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

:root {
  --bg:        #0e1016;
  --bg-2:      #13151f;
  --panel:     #1a1d28;
  --border:    rgba(255,255,255,0.07);
  --text:      #e8eaf0;
  --muted:     #8890a8;
  --accent:    #ff4d6d;
  --accent-2:  #00c9a7;
  --accent-3:  #ffc947;
  --cw:        160px;
  --ch:        128px;
  --gap:       10px;
  --site-max:  1760px;
  --sidebar-w: 200px;
  --sidebar-collapsed: 48px;
  --header-h:  60px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: rgba(14, 16, 22, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 12px;
}

.logo {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo span { color: var(--accent); }

.top-nav { display: none; }

.header-search {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
  width: 250px;
}
.search-svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}
.header-search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s;
}
.header-search input:focus { border-color: rgba(255,77,109,0.6); }
.header-search input::placeholder { color: var(--muted); }
.header-search.is-open input {
  border-color: rgba(255,77,109,0.65);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.header-search-panel {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  max-height: min(70vh, 420px);
  overflow-y: auto;
  padding: 8px;
  background: rgba(19, 21, 31, 0.98);
  border: 1px solid rgba(255,77,109,0.35);
  border-top: 0;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  box-shadow: 0 22px 44px rgba(0,0,0,0.42);
  display: grid;
  gap: 6px;
  z-index: 250;
}
.header-search-panel[hidden] {
  display: none !important;
}
.header-search-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 6px;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.header-search-item:hover {
  background: rgba(255,255,255,0.06);
}
.header-search-thumb {
  width: 52px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: #111;
}
.header-search-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.header-search-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.header-search-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
}
.header-search-item .badge {
  position: static;
  top: auto;
  left: auto;
  z-index: auto;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  flex-shrink: 0;
}
.header-search-meta,
.header-search-empty {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}
.header-search-empty {
  padding: 8px 10px;
}

/* ── Layout ── */
.page-wrap {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 12px 0 calc(var(--sidebar-collapsed) + 12px);
}
body.is-theater-mode {
  overflow: hidden;
}
body.is-theater-mode .site-header,
body.is-theater-mode .sidebar,
body.is-theater-mode .site-footer,
body.is-theater-mode .game-tags,
body.is-theater-mode .embed-share-panel,
body.is-theater-mode .game-article,
body.is-theater-mode .game-row {
  display: none !important;
}
body.is-theater-mode .page-wrap {
  max-width: none;
  padding: 0;
}
body.is-theater-mode .main-content {
  padding: 0;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  left: 0;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  width: var(--sidebar-collapsed);
  padding: 8px 6px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  transition: width 0.22s ease;
  z-index: 200;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar:hover { width: var(--sidebar-w); }

.cat-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cat-list a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.cat-list a:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.cat-special a { color: var(--text); font-weight: 600; }
.cat-icon { font-size: 1.1rem; line-height: 1; flex-shrink: 0; }
.cat-label { opacity: 0; width: 0; overflow: hidden; white-space: nowrap; transition: opacity 0.18s, width 0.22s; }
.cat-divider { height: 1px; background: var(--border); margin: 8px 6px; }
.cat-list a { padding: 9px 8px; justify-content: center; gap: 0; }

/* expanded on hover */
.sidebar:hover .cat-label { opacity: 1; width: auto; }
.sidebar:hover .cat-divider { margin: 8px 10px; }
.sidebar:hover .cat-list a { padding: 9px 10px; justify-content: flex-start; gap: 9px; }

/* ── Main content ── */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 16px 0 48px 0;
}

/* ── Game row ── */
.game-row { margin-bottom: 32px; }

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.row-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.row-controls { display: flex; gap: 6px; }

.row-arrow {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.row-arrow:hover { color: var(--text); background: rgba(255,255,255,0.1); }

.row-scroll {
  display: grid;
  grid-template-rows: repeat(2, var(--ch));
  grid-auto-flow: column;
  grid-auto-columns: var(--cw);
  gap: var(--gap);
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--panel) transparent;
}
.row-scroll::-webkit-scrollbar { height: 3px; }
.row-scroll::-webkit-scrollbar-track { background: transparent; }
.row-scroll::-webkit-scrollbar-thumb { background: var(--panel); border-radius: 2px; }

/* ── Game card (shared) ── */
.game-card {
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  transition: transform 0.18s, border-color 0.15s, box-shadow 0.18s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 14px 36px rgba(0,0,0,0.5);
}

/* small card — 1×1 grid cell */
/* width/height come from the grid; explicit only for outside-grid use */
.card-small { width: var(--cw); }

/* large card — spans 2 rows × 2 columns; exactly 4 small cards */
.row-scroll .card-large {
  grid-row: span 2;
  grid-column: span 2;
}

.card-img {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: #111;
  overflow: hidden;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.22s;
  display: block;
}
.game-card:hover .card-img img { transform: scale(1.06); }

/* gradient title overlay — large cards only */
.card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 36px 10px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.86) 0%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}
.card-overlay-title {
  display: block;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
}

/* video preview layer — sits between img (z:0) and badge/overlay (z:2) */
.card-video-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
/* suppress img zoom when video is active */
.game-card.is-previewing .card-img img { transform: none !important; }

.badge {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  z-index: 2;
}
.badge-hot      { background: var(--accent);   color: #fff; }
.badge-trending { background: var(--accent-3); color: #000; }
.badge-new      { background: var(--accent-2); color: #000; }

/* title below image — small cards only */
.card-title {
  padding: 7px 9px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

/* ── Search results ── */
.search-results-section { margin-bottom: 32px; }

.search-results-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.category-hero {
  margin-bottom: 18px;
  padding: 14px 6px 4px;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  border: 0;
  border-radius: 0;
}
.category-hero h1 {
  margin-top: 0;
  font-size: clamp(1.55rem, 2.1vw, 2.1rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}
.category-grid-section {
  margin-bottom: 24px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.category-card-grid {
  --category-grid-gap: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cw), var(--cw)));
  grid-auto-rows: var(--ch);
  grid-auto-flow: dense;
  justify-content: flex-start;
  gap: var(--category-grid-gap);
}
.category-card-grid .game-card {
  width: var(--cw);
  height: var(--ch);
}
.category-card-grid .card-large {
  grid-column: span 2;
  grid-row: span 2;
  width: calc((var(--cw) * 2) + var(--category-grid-gap));
  height: calc((var(--ch) * 2) + var(--category-grid-gap));
}
.category-card-grid .card-img {
  height: calc(var(--ch) - 28px);
}
.category-card-grid .card-large .card-img {
  height: calc(((var(--ch) * 2) + var(--category-grid-gap)) - 28px);
}
/* search results: outside row-scroll grid, need explicit size */
.search-results-grid .game-card {
  width: var(--cw);
  height: var(--ch);
}
.search-results-grid .card-img { height: calc(var(--ch) - 28px); }

/* ── SEO block ── */
.seo-block {
  margin-top: 40px;
  padding: 24px 28px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.seo-block h2 { font-size: 1.25rem; margin-bottom: 12px; color: var(--text); }
.seo-block h3 { font-size: 1rem; color: var(--accent-2); margin: 22px 0 8px; }
.seo-block p  { color: #b8bdd0; line-height: 1.8; font-size: 0.92rem; margin-bottom: 10px; }
.seo-block ul { color: #b8bdd0; line-height: 1.8; font-size: 0.92rem; padding-left: 1.4em; margin: 6px 0; }
.seo-block ul li { margin-bottom: 6px; }
.seo-block a { color: var(--accent-2); text-decoration: none; }
.seo-block a:hover { text-decoration: underline; }

/* ── 404 page ── */
.error-page-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 26px 0 48px;
}
.error-shell {
  padding: 28px 30px 30px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
.error-code {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent-2);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.error-shell h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}
.error-shell p {
  max-width: 700px;
  margin-top: 14px;
  color: #b8bdd0;
  font-size: 0.96rem;
  line-height: 1.8;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}
.error-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.error-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
}
.error-btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: #081710;
}
.error-btn-primary:hover {
  background: #77f2c4;
}
.error-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.error-link-card {
  padding: 16px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.error-link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
}
.error-link-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.94rem;
}
.error-link-card span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding: 26px 20px 28px;
  background: var(--bg-2);
}
.footer-inner {
  max-width: var(--site-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 18px 36px;
  align-items: start;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-logo { font-size: 1.35rem; font-weight: 800; }
.footer-logo span { color: var(--accent); }
.footer-tagline { color: var(--muted); font-size: 0.88rem; }
.footer-meta {
  display: grid;
  gap: 14px;
  align-content: start;
}
.footer-legal-note {
  color: #b8bdd0;
  font-size: 0.9rem;
  line-height: 1.5;
}
.footer-legal-note strong { color: var(--accent-2); }
.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}
.footer-legal-links a {
  color: var(--text);
  font-size: 0.88rem;
  transition: color 0.15s, opacity 0.15s;
}
.footer-legal-links a:hover {
  color: var(--accent-2);
  opacity: 1;
}
.footer-copy {
  color: var(--muted);
  font-size: 0.8rem;
}

.page-wrap-legal {
  padding-left: 12px;
}
.legal-page {
  padding-top: 26px;
  padding-bottom: 48px;
}
.legal-main {
  max-width: 980px;
  margin: 0 auto;
}
.legal-hero {
  margin-bottom: 20px;
}
.legal-kicker {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.legal-hero h1 {
  margin-top: 16px;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
}
.legal-lead {
  margin-top: 14px;
  max-width: 760px;
  font-size: 1rem;
  line-height: 1.8;
  color: #b8bdd0;
}
.legal-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
.legal-card + .legal-card { margin-top: 16px; }
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.84rem;
}
.legal-card h2 {
  margin: 22px 0 10px;
  font-size: 1.1rem;
  color: var(--text);
}
.legal-card h2:first-of-type { margin-top: 0; }
.legal-card p,
.legal-card li,
.legal-card address {
  color: #b8bdd0;
  font-size: 0.94rem;
  line-height: 1.85;
}
.legal-card ul,
.legal-card ol {
  margin: 8px 0 14px;
  padding-left: 1.4em;
}
.legal-card li + li { margin-top: 4px; }
.legal-card a { color: var(--accent-2); }
.legal-card a:hover { text-decoration: underline; }
.legal-card address { font-style: normal; }
.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.legal-callout {
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}
.legal-callout strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .page-wrap { padding-left: 20px; }
  :root { --cw: 130px; --ch: 104px; }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .error-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-legal-links {
    gap: 12px 18px;
  }
  .legal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  :root { --cw: 110px; --ch: 88px; }
  .header-search { width: 150px; }
  .header-search-panel {
    left: auto;
    right: 0;
    width: min(86vw, 300px);
  }
  .logo { font-size: 1.2rem; }
  .category-hero {
    padding: 8px 2px 2px;
  }
  .category-grid-section {
    padding: 0;
  }
  .category-card-grid {
    --category-grid-gap: 12px;
  }
  .error-page-main {
    padding-top: 18px;
    padding-bottom: 32px;
  }
  .error-shell {
    padding: 22px 16px 18px;
    border-radius: 14px;
  }
  .error-actions {
    gap: 10px;
  }
  .error-btn {
    width: 100%;
    min-width: 0;
  }
  .error-links {
    grid-template-columns: 1fr;
  }
  .legal-page {
    padding-top: 18px;
    padding-bottom: 32px;
  }
  .legal-card {
    padding: 20px 16px;
    border-radius: 14px;
  }
  .footer-legal-note,
  .footer-legal-links a {
    font-size: 0.84rem;
  }
  .footer-legal-links {
    gap: 10px 14px;
  }
}

/* ════════════════════════════════
   Game Detail Page
   ════════════════════════════════ */

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--text); }
.bc-sep {
  color: rgba(255,255,255,0.34);
  font-weight: 700;
  letter-spacing: 0.04em;
  user-select: none;
}
.bc-current { color: var(--text); }

/* Unified player grid: cards auto-flow around the player and continue below */
.game-frame-area {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 6px;
  align-items: start;
  margin-bottom: 14px;
}

.frame-side-card {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  transition: border-color 0.15s, transform 0.14s;
  flex-shrink: 0;
}
.frame-side-card:hover {
  border-color: rgba(255,255,255,0.22);
  transform: scale(1.04);
}
.frame-side-card img {
  width: 100%;
  aspect-ratio: 218 / 142;
  object-fit: cover;
  display: block;
}
.frame-side-card-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 10px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  background: linear-gradient(to top, rgba(9,11,17,0.92), rgba(9,11,17,0.5), transparent);
  opacity: 0.82;
  z-index: 2;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.frame-side-card:hover .frame-side-card-name { opacity: 1; }

/* two-column fallback kept for possible future use */
.game-layout {
  display: grid;
  grid-template-columns: 1fr 264px;
  gap: 24px;
  align-items: start;
}

/* Title row */
.game-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.game-page-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
}

/* Player card */
.game-player-card {
  grid-column: 3 / span 5;
  grid-row: 1 / span 4;
  width: 100%;
  max-width: none;
  justify-self: stretch;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.game-player-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.game-player-card-header .game-page-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Title inside ctrl bar */
.game-ctrl-bar .game-page-title {
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}

/* Iframe player */
.game-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.game-player-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.game-frame-area.is-theater {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 0;
}
.game-frame-area.is-theater .frame-side-card {
  display: none;
}
.game-player-card.is-theater {
  position: fixed;
  inset: 0;
  z-index: 500;
  grid-column: 1 / -1;
  grid-row: auto;
  border-radius: 0;
  border: 0;
}
/* theater mode expands the player and removes surrounding distractions */
.game-player-wrap.is-theater {
  aspect-ratio: unset;
  height: calc(100vh - 52px);
}

/* Control bar */
.game-ctrl-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.game-ctrl-bar::-webkit-scrollbar { display: none; }
.ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
  user-select: none;
}
.ctrl-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.07); }
.ctrl-btn.is-active { color: var(--accent); border-color: var(--accent); }
.ctrl-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.ctrl-btn-like.liked { color: var(--accent); border-color: var(--accent); }
.ctrl-bar-spacer { flex: 1; }
.ctrl-like-count { font-size: 0.78rem; color: var(--muted); margin-left: 2px; }

/* Tags row */
.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}
.game-tag {
  display: inline-block;
  padding: 4px 13px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s;
}
.game-tag:hover { color: var(--text); border-color: rgba(255,255,255,0.22); }

/* Embed share panel */
.embed-share-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 18px;
}
.embed-share-row + .embed-share-row {
  margin-top: 10px;
}
.embed-share-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.embed-share-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0;
}
.embed-share-field-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: min(100%, 1120px);
  justify-self: start;
}
.embed-share-field {
  width: 100%;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0b4837;
  color: #f2f6f9;
  font-size: 0.88rem;
  line-height: 1.3;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.embed-share-field[readonly] {
  cursor: text;
}
.embed-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0b4837;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.embed-copy-btn:hover {
  background: #10614a;
  border-color: rgba(255,255,255,0.22);
}
.embed-copy-btn.is-copied {
  background: var(--accent);
  border-color: var(--accent);
  color: #08110e;
}

/* Article */
.game-article {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 30px;
}
.game-article .breadcrumb {
  margin-bottom: 18px;
}
.game-article .breadcrumb + h2 {
  margin-top: 0;
}
.game-article h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 26px 0 10px;
}
.game-article h2:first-child { margin-top: 0; }
.game-article h3 {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--accent-2);
  margin: 18px 0 8px;
}
.game-article p {
  font-size: 0.92rem;
  line-height: 1.8;
  color: #b8bdd0;
  margin-bottom: 10px;
}
.game-article ul, .game-article ol {
  font-size: 0.92rem;
  line-height: 1.8;
  color: #b8bdd0;
  padding-left: 1.5em;
  margin: 6px 0 12px;
}
.game-article li { margin-bottom: 4px; }
.game-article a { color: var(--accent-2); }
.game-article a:hover { text-decoration: underline; }

/* Controls table */
.ctrl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 10px 0 14px;
}
.ctrl-table th {
  background: var(--panel);
  padding: 8px 14px;
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.ctrl-table td {
  padding: 8px 14px;
  color: #b8bdd0;
  border-bottom: 1px solid var(--border);
}
.ctrl-table tr:last-child td { border-bottom: none; }
.ctrl-table code {
  background: var(--panel);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  color: var(--accent-3);
  font-size: 0.85rem;
}

/* FAQ */
.faq-item { margin-bottom: 18px; }
.faq-q {
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}
.faq-a {
  font-size: 0.88rem;
  color: #b8bdd0;
  line-height: 1.75;
}

/* Right panel */
.game-right-panel {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--panel) transparent;
}
.game-right-panel::-webkit-scrollbar { width: 3px; }
.game-right-panel::-webkit-scrollbar-thumb { background: var(--panel); border-radius: 2px; }
.panel-heading + .panel-heading,
.related-card + .panel-heading { margin-top: 20px; }
.panel-heading {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 12px;
}
.related-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: border-color 0.15s, transform 0.12s;
}
.related-card:hover {
  border-color: rgba(255,255,255,0.18);
  transform: translateX(3px);
}
.related-card img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.related-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 3px;
}
.related-cat {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 1100px) {
  .game-layout { grid-template-columns: 1fr 220px; }
  .game-frame-area { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .game-layout { grid-template-columns: 1fr; }
  .game-right-panel { display: none; }
  .game-player-wrap { min-height: 300px; }
  .game-frame-area {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
  }
  .game-player-card {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .game-ctrl-bar {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .game-player-wrap.is-theater {
    height: calc(100vh - 94px);
  }
}
@media (max-width: 600px) {
  .game-frame-area { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-wrap { padding-left: 12px; }
  .embed-share-row {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
  }
  .embed-share-field-wrap {
    gap: 8px;
    width: 100%;
  }
  .embed-share-field {
    padding: 11px 14px;
    font-size: 0.84rem;
  }
  .embed-copy-btn {
    min-width: 72px;
    padding: 11px 12px;
    font-size: 0.84rem;
  }
  .game-article { padding: 18px 20px; }
  .game-page-title { font-size: 1.3rem; }
}