:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --line: #e3e5ea;
  --line-strong: #c9ccd4;
  --text: #1c1e23;
  --muted: #6a7080;
  --accent: #6d28d9;
  --accent-weak: #f1ebfd;
  --green: #16d97a;
  --green-soft: #d9fbe9;
  --amber: #f0a92e;
  --red: #d93a3a;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(20, 24, 34, 0.09), 0 1px 2px rgba(20, 24, 34, 0.05);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- app bar ---------- */
.appbar {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 52px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.appbar-brand {
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.appbar-brand span { color: var(--muted); font-weight: 450; }
.appbar-links { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.appbar-links a {
  padding: 6px 11px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.appbar-links a:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.appbar-links a.active { background: var(--accent-weak); color: var(--accent); font-weight: 550; }
.appbar-right { display: flex; align-items: center; gap: 12px; }

.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); display: block; }
.conn.ok i { background: var(--green); }

/* ---------- layout ---------- */
.page { padding: 22px; max-width: 1500px; margin: 0 auto; }
.page-wide { max-width: none; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.015em; }
h2 { font-size: 16px; margin: 26px 0 10px; letter-spacing: -0.01em; }
.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 14px; letter-spacing: 0.01em; text-transform: uppercase; color: var(--muted); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- controls ---------- */
button, .btn {
  font: inherit;
  font-size: 14px;
  /* .btn is used on <a>; inline padding would overflow the line box and collide. */
  display: inline-block;
  line-height: 1.2;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
}
button:hover:not(:disabled), .btn:hover { background: var(--bg); text-decoration: none; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary, .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 550;
}
button.primary:hover:not(:disabled) { background: #5821ae; }
button.danger { color: var(--red); border-color: #f0c4c4; }
button.danger:hover:not(:disabled) { background: #fdf2f2; }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
button.small { padding: 4px 9px; font-size: 13px; }

input, select, textarea {
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
}
label.field { display: block; margin-bottom: 12px; }
label.field > span {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 500;
}
label.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
label.inline input { width: auto; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
  white-space: nowrap;
}
td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: #fafbfc; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.rank-cell { width: 54px; text-align: center; font-weight: 600; }
.muted { color: var(--muted); }
.empty { padding: 34px 12px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- scoretaking screen ---------- */
.score-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  height: calc(100vh - 52px);
}
.score-form {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
}
.score-table-pane { overflow: auto; background: var(--surface); }

.limits { font-size: 13px; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }
.limits b { color: var(--text); font-weight: 600; }

.attempt-field { margin-bottom: 8px; position: relative; }
.attempt-field input {
  font-family: var(--mono);
  font-size: 16px;
  padding: 11px 12px;
}
.attempt-field.locked input { background: #f2f3f5; color: var(--muted); }
.attempt-field .plus2-tag {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  pointer-events: none;
}
.attempt-field input.over-limit { border-color: var(--red); background: #fff6f6; }

.competitor-wrap { position: relative; margin-bottom: 18px; }
.competitor-wrap > label > span { color: var(--accent); }
.suggestions {
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(20, 24, 34, 0.14);
  max-height: 260px;
  overflow-y: auto;
  z-index: 30;
}
.suggestions:empty { display: none; }
.suggestion { padding: 8px 11px; cursor: pointer; font-size: 14px; display: flex; gap: 9px; align-items: baseline; }
.suggestion.on { background: var(--accent-weak); }
.suggestion b { font-family: var(--mono); font-size: 12.5px; color: var(--muted); min-width: 34px; }
.suggestion .done { margin-left: auto; font-size: 11px; color: var(--green); font-weight: 700; }

.totals {
  display: flex;
  gap: 22px;
  font-size: 14px;
  margin: 14px 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.totals div span { color: var(--muted); font-size: 12.5px; display: block; }
.totals div b { font-family: var(--mono); font-size: 16px; font-weight: 600; }

.cutoff-warn { font-size: 12.5px; color: var(--amber); margin-bottom: 10px; font-weight: 500; }

.keyhelp {
  background: #4a4f58;
  color: #fff;
  border-radius: var(--radius);
  padding: 11px 13px;
  font-size: 12.5px;
  line-height: 1.75;
  margin-top: 16px;
}
.keyhelp b { display: block; margin-bottom: 3px; font-weight: 650; }
.keyhelp kbd {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.16);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11.5px;
}

tr.entered .rank-cell { background: var(--green); color: #08351f; }
tr.pending .rank-cell { background: #eceef1; color: var(--muted); }
tr.focused { background: var(--accent-weak) !important; }
tr.cut td { opacity: 0.55; }
/* Competitors on track to advance get a tinted row, not a per-cell rule. */
tr.advancing td { background: #f4fdf8; }
tr.advancing:hover td { background: #ecfbf3; }

.attempt-cell { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.attempt-cell.trimmed { color: var(--muted); }
.attempt-cell.best-attempt { font-weight: 700; }

/* ---------- results / public ---------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.podium-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; text-align: center; box-shadow: var(--shadow); }
.podium-card .pos { font-size: 26px; }
.podium-card .who { font-weight: 600; margin: 4px 0 2px; }
.podium-card .val { font-family: var(--mono); font-size: 18px; }

/* Non-final rounds get this instead of a podium — nobody has "won" a round
   they're only advancing out of. */
.advance-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--green-soft);
  border: 1px solid #a7ecc4;
  color: #0b6b3d;
  font-size: 14px;
  font-weight: 550;
}
.advance-note-icon { font-size: 15px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 9px 14px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 14px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.tab:hover { background: transparent; color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.pill.live { background: var(--green-soft); color: #0b6b3d; }
.pill.done { background: #eceef1; color: var(--muted); }

/* ---------- bracket ---------- */
.bracket { display: flex; gap: 34px; overflow-x: auto; padding: 8px 4px 18px; align-items: stretch; }
.bracket-round { display: flex; flex-direction: column; min-width: 230px; }
.bracket-round h4 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
  height: 16px;
}
/* Matches share the remaining height evenly, so each round's matches sit
   centred against the pair that feeds them. */
.bracket-matches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }
.match {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.match-side {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.match-side:last-child { border-bottom: none; }
.match-side:hover { background: var(--bg); }
.match-side.win { background: var(--green-soft); font-weight: 650; }
.match-side .seed { font-family: var(--mono); font-size: 11px; color: var(--muted); min-width: 16px; }
.match-side .score { margin-left: auto; font-family: var(--mono); font-size: 13px; }
.match-side.tbd { color: var(--muted); font-style: italic; cursor: default; }

.match.clickable { cursor: pointer; }
.match.clickable:hover { border-color: var(--accent); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 34, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border-radius: 10px;
  padding: 22px;
  width: min(460px, 100%);
  box-shadow: 0 18px 46px rgba(20, 24, 34, 0.3);
}
.modal h3 { margin: 0 0 18px; font-size: 17px; letter-spacing: -0.01em; }
#match-modal .modal { width: min(640px, 100%); }
.match-teams-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.match-team-col h4 { margin: 0 0 12px; font-size: 14.5px; letter-spacing: -0.01em; }
.match-member-field { margin-bottom: 10px; }
.match-team-total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 600;
}
.match-team-total.leading { color: #0b6b3d; }
@media (max-width: 520px) {
  .match-teams-grid { grid-template-columns: 1fr; }
}

/* ---------- projector / LED stage mode ----------
   Palette taken from the competition posters: deep violet-black ground, electric
   purple glow, gold for anything that matters. Sized off the viewport so it
   reads from across a concourse; row height is set in px from JS so the
   pagination maths is exact. */
body.projector { background: #0a0512; overflow: hidden; }
body.projector > *:not(.proj-stage) { display: none !important; }

.proj-stage {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  color: #f7f2ff;
  font-variant-numeric: tabular-nums;
  background:
    radial-gradient(65% 55% at 6% -12%, rgba(147, 51, 234, 0.55) 0%, transparent 62%),
    radial-gradient(60% 50% at 98% 8%, rgba(168, 85, 247, 0.34) 0%, transparent 60%),
    radial-gradient(70% 60% at 50% 118%, rgba(109, 40, 217, 0.38) 0%, transparent 62%),
    linear-gradient(165deg, #230d3d 0%, #150726 45%, #0a0512 100%);
}

/* Gold rail, echoing the banded gold panels on the posters. */
.cube-rail {
  height: 0.75vh;
  min-height: 4px;
  flex: 0 0 auto;
  background: linear-gradient(90deg, #7a5410 0%, #d4a017 18%, #ffe89a 38%, #f5c542 55%, #d4a017 78%, #7a5410 100%);
}

/* A 3x3 sticker face — instantly recognisable as a cube. */
.cube-mark { display: block; flex: 0 0 auto; height: auto; }
.proj-mark { width: clamp(34px, 7.2vh, 100px); }

.proj-head {
  display: flex;
  align-items: center;
  gap: 1.6vw;
  padding: 2.2vh 3vw 1.7vh;
  border-bottom: 1px solid rgba(196, 154, 255, 0.22);
}
/* The competition is the headline; MYCSA is the system credit in the footer. */
.proj-comp {
  font-size: clamp(15px, 3.1vh, 46px);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.08;
  background: linear-gradient(180deg, #fff6d2 0%, #f5c542 52%, #d09a12 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.proj-event {
  font-size: clamp(13px, 2.4vh, 34px);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffffff;
  line-height: 1.25;
  margin-top: 0.35vh;
}
.proj-head-right { margin-left: auto; text-align: right; }
.proj-rankedby {
  font-size: clamp(10px, 1.6vh, 21px);
  color: #b9a3dd;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.proj-range {
  font-size: clamp(15px, 2.6vh, 38px);
  font-weight: 700;
  color: #ffffff;
}
.proj-live {
  display: inline-flex;
  align-items: center;
  gap: 0.7vw;
  font-size: clamp(11px, 1.7vh, 23px);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #e879f9;
  text-transform: uppercase;
}
.proj-live i {
  width: 1.1vh; height: 1.1vh;
  min-width: 7px; min-height: 7px;
  border-radius: 50%;
  background: #e879f9;
  box-shadow: 0 0 1.2vh rgba(232, 121, 249, 0.85);
  animation: proj-pulse 2s ease-in-out infinite;
}
.proj-live.off, .proj-live.off i { color: #ff6b6b; background: #ff6b6b; box-shadow: none; animation: none; }
@keyframes proj-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.proj-body { flex: 1; min-height: 0; padding: 0 3vw; display: flex; flex-direction: column; }
/* Deliberately a transform-only entrance. If the browser ever freezes its
   animation timeline — which it does whenever the tab is considered hidden or
   occluded — an opacity keyframe would leave the screen blank. A stalled
   translate is invisible to the audience. */
.proj-slide { flex: 1; min-height: 0; animation: proj-in 0.4s ease both; }
@keyframes proj-in { from { transform: translateY(1.2vh); } to { transform: none; } }

.proj-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.proj-table th {
  position: static;
  background: none;
  color: #b9a3dd;
  font-size: clamp(10px, 1.55vh, 20px);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 650;
  padding: 1.2vh 1vw 0.9vh;
  border-bottom: 1px solid rgba(196, 154, 255, 0.28);
}
.proj-table td {
  height: var(--proj-row);
  padding: 0 1vw;
  border-bottom: 1px solid rgba(196, 154, 255, 0.13);
  font-size: var(--proj-font);
  color: #f4eeff;
}
.proj-table tbody tr:nth-child(even) td { background: rgba(168, 85, 247, 0.10); }

.proj-rank {
  width: 9%;
  text-align: center;
  font-weight: 750;
  color: #b9a3dd;
}
.proj-name { font-weight: 600; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-country { width: 11%; color: #b9a3dd; font-size: calc(var(--proj-font) * 0.72); }
.proj-num { width: 17%; text-align: right; font-family: var(--mono); color: #ded2f5; }
/* The column that decides the ranking, in gold so the eye lands on it. */
.proj-key { font-weight: 750; color: #f5c542; }

/* Medals read instantly from a distance. These selectors are deliberately more
   specific than the zebra-striping rule above, which is a `background`
   shorthand and would otherwise wipe out the medal gradient. */
.proj-table tbody tr.proj-gold td,
.proj-table tbody tr.proj-silver td,
.proj-table tbody tr.proj-bronze td { background: rgba(245, 197, 66, 0.13); }

.proj-table tbody tr.proj-gold .proj-rank {
  color: #2a1c02;
  background: linear-gradient(180deg, #ffe89a, #d4a017);
}
.proj-table tbody tr.proj-silver .proj-rank {
  color: #1c1a22;
  background: linear-gradient(180deg, #f2f2f7, #b7b7c4);
}
.proj-table tbody tr.proj-bronze .proj-rank {
  color: #241505;
  background: linear-gradient(180deg, #e8ad78, #b8702f);
}
.proj-table tbody tr.proj-gold .proj-name { color: #ffe89a; }
.proj-table tbody tr.proj-gold .proj-key { color: #fff6d2; }

/* Non-final rounds: no medals, just a highlight on who moves on. */
.proj-table tbody tr.proj-advancing td { background: rgba(22, 217, 122, 0.14); }
.proj-table tbody tr.proj-advancing .proj-rank { color: #baffdd; }

.proj-foot {
  display: flex;
  align-items: center;
  gap: 1.6vw;
  padding: 1.5vh 3vw 1.8vh;
  border-top: 1px solid rgba(196, 154, 255, 0.22);
  font-size: clamp(11px, 1.9vh, 26px);
  color: #b9a3dd;
}
.proj-foot b { color: #fff; font-weight: 650; }
/* System credit — small, so it never competes with the competition name. */
.proj-credit {
  display: inline-flex;
  align-items: center;
  gap: 0.6vw;
  color: #9b86c4;
  font-size: clamp(9px, 1.5vh, 19px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.proj-credit .cube-mark { width: clamp(14px, 2.4vh, 30px); }
.proj-dots { display: flex; gap: 0.6vw; margin-left: auto; }
.proj-dot {
  width: 1.1vh; height: 1.1vh;
  min-width: 7px; min-height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.26);
}
.proj-dot.on { background: #f5c542; }

.proj-progress { height: 0.55vh; min-height: 3px; background: rgba(255, 255, 255, 0.12); }
.proj-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #f5c542);
  transform-origin: left;
  animation: proj-sweep linear forwards;
}
@keyframes proj-sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.proj-paused .proj-progress i { animation-play-state: paused; }

.proj-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6vh;
  text-align: center;
}
.proj-empty .cube-mark { width: clamp(60px, 14vh, 190px); margin-bottom: 1vh; }
.proj-empty h2 { font-size: clamp(20px, 4.6vh, 66px); margin: 0; font-weight: 750; }
.proj-empty p { color: #b9a3dd; font-size: clamp(13px, 2.2vh, 30px); margin: 0; }

.proj-hint {
  position: fixed;
  bottom: 1.6vh;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(168, 85, 247, 0.3);
  color: #f7f2ff;
  padding: 0.8vh 1.6vw;
  border-radius: 999px;
  font-size: clamp(11px, 1.7vh, 20px);
  transition: opacity 0.6s;
  pointer-events: none;
}
.proj-hint.gone { opacity: 0; }

/* Team battle on the big screen */
.proj-bracket { display: flex; gap: 2.4vw; height: 100%; padding: 2vh 0; }
.proj-round { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.proj-round h4 {
  margin: 0 0 1.6vh;
  font-size: clamp(11px, 2vh, 27px);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #b9a3dd;
  font-weight: 650;
}
.proj-round-body { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 1.8vh; }
.proj-match {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(196, 154, 255, 0.3);
  border-radius: 1vh;
  overflow: hidden;
}
/* A knockout column holds at most a handful of matches, so the type can be far
   larger than the ranking tables — this is the slide people watch. */
.proj-side {
  display: flex;
  align-items: center;
  gap: 1vw;
  padding: 1.6vh 1.2vw;
  font-size: clamp(14px, 3vh, 44px);
  font-weight: 550;
  border-bottom: 1px solid rgba(196, 154, 255, 0.18);
}
.proj-side:last-child { border-bottom: none; }
.proj-side .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-side .v { margin-left: auto; font-family: var(--mono); color: #ded2f5; }
.proj-side.win {
  background: linear-gradient(90deg, rgba(245, 197, 66, 0.34), rgba(245, 197, 66, 0.14));
  box-shadow: inset 0.4vh 0 0 #f5c542;
  font-weight: 750;
}
.proj-side.win .v { color: #ffe89a; }
.proj-side.tbd { color: #9b86c4; font-style: italic; }
.proj-champ { background: linear-gradient(180deg, #ffe89a, #d4a017); color: #2a1c02; font-weight: 800; }

/* ---------- toasts ---------- */
.toast-host { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: #24272e;
  color: #fff;
  padding: 10px 15px;
  border-radius: var(--radius);
  font-size: 13.5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  transition: opacity 0.4s, transform 0.4s;
  max-width: 340px;
}
.toast.out { opacity: 0; transform: translateY(6px); }
.toast-error { background: var(--red); }
.toast-success { background: #14804a; }

/* ---------- misc ---------- */
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.scroll-x { overflow-x: auto; }
.tag { font-size: 11.5px; background: var(--bg); border: 1px solid var(--line); padding: 1px 7px; border-radius: 999px; color: var(--muted); }

@media (max-width: 900px) {
  .score-layout { grid-template-columns: 1fr; height: auto; }
  .score-form { border-right: none; border-bottom: 1px solid var(--line); }
  .podium { grid-template-columns: 1fr; }
}

@media print {
  .appbar, .keyhelp, .score-form, .tabs, button { display: none !important; }
  .score-layout { display: block; height: auto; }
  body { background: #fff; }
  .card { box-shadow: none; border: none; }
}
