:root {
  color-scheme: dark;
  --bg: #071610;
  --panel: #10261d;
  --text: #f5fbf7;
  --muted: #a9c4b7;
  --green: #70e49e;
  --green-dark: #163d2a;
  --yellow: #f5d969;
  --border: rgba(255, 255, 255, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: radial-gradient(circle at 75% 10%, #17482f 0, transparent 32%), var(--bg); color: var(--text); }
button, input { font: inherit; }

.stage {
  min-height: 100svh;
  padding: clamp(28px, 4.4vh, 58px) clamp(36px, 6vw, 116px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(20px, 3vh, 38px);
}
.stage__header, .stage__footer { display: flex; align-items: center; justify-content: space-between; }
.eyebrow { margin: 0 0 .35em; color: var(--green); font-size: clamp(.8rem, 1.1vw, 1.25rem); font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.2rem, 4.1vw, 5rem); line-height: 1; letter-spacing: -.045em; }
.live-badge { padding: .7em 1em; border: 1px solid var(--border); border-radius: 999px; font-size: clamp(.85rem, 1.2vw, 1.3rem); color: var(--muted); }
.live-badge span { display: inline-block; width: .55em; height: .55em; margin-right: .45em; border-radius: 50%; background: var(--green); box-shadow: 0 0 16px var(--green); }

.results { display: grid; align-content: center; gap: clamp(13px, 1.8vh, 22px); }
.option { position: relative; overflow: hidden; min-height: clamp(110px, 16vh, 174px); padding: clamp(20px, 2.8vh, 34px) clamp(24px, 2.5vw, 48px); border: 1px solid var(--border); border-radius: clamp(18px, 1.6vw, 30px); background: rgba(16, 38, 29, .83); }
.option__fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, rgba(54, 162, 99, .4), rgba(53, 128, 84, .15)); transition: width 900ms cubic-bezier(.2,.8,.2,1); }
.option__content { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 30px; }
.option__name { margin: 0; font-size: clamp(1.6rem, 2.5vw, 3rem); font-weight: 750; }
.option__score { display: flex; align-items: baseline; gap: clamp(14px, 1.5vw, 28px); }
.option__votes { color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.55rem); }
.option__percent { min-width: 3.6ch; text-align: right; font-size: clamp(2.2rem, 4vw, 4.8rem); font-weight: 850; line-height: .9; letter-spacing: -.05em; }
.option__track { grid-column: 1 / -1; height: clamp(6px, .8vh, 10px); overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.1); }
.option__bar { height: 100%; width: 0; border-radius: inherit; background: var(--green); transition: width 900ms cubic-bezier(.2,.8,.2,1); }
.option--leader { border-color: rgba(245,217,105,.7); box-shadow: 0 0 0 1px rgba(245,217,105,.15), 0 16px 45px rgba(0,0,0,.18); }
.option--leader .option__percent { color: var(--yellow); }
.leader-label { display: inline-block; margin-left: .8em; padding: .25em .55em; border-radius: 999px; background: var(--yellow); color: #1a251e; font-size: clamp(.65rem, .75vw, .9rem); font-weight: 850; vertical-align: middle; text-transform: uppercase; letter-spacing: .08em; }

.stage__footer { border-top: 1px solid var(--border); padding-top: clamp(18px, 2.5vh, 30px); color: var(--muted); font-size: clamp(.9rem, 1.3vw, 1.45rem); }
.stage__footer p { margin: 0; }
.total { display: flex; align-items: center; gap: .5em; color: var(--text); }
.total > span { font-size: clamp(2.2rem, 3.5vw, 4rem); font-weight: 850; }
.total small { max-width: 12ch; color: var(--muted); font-size: .65em; line-height: 1.1; }

.admin { width: min(760px, calc(100% - 32px)); padding: 0; border: 1px solid #416653; border-radius: 22px; background: #0c1d16; color: var(--text); box-shadow: 0 30px 100px #000; }
.admin::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.admin form { padding: 28px; }
.admin__heading { display: flex; justify-content: space-between; align-items: start; }
.admin h2 { margin: 0; font-size: 2rem; }
.icon-button { border: 0; background: transparent; color: white; font-size: 2.4rem; cursor: pointer; }
.status { padding: 12px 15px; border-left: 4px solid var(--green); background: var(--green-dark); color: #dff8e8; }
.status--fallback { border-color: var(--yellow); background: #3c3518; color: #fff1b5; }
.admin__fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.admin label { color: var(--muted); font-weight: 700; }
.admin input { width: 100%; margin-top: 7px; padding: 12px; border: 1px solid #496356; border-radius: 9px; background: #07110d; color: white; }
.admin__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.button { padding: 11px 16px; border: 1px solid #587164; border-radius: 9px; background: #182d23; color: white; cursor: pointer; }
.button--primary { border-color: var(--green); background: #237344; }
.button--danger { color: #ffc8c8; }
.admin__note { margin-bottom: 0; color: var(--muted); font-size: .9rem; }

@media (max-height: 700px) {
  .stage { padding-top: 20px; padding-bottom: 20px; gap: 12px; }
  .option { min-height: 92px; padding-top: 14px; padding-bottom: 14px; }
}
@media (max-width: 700px) {
  .live-badge, .stage__footer > p:first-child { display: none; }
  .stage__footer { justify-content: flex-end; }
  .option__content { gap: 8px 12px; }
  .option__votes { display: block; }
  .admin__fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
