:root {
  --red: #e30613;
  --red-dark: #9e0012;
  --gold: #f4c430;
  --gold-dark: #a8831a;
  --ink: #12060a;
  --panel: #1c0a10;
  --muted: rgba(255, 228, 228, 0.7);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: #fff; font-family: "Barlow Condensed", system-ui, sans-serif; }
body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.display { font-family: "Luckiest Guy", "Barlow Condensed", sans-serif; letter-spacing: 0.04em; font-weight: 400; }
.gold { color: var(--gold); }
.good { color: #7dff8a; }
.bad { color: #ff9a9a; }

.app { display: flex; flex-direction: column; height: 100dvh; min-height: 560px; overflow: hidden; }

.top {
  position: relative; z-index: 2;
  background: linear-gradient(to bottom, var(--red), var(--red-dark));
  border-bottom: 4px solid var(--gold);
  padding: 0.5rem 0.75rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.top-inner { max-width: 64rem; margin: 0 auto; display: flex; align-items: center; gap: 0.75rem; }
.brand { display: none; flex-shrink: 0; }
.brand h1 { margin: 0; font-size: 1.6rem; line-height: 1; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.tag { margin: 2px 0 0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted); }
.brand-mobile { margin: 0.3rem 0 0; text-align: center; font-size: 1.15rem; line-height: 1; }
.scores { display: flex; flex: 1; gap: 0.5rem; }
.score {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center;
  background: rgba(0, 0, 0, 0.35); border-radius: 0.5rem; padding: 0.25rem 0.5rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.score .label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted); }
.score .value { font-size: 1.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.score .value.bump { animation: bump 0.4s ease; }
@keyframes bump { 40% { transform: scale(1.35); } }

.stage { position: relative; flex: 1; min-height: 240px; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: pointer; display: block; }
.note {
  pointer-events: none; position: absolute; right: 0.5rem; border-radius: 4px; padding: 0.2rem 0.5rem;
  font-size: 10px; color: rgba(255, 255, 255, 0.85); background: rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.note-top { top: 0.5rem; max-width: 60%; text-align: right; line-height: 1.2; }
.note-bottom { bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.7); background: rgba(0, 0, 0, 0.4); }

.controls {
  position: relative; z-index: 2; background: var(--panel); border-top: 4px solid var(--red);
  padding: 0.5rem 0.75rem max(0.5rem, env(safe-area-inset-bottom));
}
.controls-inner { max-width: 64rem; margin: 0 auto; }
.spots { display: flex; gap: 0.4rem; overflow-x: auto; margin: 0 -0.25rem 0.5rem; padding: 0 0.25rem; scrollbar-width: none; }
.spots::-webkit-scrollbar { display: none; }
.spot {
  flex-shrink: 0; border: 0; cursor: pointer; border-radius: 999px; padding: 0.3rem 0.8rem;
  font: 600 12px "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.1); color: #ffe3e3; transition: background 0.15s, color 0.15s;
}
.spot:hover { background: rgba(255, 255, 255, 0.2); }
.spot[aria-pressed="true"] { background: var(--red); color: #fff; box-shadow: inset 0 0 0 2px var(--gold); }
.spot:disabled { opacity: 0.5; cursor: default; }

.row { display: flex; align-items: stretch; gap: 0.75rem; }
.sliders { flex: 1; display: grid; grid-template-columns: 1fr; gap: 0.25rem; }
.slider { display: block; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; }
.slider-head .display { font-size: 0.9rem; }
.slider-head .val { color: var(--gold); font-variant-numeric: tabular-nums; }
.slider-foot { display: flex; justify-content: space-between; margin-top: -2px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 228, 228, 0.5); }

input[type="range"] {
  --pct: 50%;
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 2px 0 0; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 999px;
  background: linear-gradient(to right, var(--red) 0 var(--pct), rgba(255, 255, 255, 0.15) var(--pct) 100%);
}
input[type="range"]::-moz-range-track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.15); }
input[type="range"]::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--red); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; margin-top: -6px; border-radius: 50%;
  background: var(--gold); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 3px solid #fff; }
input[type="range"]:disabled { opacity: 0.55; }

.shoot {
  width: 6rem; flex-shrink: 0; display: grid; place-items: center; cursor: pointer;
  border: 0; border-bottom: 4px solid var(--gold-dark); border-radius: 1rem;
  background: var(--gold); color: #4a0a12; font-size: 1.4rem; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
  transition: transform 0.08s, border-width 0.08s;
}
.shoot:active { transform: translateY(2px); border-bottom-width: 2px; }
.shoot:disabled { opacity: 0.6; cursor: default; }

@media (min-width: 640px) {
  .top { padding: 0.5rem 1.5rem; }
  .brand { display: block; }
  .brand-mobile { display: none; }
  .scores { margin-left: auto; max-width: 28rem; }
  .score { padding: 0.25rem 1rem; }
  .score .label { font-size: 12px; }
  .score .value { font-size: 1.9rem; }
  .note { font-size: 12px; }
  .controls { padding: 0.75rem 1.5rem max(0.75rem, env(safe-area-inset-bottom)); }
  .sliders { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
  .shoot { width: 9rem; font-size: 1.9rem; }
}
