:root {
  --sky-top: #8bd5ff;
  --sky-mid: #c8f1ff;
  --sky-bottom: #fff3ba;
  --grass: #a9df62;
  --grass-dark: #74b72f;
  --ink: #22304d;
  --ink-soft: #50627e;
  --surface: #fff8da;
  --surface-strong: #fffdf0;
  --surface-warm: #ffeaa8;
  --surface-mint: #dff5bc;
  --surface-blue: #dff1ff;
  --surface-pink: #ffe0cc;
  --panel-line: #22304d;
  --pixel-shadow-sm: 0 4px 0 rgba(34, 48, 77, 0.92);
  --pixel-shadow-md: 0 6px 0 rgba(34, 48, 77, 0.92), 0 14px 0 rgba(34, 48, 77, 0.12);
  --pixel-shadow-lg: 0 8px 0 rgba(34, 48, 77, 0.94), 0 18px 0 rgba(34, 48, 77, 0.14);
  --primary: #3b82f6;
  --accent: #20b052;
  --warning: #ffb11a;
  --danger: #ff5b4d;
  --belt-accent: #dde5f0;
  --belt-accent-soft: rgba(221, 229, 240, 0.2);
  --belt-accent-strong: rgba(221, 229, 240, 0.34);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
  overflow-x: clip;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  overflow-y: hidden;
  font-family:
    "Avenir Next",
    "Trebuchet MS",
    "Arial Rounded MT Bold",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 34%, var(--sky-bottom) 67%, var(--grass) 67%, var(--grass-dark) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 255, 255, 0.96) 0 4.5%, transparent 4.7%),
    radial-gradient(circle at 21% 18%, rgba(255, 255, 255, 0.96) 0 3.6%, transparent 3.8%),
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.94) 0 4.4%, transparent 4.6%),
    radial-gradient(circle at 88% 14%, rgba(255, 255, 255, 0.94) 0 3.4%, transparent 3.6%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 2px, transparent 2px 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 28px 28px;
  opacity: 0.52;
  animation: cloudDrift 20s linear infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20vh;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(34, 48, 77, 0.12) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, rgba(34, 48, 77, 0.08) 0 2px, transparent 2px 100%);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, transparent, black 28%);
  opacity: 0.42;
}

button,
input {
  font: inherit;
}

button {
  appearance: none;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

.hidden {
  display: none !important;
}

.glass-card {
  background: none;
  border: none;
  box-shadow: none;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1160px, calc(100% - 24px));
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 14px) 0 calc(var(--safe-bottom) + 28px);
  overflow-x: clip;
}

.app-shell::before {
  content: "";
  position: absolute;
  top: 52px;
  right: 14px;
  width: 88px;
  height: 88px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff9cc 0 44%, #ffd15d 44% 74%, #ffb21d 74% 100%);
  box-shadow: 0 0 0 8px rgba(255, 222, 121, 0.22);
  z-index: 0;
  animation: sunPulse 2.8s ease-in-out infinite;
}

.bg-ornaments {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: clip;
  z-index: 0;
}

.bg-chip {
  position: absolute;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(34, 48, 77, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.34);
  color: rgba(34, 48, 77, 0.46);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  font-weight: 900;
  backdrop-filter: blur(4px);
  animation: chipFloat 9s ease-in-out infinite;
}

.bg-chip--a {
  top: 14%;
  left: 7%;
}

.bg-chip--b {
  top: 24%;
  right: 8%;
  animation-delay: -1.6s;
}

.bg-chip--c {
  top: 46%;
  left: 4%;
  animation-delay: -3.2s;
}

.bg-chip--d {
  top: 54%;
  right: 12%;
  animation-delay: -2.4s;
}

.bg-chip--e {
  bottom: 22%;
  left: 12%;
  animation-delay: -4.4s;
}

.bg-chip--f {
  bottom: 18%;
  right: 6%;
  animation-delay: -5.1s;
}

.app-topbar,
.hero-card,
.progress-panel,
.stat-card,
.mode-card,
.game-hero,
.board-panel,
.controls-panel,
.highlight-panel,
.keypad-panel,
.modal__card {
  position: relative;
  z-index: 1;
}

.app-topbar {
  position: absolute;
  top: calc(var(--safe-top) + 10px);
  left: 10px;
  right: 10px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  pointer-events: none;
}

.app-topbar > * {
  min-width: 0;
  pointer-events: auto;
}

.topbar-hud {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 auto;
}

.nav-chip,
.launch-btn,
.mode-card,
.tool-btn,
.mini-chip,
.digit-chip,
.digit-btn,
.modal__actions button {
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.nav-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 16px;
  border: 2px solid rgba(34, 48, 77, 0.28);
  border-radius: 18px;
  background: var(--surface-strong);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: var(--pixel-shadow-sm);
  justify-self: start;
}

.nav-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 9px 14px;
  border: 2px solid rgba(34, 48, 77, 0.28);
  border-radius: 18px;
  background: rgba(255, 252, 243, 0.94);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: var(--pixel-shadow-sm);
  white-space: nowrap;
}

.nav-status--soft {
  background: rgba(255, 243, 205, 0.94);
}

.nav-status--challenge {
  min-height: 40px;
  padding: 8px 10px;
  background: rgba(219, 238, 255, 0.96);
  color: #1c59b7;
  font-size: 11px;
  flex: 0 0 auto;
}

#timerStat {
  display: inline-block;
  min-width: 4ch;
  text-align: right;
}

.nav-chip--ghost {
  background: linear-gradient(180deg, #fffef3, #ffeaa8);
}

.settings-wrap {
  position: relative;
  flex: 0 0 auto;
}

.nav-chip--settings {
  width: 48px;
  min-width: 48px;
  padding: 0;
  background: linear-gradient(180deg, #fffef3, #f6f8ff);
}

.nav-chip__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-chip__icon--settings {
  width: 22px;
  height: 22px;
}

.nav-chip__icon--settings svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-chip--settings.is-open {
  background: linear-gradient(180deg, #fff7d2, #ffdba0);
  color: var(--ink-soft);
}

.settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: -4px;
  width: min(228px, calc(100vw - 18px));
  overflow: hidden;
  border: 3px solid rgba(34, 48, 77, 0.32);
  border-radius: 18px 18px 14px 14px;
  background: linear-gradient(180deg, rgba(255, 251, 239, 0.99), rgba(241, 247, 255, 0.98));
  box-shadow:
    0 18px 32px rgba(20, 33, 63, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.settings-menu__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 12px;
  border-bottom: 2px solid rgba(34, 48, 77, 0.18);
  background: linear-gradient(180deg, #fff2a8, #ffd982);
}

.settings-menu__title {
  color: #61440e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.settings-menu__section {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.settings-menu__section + .settings-menu__section {
  border-top: 1px solid rgba(72, 96, 132, 0.14);
}

.settings-menu__label {
  color: rgba(50, 71, 99, 0.8);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.settings-toggle,
.settings-segment__btn {
  user-select: none;
  touch-action: manipulation;
}

.settings-toggle {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 10px 11px;
  border: 2px solid rgba(34, 48, 77, 0.14);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(229, 243, 255, 0.96), rgba(208, 231, 255, 0.94));
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.42);
}

.settings-toggle.is-muted {
  background: linear-gradient(180deg, rgba(255, 245, 214, 0.96), rgba(255, 231, 172, 0.94));
}

.settings-toggle__state {
  min-width: 3.4em;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #1c59b7;
}

.settings-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.settings-segment__btn {
  min-height: 40px;
  padding: 10px 0;
  border: 2px solid rgba(34, 48, 77, 0.14);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 248, 255, 0.94));
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.settings-segment__btn.is-active {
  background: linear-gradient(180deg, #fff8d5, #ffe095);
  border-color: rgba(158, 117, 33, 0.34);
  color: #7a4b00;
}

.nav-chip:hover,
.launch-btn:hover,
.mode-card:hover,
.tool-btn:hover,
.mini-chip:hover,
.digit-chip:hover,
.digit-btn:hover,
.modal__actions button:hover {
  transform: translateY(-2px);
  filter: brightness(1.02);
}

.nav-chip:active,
.launch-btn:active,
.mode-card:active,
.tool-btn:active,
.mini-chip:active,
.digit-chip:active,
.digit-btn:active,
.modal__actions button:active {
  transform: translateY(1px);
  box-shadow: none;
}

.view-stack {
  display: grid;
  min-height: 0;
  position: relative;
}

.view {
  display: grid;
  min-height: 0;
  gap: 14px;
}

.view--game {
  gap: 0;
  position: relative;
  z-index: 2;
}

#homeView {
  align-content: start;
  justify-items: start;
  height: 100%;
  padding-bottom: 112px;
}

#homeView.view--backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  padding-bottom: 0;
  overflow: hidden;
}

#homeView.view--backdrop .home-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#homeView.view--backdrop .maple-home-scene__fade {
  background:
    linear-gradient(180deg, rgba(244, 250, 255, 0.1), rgba(243, 200, 99, 0.18) 72%, rgba(29, 44, 78, 0.34) 100%);
}

#gameView {
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
}

.hero-card,
.progress-panel,
.stat-card,
.mode-card,
.board-panel,
.controls-panel,
.highlight-panel,
.keypad-panel,
.game-hero,
.modal__card,
.view-stack,
.view,
.board-layout,
.controls-column,
.board-shell {
  min-width: 0;
}

.hero-card,
.progress-panel,
.stat-card,
.mode-card,
.board-panel,
.controls-panel,
.highlight-panel,
.keypad-panel,
.game-hero,
.modal__card {
  border: 2px solid rgba(34, 48, 77, 0.24);
  border-radius: 30px;
}

.hero-card {
  display: block;
  width: min(520px, 100%);
  gap: 0;
  padding: 8px 0 0;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.hero-card::before {
  display: none;
}

.hero-card::after {
  display: none;
}

.hero-card__copy,
.hero-card__scene {
  position: relative;
  z-index: 1;
}

.hero-card__copy {
  display: grid;
  align-content: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
.hero-stat__value,
.hero-pill__value,
.stat-card__value,
.digit-btn__value,
.modal__title {
  font-family:
    "Arial Rounded MT Bold",
    "Trebuchet MS",
    "Avenir Next",
    sans-serif;
}

h1 {
  margin-top: 10px;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

h2 {
  font-size: clamp(28px, 3.4vw, 34px);
  letter-spacing: -0.04em;
}

h3 {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.hero-card__text,
.mode-card__text,
.game-hero__text,
.stat-card__sub,
.modal__body {
  color: var(--ink-soft);
  line-height: 1.5;
}

.hero-card__text {
  max-width: 38ch;
  margin-top: 12px;
  font-size: 16px;
}

.persona-inline {
  display: grid;
  gap: 2px;
  margin-top: 14px;
}

.persona-inline__name {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.persona-inline__tag {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

.hero-card__hud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.hero-card__scene {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 220px;
  height: 34vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-stat,
.hero-pill,
.stat-card {
  box-shadow: var(--pixel-shadow-sm);
}

.hero-stat,
.hero-pill {
  min-width: 132px;
  padding: 12px 14px;
  border: 2px solid rgba(34, 48, 77, 0.24);
  border-radius: 18px;
  background: var(--surface-strong);
}

.hero-stat__label,
.hero-pill__label {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-stat__value,
.hero-pill__value,
.stat-card__value {
  display: block;
  margin-top: 4px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero-card__ground {
  position: absolute;
  inset: auto 0 0 0;
  height: 108px;
  background:
    linear-gradient(90deg, rgba(34, 48, 77, 0.08) 0 8px, transparent 8px 100%),
    linear-gradient(180deg, rgba(121, 178, 58, 0.1), rgba(121, 178, 58, 0.22)),
    linear-gradient(180deg, #9cd06f 0%, #74b72f 100%);
  background-size: 48px 100%, 100% 100%, 100% 100%;
}

.hero-runner {
  position: absolute;
  bottom: 34px;
  left: 10%;
  width: clamp(78px, 20vw, 104px);
  animation: runnerTrack 7.8s ease-in-out infinite;
}

.hero-runner__shadow {
  position: absolute;
  left: 22%;
  right: 20%;
  bottom: -10px;
  height: 12px;
  border-radius: 999px;
  background: rgba(34, 48, 77, 0.18);
  filter: blur(2px);
  animation: shadowFloat 0.75s ease-in-out infinite;
}

.hero-runner__body {
  position: relative;
  width: 84px;
  height: 92px;
  animation: runnerHop 0.75s ease-in-out infinite;
}

.hero-runner__hood,
.hero-runner__face,
.hero-runner__visor,
.hero-runner__scarf,
.hero-runner__torso,
.hero-runner__belt,
.hero-runner__arm,
.hero-runner__leg {
  position: absolute;
}

.hero-runner__hood {
  top: 2px;
  left: 26px;
  width: 34px;
  height: 36px;
  border-radius: 18px 18px 16px 16px;
  background: linear-gradient(180deg, #2d3955, #162035);
  box-shadow: inset 0 -5px 0 rgba(255, 255, 255, 0.04);
}

.hero-runner__face {
  top: 14px;
  left: 34px;
  width: 18px;
  height: 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f3d5b9, #e6bf9d);
}

.hero-runner__visor {
  top: 16px;
  left: 38px;
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: #f9f7ef;
  box-shadow: 0 0 0 1px rgba(34, 48, 77, 0.16);
}

.hero-runner__torso {
  top: 28px;
  left: 18px;
  width: 46px;
  height: 42px;
  border-radius: 16px 16px 12px 12px;
  background: linear-gradient(180deg, #24324e, #172238);
}

.hero-runner__scarf {
  top: 30px;
  left: 56px;
  width: 24px;
  height: 10px;
  border-radius: 10px 4px 8px 10px;
  background: linear-gradient(90deg, #ff9b6f, #ffb793);
  transform: rotate(-12deg);
  box-shadow: -10px 7px 0 -2px rgba(255, 155, 111, 0.78);
}

.hero-runner__belt {
  top: 52px;
  left: 14px;
  width: 56px;
  height: 10px;
  border-radius: 999px;
  background: var(--belt-accent, #dde5f0);
}

.hero-runner__arm {
  top: 34px;
  width: 12px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, #24324e, #172238);
  transform-origin: top center;
}

.hero-runner__arm--front {
  left: 56px;
  transform: rotate(26deg);
}

.hero-runner__arm--back {
  left: 12px;
  opacity: 0.82;
  transform: rotate(-28deg);
}

.hero-runner__leg {
  top: 60px;
  width: 12px;
  height: 36px;
  border-radius: 999px;
  background: #22304d;
  transform-origin: top center;
}

.hero-runner__leg--front {
  left: 30px;
  transform: rotate(18deg);
}

.hero-runner__leg--back {
  left: 46px;
  transform: rotate(-22deg);
}

.menu-launchers {
  display: grid;
  justify-items: center;
  gap: 12px;
  align-self: center;
  justify-self: center;
  width: min(320px, calc(100vw - 40px));
  margin-top: clamp(24px, 10vh, 96px);
  z-index: 2;
}

.launch-btn {
  min-height: 46px;
  width: 100%;
  padding: 0 18px;
  border: 2px solid rgba(34, 48, 77, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 24px rgba(34, 48, 77, 0.08);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: transform 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.launch-btn:hover {
  transform: translateY(-2px);
}

.launch-btn.is-active {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 28px rgba(34, 48, 77, 0.12);
}

.mode-grid {
  display: grid;
  gap: 12px;
  align-self: center;
  justify-self: center;
  width: min(420px, calc(100vw - 36px));
  margin-top: 6px;
  z-index: 2;
}

.mode-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  overflow: hidden;
  text-align: left;
  border-radius: 22px;
  border: 1px solid rgba(34, 48, 77, 0.14);
  box-shadow: 0 10px 22px rgba(34, 48, 77, 0.06);
  backdrop-filter: blur(10px);
}

.mode-card::before {
  display: none;
}

.mode-card--daily {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.5)),
    linear-gradient(180deg, #dbf3ff 0%, #fff4b2 100%);
}

.mode-card--journey {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.5)),
    linear-gradient(180deg, #def8d2 0%, #bce780 100%);
}

.mode-card.is-complete {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.5)),
    linear-gradient(180deg, #dfffe7 0%, #bff09d 100%);
}

.mode-card__head {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.mode-card__icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(34, 48, 77, 0.28);
  border-radius: 20px;
  background: var(--surface-strong);
  box-shadow: var(--pixel-shadow-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.mode-card__meta,
.board-panel__chips,
.controls-panel__row,
.controls-panel__row--status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mode-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 16px;
  border: 2px solid rgba(34, 48, 77, 0.28);
  border-radius: 16px;
  background: #124d88;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: var(--pixel-shadow-sm);
}

.mode-card--journey .mode-card__cta {
  background: #1f6b2d;
}

.mode-card.is-complete .mode-card__cta {
  background: #1d7c33;
}

.progress-panel,
.game-hero,
.board-panel,
.controls-panel,
.highlight-panel,
.keypad-panel {
  box-shadow: 0 14px 28px rgba(34, 48, 77, 0.08);
}

.progress-panel {
  align-self: end;
  justify-self: center;
  width: min(560px, calc(100vw - 28px));
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.panel-header,
.panel-header--tight {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-header__aside {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

.panel-header--tight {
  align-items: center;
}

.progress-panel .panel-header {
  display: none;
}

.belt-rack {
  position: relative;
  display: flex;
  gap: 10px;
  margin-top: 0;
  overflow-x: auto;
  padding: 0 4px 4px;
  scrollbar-width: none;
}

.belt-rack::before {
  display: none;
}

.belt-rack::-webkit-scrollbar {
  display: none;
}

.belt-pill {
  display: grid;
  gap: 8px;
  min-width: 108px;
  flex: 0 0 108px;
  padding: 14px 10px 10px;
  border: 1px solid rgba(34, 48, 77, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
  text-align: center;
  box-shadow: 0 8px 16px rgba(34, 48, 77, 0.05);
  transition: transform 140ms ease;
}

.belt-pill__swatch {
  height: 14px;
  border: 1px solid rgba(34, 48, 77, 0.16);
  border-radius: 999px;
  background: var(--belt-color, #cbd5e1);
}

.belt-pill__name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.belt-pill__wins {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 800;
}

.belt-pill.is-current {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.82);
}

.belt-pill.is-locked {
  opacity: 0.52;
}

.stats-grid {
  display: none;
}

.stat-card {
  padding: 18px;
  border: 4px solid var(--panel-line);
  border-radius: 24px;
  background: var(--surface-strong);
}

.stat-card:nth-child(1) {
  background: linear-gradient(180deg, #fff8d1, #ffe7b2);
}

.stat-card:nth-child(2) {
  background: linear-gradient(180deg, #ffe8df, #ffd4bf);
}

.stat-card:nth-child(3) {
  background: linear-gradient(180deg, #e1f6ff, #caeaff);
}

.stat-card__sub {
  font-size: 14px;
}

.game-stage {
  display: grid;
  min-height: 0;
  height: 100%;
  padding:
    calc(var(--safe-top) + 74px)
    12px
    calc(var(--safe-bottom) + 12px);
}

.game-frame {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  height: 100%;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
}

.game-frame::before {
  display: none;
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(248px, 0.34fr);
  gap: 10px;
  align-items: stretch;
  min-height: 0;
  height: 100%;
}

.board-panel,
.controls-panel,
.highlight-panel,
.keypad-panel {
  padding: 12px;
  background: rgba(255, 253, 244, 0.74);
  backdrop-filter: blur(8px);
}

.board-panel,
.controls-panel,
.keypad-panel {
  border-radius: 20px;
}

.board-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), transparent 28%),
    rgba(255, 251, 234, 0.9);
}

.board-shell {
  width: min(100%, 70vh, 720px);
  margin: auto;
  padding: 10px;
  border: 4px solid var(--panel-line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.2)),
    #fff7d6;
  box-shadow: inset 0 0 0 4px rgba(34, 48, 77, 0.08), var(--pixel-shadow-md);
}

.board {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 4px solid var(--panel-line);
  border-radius: 16px;
  background: #ffffff;
}

.board-cell {
  position: relative;
  padding: 0;
  border-right: 1px solid rgba(34, 48, 77, 0.14);
  border-bottom: 1px solid rgba(34, 48, 77, 0.14);
  background: #fffef7;
  color: var(--ink);
  transition: background-color 140ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.board-cell:focus-visible,
.launch-btn:focus-visible,
.mode-card:focus-visible,
.tool-btn:focus-visible,
.mini-chip:focus-visible,
.digit-chip:focus-visible,
.digit-btn:focus-visible,
.modal__actions button:focus-visible,
.nav-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.22);
}

.board-cell:nth-child(9n) {
  border-right: none;
}

.board-cell:nth-child(n + 73) {
  border-bottom: none;
}

.board-cell.cell--thick-right {
  border-right: 3px solid var(--panel-line);
}

.board-cell.cell--thick-bottom {
  border-bottom: 3px solid var(--panel-line);
}

.board-cell__inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.board-cell__value {
  font-size: clamp(22px, 2.9vw, 32px);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.board-cell__notes {
  position: relative;
  width: 100%;
  height: 100%;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(8px, 0.92vw, 11px);
  font-weight: 800;
  line-height: 1;
}

.board-cell__note {
  position: absolute;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.board-cell__note.note-pos-1 {
  top: 18%;
  left: 18%;
}

.board-cell__note.note-pos-2 {
  top: 12%;
  left: 38%;
}

.board-cell__note.note-pos-3 {
  top: 12%;
  left: 62%;
}

.board-cell__note.note-pos-4 {
  top: 18%;
  left: 82%;
}

.board-cell__note.note-pos-5 {
  top: 50%;
  left: 84%;
}

.board-cell__note.note-pos-6 {
  top: 82%;
  left: 82%;
}

.board-cell__note.note-pos-7 {
  top: 86%;
  left: 50%;
}

.board-cell__note.note-pos-8 {
  top: 82%;
  left: 18%;
}

.board-cell__note.note-pos-9 {
  top: 50%;
  left: 16%;
}

.board-cell__note.is-on {
  opacity: 1;
}

.board-cell.is-fixed .board-cell__value {
  color: #273654;
}

.board-cell.is-user .board-cell__value {
  color: #145ca3;
}

.board-cell.is-selected {
  background: #cce8ff;
  box-shadow: inset 0 0 0 3px #2177c8;
}

.board-cell.is-peer {
  background: #eef8ff;
}

.board-cell.is-highlight-line {
  background: #e8f9db;
}

.board-cell.is-highlight-block {
  background: #dff0ff;
}

.board-cell.is-same-digit {
  background: #ffe8b1;
}

.board-cell.is-invalid {
  animation: cellShake 360ms ease;
  background: #ffd3cb;
}

.board-cell.is-pop {
  animation: cellPop 260ms ease;
}

.controls-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.controls-panel--game,
.keypad-panel--game {
  display: grid;
  gap: 10px;
  align-content: start;
}

.controls-panel__block {
  display: grid;
  gap: 8px;
}

.controls-panel__labelrow {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.controls-panel--game .controls-panel__row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.controls-panel--game .controls-panel__row--status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tool-btn,
.mini-chip,
.digit-chip,
.digit-btn,
.modal__actions button {
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid rgba(34, 48, 77, 0.28);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: var(--pixel-shadow-sm);
  font-weight: 900;
}

.tool-btn,
.mini-chip,
.digit-chip,
.mode-card__cta,
.status-pill,
.info-pill,
.modal__actions button {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-btn.is-active,
.digit-chip.is-active,
.digit-btn.is-active {
  background: var(--panel-line);
  color: #fff;
}

.tool-btn--soft,
.mini-chip,
.digit-chip {
  background: #fff2bf;
}

.hero-pill--compact {
  min-width: 78px;
  min-height: 44px;
  padding: 7px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 0 rgba(34, 48, 77, 0.92);
}

.tool-btn:disabled,
.mini-chip:disabled,
.digit-chip:disabled,
.digit-btn:disabled,
.modal__actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.status-pill,
.info-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 2px solid rgba(34, 48, 77, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 900;
}

.status-pill--hud {
  min-height: 30px;
  padding: 6px 10px;
  box-shadow: 0 4px 0 rgba(34, 48, 77, 0.92);
}

.info-pill--soft,
.status-pill--soft {
  color: var(--ink-soft);
  background: rgba(255, 242, 191, 0.92);
}

.digit-strip {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
  margin-top: 0;
}

.digit-chip {
  min-height: 42px;
  padding: 8px 0;
  font-size: 16px;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
}

.digit-btn {
  display: grid;
  gap: 3px;
  align-items: center;
  justify-items: center;
  min-height: 72px;
  background: linear-gradient(180deg, #fffef4, #ffefb5);
}

.digit-btn__value {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
}

.digit-btn__meta {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.digit-btn__indicator {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #2c66c6;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 140ms ease, transform 140ms ease;
}

.digit-btn.is-armed {
  border-color: rgba(26, 88, 182, 0.44);
}

.digit-btn.is-armed .digit-btn__indicator {
  opacity: 1;
  transform: scale(1);
}

.digit-btn.is-active .digit-btn__meta {
  color: rgba(255, 255, 255, 0.84);
}

.toast-layer {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-top) + 72px);
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 24px));
  justify-items: center;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 120;
}

.toast {
  min-width: min(360px, calc(100vw - 32px));
  max-width: 420px;
  padding: 14px 16px;
  border: 4px solid var(--panel-line);
  border-radius: 20px;
  background: #fffdf1;
  color: var(--ink);
  box-shadow: var(--pixel-shadow-md);
  animation: toastIn 220ms ease;
}

.toast--success {
  background: #dff7c8;
}

.toast--error {
  background: #ffd6c9;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(130, 191, 255, 0.22);
  backdrop-filter: blur(10px);
  z-index: 140;
}

.modal__card {
  width: min(520px, 100%);
  padding: 24px;
  background: linear-gradient(180deg, #fffdf1, #ffeebf);
  box-shadow: var(--pixel-shadow-lg);
}

.modal__title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.modal__body {
  margin-top: 10px;
  font-size: 16px;
}

.modal__art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  margin-top: 14px;
}

.modal__art--belt {
  min-height: 144px;
  margin-top: 18px;
  margin-bottom: 8px;
  --modal-art-accent: #7db8ff;
}

.modal__belt-ring {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.92) 0 26%, transparent 27%),
    radial-gradient(circle, color-mix(in srgb, var(--modal-art-accent) 68%, white 32%) 0 60%, transparent 61%);
  box-shadow:
    0 0 0 10px color-mix(in srgb, var(--modal-art-accent) 14%, white 86%),
    0 0 32px color-mix(in srgb, var(--modal-art-accent) 34%, white 66%);
  animation: beltModalRing 880ms ease-out infinite alternate;
}

.modal__belt-icon {
  position: relative;
  z-index: 1;
  width: 78px;
  height: 78px;
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 18px rgba(24, 31, 58, 0.18));
  animation: beltModalPop 900ms cubic-bezier(0.2, 0.8, 0.18, 1) both;
}

.modal__belt-label {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #20304f;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.modal__actions button {
  background: #fffef4;
}

.noscript {
  margin: 20px;
  padding: 16px;
  border: 4px solid var(--panel-line);
  border-radius: 20px;
  background: #ffd6c9;
  color: var(--ink);
}

@keyframes cloudDrift {
  from {
    transform: translateX(-10px);
  }
  to {
    transform: translateX(10px);
  }
}

@keyframes sunPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes avatarFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes shadowFloat {
  0%,
  100% {
    transform: scaleX(1);
    opacity: 0.24;
  }
  50% {
    transform: scaleX(0.9);
    opacity: 0.18;
  }
}

@keyframes runnerTrack {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(46%);
  }
}

@keyframes runnerHop {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes auraPulse {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes chipFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -12px, 0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes beltModalPop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.58) rotate(-12deg);
  }
  55% {
    opacity: 1;
    transform: translateY(-6px) scale(1.08) rotate(5deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes beltModalRing {
  0% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.06);
    opacity: 1;
  }
}

@keyframes cellShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-3px);
  }
  40% {
    transform: translateX(3px);
  }
  60% {
    transform: translateX(-2px);
  }
  80% {
    transform: translateX(2px);
  }
}

@keyframes cellPop {
  0% {
    transform: scale(0.92);
  }
  55% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 980px) {
  .hero-card,
  .board-layout {
    grid-template-columns: 1fr;
  }

  .hero-card__scene {
    min-height: 180px;
  }

  .hero-pill {
    min-width: 0;
  }

}

@media (max-width: 760px) {
  .app-shell {
    width: min(100%, calc(100% - 18px));
  }

  .app-shell::before {
    width: 72px;
    height: 72px;
    top: 58px;
  }

  .app-topbar {
    grid-template-columns: auto;
  }

  .hero-card {
    width: min(440px, 100%);
    padding: 0;
  }

  .mode-grid {
    width: min(380px, calc(100vw - 28px));
  }

  .hero-card__hud {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-stat {
    min-width: 0;
  }

  .persona-inline__name {
    font-size: 18px;
  }

  .belt-rack {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-top: 0;
    padding-bottom: 4px;
    margin-top: 14px;
    scrollbar-width: none;
  }

  .belt-rack::-webkit-scrollbar {
    display: none;
  }

  .belt-rack::before {
    display: none;
  }

  .belt-pill {
    min-width: 124px;
    flex: 0 0 124px;
  }

  .digit-strip {
    grid-template-columns: repeat(9, minmax(44px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .digit-strip::-webkit-scrollbar {
    display: none;
  }

  .controls-panel__row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .controls-column {
    gap: 12px;
  }

  .game-frame {
    padding: 0;
    border-radius: 0;
  }

  .board-layout {
    gap: 10px;
  }

  .board-panel,
  .controls-panel,
  .keypad-panel {
    padding: 10px;
    border-radius: 18px;
  }

  .board-shell {
    width: min(100%, calc(100vw - 56px));
    padding: 8px;
    border-radius: 18px;
  }

  .controls-column {
    grid-template-rows: auto auto;
  }

  .keypad-panel--game {
    order: 2;
  }

  .controls-panel--game {
    order: 1;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100%, calc(100% - 14px));
    padding-top: calc(var(--safe-top) + 10px);
  }

  .app-topbar {
    gap: 8px;
  }

  .nav-chip,
  .nav-status {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 11px;
  }

  .hero-card,
  .progress-panel,
  .stat-card,
  .mode-card,
  .board-panel,
  .controls-panel,
  .highlight-panel,
  .keypad-panel,
  .modal__card {
    padding: 16px;
    border-radius: 24px;
  }

  .hero-card {
    width: 100%;
    padding: 0;
  }

  .hero-card__text {
    font-size: 15px;
  }

  .hero-card__hud {
    gap: 10px;
  }

  .hero-card__scene {
    min-height: 132px;
    height: 28vh;
  }

  .board-shell {
    padding: 10px;
    border-radius: 20px;
  }

  .board {
    border-radius: 14px;
  }

  .board-cell__notes {
    font-size: 9px;
  }

  .menu-launchers {
    width: min(280px, calc(100vw - 28px));
  }

  .game-frame {
    padding: 0;
    gap: 0;
    border-radius: 0;
  }

  .hero-pill,
  .hero-pill--compact {
    padding: 8px 10px;
  }

  .hero-pill__value {
    font-size: clamp(17px, 5.2vw, 22px);
  }

  .controls-panel__row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .controls-panel__row--status {
    grid-template-columns: 1fr;
  }

  .status-pill,
  .info-pill {
    width: 100%;
  }

  .digit-strip {
    grid-template-columns: repeat(9, 42px);
    justify-content: start;
  }

  .keypad-grid {
    gap: 8px;
  }

  .digit-btn {
    min-height: 68px;
    padding: 10px 8px;
  }

  .digit-btn__value {
    font-size: 24px;
  }

  .digit-btn__meta {
    font-size: 10px;
    letter-spacing: 0.04em;
  }

  .bg-chip {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 12px;
  }

  .toast-layer {
    top: calc(var(--safe-top) + 64px);
    left: 10px;
    right: 10px;
    width: auto;
    justify-items: stretch;
    transform: none;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

body::before,
body::after,
.app-shell::before {
  display: none;
}

#homeView {
  position: relative;
  gap: 0;
  padding: 0;
  height: 100%;
  overflow: clip;
  border-radius: 30px;
}

.maple-home-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(152, 216, 255, 0.98) 0%, rgba(255, 188, 120, 0.82) 50%, rgba(38, 32, 80, 0.96) 100%),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.34), transparent 22%);
  border: 2px solid rgba(31, 28, 66, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.66),
    0 10px 30px rgba(18, 18, 42, 0.24);
}

.maple-home-scene__canvas,
.maple-home-scene__fade,
.maple-home-scene__glow {
  position: absolute;
  inset: 0;
}

.maple-home-scene__canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.maple-home-scene__fade {
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 0 48%, rgba(8, 10, 26, 0.2) 88%),
    linear-gradient(180deg, rgba(255, 248, 220, 0.04), rgba(20, 16, 44, 0.38));
}

.maple-home-scene__glow {
  pointer-events: none;
  background:
    radial-gradient(circle at 74% 74%, rgba(255, 227, 151, 0.24), transparent 20%),
    radial-gradient(circle at 68% 68%, rgba(255, 255, 255, 0.16), transparent 12%);
  mix-blend-mode: screen;
}

.home-overlay {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  height: 100%;
  padding: 12px;
  pointer-events: none;
}

.home-overlay > * {
  pointer-events: auto;
}

.home-banner,
.mode-card,
.progress-panel {
  border: 3px solid rgba(32, 33, 73, 0.9);
  box-shadow:
    0 10px 0 rgba(20, 20, 48, 0.92),
    0 18px 28px rgba(16, 12, 40, 0.18);
}

.home-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 250, 228, 0.96), rgba(255, 235, 185, 0.94)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.32), transparent);
}

.home-banner__main {
  min-width: 0;
}

.home-banner h1 {
  margin-top: 2px;
  font-size: clamp(1.85rem, 4vw, 2.8rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
}

.home-banner__stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-chipstat {
  min-width: 128px;
  padding: 10px 12px;
  border: 2px solid rgba(38, 39, 78, 0.78);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(218, 238, 255, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.home-chipstat__label {
  display: block;
  margin-bottom: 4px;
  color: rgba(50, 58, 84, 0.72);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-chipstat__value {
  display: block;
  font-size: 1rem;
  font-weight: 900;
}

.home-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 0;
}

.menu-launchers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.launch-btn {
  min-width: 182px;
  min-height: 56px;
  padding: 14px 18px;
  border: 3px solid rgba(26, 31, 76, 0.94);
  border-radius: 999px;
  background:
    linear-gradient(180deg, #fffef4 0%, #ffd99d 52%, #ffbd59 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.52), transparent);
  color: #2a244f;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow:
    0 8px 0 rgba(31, 31, 69, 0.96),
    0 18px 22px rgba(22, 14, 44, 0.14);
}

.launch-btn.is-active {
  transform: translateY(-1px);
  background:
    linear-gradient(180deg, #fffbe4 0%, #d6f0ff 50%, #7bc8ff 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.52), transparent);
  box-shadow:
    0 10px 0 rgba(29, 31, 70, 0.98),
    0 22px 24px rgba(15, 12, 40, 0.2);
}

.mode-grid {
  display: grid;
  justify-items: center;
  width: 100%;
}

.mode-card {
  width: min(430px, 100%);
  padding: 14px 16px 16px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 251, 232, 0.98), rgba(255, 238, 196, 0.96)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.45), transparent);
}

.mode-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.mode-card__badge,
.mode-card__status,
.home-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 2px solid rgba(38, 39, 78, 0.74);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-card__badge {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(228, 243, 255, 0.92));
  color: rgba(36, 44, 74, 0.88);
}

.mode-card__status {
  background: linear-gradient(180deg, rgba(255, 249, 216, 0.98), rgba(255, 223, 138, 0.92));
  color: rgba(46, 39, 16, 0.84);
}

.mode-card.is-complete .mode-card__status {
  background: linear-gradient(180deg, rgba(221, 255, 224, 0.98), rgba(110, 217, 136, 0.92));
  color: rgba(18, 74, 34, 0.92);
}

.mode-card h2 {
  font-size: 1.45rem;
  line-height: 1;
}

.mode-card__text {
  margin-top: 8px;
  font-size: 0.97rem;
  line-height: 1.45;
  color: rgba(55, 60, 88, 0.88);
}

.mode-card__meta {
  margin-top: 12px;
}

.mode-card__cta {
  width: 100%;
  margin-top: 14px;
  min-height: 52px;
  padding: 12px 16px;
  border: 3px solid rgba(26, 31, 76, 0.94);
  border-radius: 18px;
  background: linear-gradient(180deg, #fffaf0 0%, #bee1ff 42%, #6fb7ff 100%);
  color: #20244e;
  font-size: 0.95rem;
  font-weight: 900;
  box-shadow: 0 8px 0 rgba(30, 33, 72, 0.96);
}

.progress-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(248, 244, 255, 0.96), rgba(224, 236, 255, 0.96)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.38), transparent);
}

.progress-panel__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.home-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.home-total {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 241, 198, 0.9));
  color: rgba(39, 43, 74, 0.88);
  letter-spacing: 0.06em;
}

.home-total strong {
  margin-right: 6px;
}

.belt-rack {
  display: flex;
  gap: 10px;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.belt-rack::-webkit-scrollbar {
  display: none;
}

.belt-pill {
  min-width: 98px;
  padding: 10px 10px 12px;
  border: 2px solid rgba(32, 34, 74, 0.8);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(233, 238, 255, 0.93));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.belt-pill__swatch {
  border-radius: 999px;
}

.belt-pill.is-current {
  transform: translateY(-2px);
  box-shadow:
    0 8px 0 rgba(31, 35, 74, 0.94),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.persona-inline {
  margin-top: 10px;
  gap: 8px;
}

.persona-inline__name,
.persona-inline__tag {
  min-height: 30px;
  padding: 6px 10px;
  border: 2px solid rgba(34, 36, 76, 0.76);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.persona-inline__name {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.persona-inline__tag {
  color: rgba(63, 66, 95, 0.92);
  font-size: 0.82rem;
  font-weight: 700;
}

@media (max-width: 900px) {
  .app-shell {
    width: calc(100% - 16px);
    padding-bottom: calc(var(--safe-bottom) + 12px);
  }

  .home-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .home-banner__stats {
    justify-content: flex-start;
  }

  .home-chipstat {
    flex: 1 1 148px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: 100%;
    padding:
      calc(var(--safe-top) + 8px)
      10px
      calc(var(--safe-bottom) + 10px);
  }

  #homeView,
  .maple-home-scene {
    border-radius: 24px;
  }

  .home-overlay {
    gap: 10px;
    padding: 8px;
  }

  .home-banner {
    padding: 12px;
    border-radius: 20px;
  }

  .home-banner h1 {
    font-size: clamp(1.55rem, 7vw, 2.15rem);
  }

  .home-center {
    gap: 12px;
  }

  .menu-launchers {
    flex-direction: column;
    align-items: center;
  }

  .launch-btn {
    width: min(260px, 100%);
    min-width: 0;
    min-height: 54px;
  }

  .mode-card {
    width: min(100%, 360px);
    padding: 12px 13px 14px;
    border-radius: 20px;
  }

  .mode-card__topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .progress-panel {
    gap: 10px;
    padding: 12px;
    border-radius: 20px;
  }

  .progress-panel__head {
    align-items: flex-start;
  }

  .home-totals {
    justify-content: flex-start;
  }

  .panel-header__aside {
    max-width: 160px;
    text-align: right;
  }

  .belt-pill {
    min-width: 92px;
  }
}

/* Maple home override */
.app-shell {
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
}

.view-stack {
  min-height: 100%;
  height: 100%;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
}

.view {
  height: 100%;
}

#homeView {
  position: relative;
  display: block;
  height: 100%;
  min-height: 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-radius: 0;
}

.maple-home-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 0;
  border: none;
  background: linear-gradient(180deg, rgba(133, 210, 255, 0.96), rgba(255, 201, 140, 0.74) 58%, rgba(37, 78, 67, 0.82) 100%);
  box-shadow: none;
}

.maple-home-scene__fade {
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(16, 24, 46, 0.1) 72%, rgba(10, 18, 36, 0.22)),
    radial-gradient(circle at 50% 68%, rgba(255, 220, 162, 0.18), transparent 34%);
}

.maple-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 18, 35, 0.28);
  backdrop-filter: blur(6px);
  transition: opacity 180ms ease;
}

.maple-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.maple-loading__box {
  min-width: min(100%, 250px);
  padding: 14px 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  background: rgba(17, 24, 43, 0.82);
  color: #f7fbff;
  text-align: center;
  box-shadow: 0 12px 28px rgba(10, 12, 24, 0.24);
}

.maple-loading__title {
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.maple-loading__detail {
  margin-top: 6px;
  color: rgba(247, 251, 255, 0.84);
  font-size: 0.88rem;
  line-height: 1.45;
}

.maple-loading__meter {
  position: relative;
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.24);
}

.maple-loading__bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6ac8ff, #ffe58c);
  box-shadow: 0 0 14px rgba(255, 229, 140, 0.28);
  transition: width 180ms ease;
}

.maple-loading__percent {
  margin-top: 8px;
  color: rgba(247, 251, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: start center;
  width: 100%;
  height: 100%;
  padding:
    calc(var(--safe-top) + 72px)
    14px
    calc(var(--safe-bottom) + 14px);
  pointer-events: none;
}

.home-ui,
.scene-arrow {
  pointer-events: auto;
}

.home-ui {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 320px);
  margin: 0 auto;
  align-self: start;
}

.home-page {
  display: none;
  width: 100%;
}

.home-page.is-active {
  display: block;
}

.maple-window {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 2px solid #23314f;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 253, 244, 0.96), rgba(247, 239, 217, 0.94));
  box-shadow:
    0 12px 28px rgba(18, 24, 44, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.maple-window::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(78, 107, 160, 0.28);
  border-radius: 8px;
  pointer-events: none;
}

.maple-window__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 6px 10px;
  border-bottom: 2px solid rgba(24, 36, 62, 0.24);
  background: linear-gradient(180deg, #78b7ff, #3d74df);
  color: #f8fbff;
  text-shadow: 0 1px 0 rgba(24, 36, 62, 0.45);
}

.maple-window__title,
.maple-window__page {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.maple-window__body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.maple-window__body--launcher,
.maple-window__body--progress {
  gap: 12px;
}

.maple-window__body--launcher {
  justify-items: center;
}

.maple-copy {
  color: rgba(37, 49, 79, 0.88);
  font-size: 0.94rem;
  line-height: 1.45;
}

.maple-copy--compact {
  font-size: 0.84rem;
  line-height: 1.35;
}

.belt-hero {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.belt-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 32px;
  padding: 5px 10px;
  border: 2px solid rgba(30, 43, 69, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: rgba(36, 48, 78, 0.92);
  font-size: 0.84rem;
  font-weight: 900;
}

.belt-hero__tag,
.hero-stat,
.home-total,
.belt-pill {
  border: 2px solid rgba(30, 43, 69, 0.18);
}

.belt-hero__tag {
  width: fit-content;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 247, 212, 0.88);
  color: rgba(58, 48, 12, 0.88);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mode-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.daily-home-status {
  min-height: 18px;
  color: rgba(36, 48, 78, 0.82);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}

.mode-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-stat {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.hero-stat__label {
  color: rgba(55, 67, 99, 0.7);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-stat__value {
  font-size: 1rem;
  font-weight: 900;
}

.hero-stat__value--belt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.belt-item-icon {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  flex: 0 0 auto;
}

.launch-btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid #23314f;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 252, 239, 0.98), rgba(255, 232, 166, 0.96));
  color: #24304e;
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-align: center;
  box-shadow:
    0 6px 14px rgba(18, 24, 44, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.launch-btn.is-complete {
  border-color: #24613d;
  background: linear-gradient(180deg, rgba(241, 255, 230, 0.98), rgba(191, 239, 180, 0.96));
  color: #1f4b32;
}

.mini-pill,
.home-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mini-pill {
  background: rgba(255, 255, 255, 0.85);
  color: rgba(36, 48, 78, 0.88);
}

.scene-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid #23314f;
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.92);
  color: #23314f;
  font-size: 1.7rem;
  line-height: 1;
  transform: translateY(-50%);
  box-shadow: 0 8px 18px rgba(18, 24, 44, 0.2);
}

.scene-arrow--left {
  left: 14px;
}

.scene-arrow--right {
  right: 14px;
}

.scene-arrow:disabled {
  opacity: 0.36;
  cursor: default;
  transform: translateY(-50%);
  filter: none;
}

.home-page-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.home-page-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  box-shadow: inset 0 0 0 2px rgba(35, 49, 79, 0.24);
}

.home-page-dot.is-active {
  background: rgba(255, 248, 208, 0.96);
  box-shadow: inset 0 0 0 2px rgba(35, 49, 79, 0.82);
}

.progress-copy {
  display: grid;
  gap: 6px;
}

.home-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.home-total {
  background: rgba(255, 255, 255, 0.78);
  color: rgba(36, 48, 78, 0.88);
}

.belt-rack {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.belt-rack::-webkit-scrollbar {
  display: none;
}

.belt-pill {
  min-width: 86px;
  padding: 10px 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.belt-pill__swatch {
  display: grid;
  place-items: center;
  min-height: 34px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--belt-color);
}

.belt-pill__icon {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}

.belt-pill__name {
  font-size: 0.84rem;
  font-weight: 900;
}

.belt-pill__wins {
  margin-top: 4px;
  color: rgba(55, 67, 99, 0.72);
  font-size: 0.73rem;
  font-weight: 700;
}

.belt-pill__perk {
  margin-top: 5px;
  color: rgba(68, 85, 118, 0.74);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.belt-pill.is-current {
  transform: translateY(-1px);
  border-color: rgba(35, 49, 79, 0.56);
  box-shadow: 0 8px 18px rgba(18, 24, 44, 0.14);
}

@media (max-width: 900px) {
  .home-ui {
    width: min(100%, 304px);
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: 100%;
    padding: 0;
  }

  #homeView,
  .maple-home-scene {
    border-radius: 0;
  }

  .home-overlay {
    padding:
      calc(var(--safe-top) + 62px)
      10px
      calc(var(--safe-bottom) + 10px);
  }

  .home-ui {
    width: min(100%, 280px);
    gap: 8px;
  }

  .maple-window__body {
    padding: 10px;
  }

  .app-topbar {
    top: calc(var(--safe-top) + 8px);
    left: 8px;
    right: 8px;
    gap: 8px;
  }

  .topbar-hud {
    gap: 6px;
  }

  .nav-chip--settings {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .settings-menu {
    top: calc(100% + 8px);
    right: -2px;
    width: min(210px, calc(100vw - 16px));
  }

  .scene-arrow {
    width: 38px;
    height: 38px;
    font-size: 1.45rem;
  }

  .scene-arrow--left {
    left: 8px;
  }

  .scene-arrow--right {
    right: 8px;
  }

  .launch-btn {
    min-height: 42px;
    padding: 9px 10px;
    font-size: 0.82rem;
  }

  .game-stage {
    padding:
      calc(var(--safe-top) + 58px)
      8px
      calc(var(--safe-bottom) + 8px);
  }
}

/* Game controller refresh */
button {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#homeView.view--backdrop .maple-home-scene__fade {
  background:
    linear-gradient(180deg, rgba(100, 178, 255, 0.22), rgba(81, 149, 255, 0.16) 48%, rgba(12, 37, 82, 0.3)),
    radial-gradient(circle at 50% 72%, rgba(122, 196, 255, 0.16), transparent 42%);
}

#gameView {
  position: relative;
}

#gameView::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(108, 184, 255, 0.16), rgba(138, 207, 255, 0.2) 56%, rgba(31, 88, 180, 0.14)),
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.12), transparent 34%);
}

#gameView > * {
  position: relative;
  z-index: 1;
}

.board-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  gap: 14px;
}

.board-panel {
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  backdrop-filter: none;
}

.board-shell {
  width: min(100%, 74vh, 720px);
}

.controls-column {
  width: min(100%, 720px);
  grid-template-rows: auto;
  gap: 12px;
  align-content: end;
  padding: 16px 18px 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(241, 246, 255, 0.82));
  box-shadow:
    0 24px 48px rgba(19, 41, 86, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.controls-panel--game,
.keypad-panel--game {
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
}

.controls-panel--game .controls-panel__row {
  gap: 10px;
}

.tool-btn {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: auto;
  padding: 8px 4px 2px;
  border: none;
  border-radius: 20px;
  background: none;
  box-shadow: none;
  color: #738096;
  font-family:
    "SF Pro Display",
    "Segoe UI",
    system-ui,
    sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

.tool-btn.is-active,
.digit-btn.is-active {
  background: none;
  color: inherit;
}

.tool-btn:hover {
  filter: none;
}

.tool-btn__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(120, 145, 184, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow:
    0 14px 24px rgba(18, 36, 73, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  color: currentColor;
}

.tool-btn__icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-btn__label {
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1;
}

.tool-btn--toggle::after {
  content: attr(data-state);
  position: absolute;
  top: 4px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d8dee8;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.tool-btn--toggle[data-state="ON"]::after {
  background: #2f6dff;
}

.tool-btn.is-active .tool-btn__icon {
  background: linear-gradient(180deg, #66abff, #2f6dff);
  box-shadow:
    0 14px 28px rgba(47, 109, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  color: #ffffff;
}

.tool-btn.is-active .tool-btn__label {
  color: #2f6dff;
}

.keypad-panel--game {
  padding-top: 2px;
}

.keypad-grid {
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: clamp(2px, 0.75vw, 8px);
  align-items: start;
}

.digit-btn {
  display: grid;
  justify-items: center;
  align-items: start;
  gap: 6px;
  min-height: auto;
  padding: 6px 0 0;
  border: none;
  border-radius: 18px;
  background: none;
  box-shadow: none;
  color: #2f6dff;
}

.digit-btn__value {
  font-size: clamp(1.95rem, 4.2vw, 3.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
}

.digit-btn__indicator {
  width: 7px;
  height: 7px;
  margin-top: 2px;
  border-radius: 999px;
  background: #2f6dff;
}

.digit-btn.is-active .digit-btn__value {
  color: #1551c7;
  text-shadow: 0 0 10px rgba(47, 109, 255, 0.14);
}

.digit-btn.is-armed {
  background: rgba(47, 109, 255, 0.1);
}

.digit-btn:disabled {
  opacity: 0.28;
}

.board-cell.is-selected {
  box-shadow: none;
}

@media (max-width: 980px) {
  .controls-column {
    padding: 14px 14px 12px;
    border-radius: 28px;
  }
}

@media (max-width: 760px) {
  .controls-column {
    gap: 10px;
    padding: 12px 12px 10px;
  }

  .controls-panel--game .controls-panel__row {
    gap: 6px;
  }

  .tool-btn {
    gap: 6px;
  }

  .tool-btn__icon {
    width: 48px;
    height: 48px;
  }

  .tool-btn__icon svg {
    width: 22px;
    height: 22px;
  }

  .tool-btn__label {
    font-size: 0.82rem;
  }

  .keypad-grid {
    gap: 1px;
  }

  .digit-btn {
    padding-top: 4px;
  }

  .digit-btn__value {
    font-size: clamp(1.75rem, 8vw, 2.6rem);
  }
}

@media (max-width: 560px) {
  .controls-column {
    gap: 8px;
    padding: 10px 10px 8px;
    border-radius: 26px;
  }

  .tool-btn__icon {
    width: 44px;
    height: 44px;
  }

  .tool-btn__label {
    font-size: 0.78rem;
  }

  .tool-btn--toggle::after {
    top: 2px;
    right: 0;
    min-width: 28px;
    height: 18px;
    font-size: 9px;
  }

  .digit-btn__value {
    font-size: clamp(1.6rem, 8.2vw, 2.3rem);
  }

  .digit-btn__indicator {
    width: 6px;
    height: 6px;
  }
}
