:root {
  --maroon: #5b1030; --maroon-2: #7d1a44; --gold: #d4a53c; --gold-2: #f3d58a;
  --bg: #fbf7f2; --surface: #ffffff; --surface-2: #f5ede4; --text: #23131a; --text-2: #5e4a52; --muted: #8d7a82;
  --border: #eadfd6; --ok: #15803d; --ok-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7;
  --shadow: 0 10px 30px rgba(60, 15, 35, .10); --radius: 16px;
  --serif: 'Playfair Display', Georgia, serif; --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #150a0f; --surface: #20121a; --surface-2: #2a1822; --text: #f6ecef; --text-2: #d3bfc7; --muted: #a08d95;
    --border: #3a2530; --ok: #4ade80; --ok-soft: #12321f; --warn: #fbbf24; --warn-soft: #3a2a0c; --shadow: 0 10px 30px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #150a0f; --surface: #20121a; --surface-2: #2a1822; --text: #f6ecef; --text-2: #d3bfc7; --muted: #a08d95;
  --border: #3a2530; --ok: #4ade80; --ok-soft: #12321f; --warn: #fbbf24; --warn-soft: #3a2a0c; --shadow: 0 10px 30px rgba(0,0,0,.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); }
body.noscroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--maroon-2); text-decoration: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) a { color: var(--gold-2); } }
h1, h2, h3 { margin: 0; line-height: 1.15; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 22px; font: 600 15px var(--sans); cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #3b0a1f !important; box-shadow: 0 6px 18px rgba(212,165,60,.35); }
.btn-gold:hover { box-shadow: 0 8px 24px rgba(212,165,60,.5); }
.btn-gold:disabled { background: var(--surface-2); color: var(--muted) !important; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff !important; border: 1px solid rgba(255,255,255,.35); }
.btn-ghost:hover { background: rgba(255,255,255,.2); }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }

/* header */
.top { position: sticky; top: 0; z-index: 40; background: rgba(91,16,48,.96); backdrop-filter: blur(10px); color: #fff; border-bottom: 1px solid rgba(243,213,138,.25); }
.top-in { display: flex; align-items: center; gap: 16px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff !important; font-family: var(--serif); font-size: 20px; white-space: nowrap; }
.brand em { color: var(--gold-2); font-style: italic; }
.tabs { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { color: rgba(255,255,255,.8) !important; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tabs a:hover { background: rgba(255,255,255,.08); color: #fff !important; }
.tabs a.active { background: rgba(243,213,138,.16); color: var(--gold-2) !important; }
.pill { background: var(--gold); color: #3b0a1f; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }

/* hero */
.hero { background: radial-gradient(900px 500px at 85% 0%, rgba(212,165,60,.35), transparent 60%), radial-gradient(700px 500px at 0% 100%, rgba(125,26,68,.9), transparent 60%), linear-gradient(135deg, #3d0820, #5b1030 55%, #2a0516); color: #fff; padding: 56px 0 64px; overflow: hidden; }
.hero-in { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 12px; font-weight: 700; color: var(--gold-2); margin: 0 0 10px; }
.hero h1 { font-family: var(--serif); font-size: clamp(44px, 8vw, 84px); font-weight: 800; letter-spacing: -.01em; }
.hero h1 span { color: var(--gold-2); font-style: italic; font-weight: 600; }
.lead { font-size: 18px; color: rgba(255,255,255,.85); max-width: 540px; margin: 16px 0 26px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.coronation { margin: 22px 0 0; color: rgba(255,255,255,.7); font-size: 14px; }
.hero-card { background: rgba(255,255,255,.07); border: 1px solid rgba(243,213,138,.3); border-radius: 22px; padding: 24px; backdrop-filter: blur(6px); }
.hc-label { margin: 0 0 10px; text-transform: uppercase; letter-spacing: .14em; font-size: 11.5px; font-weight: 700; color: var(--gold-2); }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.countdown div { background: rgba(0,0,0,.25); border-radius: 12px; padding: 12px 4px; text-align: center; }
.countdown b { display: block; font: 700 30px var(--serif); font-variant-numeric: tabular-nums; }
.countdown small { font-size: 11px; color: rgba(255,255,255,.65); text-transform: uppercase; letter-spacing: .1em; }
.hc-top { margin-bottom: 18px; }
.hc-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.1); }
.hc-row img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; }
.hc-row b { flex: 1; font-weight: 600; font-size: 14px; }
.hc-row span:last-child { color: var(--gold-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.rk { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: rgba(255,255,255,.15); flex: none; }

/* sections */
.section { padding: 48px 16px; }
.sec-title { font-family: var(--serif); font-size: clamp(26px, 4vw, 36px); color: var(--maroon); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sec-title { color: var(--gold-2); } }
:root[data-theme="dark"] .sec-title { color: var(--gold-2); }
.sec-sub { color: var(--text-2); margin: 6px 0 24px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.step span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--maroon); color: var(--gold-2); font-weight: 800; margin-bottom: 12px; }
.step h3 { font-size: 16px; margin-bottom: 4px; }
.step p { margin: 0; color: var(--text-2); font-size: 14px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 128px; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.strip-item { scroll-snap-align: start; color: var(--text) !important; font-size: 13px; font-weight: 600; text-align: center; }
.strip-item img { aspect-ratio: 3/4; object-fit: cover; object-position: 50% 50%; border-radius: 14px; margin-bottom: 6px; box-shadow: var(--shadow); }

/* candidate grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: transform .2s, box-shadow .2s; outline: none; }
.card:hover, .card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow); }
.card:focus-visible { box-shadow: 0 0 0 3px var(--gold); }
.card-img { position: relative; aspect-ratio: 3/4; background: var(--surface-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; background: #fff; }
.num { position: absolute; top: 10px; left: 10px; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; background: var(--maroon); color: var(--gold-2); font: 700 15px var(--serif); box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.mine { position: absolute; top: 10px; right: 10px; background: #fff; color: #be123c; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.album-tag { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.card-body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 16px; font-weight: 700; font-family: var(--sans); }
.card-body small { color: var(--muted); }
.card-body .cnum { color: var(--maroon-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; }
.cv { font-weight: 700; color: var(--maroon-2); font-variant-numeric: tabular-nums; font-size: 14px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cv { color: var(--gold-2); } }

/* vote tab */
.vote-hero { background: linear-gradient(135deg, #3d0820, #5b1030 60%, #7d1a44); color: #fff; padding: 36px 0 30px; }
.vote-title { font-family: var(--serif); font-size: clamp(30px, 5vw, 48px); }
.vote-sub { color: rgba(255,255,255,.82); margin: 8px 0 0; max-width: 640px; }
.vote-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; padding-top: 24px; padding-bottom: 48px; align-items: start; }
.vote-layout.no-board { grid-template-columns: 1fr; }
.banner { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--gold); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; }
.banner.done { border-left-color: var(--ok); }
.banner.closed { border-left-color: var(--muted); }
.banner-text b { display: block; font-size: 16px; }
.banner-text small { color: var(--muted); }
.ballots { display: flex; gap: 6px; }
.ballots i { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 2px dashed var(--border); position: relative; }
.ballots i.on { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border: 0; }
.ballots i.on::after { content: '♥'; position: absolute; inset: 0; display: grid; place-items: center; color: #7d1a44; font-size: 13px; }
.search input { width: 100%; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 15px var(--sans); margin-bottom: 18px; }
.search input:focus { outline: 2px solid var(--gold); border-color: transparent; }
.board { position: sticky; top: 80px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.board-head h3 { font-family: var(--serif); font-size: 20px; }
.board-head small { color: var(--muted); font-size: 12px; }
.board-list { list-style: none; margin: 0; padding: 0; max-height: 62vh; overflow-y: auto; }
.board-list li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--border); cursor: pointer; border-radius: 8px; }
.board-list li:hover { background: var(--surface-2); }
.board-list li .rk { background: var(--surface-2); color: var(--text-2); }
.board-list li.rank-1 .rk { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #3b0a1f; }
.board-list li.rank-2 .rk { background: #d9d9de; color: #333; }
.board-list li.rank-3 .rk { background: #e0b089; color: #4a2508; }
.board-list img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; flex: none; }
.bl-main { flex: 1; min-width: 0; }
.bl-main b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { display: block; height: 6px; background: var(--surface-2); border-radius: 99px; margin-top: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--maroon-2), var(--gold)); border-radius: 99px; transition: width .6s; }
.bv { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.board-total { margin: 10px 0 0; text-align: right; color: var(--muted); font-size: 13px; }

/* album modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-back { position: absolute; inset: 0; background: rgba(15,4,9,.8); backdrop-filter: blur(4px); }
.modal-box { position: relative; width: min(920px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: 22px; display: grid; grid-template-columns: 1.05fr 1fr; grid-template-rows: auto 1fr; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.x { position: absolute; top: 10px; right: 12px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.al-view { position: relative; grid-row: 1 / 3; background: #fff; min-height: 360px; }
.al-stage { position: absolute; inset: 0; }
.al-stage img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.al-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); color: #3b0a1f; font-size: 28px; line-height: 1; cursor: pointer; }
.al-nav.prev { left: 10px; } .al-nav.next { right: 10px; }
.al-count { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 99px; }
.al-thumbs { display: flex; gap: 8px; padding: 16px 20px 0; overflow-x: auto; }
.al-thumbs { flex: none; }
.al-thumbs button { flex: none; width: 58px; height: 74px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: none; opacity: .65; }
.al-thumbs button.on { border-color: var(--gold); opacity: 1; }
.al-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.al-info { padding: 16px 22px 22px; display: flex; flex-direction: column; gap: 12px; }
.al-head { display: flex; align-items: center; gap: 12px; padding-right: 30px; }
.al-head .num { position: static; flex: none; width: 46px; height: 46px; font-size: 20px; }
.al-head h3 { font-family: var(--serif); font-size: 26px; }
.al-head small { color: var(--muted); }
.al-info p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.al-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: auto; }
.al-votes { color: var(--text-2); font-size: 13.5px; line-height: 1.4; }
.al-votes b { color: var(--text); font-size: 16px; }
.al-msg { min-height: 1.4em; font-weight: 600; font-size: 14px; border-radius: 10px; }
.al-msg.ok { color: var(--ok); background: var(--ok-soft); padding: 10px 12px; }
.al-msg.warn { color: var(--warn); background: var(--warn-soft); padding: 10px 12px; }
.ts-box:empty { display: none; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; background: #1b0a12; color: #fff; padding: 12px 20px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.35); font-weight: 600; font-size: 14px; max-width: calc(100% - 32px); text-align: center; border: 1px solid rgba(243,213,138,.4); }

.foot { border-top: 1px solid var(--border); padding: 22px 0; font-size: 13px; color: var(--text-2); }
.foot-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* responsive */
@media (max-width: 920px) {
  .hero-in { grid-template-columns: 1fr; }
  .vote-layout { grid-template-columns: 1fr; }
  .board { position: static; }
  .board-list { max-height: 300px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .modal { padding: 0; }
  .modal-box { grid-template-columns: 1fr; border-radius: 0; max-height: 100vh; height: 100%; }
  .al-view { grid-row: auto; min-height: 0; width: 100%; height: 56vh; }
  .modal-box { display: flex; flex-direction: column; }
  .al-view { flex: none; }
  .al-info { flex: none; }
  .brand span { display: none; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 10px; }
  .card-body h3 { font-size: 14px; }
  .card-foot { flex-direction: column; align-items: stretch; gap: 6px; }
  .steps { grid-template-columns: 1fr; }
  .tabs a { padding: 8px 10px; font-size: 13px; }
  .tabs .pill { display: none; }
  .tabs { margin-left: 0; }
  .top-in { gap: 8px; }
  .hero { padding: 40px 0 44px; }
  .banner { padding: 12px 14px; gap: 12px; }
  .ballots i { width: 22px; height: 22px; }
}
