:root {
  color-scheme: light;
  --bg: #f7f3ed;
  --surface: rgba(255, 252, 247, .78);
  --surface-strong: #fffaf3;
  --ink: #312b2b;
  --ink-soft: #6d6460;
  --ink-muted: #857972;
  --line: rgba(64, 52, 47, .12);
  --coral: #ed8f76;
  --coral-deep: #c95f56;
  --blue: #8caac2;
  --shadow: rgba(83, 59, 48, .10);
  --board: #eeeae2;
  --grid: rgba(64, 52, 47, .13);
  --snake: #6a8796;
  --snake-head: #405d6c;
  --food: #c95f56;
  --eye: #fffaf3;
  --serif: Georgia, "Noto Serif SC", "Songti SC", "STSong", serif;
  font-family: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1d25;
  --surface: rgba(36, 41, 52, .82);
  --surface-strong: #242934;
  --ink: #f4e9df;
  --ink-soft: #c6b9b0;
  --ink-muted: #a49790;
  --line: rgba(244, 233, 223, .12);
  --coral: #e78c74;
  --coral-deep: #ffad91;
  --blue: #88a9c2;
  --shadow: rgba(0, 0, 0, .23);
  --board: #202630;
  --grid: rgba(244, 233, 223, .14);
  --snake: #88a9c2;
  --snake-head: #bfd4e1;
  --food: #ffad91;
  --eye: #242934;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .45; background-image: radial-gradient(var(--grid) .6px, transparent .6px); background-size: 6px 6px; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .45; }
button, a { color: inherit; }
a { text-decoration: none; }
button:focus-visible, a:focus-visible, .board:focus-visible { outline: 3px solid var(--coral-deep); outline-offset: 5px; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ambient { position: fixed; z-index: 0; pointer-events: none; width: 400px; height: 400px; border-radius: 50%; filter: blur(85px); opacity: .18; }
.ambient-coral { top: 120px; left: -220px; background: var(--coral); }
.ambient-blue { top: 160px; right: -220px; background: var(--blue); }
.page-frame { position: relative; max-width: 1240px; width: calc(100% - 80px); margin: auto; padding: 26px 0 24px; }
.site-header { display: flex; align-items: center; gap: 28px; padding: 13px 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 14px 44px var(--shadow); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 11px; font-size: 1.25rem; font-weight: 750; letter-spacing: -.055em; }
.brand img { display: block; border-radius: 14px; box-shadow: 0 7px 14px rgba(201, 95, 86, .18); }
.brand-blog { margin-left: 5px; font-size: .64rem; font-weight: 500; letter-spacing: .10em; color: var(--ink-soft); }
.header-note { font-size: .6rem; letter-spacing: .18em; color: var(--ink-muted); margin-left: 12px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.status-pill { display: flex; align-items: center; gap: 8px; font-size: .73rem; color: var(--ink-soft); }
.status-dot { width: 6px; height: 6px; background: var(--coral-deep); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 16%, transparent); }
.theme-button { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-strong); }
.theme-button:hover { color: var(--coral-deep); }
.moon { display: none; }
[data-theme="dark"] .sun { display: none; }
[data-theme="dark"] .moon { display: block; }
.main-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 90px); align-items: center; padding: 76px 34px 70px; }
.eyebrow { margin: 0; color: var(--coral-deep); font-size: .60rem; font-weight: 650; letter-spacing: .18em; line-height: 1.8; }
.countdown-section > .eyebrow { display: flex; align-items: center; gap: 10px; }
.tiny-line { width: 22px; height: 1px; background: var(--coral-deep); }
h1 { margin: 27px 0 23px; font-family: var(--serif); font-size: clamp(3.4rem, 5.4vw, 5rem); font-weight: 400; line-height: 1.22; letter-spacing: -.055em; }
h1 em { color: var(--coral-deep); font-style: normal; }
.hero-description { color: var(--ink-soft); font-size: .92rem; line-height: 2; margin: 0 0 38px; }
.countdown-heading { display: flex; justify-content: space-between; align-items: center; color: var(--ink-soft); font-size: .74rem; margin-bottom: 16px; }
.small-star { color: var(--coral-deep); font-size: 1.35rem; }
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 21px 0 23px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.time-unit { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.time-unit + .time-unit { border-left: 1px solid var(--line); }
.time-value { font-size: clamp(2.3rem, 4vw, 3.6rem); font-weight: 400; letter-spacing: -.07em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.time-unit:first-child .time-value { color: var(--coral-deep); }
.time-label { font-size: .69rem; color: var(--ink-soft); }
.time-label small { display: block; font-size: .47rem; letter-spacing: .12em; color: var(--ink-muted); text-align: center; margin-top: 5px; }
.launch-date { display: flex; gap: 10px; align-items: center; margin-top: 19px; color: var(--ink-soft); font-size: .72rem; flex-wrap: wrap; }
.launch-date svg { width: 15px; height: 15px; color: var(--coral-deep); }
.launch-date time { letter-spacing: .04em; }
.launch-date time span { margin-left: 6px; }
.timezone { font-size: .61rem; color: var(--ink-muted); margin-left: auto; }
.waiting-note { margin: 35px 0 0; color: var(--ink-muted); font-size: .72rem; }
.waiting-note span { display: inline-block; margin-right: 6px; color: var(--coral-deep); }
.game-card { padding: 25px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: 0 18px 50px var(--shadow); }
.game-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.game-heading .eyebrow { font-size: .50rem; letter-spacing: .14em; }
h2 { font-family: var(--serif); font-size: 1.55rem; font-weight: 400; letter-spacing: -.04em; margin: 5px 0 0; }
.game-tag { padding: 7px 9px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink-muted); font-size: .5rem; letter-spacing: .1em; white-space: nowrap; }
.scorebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 24px 0 12px; font-size: .65rem; color: var(--ink-soft); }
.game-state { display: flex; align-items: center; gap: 6px; }
.game-state i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-muted); }
.game-state i[data-running="true"] { background: var(--coral-deep); }
.scores { display: flex; gap: 18px; }
.scores strong { margin-left: 6px; color: var(--ink); font-size: .95rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.board { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--board); }
canvas { display: block; width: 100%; height: 100%; }
.game-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--board) 42%, transparent); }
.game-overlay[hidden] { display: none; }
.overlay-copy { text-align: center; padding: 24px 12px; width: 100%; background: color-mix(in srgb, var(--surface-strong) 85%, transparent); backdrop-filter: blur(5px); border-block: 1px solid var(--line); }
.overlay-kicker { color: var(--coral-deep); font-size: .5rem; letter-spacing: .21em; }
h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 400; margin: 11px 0; letter-spacing: -.04em; }
.overlay-copy p { font-size: .72rem; color: var(--ink-soft); margin: 0 0 20px; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 24px; padding: 12px 20px; border: 0; border-radius: 999px; font-size: .76rem; font-weight: 650; background: #c95f56; color: #fffaf3; box-shadow: 0 8px 18px rgba(201, 95, 86, .18); transition: transform .2s ease; }
.primary-button:hover { transform: translateY(-2px); background: #b44f47; }
.overlay-hint { display: block; font-size: .59rem; margin-top: 13px; color: var(--ink-muted); }
.game-instructions { margin-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-soft); font-size: .59rem; }
.keyboard-hint { display: flex; align-items: center; gap: 3px; }
kbd { display: inline-grid; place-items: center; min-width: 19px; height: 20px; background: var(--surface-strong); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; font: inherit; color: var(--ink-soft); }
kbd.space-key { padding: 0 6px; margin-left: 7px; }
.pause-button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: .62rem; color: var(--ink-soft); background: var(--surface-strong); min-height: 30px; }
.touch-controls, .touch-hint { display: none; }
.game-footnote { text-align: center; margin: 18px 0 0; font-size: .63rem; color: var(--ink-muted); }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 34px 0; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: .62rem; }
.site-footer > div { display: flex; gap: 18px; align-items: center; }
.footer-brand { letter-spacing: .15em; color: var(--coral-deep); font-size: .58rem; }
.site-footer p { margin: 0; font-size: .55rem; letter-spacing: .07em; line-height: 1.7; }
.footer-separator { margin: 0 9px; color: var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.noscript-note { position: relative; padding: 20px; text-align: center; color: var(--coral-deep); }
@media (max-width: 1100px) {
  .page-frame { width: calc(100% - 48px); }
  .main-grid { padding: 60px 10px; gap: 36px; }
  .game-card { padding: 20px; }
  .header-note { font-size: .5rem; }
  .game-tag { display: none; }
}
/* 桌面端同时按窗口宽、高分配空间，棋盘保持正方形，内容不裁切。 */
@media (min-width: 821px) and (pointer: fine) {
  .page-frame { min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; padding-block: clamp(12px, 2svh, 22px); }
  .site-header { padding-block: 10px; }
  .main-grid { min-height: 0; gap: clamp(30px, 5vw, 72px); padding-block: clamp(12px, 2.5svh, 24px); }
  .countdown-section { width: 100%; max-width: 510px; }
  h1 { margin: 20px 0 18px; font-size: clamp(2.4rem, 7svh, 4.5rem); line-height: 1.14; }
  .hero-description { font-size: .85rem; line-height: 1.8; margin-bottom: 24px; }
  .countdown-heading { margin-bottom: 10px; }
  .countdown { padding-block: 15px; }
  .time-value { font-size: clamp(2.4rem, 5.6svh, 3.3rem); }
  .launch-date { margin-top: 14px; }
  .waiting-note { margin-top: 20px; }
  .game-card { width: min(100%, calc(clamp(232px, 100svh - 365px, 400px) + 38px)); justify-self: center; padding: 18px; border-radius: 22px; }
  h2 { font-size: 1.35rem; }
  .scorebar { margin: 14px 0 10px; }
  .game-instructions { margin-top: 10px; }
  .game-footnote { margin-top: 12px; }
  .site-footer { padding-top: 14px; }
}
@media (min-width: 821px) and (pointer: fine) and (max-height: 700px) {
  h1 { margin: 14px 0 12px; font-size: clamp(2.2rem, 6.4svh, 2.9rem); line-height: 1.1; }
  .hero-description { font-size: .8rem; line-height: 1.7; margin-bottom: 17px; }
  .countdown-heading { margin-bottom: 8px; }
  .countdown { padding-block: 12px; }
  .time-value { font-size: 2.6rem; }
  .launch-date { margin-top: 12px; }
  .waiting-note, .game-footnote { display: none; }
  .scorebar { margin-top: 10px; }
  .overlay-copy { padding-block: 16px; }
  h3 { margin-block: 8px; font-size: 1.3rem; }
  .overlay-copy p { margin-bottom: 14px; }
  .overlay-hint { margin-top: 10px; }
}
@media (min-width: 821px) and (pointer: fine) and (max-height: 600px) {
  .countdown-section > .eyebrow { display: none; }
  .hero-description { font-size: .75rem; line-height: 1.6; }
  .keyboard-hint { gap: 2px; font-size: .55rem; }
  .keyboard-hint kbd { min-width: 16px; height: 18px; }
  .keyboard-hint .space-key { margin-left: 4px; padding-inline: 4px; }
  .pause-button { flex-shrink: 0; white-space: nowrap; }
}
@media (max-width: 820px) {
  .header-note { display: none; }
  .main-grid { grid-template-columns: minmax(0, 1fr); gap: 45px; max-width: 560px; margin: auto; padding: 52px 10px 45px; }
  h1 { font-size: clamp(3.6rem, 10vw, 4.7rem); }
  .hero-description { margin-bottom: 28px; }
  .waiting-note { margin-top: 22px; }
  .waiting-note span { transform: rotate(90deg); }
  .time-value { font-size: 3rem; }
  .game-tag { display: block; }
  .site-footer { padding-inline: 10px; flex-wrap: wrap; }
}
@media (pointer: coarse), (max-width: 820px) {
  .touch-controls { display: grid; grid-template: repeat(3, 48px) / repeat(3, 54px); justify-content: center; gap: 7px; margin-top: 20px; }
  .touch-controls button { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-strong); font-size: 1.2rem; color: var(--ink-soft); touch-action: none; user-select: none; -webkit-user-select: none; }
  .touch-controls button:active { background: color-mix(in srgb, var(--coral) 30%, var(--surface-strong)); transform: scale(.95); }
  .touch-controls .confirm { grid-area: 2 / 2; background: #c95f56; color: #fffaf3; font-size: .72rem; }
  .up { grid-area: 1 / 2; }
  .left { grid-area: 2 / 1; }
  .right { grid-area: 2 / 3; }
  .down { grid-area: 3 / 2; }
  .keyboard-hint { display: none; }
  .touch-hint { display: inline; }
  .overlay-hint { display: none; }
  .pause-button { min-height: 44px; min-width: 48px; }
}
@media (max-width: 480px) {
  .page-frame { width: calc(100% - 32px); padding-top: 16px; }
  .site-header { padding: 10px 12px; border-radius: 18px; gap: 10px; }
  .brand img { width: 36px; height: 36px; border-radius: 12px; }
  .brand { font-size: 1.12rem; gap: 8px; }
  .brand-blog { display: none; }
  .header-actions { gap: 14px; }
  .status-pill { font-size: .65rem; }
  .theme-button { width: 44px; height: 44px; }
  .main-grid { padding: 43px 4px 36px; gap: 36px; }
  .countdown-section > .eyebrow { font-size: .5rem; letter-spacing: .12em; }
  h1 { font-size: clamp(3rem, 12vw, 4rem); }
  .hero-description { font-size: .82rem; }
  .time-value { font-size: 2.6rem; }
  .timezone { font-size: .57rem; }
  .launch-date { column-gap: 7px; font-size: .65rem; }
  .game-card { padding: 17px; border-radius: 22px; }
  h2 { font-size: 1.45rem; }
  h3 { font-size: 1.3rem; }
  .overlay-copy { padding-block: 17px; }
  .overlay-copy p { margin-bottom: 14px; }
  .site-footer { padding-inline: 4px; gap: 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
