:root {
  --bg: #faf6f1;
  --surface: #ffffff;
  --surface-2: #f2ebe3;
  --text: #2a1d1f;
  --muted: #6e5f61;
  --border: #e4d9cf;
  --accent: #7a1f2b;
  --accent-text: #ffffff;
  --accent-soft: #f6e3e5;
  --gold: #b8892e;
  --ok: #2f6b3a;
  --ok-soft: #e3f1e5;
  --warn-soft: #fbefd6;
  --shadow: 0 1px 2px rgb(60 30 30 / .06), 0 4px 14px rgb(60 30 30 / .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141011;
    --surface: #1f191a;
    --surface-2: #2a2223;
    --text: #f3eae6;
    --muted: #b1a3a0;
    --border: #3a2f30;
    --accent: #e0707d;
    --accent-text: #1b0d10;
    --accent-soft: #3a1f24;
    --gold: #e0b866;
    --ok: #8fd19c;
    --ok-soft: #1d3322;
    --warn-soft: #3a2f17;
    --shadow: 0 1px 2px rgb(0 0 0 / .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141011; --surface: #1f191a; --surface-2: #2a2223; --text: #f3eae6;
  --muted: #b1a3a0; --border: #3a2f30; --accent: #e0707d; --accent-text: #1b0d10;
  --accent-soft: #3a1f24; --gold: #e0b866; --ok: #8fd19c; --ok-soft: #1d3322;
  --warn-soft: #3a2f17; --shadow: 0 1px 2px rgb(0 0 0 / .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
a { color: var(--accent); }
button { font: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--text); text-decoration: none; }
.net { font-size: .8rem; background: var(--warn-soft); padding: 2px 10px; border-radius: 99px; }

main { max-width: 720px; margin: 0 auto; padding: 20px 16px 120px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.stack > * + * { margin-top: 14px; }

.intro { margin-bottom: 22px; }
.intro p { margin: 6px 0 0; color: var(--muted); }
.badge {
  display: inline-block; font-size: .8rem; font-weight: 600;
  padding: 2px 10px; border-radius: 99px; margin-top: 10px;
  background: var(--surface-2); color: var(--muted);
}
.badge.open { background: var(--ok-soft); color: var(--ok); }
.badge.voted { background: var(--accent-soft); color: var(--accent); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--accent); }
a.card p { margin: 4px 0 0; color: var(--muted); }

.option { transition: border-color .15s, box-shadow .15s; }
.option.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.option .note { margin: 6px 0 0; font-size: .92rem; color: var(--muted); font-style: italic; }
.videos { display: grid; gap: 10px; margin: 12px 0; }
.video {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border: 0; padding: 0; border-radius: 10px; overflow: hidden;
  background: #000 center / cover no-repeat; cursor: pointer;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .play {
  position: absolute; inset: 0; margin: auto; width: 64px; height: 44px;
  border-radius: 12px; background: rgb(0 0 0 / .7);
  display: grid; place-items: center;
}
.video .play::after {
  content: ""; border-style: solid; border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff; margin-left: 4px;
}
.video:hover .play, .video:focus-visible .play { background: #c4302b; }
.video .label {
  position: absolute; left: 8px; bottom: 8px; font-size: .78rem; color: #fff;
  background: rgb(0 0 0 / .65); padding: 1px 8px; border-radius: 6px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; font-weight: 600; text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.choose[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }

.votebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgb(0 0 0 / .08);
}
.votebar .inner { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.votebar .what { flex: 1; min-width: 0; font-size: .92rem; }
.votebar .what strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.notice { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.err { background: var(--accent-soft); color: var(--accent); }

.result + .result { margin-top: 16px; }
.result .row { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.result .row .n { color: var(--muted); font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.result .mine { color: var(--accent); font-size: .82rem; font-weight: 600; }
.bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .6s ease; }
.result.leader .bar > span { background: var(--accent); }
