/* CAPS phone page. Light and calm for reading long questions; system fonts; big tap targets for small phones.
   Old Androids too: flexbox without gap, no grid, no min()/max()/clamp() (build.mjs checks).
   The colours, shapes and type are tokens (:root) that a theme (css/themes/<x>.css → t-<x>.css, ?theme=x)
   overrides; this file is the default look and all the motion. Motion is transform and opacity only, and big motion
   is off with prefers-reduced-motion. */
:root {
  --bg: #f4f1ea; --ink: #1d2733; --muted: #59636e; --faint: #8a929b; --card: #fff; --line: #c9cfd6; --rule: #e3e6ea;
  --brand: #14365d; --on-brand: #fff; --link: #2a6bb3; --accent: #ffc83d; --tint: #e8f0f9; --note: #fff4d6; --field: #fff;
  --ok: #1f8a52; --ok-bg: #e3f5ea; --ok-line: #2fa96b; --ny: #b26b00; --track: #dde3ea;
  --o0: #e5484d; --o1: #2fa96b; --o2: #e0a100; --o3: #3d7fe0;
  --fx0: #ffc83d; --fx1: #2fa96b; --fx2: #3d7fe0; --fx3: #e5484d;
  --r: 12px; --r-card: 14px; --shadow: 0 1px 3px rgba(20, 54, 93, .12);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: var(--sans); --display-case: none; --display-track: 0;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.45 var(--sans); -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
h1 { font-size: 1.45rem; line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .4rem; }
h1, .verdict, .big, .brand, .kicker, .share .gcode, .tfb b { font-family: var(--display); }
h1, .verdict .vw, .verdict.none, .big, .tfb b { text-transform: var(--display-case); letter-spacing: var(--display-track); }   /* "Not yet" never shouts */
h2 small, label small, .lbl small { font-weight: 400; color: var(--muted); }
.sub { color: var(--muted); margin: .3rem 0; }
.foot { text-align: center; color: var(--faint); font-size: .85rem; margin: 1.2rem 1rem; }

#top { position: -webkit-sticky; position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: .55rem 1rem; background: var(--brand); color: var(--on-brand); }
.brand { color: var(--on-brand); text-decoration: none; font-weight: 800; letter-spacing: .08em; }
.brand:before { content: "✓"; display: inline-block; color: var(--accent); margin-right: .35rem; }
.conn { font-size: .8rem; padding: .15rem .55rem; border-radius: 1rem; background: rgba(255, 255, 255, .15); font-weight: 600; letter-spacing: .05em; }
.conn.ok:before, .conn.wait:before, .conn.bad:before { content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .35rem; background: #2fd27a; }
.conn.wait:before { background: #ffc83d; }
.conn.bad:before { background: #ff6b6b; }
#prog { position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; background: rgba(0, 0, 0, .08); overflow: hidden; }
#prog i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform .8s var(--ease); }

#screen { padding: .8rem .8rem 6rem; max-width: 40rem; margin: 0 auto; }
.bars1 #screen { padding-bottom: 7.5rem; }
.bars2 #screen { padding-bottom: 10.5rem; }
.card { background: var(--card); border-radius: var(--r-card); padding: 1rem; margin: 0 0 .8rem; box-shadow: var(--shadow); }
.center { text-align: center; padding: 2.5rem .5rem 1rem; }
.row { display: flex; }
.row > input { flex: 1; margin-right: .5rem; }
.row2 { display: flex; flex-wrap: wrap; margin: 0 -.25rem; }
.row2 > .btn { flex: 1 1 10rem; margin: .25rem; }

.lbl { display: block; font-weight: 700; font-size: .9rem; margin: .9rem 0 .35rem; color: var(--brand); }
input.code, input.name, select { width: 100%; padding: .7rem .8rem; border: 2px solid var(--line); border-radius: 10px; background: var(--field); }
input.code { text-transform: uppercase; letter-spacing: .3em; font-weight: 800; font-size: 1.3rem; }
input:focus, select:focus { outline: none; border-color: var(--link); }
.check { display: block; margin: 1rem 0 .3rem; }
.check input { width: 1.2rem; height: 1.2rem; vertical-align: -.2rem; margin-right: .4rem; }

.btn { display: block; width: 100%; padding: .8rem 1rem; border: 2px solid var(--brand); border-radius: var(--r); background: var(--card); color: var(--brand); font-weight: 700; cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.big { padding: 1rem; margin-top: 1rem; font-size: 1.1rem; }
.btn[disabled] { opacity: .45; }
.row .btn { width: auto; }
.link { border: 0; background: none; color: var(--link); font-weight: 700; padding: .4rem 0; text-decoration: underline; cursor: pointer; }
/* press-down: everything you tap gives a little */
.btn, .opt, .seg, .avpick, .pick, .rx, .hostbar button { transition: transform .12s ease-out; }
.btn:active, .seg:active, .pick:active, .hostbar button:active { transform: scale(.96); }
.opt:active { transform: scale(.97); }
.avpick:active, .rx:active { transform: scale(.85); }

.segs { display: flex; margin: 0 -.2rem; }
.seg { flex: 1; margin: 0 .2rem; padding: .7rem .2rem; border: 2px solid var(--line); border-radius: 10px; background: var(--card); font-weight: 700; }
.seg.on { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
.avgrid { display: flex; flex-wrap: wrap; margin: 0 -.2rem; }
.avpick { margin: .2rem; padding: .15rem; border: 3px solid transparent; border-radius: 50%; background: none; }
.avpick.on { border-color: var(--brand); }
.av { display: inline-block; width: 2.6rem; height: 2.6rem; border-radius: 50%; text-align: center; line-height: 2.6rem; font-size: 1.5rem; }
.av.sm { width: 1.9rem; height: 1.9rem; line-height: 1.9rem; font-size: 1.05rem; margin-right: .5rem; }

.mine { margin: .6rem 0; padding: .7rem .8rem; border-radius: 10px; background: var(--tint); }
.mine b, .mine small { display: block; }
.mine small { color: var(--muted); }
.note { margin: .6rem 0; padding: .7rem .8rem; border-radius: 10px; background: var(--note); }
.picks { display: flex; flex-wrap: wrap; margin: 0 -.2rem; }
.pick { margin: .2rem; padding: .5rem .7rem; border: 2px solid var(--line); border-radius: 10px; background: var(--card); }
.hostbox { margin-top: .6rem; padding-top: .3rem; border-top: 1px solid var(--rule); }
.share { margin: .8rem 0; padding: .8rem; border-radius: 10px; background: var(--tint); text-align: center; }
.share .gcode { font-size: 2rem; font-weight: 800; letter-spacing: .25em; color: var(--brand); }
.share .url { word-break: break-all; font-size: .9rem; color: var(--link); }
.share svg { width: 9rem; height: 9rem; display: block; margin: .5rem auto; background: #fff; }
.roster { list-style: none; margin: 0; padding: 0; }
.roster li { display: flex; align-items: center; padding: .3rem 0; border-bottom: 1px solid var(--rule); }
.roster li .nm { -webkit-flex: 1; flex: 1; font-weight: 600; }
.roster li .av { -webkit-flex: none; flex: none; }
.roster li small { color: var(--muted); }

.kicker { font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--link); margin-bottom: .4rem; }
h1.round { font-size: 2rem; }
.rule { font-size: 1.1rem; color: var(--muted); }
.q { padding-top: .4rem; }
.qtext { font-size: 1.3rem; line-height: 1.35; margin: .2rem 0 1rem; }
.qtext.small { font-size: 1.05rem; color: var(--muted); margin-bottom: .7rem; }
.bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; margin: 1rem 0; }
.bar i { display: block; height: 100%; background: var(--link); -webkit-animation: shrink linear forwards; animation: shrink linear forwards; -webkit-transform-origin: left; transform-origin: left; }
@-webkit-keyframes shrink { from { -webkit-transform: scaleX(1); } to { -webkit-transform: scaleX(0); } }
@keyframes shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.opts .opt, .tf .opt { position: relative; display: flex; align-items: center; width: 100%; text-align: left; margin: 0 0 .55rem; padding: .75rem .8rem; min-height: 3.4rem;
  border: 2px solid var(--line); border-left-width: 8px; border-radius: var(--r); background: var(--card); cursor: pointer; }
.opt b { flex: none; width: 2rem; height: 2rem; line-height: 2rem; text-align: center; border-radius: 8px; margin-right: .7rem; background: var(--track); }
.opt span { flex: 1; }
.opt.o0 { border-left-color: var(--o0); } .opt.o1 { border-left-color: var(--o1); } .opt.o2 { border-left-color: var(--o2); } .opt.o3 { border-left-color: var(--o3); }
.opt.on { border-color: var(--brand); background: var(--tint); }
.opt.dim { opacity: .5; transition: opacity .3s, transform .12s; }
.stmt { padding: 1rem; border-radius: var(--r); background: var(--card); border: 2px dashed var(--line); font-size: 1.15rem; font-weight: 600; margin-bottom: .8rem; }
.stmt small { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.tf { display: flex; margin: 0 -.3rem; }
.tf .opt.tfb { flex: 1; display: block; text-align: center; margin: 0 .3rem; border-left-width: 2px; }
.tfb b { display: block; width: auto; height: auto; background: none; font-size: 1.3rem; margin: 0; }
.tfb small { color: var(--muted); }
.conf { margin-top: .5rem; }
.locked { text-align: center; color: var(--muted); font-weight: 600; margin: 1rem 0; }
.lock { display: inline-block; }

.verdict { position: relative; font-size: 1.6rem; font-weight: 800; margin: .3rem 0 .6rem; }
.verdict .vw { display: inline-block; }
.verdict.yes .vw { font-size: 2.2rem; line-height: 1.1; }
.verdict small { display: block; font: 600 .95rem/1.45 var(--sans); }
.verdict.yes { color: var(--ok); }
.verdict.notyet { color: var(--ny); }
.verdict.none { color: var(--muted); }
.streak { display: inline-block; margin-top: .35rem; padding: .2rem .7rem; border-radius: 1rem; background: var(--note); color: var(--ink); font: 700 .95rem/1.45 var(--sans); }
.right { padding: .75rem .8rem; border-radius: var(--r); background: var(--ok-bg); border: 2px solid var(--ok-line); font-weight: 600; margin-bottom: .6rem; }
.right b { display: inline-block; width: 1.8rem; text-align: center; border-radius: 6px; background: var(--ok-line); color: #fff; margin-right: .4rem; }
.explain { background: var(--card); border-radius: var(--r); padding: .2rem .9rem .5rem; margin: .6rem 0; box-shadow: var(--shadow); }
.explain p { margin: .6rem 0; }
.big { font-size: 3.2rem; font-weight: 800; color: var(--brand); }
.team { margin: 1rem auto; text-align: left; max-width: 22rem; }
.tbar { position: relative; height: 14px; border-radius: 7px; background: var(--track); overflow: hidden; }
.tbar i { display: block; height: 100%; background: var(--ok-line); transform-origin: 0 50%; }
.tbar em { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--brand); }
.met { display: inline-block; font-weight: 700; color: var(--ok); }
.next { margin-top: 2.2rem; font: 1.4rem/1.2 var(--display); text-transform: var(--display-case); letter-spacing: var(--display-track); color: var(--ink); }
.next span { display: block; margin-bottom: .3rem; font: 700 .8rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.awards span { display: inline-block; margin: .3rem; padding: .35rem .7rem; border-radius: 1rem; background: var(--note); font-weight: 700; }
.awards i { font-style: normal; }
.final { position: relative; }
.miss { border-top: 1px solid var(--rule); padding: .4rem 0; }
.miss p { margin: .4rem 0; }

#bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--card); border-top: 1px solid var(--rule); padding: .3rem .8rem .5rem; }
.hostbar { display: flex; align-items: center; max-width: 40rem; margin: .2rem auto 0; }
.hostbar span { flex: 1; font-weight: 700; color: var(--brand); }
.hostbar button { margin-left: .5rem; padding: .55rem .9rem; border: 2px solid var(--brand); border-radius: 10px; background: var(--card); font-weight: 700; }
.hostbar button.hot { background: var(--brand); color: var(--on-brand); }
#overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(13, 27, 42, .75); z-index: 10; display: flex; align-items: center; justify-content: center; }
.ovbox { background: var(--card); border-radius: 16px; padding: 1.5rem; margin: 1rem; text-align: center; }
#toast { position: fixed; left: 1rem; right: 1rem; bottom: 5rem; z-index: 20; padding: .8rem 1rem; border-radius: var(--r); background: var(--brand); color: var(--on-brand); text-align: center; }
.bars1 #toast { bottom: 6.5rem; }
.bars2 #toast { bottom: 9.5rem; }
.dots i { display: inline-block; width: .7rem; height: .7rem; margin: .3rem; border-radius: 50%; background: var(--link); -webkit-animation: blink 1.2s infinite; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { -webkit-animation-delay: .2s; animation-delay: .2s; }
.dots i:nth-child(3) { -webkit-animation-delay: .4s; animation-delay: .4s; }
@-webkit-keyframes blink { 50% { opacity: .2; } }
@keyframes blink { 50% { opacity: .2; } }

/* ---- reactions: a bar at the bottom (not while the options are up), floats rising ---- */
#rxbar { position: relative; display: flex; justify-content: space-between; max-width: 40rem; margin: 0 auto; padding-bottom: 3px; }
.rx { -webkit-flex: 1; flex: 1; margin: 0 .1rem; padding: .3rem 0; border: 0; border-radius: var(--r); background: none; font-size: 1.55rem; line-height: 1.3; cursor: pointer; }
#rxbar.cool .rx { opacity: .35; }
#rxbar .cd { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
#rxbar.cool .cd { animation: cooldown 3s linear both; }
@keyframes cooldown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
#floats { position: fixed; left: 0; right: 0; bottom: 0; height: 0; z-index: 15; pointer-events: none; }
.float { position: absolute; bottom: 5rem; margin-left: -1.1rem; font-size: 1.7rem; line-height: 1; white-space: nowrap; animation: floatup 2.2s var(--ease) both; }
.float.own { font-size: 2.3rem; bottom: 4.2rem; }
.float b { display: inline-block; width: 1.5rem; height: 1.5rem; margin-right: .1rem; border-radius: 50%; font-size: .95rem; line-height: 1.5rem; text-align: center; vertical-align: .2rem; }
.float.still { animation: fadeinout 2.2s both; }
@keyframes floatup {
  0% { opacity: 0; transform: translate(0, 12px) scale(.5); }
  12% { opacity: 1; transform: translate(0, -24px) scale(1.15); }
  45% { transform: translate(10px, -120px) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-6px, -250px) scale(.9); }
}
@keyframes fadeinout { 0%, 100% { opacity: 0; } 15%, 80% { opacity: 1; } }

/* ---- motion: keyed entrances (src/shared/motion.js puts mo-<kind> and a delay on an element) ---- */
.mo-rise, .mo-slide, .mo-drop, .mo-slam, .mo-pop, .mo-press, .mo-lock, .mo-yes, .mo-soft, .mo-grow, .mo-award, .mo-fly { animation-fill-mode: both; }
.mo-rise { animation-name: mo-rise; animation-duration: .45s; animation-timing-function: var(--ease); }
.mo-slide { animation-name: mo-slide; animation-duration: .45s; animation-timing-function: var(--ease); }
.mo-drop { animation-name: mo-drop; animation-duration: .5s; animation-timing-function: var(--ease); }
.mo-slam { animation-name: mo-slam; animation-duration: .7s; animation-timing-function: var(--ease); }
.mo-pop { display: inline-block; animation-name: mo-pop; animation-duration: .5s; animation-timing-function: var(--spring); }
li.mo-pop { display: flex; }
.mo-press { animation-name: mo-press; animation-duration: .3s; animation-timing-function: var(--spring); }
.mo-lock { animation-name: mo-lock; animation-duration: .7s; animation-timing-function: var(--ease); }
.mo-lock:after { content: ""; position: absolute; top: -6px; left: -6px; right: -6px; bottom: -6px; border-radius: var(--r); border: 3px solid var(--brand); opacity: 0; animation: mo-ring .7s var(--ease) both; animation-delay: inherit; pointer-events: none; }
.mo-yes { animation-name: mo-yes; animation-duration: .8s; animation-timing-function: var(--spring); }
.mo-soft { animation-name: mo-soft; animation-duration: .9s; animation-timing-function: ease-out; }
.mo-grow { animation-name: mo-grow; animation-duration: 1.2s; animation-timing-function: var(--ease); }
.mo-award { display: inline-block; animation-name: mo-award; animation-duration: .8s; animation-timing-function: var(--spring); }
@keyframes mo-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes mo-slide { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes mo-drop { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes mo-slam { 0% { opacity: 0; transform: scale(1.7); } 55% { opacity: 1; transform: scale(.96); } 100% { opacity: 1; transform: none; } }
@keyframes mo-pop { 0% { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: none; } }
@keyframes mo-press { 0% { transform: scale(.95); } 100% { transform: none; } }
@keyframes mo-lock { 0% { transform: none; } 30% { transform: scale(1.035); } 100% { transform: none; } }
@keyframes mo-ring { 0% { opacity: .8; transform: scale(.97); } 100% { opacity: 0; transform: scale(1.04); } }
@keyframes mo-yes { 0% { opacity: 0; transform: scale(.3) rotate(-8deg); } 55% { opacity: 1; transform: scale(1.18) rotate(2deg); } 100% { opacity: 1; transform: none; } }
@keyframes mo-soft { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes mo-grow { from { transform: scaleX(0); } to { transform: none; } }
@keyframes mo-award { 0% { opacity: 0; transform: scale(.3) rotate(-12deg); } 60% { opacity: 1; transform: scale(1.15) rotate(3deg); } 100% { opacity: 1; transform: none; } }

/* the "Yes!" burst: spokes (rotated) each throwing a dot outwards */
.burst { position: absolute; left: 50%; top: 1.4rem; width: 0; height: 0; pointer-events: none; }
.verdict.yes .burst { left: 3.6rem; top: 1.6rem; }
.burst s { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.burst i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--fx0); opacity: 0; }
.burst i.b1 { background: var(--fx1); width: 6px; height: 10px; border-radius: 3px; }
.burst i.b2 { background: var(--fx2); }
.burst i.b3 { background: var(--fx3); width: 10px; height: 4px; border-radius: 2px; }
.mo-fly { animation: mo-fly 1.4s cubic-bezier(.1, .7, .3, 1) both; }
.mo-fly.b1 { animation-name: mo-fly1; animation-duration: 1.7s; }
.mo-fly.b2 { animation-name: mo-fly2; animation-duration: 1.2s; }
.mo-fly.b3 { animation-name: mo-fly1; animation-duration: 1.5s; }
@keyframes mo-fly { 0% { opacity: 1; transform: translateY(0) scale(.6); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-120px) scale(1); } }
@keyframes mo-fly1 { 0% { opacity: 1; transform: translateY(-6px) rotate(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-150px) rotate(220deg); } }
@keyframes mo-fly2 { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-80px) scale(.4); } }

@media (prefers-reduced-motion: reduce) {
  .mo-rise, .mo-slide, .mo-drop, .mo-slam, .mo-pop, .mo-press, .mo-lock, .mo-yes, .mo-soft, .mo-grow, .mo-award, .mo-fly, .mo-lock:after { animation: none !important; }
  .burst { display: none; }
  .float { animation: fadeinout 2.2s both; }
  #prog i, .btn, .opt, .seg, .rx { transition: none; }
}
[hidden] { display: none !important; }

/* The approval gate (docs/gate.md): a hosting phone shows its pairing code until approved. */
.pair { margin: .8rem 0; padding: .8rem; border-radius: 10px; background: #f4b63d; color: #1b2433; text-align: center; }
.pair .gcode { font-size: 1.8rem; font-weight: 800; letter-spacing: .12em; }
.pair .note { background: transparent; padding: 0; }
