:root {
  --night: #0b0a1c;
  --deep: #1d1746;
  --panel: #15123a;
  --cyan: #7df9ff;
  --gold: #ffd166;
  --red: #ff4d6d;
  --text: #f2f0ff;
  --muted: rgba(242, 240, 255, 0.68);
  --line: rgba(255, 255, 255, 0.12);
  --radius: 16px;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { background: var(--night); color: var(--text); font-family: var(--font); line-height: 1.55; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse 120% 60% at 50% -10%, #241c5c 0%, var(--night) 60%) no-repeat; }
main { flex: 1; width: min(1180px, 100%); margin: 0 auto; padding: 0 20px 40px; }
a { color: var(--cyan); }
a:hover { color: #b8fcff; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* bilingual content: both languages are in the HTML; CSS shows one */
html:not([data-lang="zh"]) .lang-zh { display: none !important; }
html[data-lang="zh"] .lang-en { display: none !important; }

/* header */
.site-header { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px); background: rgba(11, 10, 28, 0.78); border-bottom: 1px solid var(--line); }
.site-header .inner { width: min(1180px, 100%); margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: 0.01em; }
.brand img { width: 36px; height: 36px; border-radius: 50%; }
.brand span b { color: var(--cyan); }
.site-nav { display: flex; gap: 18px; margin-left: auto; align-items: center; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.lang-btn { border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-weight: 700; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.lang-btn:hover { border-color: var(--cyan); }
@media (max-width: 560px) { .site-nav { gap: 12px; } .brand span { display: none; } }

/* hero */
.hero { display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: center; padding: 48px 0 36px; }
.hero img { width: 200px; height: 200px; border-radius: 50%; box-shadow: 0 0 60px rgba(125, 249, 255, 0.25); }
.hero .hi { color: var(--cyan); font-weight: 700; font-size: 18px; }
.hero h1 { font-size: clamp(30px, 5vw, 50px); line-height: 1.1; margin: 4px 0 12px; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p.sub { color: var(--muted); font-size: 17px; max-width: 40em; }
.hero .cta { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 28px; gap: 16px; }
  .hero img { width: 120px; height: 120px; margin: 0 auto; }
  .hero .cta { justify-content: center; }
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 22px; border-radius: 999px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 2px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--text); }
.btn:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.btn.primary { background: linear-gradient(180deg, #38d9e6, #1c8fb3); border-color: var(--cyan); color: #06121a; }
.btn.primary:hover { filter: brightness(1.08); color: #06121a; }

/* sections */
.section { margin-top: 36px; }
.section-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { font-size: 24px; margin-right: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 14px; padding: 4px 12px; border-radius: 999px; cursor: pointer; }
.chip[aria-pressed="true"] { color: var(--night); background: var(--cyan); border-color: var(--cyan); font-weight: 700; }
.search { min-width: 200px; flex: 0 1 260px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--text); font: inherit; }
.search:focus { outline: none; border-color: var(--cyan); }

/* game cards — auto-fill grid that stays tidy from 1 to 50+ games */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card { position: relative; display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.card:hover { transform: translateY(-3px); border-color: rgba(125, 249, 255, 0.5); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); color: var(--text); }
.card .cover { aspect-ratio: 4 / 3; width: 100%; height: auto; object-fit: cover; background: var(--deep); }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 18px; line-height: 1.25; }
.card p { color: var(--muted); font-size: 14px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: rgba(125, 249, 255, 0.1); color: var(--cyan); }
.badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.badge { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--gold); color: var(--night); }
.badge.lb { background: rgba(11, 10, 28, 0.8); color: var(--gold); border: 1px solid var(--gold); }
.empty { color: var(--muted); padding: 24px 0; }
.coming { border: 2px dashed var(--line); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 24px; min-height: 180px; }

/* weekly log */
.log { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.log h3 { font-size: 18px; margin-bottom: 6px; }
.log .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.log .stat { background: rgba(255, 255, 255, 0.04); border-radius: 12px; padding: 10px 14px; }
.log .stat span { display: block; color: var(--muted); font-size: 13px; }
.log .stat b { font-size: 22px; color: var(--gold); }
.log .note { color: var(--muted); font-size: 14px; }

/* game page */
.crumbs { padding: 18px 0 10px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.player { position: relative; width: 100%; aspect-ratio: var(--aspect, 16 / 9); max-height: calc(100vh - 140px); background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player:fullscreen { border-radius: 0; max-height: none; aspect-ratio: auto; }
@media (max-width: 700px) { .player { aspect-ratio: 3 / 4; max-height: 78vh; } }
.player-bar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin: 10px 0 0; }
.game-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; margin: 22px 0 6px; }
.game-head h1 { font-size: clamp(26px, 4vw, 38px); }
.lead { color: var(--muted); font-size: 18px; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; margin-top: 24px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 20px; margin-bottom: 10px; }
.panel p + p { margin-top: 10px; }
.controls { width: 100%; border-collapse: collapse; }
.controls td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.controls td:first-child { color: var(--muted); padding-right: 14px; width: 45%; }
.lb { width: 100%; border-collapse: collapse; font-size: 15px; }
.lb td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.lb td:first-child { color: var(--muted); width: 2.5em; }
.lb td:last-child { text-align: right; color: var(--gold); font-weight: 700; }
.muted { color: var(--muted); }

/* long-form pages */
.prose { max-width: 760px; margin: 0 auto; padding-top: 30px; }
.prose h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 16px; }
.prose h2 { font-size: 21px; margin: 26px 0 8px; }
.prose p, .prose li { color: rgba(242, 240, 255, 0.88); }
.prose ul { padding-left: 1.3em; margin: 6px 0; }
.prose li + li { margin-top: 4px; }
.prose table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--muted); font-weight: 600; }
.prose .updated { color: var(--muted); font-size: 14px; }
.about-hero { display: flex; gap: 20px; align-items: center; margin-bottom: 18px; }
.about-hero img { width: 110px; height: 110px; border-radius: 50%; }

/* reserved for later: ads and the cookie-consent banner (inactive until ads are approved) */
.ad-slot[hidden], .consent[hidden] { display: none !important; }
.ad-slot { margin: 28px auto; min-height: 90px; display: flex; align-items: center; justify-content: center; }
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20; max-width: 640px; margin: 0 auto; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }

/* footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer .inner { width: min(1180px, 100%); margin: 0 auto; padding: 22px 20px; display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.site-footer nav { display: flex; gap: 16px; margin-left: auto; }
.site-footer a { color: var(--muted); }
