*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0c0c12;
  color: #c8c8d0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

main {
  width: 100%;
  max-width: 1000px;
  padding: 2.5rem 1.5rem;
}

/* --- Header --- */

header {
  margin-bottom: 2rem;
}

h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #e8e8f0;
}

.tagline {
  margin-top: 0.75rem;
  font-family: monospace;
  font-size: 0.75rem;
  color: #555;
}

/* --- About / Dialogue --- */

.about {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 2rem;
  padding: 0.875rem;
  background: #0f0f18;
  border: 3px solid #2a2a36;
  box-shadow: inset 0 0 0 1px #0c0c12, 0 0 0 1px #0c0c12;
  position: relative;
}

.about::before,
.about::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: #7dd3fc;
}

.about::before { top: -3px; left: -3px; }
.about::after { bottom: -3px; right: -3px; }

.avatar-frame {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.avatar {
  width: 88px;
  height: 88px;
  display: block;
  image-rendering: pixelated;
  border: 2px solid #2a2a36;
}

.avatar-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: #7dd3fc;
  letter-spacing: 0.08em;
  text-shadow: 0 0 6px rgba(125, 211, 252, 0.4);
}

.dialogue {
  flex: 1;
  min-width: 0;
}

.dialogue-header {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.625rem;
  border-bottom: 2px dashed #2a2a36;
  flex-wrap: wrap;
}

.dialogue-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  color: #e8e8f0;
  letter-spacing: 0.06em;
  text-shadow: 0 0 8px rgba(232, 232, 240, 0.3);
}

.dialogue-class {
  font-family: monospace;
  font-size: 0.625rem;
  color: #666;
  letter-spacing: 0.08em;
}

.dialogue-lines {
  list-style: none;
  font-family: monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #a8a8b0;
}

.dialogue-lines li {
  position: relative;
  padding-left: 1.25rem;
}

.dialogue-lines li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: #7dd3fc;
  font-weight: 700;
}

.game-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  padding: 0 0.125rem;
}

.game-name.boom { color: #ff6b6b; text-shadow: 0 0 6px rgba(255, 107, 107, 0.4); }
.game-name.runner { color: #fbbf24; text-shadow: 0 0 6px rgba(251, 191, 36, 0.4); }
.game-name.madina { color: #7dd3fc; text-shadow: 0 0 6px rgba(125, 211, 252, 0.4); }

.cursor {
  display: inline-block;
  margin-left: 0.25rem;
  color: #7dd3fc;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.dialogue-footer {
  margin-top: 0.875rem;
}

.pixel-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  color: #0c0c12;
  background: #7dd3fc;
  padding: 0.5rem 0.75rem 0.45rem;
  border: 2px solid #7dd3fc;
  text-decoration: none;
  box-shadow: 3px 3px 0 #1a1a24;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.pixel-btn:hover {
  background: transparent;
  color: #7dd3fc;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #1a1a24;
}

.pixel-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #1a1a24;
}

.pixel-btn:focus-visible {
  outline: 2px solid #e8e8f0;
  outline-offset: 3px;
}

@media (min-width: 768px) {
  .about { padding: 1.125rem 1.25rem; gap: 1.25rem; }
  .avatar { width: 112px; height: 112px; }
  .avatar-tag { font-size: 0.5625rem; }
  .dialogue-name { font-size: 0.875rem; }
  .dialogue-lines { font-size: 0.875rem; }
  .game-name { font-size: 0.75rem; }
}

@media (max-width: 640px) {
  .about {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .avatar-frame {
    flex-direction: row;
    align-items: center;
    gap: 0.625rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px dashed #2a2a36;
  }

  .avatar {
    width: 56px;
    height: 56px;
  }

  .avatar-tag {
    font-size: 0.5rem;
  }

  .dialogue-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0.5rem;
    flex-direction: column;
    gap: 0.25rem;
  }

  .dialogue-name {
    font-size: 0.6875rem;
  }

  .dialogue-class {
    font-size: 0.5625rem;
  }

  .dialogue-lines {
    font-size: 0.75rem;
    line-height: 1.6;
  }

  .dialogue-lines li {
    padding-left: 1rem;
  }

  .game-name {
    font-size: 0.625rem;
  }
}

/* --- Game Grid --- */

.games {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .games {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
}

/* --- Cards --- */

.card {
  display: block;
  position: relative;
  background: #0f0f18;
  border: 3px solid #2a2a36;
  box-shadow: inset 0 0 0 1px #0c0c12, 0 0 0 1px #0c0c12;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent, #7dd3fc);
  z-index: 2;
}

.card::before { top: -3px; left: -3px; }
.card::after { bottom: -3px; right: -3px; }

.games .card:nth-child(1) { --accent: #ff6b6b; }
.games .card:nth-child(2) { --accent: #fbbf24; }
.games .card:nth-child(3) { --accent: #7dd3fc; }

.card:hover {
  border-color: var(--accent, #7dd3fc);
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px #0c0c12, 0 0 0 1px var(--accent, #7dd3fc), 0 0 16px rgba(125, 211, 252, 0.15);
}

.card:focus-visible {
  outline: 2px solid var(--accent, #e8e8f0);
  outline-offset: 3px;
}

/* Card image */

.card-img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0c0c12;
  border-bottom: 2px dashed #2a2a36;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.card:hover .card-img img {
  transform: scale(1.04);
}

/* Card info */

.card-info {
  padding: 1rem 1.125rem 1.25rem;
}

.card h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8125rem;
  font-weight: 400;
  color: #e8e8f0;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.8125rem;
  color: #666;
  line-height: 1.5;
}

.tag {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  color: var(--accent, #888);
  border: 1px solid var(--accent, #2a2a36);
  padding: 0.35rem 0.5rem 0.3rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 4px currentColor);
  opacity: 0.9;
}

/* --- Footer --- */

footer {
  margin-top: 2.5rem;
  text-align: center;
}

footer p {
  font-family: monospace;
  font-size: 0.6875rem;
  color: #3a3a44;
  letter-spacing: 0.03em;
}
