/* ═══════════════════════════════════════════════════════════════════════════
   patriot.plus LIVE — the retro system, borrowed from the store.
   Two registers:
     body.sky    the synthwave night: navy sky, orange grid floor, scan lines,
                 Oswald display type with the hard blue offset shadow.
                 Projector, lobby, hero moments.
     body.paper  the bootleg print: white, Courier Prime, 2px black rules,
                 Win95 bevel buttons, yellow hover. Phones, builder, control room.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --blue: #0021A5; --orange: #FA4616; --orange-ink: #C8420F; --gold: #F0A830; --navy: #001845; --dark: #0A0E1A;
  --paper: #ffffff; --ink: #111111; --ink-2: #555555; --rule: #111111; --grey: #e9e9e9; --yellow: #FFE600;
  --good: #1f8a4c; --bad: #c8250f; --sky-muted: #c7cfe6; --sky-faint: rgba(255,255,255,0.42); --sky-line: rgba(255,255,255,0.12);
  --mono: 'Courier Prime', 'Courier New', Courier, monospace;
  --head: 'Oswald', 'Inter', sans-serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --bevel: 2px solid; --bevel-color: #fff #6d6d6d #6d6d6d #fff;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ═══════════════════════ SKY ═══════════════════════ */
body.sky { font-family: var(--body); color: #fff; background: var(--dark); position: relative; overflow-x: hidden; }
body.sky::before {   /* the sky and the horizon glow */
  content: ''; position: fixed; inset: 0; z-index: -3;
  background:
    radial-gradient(ellipse 70% 42% at 50% 62%, rgba(250,70,22,.55), rgba(250,70,22,0) 70%),
    radial-gradient(ellipse 90% 60% at 50% 70%, rgba(240,168,48,.18), transparent 70%),
    linear-gradient(180deg, #05070f 0%, #0b1240 38%, #1a1a5e 55%, #0A0E1A 60%);
}
body.sky::after {    /* the grid floor */
  content: ''; position: fixed; left: -40vw; right: -40vw; bottom: 0; height: 40vh; z-index: -2;
  background:
    repeating-linear-gradient(90deg, rgba(250,70,22,.85) 0 2px, transparent 2px 120px),
    repeating-linear-gradient(0deg, rgba(250,70,22,.85) 0 2px, transparent 2px 60px),
    linear-gradient(180deg, rgba(10,14,26,.2), #0A0E1A 90%);
  transform: perspective(520px) rotateX(58deg); transform-origin: 50% 0; opacity: .75;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000); mask-image: linear-gradient(180deg, transparent, #000 25%, #000);
}
.scanlines { position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 2px, rgba(0,0,0,0) 2px 4px); mix-blend-mode: multiply; }
.sun { position: fixed; left: 50%; top: 22vh; width: min(46vh, 60vw); aspect-ratio: 1; transform: translateX(-50%); z-index: -2; border-radius: 50%;
  background: linear-gradient(180deg, #ffd166 0%, #ff8a3d 45%, #ff3d7f 100%);
  -webkit-mask-image: repeating-linear-gradient(180deg, #000 0 12%, transparent 12% 15%, #000 15% 35%, transparent 35% 37%, #000 37% 55%, transparent 55% 57%, #000 57% 72%, transparent 72% 74%, #000 74% 86%, transparent 86% 88%, #000 88% 100%);
  mask-image: repeating-linear-gradient(180deg, #000 0 12%, transparent 12% 15%, #000 15% 35%, transparent 35% 37%, #000 37% 55%, transparent 55% 57%, #000 57% 72%, transparent 72% 74%, #000 74% 86%, transparent 86% 88%, #000 88% 100%);
  box-shadow: 0 0 80px rgba(255,120,60,.45); }
.sky .eyebrow { font-family: var(--head); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); font-size: .8rem;
  text-shadow: 0 2px 10px rgba(0,0,0,.85), 0 0 3px rgba(0,0,0,.9); }   /* stays readable where the sun sits behind it */
.sky .h-display { font-family: var(--head); font-weight: 700; line-height: .9; letter-spacing: .01em; text-transform: uppercase; color: #fff;
  text-shadow: 0 0 22px rgba(255,90,31,.45), 4px 4px 0 var(--blue); text-wrap: balance; }
.sky .lede { color: var(--sky-muted); line-height: 1.5; text-shadow: 0 2px 10px rgba(0,0,0,.8); }
.sky .muted { color: var(--sky-muted); } .sky .faint { color: var(--sky-faint); }
.sky .panel { background: rgba(0,12,36,.72); border: 1px solid var(--sky-line); backdrop-filter: blur(6px); box-shadow: 0 18px 50px rgba(0,0,0,.5); padding: 18px 20px; }
.sky .num { font-family: var(--head); font-weight: 700; font-variant-numeric: tabular-nums; }
.sky .btn { font-family: var(--head); font-size: .8rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; padding: 14px 24px; border: 0; cursor: pointer;
  background: var(--gold); color: var(--navy); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.sky .btn:hover { background: #ffc35a; }
.sky .btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); }
.sky .btn-ghost:hover { background: rgba(255,255,255,.08); }
.sky .btn-block { width: 100%; }
.sky .btn:disabled { opacity: .5; cursor: default; }
.sky .input { width: 100%; padding: 14px 16px; background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.3); color: #fff; font-family: var(--mono); font-size: 1.1rem; letter-spacing: .2em; text-transform: uppercase; text-align: center; outline: none; }
.sky .input:focus { border-color: var(--gold); }

/* ═══════════════════════ PAPER ═══════════════════════ */
body.paper { font-family: var(--mono); color: var(--ink); background: var(--paper); }
.paper .eyebrow { font: 700 .72rem var(--mono); letter-spacing: .28em; text-transform: uppercase; color: var(--ink-2); }
.paper .h1 { font-family: var(--head); font-weight: 700; font-size: clamp(1.7rem, 5vw, 2.6rem); line-height: 1; text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }
.paper .h2 { font: 700 1rem var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.paper .lead { font-size: 1.02rem; line-height: 1.5; margin: 10px 0 14px; }
.paper .label { font: 700 .66rem var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.paper .muted { color: var(--ink-2); } .paper .faint { color: #8a8a8a; }
.paper .num { font-family: var(--head); font-weight: 700; font-variant-numeric: tabular-nums; }
.paper .btn { font: 700 .82rem var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 11px 16px; cursor: pointer; text-decoration: none;
  background: var(--grey); color: var(--ink); border: var(--bevel); border-color: var(--bevel-color); box-shadow: 1px 1px 0 #000; border-radius: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; user-select: none; }
.paper .btn:hover { background: var(--yellow); }
.paper .btn:active { border-color: #6d6d6d #fff #fff #6d6d6d; box-shadow: none; transform: translate(1px, 1px); }
.paper .btn:disabled, .paper .btn[aria-disabled="true"] { opacity: .45; cursor: default; transform: none; }
.paper .btn-primary { background: var(--ink); color: #fff; border-color: #555 #000 #000 #555; }
.paper .btn-primary:hover { background: var(--orange-ink); }
.paper .btn-gold { background: var(--gold); }
.paper .btn-gold:hover { background: var(--yellow); }
.paper .btn-danger { background: #ffd9d2; }
.paper .btn-danger:hover { background: #ff9d8a; }
.paper .btn-good { background: #d8f3e1; }
.paper .btn-ghost { background: #fff; }
.paper .btn-sm { padding: 6px 10px; font-size: .7rem; }
.paper .btn-lg { padding: 16px 22px; font-size: .95rem; }
.paper .btn-block { width: 100%; }
.kbd { display: inline-block; min-width: 1.6em; padding: 0 5px; border: 1px solid var(--ink); background: #fff; box-shadow: 1px 1px 0 #000; font: 700 .68rem/1.5 var(--mono); text-transform: none; letter-spacing: 0; }
.paper .input, .paper .textarea, .paper .select { width: 100%; padding: 10px 12px; border: 2px solid var(--ink); background: #fff; border-radius: 0; outline: none; font-family: var(--mono); }
.paper .input:focus, .paper .textarea:focus, .paper .select:focus { background: #fffbe0; box-shadow: 2px 2px 0 #000; }
.paper .textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.paper .select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, #111 50%), linear-gradient(135deg, #111 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.field { display: grid; gap: 5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: grid; gap: 12px; }
.paper .panel { border: 2px solid var(--ink); background: #fff; padding: 14px 16px; box-shadow: 4px 4px 0 #000; }
.paper .panel-tight { padding: 10px 12px; box-shadow: 2px 2px 0 #000; }
.paper .panel > .label:first-child { margin: -14px -16px 12px; padding: 5px 12px; background: var(--ink); color: #fff; }
.paper .hr { height: 2px; background: var(--ink); border: 0; margin: 14px 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid currentColor; font: 700 .62rem var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.pill.on { color: var(--good); } .pill.warn { color: var(--orange-ink); } .pill.bad { color: var(--bad); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live .dot { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 500; padding: 12px 18px; background: #fff; color: var(--ink); border: 2px solid var(--ink); box-shadow: 4px 4px 0 #000; max-width: min(92vw, 520px); font-family: var(--mono); }
.toast.bad { background: #ffd9d2; } .toast.good { background: #d8f3e1; }
.sky .toast { background: rgba(0,12,36,.92); color: #fff; border-color: rgba(255,255,255,.3); box-shadow: 0 12px 40px rgba(0,0,0,.6); }

/* ---- lists / items (paper) ---- */
.list { display: grid; gap: 8px; }
.item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 2px solid var(--ink); background: #fff; }
.item.on { background: #fff6bf; box-shadow: 3px 3px 0 #000; }
.item .t { line-height: 1.35; }
.item .s { color: var(--ink-2); font-size: .74rem; margin-top: 3px; letter-spacing: .04em; }
button.item { width: 100%; text-align: left; cursor: pointer; }
button.item:hover { background: var(--yellow); }

/* ---- the phone's answer buttons ---- */
.options { display: grid; gap: 10px; }
.opt-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border: 2px solid var(--ink); background: #fff; box-shadow: 4px 4px 0 #000; cursor: pointer; transition: transform .08s; border-radius: 0; }
.opt-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }
.opt-btn .key { flex: 0 0 36px; height: 36px; display: grid; place-items: center; border: 2px solid var(--ink); font-family: var(--head); font-weight: 700; font-size: 1rem; background: #fff; }
.opt-btn .txt { font-size: 1rem; line-height: 1.35; }
.opt-btn.on { background: var(--yellow); }
.opt-btn.on .key { background: var(--ink); color: #fff; }
.opt-btn.unsure { border-style: dashed; box-shadow: none; }
.opt-btn:disabled { opacity: .55; cursor: default; }
.locked-note { margin-top: 12px; padding: 8px 10px; border: 2px dashed var(--ink); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.wait { text-align: center; padding: 34px 10px; }
.wait-dots { display: inline-flex; gap: 8px; margin-bottom: 12px; }
.wait-dots i { width: 10px; height: 10px; background: currentColor; animation: blink 1.2s infinite; }
.wait-dots i:nth-child(2) { animation-delay: .2s; } .wait-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .2; } 50% { opacity: 1; } }
.locked { text-align: center; padding: 30px 10px; }
.locked .tick { width: 64px; height: 64px; margin: 0 auto 12px; display: grid; place-items: center; border: 2px solid var(--ink); font-size: 2rem; background: var(--yellow); box-shadow: 4px 4px 0 #000; }
.selected-card { border: 2px solid var(--ink); background: #fff6bf; padding: 16px; box-shadow: 4px 4px 0 #000; }
.slider { text-align: center; margin: 18px 0; }
.slider-val { font-size: 4rem; line-height: 1; margin-bottom: 10px; }
.slider input[type=range] { width: 100%; accent-color: var(--orange); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; margin-top: 10px; }
.stat-row > div { border: 2px solid var(--ink); padding: 10px 6px; }

/* ---- timer ---- */
.timer { margin: 10px 0 14px; }
.countdown { font-family: var(--head); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 2.2rem; line-height: 1; letter-spacing: .04em; }
.timer.low .countdown { color: var(--orange-ink); animation: pulse 1s infinite; }
.progress { height: 10px; border: 2px solid var(--ink); background: #fff; overflow: hidden; margin-top: 6px; }
.progress > i { display: block; height: 100%; background: var(--orange); transition: width .5s linear; }
.sky .progress { border-color: rgba(255,255,255,.4); background: rgba(0,0,0,.3); }
.sky .progress > i { background: linear-gradient(90deg, var(--orange), var(--gold)); }
.sky .countdown { font-size: clamp(3rem, 9vw, 7rem); text-shadow: 3px 3px 0 var(--blue); }

/* ---- result bars (shared) ---- */
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: end; }
.bar .opt { font: 700 .92rem var(--mono); text-transform: uppercase; letter-spacing: .04em; display: flex; gap: 8px; align-items: center; }
.bar .opt .key { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border: 2px solid currentColor; font-family: var(--head); font-size: .85rem; }
.bar .pct { font-family: var(--head); font-weight: 700; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.bar .n { font: .78rem var(--mono); margin-left: 8px; color: var(--ink-2); }
.bar .track { grid-column: 1 / -1; height: 16px; border: 2px solid var(--ink); background: #fff; overflow: hidden; }
.bar .track > i { display: block; height: 100%; width: 0; background: var(--orange); transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.bar.win .track > i { background: var(--gold); }
.bar.unsure .track > i { background: #bdbdbd; }
.sky .bar .opt { font-family: var(--head); font-size: clamp(1.1rem, 2.6vw, 2rem); font-weight: 600; }
.sky .bar .opt .key { min-width: 1.5em; height: 1.5em; font-size: .8em; border-color: var(--gold); color: var(--gold); }
.sky .bar .pct { font-size: clamp(1.4rem, 3.4vw, 2.8rem); }
.sky .bar .n { color: var(--sky-muted); font-size: 1rem; }
.sky .bar .track { height: clamp(18px, 3vw, 34px); border-color: rgba(255,255,255,.55); background: rgba(0,0,0,.35); }
.sky .bar .track > i { background: linear-gradient(90deg, var(--orange), #ff8a3d); box-shadow: 0 0 18px rgba(250,70,22,.6); }
.sky .bar.win .track > i { background: linear-gradient(90deg, var(--gold), #ffd77a); box-shadow: 0 0 22px rgba(240,168,48,.7); }

/* ---- before / after ---- */
.shift { display: grid; gap: 6px; }
.shift-head, .shift-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 8px; align-items: center; }
.shift-head { font: 700 .66rem var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); border-bottom: 2px solid var(--ink); padding-bottom: 4px; }
.shift-row { padding: 6px 0; border-bottom: 1px dashed #999; }
.shift-row .num { font-size: 1.1rem; }
.shift .up { color: var(--good); } .shift .down { color: var(--bad); }
.sky .shift-head { color: var(--gold); border-color: rgba(255,255,255,.4); }
.sky .shift-row { border-color: rgba(255,255,255,.2); font-size: clamp(1rem, 2.4vw, 1.8rem); }
.sky .shift-row .num { font-size: clamp(1.3rem, 3vw, 2.6rem); }
.sky .shift .up { color: #7dffb0; } .sky .shift .down { color: #ff9d8a; }

/* ---- leaderboard ---- */
.lb { display: grid; gap: 6px; }
.lb-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 2px solid var(--ink); }
.lb-row.me { background: var(--yellow); }
.lb-no { font-size: 1.2rem; }
.lb-xp { font-size: 1.1rem; }
.sky .lb-row { border-color: rgba(255,255,255,.3); background: rgba(0,12,36,.55); font-size: clamp(1rem, 2.4vw, 1.9rem); padding: 10px 18px; grid-template-columns: 70px 1fr auto; }
.sky .lb-row:nth-child(1) { border-color: var(--gold); box-shadow: 0 0 24px rgba(240,168,48,.35); }
.sky .lb-no { color: var(--gold); font-size: clamp(1.4rem, 3vw, 2.6rem); }
.sky .lb-xp { font-size: clamp(1.2rem, 2.8vw, 2.2rem); }

/* ---- projector ---- */
.pj-stage { position: relative; z-index: 2; min-height: 100vh; display: grid; place-items: center; padding: 4vh 5vw; }
.pj-inner { width: min(92vw, 1500px); }
.pj-kicker { font-family: var(--head); letter-spacing: .32em; text-transform: uppercase; color: var(--gold); font-size: clamp(.9rem, 1.7vw, 1.5rem); margin-bottom: 1.2vh; }
.pj-head { font-size: clamp(2.2rem, 6.4vw, 6.4rem); margin-bottom: 2.4vh; }
.pj-sub { font-size: clamp(1.1rem, 2.4vw, 2rem); color: var(--sky-muted); max-width: 60ch; }
.pj-body { font-size: clamp(1rem, 2vw, 1.7rem); color: #fff; max-width: 60ch; line-height: 1.45; margin-top: 1.5vh; }
.pj-opts { display: grid; gap: 1.4vh; max-width: 1100px; }
.pj-opt { display: flex; align-items: center; gap: 1.6vw; font-family: var(--head); font-size: clamp(1.3rem, 3.2vw, 3rem); font-weight: 600; padding: 1.2vh 1.6vw; border: 2px solid rgba(255,255,255,.55); background: rgba(0,12,36,.55); }
.pj-opt .key { display: grid; place-items: center; min-width: 1.8em; height: 1.8em; border: 2px solid var(--gold); color: var(--gold); font-size: .8em; }
.pj-opt.faint { opacity: .55; border-style: dashed; }
.pj-foot { margin-top: 3vh; font-family: var(--head); font-size: clamp(1rem, 2.2vw, 2rem); letter-spacing: .08em; text-transform: uppercase; color: var(--sky-muted); display: flex; align-items: center; gap: 1.4vw; flex-wrap: wrap; }
.big-num { font-size: clamp(2.4rem, 6vw, 6rem); color: #fff; text-shadow: 3px 3px 0 var(--blue); line-height: 1; }
.pj-foot .gold { color: var(--gold); }
.pj-img { max-height: 40vh; margin-bottom: 2vh; border: 2px solid rgba(255,255,255,.4); }
.pj-quote { font-family: var(--head); font-weight: 600; font-size: clamp(1.8rem, 4.6vw, 4.6rem); line-height: 1.12; max-width: 24ch; text-shadow: 3px 3px 0 var(--blue); }
.pj-author { color: var(--gold); }
.ranks { display: grid; gap: 1.6vh; max-width: 1200px; }
.rank { display: grid; grid-template-columns: auto 1fr; gap: 1vh 2vw; align-items: center; padding: 1.6vh 2vw; border: 2px solid rgba(255,255,255,.5); background: rgba(0,12,36,.6); }
.rank[data-rank="1"] { border-color: var(--gold); box-shadow: 0 0 40px rgba(240,168,48,.35); }
.rank-no { font-family: var(--head); font-weight: 700; font-size: clamp(2rem, 5vw, 5rem); color: var(--gold); text-shadow: 3px 3px 0 var(--blue); grid-row: span 2; }
.rank-text { font-family: var(--head); font-size: clamp(1.2rem, 2.8vw, 2.6rem); font-weight: 600; line-height: 1.15; }
.rank-meta { color: var(--sky-muted); font-size: clamp(.9rem, 1.6vw, 1.3rem); letter-spacing: .08em; text-transform: uppercase; }
.rank.ghost { opacity: .35; border-style: dashed; }
.hist { display: grid; grid-template-columns: repeat(10, 1fr); gap: .6vw; height: 34vh; align-items: end; max-width: 1100px; }
.hist-col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.hist-col i { display: block; background: linear-gradient(180deg, var(--gold), var(--orange)); border: 2px solid rgba(255,255,255,.5); min-height: 3px; transition: height 1s cubic-bezier(.2,.8,.2,1); }
.hist-col span { font-family: var(--head); color: var(--sky-muted); font-size: clamp(.8rem, 1.4vw, 1.2rem); margin-top: 6px; text-align: center; }
.cloud { display: flex; flex-wrap: wrap; gap: 1vw 2vw; align-items: baseline; justify-content: center; max-width: 1200px; font-family: var(--head); font-weight: 600; text-transform: uppercase; }
.cloud span { text-shadow: 2px 2px 0 var(--blue); }
.qr { background: #fff; padding: 14px; display: inline-block; border: 4px solid #fff; box-shadow: 0 0 40px rgba(0,0,0,.6); }
.pj-code { font-family: var(--head); font-weight: 700; font-size: clamp(3rem, 9vw, 9rem); letter-spacing: .18em; color: #fff; text-shadow: 0 0 22px rgba(255,90,31,.45), 5px 5px 0 var(--blue); line-height: 1; }
.pj-lobby { display: grid; grid-template-columns: 1fr auto; gap: 4vw; align-items: center; }
@media (max-width: 900px) { .pj-lobby { grid-template-columns: 1fr; } }

/* ---- layout ---- */
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 18px; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.fade-in { animation: fadeIn .3s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* riseUp, not rise: `rise` is now one of the transition kinds a theme can name
   in --tr-kind, and @keyframes are global, so the two cannot share a name. The
   .rise CLASS is unchanged; only what it plays is renamed. */
.rise { animation: riseUp .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes riseUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
.ticker { overflow: hidden; white-space: nowrap; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 6px 0; font: 700 .72rem var(--mono); letter-spacing: .2em; text-transform: uppercase; }
.ticker > span { display: inline-block; padding-left: 100%; animation: ticker 18s linear infinite; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* ---- the paper masthead (phone + admin) ---- */
.mast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 2px solid var(--ink); }
.mast .brand { font: 700 .85rem var(--mono); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.mast .brand img { height: 26px; }
.mast .brand .live { color: var(--orange-ink); }

/* The handset's own diagnosis. Small, quiet, and readable across a dark room
   when an officer asks someone to read out what their phone says. */
.standby .diag {
  margin: 12px auto 0;
  max-width: 34ch;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .74rem;
  line-height: 1.5;
  letter-spacing: .01em;
  color: var(--muted, #8b93a7);
  opacity: .85;
  word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════════════════════
   THE DESK, RESPONDING
   Paired with live/assets/admin-ui.js. Everything here is about the first
   hundred milliseconds after a press, because that is where the officer pages
   felt broken — not in how long the work took, but in how long they said
   nothing about it. No easing on anything that acknowledges input: a press
   should land, not animate.
   ═══════════════════════════════════════════════════════════════════════════ */

/* the rule across the top — a chunky segmented block, not a hairline */
.admin-bar {
  position: fixed; inset: 0 0 auto 0; height: 5px; z-index: 900;
  background: repeating-linear-gradient(90deg, var(--ink, #111) 0 6px, transparent 6px 10px);
  background-size: 10px 100%;
  opacity: 0; pointer-events: none;
  clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0);
}
.admin-bar.on { opacity: 1; }
.admin-bar i { display: none; }

/* a button that is working. The bevel stays pressed in, because it is. */
.paper .btn[data-busy="1"],
.paper button[data-busy="1"] {
  opacity: 1; cursor: progress;
  border-color: #6d6d6d #fff #fff #6d6d6d;
  box-shadow: none; transform: translate(1px, 1px);
  background: var(--yellow, #ffe680);
}
.admin-spin { display: inline-block; width: 1ch; font-family: var(--mono, monospace); font-weight: 700; }

/* the press acknowledgement, applied on pointerdown before any handler runs */
.paper .admin-press {
  border-color: #6d6d6d #fff #fff #6d6d6d !important;
  box-shadow: none !important; transform: translate(1px, 1px) !important;
  background: var(--yellow, #ffe680);
}
.sky .admin-press { transform: translate(2px, 2px); box-shadow: none !important; }

/* work that finished before anyone could see it happen */
@keyframes adminFlashOk  { 0% { background: var(--good-bg, #d8f3e1); } 100% { background: inherit; } }
@keyframes adminFlashBad { 0% { background: #ff9d8a; } 100% { background: inherit; } }
.admin-flash-ok  { animation: adminFlashOk .6s steps(6) 1; }
.admin-flash-bad { animation: adminFlashBad .6s steps(6) 1; }

@media (prefers-reduced-motion: reduce) {
  .admin-flash-ok, .admin-flash-bad { animation: none; }
  .admin-bar { transition: none; }
}

/* ═══ THE FOUR CORNERS QUESTION BUILDER ═══
   Four answers, one of them right, and what the question is worth. It was a
   textarea of pipe-separated lines, which is a data format wearing a form. */
.paper .cq-box { display: flex; flex-direction: column; gap: 10px; }
.paper .cq {
  border: 2px solid var(--ink); background: var(--paper);
  padding: 10px 11px; display: flex; flex-direction: column; gap: 8px;
}
.paper .cq-head { display: flex; align-items: center; gap: 6px; }
.paper .cq-no { font: 700 .72rem var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.paper .cq-head .grow { flex: 1 1 auto; }
.paper .cq-text { font-weight: 700; }
.paper .cq-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.paper .cq-ans { display: flex; align-items: center; gap: 6px; }
.paper .cq-ans .cq-key {
  flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center;
  font: 700 .8rem var(--head); border: 2px solid var(--ink); background: var(--yellow);
}
.paper .cq-ans .input { flex: 1 1 auto; min-width: 0; }
.paper .cq-foot { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.paper .cq-pick { display: flex; flex-direction: column; gap: 3px; }
.paper .cq-pick .select { min-width: 84px; }
.paper .cq-foot .grow { flex: 1 1 200px; min-width: 0; }
@media (max-width: 640px) { .paper .cq-answers { grid-template-columns: 1fr; } }
