:root {
  color-scheme: light;

  --ledger: #f2f4f7;
  --ink: #161c28;
  --slate-table: #2a3444;
  --signal: #b42318;
  --ember: #c07028;
  --violet-tick: #4f46c8;
  --surface: #ffffff;
  --muted: #5c6575;
  --line: #c5cbd6;

  --gray-100: #f7f8fa;
  --gray-200: #f2f4f7;
  --gray-300: #e4e7ed;
  --gray-400: #c5cbd6;
  --gray-500: #8b93a3;
  --gray-600: #5c6575;
  --gray-700: #3e4756;
  --gray-800: #2a3444;
  --gray-900: #161c28;

  --signal-100: #fdecec;
  --signal-200: #f8c5c2;
  --signal-300: #f08f88;
  --signal-400: #e05a50;
  --signal-500: #d03228;
  --signal-600: #b42318;
  --signal-700: #8f1c14;
  --signal-800: #6b1510;
  --signal-900: #3d0c09;

  --tile-1: #e8edf3;
  --tile-2: #d0d7e4;
  --tile-4: #cdc6b8;
  --tile-8: #c4a870;
  --tile-16: #c99242;
  --tile-32: #c07028;
  --tile-64: #b85a22;
  --tile-128: #a84820;
  --tile-256: #8f3418;
  --tile-number-low: var(--ink);
  --tile-number-high: #ffffff; /* 64 及以上 */

  --success: #1f7a4c;
  --stuck-wash: #f3e6d6;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;

  --text-meta: 13px;
  --text-body: 16px;
  --text-title: 20px;
  --text-h1: 24px;          /* 游戏态；内页桌面改为 32px */
  --text-tile: clamp(20px, 6vw, 28px);
  --text-stat: 28px;
  --leading-body: 24px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius-tile: 6px;
  --radius-board: 12px;
  --radius-btn: 8px;
  --radius-card: 16px;

  --hairline: 1px solid var(--line);
  --stroke-selected: 2px solid var(--signal-600);
  --stroke-hint: 2px dashed var(--ink);
  --shadow-modal: 0 16px 40px rgba(22, 28, 40, 0.18);
  --focus-ring: 3px solid var(--signal-600);

  --header-h: 56px;
  --tap: 44px;
  --board-max: 22.5rem;
  --board-max-h: 52dvh;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 160ms;
  --overlay: rgba(22, 28, 40, 0.40);
}

@font-face {
  font-family: "Space Grotesk";
  src: url("/_a/space-grotesk-500.eaffa8b1c3.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-2019, U+201C-201D, U+2022, U+2026, U+2212;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("/_a/space-grotesk-700.1a97235101.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-2019, U+201C-201D, U+2022, U+2026, U+2212;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/_a/source-sans-3-400.19cc5d66d8.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-2019, U+201C-201D, U+2022, U+2026, U+2212;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/_a/source-sans-3-600.a2925769f2.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-2019, U+201C-201D, U+2022, U+2026, U+2212;
}

.site-shell {
  --gutter: var(--space-4);
  --game-column: 28rem;
  --prose-column: 40rem;
  margin: 0;
  background: var(--ledger);
  color: var(--ink);
  font: 400 var(--text-body)/var(--leading-body) var(--font-body);
}

.site-shell *, .site-shell *::before, .site-shell *::after { box-sizing: border-box; }
.site-shell [hidden] { display: none !important; }
.site-shell :focus-visible { outline: var(--focus-ring); outline-offset: 3px; }
.site-shell a { color: var(--signal-600); text-underline-offset: .2em; }
.site-shell a:hover { color: var(--signal-700); }
.site-shell h1, .site-shell h2, .site-shell h3 { font-family: var(--font-display); font-weight: 700; }
.site-shell h1 { font-size: var(--text-h1); line-height: 28px; }
.site-shell h2 { font-size: var(--text-title); line-height: 24px; }
.site-shell h3 { font-size: var(--text-body); line-height: var(--leading-body); }

.site-shell button {
  min-height: var(--tap);
  padding: var(--space-2) var(--space-4);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--ink);
  font: 700 var(--text-body)/var(--leading-body) var(--font-display);
  cursor: pointer;
}

.site-shell button:not(:disabled):hover { background: var(--gray-300); }
.site-shell button:not(:disabled):active { transform: scale(.98); }
.site-shell button:disabled { opacity: .4; cursor: default; }

.site-shell .play-button,
.site-shell .play-button:not(:disabled):hover,
.site-shell button[data-gf-liked],
.site-shell button[data-gf-like][aria-pressed="true"] {
  border: 0;
  background: var(--signal-600);
  color: var(--surface);
}

.site-shell .play-button:not(:disabled):hover,
.site-shell button[data-gf-liked]:not(:disabled):hover,
.site-shell button[data-gf-like][aria-pressed="true"]:not(:disabled):hover { background: var(--signal-700); }
.site-shell .play-button:not(:disabled):active { background: var(--signal-800); }

.site-shell .skip-link {
  position: absolute;
  inset: var(--space-2) auto auto var(--space-2);
  z-index: 3;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  transform: translateY(-150%);
}

.site-shell .skip-link:focus { transform: none; }
.site-shell .site-wrap { width: min(calc(100% - 2 * var(--gutter)), 64rem); margin-inline: auto; }

.site-shell .site-header {
  position: relative;
  z-index: 1;
  height: var(--header-h);
  border-bottom: var(--hairline);
  background: var(--surface);
}

.site-shell .header-inner {
  display: flex;
  height: 100%;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.site-shell .site-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap);
  color: var(--ink);
  font: 700 var(--text-body)/var(--leading-body) var(--font-display);
  text-decoration: none;
  white-space: nowrap;
}

.site-shell .site-brand svg { flex: none; }
.site-shell .site-nav { position: relative; min-width: 0; }
.site-shell .menu-toggle { display: none; }
.site-shell .site-links, .site-shell .legal-links { display: flex; gap: var(--space-4); }

.site-shell .site-links a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--ink);
  font: 500 var(--text-body)/var(--leading-body) var(--font-display);
  white-space: nowrap;
  text-decoration: none;
}

.site-shell .site-links a:hover { color: var(--signal-700); text-decoration: underline; }

@media (max-width: 42rem) {
  .site-shell .site-links { overflow-x: auto; }
  .site-shell .menu-toggle:not([hidden]) { display: grid; place-items: center; width: var(--tap); padding: 0; }
  .site-shell .menu-toggle:not([hidden]) + .site-links {
    display: none;
    position: absolute;
    inset: calc(100% + var(--space-2)) 0 auto auto;
    flex-direction: column;
    gap: 0;
    min-width: max-content;
    padding: var(--space-1) var(--space-3);
    overflow: visible;
    border: var(--hairline);
    border-radius: var(--radius-btn);
    background: var(--surface);
  }
  .site-shell .menu-toggle[aria-expanded="true"]:not([hidden]) + .site-links { display: flex; }
}

.site-shell .site-footer {
  margin-top: var(--space-7);
  border-top: var(--hairline);
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 18px;
}

.site-shell .footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  padding-block: var(--space-4);
}

.site-shell .legal-links { flex-wrap: wrap; gap: var(--space-2) var(--space-4); }

.site-shell .home-main > h1, .site-shell .player-zone {
  width: min(100%, var(--game-column));
  margin-inline: auto;
}

.site-shell .home-main > h1 { margin-block: var(--space-3); grid-area: heading; }
.site-shell .player-zone { grid-area: player; }

.site-shell .player-stage {
  position: relative;
  overflow: hidden;
  border: var(--hairline);
  border-radius: var(--radius-board);
  background: var(--surface);
}

.site-shell .player-stage:has(iframe) { height: 44rem; }
.site-shell .player-stage iframe { display: block; width: 100%; height: 100%; border: 0; }
.site-shell .player-stage:fullscreen,
.site-shell .daily-player:fullscreen { width: 100%; height: 100%; border: 0; border-radius: 0; }

.site-shell .player-cover {
  display: grid;
  grid-template-columns: minmax(0, 96px) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
}

.site-shell .player-loading {
  display: grid;
  min-height: 12rem;
  place-items: center;
  padding: var(--space-4);
  font: 500 var(--text-body)/var(--leading-body) var(--font-display);
}

.site-shell .cover-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
  padding: var(--space-1);
  border-radius: var(--radius-board);
  background: var(--slate-table);
}

.site-shell .cover-tiles span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-bottom: 2px solid #00000014;
  border-radius: var(--radius-tile);
  background: var(--tile-4);
  color: var(--tile-number-low);
  font: 700 var(--text-tile)/1 var(--font-display);
  font-variant-numeric: tabular-nums slashed-zero;
}

.site-shell .cover-tiles .preview-two { background: var(--tile-2); }
.site-shell .cover-tiles .preview-eight { background: var(--tile-8); }
.site-shell .cover-copy p { margin: 0; }
.site-shell .cover-copy p + p { margin-top: var(--space-1); }
.site-shell .cover-kicker { color: var(--muted); font-size: var(--text-meta); line-height: 18px; }
.site-shell .cover-title { font: 700 var(--text-title)/24px var(--font-display); }
.site-shell .play-button { margin-top: var(--space-2); }

.site-shell .player-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.site-shell [data-gf-like-count] { font-variant-numeric: tabular-nums slashed-zero; }
.site-shell [data-gf-share-msg] { flex-basis: 100%; color: var(--muted); font-size: var(--text-meta); }
.site-shell [data-gf-share-msg]:empty { position: absolute; }

.site-shell .ad-reserves {
  grid-area: ads;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.site-shell .ad-reserve {
  width: min(100%, 320px);
  height: 50px;
  background: var(--gray-300);
}

.site-shell .page-sheet {
  grid-area: prose;
  width: min(100%, var(--prose-column));
  margin: var(--space-5) auto 0;
  overflow-wrap: anywhere;
}

.site-shell .home-main .page-sheet {
  padding-top: var(--space-4);
  border-top: var(--hairline);
}

.site-shell .site-prose > :first-child { margin-top: 0; }
.site-shell .site-prose h1 { margin-bottom: var(--space-4); }
.site-shell .site-prose h2 { margin: var(--space-6) 0 var(--space-2); }
.site-shell .site-prose h3 { margin: var(--space-5) 0 var(--space-2); }
.site-shell .site-prose p { margin: 0 0 var(--space-4); }
.site-shell .site-prose ul, .site-shell .site-prose ol { padding-inline-start: var(--space-5); }
.site-shell .site-prose li + li { margin-top: var(--space-2); }

.site-shell .site-prose pre {
  overflow-x: auto;
  padding: var(--space-3) var(--space-4);
  border: var(--hairline);
  border-radius: var(--radius-btn);
  background: var(--surface);
}

.site-shell .site-prose img { max-width: 100%; height: auto; }
.site-shell .site-prose:has(> .daily-player) > h1 {
  width: min(100%, var(--game-column));
  margin-inline: auto;
  font-size: var(--text-h1);
  line-height: 28px;
}

.site-shell .daily-player {
  display: block;
  width: min(100%, var(--game-column));
  height: 56rem;
  margin: 0 auto var(--space-5);
  border: var(--hairline);
  border-radius: var(--radius-board);
  background: var(--surface);
}

@media (min-width: 48rem) {
  .site-shell { --gutter: var(--space-5); }
  .site-shell .site-brand { font-size: var(--text-title); }
  .site-shell .home-main { display: grid; grid-template: "heading" "player" "ads" "prose" / minmax(0, 1fr); }
  .site-shell .player-cover { grid-template-columns: minmax(0, 136px) minmax(0, 1fr); gap: var(--space-5); padding: var(--space-5); }
  .site-shell .cover-tiles { gap: 6px; padding: var(--space-2); }
  .site-shell .ad-reserve { width: 300px; height: 250px; }
  .site-shell .daily-player, .site-shell .site-prose:has(> .daily-player) > h1 { width: min(100%, 35rem); }
  .site-shell .site-prose h1 { font-size: 32px; line-height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-shell button:not(:disabled):active { transform: none; }
}

.site-shell .player-cover:has(> .player-cover-image) { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.site-shell .player-cover-image { display: block; width: min(100%, 26rem); height: auto; border: 1px solid var(--line); border-radius: var(--radius-board); }
