:root {
  --ground: #0E1623;
  --surface: #141E2D;
  --surface-2: #182334;
  --border: #26324A;
  --border-soft: #1E2A3D;
  --text: #F2F5FA;
  --text-2: #9AAAC2;
  --text-3: #7F90AA;
  --amber: #F5B544;
  --cyan: #5EC8E5;
  --slate: #2E3C54;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'Space Grotesk', system-ui, sans-serif; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.spacer { flex: 1; }

/* ── views ─────────────────────────────────────────────────────────── */
.view { min-height: 100vh; }
.view[hidden] { display: none; }

.view-centred {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
}

h1 {
  margin: 0 0 8px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

h2 {
  margin: 0 0 18px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

h3 {
  margin: 26px 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.lede {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}

/* ── form ──────────────────────────────────────────────────────────── */
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  background: var(--ground);
  border: 1px solid var(--border);
  border-radius: 13px;
}

.seg {
  flex: 1;
  height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}

.seg:hover { color: var(--text); }

.seg.is-active {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

input[type="text"] {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 16px;
  letter-spacing: 0.01em;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--amber);
}

.hint {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
}

.hint-muted { color: var(--text-3); }

.hint code {
  font-family: 'Space Grotesk', ui-monospace, monospace;
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--ground);
  color: #C8D3E4;
}

.hint.is-error { color: #F0C9A8; }

/* ── saved sequences ───────────────────────────────────────────────── */
.save-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.save-row[hidden] { display: none; }

.save-row input[type="text"] {
  flex: 1;
  height: 44px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
}

.save-row .secondary { flex: 0 0 auto; }

.saved-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.saved-list:empty { display: none; }

.saved {
  display: flex;
  align-items: stretch;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}

.saved-load,
.saved-delete {
  border: 0;
  background: transparent;
  color: #C8D3E4;
  font-family: inherit;
}

.saved-load {
  min-height: 40px;
  padding: 0 11px;
  font-size: 13px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-load:hover { color: var(--amber); }

.saved-delete {
  width: 32px;
  color: var(--text-3);
  font-size: 17px;
  line-height: 1;
  border-left: 1px solid var(--border);
}

.saved-delete:hover { color: #F0A882; background: #2A1E16; }

.rule {
  height: 1px;
  border: 0;
  background: var(--border-soft);
  margin: 22px 0;
}

.retry-options {
  margin-top: 4px;
  margin-bottom: 20px;
  padding: 14px;
  border-radius: 12px;
  background: var(--ground);
  border: 1px solid var(--border-soft);
}

.retry-options[hidden] { display: none; }

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

.field { display: flex; flex-direction: column; gap: 7px; }

.field label {
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

select {
  height: 44px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

.field-tempo { margin-top: 18px; }

input[type="range"] {
  width: 100%;
  height: 44px;
  accent-color: var(--amber);
  background: transparent;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 22px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  min-height: 44px;
}

.checkbox input {
  width: 20px;
  height: 20px;
  accent-color: var(--amber);
}

button {
  font-family: inherit;
  cursor: pointer;
}

.primary {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 14px;
  background: var(--amber);
  color: var(--ground);
  font-size: 16px;
  font-weight: 600;
}

.primary:hover { background: #FFC45C; }

.secondary {
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid #2A3850;
  color: #E4EAF4;
  font-size: 14px;
  font-weight: 500;
}

.secondary:hover { border-color: #3C4C6B; }

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
}

.icon-button:hover { color: var(--text); background: var(--surface-2); }

.error {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 11px;
  background: #2A1E16;
  border: 1px solid #5C3A22;
  color: #F0C9A8;
  font-size: 13px;
  line-height: 1.5;
}

.footnote {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

/* ── sharing a link ────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wide { width: 100%; }

.share-out {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.share-out[hidden] { display: none; }

.share-out input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 44px;
  font-family: ui-monospace, 'Space Grotesk', monospace;
  font-size: 12px;
  color: var(--text-2);
}

.share-out .secondary { flex: 0 0 auto; min-width: 86px; }

/* ── student landing ───────────────────────────────────────────────── */
.eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.invite h1 { margin-bottom: 10px; }

.invite .lede { margin-bottom: 22px; }

.invite-notes {
  padding: 15px 16px;
  margin-bottom: 24px;
  border-radius: 13px;
  background: var(--ground);
  border: 1px solid var(--border-soft);
}

.invite-notes .eyebrow { margin-bottom: 7px; }

.invite-notes p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--amber);
  word-spacing: 0.3em;
}

.primary:disabled {
  background: var(--slate);
  color: var(--text-3);
  cursor: not-allowed;
}

/* ── practice ──────────────────────────────────────────────────────── */
.view-practice {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
}

.bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
}

.bar-top {
  height: 56px;
  border-bottom: 1px solid var(--border-soft);
}

.bar-bottom {
  height: 96px;
  border-top: 1px solid var(--border-soft);
}

.bar-top strong { font-size: 15px; font-weight: 500; }
.bar-top .muted { font-size: 14px; }

.level {
  width: 54px;
  height: 6px;
  border-radius: 3px;
  background: var(--border-soft);
  overflow: hidden;
}

.level-fill {
  width: 0;
  height: 100%;
  background: var(--amber);
  transition: width 60ms linear;
}

/* ── retry drill banner ────────────────────────────────────────────── */
.drill {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 18px;
  background: #16222F;
  border-bottom: 1px solid #2F5468;
}

.drill[hidden] { display: none; }

/* The moment the drill is cleared. */
.drill.is-done {
  background: #221C10;
  border-bottom-color: #5C4A22;
}

.drill-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
}

.drill.is-done .drill-tag { color: var(--amber); }
.drill.is-done .pip.is-filled { background: var(--amber); }

.drill-note {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
}

.pips { display: flex; gap: 5px; }

.pip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px #3A4A66;
}

.pip.is-filled {
  background: var(--cyan);
  box-shadow: none;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 18px 24px;
}

#ribbon {
  display: block;
  width: 100%;
  height: 100%;
}

.arm-hint {
  position: absolute;
  inset: auto 0 50%;
  margin: 0;
  text-align: center;
  font-size: 15px;
  color: var(--text-2);
  pointer-events: none;
}

.arm-hint[hidden] { display: none; }

.now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
}

.target-note {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  min-width: 74px;   /* holds "F♯4" without shifting the row */
}

.cents {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 3px;
}

.cents.good { color: var(--amber); }
.cents.off { color: var(--cyan); }
.cents.idle { color: var(--text-3); }

.divider {
  width: 1px;
  height: 44px;
  background: var(--border-soft);
}

/* ── results ───────────────────────────────────────────────────────── */
.score {
  display: flex;
  align-items: baseline;
  gap: 11px;
  margin-bottom: 6px;
}

.score-good {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.score-total {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--text-3);
}

.score + .small { margin: 0; }

.field-full { grid-column: 1 / -1; }

input[type="date"],
input[type="file"],
input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
}

input[type="file"] { padding: 9px 12px; height: auto; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.7); }

/* ── unlocking the picture ─────────────────────────────────────────── */
.unlock {
  padding: 15px 16px;
  margin-bottom: 22px;
  border-radius: 13px;
  background: #16222F;
  border: 1px solid #2F5468;
}

.unlock[hidden] { display: none; }
.unlock .eyebrow { color: var(--cyan); }
.unlock p:first-of-type { margin: 0 0 11px; }

.unlock-row { display: flex; gap: 8px; }
.unlock-row input { flex: 1; min-width: 0; }
.unlock-row .secondary { flex: 0 0 auto; }

/* ── the reveal puzzle ─────────────────────────────────────────────── */
.puzzle-panel { margin: 20px 0 4px; }
.puzzle-panel[hidden] { display: none; }

.puzzle-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 14px;
  overflow: hidden;
  background: var(--ground);
  border: 1px solid var(--border);
}

.puzzle-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.puzzle-tiles {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
}

.tile {
  background: #121C2A;
  box-shadow: inset 0 0 0 1px #0E1623;
  transition: opacity 600ms ease, transform 600ms ease;
}

.tile.is-open {
  opacity: 0;
  transform: scale(1.12);
}

.puzzle-progress {
  margin: 13px 0 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--amber);
}

.puzzle-panel .hint { margin-top: 5px; }

.results .eyebrow { color: var(--amber); }

.result-ribbon {
  display: block;
  width: 100%;
  height: 155px;
  margin: 20px 0 0;
}

.recovered {
  margin: 12px 0 0;
  padding: 10px 13px;
  border-radius: 10px;
  background: #16222F;
  border: 1px solid #2F5468;
  font-size: 13px;
  line-height: 1.45;
  color: #CFE6F0;
}

.recovered[hidden] { display: none; }

.problem-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.problem {
  display: flex;
  gap: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.problem-chip {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--slate);
  border: 1px solid #475C7C;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 38px;
  text-align: center;
}

.problem-body { flex: 1; min-width: 0; }

.problem-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 9px;
}

.problem-head .muted { font-size: 12px; font-weight: 400; }

.deviation {
  position: relative;
  height: 18px;
}

.deviation::before {
  content: '';
  position: absolute;
  inset: 6px 0 auto;
  height: 5px;
  border-radius: 3px;
  background: var(--border-soft);
}

.deviation::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 2px;
  width: 2px;
  height: 13px;
  margin-left: -1px;
  background: #3A4A66;
}

.deviation-marker {
  position: absolute;
  top: 0;
  width: 4px;
  height: 18px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--cyan);
}

.problem-hint {
  margin: 9px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
}

.results .primary { margin-top: 24px; }

/* ── narrow screens ────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .bar-top .muted { display: none; }
  .bar-bottom { height: 88px; }
  .target-note { font-size: 28px; min-width: 62px; }
  .stage { padding: 12px 14px; }
}

/* Earned, but the picture has not been unlocked yet. */
.tile.is-earned {
  background: #3B2F18;
  box-shadow: inset 0 0 0 1px #0E1623;
}

/* ── input meter ───────────────────────────────────────────────────── */
.meter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meter-bar {
  position: relative;
  flex: 1;
  min-width: 90px;
  height: 12px;
  border-radius: 6px;
  background: #111A28;
  border: 1px solid var(--border-soft);
  overflow: hidden;
}

.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 6px;
  background: var(--slate);
  transition: width 60ms linear;
}

.meter[data-state="quiet"] .meter-fill { background: #6C5A2E; }
.meter[data-state="hearing"] .meter-fill { background: var(--amber); }

/* Where the silence threshold sits, so "too quiet" is visible, not a mystery. */
.meter-mark {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  margin-left: -1px;
  background: var(--cyan);
  opacity: 0.85;
}

.meter-peak {
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 2px;
  margin-left: -1px;
  background: #E4EAF4;
  opacity: 0.55;
  transition: left 90ms linear;
}

.meter-label {
  min-width: 112px;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

.meter[data-state="hearing"] .meter-label { color: var(--amber); }
.meter[data-state="quiet"] .meter-label { color: #D8B268; }

.meter-compact .meter-bar { min-width: 70px; height: 9px; }
.meter-compact .meter-label {
  min-width: 42px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 13px;
}

/* ── microphone check panel ────────────────────────────────────────── */
.miccheck {
  padding: 15px 16px;
  margin-bottom: 20px;
  border-radius: 13px;
  background: var(--ground);
  border: 1px solid var(--border-soft);
}

.miccheck .meter { margin-bottom: 12px; }
.miccheck .eyebrow { margin-bottom: 11px; }

.miccheck-device {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.miccheck-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.miccheck-row label {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-2);
}

.miccheck-row input[type="range"] { flex: 1; height: 32px; }

.linkish {
  border: 0;
  background: none;
  padding: 0;
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.linkish:hover { color: var(--amber); }

/* ── tuning check (shared by both apps) ──────────────────────────────────────────────────── */
.tune-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 22px;
}

.tune-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.tune-row.is-ok { border-color: #4A3A1E; }
.tune-row.is-live { border-color: #2F5468; background: #16222F; }

.tune-name {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 19px;
  font-weight: 700;
  width: 34px;
}

.tune-meter {
  position: relative;
  flex: 1;
  height: 18px;
}

.tune-meter::before {
  content: '';
  position: absolute;
  inset: 6px 0 auto;
  height: 5px;
  border-radius: 3px;
  background: var(--border-soft);
}

.tune-meter::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 2px;
  width: 2px;
  height: 13px;
  margin-left: -1px;
  background: #3A4A66;
}

.tune-marker {
  position: absolute;
  top: 0;
  width: 4px;
  height: 18px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--cyan);
  transition: left 80ms linear;
}

.tune-state {
  width: 92px;
  text-align: right;
  font-size: 13px;
  color: var(--text-2);
}

.tune-row.is-ok .tune-state { color: var(--amber); }

/* ── how to play (shared by both games) ────────────────────────────── */
.howto-steps {
  margin: 0 0 24px;
  padding-left: 22px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
}

.howto-steps li { margin-bottom: 9px; }
.howto-steps li::marker { color: var(--amber); font-weight: 600; }

.howto-notes {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 11px 0 24px;
}

.howto-note {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 15px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.howto-name {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--amber);
  min-width: 62px;
}

.howto-where { font-size: 14px; color: var(--text-2); }

/* ── the big "what to play now" bar ────────────────────────────────── */
.nowbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 92px;
  padding: 0 22px;
  border-top: 1px solid var(--border-soft);
  background: var(--ground);
}

.nowbar-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}

.nowbar-note {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--amber);
  min-width: 104px;
}

.nowbar-where { font-size: 16px; color: #E4EAF4; }

.nowbar-cents {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--text-3);
  min-width: 78px;
  text-align: right;
}

.nowbar-cents.good { color: var(--amber); }
.nowbar-cents.off { color: var(--cyan); }

@media (max-width: 720px) {
  .nowbar { height: 76px; gap: 12px; padding: 0 14px; }
  .nowbar-note { font-size: 38px; min-width: 76px; }
  .nowbar-where { font-size: 13px; }
}

.nowbar-staff {
  flex: 0 0 auto;
  width: 92px;
  height: 72px;
}

@media (max-width: 720px) {
  .nowbar-staff { width: 70px; height: 56px; }
}

/* The language picker. Fixed rather than in a card, because it has to be
   reachable from the invite screen and from mid-game, and a student who
   cannot read the page needs it before they can find anything else. */
.lang-picker {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 60;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-2);
  background: rgba(17, 24, 41, 0.86);
  border: 1px solid var(--border);
  border-radius: 9px;
  opacity: 0.62;
  transition: opacity 140ms ease;
}

.lang-picker:hover,
.lang-picker:focus { opacity: 1; }

/* Keep the card clear of the picker rather than letting it sit on top of
   the heading. */
.view-centred { padding-top: 52px; }

@media (max-width: 560px) {
  .lang-picker {
    top: 6px;
    right: 6px;
    font-size: 11px;
    max-width: 44vw;
    padding: 4px 6px;
  }
  .view-centred { padding-top: 44px; }
}

/* Out of the way once a game starts: the HUD owns that corner, and a
   student mid-run is not changing language. */
body[data-view="game"] .lang-picker,
body[data-view="play"] .lang-picker,
body[data-view="practice"] .lang-picker { display: none; }

/* Two selects side by side stop fitting their own option text below about
   420px — "Normal — 20¢" was being clipped mid-word. One column instead. */
@media (max-width: 420px) {
  /* minmax(0, 1fr) rather than 1fr: a plain fr track refuses to shrink
     below its content's minimum width, and a <select> reports the width of
     its longest option. One column was therefore wider than the phone. */
  .field-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Same reason, for any control that can be handed text longer than its box. */
select, input[type="text"], input[type="number"], input[type="date"] {
  max-width: 100%;
}

/* --- the progress strip ---------------------------------------------------
   Shown at the end of every run, in all four apps. Three figures and a
   fortnight of bars: what this run earned, the streak it protects, and the
   total it adds to. */

.progress-strip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 16px 12px;
  margin: 4px 0 22px;
}

.strip-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  text-align: center;
}

.strip-figure {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.strip-number {
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: #E4EAF4;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.strip-number.is-gain { color: var(--amber); }

.strip-label {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* Fourteen days. Bars rather than a line: a missed day should read as a gap,
   which is the whole point of showing it. */
.strip-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 36px;
  margin-top: 14px;
}

.strip-chart i {
  flex: 1;
  min-width: 0;
  border-radius: 2px 2px 0 0;
  background: rgba(245, 181, 68, 0.55);
}

.strip-chart i.is-empty { background: rgba(140, 160, 190, 0.16); }
.strip-chart i.is-today { background: var(--amber); }

@media (max-width: 420px) {
  .strip-number { font-size: 22px; }
  .strip-label { font-size: 10px; }
}

/* Links inside cards and rows. The browser default is a dark blue that is
   all but invisible on this background. */
.card a:not(.primary):not(.secondary),
.pr-run a,
.student-sub a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 181, 68, 0.35);
}

.card a:hover,
.pr-run a:hover { border-bottom-color: var(--amber); }

/* An anchor styled as a button has to be told to behave like one. */
a.primary, a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
