:root {
  --bg: #17101a;
  --panel: #251a2a;
  --line: rgba(255, 255, 255, .15);
  --text: #f6efe4;
  --mist: #b9a9bd;
  --gold: #f2c14e;
  --good: #6fd08c;
  --bad: #ff7b6b;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg) radial-gradient(900px 500px at 50% -10%, #4a2338 0%, rgba(74, 35, 56, 0) 65%) no-repeat;
  color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
header { display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 16px 8px; width: 100%; max-width: 560px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.logo { width: 38px; height: 38px; flex: none; }
h1 { margin: 0; font-size: 19px; letter-spacing: .2em; text-transform: uppercase; }
.brand p { margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mist); }
.hud { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--mist); font-size: 14px; }
.hud b { font-size: 22px; color: var(--gold); }
.round { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: rgba(23, 16, 26, .8); color: var(--text); font-size: 17px; cursor: pointer; }
@media (max-width: 400px) { .brand p { display: none; } h1 { font-size: 16px; letter-spacing: .12em; } }

#card { width: 100%; max-width: 560px; margin: 0 auto; padding: 14px 16px max(24px, env(safe-area-inset-bottom)); flex: 1; display: flex; flex-direction: column; }
#card > * { animation: rise .38s cubic-bezier(.2, .7, .2, 1) both; }
#card > :nth-child(2) { animation-delay: .05s; }
#card > :nth-child(3) { animation-delay: .1s; }
#card > :nth-child(n+4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.eyebrow { margin: 0 0 4px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
h2 { margin: 0 0 8px; font-size: 26px; line-height: 1.2; text-wrap: balance; }
p { margin: 0 0 10px; }
.muted { color: var(--mist); font-size: 14px; }
.btn {
  display: block; width: 100%; margin-top: 10px; padding: 14px 18px; border: 0; border-radius: 12px;
  background: var(--gold); color: #2a1c00; font: inherit; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  transition: transform .12s, filter .12s, opacity .2s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn:focus-visible, .round:focus-visible, .pick:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.link { background: none; border: 0; padding: 0; color: var(--mist); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }

/* ---- the duel ---- */
.dots { display: flex; gap: 5px; margin: 0 0 12px; }
.dots i { flex: 1; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .13); }
.dots i.ok { background: var(--good); }
.dots i.no { background: var(--bad); }
.dots i.now { background: var(--gold); }
.ask { margin: 0 0 12px; font-size: 15px; color: var(--mist); }
.ask b { color: var(--text); }
.film {
  position: relative; padding: 20px 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); text-align: center;
  transition: border-color .3s, background .3s;
}
.film .t { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; text-wrap: balance; }
.film .g { margin: 2px 0 8px; font-size: 13px; color: var(--mist); }
.film .k { margin: 0; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--mist); }
.film .v { margin: 0; font-size: 38px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--gold); }
.film .v.hid { color: var(--mist); }
.film.ok { border-color: var(--good); background: #1d3327; }
.film.ok .v { color: var(--good); }
.film.no { border-color: var(--bad); background: #3a1d20; }
.film.no .v { color: var(--bad); }
.film.no.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.vs { display: grid; place-items: center; height: 14px; position: relative; z-index: 1; }
.vs span {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line);
  font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--mist); transition: transform .4s cubic-bezier(.3, 1.6, .5, 1), background .3s, color .3s;
}
.vs.ok span { background: var(--good); color: #0c2414; transform: scale(1.2); }
.vs.no span { background: var(--bad); color: #36100b; transform: scale(1.2); }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.pick {
  padding: 15px 8px; border-radius: 12px; border: 2px solid; background: transparent; font: inherit; font-size: 17px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: transform .12s, background .15s, opacity .2s;
}
.pick.hi { color: var(--good); border-color: var(--good); }
.pick.lo { color: var(--bad); border-color: var(--bad); }
.pick.hi:hover:not(:disabled) { background: rgba(111, 208, 140, .16); transform: translateY(-2px); }
.pick.lo:hover:not(:disabled) { background: rgba(255, 123, 107, .16); transform: translateY(2px); }
.pick:disabled { cursor: default; opacity: .35; }
.pick.chosen { opacity: 1; }
.pick.hi.chosen { background: var(--good); color: #0c2414; }
.pick.lo.chosen { background: var(--bad); color: #36100b; }
.notice { margin: 10px 0 0; font-size: 14px; color: var(--mist); text-align: center; }
.notice.err { color: var(--bad); }
.streakbar { display: flex; justify-content: space-between; margin: 0 0 12px; font-size: 13px; color: var(--mist); }
.streakbar b { color: var(--gold); font-size: 16px; }

.big { margin: 2px 0; font-size: 46px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.big small { font-size: 18px; font-weight: 600; color: var(--mist); }
.row10 { margin: 8px 0; font-size: 22px; letter-spacing: 2px; }
.row10 span { display: inline-block; animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pop { from { transform: scale(0) rotate(-20deg); opacity: 0; } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 0; }
.stats div { padding: 9px 6px; border-radius: 12px; background: rgba(255, 255, 255, .07); text-align: center; }
.stats b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mist); }
.log { list-style: none; margin: 12px 0 0; padding: 0; }
.log li { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); align-items: center; }
.log .m { font-size: 18px; }
.log .a { font-weight: 600; font-size: 15px; }
.log .q { font-size: 13px; color: var(--mist); }
.foot { margin-top: auto; padding-top: 18px; text-align: center; }

dialog { width: min(520px, calc(100vw - 32px)); max-height: 86vh; overflow-y: auto; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(10, 6, 12, .78); }
dialog h2 { font-size: 17px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-top: 6px; }
dialog ul { padding-left: 20px; margin: 0 0 16px; }
dialog li { margin-bottom: 8px; }
dialog p { color: var(--mist); font-size: 14px; }
dialog .more { margin: 14px 0 0; text-align: center; }
#feedback label { display: block; margin: 12px 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--mist); }
#feedback select, #feedback textarea { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: #322438; color: var(--text); font: inherit; resize: vertical; }
#feedback .fine { margin: 10px 0 0; font-size: 13px; }
.status { min-height: 20px; margin: 8px 0 0; font-size: 14px; color: var(--bad); }
.status.ok { color: var(--good); }
.petal { position: fixed; z-index: 9; width: 9px; height: 9px; border-radius: 2px; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  #card > *, .row10 span, .film.no.shake { animation: none; }
  .vs span { transition: none; }
}
