:root {
  color-scheme: light;
  --ink: #162033;
  --ink-soft: #354156;
  --muted: #737d91;
  --muted-light: #98a1b2;
  --line: #e7eaf1;
  --surface: #ffffff;
  --background: #f5f7fb;
  --accent: #575ce7;
  --accent-deep: #4449cb;
  --accent-soft: #eef0ff;
  --teal: #19b89b;
  --teal-soft: #e9faf6;
  --danger: #e45e55;
  --danger-soft: #fff0ee;
  --shadow-lg: 0 24px 70px rgba(31, 42, 68, 0.1);
  --shadow-md: 0 12px 35px rgba(31, 42, 68, 0.08);
  --shadow-sm: 0 5px 16px rgba(31, 42, 68, 0.07);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --font-sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: max(20px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 6%, rgba(87, 92, 231, 0.12), transparent 27rem),
    radial-gradient(circle at 94% 18%, rgba(25, 184, 155, 0.1), transparent 25rem),
    linear-gradient(180deg, #f8f9fd 0%, #f3f6fb 100%);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(79, 91, 122, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 91, 122, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button {
  font: inherit;
}

button,
.board {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid rgba(87, 92, 231, 0.28);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.page-glow {
  position: fixed;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(18px);
}

.page-glow--one {
  top: -170px;
  left: 48%;
  background: rgba(87, 92, 231, 0.07);
}

.page-glow--two {
  right: -170px;
  bottom: -140px;
  background: rgba(25, 184, 155, 0.07);
}

.app-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 4px;
  width: 42px;
  height: 42px;
  place-content: center;
  border: 1px solid rgba(87, 92, 231, 0.14);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-sm);
}

.brand-mark i {
  display: block;
  border-radius: 3px;
  background: var(--accent);
}

.brand-mark i:nth-child(2),
.brand-mark i:nth-child(3) {
  background: var(--teal);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.brand-copy small {
  color: var(--muted-light);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.best-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid rgba(22, 32, 51, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 0.76rem;
  box-shadow: 0 6px 20px rgba(31, 42, 68, 0.04);
  backdrop-filter: blur(12px);
}

.best-chip__icon {
  color: var(--accent);
  font-size: 1rem;
}

.best-chip strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin: 52px 0 28px;
}

.hero-main {
  max-width: 680px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 15px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.09em;
}

.eyebrow > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(25, 184, 155, 0.1);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.7rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 1;
}

.hero h1 span {
  margin-left: 0.1em;
  color: var(--accent);
}

.hero-copy {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.8;
}

.hero-note {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  padding-bottom: 3px;
}

.hero-note > span {
  color: var(--muted-light);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.focus-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.focus-tags span {
  padding: 7px 11px;
  border: 1px solid rgba(22, 32, 51, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.63);
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.play-card,
.guide-card {
  border: 1px solid rgba(22, 32, 51, 0.065);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.play-card {
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-xl);
}

.play-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  margin: 0 2px 14px;
}

.live-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b9c0cd;
  box-shadow: 0 0 0 4px rgba(185, 192, 205, 0.14);
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.status-dot.is-active {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(25, 184, 155, 0.12);
}

.status-dot.is-paused {
  background: #e5a13a;
  box-shadow: 0 0 0 4px rgba(229, 161, 58, 0.13);
}

.status-dot.is-complete {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(87, 92, 231, 0.12);
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.ghost-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.73rem;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.ghost-button:hover:not(:disabled) {
  border-color: #cfd4e2;
  background: #fafbfe;
}

.ghost-button:active:not(:disabled) {
  transform: translateY(1px);
}

.ghost-button:disabled {
  color: #b4bac7;
  cursor: not-allowed;
}

.board-frame {
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #f0f2f8;
  isolation: isolate;
}

.board-frame::before {
  display: block;
  padding-top: 100%;
  content: "";
}

.board {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: clamp(6px, 1.3vw, 10px);
  padding: clamp(7px, 1.4vw, 11px);
  transition: filter 220ms ease, transform 220ms ease;
}

.board.is-obscured {
  filter: blur(9px);
  transform: scale(1.018);
}

.cell {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 0;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(26, 38, 61, 0.07);
  border-radius: clamp(10px, 1.6vw, 16px);
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  font-size: clamp(1.15rem, 3.3vw, 2rem);
  font-weight: 720;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 12px rgba(31, 42, 68, 0.045);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 100ms ease, opacity 150ms ease;
}

.cell::after {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.7), transparent 52%);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .cell:hover:not(:disabled) {
    border-color: rgba(87, 92, 231, 0.24);
    box-shadow: 0 8px 20px rgba(87, 92, 231, 0.1);
    transform: translateY(-1px);
  }
}

.cell:active:not(:disabled) {
  transform: scale(0.965);
}

.cell:disabled {
  cursor: default;
}

.cell.is-found {
  border-color: rgba(25, 184, 155, 0.12);
  background: var(--teal-soft);
  color: #7cae9f;
  box-shadow: inset 0 0 0 1px rgba(25, 184, 155, 0.07);
  opacity: 0.58;
  animation: cell-found 280ms cubic-bezier(0.2, 0.82, 0.28, 1);
}

.cell.is-found::after {
  opacity: 0.38;
}

.cell.is-wrong {
  border-color: rgba(228, 94, 85, 0.5);
  background: var(--danger-soft);
  color: var(--danger);
  animation: cell-shake 280ms ease;
}

.board-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(245, 247, 251, 0.58);
  backdrop-filter: blur(8px);
}

.overlay-content {
  display: flex;
  width: min(100%, 390px);
  padding: 28px 22px;
  align-items: center;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  text-align: center;
  box-shadow: 0 22px 55px rgba(31, 42, 68, 0.14);
  animation: overlay-in 260ms ease both;
}

.overlay-kicker,
.section-kicker {
  color: var(--accent);
  font-size: 0.63rem;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.overlay-content h2 {
  margin: 10px 0 7px;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  letter-spacing: -0.035em;
}

.overlay-content p {
  max-width: 280px;
  margin: 0 0 19px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.primary-button {
  display: inline-flex;
  min-height: 48px;
  padding: 0 26px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #6267ed, #4e53d8);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(78, 83, 216, 0.26);
  cursor: pointer;
  transition: box-shadow 160ms ease, transform 160ms ease, filter 160ms ease;
}

.primary-button:hover {
  filter: brightness(1.04);
  box-shadow: 0 12px 28px rgba(78, 83, 216, 0.32);
}

.primary-button:active {
  transform: translateY(1px) scale(0.99);
}

.overlay-hint {
  margin-top: 11px;
  color: var(--muted-light);
  font-size: 0.65rem;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 17px 3px 11px;
}

.target-group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.target-label,
.progress-copy span {
  color: var(--muted);
  font-size: 0.72rem;
}

.target-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.progress-copy {
  display: flex;
  align-items: center;
  gap: 7px;
}

.progress-copy strong {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceff5;
}

.progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  transition: width 180ms ease;
}

.side-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stats-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 100% 0%, rgba(101, 107, 236, 0.42), transparent 55%),
    linear-gradient(145deg, #1a2339, #253453);
  color: #fff;
  box-shadow: 0 24px 60px rgba(31, 42, 68, 0.2);
}

.stats-card::after {
  position: absolute;
  right: -35px;
  bottom: -58px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  content: "";
}

.primary-stat {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.stat-label {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.timer {
  margin: 7px 0 2px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stat-note {
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.68rem;
}

.stat-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.mini-stat {
  display: flex;
  min-width: 0;
  padding: 13px;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.mini-stat span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.65rem;
}

.mini-stat strong {
  overflow: hidden;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-card {
  padding: 23px;
  border-radius: var(--radius-xl);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card-heading h2 {
  margin: 5px 0 0;
  font-size: 1.18rem;
  letter-spacing: -0.025em;
}

.guide-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(87, 92, 231, 0.1);
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
}

.steps {
  display: flex;
  margin: 22px 0;
  padding: 0;
  flex-direction: column;
  gap: 14px;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
}

.steps li > span {
  padding-top: 2px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.62;
}

.tip-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 14px;
  background: #f5f7fb;
}

.tip-box > span {
  color: var(--teal);
  font-size: 0.8rem;
}

.tip-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.6;
}

.page-footer {
  display: flex;
  margin-top: 22px;
  padding: 0 4px;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted-light);
  font-size: 0.65rem;
}

.result-dialog {
  width: min(calc(100% - 32px), 430px);
  max-height: calc(100svh - 32px);
  padding: 30px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 26px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(19, 27, 46, 0.3);
}

.result-dialog::backdrop {
  background: rgba(21, 29, 46, 0.48);
  backdrop-filter: blur(5px);
}

.result-dialog[open] {
  animation: dialog-in 240ms ease both;
}

.result-dialog h2 {
  margin: 8px 0 6px;
  font-size: 1.75rem;
  letter-spacing: -0.045em;
}

.result-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 24px 0;
}

.result-grid > div {
  display: flex;
  min-width: 0;
  padding: 13px 9px;
  align-items: center;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8f9fc;
}

.result-grid span {
  color: var(--muted);
  font-size: 0.63rem;
}

.result-grid strong {
  overflow: hidden;
  max-width: 100%;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f2f4f8;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.result-tags {
  display: flex;
  margin-bottom: 11px;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.record-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: #128c76;
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.result-primary {
  width: 100%;
}

.text-button {
  display: block;
  margin: 10px auto 0;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  cursor: pointer;
}

.text-button:hover {
  color: var(--ink);
}

@keyframes cell-found {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(25, 184, 155, 0.22); }
  58% { transform: scale(1.035); box-shadow: 0 0 0 8px rgba(25, 184, 155, 0); }
  100% { transform: scale(1); }
}

@keyframes cell-shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-4px); }
  44% { transform: translateX(4px); }
  68% { transform: translateX(-3px); }
  84% { transform: translateX(2px); }
}

@keyframes overlay-in {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (min-width: 941px) and (max-height: 1050px) {
  body {
    padding-top: 14px;
  }

  .hero {
    margin: 24px 0 18px;
    align-items: center;
  }

  .eyebrow {
    margin-bottom: 10px;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 4.4vw, 3.65rem);
  }

  .hero-copy {
    margin-top: 10px;
    font-size: 0.86rem;
  }

  .play-card {
    padding: 14px;
  }

  .play-toolbar {
    margin-bottom: 10px;
  }

  .board-frame {
    width: min(100%, 560px, max(380px, calc(100svh - 330px)));
  }
}

@media (min-width: 941px) and (max-height: 800px) {
  .hero {
    margin: 14px 0 12px;
  }

  .eyebrow {
    margin-bottom: 8px;
  }

  .hero h1 {
    font-size: 2.85rem;
  }

  .hero-copy {
    display: none;
  }

  .play-card {
    padding: 12px;
  }

  .play-toolbar {
    margin-bottom: 8px;
  }
}

@media (max-width: 940px) {
  .hero {
    align-items: flex-start;
    margin-top: 38px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .side-column {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}

@media (max-width: 680px) {
  body {
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .best-chip {
    min-height: 38px;
    padding: 7px 11px;
  }

  .best-chip > span:not(.best-chip__icon) {
    display: none;
  }

  .hero {
    display: block;
    margin: 32px 0 21px;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 14vw, 3.7rem);
  }

  .hero-copy {
    margin-top: 13px;
    font-size: 0.86rem;
  }

  .hero-note {
    display: none;
  }

  .play-card {
    padding: 12px;
    border-radius: 22px;
  }

  .play-toolbar {
    margin: 1px 2px 11px;
  }

  .ghost-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.69rem;
  }

  .board-frame {
    border-radius: 17px;
  }

  .board {
    gap: 6px;
    padding: 6px;
  }

  .cell {
    border-radius: 10px;
    font-size: clamp(1rem, 6.2vw, 1.45rem);
  }

  .board-overlay {
    padding: 14px;
  }

  .overlay-content {
    padding: 24px 17px;
    border-radius: 18px;
  }

  .overlay-content h2 {
    font-size: 1.25rem;
  }

  .progress-row {
    margin-top: 14px;
  }

  .side-column {
    display: flex;
  }

  .stats-card {
    padding: 21px;
    border-radius: 22px;
  }

  .timer {
    font-size: 2.5rem;
  }

  .guide-card {
    padding: 21px;
    border-radius: 22px;
  }

  .page-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .result-dialog {
    padding: 25px 20px 22px;
    border-radius: 22px;
  }

  .result-grid {
    gap: 6px;
  }

  .result-grid > div {
    padding: 11px 6px;
  }

  .result-grid strong {
    font-size: 0.84rem;
  }
}

@media (max-width: 370px) {
  .brand-copy small {
    display: none;
  }

  .play-toolbar {
    align-items: flex-start;
  }

  .toolbar-actions {
    gap: 5px;
  }

  .ghost-button {
    padding: 0 8px;
  }

  .cell {
    border-radius: 8px;
    font-size: 0.98rem;
  }

  .board {
    gap: 4px;
    padding: 5px;
  }
}

@media (orientation: landscape) and (max-height: 620px) and (max-width: 940px) {
  body {
    padding-top: 12px;
  }

  .hero {
    margin: 18px 0 14px;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero-copy {
    display: none;
  }

  .eyebrow {
    margin-bottom: 9px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    gap: 14px;
  }

  .side-column {
    display: flex;
  }

  .play-card {
    padding: 10px;
  }

  .board-frame {
    width: min(100%, calc(100svh - 190px));
  }

  .play-toolbar {
    margin-bottom: 8px;
  }

  .progress-row {
    margin-top: 10px;
  }

  .stats-card,
  .guide-card {
    padding: 18px;
  }

  .timer {
    font-size: 2rem;
  }

  .stat-grid {
    margin-top: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}