/* style.css — Orbit */
:root {
  --bg: #07060f;
  --fg: #e8f0ff;
  --muted: #8893b5;
  --accent: #6cc5ff;
  --danger: #ff5a5a;
  --gold: #ffcf3a;
  --panel: rgba(18, 16, 36, 0.82);
  --panel-border: rgba(120, 160, 220, 0.22);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f4f6ff;
  --fg: #1a1f3a;
  --muted: #5a6488;
  --accent: #2a7fd6;
  --danger: #e03b3b;
  --gold: #d99a00;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-border: rgba(40, 80, 160, 0.25);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    --bg: #f4f6ff;
    --fg: #1a1f3a;
    --muted: #5a6488;
    --accent: #2a7fd6;
    --danger: #e03b3b;
    --gold: #d99a00;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-border: rgba(40, 80, 160, 0.25);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

#root {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 18px 22px 0;
  pointer-events: none;
  z-index: 5;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}
.stat.right { align-items: flex-end; }

.stat .label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 600;
}
.stat span:not(.label) {
  font-size: 28px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
}

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: radial-gradient(circle at center, rgba(7,6,15,0.25), rgba(7,6,15,0.55));
  transition: opacity 0.3s ease;
}
#overlay.hidden { opacity: 0; pointer-events: none; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 20px;
  padding: 34px 38px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
  max-width: 86vw;
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1), opacity 0.3s;
}
.panel.hidden { display: none; }

.title {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 8px;
  margin: 0 0 10px;
  background: linear-gradient(120deg, var(--accent), #b794ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.title.small {
  font-size: 30px;
  letter-spacing: 6px;
  background: linear-gradient(120deg, var(--danger), #ff9a3a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 22px;
  max-width: 280px;
}

.btn {
  appearance: none;
  border: none;
  background: linear-gradient(120deg, var(--accent), #8a7bff);
  color: #0a0820;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 13px 30px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(108, 197, 255, 0.35);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 12px 30px rgba(108,197,255,0.45); }
.btn:active { transform: translateY(1px) scale(0.98); }

.result {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 4px;
}
#finalScore {
  font-size: 52px;
  font-weight: 800;
  color: var(--fg);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.result-label {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 1px;
}
.best-line {
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 18px;
  min-height: 16px;
}

#hint {
  position: absolute;
  bottom: 22px;
  left: 0; right: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  z-index: 4;
}
#hint.show { opacity: 0.7; }

@media (max-width: 360px) {
  .panel { padding: 26px 24px; }
  .title { font-size: 36px; letter-spacing: 6px; }
  .stat span:not(.label) { font-size: 24px; }
}
