@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces-italic-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("assets/fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Wordgarden Serif SC";
  src: url("assets/fonts/noto-serif-sc-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Wordgarden Sans SC";
  src: url("assets/fonts/noto-sans-sc-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font-display: "Fraunces", "Wordgarden Serif SC", "Songti SC", "Noto Serif CJK SC", "STSong", serif;
  --font-body: "Manrope", "Wordgarden Sans SC", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --page-gutter: clamp(20px, 4vw, 56px);
  --bg: #f3efe3;
  --bg-deep: #ebe4d3;
  --surface: rgba(252, 248, 238, 0.82);
  --surface-solid: #fbf7ed;
  --ink: #1d2a20;
  --ink-soft: #344437;
  --muted: #737c6d;
  --muted-strong: #5b6659;
  --line: #ded7c6;
  --line-strong: #c7c0ad;
  --accent: #b27c2e;
  --accent-soft: #e8d3a5;
  --green: #107a4b;
  --green-deep: #0b5b38;
  --sage: #dfe6d4;
  --tile: #fcf9f1;
  --tile-border: #d7d0bf;
  --tile-active: #0f8752;
  --correct: #1eaf6a;
  --correct-border: #139d5e;
  --on-correct: #071c10;
  --present: #d9ac49;
  --present-border: #c19332;
  --absent: #657064;
  --absent-border: #596356;
  --on-color: #f8f4e7;
  --on-present: #292b1e;
  --key: #e9e2d2;
  --key-hover: #ded5c1;
  --key-ink: #354236;
  --card: #fbf7ed;
  --card-border: #e1dac9;
  --card-inner: rgba(255, 255, 255, 0.35);
  --primary-bg: #1e432c;
  --primary-ink: #f8f4e8;
  --primary-hover: #2a5539;
  --secondary-bg: transparent;
  --secondary-border: #cdc5b2;
  --danger: #a14836;
  --overlay: rgba(16, 24, 17, 0.48);
  --shadow: 0 34px 80px -44px rgba(39, 52, 38, 0.56);
  --shadow-soft: 0 18px 44px -34px rgba(39, 52, 38, 0.4);
  --focus: #af7b2d;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1610;
  --bg-deep: #0a100b;
  --surface: rgba(22, 31, 23, 0.82);
  --surface-solid: #161f17;
  --ink: #edf0e4;
  --ink-soft: #d3dac9;
  --muted: #99a391;
  --muted-strong: #b0b9a7;
  --line: #2c382d;
  --line-strong: #405040;
  --accent: #d5a64f;
  --accent-soft: #5a4828;
  --green: #7cdb99;
  --green-deep: #95efb1;
  --sage: #29382c;
  --tile: #172018;
  --tile-border: #354134;
  --tile-active: #7fe6a2;
  --correct: #27c47a;
  --correct-border: #37d98a;
  --on-correct: #071c10;
  --present: #c9a144;
  --present-border: #dbb65e;
  --absent: #39433a;
  --absent-border: #485448;
  --on-color: #f3f4e9;
  --on-present: #252718;
  --key: #252f26;
  --key-hover: #303c31;
  --key-ink: #dce2d5;
  --card: #151d16;
  --card-border: #2d3a2e;
  --card-inner: rgba(255, 255, 255, 0.025);
  --primary-bg: #d5e1c7;
  --primary-ink: #172016;
  --primary-hover: #e2ecd7;
  --secondary-bg: transparent;
  --secondary-border: #455445;
  --danger: #e19582;
  --overlay: rgba(3, 8, 4, 0.7);
  --shadow: 0 34px 90px -40px rgba(0, 0, 0, 0.85);
  --shadow-soft: 0 18px 44px -30px rgba(0, 0, 0, 0.75);
  --focus: #d8ad57;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 83% 4%, rgba(216, 227, 198, 0.74), transparent 45%),
    radial-gradient(ellipse at 7% 98%, rgba(231, 210, 169, 0.3), transparent 42%),
    var(--bg);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 81% 2%, rgba(52, 75, 48, 0.35), transparent 46%),
    radial-gradient(ellipse at 4% 96%, rgba(104, 80, 37, 0.16), transparent 42%),
    var(--bg);
}

::selection {
  color: var(--primary-ink);
  background: var(--green);
}

[data-theme="dark"] ::selection {
  color: var(--primary-ink);
  background: var(--green-deep);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  font: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

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

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  transform: translateY(-160%);
  border-radius: 8px;
  color: var(--primary-ink);
  background: var(--primary-bg);
  font-size: 13px;
  font-weight: 600;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.noscript-banner {
  width: min(calc(100% - 2 * var(--page-gutter)), 1280px);
  margin: 16px auto 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  background: var(--surface-solid);
  font-size: 12px;
  text-align: center;
}

body.is-modal-open {
  overflow: hidden;
}

.shell,
.section-shell {
  width: min(calc(100% - 2 * var(--page-gutter)), 1280px);
  margin-inline: auto;
}

/* -------------------------------------------------------------------------- */
/* Ambient background                                                         */
/* -------------------------------------------------------------------------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient-glow {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.8;
}

.ambient-glow--sage {
  top: -16vw;
  right: -12vw;
  width: 48vw;
  height: 48vw;
  background: rgba(198, 214, 175, 0.5);
}

.ambient-glow--ochre {
  bottom: -22vw;
  left: -14vw;
  width: 46vw;
  height: 46vw;
  background: rgba(228, 200, 144, 0.28);
}

[data-theme="dark"] .ambient-glow--sage {
  opacity: 0.22;
  background: rgba(91, 125, 72, 0.5);
}

[data-theme="dark"] .ambient-glow--ochre {
  opacity: 0.16;
  background: rgba(159, 116, 46, 0.34);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='.8'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

[data-theme="dark"] .grain {
  opacity: 0.08;
  mix-blend-mode: soft-light;
}

/* -------------------------------------------------------------------------- */
/* Header                                                                     */
/* -------------------------------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  width: 38px;
  height: 38px;
  padding: 7px;
  border-radius: 12px;
  background: var(--green);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform: rotate(-3deg);
  transition: transform 220ms ease;
}

.brand:hover .brand-mark {
  transform: rotate(2deg) scale(1.03);
}

.brand-mark i {
  display: block;
  border-radius: 2px;
  background: #f5f0e1;
}

.brand-mark i:nth-child(2) {
  opacity: 0.44;
}

.brand-mark i:nth-child(3) {
  opacity: 0.66;
}

.brand-mark i:nth-child(4) {
  background: var(--present);
}

[data-theme="dark"] .brand-mark {
  background: #304c37;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.015em;
}

.brand-en {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 26px;
}

.header-edition {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 13%, transparent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  margin-right: 6px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--surface-solid) 35%, transparent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.home-link svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.home-link:hover {
  border-color: var(--line-strong);
  background: var(--surface-solid);
}

.icon-button,
.modal-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--muted-strong);
  transition: color 160ms ease, background-color 160ms ease;
}

.icon-button svg,
.modal-close svg {
  width: 18px;
  height: 18px;
}

.icon-button:hover,
.modal-close:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.theme-icon--moon {
  display: none;
}

[data-theme="dark"] .theme-icon--sun {
  display: none;
}

[data-theme="dark"] .theme-icon--moon {
  display: block;
}

.help-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin-left: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--surface-solid) 35%, transparent);
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.help-button svg {
  width: 16px;
  height: 16px;
  transition: transform 160ms ease;
}

.help-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-solid);
}

.help-button:hover svg {
  transform: translateX(2px);
}

/* -------------------------------------------------------------------------- */
/* Hero                                                                       */
/* -------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.09fr) minmax(410px, 0.91fr);
  gap: clamp(44px, 7vw, 110px);
  align-items: center;
  min-height: min(770px, calc(100svh - 92px));
  padding-block: clamp(26px, 4vh, 54px) clamp(58px, 8vh, 92px);
}

.intro {
  position: relative;
  z-index: 1;
  max-width: 620px;
  animation: intro-rise 760ms cubic-bezier(0.22, 0.8, 0.25, 1) both;
}

.intro-eyebrow {
  margin-bottom: clamp(20px, 3vh, 30px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow-rule {
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--line-strong);
}

.eyebrow-separator {
  color: var(--line-strong);
}

.intro h1 {
  max-width: 620px;
  margin: 0 0 clamp(20px, 3vh, 28px);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(56px, 6.4vw, 88px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.07;
}

.intro h1 em {
  position: relative;
  display: inline-block;
  color: var(--green);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}

[data-theme="dark"] .intro h1 em {
  color: var(--green-deep);
}

.intro h1 em::after {
  content: "";
  position: absolute;
  right: -0.08em;
  bottom: 0.08em;
  left: 0.02em;
  height: 0.13em;
  border-radius: 999px;
  background: var(--present);
  opacity: 0.58;
  transform: rotate(-1.4deg);
  z-index: -1;
}

.intro-copy {
  max-width: 435px;
  margin: 0;
  color: var(--muted-strong);
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.01em;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 28px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.mini-tile {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--on-color);
  font-family: var(--font-mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
  line-height: 1;
}

.mini-tile--correct {
  color: var(--on-correct);
  background: var(--correct);
}

.mini-tile--present {
  color: var(--on-present);
  background: var(--present);
}

.mini-tile--absent {
  background: var(--absent);
}

.record-panel {
  display: flex;
  align-items: center;
  gap: clamp(30px, 4vw, 54px);
  max-width: 470px;
  margin-top: clamp(32px, 4.5vh, 46px);
  padding-top: clamp(22px, 3vh, 28px);
  border-top: 1px solid var(--line);
}

.record-primary {
  display: flex;
  align-items: center;
  gap: 13px;
}

.record-primary strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.record-primary > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}

.record-primary small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.record-secondary {
  display: flex;
  gap: clamp(20px, 3vw, 34px);
}

.record-secondary > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.record-secondary strong {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.1;
}

.record-secondary span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.learn-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 30px;
  padding: 0;
  border: 0;
  color: var(--muted-strong);
  background: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  cursor: pointer;
  transition: color 160ms ease;
}

.learn-link svg {
  width: 15px;
  height: 15px;
  transition: transform 160ms ease;
}

.learn-link:hover {
  color: var(--ink);
}

.learn-link:hover svg {
  transform: translateX(2px);
}

.botanical {
  position: absolute;
  right: -68px;
  bottom: -38px;
  z-index: -1;
  width: 200px;
  height: 230px;
  color: var(--green);
  opacity: 0.33;
  pointer-events: none;
}

[data-theme="dark"] .botanical {
  opacity: 0.36;
  color: var(--green-deep);
}

/* -------------------------------------------------------------------------- */
/* Game panel                                                                 */
/* -------------------------------------------------------------------------- */

.game-panel {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 480px;
  padding: clamp(18px, 2vw, 23px);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  background:
    linear-gradient(145deg, var(--card-inner), transparent 42%),
    var(--card);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  animation: panel-rise 860ms cubic-bezier(0.22, 0.8, 0.25, 1) 90ms both;
}

[data-theme="dark"] .game-panel {
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.game-panel:focus,
.game-panel:focus-visible {
  outline: none;
}

.game-panel::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 18px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--present);
  opacity: 0.75;
}

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

.mode-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

.mode-tab {
  position: relative;
  min-height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.mode-tab.is-active {
  color: var(--primary-ink);
  background: var(--primary-bg);
  box-shadow: 0 4px 10px -6px rgba(18, 35, 24, 0.7);
}

.mode-tab:not(.is-active):hover {
  color: var(--ink);
}

.round-counter {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 56px;
  justify-content: flex-end;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.round-current {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.round-slash {
  color: var(--line-strong);
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  min-height: 24px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 10px;
}

.game-date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.game-date::before {
  content: "";
  width: 4px;
  height: 4px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
}

.bank-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.bank-caption {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.045em;
  white-space: nowrap;
}

.bank-tabs {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 2px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--bg) 46%, transparent);
}

.bank-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 21px;
  padding: 0 7px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.015em;
  white-space: nowrap;
  transition: color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.bank-tab:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

.bank-tab[aria-pressed="true"] {
  color: var(--green-deep);
  background: var(--sage);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

[data-theme="dark"] .bank-tab[aria-pressed="true"] {
  color: var(--green-deep);
  background: color-mix(in srgb, var(--sage) 58%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.bank-tab:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.bank-tab:disabled {
  cursor: default;
  opacity: 0.52;
}

.mode-tab:disabled {
  cursor: default;
  opacity: 0.55;
}

.challenge-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 25px;
  padding: 2px 4px 2px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 7px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 28%, transparent);
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.challenge-chip-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.challenge-chip-label i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.challenge-chip strong {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.challenge-exit {
  min-height: 21px;
  margin-left: 2px;
  padding: 0 6px;
  border-left: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  color: var(--muted-strong);
  font-size: 8.5px;
  font-weight: 600;
}

.challenge-exit:hover {
  color: var(--ink);
}

[data-theme="dark"] .challenge-chip {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 18%, transparent);
}

.hint-area {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: -1px 0 12px;
  animation: hint-in 240ms ease both;
}

.hint-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 25px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--green) 18%, transparent);
  border-radius: 999px;
  color: var(--green);
  background: color-mix(in srgb, var(--sage) 58%, transparent);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1;
}

[data-theme="dark"] .hint-chip {
  color: var(--green-deep);
  background: color-mix(in srgb, var(--sage) 7%, transparent);
}

.hint-chip b {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  color: var(--on-color);
  background: var(--green);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
}

[data-theme="dark"] .hint-chip b {
  color: #142015;
  background: var(--green-deep);
}

.board-wrap {
  display: flex;
  justify-content: center;
  padding-block: 2px 0;
}

.board {
  display: grid;
  gap: 8px;
  width: min(100%, 338px);
}

.board-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.tile {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1.5px solid var(--tile-border);
  border-radius: 11px;
  color: var(--ink);
  background: var(--tile);
  font-family: var(--font-mono);
  font-size: clamp(24px, 2.3vw, 29px);
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 140ms ease,
    box-shadow 160ms ease;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
  pointer-events: none;
}

[data-theme="dark"] .tile::after {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.tile.is-filled {
  border-color: var(--line-strong);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--ink) 7%, transparent);
}

.tile.is-active {
  border-color: color-mix(in srgb, var(--tile-active) 72%, var(--tile-border));
}

.tile.is-correct,
.tile.is-present,
.tile.is-absent {
  border-color: transparent;
}

.tile.is-correct {
  border-color: var(--correct-border);
  color: var(--on-correct);
  background: var(--correct);
}

.tile.is-present {
  border-color: var(--present-border);
  color: var(--on-present);
  background: var(--present);
}

.tile.is-absent {
  border-color: var(--absent-border);
  color: var(--on-color);
  background: var(--absent);
}

.tile.is-correct::after,
.tile.is-present::after,
.tile.is-absent::after {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.tile.reveal {
  animation: tile-reveal 560ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--col) * 92ms);
}

.tile.is-popping {
  animation: tile-pop 150ms ease-out both;
}

.board-row.is-shaking {
  animation: row-shake 430ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.board-row.is-winning .tile {
  animation: tile-win 620ms cubic-bezier(0.22, 0.8, 0.25, 1) both;
  animation-delay: calc(var(--col) * 60ms);
}

.announcement {
  min-height: 18px;
  margin: 9px 0 10px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
  text-align: center;
  transition: color 160ms ease;
}

.announcement.is-alert {
  color: var(--danger);
}

.announcement.is-success {
  color: var(--green);
  font-weight: 700;
}

[data-theme="dark"] .announcement.is-success {
  color: var(--green-deep);
}

/* Keyboard */

.keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 432px;
  margin-inline: auto;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.key {
  position: relative;
  flex: 1 1 0;
  max-width: 42px;
  height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--key-ink);
  background: var(--key);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--ink) 8%, transparent);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  transition:
    background-color 120ms ease,
    color 120ms ease,
    transform 80ms ease,
    box-shadow 120ms ease;
}

.key:hover {
  background: var(--key-hover);
}

.key:active,
.key.is-pressed {
  transform: translateY(1px) scale(0.97);
}

.key--wide {
  flex: 1.55 1 0;
  max-width: 65px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.key--wide svg {
  width: 18px;
  height: 18px;
  margin-inline: auto;
}

.key.is-correct {
  color: var(--on-correct);
  background: var(--correct);
}

.key.is-present {
  color: var(--on-present);
  background: var(--present);
}

.key.is-absent {
  color: color-mix(in srgb, var(--on-color) 68%, transparent);
  background: var(--absent);
}

.key.is-correct:hover,
.key.is-present:hover,
.key.is-absent:hover {
  background: var(--key-hover);
}

.key.is-correct:hover {
  background: var(--correct-border);
}

.key.is-present:hover {
  background: var(--present);
}

.key.is-absent:hover {
  background: var(--absent);
}

.keyboard.is-over .key {
  opacity: 0.62;
  cursor: default;
  pointer-events: none;
}

.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid color-mix(in srgb, var(--line) 66%, transparent);
}

.hint-button,
.new-word-button,
.cheat-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 600;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.hint-button svg,
.new-word-button svg,
.cheat-link svg {
  width: 14px;
  height: 14px;
}

.hint-button:hover,
.new-word-button:hover,
.cheat-link:hover {
  color: var(--ink);
  border-color: var(--line);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

.cheat-link {
  color: var(--accent);
  text-decoration: none;
}

.cheat-link:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.hint-button:disabled {
  opacity: 0.42;
  cursor: default;
}

.hint-count {
  display: inline-grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  margin-left: 1px;
  padding-inline: 3px;
  border-radius: 999px;
  color: var(--primary-ink);
  background: var(--primary-bg);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  line-height: 1;
}

.game-footnote {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.035em;
  text-align: center;
  white-space: nowrap;
}

.new-word-button {
  color: var(--accent);
}

/* -------------------------------------------------------------------------- */
/* Example tiles                                                              */
/* -------------------------------------------------------------------------- */

.example-board {
  display: flex;
  gap: 5px;
  margin-top: 20px;
}

.example-tile {
  display: grid;
  place-items: center;
  width: clamp(31px, 3.3vw, 38px);
  height: clamp(31px, 3.3vw, 38px);
  border-radius: 7px;
  color: var(--on-color);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

.example-tile--correct {
  color: var(--on-correct);
  background: var(--correct);
}

.example-tile--present {
  color: var(--on-present);
  background: var(--present);
}

.example-tile--absent {
  background: var(--absent);
}

.example-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.example-key li {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 2px;
}

.dot--correct {
  background: var(--correct);
}

.dot--present {
  background: var(--present);
}

.dot--absent {
  background: var(--absent);
}

/* -------------------------------------------------------------------------- */
/* Modals                                                                     */
/* -------------------------------------------------------------------------- */

.modal {
  width: min(calc(100vw - 32px), 540px);
  max-height: min(88svh, 780px);
  margin: auto;
  padding: clamp(24px, 4vw, 38px);
  overflow: auto;
  border: 1px solid var(--card-border);
  border-radius: 26px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 38%),
    var(--surface-solid);
  box-shadow: 0 40px 120px -36px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .modal {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 38%),
    var(--surface-solid);
}

.modal::backdrop {
  background: var(--overlay);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.modal[open] {
  animation: modal-in 300ms cubic-bezier(0.22, 0.8, 0.25, 1) both;
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-top .eyebrow {
  margin: 0;
}

.modal h2 {
  margin: 0 0 13px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 44px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.modal-lead {
  margin: 0 0 24px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.85;
}

.modal-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}

.help-example {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 50%, transparent);
}

.help-example-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.help-example-label {
  color: var(--muted);
  font-size: 9px;
}

.help-example-copy strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.17em;
}

.help-example .example-board {
  flex: 0 0 auto;
  margin: 0;
}

.help-example .example-tile {
  width: clamp(28px, 6vw, 34px);
  height: clamp(28px, 6vw, 34px);
  font-size: 11px;
}

.help-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 21px;
  border-top: 1px solid var(--line);
}

.help-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.help-item p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 11px;
  line-height: 1.7;
}

.help-item strong {
  color: var(--ink-soft);
  font-weight: 700;
}

.modal-fineprint {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.8;
}

.inline-link {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  transition: border-color 140ms ease;
}

.inline-link:hover {
  border-bottom-color: currentColor;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background-color 160ms ease, transform 140ms ease, border-color 160ms ease;
}

.primary-button {
  color: var(--primary-ink);
  background: var(--primary-bg);
  box-shadow: 0 8px 18px -14px rgba(18, 40, 24, 0.7);
}

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

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.primary-button svg {
  width: 15px;
  height: 15px;
}

.secondary-button {
  border-color: var(--secondary-border);
  color: var(--ink-soft);
  background: var(--secondary-bg);
}

.secondary-button:hover {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.modal-primary {
  width: 100%;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.text-danger {
  color: var(--danger);
  font-size: 10px;
  transition: opacity 140ms ease;
}

.text-danger:hover {
  opacity: 0.7;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 26px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats-grid > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-right: 1px solid var(--line);
}

.stats-grid > div:last-child {
  border-right: 0;
}

.stats-grid strong {
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stats-grid span {
  color: var(--muted);
  font-size: 9px;
}

.distribution-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.distribution-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
}

.distribution-head span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
}

.distribution-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.distribution-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.distribution-row > span {
  width: 9px;
  flex: 0 0 9px;
}

.distribution-track {
  flex: 1;
  height: 17px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  overflow: hidden;
}

.distribution-fill {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 23px;
  height: 100%;
  padding-inline: 6px;
  border-radius: 4px;
  color: var(--on-correct);
  background: var(--correct);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  transition: width 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.distribution-fill.is-empty {
  min-width: 23px;
  color: var(--muted);
  background: transparent;
}

/* Result dialog */

.modal--result {
  position: relative;
  width: min(calc(100vw - 32px), 500px);
  overflow-x: hidden;
  overflow-y: auto;
}

/* 同页作弊器弹窗 */
.modal.modal--cheat {
  width: min(calc(100vw - 24px), 1080px);
  max-width: 1080px;
  height: min(88vh, 860px);
  height: min(88svh, 860px);
  max-height: min(92vh, 920px);
  max-height: min(92svh, 920px);
  padding: 0;
  overflow: hidden;
  border-radius: 22px;
}

.modal.modal--cheat[open] {
  display: flex;
  flex-direction: column;
}

.cheat-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  padding: 11px 14px 11px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-solid);
}

.cheat-modal-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.cheat-modal-title .eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.cheat-modal-title strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cheat-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.cheat-modal-actions a {
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: border-color 140ms ease;
}

.cheat-modal-actions a:hover {
  border-bottom-color: currentColor;
}

.cheat-frame-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--bg);
}

.cheat-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
}

.cheat-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 24px;
  color: var(--muted);
  background: var(--surface-solid);
  text-align: center;
}

.cheat-fallback p {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.cheat-fallback a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  color: var(--primary-ink);
  background: var(--primary-bg);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease;
}

.cheat-fallback a:hover {
  background: var(--primary-hover);
}

.cheat-fallback span {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .modal.modal--cheat {
    width: calc(100vw - 12px);
    height: calc(100vh - 20px);
    height: calc(100svh - 20px);
    max-height: none;
    border-radius: 18px;
  }

  .cheat-modal-head {
    padding: 9px 10px 9px 13px;
  }

  .cheat-modal-title .eyebrow {
    display: none;
  }

  .cheat-modal-title strong {
    font-size: 15px;
  }

  .cheat-modal-actions a {
    font-size: 9.5px;
  }
}

.modal-close--result {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
}

.modal--result .eyebrow {
  margin-bottom: 14px;
}

.modal--result h2 {
  margin-bottom: 12px;
}

.result-leaves {
  position: absolute;
  top: 18px;
  right: 56px;
  width: 68px;
  height: 56px;
  pointer-events: none;
}

.result-leaves i {
  position: absolute;
  display: block;
  width: 14px;
  height: 24px;
  border-radius: 12px 1px 12px 1px;
  background: var(--sage);
  transform-origin: center bottom;
  opacity: 0.65;
}

.result-leaves i:nth-child(1) {
  top: 4px;
  left: 27px;
  transform: rotate(-9deg);
}

.result-leaves i:nth-child(2) {
  top: 14px;
  left: 12px;
  transform: rotate(-44deg) scale(0.84);
}

.result-leaves i:nth-child(3) {
  top: 14px;
  right: 7px;
  transform: rotate(41deg) scale(0.9);
}

.result-leaves i:nth-child(4) {
  top: 30px;
  left: 2px;
  transform: rotate(-73deg) scale(0.68);
}

.result-leaves i:nth-child(5) {
  top: 34px;
  right: -1px;
  transform: rotate(72deg) scale(0.7);
  background: var(--accent-soft);
}

.result-word-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 24px 0 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--sage) 70%, transparent), transparent 70%),
    color-mix(in srgb, var(--bg) 34%, transparent);
}

.result-word-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-word {
  display: flex;
  gap: 6px;
}

.result-word span {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 8px;
  color: var(--on-correct);
  background: var(--correct);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  animation: tile-win 520ms cubic-bezier(0.22, 0.8, 0.25, 1) both;
  animation-delay: calc(var(--col) * 55ms);
}

.word-info {
  margin: 0 0 18px;
  padding: 13px 15px 14px;
  border: 1px solid color-mix(in srgb, var(--green) 16%, var(--line));
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--sage) 44%, transparent), transparent 72%),
    color-mix(in srgb, var(--bg) 34%, transparent);
}

.word-info-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 23px;
  margin-bottom: 4px;
}

.word-info-eyebrow {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.word-info-lemma {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--green-deep);
  background: color-mix(in srgb, var(--sage) 66%, transparent);
  font-size: 8.5px;
  font-weight: 600;
}

[data-theme="dark"] .word-info-lemma {
  color: var(--green-deep);
  background: color-mix(in srgb, var(--sage) 62%, transparent);
}

.pronounce-button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  border: 1px solid color-mix(in srgb, var(--green) 20%, var(--line));
  border-radius: 50%;
  color: var(--green-deep);
  background: color-mix(in srgb, var(--surface-solid) 68%, transparent);
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

[data-theme="dark"] .pronounce-button {
  color: var(--green-deep);
}

.pronounce-button svg {
  width: 14px;
  height: 14px;
}

.pronounce-button:hover {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: var(--surface-solid);
}

.word-info-body {
  min-width: 0;
}

.word-info-phonetic {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.015em;
}

.word-info-phonetic:empty {
  display: none;
}

.word-info-meaning {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.75;
}

.word-info-example {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
}

.word-info-example-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.word-info-example-label {
  display: block;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.example-speak-button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  color: var(--muted-strong);
  transition: color 140ms ease, background-color 140ms ease;
}

.example-speak-button:hover {
  color: var(--green-deep);
  background: color-mix(in srgb, var(--sage) 55%, transparent);
}

.example-speak-button svg {
  width: 12px;
  height: 12px;
}

.word-info-example-en {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.65;
}

.word-info-example-zh {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.word-info-source {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.01em;
  opacity: 0.75;
}

.word-info-source a {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.word-info-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
  color: var(--green-deep);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: color 140ms ease;
}

.word-info-link svg {
  width: 11px;
  height: 11px;
}

.word-info-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.result-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-bottom: 20px;
}

.result-stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.result-stats strong {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

.result-stats span {
  color: var(--muted);
  font-size: 9px;
}

.next-puzzle {
  margin: 0 0 20px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  text-align: center;
}

.next-puzzle strong {
  color: var(--ink-soft);
  font-weight: 500;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.result-actions .primary-button,
.result-actions .secondary-button {
  width: 100%;
}

.share-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px 10px;
  min-height: 16px;
  margin-top: 10px;
}

.share-note {
  min-height: 0;
  margin: 0;
  color: var(--green);
  font-size: 9.5px;
  text-align: center;
}

.share-note--top {
  min-height: 15px;
  margin: 0 0 9px;
}

[data-theme="dark"] .share-note {
  color: var(--green-deep);
}

.share-link-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.share-dot {
  color: var(--line-strong);
  font-size: 9px;
}

.challenge-share-link[hidden] + .share-dot {
  display: none;
}

.challenge-share-link {
  color: var(--green-deep);
  font-size: 9px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  transition: color 140ms ease;
}

.challenge-share-link:hover {
  color: var(--ink);
}

.image-share-link,
.manual-share-link {
  color: var(--muted);
  font-size: 9px;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  transition: color 140ms ease;
}

.image-share-link:hover,
.manual-share-link:hover {
  color: var(--ink-soft);
}

.share-manual {
  margin-top: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 36%, transparent);
}

.share-manual-label {
  margin: 0 0 8px;
  color: var(--muted-strong);
  font-size: 9.5px;
  line-height: 1.6;
}

.share-manual-text {
  display: block;
  width: 100%;
  min-height: 92px;
  padding: 9px 10px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  background: var(--surface-solid);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.7;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin-top: 8px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 600;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.mini-button:hover {
  border-color: var(--ink-soft);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

/* -------------------------------------------------------------------------- */
/* Toast                                                                      */
/* -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  top: 24px;
  bottom: auto;
  left: 50%;
  z-index: 1200;
  max-width: min(90vw, 380px);
  padding: 10px 16px;
  transform: translate(-50%, -12px);
  border: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
  border-radius: 999px;
  color: var(--primary-ink);
  background: var(--primary-bg);
  box-shadow: var(--shadow-soft);
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* -------------------------------------------------------------------------- */
/* Confetti                                                                   */
/* -------------------------------------------------------------------------- */

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  overflow: hidden;
  pointer-events: none;
}

.confetti {
  position: absolute;
  top: -24px;
  left: var(--left);
  width: 8px;
  height: 14px;
  border-radius: 10px 1px 10px 1px;
  background: var(--color);
  opacity: 0;
  animation: confetti-fall var(--duration) cubic-bezier(0.16, 0.8, 0.37, 1) var(--delay) forwards;
}

/* -------------------------------------------------------------------------- */
/* Animations                                                                 */
/* -------------------------------------------------------------------------- */

@keyframes intro-rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(26px) rotate(0.8deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

@keyframes tile-reveal {
  0% {
    transform: rotateX(-88deg) scale(0.94);
    opacity: 0.45;
  }
  55% {
    transform: rotateX(8deg) scale(1.02);
    opacity: 1;
  }
  100% {
    transform: rotateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes tile-pop {
  0% {
    transform: scale(0.92);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes tile-win {
  0%,
  100% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(-8px);
  }
  65% {
    transform: translateY(2px);
  }
}

@keyframes row-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  18% {
    transform: translateX(-6px);
  }
  36% {
    transform: translateX(5px);
  }
  54% {
    transform: translateX(-4px);
  }
  72% {
    transform: translateX(3px);
  }
  88% {
    transform: translateX(-1px);
  }
}

@keyframes hint-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0) rotate(0deg);
  }
  10% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), 108vh, 0) rotate(var(--spin));
  }
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 0.94fr);
    gap: clamp(32px, 4vw, 52px);
  }

  .intro h1 {
    font-size: clamp(52px, 6vw, 72px);
  }

  .botanical {
    right: -36px;
    width: 170px;
    opacity: 0.25;
  }
}

@media (max-width: 900px) {
  .hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(36px, 7vw, 56px);
    min-height: 0;
    padding-top: clamp(18px, 4vh, 42px);
    padding-bottom: 62px;
  }

  .intro {
    max-width: 650px;
    margin-inline: auto;
    text-align: center;
  }

  .intro-eyebrow {
    justify-content: center;
  }

  .intro h1 {
    margin-inline: auto;
    font-size: clamp(48px, 9vw, 74px);
  }

  .intro-copy {
    margin-inline: auto;
  }

  .legend {
    justify-content: center;
  }

  .record-panel {
    justify-content: center;
    margin-inline: auto;
    text-align: left;
  }

  .learn-link {
    display: none;
  }

  .botanical {
    right: 50%;
    bottom: -86px;
    width: 160px;
    height: 190px;
    transform: translateX(170px) rotate(8deg);
    opacity: 0.16;
  }

  .game-panel {
    justify-self: center;
    max-width: 480px;
  }

  .example-board {
    margin-top: 14px;
  }
}

@media (max-width: 620px) {
  :root {
    --page-gutter: 17px;
  }

  .site-header {
    min-height: 74px;
    padding-block: 14px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 33px;
    height: 33px;
    padding: 6px;
    border-radius: 10px;
  }

  .brand-name {
    font-size: 19px;
  }

  .brand-en {
    font-size: 7px;
  }

  .header-edition {
    display: none;
  }

  .header-right {
    gap: 0;
  }

  .home-link {
    width: 34px;
    height: 34px;
    min-height: 34px;
    margin-right: 0;
    padding: 0;
    justify-content: center;
  }

  .home-link span {
    display: none;
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  .help-button {
    width: auto;
    height: 34px;
    min-height: 34px;
    margin-left: 3px;
    padding: 0 10px;
    gap: 5px;
    font-size: 10px;
  }

  .help-button svg {
    width: 14px;
    height: 14px;
  }

  .hero {
    gap: 30px;
    padding-top: 12px;
    padding-bottom: 50px;
  }

  .intro {
    text-align: left;
  }

  .intro-eyebrow {
    justify-content: flex-start;
    margin-bottom: 16px;
    font-size: 9px;
  }

  .eyebrow-rule {
    width: 20px;
  }

  .intro h1 {
    margin: 0 0 15px;
    font-size: clamp(41px, 12.2vw, 55px);
    line-height: 1.08;
    letter-spacing: -0.04em;
  }

  .intro-copy {
    max-width: 350px;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.8;
  }

  .legend {
    justify-content: flex-start;
    gap: 12px;
    margin-top: 17px;
  }

  .legend-item {
    font-size: 9.5px;
  }

  .mini-tile {
    width: 19px;
    height: 19px;
    border-radius: 5px;
    font-size: 8.5px;
  }

  .record-panel {
    display: none;
  }

  .botanical {
    display: none;
  }

  .game-panel {
    padding: 14px;
    border-radius: 23px;
  }

  .game-panel:focus,
.game-panel:focus-visible {
  outline: none;
}

.game-panel::before {
    top: 12px;
    right: 14px;
  }

  .game-top {
    margin-bottom: 12px;
  }

  .mode-tab {
    min-height: 28px;
    padding-inline: 11px;
    font-size: 10px;
  }

  .round-counter {
    min-width: 48px;
    font-size: 9px;
  }

  .round-current {
    font-size: 12px;
  }

  .game-meta {
    margin-bottom: 8px;
    gap: 5px 8px;
  }

  .game-date {
    font-size: 9.5px;
  }

  .bank-caption {
    display: none;
  }

  .bank-tabs {
    gap: 0;
    padding: 1px;
    border-radius: 6px;
  }

  .bank-tab {
    min-height: 21px;
    padding: 0 5px;
    font-size: 8.5px;
    border-radius: 4px;
  }

  .board {
    width: min(100%, 330px);
    gap: 7px;
  }

  .board-row {
    gap: 7px;
  }

  .tile {
    border-radius: 9px;
    font-size: clamp(23px, 7.8vw, 28px);
  }

  .announcement {
    margin-block: 8px 9px;
    font-size: 9.5px;
  }

  .keyboard {
    gap: 5px;
  }

  .keyboard-row {
    gap: 4px;
  }

  .key {
    height: 45px;
    border-radius: 7px;
    font-size: 11px;
  }

  .key--wide {
    flex: 1.7 1 0;
    max-width: 57px;
    font-size: 7.5px;
  }

  .game-footer {
    margin-top: 10px;
    padding-top: 9px;
  }

  .game-footnote {
    font-size: 8px;
  }

  .hint-button,
  .new-word-button,
  .cheat-link {
    padding-inline: 5px;
    font-size: 9.5px;
  }

  .modal {
    width: calc(100vw - 22px);
    padding: 24px 19px;
    border-radius: 22px;
  }

  .modal h2 {
    font-size: 36px;
  }

  .modal-lead {
    font-size: 11px;
  }

  .help-example {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .help-example .example-board {
    align-self: flex-start;
  }

  .stats-grid strong {
    font-size: 27px;
  }

  .result-word span {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .result-actions .secondary-button {
    min-height: 40px;
  }

  .result-stats {
    gap: 20px;
  }

  .word-info {
    padding: 12px 12px 13px;
  }

  .word-info-meaning {
    font-size: 11px;
  }

  .toast {
    top: 16px;
    bottom: auto;
  }
}

@media (max-width: 370px) {
  :root {
    --page-gutter: 10px;
  }

  .legend {
    gap: 8px;
  }

  .legend-item {
    gap: 5px;
    font-size: 8.5px;
  }

  .game-panel {
    padding: 10px;
    border-radius: 20px;
  }

  .game-meta {
    gap: 4px 6px;
  }

  .game-date {
    font-size: 8.5px;
  }

  .bank-tab {
    min-height: 20px;
    padding-inline: 4px;
    font-size: 8px;
  }

  .game-footnote {
    display: none;
  }

  .keyboard {
    gap: 4px;
  }

  .keyboard-row {
    gap: 3px;
  }

  .key {
    height: 43px;
    border-radius: 6px;
  }

  .key--wide {
    max-width: 52px;
  }

  .board {
    gap: 5px;
  }

  .board-row {
    gap: 5px;
  }

  .tile {
    border-radius: 8px;
  }

  .result-word span {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .game-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .game-date {
    font-size: 9px;
  }

  .bank-picker {
    width: 100%;
  }

  .bank-tabs {
    width: 100%;
    gap: 2px;
    padding: 2px;
  }

  .bank-tab {
    flex: 1 1 0;
    min-width: 0;
    min-height: 25px;
    padding-inline: 2px;
    font-size: 9px;
  }

  .challenge-chip {
    min-height: 25px;
    font-size: 9px;
  }
}

@media (min-width: 901px) and (max-height: 960px) {
  .site-header {
    min-height: 82px;
    padding-block: 12px;
  }

  .hero {
    min-height: 0;
    padding-block: 16px 46px;
  }

  .game-panel {
    padding: 18px;
  }

  .game-top {
    margin-bottom: 12px;
  }

  .game-meta {
    margin-bottom: 9px;
  }

  .board {
    width: min(100%, 316px);
  }

  .tile {
    font-size: 26px;
  }

  .announcement {
    margin-block: 8px 9px;
  }

  .key {
    height: 44px;
  }

  .game-footer {
    margin-top: 10px;
    padding-top: 9px;
  }
}

@media (min-width: 901px) and (max-height: 830px) {
  .site-header {
    min-height: 80px;
    padding-block: 12px;
  }

  .hero {
    min-height: 0;
    padding-block: 10px 28px;
  }

  .intro h1 {
    font-size: clamp(50px, 5.5vw, 74px);
    margin-bottom: 17px;
  }

  .intro-copy {
    font-size: 13px;
    line-height: 1.8;
  }

  .legend {
    margin-top: 19px;
  }

  .record-panel {
    margin-top: 22px;
    padding-top: 17px;
  }

  .record-primary strong {
    font-size: 40px;
  }

  .learn-link {
    margin-top: 18px;
  }

  .game-panel {
    padding: 14px;
  }

  .game-top {
    margin-bottom: 10px;
  }

  .game-meta {
    margin-bottom: 8px;
  }

  .board {
    width: min(100%, 286px);
  }

  .tile {
    font-size: 24px;
  }

  .announcement {
    margin-block: 6px 7px;
  }

  .key {
    height: 40px;
  }

  .game-footer {
    margin-top: 8px;
    padding-top: 7px;
    min-height: 26px;
  }

  .botanical {
    width: 160px;
    height: 190px;
    bottom: -30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
