:root {
  --bg: #050505;
  --panel: #111111;
  --panel-strong: #1b1b1b;
  --ink: #f4f4ef;
  --muted: #afb3ad;
  --line: #272727;
  --accent: #39b8ff;
  --accent-soft: rgba(57, 184, 255, 0.16);
  --success: #19c44a;
  --warn: #ffe44d;
  --danger: #d71920;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --stage-solid: #0a0a0a;
  --stage-overlay-line: rgba(255, 255, 255, 0.08);
  --stage-chip: rgba(12, 12, 12, 0.86);
}

body[data-theme="light"] {
  --bg: #eef4f4;
  --panel: #ffffff;
  --panel-strong: #f4f7f7;
  --ink: #0f2026;
  --muted: #5f7076;
  --line: #d9e1e3;
  --accent: #39b8ff;
  --accent-soft: rgba(57, 184, 255, 0.14);
  --success: #19c44a;
  --warn: #ffe44d;
  --danger: #d71920;
  --shadow: 0 16px 34px rgba(15, 32, 38, 0.08);
  --stage-solid: #ffffff;
  --stage-overlay-line: rgba(9, 35, 47, 0.08);
  --stage-chip: rgba(255, 255, 255, 0.92);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Atkinson Hyperlegible Next", "Avenir Next", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 34px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hero {
  margin-bottom: 16px;
}

.hero-topbar,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-topbar {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  width: 86px;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-mark img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  display: block;
}

.brand-copy {
  display: grid;
  gap: 5px;
}

.eyebrow,
.step-label {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.hero-actions,
.button-row,
.exercise-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions {
  align-items: center;
  justify-content: flex-end;
}

.theme-dock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.theme-icon,
.hero-action,
.primary,
.secondary {
  border: 1px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.theme-icon {
  width: 42px;
  height: 42px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.theme-icon.is-active {
  background: var(--accent);
  color: #04111a;
  border-color: transparent;
}

.hero-action,
.primary,
.secondary {
  min-height: 62px;
  padding: 16px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel-strong);
  font-weight: 700;
}

.primary {
  background: var(--success);
  color: #ffffff;
  border-color: transparent;
}

.secondary {
  background: var(--panel-strong);
}

.theme-icon:hover,
.hero-action:hover,
.primary:hover,
.secondary:hover,
.rating-grid button:hover,
.mover.selectable:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.card {
  padding: 26px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.set-chip {
  min-width: 124px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 700;
  text-align: center;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.field {
  display: grid;
  gap: 12px;
}

.slider-field {
  grid-column: span 4;
}

.option-field {
  grid-column: span 3;
}

.email-field {
  grid-column: span 6;
}

.field span:first-child {
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 60px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
}

.field textarea {
  min-height: 180px;
  resize: vertical;
}

.span-2 {
  grid-column: span 2;
}

.range-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.range-card input[type="range"] {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.range-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.range-meta strong {
  color: var(--ink);
  font-size: 1.06rem;
}

.summary-panel {
  margin-top: 24px;
  padding: 22px;
  border-radius: 24px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  display: grid;
  gap: 20px;
}

.summary-copy {
  line-height: 1.6;
  color: var(--ink);
}

.setup-actions {
  justify-content: flex-end;
}

.full-center {
  min-height: calc(100vh - 36px);
  display: none;
  align-items: center;
  justify-content: center;
}

.full-center.active {
  display: flex;
}

.countdown-shell {
  width: min(620px, 100%);
  padding: 28px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: center;
  box-shadow: var(--shadow);
}

.countdown-label {
  margin-top: 18px;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 700;
}

.countdown-number {
  margin: 20px 0 14px;
  font-size: clamp(5rem, 17vw, 9rem);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: -0.08em;
  color: var(--accent);
}

.countdown-summary {
  color: var(--muted);
  line-height: 1.6;
}

.exercise-mode {
  min-height: calc(100vh - 36px);
  gap: 14px;
}

.exercise-mode.active,
.selection-shell {
  min-height: calc(100vh - 36px);
  display: grid;
  gap: 14px;
}

.exercise-topbar,
.selection-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

body[data-theme="light"] .exercise-topbar,
body[data-theme="light"] .selection-topbar {
  background: var(--panel);
}

.metric {
  min-width: 112px;
  display: grid;
  gap: 4px;
}

.metric span {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.82;
}

.metric strong {
  font-size: 1.25rem;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.exercise-topbar .secondary,
.selection-topbar .secondary,
.selection-topbar .primary {
  box-shadow: none;
}

.exercise-topbar .secondary:hover,
.selection-topbar .secondary:hover,
.selection-topbar .primary:hover {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.exercise-stage {
  position: relative;
  min-height: min(78vh, 820px);
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid var(--line);
  background: var(--stage-solid);
  box-shadow: var(--shadow);
}

.exercise-stage.stage-black {
  --stage-solid: #0a0a0a;
  --stage-overlay-line: rgba(255, 255, 255, 0.08);
  --stage-chip: rgba(12, 12, 12, 0.86);
}

.exercise-stage.stage-white {
  --stage-solid: #ffffff;
  --stage-overlay-line: rgba(9, 35, 47, 0.08);
  --stage-chip: rgba(255, 255, 255, 0.92);
}

.selection-stage {
  min-height: min(70vh, 760px);
}

.background-overlay,
.mover-layer {
  position: absolute;
  inset: 0;
}

.background-overlay {
  opacity: 0.64;
  pointer-events: none;
}

.exercise-stage.bg-pulse .background-overlay {
  background:
    radial-gradient(circle at 20% 20%, var(--stage-overlay-line), transparent 28%),
    radial-gradient(circle at 80% 72%, rgba(116, 211, 255, 0.14), transparent 24%);
  animation: driftPulse 8s linear infinite;
}

.exercise-stage.bg-grid .background-overlay {
  background:
    linear-gradient(var(--stage-overlay-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--stage-overlay-line) 1px, transparent 1px);
  background-size: 42px 42px;
  animation: gridShift 3s linear infinite;
}

.exercise-stage.bg-storm .background-overlay {
  background:
    repeating-linear-gradient(135deg, var(--stage-overlay-line) 0 20px, transparent 20px 40px),
    repeating-radial-gradient(circle at 50% 50%, rgba(116, 211, 255, 0.08) 0 18px, transparent 18px 36px);
  animation: stormShift 1.4s linear infinite;
}

.stage-message {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.35;
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.exercise-stage .stage-message,
.selection-stage .stage-message {
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
}

.mover {
  position: absolute;
  width: var(--size);
  height: var(--size);
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  user-select: none;
}

.mover-inner {
  position: absolute;
  inset: 0;
}

.mover.is-target .mover-inner {
  filter: drop-shadow(0 0 12px rgba(255, 233, 117, 0.9));
}

.exercise-stage.highlight-off .mover.is-target .mover-inner,
.selection-stage.highlight-off .mover.is-target .mover-inner {
  filter: none;
}

.mover.is-target::after {
  content: "Track";
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 233, 117, 0.94);
  color: #111;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.mover.hide-target::after {
  display: none;
}

.exercise-stage.highlight-off .mover.is-target::after,
.selection-stage.highlight-off .mover.is-target::after {
  display: none;
}

.mover.selectable {
  cursor: pointer;
}

.mover.selectable.selected {
  filter: drop-shadow(0 0 12px rgba(116, 211, 255, 0.95));
}

.mover.selectable.correct {
  filter: drop-shadow(0 0 16px rgba(103, 240, 166, 0.95));
}

.mover.selectable.wrong {
  filter: drop-shadow(0 0 16px rgba(255, 141, 141, 0.95));
}

.mover-ball .mover-inner {
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.12) 24%, transparent 26%),
    radial-gradient(circle at 35% 32%, var(--fill-light, #9ee4ff), var(--fill, #2ba6df) 64%, var(--fill-dark, #0e6d98));
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.mover-puck {
  width: calc(var(--size) * 1.45);
  height: calc(var(--size) * 0.62);
}

.mover-puck .mover-inner {
  border-radius: 999px;
  background:
    linear-gradient(180deg, #5f646c, #15191f 34%, #050608 72%, #343941);
  border: 2px solid rgba(255, 255, 255, 0.18);
}

.mover-leaf .mover-inner {
  border-radius: 60% 0 60% 0;
  background:
    linear-gradient(135deg, var(--fill-light, #d8ff7b), var(--fill, #74c43c) 58%, var(--fill-dark, #356718));
  transform: rotate(24deg);
}

.mover-leaf .mover-inner::after {
  content: "";
  position: absolute;
  top: 10%;
  left: 48%;
  width: 10%;
  height: 80%;
  background: rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  transform: translateX(-50%) rotate(22deg);
}

.mover-bird {
  width: calc(var(--size) * 1.35);
  height: calc(var(--size) * 0.95);
}

.mover-bird .mover-inner::before,
.mover-bird .mover-inner::after {
  content: "";
  position: absolute;
  top: 22%;
  width: 52%;
  height: 58%;
  background: var(--fill, #4ab1e0);
  border-radius: 80% 20% 100% 0;
  transform-origin: bottom center;
  animation: flap 520ms ease-in-out infinite;
  box-shadow: inset 0 -5px 10px rgba(0, 0, 0, 0.18);
}

.mover-bird .mover-inner::before {
  left: 0;
  transform: rotate(24deg);
}

.mover-bird .mover-inner::after {
  right: 0;
  transform: scaleX(-1) rotate(24deg);
  animation-delay: -260ms;
}

.mover-bird .bird-core {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 32%;
  height: 36%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--fill-dark, #146a91);
}

.rating-scale {
  display: grid;
  gap: 16px;
}

.rating-scale + .button-row {
  margin-top: 18px;
}

.scale-label {
  color: var(--muted);
  line-height: 1.6;
}

.big-linear-scale {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 700;
}

.scale-bar {
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success), var(--warn), var(--danger));
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 12px;
}

.rating-grid button {
  min-height: 76px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
}

.rating-grid button.selected {
  background: linear-gradient(135deg, var(--accent), var(--success));
  color: #04111a;
  border-color: transparent;
}

.post-card {
  max-width: 1080px;
  margin: 0 auto;
}

@keyframes flap {
  0%,
  100% {
    transform: rotate(24deg) translateY(0);
  }
  50% {
    transform: rotate(-18deg) translateY(-2px);
  }
}

@keyframes driftPulse {
  0% {
    transform: translate3d(-3%, -2%, 0) scale(1);
  }
  50% {
    transform: translate3d(3%, 2%, 0) scale(1.08);
  }
  100% {
    transform: translate3d(-3%, -2%, 0) scale(1);
  }
}

@keyframes gridShift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-42px, -42px, 0);
  }
}

@keyframes stormShift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-26px, 18px, 0);
  }
}

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

  .hero-topbar,
  .section-heading,
  .exercise-topbar,
  .selection-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions,
  .setup-actions,
  .exercise-actions,
  .button-row {
    width: 100%;
  }

  .hero-action,
  .primary,
  .secondary {
    flex: 1 1 220px;
  }

  .setup-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .slider-field {
    grid-column: span 6;
  }

  .option-field {
    grid-column: span 3;
  }

  .email-field {
    grid-column: span 6;
  }

  .rating-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

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

  .card,
  .hero-topbar,
  .exercise-stage,
  .countdown-shell {
    border-radius: 24px;
  }

  .hero-topbar,
  .card {
    padding: 20px;
  }

  .brand-block {
    align-items: flex-start;
  }

  .brand-mark {
    width: 74px;
    height: 74px;
  }

  .setup-grid {
    grid-template-columns: 1fr;
  }

  .slider-field,
  .option-field,
  .email-field {
    grid-column: span 1;
  }

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

  .rating-grid button {
    min-height: 60px;
    font-size: 1.3rem;
  }

  .exercise-stage,
  .selection-stage {
    min-height: 72vh;
  }

  .stage-message {
    width: calc(100% - 24px);
  }
}
