:root {
  --bg: #0e0f1a;
  --bg-2: #161829;
  --surface: #1c1f35;
  --surface-2: #252945;
  --border: #2f3456;
  --text: #f1f2fb;
  --muted: #a3a8c9;
  --accent: #ff4f8b;
  --accent-2: #7c5cff;
  --accent-ink: #ffffff;
  --play: #2ee6a6;
  --play-ink: #062a1e;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Outfit", var(--font);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f6fb;
    --bg-2: #ecebf7;
    --surface: #ffffff;
    --surface-2: #f1f0fa;
    --border: #e1e0ef;
    --text: #17182b;
    --muted: #5d6080;
    --play: #13c98a;
    --play-ink: #ffffff;
    --shadow: 0 8px 24px rgba(40, 30, 90, 0.08);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 14px/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn-play { background: var(--play); color: var(--play-ink); }
.btn-play:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-disabled { background: var(--surface-2); color: var(--muted); cursor: default; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-lg svg { width: 20px; height: 20px; }

/* ---------- top bar ---------- */
.btn-sm { padding: 7px 14px; font-size: 13px; }
.topbar {
  background:
    radial-gradient(600px 200px at 90% -40%, color-mix(in srgb, var(--accent-2) 30%, transparent), transparent 70%),
    var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { min-width: 0; }
.brand h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.brand .tagline { margin: 2px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.top-links { display: flex; gap: 8px; flex: none; }
.contact { position: relative; }
.contact-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; width: max-content; max-width: calc(100vw - 24px);
  padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.contact-label { margin: 0; color: var(--muted); font-size: 12px; }
.contact-email { margin: 2px 0 12px; font-weight: 600; user-select: all; word-break: break-all; }
.contact-actions { display: flex; gap: 8px; }
.contact-actions .btn { flex: 1; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.chips { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; min-width: 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); font: 500 14px var(--font); cursor: pointer;
}
.chip span { color: var(--muted); font-size: 12px; margin-left: 2px; }
.chip:hover { border-color: var(--muted); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.is-active span { color: inherit; opacity: .8; }

/* ---------- grid / cards ---------- */
.grid {
  list-style: none; padding: 0; margin: 0 0 64px;
  display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent-2) 50%, var(--border)); }
.card-thumb { position: relative; display: block; aspect-ratio: var(--thumb-aspect); background: var(--surface-2); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-thumb img { transform: scale(1.04); }
.thumb-fallback {
  display: grid; place-items: center; width: 100%; height: 100%;
  font: 800 64px var(--display); color: var(--muted);
  background: linear-gradient(135deg, var(--surface-2), var(--bg-2));
}
.badge {
  position: absolute; padding: 3px 10px; border-radius: 999px;
  font: 600 11px/1.6 var(--font); letter-spacing: .02em;
  background: rgba(10, 10, 20, .72); color: #fff; backdrop-filter: blur(6px);
}
.badge-status { top: 10px; left: 10px; background: var(--accent); }
.badge-platforms { bottom: 10px; right: 10px; }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 18px; flex: 1; }
.card-title { font-size: 20px; font-weight: 700; }
.card-title a { text-decoration: none; }
.card-desc {
  margin: 0; color: var(--muted); font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: color-mix(in srgb, var(--accent-2) 70%, var(--text));
}
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.card-actions .btn { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 48px 0 80px; }

/* ---------- detail page ---------- */
.detail { padding-top: 28px; padding-bottom: 64px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 22px; font-weight: 500; }
.back:hover { color: var(--text); }
.detail-top { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
.detail-media {
  aspect-ratio: var(--thumb-aspect); border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); box-shadow: var(--shadow); border: 1px solid var(--border);
}
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { display: flex; flex-direction: column; gap: 16px; }
.detail-info h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 800; letter-spacing: -0.02em; }
.detail-info .tagline { margin: 0; font-size: 19px; color: var(--muted); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.extra-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.extra-links a { color: var(--accent); font-weight: 600; text-decoration: none; }
.extra-links a:hover { text-decoration: underline; }
.details {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; margin: 6px 0 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.details div { padding: 12px 14px; outline: 1px solid var(--border); }
.details dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.details dd { margin: 2px 0 0; font-weight: 600; }

.section { margin-top: 48px; }
.section h2 { font-size: 24px; margin-bottom: 14px; }
.prose { max-width: 72ch; }
.prose p { margin: 0 0 14px; color: color-mix(in srgb, var(--text) 85%, var(--muted)); }
.prose ul { margin: 0; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.notes {
  max-width: none; padding: 20px 24px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
}
.notes p:last-child { margin-bottom: 0; }

.embed {
  position: relative; display: grid; place-items: center; width: 100%;
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(circle at center, var(--surface-2), var(--bg-2)); border: 1px solid var(--border);
}
.embed[data-orientation="portrait"] { aspect-ratio: 9 / 16; max-width: 420px; margin: 0 auto; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.shots { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.shots a { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.shots img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.shots a:hover img { transform: scale(1.03); }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a { color: var(--muted); text-decoration: none; font-weight: 500; }
.pager a:hover { color: var(--text); }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.footer-about { flex-basis: 100%; margin-bottom: 8px; }
.footer-about p { margin: 0 0 6px; max-width: 62ch; }
.site-footer a { color: var(--muted); }

@media (max-width: 760px) {
  .wrap { padding: 0 12px; }
  .topbar-inner { padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .brand h1 { font-size: 21px; }
  .brand .tagline { font-size: 12.5px; }
  .hide-sm { display: none; }
  .top-links .btn-sm { padding: 8px; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 8px; margin: 10px 0 12px; }
    .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; padding: 0 12px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; padding: 5px 12px; font-size: 13px; }
  .detail-top { grid-template-columns: 1fr; }

  /* Two cards per row so several games fit on the first screen. */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { border-radius: 14px; }
  .card-body { padding: 10px 10px 12px; gap: 6px; }
  .card-title { font-size: 15px; }
  .card-desc { font-size: 12.5px; line-height: 1.45; -webkit-line-clamp: 2; }
  .card .tags, .card .btn-ghost, .badge-platforms { display: none; }
  .card-actions { padding-top: 4px; }
  .card-actions .btn { padding: 7px 10px; font-size: 13px; }
  .badge { font-size: 10px; padding: 2px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
