:root {
  --bg: #0b0f1a;
  --surface: #151b2b;
  --elevated: #1c2438;
  --border: #28334d;
  --ink: #e8ecf5;
  --muted: #9aa4b8;
  --primary: #6344f5;
  --primary-hover: #5132e0;
  --cyan: #22d3ee;
  --gold: #f5b841;
  --white: #ffffff;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.36);
  --font-head: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

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

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.embed-shell {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.2;
  color: var(--ink);
  margin-top: 0;
}

h1 {
  font-size: 36px;
  margin-bottom: 12px;
}

h2 {
  font-size: 28px;
  margin-bottom: 16px;
}

h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

p {
  margin-top: 0;
  margin-bottom: 16px;
}

a {
  color: var(--cyan);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--gold);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* Header */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
}

.brand:hover {
  color: var(--gold);
}

.brand-crest {
  font-size: 22px;
}

.nav-toggle {
  display: none;
  background: var(--elevated);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-item {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
}

.nav-item:hover {
  background: var(--elevated);
  color: var(--cyan);
}

/* Hero Game Stage */
.stage-band {
  padding: 24px 0 48px;
  border-bottom: 1px solid var(--border);
}

.stage-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.eyebrow {
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stage-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.pill-cyan {
  background: var(--cyan);
  color: var(--bg);
}

.pill-gold {
  background: var(--gold);
  color: var(--bg);
}

.player-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-lg);
}

.game-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 360px;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
}

.game-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.game-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-overlay {
  position: relative;
  z-index: 2;
  background: rgba(11, 15, 26, 0.86);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 32px;
  text-align: center;
  max-width: 520px;
  margin: 16px;
}

.cover-kicker {
  color: var(--cyan);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 32px;
  background: var(--primary);
  color: var(--white);
  border: 0;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.btn-play:hover {
  background: var(--primary-hover);
}

.cover-sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 12px;
  margin-bottom: 0;
}

.game-loader {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg);
  z-index: 3;
}

.game-stage[data-gf-state="loading"] .game-loader {
  display: flex;
}

.loader-ring {
  width: 48px;
  height: 48px;
  border: 4px solid var(--elevated);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-label {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  background: var(--elevated);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tool-btn:hover {
  border-color: var(--cyan);
}

.tool-btn[data-gf-liked],
.tool-btn[aria-pressed="true"] {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.tool-btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.tool-btn-primary:hover {
  background: var(--primary-hover);
}

.count-badge {
  background: var(--bg);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.share-feedback {
  color: var(--cyan);
  font-size: 14px;
  font-weight: 600;
}

.ios-install-tip {
  margin-top: 12px;
  margin-bottom: 0;
  padding: 12px 16px;
  background: var(--elevated);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
}

/* Quick Jump Cards */
.quick-jump-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.jump-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.jump-card:hover {
  border-color: var(--cyan);
  color: var(--ink);
}

.jump-tag {
  align-self: flex-start;
  background: var(--elevated);
  color: var(--gold);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.jump-card strong {
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--ink);
}

.jump-card span:last-child {
  color: var(--muted);
  font-size: 14px;
}

/* Version Finder */
.finder-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

.section-lead {
  color: var(--muted);
  max-width: 70ch;
  font-size: 16px;
}

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-chip {
  min-height: 44px;
  padding: 8px 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip.is-active,
.filter-chip:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.version-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.ver-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.ver-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.ver-pkg {
  color: var(--muted);
  font-size: 12px;
  font-family: ui-monospace, Consolas, monospace;
  word-break: break-all;
}

.ver-card p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 0;
}

/* Article & Prose */
.content-section,
.subpage-wrap {
  padding: 48px 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.subpage-header {
  margin-bottom: 32px;
}

.subpage-lead {
  color: var(--muted);
  font-size: 18px;
  max-width: 70ch;
}

.subpage-cta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn-inline-play {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 24px;
  background: var(--primary);
  color: var(--white);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}

.btn-inline-play:hover {
  background: var(--primary-hover);
  color: var(--white);
}

.updated-stamp {
  color: var(--muted);
  font-size: 14px;
}

.article-figure {
  margin: 0 0 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.article-figure figcaption {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

.prose {
  max-width: 75ch;
}

.prose h2 {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose h3 {
  margin-top: 24px;
}

.prose p,
.prose li {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
}

.prose ul,
.prose ol {
  padding-left: 24px;
  margin-bottom: 24px;
}

.prose li {
  margin-bottom: 8px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.prose th {
  background: var(--elevated);
  color: var(--gold);
  font-weight: 700;
}

.prose code {
  background: var(--elevated);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
}

/* FAQ */
.faq-section,
.faq-block {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.faq-list {
  display: grid;
  gap: 16px;
  margin: 0;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.faq-item dt {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.faq-item dd {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.related-guides {
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

/* Comments */
.comments-section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.comment-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 720px;
  margin-bottom: 24px;
}

.form-row {
  margin-bottom: 12px;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-body);
  font-size: 16px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-submit {
  min-height: 44px;
  padding: 10px 24px;
  background: var(--primary);
  color: var(--white);
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-submit:hover {
  background: var(--primary-hover);
}

.btn-cancel-reply {
  min-height: 44px;
  padding: 10px 16px;
  background: var(--elevated);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.comment-status {
  color: var(--cyan);
  font-size: 14px;
}

.comments-empty-hint {
  display: none;
  color: var(--muted);
  font-size: 14px;
}

.comments-list[data-gf-empty] .comments-empty-hint {
  display: block;
}

.comment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin-bottom: 12px;
  max-width: 720px;
}

.comment-card[data-gf-owner] {
  border-color: var(--gold);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  font-size: 14px;
}

.owner-badge {
  background: var(--gold);
  color: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.comment-time,
.reply-target {
  color: var(--muted);
  font-size: 12px;
}

.comment-body {
  color: var(--ink);
  margin-bottom: 8px;
}

.reply-link {
  background: transparent;
  color: var(--cyan);
  border: 0;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.comment-replies {
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.footer-note,
.footer-contact {
  color: var(--muted);
  font-size: 14px;
}

.footer-heading {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-list li {
  margin-bottom: 8px;
}

.footer-list a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.footer-list a:hover {
  color: var(--cyan);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.disclaimer {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 22px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 0;
    border-top: 1px solid var(--border);
  }

  .nav-links.is-open {
    display: flex;
  }

  .topbar-inner {
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .player-shell {
    padding: 8px;
  }

  .game-stage {
    aspect-ratio: 4 / 5;
    min-height: 420px;
  }

  .cover-overlay {
    padding: 16px;
  }

  .btn-play {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }

  .tool-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
