:root {
  color-scheme: dark;
  --color-bg: #07111f;
  --color-bg-deep: #030814;
  --color-surface: rgba(4, 18, 34, 0.74);
  --color-surface-strong: rgba(8, 35, 55, 0.9);
  --color-border: rgba(148, 238, 229, 0.22);
  --color-text: #eef8f6;
  --color-text-muted: #a6bac0;
  --color-text-soft: #6f8994;
  --color-primary: #63f0cf;
  --color-primary-strong: #8fffe0;
  --color-primary-cool: #58c7f5;
  --color-reward: #ffc857;
  --color-error: #ff6f6f;
  --glow-emerald: rgba(99, 240, 207, 0.52);
  --glow-cyan: rgba(88, 199, 245, 0.34);
  --glow-gold: rgba(255, 200, 87, 0.42);
  --node-border-width: 2px;
  --node-border-width-active: 2px;
  --node-icon-size: 1.52rem;
  --node-fill-base: #041320;
  --node-surface: radial-gradient(circle at 40% 24%, #315863, #123647 46%, #041320);
  --node-surface-completed: radial-gradient(circle at 42% 25%, #2f6d66, #0b4249 48%, #041521);
  --node-surface-locked: radial-gradient(circle at 45% 28%, #344a55, #172f3f 54%, #05111f);
  --node-surface-active: radial-gradient(circle at 48% 42%, #24c7a5, #0d806d 34%, #063a3a 60%, #02101b);
  --star-size-completed: 1.02rem;
  --path-height: clamp(82rem, 210svh, 116rem);
  --shadow-glow: 0 0 34px var(--glow-emerald);
  --shadow-quiet: 0 18px 56px rgba(0, 0, 0, 0.38);
  --radius-pill: 999px;
  --radius-panel: 28px;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --font-sans: Sora, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --game-bg: #050d18;
  --game-bg-deep: #020711;
  --game-bg-soft: #071623;
  --game-surface: rgba(7, 27, 38, 0.64);
  --game-surface-strong: rgba(7, 25, 35, 0.88);
  --game-surface-row: rgba(6, 24, 34, 0.38);
  --game-surface-key: linear-gradient(180deg, rgba(31, 68, 82, 0.88), rgba(12, 34, 49, 0.92));
  --game-border: rgba(92, 225, 213, 0.2);
  --game-border-strong: rgba(100, 246, 229, 0.58);
  --game-text: #edf8fb;
  --game-text-muted: #9fb7c2;
  --game-text-soft: #6e8894;
  --game-accent-cyan: #50f0db;
  --game-accent-emerald: #32d874;
  --game-accent-amber: #f0a933;
  --game-accent-gold: #ffc857;
  --game-accent-coral: #e86e74;
  --game-clue-exact: var(--game-accent-emerald);
  --game-clue-misplaced: var(--game-accent-amber);
  --game-clue-miss: rgba(20, 49, 59, 0.72);
  --game-clue-unknown: rgba(8, 20, 30, 0.94);
  --game-glow-active: 0 0 16px rgba(80, 240, 219, 0.2);
  --game-glow-enter: 0 0 14px rgba(50, 224, 199, 0.17);
  --game-glow-success: 0 0 26px rgba(31, 232, 198, 0.14);
  --game-glow-gold: 0 0 10px rgba(255, 200, 87, 0.28);
  --game-radius-sm: 8px;
  --game-radius-md: 10px;
  --game-radius-lg: 16px;
  --game-radius-panel: 20px;
  --game-radius-pill: var(--radius-pill);
  --game-space-1: 0.25rem;
  --game-space-2: 0.375rem;
  --game-space-3: 0.5rem;
  --game-space-4: 0.75rem;
  --game-space-5: 1rem;
  --game-space-6: 1.25rem;
  --game-font-family: var(--font-sans);
  --game-font-weight-strong: 900;
  --game-duration-fast: 100ms;
  --game-duration-base: 160ms;
  --game-duration-row: 200ms;
  --game-duration-sheet: 260ms;
  --game-duration-invalid: 240ms;
  --game-duration-pulse: 2600ms;
  --game-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --game-ease-standard: cubic-bezier(0.2, 0, 0, 1);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-height: 100%;
  background: var(--color-bg-deep);
  font-family: var(--font-sans);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
}

main {
  min-height: 100%;
}

button {
  font: inherit;
}

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

.home-shell {
  position: relative;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--home-background-image, url("/images/home/atmospheric-valley.png")) center / cover no-repeat;
  background-color: var(--color-bg-deep);
}

.home-stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: min(100%, 27rem);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top) + var(--space-6))
    var(--space-4)
    calc(env(safe-area-inset-bottom) + var(--space-3));
}

.home-header {
  align-self: start;
  padding: 0 0 var(--space-4);
}

.brand-mark {
  margin: 0;
  width: min(15rem, 64vw);
  line-height: 0;
  filter: drop-shadow(0 0 18px rgba(79, 219, 233, 0.28));
}

.brand-mark__image {
  display: block;
  width: 100%;
  height: auto;
}

.level-path-scroll {
  --path-scroll-gutter: clamp(12rem, 38dvh, 21rem);
  min-height: 0;
  margin-inline: calc(var(--space-4) * -1);
  background: transparent;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.level-path-scroll::-webkit-scrollbar {
  display: none;
}

.level-path {
  position: relative;
  height: var(--path-height);
  min-height: var(--path-height);
  margin: var(--path-scroll-gutter) 0;
  padding: 0;
  list-style: none;
}

.level-path__line {
  --path-core-width: 1.55;
  --path-future-width: 2.15;
  --path-completed-width: 2.35;
  --path-highlight-width: 0.95;
  --path-glow-outer-width: 10;
  --path-glow-inner-width: 5.4;
  --path-active-glow-width: 4.8;
  --path-glow-outer-opacity-low: 0.08;
  --path-glow-outer-opacity-high: 0.15;
  --path-glow-inner-opacity-low: 0.16;
  --path-glow-inner-opacity-high: 0.28;
  --path-active-glow-opacity-low: 0.2;
  --path-active-glow-opacity-high: 0.42;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.level-path__glow,
.level-path__future,
.level-path__completed,
.level-path__active,
.level-path__core,
.level-path__highlight {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.level-path__glow {
  stroke-width: var(--path-glow-width);
  opacity: var(--path-glow-opacity-low);
  animation: path-glow-pulse 6.8s ease-in-out infinite;
}

.level-path__glow--outer {
  --path-glow-width: var(--path-glow-outer-width);
  --path-glow-opacity-low: var(--path-glow-outer-opacity-low);
  --path-glow-opacity-high: var(--path-glow-outer-opacity-high);
}

.level-path__glow--inner {
  --path-glow-width: var(--path-glow-inner-width);
  --path-glow-opacity-low: var(--path-glow-inner-opacity-low);
  --path-glow-opacity-high: var(--path-glow-inner-opacity-high);
  animation-duration: 5.9s;
  animation-delay: -1.1s;
}

.level-path__future {
  stroke-dasharray: 49 100;
  stroke-width: var(--path-future-width);
  opacity: 0.4;
}

.level-path__completed {
  stroke: rgba(125, 255, 218, 0.66);
  stroke-dasharray: 52 100;
  stroke-dashoffset: -48;
  stroke-width: var(--path-completed-width);
}

.level-path__active {
  stroke: rgba(115, 255, 221, 0.9);
  stroke-dasharray: 18 100;
  stroke-dashoffset: -40;
  stroke-width: var(--path-active-glow-width);
  opacity: var(--path-active-glow-opacity-low);
  animation: path-active-glow-pulse 5.6s ease-in-out infinite;
}

.level-path__core {
  stroke-width: var(--path-core-width);
  opacity: 0.94;
}

.level-path__highlight {
  stroke-dasharray: 16 100;
  stroke-dashoffset: -41;
  stroke-width: var(--path-highlight-width);
  opacity: 0.7;
}

.level-node {
  --marker-size: 3.36rem;
  position: absolute;
  top: var(--node-y);
  left: var(--node-x, 50%);
  display: block;
  width: var(--marker-size);
  height: var(--marker-size);
  transform: translate(-50%, -50%);
}

.level-marker-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  justify-items: center;
  width: var(--marker-size);
  transform: translateX(-50%);
}

.level-marker {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--marker-size);
  aspect-ratio: 1;
  padding: 0;
  border: var(--node-border-width) solid rgba(134, 224, 220, 0.32);
  border-radius: 50%;
  background-color: var(--node-fill-base);
  background-image: var(--node-surface);
  color: var(--color-text);
  box-shadow:
    inset 0 1px 0 rgba(238, 255, 249, 0.12),
    inset 0 -0.65rem 1.1rem rgba(0, 0, 0, 0.24),
    inset 0 0 18px rgba(116, 255, 218, 0.09),
    var(--shadow-quiet);
  transform: translateY(-50%);
}

.level-marker {
  text-decoration: none;
}

button.level-marker,
a.level-marker {
  cursor: pointer;
}

button.level-marker:focus-visible,
a.level-marker:focus-visible {
  outline: 3px solid rgba(143, 255, 224, 0.86);
  outline-offset: 5px;
}

.level-marker[aria-disabled="true"] {
  cursor: default;
  pointer-events: none;
}

.level-marker__icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--node-icon-size);
  height: var(--node-icon-size);
  color: var(--color-primary-strong);
  line-height: 1;
  filter:
    drop-shadow(0 0 5px rgba(226, 255, 248, 0.34))
    drop-shadow(0 0 11px rgba(99, 240, 207, 0.44));
}

.level-marker__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.level-marker__icon-fill {
  fill: currentColor;
}

.level-marker__icon-stroke,
.level-marker__icon-sheen {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.level-marker__icon-stroke {
  stroke-width: 2.4;
}

.level-marker__icon-glow {
  opacity: 0.2;
  stroke-width: 5.2;
}

.level-marker__icon-sheen {
  color: rgba(244, 255, 252, 0.68);
  stroke-width: 1.35;
}

.level-marker__icon-body {
  opacity: 0.16;
}

.level-marker__icon--play {
  width: 2.52rem;
  height: 2.52rem;
  margin-left: 0.2rem;
  color: #effff9;
  filter:
    drop-shadow(0 0 6px rgba(244, 255, 252, 0.42))
    drop-shadow(0 0 18px rgba(143, 255, 224, 0.58));
}

.level-marker__icon--locked {
  width: 1.6rem;
  height: 1.6rem;
  color: rgba(202, 229, 231, 0.9);
  filter: drop-shadow(0 0 8px rgba(116, 203, 214, 0.2));
}

.level-node--active {
  --marker-size: 7.35rem;
  z-index: 2;
}

.level-node--active .level-marker {
  border-width: var(--node-border-width-active);
  border-color: rgba(160, 255, 232, 0.94);
  background-color: var(--node-fill-base);
  background-image: var(--node-surface-active);
  box-shadow:
    inset 0 1px 0 rgba(240, 255, 250, 0.2),
    inset 0 -1rem 1.8rem rgba(0, 0, 0, 0.3),
    inset 0 0 30px rgba(214, 255, 245, 0.18),
    0 0 0 0.2rem rgba(136, 255, 225, 0.38),
    0 0 0 0.78rem rgba(99, 240, 207, 0.13),
    0 0 0 1.55rem rgba(88, 199, 245, 0.05),
    0 0 74px rgba(99, 240, 207, 0.66),
    0 0 128px rgba(82, 212, 239, 0.28),
    var(--shadow-quiet);
  animation: calm-pulse 3.6s ease-in-out infinite;
}

.level-node--active .level-marker::before {
  position: absolute;
  inset: -2.25rem;
  border: 1px solid rgba(255, 202, 92, 0.22);
  border-radius: 50%;
  background:
    radial-gradient(circle at 12% 48%, rgba(255, 210, 107, 0.8) 0 0.12rem, transparent 0.16rem),
    radial-gradient(circle at 88% 34%, rgba(255, 210, 107, 0.72) 0 0.1rem, transparent 0.15rem),
    radial-gradient(circle at 68% 91%, rgba(143, 255, 224, 0.72) 0 0.09rem, transparent 0.14rem);
  box-shadow: 0 0 22px rgba(255, 202, 92, 0.12);
  content: "";
  animation: slow-orbit 16s linear infinite;
}

.level-node--active .level-marker::after {
  position: absolute;
  inset: -3.2rem;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 240, 207, 0.38), rgba(88, 199, 245, 0.16) 43%, transparent 70%);
  content: "";
  filter: blur(9px);
}

.level-node--completed .level-marker {
  border-color: rgba(95, 238, 211, 0.76);
  background-color: var(--node-fill-base);
  background-image: var(--node-surface-completed);
  box-shadow:
    inset 0 1px 0 rgba(238, 255, 249, 0.14),
    inset 0 -0.65rem 1.1rem rgba(0, 0, 0, 0.24),
    inset 0 0 20px rgba(99, 240, 207, 0.14),
    0 0 27px rgba(88, 199, 245, 0.3),
    var(--shadow-quiet);
}

.level-node--locked {
  opacity: 0.74;
}

.level-node--locked .level-marker {
  border-color: rgba(154, 216, 224, 0.34);
  background-color: var(--node-fill-base);
  background-image: var(--node-surface-locked);
  color: rgba(187, 213, 218, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(233, 255, 252, 0.08),
    inset 0 -0.58rem 1rem rgba(0, 0, 0, 0.2),
    inset 0 0 15px rgba(137, 205, 210, 0.07),
    0 0 18px rgba(90, 170, 190, 0.1);
}

.level-node--completed.level-node--active .level-marker {
  border-color: rgba(160, 255, 232, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(240, 255, 250, 0.2),
    inset 0 -1rem 1.8rem rgba(0, 0, 0, 0.3),
    inset 0 0 30px rgba(214, 255, 245, 0.18),
    0 0 0 0.2rem rgba(136, 255, 225, 0.38),
    0 0 0 0.78rem rgba(99, 240, 207, 0.13),
    0 0 74px rgba(99, 240, 207, 0.66),
    var(--shadow-quiet);
}

.level-stars {
  position: absolute;
  top: calc((var(--marker-size) / 2) + 0.24rem);
  left: 50%;
  display: flex;
  justify-content: center;
  gap: 0.14rem;
  color: #ffd66d;
  font-size: var(--star-size-completed);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-shadow:
    0 0 5px rgba(255, 238, 174, 0.38),
    0 0 10px rgba(255, 200, 87, 0.5),
    0 0 20px rgba(255, 161, 72, 0.2);
  transform: translateX(-50%);
}

.level-label {
  position: absolute;
  top: 50%;
  left: calc(100% + 0.55rem);
  display: grid;
  gap: var(--space-1);
  width: clamp(6.8rem, 28vw, 9.5rem);
  transform: translateY(-50%);
}

.level-node--label-left .level-label {
  right: calc(100% + 0.75rem);
  left: auto;
  text-align: right;
}

.level-label__eyebrow {
  color: var(--color-primary);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
}

.level-label__title {
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.level-node:not(.level-node--active) .level-label__eyebrow,
.level-node:not(.level-node--active) .level-label__title {
  color: var(--color-text-muted);
  font-weight: 500;
}

.level-node--placeholder .level-label {
  width: 7.5rem;
}

.home-progress {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-1);
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(154, 239, 230, 0.18);
  border-radius: var(--radius-panel);
  background:
    linear-gradient(180deg, rgba(10, 35, 55, 0.66), rgba(3, 14, 27, 0.78)),
    radial-gradient(ellipse at 50% 0%, rgba(143, 255, 224, 0.08), transparent 72%);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.08),
    inset 0 0 24px rgba(91, 214, 219, 0.05),
    0 18px 56px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px) saturate(1.1);
}

.progress-stat {
  display: grid;
  justify-items: center;
  gap: 0.18rem;
  text-align: center;
}

.progress-stat__icon {
  color: var(--color-reward);
  font-size: 1.15rem;
  line-height: 1;
  text-shadow: 0 0 12px var(--glow-gold);
}

.progress-stat__icon--rank {
  position: relative;
  width: 1.35rem;
  aspect-ratio: 1;
  border: 0.14rem solid currentColor;
  border-radius: 50%;
  color: var(--color-primary-cool);
  box-shadow:
    inset 0 0 10px rgba(99, 240, 207, 0.16),
    0 0 12px rgba(99, 240, 207, 0.38);
}

.progress-stat__icon--rank::before,
.progress-stat__icon--rank::after {
  position: absolute;
  inset: 0.2rem;
  border: 0.1rem solid rgba(99, 240, 207, 0.82);
  border-inline-color: transparent;
  border-radius: 50%;
  content: "";
}

.progress-stat__icon--rank::after {
  inset: 0.44rem -0.2rem;
  border-color: rgba(99, 240, 207, 0.74);
  border-block-color: transparent;
}

.progress-stat__icon--streak {
  position: relative;
  width: 1.12rem;
  aspect-ratio: 1;
  color: var(--color-primary-cool);
  filter: drop-shadow(0 0 10px rgba(99, 240, 207, 0.24));
}

.progress-stat__icon--streak::before,
.progress-stat__icon--streak::after {
  position: absolute;
  content: "";
}

.progress-stat__icon--streak::before {
  inset: 0.1rem 0.32rem 0.18rem;
  border: 0.11rem solid currentColor;
  border-radius: 60% 60% 58% 58%;
  transform: rotate(32deg);
  box-shadow:
    inset 0 0 10px rgba(99, 240, 207, 0.12),
    0 0 12px rgba(99, 240, 207, 0.2);
}

.progress-stat__icon--streak::after {
  inset: 0.34rem 0.46rem 0.28rem;
  border-radius: 999px 999px 50% 50%;
  background: rgba(237, 255, 251, 0.66);
  opacity: 0.72;
  transform: rotate(32deg);
}

.progress-stat__value {
  color: var(--color-text);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.1;
}

.progress-stat__label {
  color: var(--color-text-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-daily-spark {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.72rem;
  width: min(100%, 19rem);
  margin: var(--space-3) auto 0;
  padding: 0.64rem 0.82rem;
  border: 1px solid rgba(154, 239, 230, 0.16);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(12, 41, 60, 0.62), rgba(4, 18, 31, 0.7)),
    radial-gradient(circle at 16% 50%, rgba(99, 240, 207, 0.13), transparent 42%);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.08),
    0 14px 36px rgba(0, 0, 0, 0.22);
  color: rgba(224, 244, 244, 0.9);
  text-align: left;
  backdrop-filter: blur(12px) saturate(1.08);
  animation: daily-spark-arrive 420ms var(--ease-out) both;
}

.home-daily-spark[hidden] {
  display: none !important;
}

.home-daily-spark[data-state="complete"] {
  border-color: rgba(197, 255, 227, 0.24);
  background:
    linear-gradient(180deg, rgba(13, 49, 55, 0.68), rgba(4, 24, 30, 0.74)),
    radial-gradient(circle at 16% 50%, rgba(155, 255, 213, 0.2), transparent 42%);
}

.home-daily-spark__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  border: 1px solid rgba(99, 240, 207, 0.32);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(237, 255, 251, 0.8) 0 10%, rgba(99, 240, 207, 0.34) 11% 26%, rgba(99, 240, 207, 0.08) 27% 100%);
  box-shadow:
    inset 0 0 14px rgba(99, 240, 207, 0.14),
    0 0 18px rgba(99, 240, 207, 0.18);
}

.home-daily-spark__mark::before,
.home-daily-spark__mark::after {
  position: absolute;
  border-radius: inherit;
  content: "";
}

.home-daily-spark__mark::before {
  inset: 0.34rem;
  border: 1px solid rgba(237, 255, 251, 0.62);
}

.home-daily-spark__mark::after {
  inset: 0.82rem;
  background: rgba(237, 255, 251, 0.92);
  box-shadow: 0 0 12px rgba(159, 255, 222, 0.78);
}

.home-daily-spark[data-state="complete"] .home-daily-spark__mark {
  border-color: rgba(204, 255, 222, 0.46);
  background:
    radial-gradient(circle, rgba(255, 255, 241, 0.95) 0 10%, rgba(159, 255, 202, 0.5) 11% 28%, rgba(99, 240, 207, 0.1) 29% 100%);
  box-shadow:
    inset 0 0 16px rgba(159, 255, 202, 0.18),
    0 0 22px rgba(159, 255, 202, 0.24);
}

.home-daily-spark__copy {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
}

.home-daily-spark__title {
  color: rgba(237, 255, 251, 0.94);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.home-daily-spark__text {
  color: rgba(210, 232, 233, 0.78);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

@keyframes daily-spark-arrive {
  from {
    opacity: 0;
    transform: translateY(0.35rem) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.home-dedication {
  margin: var(--space-3) 0 0;
  color: var(--color-text-muted);
  font-size: 0.74rem;
  line-height: 1.4;
  text-align: center;
}

.game-shell {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% -12%, rgba(80, 240, 219, 0.16), transparent 46%),
    radial-gradient(ellipse at 50% 108%, rgba(88, 199, 245, 0.1), transparent 50%),
    linear-gradient(180deg, var(--game-bg-soft), var(--game-bg-deep) 68%);
  color: var(--game-text);
  font-family: var(--game-font-family);
}

.game-shell::before {
  position: absolute;
  inset: -12% -20%;
  pointer-events: none;
  background-image:
    linear-gradient(115deg, transparent 0 47%, rgba(113, 244, 225, 0.045) 48%, transparent 50%),
    linear-gradient(65deg, transparent 0 49%, rgba(91, 196, 235, 0.035) 50%, transparent 52%);
  background-size: 8.5rem 8.5rem, 10rem 10rem;
  content: "";
  opacity: 0.58;
}

.game-column {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: var(--game-space-1);
  width: min(100%, 27rem);
  height: 100dvh;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top) + var(--game-space-4))
    var(--game-space-4)
    calc(env(safe-area-inset-bottom) + var(--game-space-1));
}

.game-brand-header {
  display: grid;
  justify-items: center;
  margin-block: var(--game-space-1);
  line-height: 0;
}

.game-brand-header__image {
  display: block;
  width: min(13rem, 58vw);
  height: auto;
  filter: drop-shadow(0 0 15px rgba(79, 219, 233, 0.24));
}

.game-play-surface {
  display: grid;
  gap: var(--game-space-2);
  padding: var(--game-space-3);
  border: 1px solid rgba(92, 225, 213, 0.16);
  border-radius: var(--game-radius-lg);
  background:
    linear-gradient(180deg, rgba(11, 36, 51, 0.72), rgba(4, 15, 27, 0.78)),
    radial-gradient(ellipse at 50% 0%, rgba(80, 240, 219, 0.1), transparent 70%);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.08),
    inset 0 0 22px rgba(80, 240, 219, 0.035);
}

.game-topbar {
  display: grid;
  grid-template-columns: 2.56rem minmax(0, 1fr) auto 2.56rem;
  align-items: center;
  gap: var(--game-space-2);
  min-height: 2.56rem;
}

.game-icon-button {
  display: grid;
  place-items: center;
  width: 2.56rem;
  min-width: 2.56rem;
  height: 2.56rem;
  border: 1px solid rgba(151, 225, 224, 0.12);
  border-radius: var(--game-radius-pill);
  background: rgba(5, 20, 31, 0.38);
  color: rgba(237, 248, 251, 0.88);
  line-height: 1;
  text-decoration: none;
}

.game-icon-button,
.guess-slot,
.game-guidance__close,
.game-key,
.completion-button {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.game-icon-button svg {
  width: 1.12rem;
  height: 1.12rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.game-icon-button:focus-visible,
.guess-slot:focus-visible,
.game-guidance__close:focus-visible,
.game-key:focus-visible {
  outline: 3px solid rgba(143, 255, 224, 0.78);
  outline-offset: 3px;
}

.game-level {
  min-width: 0;
}

.game-level__eyebrow,
.game-level__title {
  margin: 0;
}

.game-level__eyebrow {
  color: var(--game-accent-cyan);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
}

.game-level__title {
  overflow: hidden;
  color: var(--game-text);
  font-size: 1.04rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-stats {
  display: flex;
  align-items: center;
  gap: var(--game-space-3);
}

.game-stat {
  display: grid;
  justify-items: end;
  gap: 0.1rem;
  min-width: 2.9rem;
  text-align: right;
}

.game-stat__value {
  color: var(--game-text);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
}

.game-stat__label {
  color: var(--game-text-soft);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.current-guess {
  display: grid;
  gap: var(--game-space-1);
  min-width: 0;
}

.guess-slots {
  display: grid;
  grid-template-columns: repeat(var(--game-digit-count, 4), minmax(0, 1fr));
  gap: var(--game-space-2);
}

.guess-slot {
  display: grid;
  place-items: center;
  min-height: 58px;
  padding: 0;
  border: 1px solid rgba(151, 225, 224, 0.2);
  border-radius: var(--game-radius-lg);
  background:
    linear-gradient(180deg, rgba(11, 37, 50, 0.8), rgba(4, 17, 28, 0.92)),
    radial-gradient(ellipse at 50% 0%, rgba(237, 255, 251, 0.055), transparent 74%);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.08),
    inset 0 -0.65rem 1rem rgba(0, 0, 0, 0.16);
  color: var(--game-text);
  font-size: clamp(2rem, 10vw, 2.625rem);
  font-variant-numeric: tabular-nums;
  font-weight: var(--game-font-weight-strong);
  line-height: 1;
  cursor: pointer;
  transition:
    background var(--game-duration-base) var(--game-ease-standard),
    border-color var(--game-duration-base) var(--game-ease-standard),
    box-shadow var(--game-duration-base) var(--game-ease-standard),
    color var(--game-duration-fast) var(--game-ease-standard),
    transform var(--game-duration-fast) var(--game-ease-standard);
}

.guess-slot:disabled {
  cursor: default;
}

.guess-slot--filled {
  background:
    linear-gradient(180deg, rgba(13, 47, 56, 0.92), rgba(4, 18, 29, 0.96)),
    radial-gradient(ellipse at 50% 0%, rgba(237, 255, 251, 0.08), transparent 74%);
}

.guess-slot--changed {
  transform: translateY(-1px);
}

.guess-slot--active {
  border-color: var(--game-border-strong);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.1),
    inset 0 -0.65rem 1rem rgba(0, 0, 0, 0.16),
    var(--game-glow-active);
  animation: game-slot-pulse var(--game-duration-pulse) ease-in-out infinite;
}

.guess-slot--invalid {
  border-color: rgba(232, 110, 116, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.1),
    inset 0 -0.65rem 1rem rgba(0, 0, 0, 0.16),
    0 0 18px rgba(232, 110, 116, 0.2);
  animation: game-invalid-shake var(--game-duration-invalid) var(--game-ease-standard);
}

.current-guess__submit-status {
  min-height: 0.82rem;
  margin: 0;
  color: rgba(151, 225, 224, 0.82);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  opacity: 0;
  transform: translateY(-2px);
  transition:
    opacity var(--game-duration-base) var(--game-ease-standard),
    transform var(--game-duration-base) var(--game-ease-standard);
}

.game-shell[data-game-state="submitting"] .current-guess__submit-status {
  opacity: 1;
  transform: translateY(0);
}

.game-shell[data-game-state="submitting"] [data-game-timer] {
  color: rgba(151, 225, 224, 0.92);
}

.game-shell[data-game-state="submitting"] .guess-slot {
  border-color: rgba(151, 225, 224, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.08),
    inset 0 -0.56rem 0.9rem rgba(0, 0, 0, 0.16);
  animation: none;
}

.game-shell:is([data-game-state="solved"], [data-game-state="save-pending"], [data-game-state="save-failed"]) .guess-slot {
  border-color: rgba(151, 225, 224, 0.18);
  background:
    linear-gradient(180deg, rgba(13, 47, 56, 0.86), rgba(4, 18, 29, 0.94)),
    radial-gradient(ellipse at 50% 0%, rgba(237, 255, 251, 0.06), transparent 74%);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.08),
    inset 0 -0.56rem 0.9rem rgba(0, 0, 0, 0.16);
  color: rgba(237, 248, 251, 0.94);
  cursor: default;
  animation: none;
}

.guess-history {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-block: 1px solid rgba(92, 225, 213, 0.045);
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 34px,
      rgba(92, 225, 213, 0.022) 35px,
      transparent 36px
    );
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 246, 229, 0.36) transparent;
}

.guess-history--empty {
  display: grid;
  align-content: center;
}

.guess-history__helper {
  max-height: 96px;
  margin: 0;
  padding: var(--game-space-2) var(--game-space-3);
  border-left: 2px solid rgba(80, 240, 219, 0.62);
  background: linear-gradient(90deg, rgba(6, 29, 39, 0.46), rgba(5, 17, 28, 0.08));
  color: var(--game-text-muted);
  font-size: 0.74rem;
  line-height: 1.3;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 160ms var(--game-ease-standard),
    opacity 160ms var(--game-ease-standard),
    padding 160ms var(--game-ease-standard),
    transform 160ms var(--game-ease-standard);
}

.guess-history__helper--dismissed {
  max-height: 0;
  padding-block: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-4px);
}

.guess-history__helper-title,
.guess-history__helper-mode,
.guess-history__helper-copy {
  margin: 0;
}

.guess-history__helper-title {
  color: var(--game-text);
  font-weight: 800;
}

.guess-history__helper-mode {
  margin-block-start: 0.18rem;
  color: var(--game-accent-cyan);
  font-size: 0.7rem;
  font-weight: 900;
}

.guess-history__helper-copy {
  margin-block-start: 0.28rem;
}

.game-guidance {
  position: absolute;
  z-index: 2;
  inset: var(--game-space-2) 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  gap: var(--game-space-2);
  padding: var(--game-space-2) var(--game-space-3);
  border-left: 2px solid rgba(80, 240, 219, 0.68);
  background: linear-gradient(90deg, rgba(5, 22, 32, 0.96), rgba(4, 15, 27, 0.84));
  color: var(--game-text-muted);
  font-size: 0.74rem;
  line-height: 1.3;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.game-guidance[hidden] {
  display: none;
}

.game-guidance__title,
.game-guidance__mode,
.game-guidance__copy {
  margin: 0;
}

.game-guidance__title {
  color: var(--game-text);
  font-weight: 800;
}

.game-guidance__mode {
  margin-block-start: 0.18rem;
  color: var(--game-accent-cyan);
  font-size: 0.7rem;
  font-weight: 900;
}

.game-guidance__copy {
  margin-block-start: 0.28rem;
}

.game-guidance__close {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(151, 225, 224, 0.14);
  border-radius: var(--game-radius-pill);
  background: rgba(5, 20, 31, 0.5);
  color: var(--game-text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.guess-history__list {
  display: grid;
  align-content: start;
  gap: 0.125rem;
  min-height: 0;
  margin: 0;
  padding: 0.125rem 0;
  list-style: none;
}

.guess-history--empty .guess-history__list {
  display: none;
}

.guess-history__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(4.45rem, auto);
  align-items: center;
  gap: 0.3125rem;
  min-height: 34px;
  padding: 0.125rem 0.25rem;
  border-block-end: 1px solid rgba(92, 225, 213, 0.08);
  background: rgba(6, 24, 34, 0.16);
  transition:
    background var(--game-duration-base) var(--game-ease-standard),
    border-color var(--game-duration-base) var(--game-ease-standard);
}

.guess-history__row--new {
  animation: game-row-insert var(--game-duration-row) var(--game-ease-out);
}

.guess-history__digits {
  display: grid;
  grid-template-columns: repeat(var(--game-digit-count, 4), minmax(0, 1fr));
  gap: 0.15rem;
  min-width: 0;
}

.guess-history__tile {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 27px;
  border: 1px solid rgba(151, 225, 224, 0.12);
  border-radius: 6px;
  color: var(--game-text);
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
}

.guess-history__tile--exact {
  border-color: rgba(50, 216, 116, 0.7);
  background: linear-gradient(180deg, rgba(28, 135, 80, 0.9), rgba(9, 79, 55, 0.92));
}

.guess-history__tile--misplaced {
  border-color: rgba(240, 169, 51, 0.72);
  background: linear-gradient(180deg, rgba(127, 93, 32, 0.92), rgba(75, 55, 20, 0.94));
}

.guess-history__tile--miss {
  border-color: rgba(111, 202, 222, 0.5);
  border-style: dashed;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(151, 225, 224, 0.14) 0,
      rgba(151, 225, 224, 0.14) 2px,
      transparent 2px,
      transparent 7px
    ),
    var(--game-clue-miss);
  color: rgba(237, 248, 251, 0.8);
}

.guess-history__tile--unknown,
.guess-history__tile--withheld {
  border-color: rgba(151, 225, 224, 0.14);
  background:
    linear-gradient(180deg, rgba(14, 31, 43, 0.92), var(--game-clue-unknown));
  color: rgba(237, 248, 251, 0.9);
}

.guess-history__summary {
  display: grid;
  grid-template-columns: repeat(var(--game-summary-count, 2), 1.75rem);
  align-items: center;
  justify-content: end;
  gap: 0.25rem;
  min-width: 4.45rem;
  font-variant-numeric: tabular-nums;
}

.guess-history__summary-pair {
  display: grid;
  grid-template-columns: 0.5rem 0.9rem;
  align-items: center;
  gap: 0.2rem;
  justify-content: end;
}

.guess-history__summary-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: var(--game-radius-pill);
}

.guess-history__summary-dot--exact {
  background: var(--game-clue-exact);
}

.guess-history__summary-dot--misplaced {
  background: var(--game-clue-misplaced);
}

.guess-history__summary-dot--miss {
  border: 1px dashed rgba(111, 202, 222, 0.7);
  background: var(--game-clue-miss);
}

.guess-history__summary-count {
  min-width: 0.9rem;
  color: var(--game-text);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  text-align: left;
}

.game-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--game-space-1);
}

.game-key {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid rgba(151, 225, 224, 0.18);
  border-radius: var(--game-radius-sm);
  background: var(--game-surface-key);
  color: var(--game-text);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.09),
    inset 0 -0.42rem 0.78rem rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(151, 225, 224, 0.08);
  font-size: 1.28rem;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition:
    background var(--game-duration-base) var(--game-ease-standard),
    border-color var(--game-duration-base) var(--game-ease-standard),
    box-shadow var(--game-duration-base) var(--game-ease-standard),
    color var(--game-duration-base) var(--game-ease-standard),
    opacity var(--game-duration-base) var(--game-ease-standard),
    transform var(--game-duration-fast) var(--game-ease-standard);
}

.game-key:disabled {
  cursor: default;
}

.game-key:active,
.game-key--pressed {
  transform: translateY(1px);
  border-color: rgba(151, 225, 224, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.04),
    inset 0 0.3rem 0.8rem rgba(0, 0, 0, 0.28);
}

.game-key:disabled {
  opacity: 0.66;
}

.game-key--used {
  border-color: rgba(151, 225, 224, 0.1);
  color: rgba(237, 248, 251, 0.54);
  box-shadow: inset 0 1px 0 rgba(237, 255, 251, 0.04);
}

.game-key--position-blocked {
  border-color: rgba(111, 202, 222, 0.52);
  border-style: dashed;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(151, 225, 224, 0.13) 0,
      rgba(151, 225, 224, 0.13) 2px,
      transparent 2px,
      transparent 8px
    ),
    linear-gradient(180deg, rgba(19, 50, 61, 0.8), rgba(6, 23, 35, 0.9));
  color: rgba(237, 248, 251, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.07),
    inset 0 -0.36rem 0.72rem rgba(0, 0, 0, 0.16);
}

.game-key--invalid {
  border-color: rgba(232, 110, 116, 0.72);
  color: #f5c7ca;
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.08),
    0 0 12px rgba(232, 110, 116, 0.14);
  animation: game-invalid-shake var(--game-duration-invalid) var(--game-ease-standard);
}

.game-key--secondary {
  color: #d5e4e7;
  font-size: 1.15rem;
}

.game-key--enter {
  color: rgba(237, 248, 251, 0.72);
}

.game-key--enter svg {
  width: 1.34rem;
  height: 1.34rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.game-key--enter[aria-disabled="true"] {
  border-color: rgba(151, 225, 224, 0.12);
  background: linear-gradient(180deg, rgba(25, 52, 64, 0.58), rgba(9, 25, 38, 0.72));
  color: var(--game-text-soft);
  box-shadow: inset 0 1px 0 rgba(237, 255, 251, 0.05);
}

.game-key--enter.game-key--ready {
  border-color: rgba(100, 246, 229, 0.38);
  background:
    linear-gradient(180deg, rgba(34, 128, 116, 0.86), rgba(14, 74, 75, 0.92)),
    radial-gradient(ellipse at 50% 0%, rgba(237, 255, 251, 0.14), transparent 72%);
  color: var(--game-text);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.16),
    inset 0 -0.45rem 0.8rem rgba(0, 0, 0, 0.16),
    var(--game-glow-enter);
}

.game-key--enter.game-key--submitting {
  border-color: rgba(100, 246, 229, 0.34);
  background:
    linear-gradient(180deg, rgba(28, 94, 91, 0.78), rgba(11, 54, 61, 0.86)),
    radial-gradient(ellipse at 50% 0%, rgba(237, 255, 251, 0.12), transparent 72%);
  color: rgba(237, 248, 251, 0.86);
}

.completion-sheet {
  position: absolute;
  z-index: 4;
  inset: auto var(--game-space-4) calc(env(safe-area-inset-bottom) + 2.15rem);
  max-height: calc(100dvh - 3rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(100, 246, 229, 0.2);
  border-radius: var(--game-radius-panel);
  background:
    linear-gradient(180deg, rgba(8, 31, 43, 0.97), rgba(4, 14, 25, 0.985)),
    radial-gradient(ellipse at 50% 0%, rgba(80, 240, 219, 0.1), transparent 68%);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.1),
    0 -18px 52px rgba(0, 0, 0, 0.32),
    var(--game-glow-success);
  animation: game-sheet-reveal var(--game-duration-sheet) var(--game-ease-out);
}

.completion-sheet[hidden] {
  display: none;
}

.completion-sheet--action-guarded .completion-sheet__name,
.completion-sheet--action-guarded .completion-sheet__actions {
  pointer-events: none;
}

.completion-sheet__body {
  display: grid;
  gap: 0.875rem;
  padding: var(--game-space-5);
  text-align: center;
}

.completion-sheet__eyebrow {
  margin: 0;
  color: rgba(80, 240, 219, 0.9);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.completion-sheet__number {
  justify-self: center;
  min-width: 10.75rem;
  padding: 0.68rem 1.1rem;
  border: 1px solid rgba(100, 246, 229, 0.34);
  border-radius: var(--game-radius-pill);
  background:
    linear-gradient(180deg, rgba(25, 104, 92, 0.76), rgba(8, 49, 48, 0.84)),
    radial-gradient(ellipse at 50% 0%, rgba(237, 255, 251, 0.22), transparent 72%);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.16),
    0 0 18px rgba(80, 240, 219, 0.2),
    0 0 42px rgba(31, 232, 198, 0.18);
  color: var(--game-text);
  font-size: 1.94rem;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
}

.completion-sheet__stars {
  display: grid;
  grid-template-columns: repeat(3, 1.7rem);
  justify-content: center;
  gap: var(--game-space-1);
  min-height: 1.7rem;
  font-size: 1.32rem;
  font-weight: 900;
  line-height: 1;
}

.completion-sheet__star {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  position: relative;
}

.completion-sheet__star-empty,
.completion-sheet__star-fill {
  grid-area: 1 / 1;
}

.completion-sheet__star-fill {
  color: var(--game-accent-gold);
  filter: drop-shadow(0 0 8px rgba(255, 200, 87, 0.24));
  text-shadow:
    0 0 9px rgba(255, 200, 87, 0.32),
    0 0 18px rgba(240, 169, 51, 0.14);
  animation: game-star-reveal 300ms var(--game-ease-out) both;
  animation-delay: var(--star-delay, 520ms);
}

.completion-sheet__star-empty {
  color: rgba(224, 210, 177, 0.42);
  text-shadow: 0 0 6px rgba(255, 200, 87, 0.08);
}

.completion-sheet__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--game-space-2);
  margin: 0;
}

.completion-sheet__stats div {
  display: grid;
  gap: 0.18rem;
  padding: var(--game-space-2) var(--game-space-1);
  border-block: 1px solid rgba(92, 225, 213, 0.065);
}

.completion-sheet__stats dt,
.completion-sheet__stats dd {
  margin: 0;
}

.completion-sheet__stats dt {
  color: var(--game-text-soft);
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.completion-sheet__stats dd {
  color: rgba(237, 248, 251, 0.9);
  font-size: 0.96rem;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
}

.completion-sheet__save {
  display: grid;
  gap: 0.18rem;
  color: var(--game-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
}

.completion-sheet__save span:first-child {
  color: rgba(237, 248, 251, 0.88);
}

.completion-sheet__name {
  display: grid;
  gap: var(--game-space-2);
  text-align: left;
}

.completion-sheet__name[hidden] {
  display: none;
}

.completion-sheet__name label {
  color: var(--game-text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.completion-sheet__name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--game-space-2);
}

.completion-sheet__name input {
  min-width: 0;
  min-height: 42px;
  padding: 0 var(--game-space-3);
  border: 1px solid rgba(151, 225, 224, 0.18);
  border-radius: var(--game-radius-sm);
  background: rgba(5, 20, 31, 0.72);
  color: var(--game-text);
  font: inherit;
}

.completion-sheet__actions {
  display: grid;
  gap: 0.625rem;
}

.completion-button {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 var(--game-space-4);
  border: 1px solid rgba(151, 225, 224, 0.18);
  border-radius: var(--game-radius-sm);
  background: rgba(5, 20, 31, 0.64);
  color: var(--game-text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--game-duration-base) var(--game-ease-standard),
    border-color var(--game-duration-base) var(--game-ease-standard),
    box-shadow var(--game-duration-base) var(--game-ease-standard),
    color var(--game-duration-base) var(--game-ease-standard),
    transform var(--game-duration-fast) var(--game-ease-standard);
}

.completion-button[hidden] {
  display: none;
}

.completion-button:hover {
  border-color: rgba(151, 225, 224, 0.28);
  background: rgba(12, 39, 51, 0.76);
}

.completion-button:active {
  transform: translateY(1px);
}

.completion-button:focus-visible,
.completion-sheet__name input:focus-visible {
  outline: 3px solid rgba(143, 255, 224, 0.78);
  outline-offset: 3px;
}

.completion-button--primary {
  min-height: 46px;
  border-color: rgba(100, 246, 229, 0.44);
  background:
    linear-gradient(180deg, rgba(35, 134, 120, 0.94), rgba(14, 80, 78, 0.98)),
    radial-gradient(ellipse at 50% 0%, rgba(237, 255, 251, 0.14), transparent 72%);
  box-shadow: var(--game-glow-enter);
}

.completion-button--primary:hover {
  border-color: rgba(143, 255, 224, 0.52);
  background:
    linear-gradient(180deg, rgba(39, 144, 129, 0.96), rgba(15, 84, 82, 0.98)),
    radial-gradient(ellipse at 50% 0%, rgba(237, 255, 251, 0.16), transparent 72%);
}

.completion-button--secondary {
  background: linear-gradient(180deg, rgba(26, 58, 70, 0.82), rgba(10, 29, 43, 0.9));
}

.completion-button--tertiary {
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  color: var(--game-text-muted);
  font-size: 0.78rem;
}

.game-footer {
  min-height: 1.25rem;
  color: rgba(159, 183, 194, 0.62);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.game-shell:is([data-game-state="solved"], [data-game-state="save-pending"], [data-game-state="save-failed"]) .game-play-surface {
  border-color: rgba(100, 246, 229, 0.26);
}

.game-shell:is([data-game-state="solved"], [data-game-state="save-pending"], [data-game-state="save-failed"]) .guess-history,
.game-shell:is([data-game-state="solved"], [data-game-state="save-pending"], [data-game-state="save-failed"]) .game-keypad {
  pointer-events: none;
}

.game-shell:is([data-game-state="solved"], [data-game-state="save-pending"], [data-game-state="save-failed"]) .game-key {
  border-color: rgba(151, 225, 224, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(237, 255, 251, 0.04),
    inset 0 -0.32rem 0.66rem rgba(0, 0, 0, 0.18);
  filter: saturate(0.82);
  opacity: 0.58;
}

@media (max-width: 23.375rem) {
  .game-column {
    padding-inline: var(--game-space-3);
  }

  .guess-slots {
    gap: var(--game-space-2);
  }

  .game-topbar {
    grid-template-columns: 2.5rem minmax(0, 1fr) auto 2.5rem;
    gap: var(--game-space-2);
  }

  .guess-history__row {
    grid-template-columns: minmax(0, 1fr) 4.1rem;
    padding-inline: 0.1875rem;
  }

  .guess-history__summary {
    grid-template-columns: repeat(2, 1.82rem);
    min-width: 4.1rem;
    gap: 0.2rem;
  }

  .game-icon-button {
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
  }
}

@media (max-width: 40rem) {
  .game-key {
    min-height: 54px;
  }
}

@media (max-height: 48.75rem) {
  .game-column {
    padding-block:
      calc(env(safe-area-inset-top) + var(--game-space-3))
      calc(env(safe-area-inset-bottom) + var(--game-space-1));
  }

  .game-play-surface {
    padding: var(--game-space-3);
  }

  .game-brand-header__image {
    width: min(12.25rem, 56vw);
  }

  .guess-slot {
    min-height: 54px;
  }

  .game-key {
    min-height: 50px;
  }
}

@media (max-height: 45rem) {
  .game-column {
    gap: var(--game-space-1);
    padding-block:
      calc(env(safe-area-inset-top) + var(--game-space-2))
      calc(env(safe-area-inset-bottom) + var(--game-space-1));
  }

  .game-play-surface {
    gap: var(--game-space-1);
    padding: var(--game-space-2);
  }

  .game-brand-header {
    margin-block: 0 var(--game-space-1);
  }

  .game-brand-header__image {
    width: min(11.75rem, 54vw);
  }

  .game-topbar {
    grid-template-columns: 2.42rem minmax(0, 1fr) auto 2.42rem;
    min-height: 2.42rem;
  }

  .game-icon-button {
    width: 2.42rem;
    min-width: 2.42rem;
    height: 2.42rem;
  }

  .guess-slot {
    min-height: 50px;
  }

  .guess-history__helper {
    max-height: 84px;
    padding-block: var(--game-space-1);
  }

  .guess-history__row {
    min-height: 32px;
  }

  .guess-history__tile {
    height: 26px;
  }

  .game-key {
    min-height: 48px;
  }

  .game-footer {
    min-height: 1.2rem;
    font-size: 0.72rem;
  }
}

@media (max-height: 42.5rem) {
  .game-column {
    gap: 0.1875rem;
    padding-inline: var(--game-space-3);
  }

  .game-level__title {
    font-size: 0.94rem;
  }

  .game-level__eyebrow,
  .game-stat__label {
    font-size: 0.58rem;
  }

  .game-stats {
    gap: var(--game-space-2);
  }

  .guess-slots {
    gap: var(--game-space-1);
  }

  .guess-slot {
    min-height: 46px;
    border-radius: var(--game-radius-md);
    font-size: clamp(1.76rem, 9vw, 2.2rem);
  }

  .guess-history__helper {
    max-height: 72px;
    font-size: 0.68rem;
    line-height: 1.22;
  }

  .guess-history__helper-copy,
  .game-guidance__copy {
    margin-block-start: 0.18rem;
  }

  .guess-history__row {
    min-height: 30px;
  }

  .guess-history__tile {
    height: 24px;
    font-size: 0.9rem;
  }

  .guess-history__summary-count {
    font-size: 0.92rem;
  }

  .game-keypad {
    gap: var(--game-space-1);
  }

  .game-key {
    min-height: 48px;
    font-size: 1.14rem;
  }

  .completion-sheet {
    inset-inline: var(--game-space-3);
    inset-block-end: calc(env(safe-area-inset-bottom) + 1.75rem);
    max-height: calc(100dvh - 2.4rem);
  }

  .completion-sheet__body {
    gap: var(--game-space-3);
    padding: var(--game-space-4);
  }
}

@keyframes calm-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: saturate(1);
  }

  50% {
    transform: scale(1.025);
    filter: saturate(1.12);
  }
}

@keyframes game-invalid-shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-3px);
  }

  50% {
    transform: translateX(3px);
  }

  75% {
    transform: translateX(-2px);
  }
}

@keyframes game-row-insert {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes game-slot-pulse {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(237, 255, 251, 0.1),
      inset 0 -0.65rem 1rem rgba(0, 0, 0, 0.16),
      0 0 12px rgba(80, 240, 219, 0.18);
  }

  50% {
    box-shadow:
      inset 0 1px 0 rgba(237, 255, 251, 0.12),
      inset 0 -0.65rem 1rem rgba(0, 0, 0, 0.16),
      0 0 20px rgba(80, 240, 219, 0.28);
  }
}

@keyframes game-sheet-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes game-star-reveal {
  from {
    opacity: 0;
    transform: scale(0.88);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slow-orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes path-glow-pulse {
  0%,
  100% {
    opacity: var(--path-glow-opacity-low);
  }

  50% {
    opacity: var(--path-glow-opacity-high);
  }
}

@keyframes path-active-glow-pulse {
  0%,
  100% {
    opacity: var(--path-active-glow-opacity-low);
  }

  50% {
    opacity: var(--path-active-glow-opacity-high);
  }
}

@media (min-width: 48rem) {
  .home-stage {
    --path-height: clamp(94rem, 205svh, 118rem);
    width: min(100%, 29rem);
    padding-block: 2.5rem var(--space-5);
  }

  .brand-mark {
    width: 17rem;
  }

  .level-path-scroll {
    margin-inline: 0;
  }

  .level-path {
    padding-inline: 0;
  }

  .level-path__line {
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .level-node {
    left: var(--node-x-desktop, var(--node-x, 50%));
  }
}

@media (max-height: 30rem) {
  .home-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .home-stage {
    height: auto;
    min-height: 100dvh;
  }

  .level-path-scroll {
    overflow-y: visible;
  }
}

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

  .guess-slot--active,
  .completion-sheet__star-fill {
    animation: none !important;
  }
}
