
:root {
  /* AUB Mediterraneo's colours (aubmed.ac.cy): maroon, slate text, light grey lines. */
  --brand: #840132; --page: #F8FAFC; --ink: #0F172A; --white: #FFFFFF;
  --line: #E5E7EB; --muted: #64748B;
  --done-bg: #C8D9C2; --done-ink: #2F6B4F;
  --wait-bg: #B8D4E8; --wait-ink: #2E5C7A;
  --due-bg: #E8D9C8; --due-ink: #8A5A2B;
  --err-bg: #F2DCD8; --err-ink: #9B3B30;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 700; color: var(--brand); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 8px; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.25rem; margin-top: 24px; } h3 { font-size: 1.05rem; }
a { color: var(--brand); }
.top { background: var(--brand); color: var(--white); padding: 14px 16px; }
.logos { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 528px; margin: 0 auto; }
.logo { height: 60px; width: auto; display: block; }
/* Same visible height as the AUB logo (its file has about 7 pixels of space above and below at 60 pixels), a little softer. */
.logo.ours { height: 53px; opacity: 0.85; }
/* The Rally Paper logo above the welcome text: it names the event, so the header carries only the two logos. */
.hero-logo { display: block; width: 168px; height: auto; margin: 32px auto 35px; }
/* The event name: centred, the same size and weight as the challenge names (h3), with room below. */
.event { display: block; max-width: 528px; margin: 10px auto 6px; text-align: center; font-size: 1.05rem; font-weight: 700; line-height: 1.3; color: rgba(255, 255, 255, 0.9); }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
.prose ul { padding-left: 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--due-bg); color: var(--due-ink); }
.card { display: block; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 8px 0; text-decoration: none; color: inherit; }
.card h3 { margin-bottom: 2px; }
.card .meta { font-size: 14px; color: var(--muted); }
.status { font-size: 14px; margin-top: 4px; }
.status.done { color: var(--done-ink); } .status.wait { color: var(--wait-ink); } .status.due { color: var(--due-ink); } .status.err { color: var(--err-ink); }
.strip { border-radius: 8px; padding: 10px 12px; margin: 8px 0; font-size: 14px; }
.strip.wait { background: var(--wait-bg); color: var(--wait-ink); } .strip.due { background: var(--due-bg); color: var(--due-ink); } .strip.err { background: var(--err-bg); color: var(--err-ink); } .strip.done { background: var(--done-bg); color: var(--done-ink); }
.points { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 2rem; color: var(--brand); }
button, .button { display: block; width: 100%; min-height: 48px; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: var(--white); font: 700 16px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding: 10px 16px; margin: 8px 0; cursor: pointer; text-align: center; text-decoration: none; }
button.secondary, .button.secondary { background: var(--white); color: var(--brand); }
button:disabled { opacity: 0.5; }
input[type="text"] { width: 100%; min-height: 52px; font: 700 24px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: 0.15em; text-transform: uppercase; text-align: center; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--brand); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 12px 0; }
label.check input { width: 22px; height: 22px; margin-top: 1px; }
.viewer { width: 100%; border-radius: 16px; background: #1F1F1F; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.viewer.whole { object-fit: contain; }
.timer { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 1.5rem; text-align: center; color: var(--brand); }
.group { margin-top: 20px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.ranking { width: 100%; border-collapse: collapse; font-size: 14px; } .ranking td { padding: 4px 0; border-bottom: 1px solid var(--line); } .ranking td:last-child { text-align: right; }
.levels { margin: -8px 0 14px; padding-left: 20px; } .levels li { margin: 2px 0; }

/* Review page */
body.review main { max-width: 760px; }
/* The header lines up with the page's edges (the page width less its padding). */
body.review .logos, body.review .event { max-width: 728px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.tabs button { width: auto; min-height: 40px; margin: 0; padding: 6px 12px; font-size: 14px; }
.actions { margin-top: 8px; }
.actions button { margin: 6px 0; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; margin: 0; }
select { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font: 16px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding: 6px 10px; width: 100%; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.stack label { display: block; margin: 10px 0; font-size: 14px; }
.entry { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
details summary { cursor: pointer; font-size: 14px; color: var(--brand); margin-top: 8px; }
body.review .viewer { aspect-ratio: auto; max-height: 70vh; margin: 8px 0; }

/* Results board (/board): one 16:9 screen for a projector or TV, sizes follow the screen's height. */
body.board { height: 100vh; overflow: hidden; display: grid; grid-template-rows: 1fr auto; background: var(--page); user-select: none; }
body.board.idle { cursor: none; }
.stage { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3vh 4vw; min-height: 0; }
.board-logo { height: 58vh; width: auto; transition: height 0.9s ease; }
.stage.started .board-logo { height: 21vh; }
.places { list-style: none; margin: 0; padding: 0; width: min(78vw, 140vh); display: grid; gap: 1.6vh; max-height: 0; opacity: 0; transition: max-height 0.9s ease, opacity 0.6s ease 0.3s, margin 0.9s ease; }
.stage.started .places { max-height: 70vh; opacity: 1; margin-top: 3vh; }
.place { display: grid; grid-template-columns: 13vh 1fr auto; align-items: center; gap: 3vh; height: calc(52vh / var(--rows, 4)); max-height: 12vh; padding: 0 4vh 0 1.6vh; border-radius: 2vh;
  background: var(--white); border: 0.25vh dashed var(--line); color: var(--muted); font-size: 5.2vh; font-weight: 700; }
.place .badge { display: flex; align-items: center; justify-content: center; height: 80%; aspect-ratio: 1; border-radius: 50%; background: var(--line); color: var(--muted); font-size: 3.4vh; }
.place .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0.02em; }
.place .pts { font-variant-numeric: tabular-nums; }
.place.shown { border: 0.25vh solid var(--line); border-left: 1.2vh solid var(--brand); color: var(--ink); box-shadow: 0 0.6vh 2vh rgba(15, 23, 42, 0.08); }
.place.shown.fresh { animation: slide-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.place.shown .badge { background: var(--brand); color: var(--white); }
.place.shown .pts { color: var(--brand); }
.place.first.shown { background: var(--brand); border-color: var(--brand); border-left-color: #C9A227; color: var(--white); transform: scale(1.03); }
.place.first.shown.fresh { animation: slide-in-first 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.place.first.shown .badge { background: #C9A227; color: var(--brand); }
.place.first.shown .pts { color: #F4D77A; }
@keyframes slide-in { from { opacity: 0; transform: translateX(-6vw); } to { opacity: 1; transform: none; } }
@keyframes slide-in-first { from { opacity: 0; transform: scale(0.8); } 60% { transform: scale(1.07); } to { opacity: 1; transform: scale(1.03); } }
.board-note { margin: 4vh 0 0; font-size: 2.2vh; color: var(--muted); }
.stage.started .board-note { display: none; }
.board-note.err { max-width: 60vw; text-align: center; font-size: 3vh; color: var(--err-ink); }
.band { background: var(--brand); display: flex; align-items: center; justify-content: space-between; padding: 1.8vh 4vw; }
.band img { height: 6vh; width: auto; display: block; }
.band img.ours { height: 5.3vh; opacity: 0.85; }
#confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; }
