/* Starlight: pure black, thin luminous lines. Colour carries meaning: apricot = your pick, mint = also good, red = no, blue = something to press.
   Phone first: the choose screen is one fixed page (head, stage, strip, dock); the stage takes what is left and nothing scrolls under anything. */
@font-face { font-family: Jost; src: url(/jost.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --ink: #d6def0; --note: #969eb2; --line: rgba(214, 222, 240, .16); --line2: rgba(214, 222, 240, .32); --lift: #0c0e14;
  --pick: #f7b267; --good: #9fe6c9; --no: #ff786e; --act: #aac3ff; --kb: 0px;
  --spring: cubic-bezier(.2, .9, .25, 1); --side: 20px;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; background: #000; overscroll-behavior: none; }
body { color: var(--ink); font: 400 17px/1.45 Jost, system-ui, sans-serif; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
#top { grid-row: 1; }
main { grid-row: 2; min-height: 0; min-width: 0; overflow: hidden auto; overscroll-behavior: contain; outline: none; }
.choosing main { overflow: hidden; }
h1 { font-size: 26px; font-weight: 300; line-height: 1.2; margin: 0; text-wrap: balance; }
h2 { font-size: 19px; font-weight: 400; margin: 44px 0 14px; }
p { margin: 0; max-width: 62ch; }
small { font-size: 15px; color: var(--note); }
a { color: var(--act); text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2px solid var(--act); outline-offset: 3px; }
.icon { width: 22px; height: 22px; display: block; }
.empty { color: var(--note); }

/* top bar */
#top { padding: var(--st) calc(var(--side) - 10px) 0; }
#top nav { display: flex; align-items: center; max-width: 1180px; margin: 0 auto; height: 52px; }
#top a { color: var(--note); padding: 10px; transition: color .15s; }
#top a[aria-current], #top a:hover { color: var(--ink); }
#top .me { margin-left: auto; padding: 11px; }

/* buttons */
.save { background: var(--act); color: #000; border: 0; border-radius: 999px; padding: 0 26px; height: 50px; font-weight: 500; white-space: nowrap; transition: scale .12s, opacity .15s; }
.save:active, .pickbtn:active, .round:active, .chip:active, .mark:active { scale: .96; }
.save:disabled { opacity: .5; }
.quiet { background: none; border: 0; padding: 0 12px; height: 44px; color: var(--note); white-space: nowrap; transition: color .15s; }
.quiet:hover { color: var(--ink); }
.quiet[aria-pressed=true] { color: var(--no); }
.quiet.lit { color: var(--act); }
.backlink { display: inline-flex; align-items: center; gap: 2px; margin-left: -6px; height: 40px; }

/* ---- choose: shared ---- */
.choose { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-columns: minmax(0, 1fr); position: relative; overflow: hidden; }
.head { padding: 0 var(--side); display: grid; justify-items: center; text-align: center; gap: 2px; }
.head p { color: var(--note); }
.head .backlink { justify-self: start; }
.wave { width: min(340px, 100%); height: 26px; overflow: visible; margin-bottom: 8px; }
.wave .todo { fill: rgba(214, 222, 240, .38); }
.wave .pick { fill: var(--pick); filter: drop-shadow(0 0 4px rgba(247, 178, 103, .85)); }
.wave .other { fill: var(--note); }
.wave .now { fill: #000; stroke: var(--act); stroke-width: 1.6; }
.stage { min-height: 0; min-width: 0; container-type: size; view-transition-name: stage; }
.letter { font-weight: 500; color: var(--note); }
.opt { min-width: 0; }
.face { display: block; padding: 0; border: 0; background: #000; text-align: left; width: 100%; transition: box-shadow .25s, opacity .25s; }
.mark { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--note); flex: none; transition: background .15s, color .15s, border-color .15s, scale .12s; }
.mark:hover { border-color: var(--line2); color: var(--ink); }
.mark.good[aria-pressed=true], .round.good[aria-pressed=true] { background: var(--good); border-color: var(--good); color: #000; }
.mark.no[aria-pressed=true], .round.no[aria-pressed=true] { background: var(--no); border-color: var(--no); color: #000; }
.title .words, .cover .words { font: 500 17px/1.32 Roboto, 'Segoe UI', system-ui, sans-serif; color: #f1f1f1; }        /* a title is judged in YouTube's kind of type */

/* covers, frames, clips */
.deck .face { border-radius: 20px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); position: relative; }
.deck img, .deck video { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #000; -webkit-user-drag: none; }
.deck .words { display: block; padding: 10px 14px 12px; background: #0f0f0f; min-height: 66px; }
.frame { position: relative; }
.over { position: absolute; right: 8px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: var(--ink); }
.over.expand { top: 8px; }
.over.sound { top: 60px; }
.chosen .opt:not(.best):not(.good) .face { opacity: .62; }
.opt.no .face, .chosen .opt.no .face { opacity: .34; }
.opt.best .face { box-shadow: 0 0 0 3px var(--pick), 0 0 46px rgba(247, 178, 103, .4); opacity: 1; }
.opt.good .face { box-shadow: 0 0 0 2px rgba(159, 230, 201, .8); }

/* titles and lines */
.list { display: grid; gap: 12px; align-content: safe center; }
.list .opt { display: flex; align-items: center; gap: 12px; }
.list .face { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 18px; border-radius: 18px; background: var(--lift); box-shadow: inset 0 0 0 1px var(--line); }
.list .words { text-wrap: pretty; min-width: 0; }
.text .list .words { font-size: 18px; line-height: 1.38; }
.list .marks { display: flex; gap: 8px; }
.list .opt.best .face { box-shadow: inset 0 0 0 3px var(--pick), 0 0 40px rgba(247, 178, 103, .28); }
.list .opt.good .face { box-shadow: inset 0 0 0 2px rgba(159, 230, 201, .8); }
.ctx { border-radius: 14px; box-shadow: 0 0 0 1px var(--line); display: block; aspect-ratio: 9 / 16; }

/* reasons */
.chips { display: grid; gap: 14px; min-width: 0; }
.chips .row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: none; border: 1px solid var(--line2); border-radius: 999px; padding: 0 15px; height: 40px; font-size: 16px; white-space: nowrap; transition: background .15s, color .15s, scale .12s; }
.chip.nope { color: var(--note); border-color: var(--line); }
.chip[aria-pressed=true] { color: #000; border-color: transparent; }
.chip.yes[aria-pressed=true] { background: var(--good); }
.chip.nope[aria-pressed=true] { background: var(--no); }
textarea, input:not([type=checkbox]) { width: 100%; background: #000; border: 1px solid var(--line2); border-radius: 14px; padding: 12px 16px; resize: none; font-size: 17px; line-height: 1.4; display: block; transition: border-color .15s; }
textarea:focus, input:not([type=checkbox]):focus { border-color: var(--act); outline: none; }
textarea::placeholder, input::placeholder { color: var(--note); opacity: 1; }
.use { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; white-space: nowrap; color: var(--ink); position: relative; }
.use input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 50px; height: 30px; border-radius: 99px; background: var(--line2); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; width: 24px; height: 24px; border-radius: 50%; background: #000; top: 3px; left: 3px; transition: translate .22s var(--spring); }
.use input:checked + .switch { background: var(--pick); }
.use input:checked + .switch::after { translate: 20px 0; }
.use input:focus-visible + .switch { outline: 2px solid var(--act); outline-offset: 3px; }

/* ---- choose: phone ---- */
@media (max-width: 820px) {
  .head h1 { font-size: 23px; }
  .head p { font-size: 15px; }
  .deckmode { margin-top: 6px; }
  .deck { --w: min(80cqw, calc((100cqh - 24px) * .5625)); height: 100%; display: flex; align-items: center; gap: 18px; overflow: auto hidden; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 0 calc(50cqw - var(--w) / 2); overscroll-behavior-x: contain; }
  .deck::-webkit-scrollbar { display: none; }
  .deck .opt { flex: 0 0 var(--w); scroll-snap-align: center; scroll-snap-stop: always; }
  .deck .marks, .deck .opt:not(.here) .over { display: none; }
  .deck .words { font-size: 16px; padding: 9px 12px; min-height: 0; height: 62px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .kind-package .deck { --w: min(80cqw, calc((100cqh - 90px) * .5625)); }
  .deck .opt.best .face { box-shadow: 0 0 0 3px var(--pick), 0 0 22px rgba(247, 178, 103, .42); }
  .strip { display: flex; justify-content: center; gap: 12px; padding: 10px var(--side) 4px; }
  .strip button { border: 0; background: none; padding: 0; width: 46px; display: grid; justify-items: center; gap: 3px; color: var(--note); font-size: 15px; line-height: 1.2; }
  .strip img { width: 34px; height: 60px; object-fit: cover; border-radius: 7px; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s, opacity .2s; display: block; }
  .strip .here { color: var(--ink); }
  .strip .here img { box-shadow: 0 0 0 1.5px var(--ink); }
  .strip .best { color: var(--pick); }
  .strip .best img { box-shadow: 0 0 0 2.5px var(--pick); }
  .strip .good { color: var(--good); }
  .strip .good img { box-shadow: 0 0 0 2px var(--good); }
  .strip .no img { opacity: .35; }
  .strip button:not(:has(img)) { height: 44px; place-content: center; font-size: 18px; }

  .listmode { overflow: hidden auto; scrollbar-width: none; mask-image: linear-gradient(transparent, #000 14px, #000 calc(100% - 30px), transparent); }
  .listmode::-webkit-scrollbar { display: none; }
  .list { min-height: 100cqh; padding: 16px var(--side) 34px; }
  .list .face { padding: 12px 14px; gap: 12px; }
  .withcover { min-height: 100cqh; display: grid; grid-template-rows: auto 1fr; }
  .withcover .list { min-height: 0; padding-top: 16px; }
  .withcover .ctx { height: clamp(64px, 21cqh, 180px); margin: 14px auto 0; }

  .dock { padding: 8px var(--side) calc(6px + var(--sb)); display: grid; gap: 4px; }
  .trio { display: grid; grid-template-columns: 54px 1fr 54px; gap: 12px; align-items: center; }
  .round { width: 54px; height: 54px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid var(--line2); background: none; transition: background .15s, color .15s, scale .12s; }
  .round.no { color: var(--no); }
  .round.good { color: var(--good); }
  .pickbtn { height: 54px; border-radius: 999px; border: 1.5px solid var(--pick); background: none; color: var(--pick); font-weight: 500; transition: background .2s, color .2s, scale .12s; }
  .pickbtn.on, .cont { background: var(--pick); color: #000; }
  .cont { width: 100%; height: 54px; }
  .quiets { display: flex; justify-content: center; margin: 0 -12px; }
  .quiets .quiet { font-size: 16px; padding: 0 9px; }

  .chips { gap: 10px; }
  .chip { height: 38px; padding: 0 13px; }
  .chips .slide { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--side)); padding: 0 var(--side); scrollbar-width: none; touch-action: pan-x; }
  .chips .slide::-webkit-scrollbar { display: none; }
  .scrim { position: absolute; inset: 0; z-index: 2; background: linear-gradient(transparent, rgba(0, 0, 0, .55) 60%); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .sheet { position: absolute; z-index: 3; inset: auto 0 0; background: #0c0e14; border-radius: 26px 26px 0 0; box-shadow: 0 0 0 1px var(--line); padding: 0 var(--side) calc(14px + max(var(--sb), var(--kb))); display: grid; gap: 16px; max-height: 92%; overflow: hidden auto; transform: translateY(calc(100% + 4px)); visibility: hidden; transition: transform .34s var(--spring), translate .3s var(--spring), visibility 0s .34s; touch-action: none; }
  .sheeton .sheet { transform: none; visibility: visible; transition: transform .34s var(--spring), translate .3s var(--spring); }
  .choose .sheet.held { transition: none; }
  .sheeton .scrim { opacity: 1; pointer-events: auto; }
  .grab { height: 24px; border: 0; background: none; padding: 0; display: grid; place-items: center; margin-bottom: -14px; }
  .grab::after { content: ''; width: 40px; height: 5px; border-radius: 9px; background: var(--line2); }
  .sheet h2 { margin: 0; font-size: 21px; font-weight: 300; }
  .fields { display: grid; gap: 8px; }
  .sheet .save { width: 100%; height: 54px; }
  .chips:empty { display: none; }
}
@media (max-width: 820px) and (max-height: 700px) {
  .wave { height: 20px; margin-bottom: 2px; }
  #top nav { height: 46px; }
  .head h1 { font-size: 21px; }
  .strip { padding-top: 6px; padding-bottom: 0; gap: 6px; }
  .strip img { display: none; }
  .strip button { width: 44px; height: 34px; place-content: center; }
  .trio { grid-template-columns: 50px 1fr 50px; }
  .round, .pickbtn { height: 50px; }
  .round { width: 50px; }
  .quiets .quiet { height: 40px; }
  .sheet { gap: 12px; }
}
@media (max-width: 820px) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view(inline)) {
    .deck .frame { animation: peek linear both; animation-timeline: view(inline); }
  }
}
@keyframes peek { 0% { scale: .86; } 50% { scale: 1; } 100% { scale: .86; } }

/* ---- choose: computer ---- */
@media (min-width: 821px) {
  :root { --side: 28px; }
  .onlyphone, .scrim, .grab, .sheet h2, .strip, .trio, .cont { display: none !important; }
  .head { padding-bottom: 22px; width: 100%; max-width: 1180px; margin: 0 auto; }
  .deckmode { max-width: 1280px; width: 100%; margin: 0 auto; }
  .deck { --n: 4; --gap: 22px; --w: min(calc((100cqw - 2 * var(--side) - (var(--n) - 1) * var(--gap)) / var(--n)), calc((100cqh - 78px) * .5625)); height: 100%; padding: 4px var(--side); display: flex; gap: var(--gap); justify-content: center; align-items: flex-start; }
  .n2 { --n: 2; } .n3 { --n: 3; } .n5 { --n: 5; } .n6 { --n: 6; }
  .kind-package .deck { --w: min(calc((100cqw - 2 * var(--side) - (var(--n) - 1) * var(--gap)) / var(--n)), calc((100cqh - 144px) * .5625)); }
  .deck .opt { flex: 0 0 var(--w); }
  .deck .marks { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
  .deck .letter { margin-right: auto; padding-left: 4px; }
  .deck .face:hover { opacity: 1; }
  .over { opacity: 0; transition: opacity .15s; }
  .frame:hover .over, .over:focus-visible, .over.sound { opacity: 1; }
  .listmode { overflow: hidden auto; }
  .list { min-height: 100cqh; max-width: 820px; margin: 0 auto; padding: 4px var(--side); }
  .withcover { min-height: 100cqh; display: grid; grid-template-columns: auto minmax(0, 620px); gap: 44px; justify-content: center; align-items: center; padding: 0 var(--side); }
  .withcover .list { margin: 0; padding: 4px 0; width: 100%; }
  .withcover .ctx { height: min(440px, 92cqh); }
  .list .face:hover { opacity: 1; }
  .list .opt:not(.best):not(.good) .face:hover { box-shadow: inset 0 0 0 1px var(--line2); }
  .bottom { border-top: 1px solid var(--line); margin-top: 14px; padding: 14px max(var(--side), calc((100vw - 1124px) / 2)); display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-areas: 'chips chips chips chips' 'text use quiets save'; gap: 14px 12px; align-items: center; min-height: 78px; }
  .dock, .sheet, .fields { display: contents; }
  .chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: 8px 22px; }
  .chips:empty { display: none; }
  .fields textarea { grid-area: text; }
  .use { grid-area: use; padding: 0 6px; }
  .quiets { grid-area: quiets; display: flex; }
  .sheet .save { grid-area: save; }
  .chip { height: 36px; font-size: 15px; padding: 0 13px; }
}

/* a soft slide between questions */
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(stage) { animation-duration: .3s; }
::view-transition-old(stage) { animation: .2s ease-in both leave; }
::view-transition-new(stage) { animation: .32s var(--spring) both enter; }
[data-dir=prev]::view-transition-old(stage) { animation-name: leaveback; }
[data-dir=prev]::view-transition-new(stage) { animation-name: enterback; }
@keyframes leave { to { opacity: 0; translate: -40px 0; } }
@keyframes enter { from { opacity: 0; translate: 60px 0; } }
@keyframes leaveback { to { opacity: 0; translate: 40px 0; } }
@keyframes enterback { from { opacity: 0; translate: -60px 0; } }

/* ---- full size ---- */
dialog { border: 0; padding: 0; background: #000; color: var(--ink); width: 100vw; height: 100dvh; max-width: none; max-height: none; }
dialog[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
dialog::backdrop { background: #000; }
.full { display: grid; place-items: center; min-height: 0; padding-top: var(--st); touch-action: pan-y pinch-zoom; }
.full img, .full video { max-width: 100%; max-height: calc(100dvh - 80px - var(--sb) - var(--st)); display: block; user-select: none; -webkit-user-drag: none; }
.bar { display: flex; align-items: center; justify-content: center; gap: 30px; padding: 12px 14px calc(14px + var(--sb)); }
.jump { display: flex; }
.jump .quiet { min-width: 44px; padding: 0; }
.jump [aria-current] { color: var(--pick); font-weight: 500; }
@media (max-width: 820px) { .bar { gap: 4px; justify-content: space-between; } .bar .save { padding: 0 20px; } }

/* ---- other pages ---- */
.page { max-width: 780px; margin: 0 auto; padding: 18px var(--side) calc(70px + var(--sb)); }
.page > h1 { margin: 8px 0 18px; }
.page > p { color: var(--note); margin-bottom: 8px; }
.done { display: grid; gap: 14px; justify-items: center; text-align: center; padding-top: 12vh; }
.done > h1, .done > p { margin: 0; }
.done .todo { width: 100%; text-align: left; }
.rows li + li { border-top: 1px solid var(--line); }
.rows a { display: flex; gap: 18px; align-items: center; padding: 14px 0; color: inherit; min-height: 68px; }
.rows a > span:last-child { display: grid; gap: 2px; min-width: 0; }
.rows strong { font-weight: 400; font-size: 19px; line-height: 1.3; transition: color .15s; }
.rows a:hover strong { color: var(--act); }
.thumb { width: 54px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; flex: none; background: #000; box-shadow: 0 0 0 1px var(--line); }
small.left { color: var(--pick); }
.hero { display: flex; gap: 22px; align-items: center; margin-top: 10px; }
.hero img { width: 116px; border-radius: 16px; box-shadow: 0 0 0 1px var(--line); flex: none; }
.hero div { display: grid; gap: 8px; min-width: 0; }
.hero p { color: var(--note); }
.note { display: grid; gap: 12px; }
.note .save { justify-self: end; }
.notes { margin-top: 20px; }
.notes li { padding: 14px 0; border-top: 1px solid var(--line); }
.notes p { white-space: pre-wrap; overflow-wrap: anywhere; }
.rules { display: grid; gap: 32px; }
.rules p { font-size: 19px; line-height: 1.4; margin-bottom: 4px; }
.rules b { font-weight: 500; }
.rules b.sure { color: var(--good); }
.rules b.likely { color: var(--pick); }
.rules b.testing { color: var(--act); }
.votes { display: flex; gap: 10px; margin-top: 12px; }
.vote { background: none; border: 1px solid var(--line2); border-radius: 999px; height: 44px; padding: 0 18px; color: var(--note); transition: background .15s, color .15s; }
.vote.good[aria-pressed=true] { background: var(--good); border-color: var(--good); color: #000; }
.vote.no[aria-pressed=true] { background: var(--no); border-color: var(--no); color: #000; }
.fix { display: flex; gap: 10px; margin-top: 12px; }
.account form { display: grid; gap: 10px; max-width: 400px; margin-bottom: 36px; }
.account h2 { margin: 12px 0 4px; }
.account .save { justify-self: start; margin-top: 10px; }
.account .quiet { padding: 0; }
.login { min-height: 100%; display: grid; place-content: center; gap: 36px; justify-items: center; padding: 30px var(--side); }
.login form { display: grid; gap: 10px; width: min(340px, 86vw); }
.login .save { margin-top: 4px; }
.psi { width: 112px; height: 112px; border-radius: 26px; }
label { color: var(--note); }
.error { color: var(--no); min-height: 1.45em; }

#toast { position: fixed; z-index: 9; left: 50%; translate: -50% 0; top: calc(12px + var(--st)); background: var(--ink); color: #000; padding: 11px 20px; border-radius: 999px; width: max-content; max-width: 92vw; text-align: center; animation: drop .3s var(--spring); }
@keyframes drop { from { opacity: 0; translate: -50% -14px; } }
@media (prefers-reduced-motion: reduce) { *, ::before, ::after { transition: none !important; animation: none !important; } }
