:root {
  --bg-top: #09111f;
  --bg-bottom: #05070d;
  --panel: rgba(10, 17, 31, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --gold: #facc15;
  --green: #4ade80;
  --shadow: rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(244, 114, 182, 0.22), transparent 26%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.hero-card {
  width: min(1120px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 30px 80px var(--shadow);
  backdrop-filter: blur(12px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
}

.subcopy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 64ch;
}

.options-panel {
  margin-top: 24px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.options-header h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.options-header p {
  margin: 0 0 18px;
  color: var(--muted);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.option-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.option-title {
  font-weight: 700;
}

.option-value {
  color: var(--gold);
  font-weight: 700;
}

.option-card small {
  color: var(--muted);
  line-height: 1.35;
}

.option-card input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.option-toggle {
  justify-content: space-between;
}

.option-toggle input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--green);
}

.status-bar {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  gap: 18px;
  align-items: center;
  margin: 26px 0 22px;
}

.score-box,
.control-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 20px;
}

.score-box {
  padding: 18px 20px;
  text-align: center;
}

.cyan-box { box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.18); }
.pink-box { box-shadow: inset 0 0 0 1px rgba(244, 114, 182, 0.18); }

.score-box strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.center-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 82px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
}

.winner-banner {
  color: var(--gold);
  font-weight: 700;
  min-height: 1.2em;
}

.canvas-wrap {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #020617;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

canvas {
  width: 100%;
  height: auto;
  display: block;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.control-card {
  padding: 16px 18px;
}

.control-card h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.control-card p {
  margin: 8px 0;
  color: var(--muted);
}

.left-card h2 { color: var(--cyan); }
.right-card h2 { color: var(--pink); }
.center-card h2 { color: var(--gold); }

kbd {
  display: inline-block;
  min-width: 2rem;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 980px) {
  .options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .hero-card { padding: 20px; }
  .status-bar,
  .controls-grid,
  .options-grid {
    grid-template-columns: 1fr;
  }
  .center-status { padding: 14px; }
}
