* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(900px 520px at 70% -10%, #13302a 0%, transparent 62%), var(--bg);
  color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased;
  min-height: 100dvh; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) max(18px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(18px, env(safe-area-inset-left));
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }

.banner { position: sticky; top: 0; z-index: 5; margin: 0 -18px; padding: 8px 18px; text-align: center; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.banner.test { background: var(--warn); color: #1b1407; font-weight: 600; }
.banner.off { background: #3a1f1a; color: #f3c3b8; }

header { text-align: center; padding: 22px 0 6px; }
header img { height: 44px; width: auto; }
.edition { margin-top: 6px; font-size: 10px; letter-spacing: .34em; text-transform: uppercase; color: var(--blush); min-height: 12px; }

main { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 520px; margin: 0 auto; padding: 10px 0 20px; }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 24px 0; }
.eyebrow { font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--blush); }
.title { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.12; margin: 0; text-wrap: balance; }
.lead { font-family: var(--serif); font-size: 22px; line-height: 1.3; margin: 0; color: var(--text); text-wrap: balance; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; }
.rule { width: 54px; height: 2px; background: var(--sage); margin: 4px auto; }

/* ---- voting ---- */
.vote-head { text-align: center; padding: 8px 0 14px; }
.vote-head .title { margin-top: 8px; }
.timer { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.timer .num { font-family: var(--serif); font-size: 34px; line-height: 1; min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.timer .unit { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.timer .track { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.timer .fill { height: 100%; width: 100%; background: var(--blush); border-radius: 3px; transform-origin: left center; }
.timer.low .num { color: var(--warn); }
.timer.low .fill { background: var(--warn); }

.finalists { display: flex; flex-direction: column; gap: 10px; }
.finalist {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) 30px; align-items: center; gap: 14px;
  width: 100%; text-align: left; padding: 10px 14px 10px 10px; min-height: 104px;
  background: var(--panel); border: 1.5px solid var(--line2); border-radius: 4px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.finalist img, .finalist .ph { width: 76px; height: 95px; object-fit: cover; border-radius: 2px; background: #10241f; display: block; }
.finalist .ph { display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 30px; color: var(--sage); }
.finalist .nm { font-family: var(--serif); font-size: 23px; line-height: 1.15; overflow-wrap: anywhere; }
.finalist .dot { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line2); position: relative; justify-self: end; }
.finalist.sel { border-color: var(--blush); background: #142a24; }
.finalist.sel .dot { border-color: var(--blush); }
.finalist.sel .dot::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--blush); }
.finalist:focus-visible, .btn:focus-visible, .code-input:focus-visible { outline: 2px solid var(--blush); outline-offset: 2px; }
.finalists.preview .finalist { cursor: default; opacity: .75; grid-template-columns: 76px minmax(0, 1fr); }
.finalists.locked .finalist { cursor: default; }
.finalists.locked .finalist:not(.sel) { opacity: .4; }

.actions { position: sticky; bottom: 0; padding: 14px 0 max(10px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--bg) 30%); margin-top: auto; }
.btn {
  display: block; width: 100%; min-height: 58px; padding: 14px 18px; border-radius: 4px; cursor: pointer;
  background: var(--blush); color: #17110f; border: 0; font-weight: 600; font-size: 14px; letter-spacing: .18em; text-transform: uppercase;
}
.btn:disabled { background: transparent; color: var(--muted); border: 1.5px solid var(--line2); cursor: default; }
.hint { text-align: center; font-size: 12px; color: var(--muted); margin: 10px 0 0; min-height: 16px; }
.error { color: var(--danger); }

.check { width: 74px; height: 74px; border-radius: 50%; border: 1.5px solid var(--blush); display: flex; align-items: center; justify-content: center; }
.check svg { width: 34px; height: 34px; stroke: var(--blush); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.choice { font-family: var(--serif); font-size: 26px; line-height: 1.15; }

/* ---- code entry ---- */
.code-form { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.code-input {
  width: 100%; min-height: 60px; padding: 12px; text-align: center; background: var(--field); color: var(--text);
  border: 1.5px solid var(--line2); border-radius: 4px; font-family: var(--sans); font-size: 24px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
}
.code-input::placeholder { color: #3d4d48; letter-spacing: .22em; }
.noscript { text-align: center; color: var(--warn); padding: 20px; }

@media (max-height: 640px) {
  header { padding-top: 12px; } header img { height: 34px; }
  .title { font-size: 28px; }
  .finalist { min-height: 88px; grid-template-columns: 62px minmax(0, 1fr) 30px; }
  .finalist img, .finalist .ph { width: 62px; height: 78px; }
  .finalist .nm { font-size: 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  .fade { animation: fade .35s ease both; }
  @keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
