:root {
  --ink: #14110f;
  --ink-2: #2a2420;
  --paper: #faf7f2;
  --card: #ffffff;
  --line: #e7e0d6;
  --muted: #6f655b;
  --gold: #e8a93a;
  --gold-deep: #b97a12;
  --accent: #c2410c;
  --ok: #15803d;
  --ok-bg: #ecfdf3;
  --err: #b42318;
  --err-bg: #fef3f2;
  --warn-bg: #fff8e6;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(20 17 15 / 6%), 0 8px 24px rgb(20 17 15 / 6%);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--sans); color: var(--ink); background: var(--paper); }
img { max-width: 100%; display: block; }
a { color: var(--gold-deep); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1, h2 { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }
.section { padding: 40px 0; }
.section-title { margin-bottom: 20px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.center-row { justify-content: center; }
.wrap-row { gap: 12px 24px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lead { font-size: 1.125rem; color: var(--ink-2); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--gold); margin-bottom: 12px; }
.eyebrow.dark { color: var(--gold-deep); }
.note { background: var(--warn-bg); border-radius: 10px; padding: 12px 14px; }
.big-icon { font-size: 3.5rem; margin-bottom: 8px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--ink); color: #fff; font: 600 .95rem var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); background: var(--ink-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-ghost-light { background: transparent; border-color: rgb(255 255 255 / 60%); color: #fff; }
.btn-ghost-light:hover { background: #fff; color: var(--ink); }
.hero .btn:not(.btn-ghost-light) { background: var(--gold); border-color: var(--gold); color: var(--ink); }

/* header */
.topbar { background: rgb(250 247 242 / 92%); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.3rem var(--serif); color: var(--ink); text-decoration: none; }
.logo-mark { width: 34px; height: 34px; }
.nav { display: flex; gap: 26px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--gold-deep); }
.nav-admin { color: var(--accent) !important; }
.nav-toggle, .nav-burger { display: none; }

/* hero */
.hero { background: radial-gradient(ellipse at 80% 0%, #3b2a14 0%, transparent 60%), var(--ink); color: #f4ede3; padding: 72px 0; }
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.6rem); }
.hero h1 em { color: var(--gold); font-style: italic; }
.hero .lead { color: #d9cfc2; max-width: 34em; }
.hero-panel { background: rgb(255 255 255 / 6%); border: 1px solid rgb(255 255 255 / 12%); border-radius: 20px; padding: 24px; }
.hero-panel .small { color: #bfb3a5; }
.hero-prize { border-top: 1px solid rgb(255 255 255 / 12%); padding-top: 14px; margin-top: 14px; }
.hero-prize span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: #bfb3a5; }
.hero-prize strong { font: 700 1.3rem var(--serif); color: var(--gold); }
.mini-board { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; counter-reset: r; }
.mini-board a { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 6px; border-radius: 10px; }
.mini-board a:hover { background: rgb(255 255 255 / 8%); }
.mini-board li { counter-increment: r; }
.mini-board a::before { content: counter(r); width: 18px; color: var(--gold); font-weight: 700; }
.mini-board img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.mini-board span { flex: 1; }

/* countdown */
.countdown-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.hero .countdown-label { color: #bfb3a5; }
.countdown-units { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.countdown-units div { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; text-align: center; }
.hero .countdown-units div { background: rgb(0 0 0 / 30%); border-color: rgb(255 255 255 / 10%); }
.countdown-units b { display: block; font: 700 1.5rem var(--serif); font-variant-numeric: tabular-nums; }
.countdown-units small { font-size: .7rem; color: var(--muted); }
.hero .countdown-units small { color: #bfb3a5; }

/* badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.badge-live { background: #dcfce7; color: #166534; }
.badge-live::before { content: '● '; }
.badge-soon { background: #fef3c7; color: #92400e; }
.badge-done { background: #ece7df; color: var(--muted); }

/* cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 22px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.comp-card { padding: 22px; display: flex; flex-direction: column; }
.comp-card-head h3 { font: 700 1.2rem var(--serif); margin-top: 10px; }
.comp-card-head a { color: var(--ink); text-decoration: none; }
.comp-card .row { margin-top: auto; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step span { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); font-weight: 700; margin-bottom: 10px; }
.step p { color: var(--muted); }

.prizes { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 20px; }
.prize { border-radius: var(--radius); padding: 24px; border: 1px solid var(--line); background: var(--card); }
.prize p { font: 700 1.25rem var(--serif); margin: 6px 0 0; }
.prize-1 { background: linear-gradient(135deg, #fff6e0, #ffe7b0); border-color: #f4d58d; }
.prize-1 p { font-size: 1.5rem; }
.prize-pos { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-deep); }

/* page head */
.page-head { padding: 40px 0 8px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.comp-head { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
.comp-head h1 { margin-top: 10px; }
.dates { margin: 18px 0 0; display: grid; gap: 10px; }
.dates div { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.dates dt { color: var(--muted); font-size: .9rem; }
.dates dd { margin: 0; font-weight: 600; font-size: .9rem; text-align: right; }

/* contestants */
.contestant { overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s; display: flex; flex-direction: column; }
.contestant:hover { transform: translateY(-3px); }
.contestant-photo { position: relative; aspect-ratio: 4 / 3; background: #eee; }
.contestant-photo img { width: 100%; height: 100%; object-fit: cover; }
.rank { position: absolute; top: 10px; left: 10px; background: var(--ink); color: var(--gold); font-weight: 700; font-size: .8rem; padding: 3px 9px; border-radius: 999px; }
.contestant-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.contestant-body h3 { margin-bottom: 2px; }
.contestant-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 10px; }
.votes b { font-size: 1.15rem; }
.search { padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; font: inherit; min-width: 240px; background: #fff; }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.podium a { text-decoration: none; color: inherit; overflow: hidden; }
.podium img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.podium-1 { outline: 3px solid var(--gold); }

/* avatars */
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--gold); background: var(--line); }
.avatar-sm { width: 30px; height: 30px; border-width: 1px; box-shadow: 0 0 0 1px var(--gold); }
.avatar-lg { width: 64px; height: 64px; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who > div { min-width: 0; }
.who h3, .who .vote-name { margin: 0; }
.who-sm { gap: 8px; color: inherit; text-decoration: none; font-weight: 600; }
.who-lg { margin-bottom: 4px; }
.contestant-body .who { align-items: flex-start; }
.contestant-body .who p { margin: 2px 0 0; }
.avatar-preview { margin: -6px 0 16px; }
.mini-board .avatar { width: 36px; height: 36px; box-shadow: 0 0 0 2px var(--gold); border-color: var(--ink); }

/* vote page */
.vote-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; align-items: start; }
.vote-photo { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; background: #111; box-shadow: var(--shadow); }
.vote-photo img { width: 100%; max-height: 78vh; object-fit: contain; margin: auto; }
.sticky { position: sticky; top: 84px; }
.vote-name { font-size: 2rem; }
.vote-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 18px; }
.vote-stats div { background: var(--paper); border-radius: 12px; padding: 12px; text-align: center; }
.vote-stats b { display: block; font: 700 1.8rem var(--serif); }
.vote-stats small { color: var(--muted); }
.vote-form { margin-top: 20px; }
.stepper { display: grid; grid-template-columns: 48px 1fr 48px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stepper button { border: 0; background: var(--paper); font-size: 1.4rem; cursor: pointer; }
.stepper button:hover { background: var(--line); }
.stepper input { border: 0 !important; border-radius: 0 !important; text-align: center; font-size: 1.3rem !important; font-weight: 700; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font: 600 .85rem var(--sans); cursor: pointer; }
.chip:hover, .chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.share { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; display: grid; gap: 8px; }
.share-row { display: flex; gap: 6px; }
.share-row input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font: .85rem var(--sans); background: var(--paper); }
.prose h2 { margin-top: 1.2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { color: var(--gold-deep); margin-top: 1.2em; }
.prose li { margin-bottom: .4em; }

/* forms */
.form h2 { font-size: 1.25rem; margin-top: 8px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-weight: 600; font-size: .9rem; }
.field small { color: var(--muted); font-size: .8rem; }
.field input, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font: 1rem var(--sans); background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; font-size: .92rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.photo-preview { max-height: 320px; border-radius: 10px; margin: -6px 0 16px; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; background: var(--warn-bg); border: 1px solid #f5dfa8; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-error { background: var(--err-bg); border-color: #fecdca; color: var(--err); }
.alert-ok { background: var(--ok-bg); border-color: #abefc6; color: var(--ok); }

/* footer */
.footer { background: var(--ink); color: #bfb3a5; margin-top: 60px; padding: 48px 0 24px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; }
.footer h4 { color: #fff; margin: 0 0 12px; }
.footer-grid a:not(.brand) { display: block; color: #bfb3a5; text-decoration: none; margin-bottom: 6px; }
.footer-grid a:hover { color: var(--gold); }
.brand-light { color: #fff; margin-bottom: 12px; }
.footer-legal { border-top: 1px solid rgb(255 255 255 / 10%); margin-top: 32px; padding-top: 20px; font-size: .8rem; }
.footer-legal a { color: var(--gold); }

/* admin */
.admin h2 { margin-top: 36px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stats small { color: var(--muted); display: block; }
.stats b { font: 700 1.8rem var(--serif); }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.review { overflow: hidden; }
.review img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
details.card { margin-bottom: 16px; }
summary { cursor: pointer; display: flex; gap: 10px; align-items: center; }
.status { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #ece7df; }
.status-paid { background: #dcfce7; color: #166534; }
.status-failed, .status-mismatch { background: var(--err-bg); color: var(--err); }

/* responsive */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero-inner, .comp-head, .vote-layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .vote-layout { gap: 20px; }
  .vote-main { display: contents; }
  .vote-main .crumbs { order: 0; margin: 0; }
  .vote-photo { order: 1; margin: 0; }
  .vote-side { order: 2; }
  .vote-about { order: 3; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .nav-burger { display: grid; place-items: center; width: 40px; height: 40px; cursor: pointer; }
  .nav-burger span, .nav-burger span::before, .nav-burger span::after { content: ''; display: block; width: 22px; height: 2px; background: var(--ink); position: relative; }
  .nav-burger span::before { position: absolute; top: -7px; }
  .nav-burger span::after { position: absolute; top: 7px; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--paper); flex-direction: column; gap: 0; border-bottom: 1px solid var(--line); }
  .nav a { padding: 14px 16px; border-top: 1px solid var(--line); }
  .nav-toggle:checked ~ .nav { display: flex; }
  .grid-2, .grid-3, .prizes, .podium, .footer-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hero { padding: 48px 0; }
  .search { min-width: 0; width: 100%; }
  .contestant-body { padding: 10px 12px 12px; }
  .contestant-foot { flex-direction: column; align-items: flex-start; gap: 8px; }
  .contestant-body .who { flex-direction: column; align-items: flex-start; gap: 4px; }
  .contestant-body .avatar { margin-top: -32px; position: relative; }
}
@media (max-width: 420px) {
  .steps { grid-template-columns: 1fr; }
}
