@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wdth,wght@12..96,75..100,400..800&family=Instrument+Sans:wght@400;500;600&display=swap');

:root {
  --night: #1b0f24;
  --night-2: #2b1a39;
  --night-3: #3b2650;
  --gold: #e3a82b;
  --gold-soft: #f4d58a;
  --red: #c4312a;
  --leaf: #1f7a4d;
  --paper: #f8f6f9;
  --white: #ffffff;
  --ink: #1a1220;
  --muted: #655a6e;
  --line: #e3dde9;
  --line-dark: rgba(255, 255, 255, 0.14);
  --display: 'Bricolage Grotesque', 'Arial Narrow', Arial, sans-serif;
  --body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 10px;
  /* woven kente strip: warp stripes with a weft texture laid over them */
  --kente: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(90deg, var(--gold) 0 12px, var(--night) 12px 15px, var(--red) 15px 27px, var(--night) 27px 30px, var(--leaf) 30px 42px, var(--night) 42px 45px);
  --kente-gold: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(90deg, var(--gold) 0 18px, #b9831a 18px 21px, var(--gold-soft) 21px 33px, #b9831a 33px 36px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); font-size: 17px; line-height: 1.55; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.02; margin: 0; letter-spacing: -0.01em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

.weave { height: 14px; background: var(--kente); background-size: 45px 100%, 45px 100%; }

/* ---------- buttons ---------- */
.btn { font: 600 1rem/1 var(--body); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 22px; min-height: 48px; border-radius: 999px; border: 2px solid transparent; cursor: pointer; text-decoration: none; transition: transform 0.15s ease, background 0.15s ease; }
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--night); }
.btn-gold:hover { background: var(--gold-soft); }
.btn-line { background: transparent; color: var(--white); border-color: var(--line-dark); }
.btn-line:hover { border-color: var(--gold); }
.btn-dark { background: var(--night); color: var(--white); }
.btn-dark:hover { background: var(--night-3); }
.btn-small { padding: 9px 16px; min-height: 40px; font-size: 0.92rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero { background: radial-gradient(900px 500px at 85% 10%, var(--night-3) 0%, transparent 70%), var(--night); color: var(--white); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; }
.brand { font: 800 1.25rem/1 var(--display); font-stretch: 80%; text-decoration: none; letter-spacing: 0.01em; }
.brand span { color: var(--gold); }
.topbar nav { display: flex; align-items: center; gap: 26px; }
.topbar nav a:not(.btn) { text-decoration: none; opacity: 0.85; }
.topbar nav a:not(.btn):hover { opacity: 1; color: var(--gold-soft); }

.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; padding: 40px 0 72px; }
.hero h1 { font-size: clamp(3.6rem, 9.2vw, 8rem); font-weight: 800; font-stretch: 76%; line-height: 0.9; letter-spacing: -0.02em; }
.hero h1 span { display: block; }
.hero h1 .year { color: var(--gold); }
.hero .lede { max-width: 30rem; font-size: 1.15rem; margin: 26px 0 0; color: #ddd3e6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.status { display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; padding: 8px 14px; border: 1px solid var(--line-dark); border-radius: 999px; font-size: 0.95rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #8d809a; flex: none; }
.status[data-state='open'] .dot { background: #46d08a; box-shadow: 0 0 0 4px rgba(70, 208, 138, 0.2); }
.status[data-state='scheduled'] .dot { background: var(--gold); }
.status[data-state='ended'] .dot, .status[data-state='closed'] .dot { background: var(--red); }

.lead-panel { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-dark); border-radius: 16px; padding: 22px 22px 14px; backdrop-filter: blur(4px); }
.lead-panel h2 { font-size: 1.5rem; font-stretch: 80%; }
.lead-panel .total { color: #c9bdd6; font-size: 0.95rem; margin: 6px 0 16px; }
.lead-list { list-style: none; margin: 0; padding: 0; }
.lead-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line-dark); }
.lead-list .pos { font: 800 1.3rem/1 var(--display); color: var(--gold); }
.lead-list .nm { font-weight: 600; }
.lead-list .cd { color: #b4a7c2; font-size: 0.85rem; }
.lead-list .vt { font-weight: 600; }
.lead-list .bar { grid-column: 2 / -1; height: 6px; border-radius: 3px; background: var(--kente); background-size: 45px 100%, 45px 100%; transition: width 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.lead-panel .more { display: block; text-align: center; padding: 12px; color: var(--gold-soft); text-decoration: none; font-weight: 600; }

/* ---------- sections ---------- */
section { padding: 80px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-stretch: 80%; font-weight: 800; }
.section-head p { margin: 8px 0 0; color: var(--muted); max-width: 34rem; }
.live-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--muted); }
.live-tag .dot { background: #46d08a; animation: pulse 2s ease-in-out infinite; }
.live-tag[data-off] .dot { background: #b7aebf; animation: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(70, 208, 138, 0); } 0% { box-shadow: 0 0 0 0 rgba(70, 208, 138, 0.5); } }

/* ---------- results board ---------- */
.board { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.row { display: grid; grid-template-columns: 52px 56px minmax(150px, 260px) 1fr auto auto; gap: 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row .rank { font: 800 1.9rem/1 var(--display); font-stretch: 80%; text-align: right; }
.row:nth-child(-n + 3) .rank { color: var(--red); }
.row .who strong { display: block; font-size: 1.08rem; line-height: 1.2; }
.row .who span { color: var(--muted); font-size: 0.88rem; }
.row .track { height: 22px; background: #ece7f0; border-radius: 4px; overflow: hidden; }
.row .fill { height: 100%; width: 0; background: var(--kente); background-size: 45px 100%, 45px 100%; border-radius: 4px; transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.row:first-child .fill { background: var(--kente-gold); background-size: 36px 100%, 36px 100%; }
.row .count { text-align: right; min-width: 118px; }
.row .count b { font-size: 1.15rem; display: block; line-height: 1.1; }
.row .count span { color: var(--muted); font-size: 0.85rem; }
.hidden-note { border: 2px dashed var(--line); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--muted); }

.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--night); color: var(--gold); display: grid; place-items: center; font: 800 1.15rem/1 var(--display); flex: none; }
.avatar[data-t='1'] { background: var(--red); color: #fff; }
.avatar[data-t='2'] { background: var(--leaf); color: #fff; }
.avatar[data-t='3'] { background: var(--gold); color: var(--night); }
.avatar[data-t='4'] { background: var(--night-3); color: var(--gold-soft); }

/* ---------- contestants ---------- */
.contestants { background: var(--white); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 28px 22px; }
.person { display: flex; flex-direction: column; }
.person .photo { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--night); }
.person .photo img { width: 100%; height: 100%; object-fit: cover; }
.person .mono { position: absolute; inset: 0; display: grid; place-items: center; font: 800 5rem/1 var(--display); font-stretch: 76%; color: rgba(255, 255, 255, 0.9); }
.person .photo[data-t='0'] { background: linear-gradient(160deg, var(--night-3), var(--night)); }
.person .photo[data-t='1'] { background: linear-gradient(160deg, #e0524a, #7d1713); }
.person .photo[data-t='2'] { background: linear-gradient(160deg, #2da266, #0c3d26); }
.person .photo[data-t='3'] { background: linear-gradient(160deg, #f0bf4f, #9b6a0a); }
.person .photo[data-t='3'] .mono { color: var(--night); }
.person .code { position: absolute; left: 10px; bottom: 10px; background: var(--night); color: var(--gold); font-weight: 600; font-size: 0.85rem; padding: 4px 10px; border-radius: 999px; }
.person h3 { font-size: 1.45rem; font-stretch: 82%; margin-top: 14px; }
.person p { color: var(--muted); font-size: 0.95rem; margin: 6px 0 14px; flex: 1; max-width: 34ch; }

/* ---------- how to vote ---------- */
.ways { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 2px solid var(--ink); border-radius: 16px; overflow: hidden; background: var(--white); }
.way { padding: 36px; }
.way + .way { border-left: 2px solid var(--ink); }
.way h3 { font-size: 2rem; font-stretch: 80%; margin-bottom: 18px; }
.way ol { margin: 0; padding-left: 1.3rem; }
.way li { margin: 0 0 10px; padding-left: 4px; }
.way li::marker { font-weight: 700; color: var(--red); }
.shortcode { display: inline-block; font: 800 2.6rem/1 var(--display); font-stretch: 80%; background: var(--night); color: var(--gold); padding: 12px 22px; border-radius: 10px; margin: 0 0 20px; letter-spacing: 0.02em; }
.small-print { color: var(--muted); font-size: 0.9rem; margin-top: 16px; }

footer { background: var(--night); color: #cbbfd8; padding: 40px 0 48px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
footer strong { color: var(--white); font-family: var(--display); font-size: 1.3rem; font-stretch: 80%; }

/* ---------- vote dialog ---------- */
dialog { border: 0; padding: 0; border-radius: 18px; width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; background: var(--white); color: var(--ink); box-shadow: 0 30px 80px rgba(27, 15, 36, 0.5); }
dialog::backdrop { background: rgba(27, 15, 36, 0.72); }
.dlg-head { background: var(--night); color: var(--white); padding: 22px 26px 18px; position: relative; }
.dlg-head h2 { font-size: 2rem; font-stretch: 80%; }
.dlg-head p { margin: 4px 0 0; color: #cbbfd8; font-size: 0.95rem; }
.dlg-head .weave { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; }
.dlg-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 1.4rem; cursor: pointer; }
.dlg-close:hover { background: rgba(255, 255, 255, 0.2); }
form.vote { padding: 22px 26px 26px; display: grid; gap: 16px; }
label.f { display: grid; gap: 6px; font-weight: 600; font-size: 0.95rem; }
label.f small { font-weight: 400; color: var(--muted); }
input, select, textarea { font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); min-height: 48px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--night-3); outline: none; box-shadow: 0 0 0 3px var(--gold-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; font: 600 0.95rem var(--body); cursor: pointer; min-height: 40px; }
.chip:hover, .chip[aria-pressed='true'] { border-color: var(--night); background: var(--night); color: var(--gold); }
.total-line { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.total-line b { font: 800 1.8rem/1 var(--display); font-stretch: 80%; }
.error { color: #a4201a; background: #fdeceb; border: 1px solid #f3b8b4; padding: 10px 14px; border-radius: 10px; font-size: 0.95rem; }
.error[hidden] { display: none; }

/* ---------- result / completion page ---------- */
.center-page { min-height: 100dvh; display: grid; place-items: center; background: var(--night); color: #fff; padding: 24px; text-align: center; }
.center-card { max-width: 520px; }
.center-card h1 { font-size: clamp(2.4rem, 8vw, 4rem); font-stretch: 80%; margin: 18px 0 12px; }
.center-card p { color: #d6cbe2; font-size: 1.1rem; }
.center-card .weave { border-radius: 4px; margin: 0 auto; width: 160px; }
.center-card .btn { margin-top: 22px; }

/* ---------- stage (big screen) ---------- */
body.stage { background: var(--night); color: #fff; }
body.stage .wrap { width: min(1500px, 100% - 64px); }
body.stage .section-head { padding-top: 28px; margin-bottom: 18px; }
body.stage .section-head h2 { font-size: clamp(2.6rem, 6vw, 5rem); color: #fff; }
body.stage .section-head p, body.stage .live-tag { color: #cbbfd8; }
body.stage .board { border-color: var(--gold); }
body.stage .row { border-color: var(--line-dark); padding: 10px 0; }
body.stage .row .who span, body.stage .row .count span { color: #b4a7c2; }
body.stage .row .track { background: rgba(255, 255, 255, 0.08); }
body.stage .row .who strong { font-size: 1.3rem; }
body.stage .row .count b { font-size: 1.5rem; }
body.stage .row .vote-btn { display: none; }
body.stage .row:nth-child(-n + 3) .rank { color: var(--gold); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; padding-bottom: 56px; }
  .ways { grid-template-columns: 1fr; }
  .way + .way { border-left: 0; border-top: 2px solid var(--ink); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  section { padding: 56px 0; }
  .topbar nav a:not(.btn) { display: none; }
  .row { grid-template-columns: 34px 44px 1fr auto; gap: 12px; }
  .row .track { grid-column: 2 / -1; grid-row: 2; }
  .row .vote-btn { grid-column: 2 / -1; justify-self: start; padding: 8px 20px; }
  .row .rank { font-size: 1.5rem; }
  .avatar { width: 44px; height: 44px; font-size: 1rem; }
  .row .count { min-width: 0; }
  .way { padding: 26px 22px; }
  .shortcode { font-size: 2.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
