/* ── Reset & Root ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100dvh;
  width: 100vw;
  background: #0a0f1e;
  color: #e0e6f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  /* Block browser pinch-zoom and double-tap zoom on the whole app.
     OrbitControls still receives touches on the canvas. */
  touch-action: none;
  -webkit-text-size-adjust: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ── Top Bar (flex row, always at top) ─────────────────── */
#top-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(10,15,30,0.95);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 20;
}

.back-link {
  color: #8899bb;
  text-decoration: none;
  font-size: 13px;
}
.back-link:hover { color: #c0d0f0; }

.app-title {
  font-size: 15px;
  font-weight: 600;
  color: #c0d0f0;
  flex: 1;
}

.icon-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #8899bb;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: rgba(255,255,255,0.1);
}
.icon-btn:hover { background: rgba(255,255,255,0.15); color: #e0e6f0; }

/* ── Mode Selector (flex row under top bar) ────────────── */
#mode-selector {
  flex-shrink: 0;
  display: flex;
  gap: 2px;
  padding: 4px 6px;
  background: rgba(11,16,32,0.95);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;   /* allow horizontal scroll but no pinch-zoom */
  z-index: 19;
}

.mode-btn {
  padding: 6px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #667799;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.mode-btn:hover { color: #c0d0f0; background: rgba(255,255,255,0.06); }
.mode-btn.active {
  background: rgba(255,255,255,0.12);
  color: #e0e6f0;
  font-weight: 600;
}

/* ── Stopping Time Sub-modes ───────────────────────────── */
.sub-modes {
  flex-shrink: 0;
  display: flex;
  gap: 2px;
  padding: 3px 6px;
  background: rgba(11,16,32,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  z-index: 18;
}

.sub-btn {
  padding: 5px 9px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #556688;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.sub-btn:hover { color: #aabbdd; background: rgba(255,255,255,0.04); }
.sub-btn.active {
  background: rgba(255,255,255,0.08);
  color: #c0d0f0;
  font-weight: 600;
}

/* ── Scene Wrap (takes remaining space) ────────────────── */
#scene-wrap {
  flex: 1 1 0;
  position: relative;
  overflow: hidden;
  min-height: 0;  /* critical for flex children that can shrink */
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Bottom Bar (always at bottom) ─────────────────────── */
#bottom-bar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 10px;
  background: rgba(10,15,30,0.95);
  border-top: 1px solid rgba(255,255,255,0.06);
  z-index: 20;
}

#input-area {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
}

#num-input, #fill-input {
  width: 110px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  background: rgba(11,16,32,0.9);
  color: #e0e6f0;
  font-size: 15px;
  outline: none;
}
#num-input:focus, #fill-input:focus { border-color: rgba(255,255,255,0.35); }
#num-input.error, #fill-input.error {
  border-color: #ff5a5a;
  animation: shake 0.3s ease-in-out;
}

.input-sep {
  width: 1px;
  align-self: stretch;
  margin: 4px 0;
  background: rgba(255,255,255,0.1);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

#btn-go, #btn-fill {
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #d4a44a 0%, #c08830 100%);
  color: #1a1200;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
#btn-go:hover, #btn-fill:hover { opacity: 0.9; }
#btn-go:active, #btn-fill:active { transform: scale(0.97); }
#btn-fill {
  background: linear-gradient(135deg, #4a8ad4 0%, #3070c0 100%);
  color: #fff;
}
#btn-fill:disabled { opacity: 0.5; cursor: default; }

/* ── Time Series slider (in bottom bar when visible) ──── */
#ts-slider-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  max-width: 320px;
}
#ts-slider-wrap label {
  font-size: 11px;
  color: #8899bb;
}
#ts-slider-wrap label span {
  font-weight: 700;
  color: #ffd866;
  margin-left: 4px;
}
#ts-slider { width: 100%; accent-color: #d4a44a; }

/* ── Math Bar (absolute overlay on scene) ─────────────── */
#math-bar {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(11,16,32,0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 20px;
  white-space: nowrap;
  max-width: calc(100% - 16px);
  z-index: 10;
}
#math-bar > * { white-space: nowrap; }
#math-label {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
#math-label.even { color: #4a9aff; }
#math-label.odd  { color: #ff6b4a; }
#math-rule { font-size: 13px; color: #667799; }
#math-operation {
  font-size: 18px;
  font-weight: 600;
  color: #e0e6f0;
}
#math-result {
  font-size: 24px;
  font-weight: 700;
  color: #ffd866;
}

/* ── Number Line + Chart Controls (overlay, bottom-left of scene) ── */
#nl-controls, #chart-controls {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 10;
}
#nl-stats {
  min-width: 180px;
  background: rgba(11,16,32,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nl-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.nl-stat-label {
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #667799;
}
.nl-stat-value {
  font-size: 12px;
  color: #cbd8f0;
  font-weight: 600;
}
.nl-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.nl-badge {
  font-size: 10px;
  color: #ffd866;
  border: 1px solid rgba(255,216,102,0.22);
  border-radius: 999px;
  padding: 1px 7px;
  background: rgba(255,216,102,0.08);
}

.nl-btn {
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  background: rgba(11,16,32,0.85);
  backdrop-filter: blur(12px);
  color: #8899bb;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: rgba(255,255,255,0.1);
}
.nl-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #c0d0f0;
}

#perf-toggles {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mode-toggle-btn {
  font-size: 11px;
  text-align: left;
}
#nl-goto-input {
  width: 70px;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  background: rgba(11,16,32,0.9);
  color: #e0e6f0;
  font-size: 13px;
  outline: none;
}
.nl-ff {
  font-weight: 700;
  color: #ffd866 !important;
  border-color: rgba(255,216,102,0.2) !important;
}

/* ── Step Info (overlay) ───────────────────────────────── */
#step-info {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
  background: rgba(11,16,32,0.85);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
  z-index: 10;
}
#step-value {
  font-weight: 700;
  font-size: 18px;
  color: #ffd866;
}
#step-detail { color: #8899bb; }

/* ── Recent Panel (overlay, top-right of scene) ───────── */
/* ── Hit counter (number line mode) ───────────────────── */
/* ── Hit counter (inline inside math-bar) ──────────────── */
#hit-counter {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin-left: 8px;
  padding-left: 14px;
  border-left: 1px solid rgba(255,255,255,0.15);
}
#hit-counter.hidden { display: none; }
#hit-count {
  font-size: 32px;
  font-weight: 700;
  color: #ffd866;
  line-height: 1;
}
.hit-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #667799;
}

#recent-panel {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 140px;
  max-height: calc(100% - 16px);
  overflow-y: auto;
  background: rgba(11,16,32,0.85);
  backdrop-filter: blur(12px);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px;
  z-index: 10;
}
#recent-panel h3 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #667799;
  margin-bottom: 6px;
}

#recent-list { list-style: none; }
#recent-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 5px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
}
#recent-list li:hover { background: rgba(255,255,255,0.06); }

.recent-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.recent-num { font-weight: 600; color: #c0d0f0; min-width: 30px; }
.recent-steps { color: #667799; font-size: 10px; margin-left: auto; }

/* ── Tooltip ───────────────────────────────────────────── */
#tooltip {
  position: fixed;
  padding: 6px 10px;
  background: rgba(11,16,32,0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
  z-index: 50;
  max-width: 180px;
}
#tooltip .tt-value { font-weight: 700; font-size: 16px; color: #ffd866; }
#tooltip .tt-detail { color: #8899bb; }

/* ── Legend (overlay, bottom-right) ────────────────────── */
#legend {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 120px;
  z-index: 10;
}
.legend-bar {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #6a0dbd, #2b60de, #1a998e, #43aa2f, #e6c619, #e87d1e, #d42020);
}
.legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #667799;
  margin-top: 2px;
}

/* ── Panel close button + backdrop ─────────────────────── */
.panel-close {
  position: absolute;
  top: 6px; right: 8px;
  background: none; border: none;
  color: #667799;
  font-size: 1.5rem; line-height: 1;
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 4px;
  z-index: 1;
}
.panel-close:hover { color: #e0e6f0; background: rgba(255,255,255,0.1); }

.panel-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 25;
}

/* ── Discovery counter (top-right during Orb Run) ──────── */
#discovery-counter {
  position: absolute;
  top: 8px;
  right: 150px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(11,16,32,0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 6px 14px;
  z-index: 10;
}
#discovery-counter.hidden { display: none; }
#discovery-icon { font-size: 18px; }
#discovery-count {
  font-size: 22px;
  font-weight: 700;
  color: #c8bfe7;
  line-height: 1;
}
.discovery-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #667799;
}

/* Follow button active state */
#nl-follow.active {
  background: rgba(200,191,231,0.2);
  border-color: #c8bfe7;
  color: #c8bfe7;
}

/* ── Utility ───────────────────────────────────────────── */
.hidden { display: none !important; }

#recent-panel::-webkit-scrollbar { width: 4px; }
#recent-panel::-webkit-scrollbar-track { background: transparent; }
#recent-panel::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
  #recent-panel { display: none; }
  #legend { display: none; }
  #num-input, #fill-input { width: 100px; font-size: 14px; padding: 7px 10px; }
  #btn-go, #btn-fill { padding: 7px 12px; font-size: 12px; }
  #math-bar {
    padding: 6px 12px;
    gap: 8px;
    font-size: 12px;
  }
  #math-label { font-size: 12px; }
  #math-operation { font-size: 13px; }
  #math-result { font-size: 16px; }
  #nl-controls, #chart-controls {
    gap: 2px;
  }
  .nl-btn { padding: 5px 8px; font-size: 10px; }
}

/* ═══════════════════════════════════════════════════════════ */
/* ── GAME UI ─────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════ */

/* ── Persistent score (top-left, always visible in game) ── */
#game-score {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(11,16,32,0.9);
  backdrop-filter: blur(12px);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 6px 14px;
  z-index: 10;
}
#score-value {
  font-size: 28px;
  font-weight: 700;
  color: #ffd866;
  line-height: 1;
}
#streak-value {
  font-size: 22px;
  font-weight: 700;
  color: #4fb06f;
  line-height: 1;
}
.score-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #667799;
}

/* ── Prediction panel (center overlay) ────────────────── */
#predict-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(11,16,32,0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 24px 32px;
  z-index: 30;
  text-align: center;
  min-width: 280px;
  max-width: 420px;
}
#predict-panel.hidden { display: none; }
.predict-title {
  font-size: 14px;
  color: #889abb;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.predict-number {
  font-size: 36px;
  font-weight: 700;
  color: #e0e6f0;
  margin-bottom: 16px;
}
.predict-buckets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.bucket-btn {
  padding: 8px 14px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: #e0e6f0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.bucket-btn:hover {
  border-color: rgba(255,216,102,0.5);
  background: rgba(255,216,102,0.1);
}
.bucket-btn.selected {
  border-color: #ffd866;
  background: rgba(255,216,102,0.2);
  color: #ffd866;
}
.btn-launch {
  padding: 10px 32px;
  border: none;
  border-radius: 8px;
  background: #d4a44a;
  color: #0a0f1e;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-launch:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-launch:not(:disabled):hover {
  background: #ffd866;
  transform: scale(1.05);
}

/* ── Results panel (center overlay) ───────────────────── */
#results-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(11,16,32,0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 28px 36px;
  z-index: 30;
  text-align: center;
  min-width: 300px;
  max-width: 440px;
}
#results-panel.hidden { display: none; }
.results-tag {
  font-size: 13px;
  color: #889abb;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.results-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 16px;
}
.results-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.results-stat-value {
  font-size: 36px;
  font-weight: 700;
  color: #e0e6f0;
  line-height: 1.1;
}
.results-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #667799;
  margin-top: 4px;
}
.results-verdict {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}
.results-verdict.correct { color: #4fb06f; }
.results-verdict.close   { color: #ffd866; }
.results-verdict.miss    { color: #ff6b4a; }
.results-score {
  font-size: 22px;
  font-weight: 700;
  color: #ffd866;
  margin-bottom: 16px;
}
.btn-next {
  padding: 10px 32px;
  border: none;
  border-radius: 8px;
  background: #4a9aff;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-next:hover {
  background: #6ab4ff;
  transform: scale(1.05);
}

/* ── Milestone callout (floats center-screen during run) ── */
#milestone-callout {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(255,216,102,0.6), 0 2px 8px rgba(0,0,0,0.8);
  z-index: 25;
  pointer-events: none;
  transition: opacity 0.3s;
}
#milestone-callout.hidden { display: none; }
.milestone-callout-visible { display: block; }
.milestone-peak { color: #ff9a4a; }
.milestone-terminal { color: #4fb06f; }

/* ── Results panel polish ──────────────────────────────── */
.results-tag-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}
.results-tag-icon {
  font-size: 28px;
}
.results-tag {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.results-number {
  font-size: 32px;
  font-weight: 700;
  color: #e0e6f0;
  margin-bottom: 14px;
}
.results-stat-vs {
  font-size: 14px;
  color: #667799;
  align-self: center;
}
.results-peak {
  font-size: 12px;
  color: #889abb;
  margin-bottom: 12px;
}
.results-score-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.results-score {
  font-size: 28px;
  font-weight: 700;
  color: #ffd866;
}
.results-streak {
  font-size: 16px;
  font-weight: 600;
  color: #4fb06f;
}

/* ── High score (top-left, below game score) ─────────── */
#high-score {
  position: absolute;
  top: 48px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(11,16,32,0.7);
  border-radius: 8px;
  padding: 3px 10px;
  z-index: 10;
  font-size: 11px;
}
#high-score.hidden { display: none; }
#high-score-value {
  font-weight: 700;
  color: #889abb;
}

/* ── Game mode selector panel ────────────────────────── */
#mode-select-panel {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11,16,32,0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 16px 20px;
  z-index: 30;
  text-align: center;
  min-width: 280px;
}
#mode-select-panel.hidden { display: none; }
.mode-select-title {
  font-size: 11px;
  color: #667799;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}
.mode-select-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  color: #e0e6f0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.mode-select-btn:hover {
  border-color: rgba(255,216,102,0.4);
  background: rgba(255,216,102,0.08);
}
.mode-select-btn.active {
  border-color: #ffd866;
  background: rgba(255,216,102,0.15);
}
.mode-select-icon { font-size: 20px; }
.mode-select-desc {
  font-size: 11px;
  color: #667799;
  font-weight: 400;
}

/* ── Challenge panel (hitRange / findLongest) ─────────── */
#challenge-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(11,16,32,0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 24px 32px;
  z-index: 30;
  text-align: center;
  min-width: 300px;
}
#challenge-panel.hidden { display: none; }
.challenge-instruction {
  font-size: 16px;
  color: #e0e6f0;
  line-height: 1.4;
  margin-bottom: 16px;
}
.challenge-input-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}
#challenge-input {
  width: 120px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: #e0e6f0;
  font-size: 16px;
  text-align: center;
  outline: none;
}
#challenge-input:focus {
  border-color: #ffd866;
}
