/* ============================================================
   Design tokens — retro terminal
   ============================================================ */
:root {
  --bg: #06090A;
  --bg-raised: #0C1210;
  --bg-raised-2: #101A16;
  --line: #1E3227;
  --line-bright: #2C4C39;
  --text: #C9F5D6;
  --text-dim: #5E8A70;
  --accent: #3DFF7A;
  --accent-dim: #2AC061;
  --accent-glow: rgba(61, 255, 122, 0.28);
  --radius: 3px;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(61, 255, 122, 0.025) 0px,
      rgba(61, 255, 122, 0.025) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(ellipse 900px 500px at 20% -10%, rgba(61, 255, 122, 0.07), transparent 60%);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--accent);
  color: #06090A;
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--accent);
  margin-left: 6px;
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}

/* ============================================================
   Layout shell
   ============================================================ */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

header.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(6, 9, 10, 0.92);
  backdrop-filter: blur(6px);
  z-index: 40;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
}

.logo {
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  color: var(--accent);
}

.logo .prompt {
  color: var(--text-dim);
  margin-right: 2px;
}

.search-box {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.search-box::before {
  content: ">";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 14px;
}

.search-box input {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 14px 9px 30px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.search-box input:focus {
  border-color: var(--accent-dim);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 48px 0 20px;
}

.hero .eyebrow {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 10px;
}

.hero h1 {
  font-weight: 600;
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.15;
  margin: 0 0 12px;
  max-width: 780px;
  letter-spacing: -0.2px;
}

.hero p {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 560px;
  margin: 0;
}

/* ============================================================
   Category pills
   ============================================================ */
.category-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 22px 0 8px;
}

.pill {
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.pill::before {
  content: "[ ";
  color: var(--line-bright);
}

.pill::after {
  content: " ]";
  color: var(--line-bright);
}

.pill:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

.pill.active {
  color: var(--accent);
  border-color: var(--accent);
}

.pill.active::before,
.pill.active::after {
  color: var(--accent);
}

/* ============================================================
   Game grid
   ============================================================ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  padding: 22px 0 64px;
}

.game-card {
  display: block;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.game-card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 12px 26px -14px var(--accent-glow);
}

.game-thumb {
  aspect-ratio: 4 / 3;
  background: var(--bg-raised-2);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.85) contrast(1.05);
}

.game-thumb .fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  padding: 10px;
}

.game-info {
  padding: 10px 12px 12px;
}

.game-title {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.game-tag {
  font-size: 12px;
  color: var(--accent-dim);
}

.game-tag::before {
  content: "# ";
  color: var(--line-bright);
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-dim);
  grid-column: 1 / -1;
}

.empty-state strong {
  color: var(--text);
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

/* ============================================================
   Game page
   ============================================================ */
.player-page .wrap {
  padding-top: 20px;
  padding-bottom: 40px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 16px;
}

.back-link:hover {
  color: var(--accent);
}

.player-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.player-head h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text);
}

.player-head .game-tag {
  font-size: 13px;
}

.player-actions {
  display: flex;
  gap: 10px;
}

.btn {
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent-dim);
}

.btn.primary {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.btn.primary:hover {
  border-color: var(--accent);
}

.frame-shell {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}

.frame-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.missing-game {
  padding: 80px 20px;
  text-align: center;
  color: var(--text-dim);
}

.missing-game strong {
  display: block;
  color: var(--text);
  font-size: 20px;
  margin-bottom: 8px;
}

.missing-game code {
  background: var(--bg-raised);
  padding: 2px 8px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--accent-dim);
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  color: var(--text-dim);
  font-size: 12.5px;
}

@media (max-width: 600px) {
  .header-row {
    flex-wrap: wrap;
  }
  .search-box {
    order: 3;
    max-width: none;
    width: 100%;
  }
}
