:root {
  --page: #101114; --ink: #FFFFFF; --sub: rgba(255,255,255,.6); --card: #1C1E24; --line: rgba(255,255,255,.08);
  --bad: #E8505B; --good: #3E7BFA; --btn: #FFFFFF; --btnText: #101114; --font: Inter, system-ui, sans-serif; --display: Inter, system-ui, sans-serif;
}
body[data-style="ink"] {
  --page: #F4EFE6; --ink: #1C1A17; --sub: rgba(28,26,23,.6); --card: #FFFDF8; --line: #1C1A17;
  --bad: #D6453D; --good: #2F6FDB; --btn: #1C1A17; --btnText: #F4EFE6; --display: Kalam, Inter, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--page); color: var(--ink); font-family: var(--font); overflow: hidden; }
body { display: grid; place-items: center; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

/* 9:16 stage that fits any screen; everything inside is sized in cqw so it scales with the canvas */
#stage { position: relative; height: 100dvh; max-width: 100vw; aspect-ratio: 9 / 16; margin: 0 auto; container-type: size; overflow: hidden; }
@media (max-aspect-ratio: 9/16) { #stage { width: 100vw; height: 100dvh; aspect-ratio: auto; } }
canvas { object-fit: contain; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; text-align: center; }
.screen.on { display: flex; }

/* HOME */
#home { background: var(--page); padding: 9cqw 6cqw 6cqw; gap: 4cqw; overflow-y: auto; }
#home > * { flex-shrink: 0; }
.brand h1 { font-family: var(--display); font-weight: 900; font-size: 11cqw; letter-spacing: -.04em; margin: 2cqw 0 1cqw; line-height: 1; }
.brand p { margin: 0; font-size: 3.7cqw; line-height: 1.35; color: var(--sub); font-weight: 600; }
.logo { display: inline-flex; flex-direction: column; gap: 1.1cqw; }
.logo i { width: 4.4cqw; height: 4.4cqw; border-radius: 50%; }
.logo .d0 { background: var(--bad); } .logo .d1 { background: var(--good); }
.sect { font-size: 2.6cqw; letter-spacing: .25em; text-transform: uppercase; color: var(--sub); margin: 2cqw 0 0; font-weight: 800; }
.today { border-radius: 5cqw; overflow: hidden; background: var(--card); border: 2px solid var(--line); text-align: left; }
.today canvas { position: static; width: 100%; height: auto; aspect-ratio: 1000 / 560; }
.today .meta { padding: 4cqw 5cqw 5cqw; display: flex; align-items: center; gap: 3cqw; }
.today .meta div { flex: 1; }
.today small { font-size: 2.6cqw; letter-spacing: .2em; font-weight: 800; color: var(--sub); }
.today h3 { margin: 1cqw 0 0; font-family: var(--display); font-size: 6cqw; font-weight: 900; line-height: 1.05; }
.today p { margin: 1cqw 0 0; font-size: 3.4cqw; color: var(--sub); font-weight: 600; }
.lives { display: grid; gap: 2.6cqw; }
.life { display: flex; align-items: center; gap: 3.4cqw; padding: 3.6cqw 4cqw; border-radius: 4cqw; background: var(--card); border: 2px solid var(--line); text-align: left; }
.life .sw { width: 9cqw; height: 9cqw; border-radius: 2.6cqw; overflow: hidden; display: grid; grid-template-rows: 1fr 1fr; flex: none; }
.life .sw i:first-child { background: var(--bad); } .life .sw i:last-child { background: var(--good); }
.life div { flex: 1; }
.life b { display: block; font-family: var(--display); font-size: 4.4cqw; font-weight: 900; }
.life span { font-size: 3.2cqw; color: var(--sub); font-weight: 600; }
.life em { font-style: normal; font-size: 2.6cqw; font-weight: 800; letter-spacing: .12em; color: var(--sub); }
.life[disabled] { opacity: .45; cursor: default; }
.styles { display: inline-flex; align-self: center; padding: 1cqw; border-radius: 99px; background: var(--card); border: 2px solid var(--line); margin-top: 2cqw; }
.styles button { padding: 2cqw 5cqw; border-radius: 99px; font-weight: 800; font-size: 3.4cqw; color: var(--sub); transition: background .2s, color .2s; }
.styles button.on { background: var(--btn); color: var(--btnText); }

/* PLAY */
#play { pointer-events: none; }
#play > * { pointer-events: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 4cqw 5cqw 0; }
.icon { width: 10cqw; height: 10cqw; border-radius: 50%; background: var(--card); border: 2px solid var(--line); font-size: 4cqw; display: grid; place-items: center; }
.dots { display: flex; gap: 1.6cqw; }
.dots i { width: 2cqw; height: 2cqw; border-radius: 50%; background: var(--sub); opacity: .35; transition: all .3s; }
.dots i.done { opacity: 1; background: var(--ink); }
.dots i.now { opacity: 1; width: 6cqw; border-radius: 99px; background: var(--ink); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 6cqw 7cqw; display: flex; flex-direction: column; gap: 3cqw; }
.prompt { font-family: var(--display); font-weight: 900; font-size: 6.4cqw; line-height: 1.12; margin: 0 0 1cqw; letter-spacing: -.01em; }
.picks { display: grid; gap: 2.6cqw; }
.pick { padding: 4.2cqw 5cqw; border-radius: 4.4cqw; background: var(--card); border: 2px solid var(--line); text-align: left; display: flex; flex-direction: column; gap: .8cqw; transition: transform .15s; }
.pick:active { transform: scale(.98); }
.pick b { font-size: 3cqw; letter-spacing: .2em; font-weight: 900; color: var(--sub); text-transform: uppercase; }
.pick span { font-family: var(--display); font-size: 4.8cqw; font-weight: 800; }
.pct { margin: 0; font-size: 3.4cqw; font-weight: 700; color: var(--sub); min-height: 4cqw; }
.cta { padding: 4.4cqw; border-radius: 99px; background: var(--btn); color: var(--btnText); font-weight: 900; font-size: 4.2cqw; }
.ghost { padding: 4cqw; border-radius: 99px; border: 2px solid var(--line); font-weight: 800; font-size: 3.8cqw; background: var(--card); }
.hide { display: none !important; }
.fade { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(2cqw); } to { opacity: 1; transform: none; } }

/* RESULT */
#result { background: color-mix(in srgb, var(--page) 88%, transparent); padding: 16cqw 7cqw 8cqw; justify-content: space-between; }
.card { padding: 8cqw 6cqw; border-radius: 6cqw; background: var(--card); border: 2px solid var(--line); }
.kicker { margin: 0; font-size: 2.8cqw; letter-spacing: .25em; font-weight: 900; color: var(--sub); }
.card h2 { font-family: var(--display); font-size: 8.4cqw; font-weight: 900; line-height: 1.02; margin: 3cqw 0; letter-spacing: -.02em; }
.score { display: flex; align-items: baseline; justify-content: center; gap: 2cqw; }
.score b { font-size: 18cqw; font-weight: 900; line-height: 1; letter-spacing: -.04em; }
.score span { font-size: 3.4cqw; font-weight: 900; letter-spacing: .2em; color: var(--sub); }
.card .line { font-size: 4.2cqw; font-weight: 700; margin: 4cqw 0 0; }
.card .quote { font-size: 3.6cqw; color: var(--sub); white-space: pre-line; margin: 3cqw 0 0; font-weight: 600; }
.actions { display: grid; gap: 2.6cqw; }
body[data-style="flat"] #result h2.bad, body[data-style="flat"] #result b.bad { color: var(--bad); }
#result h2.good, #result b.good { color: var(--good); }
#result h2.bad, #result b.bad { color: var(--bad); }
