/**
 * The Drum Tower, at night. Stone and lamplight, because a tower is stone and because a
 * dark screen is kinder next to a lit-up practice pad.
 *
 * Everything here is sized so it survives a 320px phone in portrait and still fills a
 * laptop: one column, generous targets, nothing measured in pixels that a thumb has to
 * hit. The Wall taught this repo that lesson the hard way — a menu button hidden above
 * 760px meant a whole screen had no door — so this app is measured at six widths from the
 * day it is born.
 */

:root {
  --stone: #14161f;
  --stone-lit: #1c2030;
  --stone-edge: #2b3145;
  --lamp: #f0b455;
  --ink: #e9ecf5;
  --ink-soft: #a5adc4;
  --locked: #57e0a0;
  --good: #7fc4ff;
  --loose: #f0b455;
  --miss: #ff7a7a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: radial-gradient(120% 90% at 50% 0%, #1e2231 0%, var(--stone) 62%);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

@media (min-width: 1100px) {
  .page { max-width: 56rem; }
}

/* ------------------------------------------------------------------ the head */

.head { padding: 0.5rem 0 1.25rem; }

.head__kicker {
  margin: 0 0 0.35rem;
  color: var(--lamp);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.head__title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  line-height: 1.15;
}

.head__sub {
  margin: 0;
  max-width: 40rem;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ the cards */

.card {
  background: var(--stone-lit);
  border: 1px solid var(--stone-edge);
  border-radius: 1rem;
  padding: 1.1rem 1rem;
  margin: 0 0 1rem;
}

.card--quiet { background: transparent; }

.card__title {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
  color: var(--lamp);
}

/* ------------------------------------------------------------------ the fields */

.field { margin: 0 0 1rem; }

.field__label {
  display: block;
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.field__input,
.field__range {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.7rem;
  background: #10121b;
  color: var(--ink);
  border: 1px solid var(--stone-edge);
  border-radius: 0.6rem;
  font-size: 1rem;
}

.field__range { padding: 0; accent-color: var(--lamp); }

.field__hint {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  min-height: 44px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 0.15rem;
  accent-color: var(--lamp);
}

.warn {
  margin: 0.9rem 0 0;
  padding: 0.7rem 0.8rem;
  background: rgba(240, 180, 85, 0.1);
  border-left: 3px solid var(--lamp);
  border-radius: 0.4rem;
  font-size: 0.92rem;
}

/* ------------------------------------------------------------------ the buttons */

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 0.9rem;
}

.btn {
  flex: 1 1 12rem;
  min-height: 54px;
  padding: 0.7rem 1rem;
  background: #232a3d;
  color: var(--ink);
  border: 1px solid var(--stone-edge);
  border-radius: 0.7rem;
  font-size: 1.02rem;
  font-weight: 600;
  cursor: pointer;
}

.btn--go {
  background: var(--lamp);
  border-color: var(--lamp);
  color: #23180a;
}

.btn:disabled { opacity: 0.45; }

.status {
  margin: 0 0 0.8rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ------------------------------------------------------------------ the meter and strip */

.meter {
  height: 10px;
  margin: 0 0 0.9rem;
  background: #10121b;
  border-radius: 999px;
  overflow: hidden;
}

.meter__fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--locked), var(--lamp));
  transition: width 60ms linear;
}

/* Every hit, newest on the right. The middle line is dead on the click; a tick that sits
   high was late and one that sits low was early, so a good run reads as a flat row and a
   rushing one visibly drifts. */
.strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 96px;
  padding: 0 0.4rem;
  background: #10121b;
  border-radius: 0.6rem;
  overflow: hidden;
}

.strip::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px dashed #39405a;
}

.tick {
  position: relative;
  flex: 1 1 0;
  min-width: 4px;
  max-width: 14px;
  height: 26px;
  border-radius: 3px;
  transform: translateY(var(--nudge, 0));
}

.tick--locked { background: var(--locked); }
.tick--good { background: var(--good); }
.tick--loose { background: var(--loose); }
.tick--miss { background: var(--miss); }

/* ------------------------------------------------------------------ the numbers */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.6rem;
  margin: 0 0 0.9rem;
}

.stat {
  padding: 0.65rem 0.7rem;
  background: #10121b;
  border-radius: 0.6rem;
}

.stat dt {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.stat dd {
  margin: 0.2rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.grades {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
}

.chip {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: #10121b;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.chip--locked { color: var(--locked); }
.chip--good { color: var(--good); }
.chip--loose { color: var(--loose); }
.chip--miss { color: var(--miss); }

.verdict {
  margin: 0;
  padding: 0.8rem 0.9rem;
  background: #10121b;
  border-radius: 0.6rem;
  line-height: 1.6;
}

/* ------------------------------------------------------------------ the footnotes */

.why {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
}

.why li { margin: 0 0 0.7rem; }
.why strong { color: var(--ink); }

.back { margin: 1.2rem 0 0; }

.back a {
  display: inline-block;
  min-height: 44px;
  padding: 0.6rem 0;
  color: var(--lamp);
}
