/* Hack-a-thon pages (ops.dassian.com/hackathon/). Poster look from the event flyer:
   off-white ground, navy condensed caps, gold trophy star, blue eyebrow.
   Title bar + footer follow the portal's canonical pattern. */
:root {
  --bg: #f7f5f0; --surface: #ffffff; --fg: #14213d; --muted: #59627a; --line: #dcd8cd;
  --navy: #1b2a4a; --navy-ink: #f7f5f0; --soft: #ebe8df; --blue: #2f62b5; --gold: #f2b632;
  --danger: #c0392b; --ok: #1d7a4a;
  --f-display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --f-body: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: ui-monospace, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }

/* Canonical title bar */
header.bar { background: var(--navy); color: #fff; padding: 0 28px; height: 60px; display: flex; align-items: center; gap: 14px; position: relative; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
header.bar h1 { font-family: "Segoe UI", system-ui, sans-serif; font-size: 15px; font-weight: 600; letter-spacing: .3px; margin: 0; white-space: nowrap; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
#user-display { font-size: 13px; font-weight: 600; color: var(--navy); background: #fff; border-radius: 4px; padding: 4px 10px; white-space: nowrap; }
#user-display:empty { display: none; }
.pill { font-size: 13px; font-weight: 600; color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: 6px; padding: 5px 12px; text-decoration: none; cursor: pointer; font-family: "Segoe UI", system-ui, sans-serif; white-space: nowrap; }
.pill:hover { background: rgba(255,255,255,.24); }
@media (max-width: 640px) { header.bar { padding: 0 14px; } header.bar h1 { display: none; } #user-display { display: none; } }

main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 40px 20px 64px; display: grid; gap: 32px; }

/* Poster hero */
.hero { display: grid; gap: 18px; justify-items: start; }
.eyebrow { font-weight: 700; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.hero h2.big { font-family: var(--f-display); font-weight: 700; text-transform: uppercase; font-size: clamp(36px, 8vw, 66px); line-height: 1.04; margin: -6px 0 4px; color: var(--navy); }
.hero h2.big span { display: block; }
.timeline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.pill-outline { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: clamp(16px, 2.6vw, 21px); color: var(--navy); border: 2px solid var(--navy); border-radius: 999px; padding: 6px 22px; }
.then { font-family: var(--f-display); font-weight: 600; font-size: clamp(16px, 2.6vw, 21px); }
.demo { display: flex; align-items: center; gap: 14px 22px; }
.demo .pill-solid { min-width: 0; }
@media (max-width: 520px) { .demo { flex-wrap: wrap; } }
.trophy { width: 64px; height: 64px; flex: none; }
.pill-solid { font-family: var(--f-display); font-weight: 600; letter-spacing: .05em; font-size: clamp(17px, 3vw, 27px); line-height: 1.2; background: var(--navy); color: var(--navy-ink); border-radius: 999px; padding: 14px 26px; box-shadow: 0 8px 18px rgba(20,33,61,.22); }
.pill-solid .uc { text-transform: uppercase; }
.lede { font-size: clamp(16px, 2.3vw, 20px); font-weight: 500; margin: 4px 0 0; }
.prizes { text-transform: none; font-size: clamp(15px, 2.3vw, 20px); letter-spacing: .03em; border-radius: 22px; padding: 8px 18px; }
.prizes sup { font-size: .6em; }
.intro { color: var(--muted); margin: 0; max-width: 62ch; }
.intro a, .muted-link { color: var(--blue); font-weight: 600; }

h3.sec { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 24px; margin: 0; }

/* Form card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: grid; gap: 20px; }
form { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; min-width: 0; }
label, .label { font-weight: 700; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; }
.req { color: var(--blue); }
input[type=text], input[type=search], textarea { width: 100%; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
textarea { min-height: 130px; resize: vertical; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.members { display: grid; gap: 8px; }
.member-row { display: flex; gap: 8px; align-items: center; }
.member-row .num { font-family: var(--f-mono); font-size: 12px; color: var(--muted); width: 22px; text-align: right; flex: none; }
.member-row input { flex: 1; min-width: 0; }
.counter { font-family: var(--f-mono); font-size: 12px; color: var(--muted); justify-self: end; }
button { font: inherit; cursor: pointer; border-radius: 8px; }
.btn { background: var(--navy); color: var(--navy-ink); border: 0; padding: 11px 22px; font-weight: 700; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-ghost { background: transparent; color: var(--navy); border: 1px dashed var(--navy); padding: 8px 14px; font-weight: 500; justify-self: start; }
.icon-btn { background: transparent; border: 1px solid var(--line); color: var(--muted); width: 38px; height: 38px; flex: none; font-size: 18px; line-height: 1; }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.small { font-size: 13px; padding: 6px 12px; background: transparent; border: 1px solid var(--line); color: var(--muted); }
.small.danger:hover { color: var(--danger); border-color: var(--danger); }
.status { font-size: 14px; }
.status.ok { color: var(--ok); } .status.err { color: var(--danger); }
.notice { background: var(--soft); border-radius: 8px; padding: 14px 16px; font-size: 14px; }
.notice.ok { border-left: 4px solid var(--ok); }
.notice.err { border-left: 4px solid var(--danger); }

/* Submissions list */
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; min-width: 120px; }
.stat b { display: block; font-family: var(--f-display); font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input { width: min(320px, 100%); }
.teams { display: grid; gap: 12px; }
.team { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: grid; gap: 8px; min-width: 0; }
.team.mine { border-color: var(--navy); box-shadow: inset 4px 0 0 var(--gold); }
.team-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.team-name { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: 14px; color: var(--blue); }
.team-name .no { color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; }
.team h4 { font-family: var(--f-display); font-weight: 600; font-size: 21px; margin: 0; overflow-wrap: anywhere; }
.team p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--soft); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.meta { font-size: 12px; color: var(--muted); }
.tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--navy); background: var(--gold); border-radius: 4px; padding: 2px 6px; }
.team-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.empty { border: 1px dashed var(--line); border-radius: 12px; padding: 28px; text-align: center; color: var(--muted); }

/* Loading overlay */
#loading { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 50; transition: opacity .3s; font-family: var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--navy); }
#loading.fade { opacity: 0; }

.site-footer { text-align: center; font-size: 12px; padding: 18px 0 24px; }
.site-footer a { color: #000; text-decoration: none; }
@media (prefers-reduced-motion: reduce) { #loading { transition: none; } }

/* Registration deadline callout */
.closes { font-weight: 700; color: #c0392b; font-size: clamp(17px, 2.6vw, 22px); margin: 0; }

/* ── Voting: rising bar chart ── */
.vchart-wrap { overflow-x: auto; padding-bottom: 4px; }
.vchart { display: flex; align-items: stretch; justify-content: center; height: var(--chart-h, 380px); min-width: 100%; padding-top: 52px; }
.vcol { flex: 1 1 0; min-width: 84px; max-width: 200px; display: flex; flex-direction: column; padding: 0 7px; }
.vtrack { flex: 1; display: flex; align-items: flex-end; justify-content: center; margin: 0 -7px; border-bottom: 3px solid var(--navy); }
.vbar { position: relative; width: 72%; min-height: 4px; background: var(--navy); border-radius: 8px 8px 0 0; transition: height .9s cubic-bezier(.2,.8,.2,1); }
.vcol.lead .vbar { background: var(--gold); box-shadow: 0 0 0 2px var(--navy) inset; }
.vcount { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -6px); font-family: var(--f-display); font-weight: 700; font-size: clamp(18px, 2.4vw, 30px); color: var(--navy); font-variant-numeric: tabular-nums; }
.vlabel { display: grid; gap: 2px; text-align: center; padding-top: 10px; height: auto; }
.vteam { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 14px; color: var(--blue); overflow-wrap: anywhere; }
.vproj { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .vbar { transition: none; } }

/* ── Voting: ballot ── */
.ballot { display: grid; gap: 10px; }
.pick { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; }
.pick:hover { border-color: var(--muted); }
.pick input { width: 20px; height: 20px; margin-top: 3px; accent-color: #1b2a4a; }
.pick.on { border-color: var(--navy); box-shadow: inset 4px 0 0 var(--gold); }
.pick.off { opacity: .55; cursor: not-allowed; }
.pick .pt { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 14px; color: var(--blue); }
.pick .ph { font-weight: 700; font-size: 16px; }
.pick .pm { font-size: 13px; color: var(--muted); }
.vote-bar { position: sticky; bottom: 0; background: var(--surface); margin: 0 -24px -24px; padding: 14px 24px; border-radius: 0 0 12px 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); }
.picked { font-family: var(--f-display); font-weight: 600; font-size: 18px; letter-spacing: .03em; }
.state-pill { display: inline-block; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; border-radius: 999px; padding: 4px 12px; }
.state-pill.open { background: #d9f2e3; color: var(--ok); }
.state-pill.closed { background: #f6dddb; color: var(--danger); }
