:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #faf1e3;
  background: #181d2b;
  font-synthesis: none;
  --muted: #c5c9d2;
  --mint: #77f2d2;
  --line: #414857;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 4px; }
.widget {
  max-width: 1680px;
  min-width: 0;
  margin: 0 auto;
  padding: clamp(18px, 3.1vw, 52px);
  padding-top: clamp(18px, 2vw, 32px);
}
.brand { font-size: clamp(1rem, 1.6vw, 1.5rem); font-weight: 750; margin: 0 0 clamp(16px, 2vw, 28px); }
.eyebrow {
  margin: 0 0 5px;
  color: var(--mint);
  font-size: clamp(.7rem, 1.15vw, 1rem);
  font-weight: 780;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1 { font-size: clamp(2rem, 4.4vw, 4.65rem); line-height: 1.05; letter-spacing: -.045em; margin: 0; }
.intro-copy { color: var(--muted); margin: 9px 0 20px; font-size: clamp(.95rem, 1.6vw, 1.4rem); }
.layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); align-items: stretch; gap: clamp(12px, 1.4vw, 20px); }
.scene {
  aspect-ratio: 50 / 33;
  position: relative;
  align-self: start;
  overflow: hidden;
  isolation: isolate;
  border-radius: 17px;
  background: #323b49;
}
canvas { display: block; width: 100%; height: 100%; }
.scene-message {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  background: #242b39;
}
.scene-state {
  position: absolute;
  top: 12px;
  left: 12px;
  border: 1px solid #eee3cb80;
  background: #202735ed;
  border-radius: 8px;
  padding: 7px 11px;
  font-weight: 700;
  font-size: .85rem;
}
.reach-note { top: auto; bottom: 12px; color: #ffe6c7; }
.screen-control {
  position: absolute;
  display: grid;
  place-items: center;
  width: 0;
  height: 0;
  z-index: 1;
}
.screen-handle {
  position: absolute;
  transform: translate(-50%, -50%);
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  width: clamp(38px, 3.65vw, 52px);
  height: clamp(38px, 3.65vw, 52px);
  border: 2px solid #fff1d3;
  background: #ffb54d;
  color: #201a15;
  box-shadow: 0 3px 9px #21150e61;
  font-size: clamp(1.15rem, 2.05vw, 1.85rem);
  font-weight: 800;
  line-height: 1;
  cursor: ns-resize;
  touch-action: none;
}
.screen-handle:focus-visible { outline-color: #161b28; }
.screen-hint {
  position: absolute;
  left: 0;
  bottom: 30px;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #fbf0d0;
  color: #fff4de;
  background: #2e2b27f5;
  white-space: nowrap;
  font-size: clamp(.68rem, 1.15vw, 1rem);
  font-weight: 650;
  pointer-events: none;
}
.panel {
  padding: clamp(12px, 1.4vw, 23px);
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, #232a38, #181d2b 80%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(8px, 1vw, 15px);
}
.panel h2, .course-summary h2 { font-size: clamp(1.05rem, 1.8vw, 1.8rem); margin: 0; letter-spacing: -.02em; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: clamp(6px, .65vw, 10px); }
.control {
  --fill: #e5e5e8;
  --track: #646b79;
  display: grid;
  gap: 0;
  padding: clamp(4px, .48vw, 8px) 13px;
  border: 1px solid #3f4758;
  background: #252c3a;
  border-radius: 11px;
}
.control[data-feedback="on-target"] { --feedback-color: #8ce8a1; }
.control[data-feedback="close"] { --feedback-color: #ffb45f; }
.control[data-feedback="far"] { --feedback-color: #ff7b78; }
.control[data-feedback] {
  --fill: var(--feedback-color);
  --track: #535b68;
  border-color: var(--feedback-color);
  box-shadow: inset 3px 0 var(--feedback-color);
  background: #252c3a;
}
.control-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; }
.control label { font-size: clamp(.85rem, 1.23vw, 1.2rem); font-weight: 700; }
.control label small { margin-inline-start: .4em; color: var(--muted); font-size: .72em; font-weight: 550; }
.control output { font-size: .82rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.control input {
  appearance: none;
  background: transparent;
  width: 100%;
  height: clamp(22px, 1.78vw, 30px);
  margin: 0;
  cursor: pointer;
}
.control input:focus-visible { outline-color: var(--muted); }
.control input::-webkit-slider-runnable-track {
  height: 7px;
  border-radius: 8px;
  background: linear-gradient(to right, var(--fill) 0 var(--position, 50%), var(--track) var(--position, 50%) 100%);
}
.control input::-moz-range-track {
  height: 7px;
  border-radius: 8px;
  background: linear-gradient(to right, var(--fill) 0 var(--position, 50%), var(--track) var(--position, 50%) 100%);
}
.control input::-webkit-slider-thumb {
  appearance: none;
  height: 18px;
  width: 18px;
  margin-top: -5.5px;
  background: var(--fill);
  border-radius: 50%;
  box-shadow: 0 1px 3px #0c1416a8;
}
.control input::-moz-range-thumb {
  height: 18px;
  width: 18px;
  border: 0;
  background: var(--fill);
  border-radius: 50%;
  box-shadow: 0 1px 3px #0c1416a8;
}
fieldset:disabled { opacity: .62; }
fieldset:disabled input { cursor: default; }
.setup-score {
  display: grid;
  gap: 8px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #252c3a;
}
.score-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 700; }
.score-heading output { color: var(--mint); font-variant-numeric: tabular-nums; }
.score-bar {
  appearance: none;
  display: block;
  width: 100%;
  height: 9px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: #454d5d;
  accent-color: var(--mint);
}
.score-bar::-webkit-progress-bar { background: #454d5d; }
.score-bar::-webkit-progress-value { background: var(--mint); border-radius: 999px; }
.score-bar::-moz-progress-bar { background: var(--mint); border-radius: 999px; }
.setup-score .button { justify-self: start; min-height: 34px; }
.celebration-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: inherit;
}
.celebration-dialog[open] { display: grid; place-items: center; }
.celebration-dialog::backdrop { background: #111624d9; }
.celebration-card {
  position: relative;
  z-index: 1;
  width: min(100%, 25rem);
  max-height: 100%;
  padding: clamp(18px, 4vw, 38px);
  overflow: auto;
  border: 1px solid #66d3ad85;
  border-radius: 20px;
  background: radial-gradient(ellipse at top, #285447, #1b302e 72%);
  box-shadow: 0 20px 60px #080c17a6;
  text-align: center;
}
.celebration-kicker {
  margin: 0 0 6px;
  color: var(--mint);
  font-size: .7rem;
  font-weight: 760;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.celebration-card h2 { margin: 0; font-size: clamp(2.2rem, 7vw, 3.5rem); line-height: 1; letter-spacing: -.04em; }
.celebration-score { margin: 12px 0 20px; color: var(--muted); }
.celebration-score strong { color: #e4fff5; font-variant-numeric: tabular-nums; }
.celebration-card .button { min-width: 110px; }
.celebration-fireworks {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.guide-toggle { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: .9rem; cursor: pointer; }
.guide-toggle input { accent-color: var(--mint); margin: 0; }
.panel-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; }
.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border-radius: 10px; min-height: 41px; padding: 7px 13px; font-weight: 740; font-size: clamp(.82rem, 1.2vw, 1.12rem); }
.secondary { color: inherit; border: 1px solid #8e97a7; background: #262d39; }
.secondary:not(:disabled):hover { background: #343e4d; }
.reset { min-height: 40px; color: var(--muted); background: transparent; border: 0; padding: 5px; }
.reset:not(:disabled):hover { color: #fff; }
.primary { color: #122726; background: var(--mint); border: 1px solid #9df2dd; }
.primary:hover { background: #a0f7e2; }
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(12px, 1.6vw, 25px);
  padding-top: clamp(10px, 1.2vw, 18px);
  border-top: 1px solid var(--line);
}
.footer span { color: var(--muted); font-size: clamp(.82rem, 1.2vw, 1.05rem); }
.course-summary { margin-top: 15px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.course-summary p { color: var(--muted); margin: 8px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 730px) {
  .layout { grid-template-columns: 1fr; }
  .panel { padding: 13px; }
  .control { padding: 4px 11px; }
  .control input { height: 28px; }
}
@media (max-width: 410px) {
  .screen-hint { transform: translateX(-75%); bottom: 22px; }
  .screen-handle { width: 34px; height: 34px; }
}
