:root {
  --display: 'Lilita One', 'Arial Black', Impact, sans-serif;
  --ui: 'Nunito', ui-rounded, -apple-system, 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ground: #f4ead2; --paper: #fdf7e8; --paper-2: #ecdfc0; --sand: #e9d8a6;
  --ink: #232a4a; --dim: #6b6a78; --edge: #232a4a;
  --green: #3f8a37; --green-2: #2f6e2a; --gold: #e8b52a; --gold-2: #b8860b; --red: #c8402a;
  --shadow: 0 4px 0 rgba(35,42,74,.35);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ground); }
html, body { margin: 0; color: var(--ink); font: 600 15px/1.35 var(--ui); -webkit-text-size-adjust: 100%; }
body { max-width: 880px; margin: 0 auto; padding: 10px 10px calc(28px + env(safe-area-inset-bottom)); }

header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 6px 2px 10px; flex-wrap: wrap; }
h1 { font: 400 clamp(34px, 7vw, 46px)/.95 var(--display); letter-spacing: .02em; margin: 0; color: var(--ink);
  text-shadow: 2px 2px 0 var(--gold); }
.where { font: 800 12px/1.2 var(--ui); text-transform: uppercase; letter-spacing: .12em; color: var(--dim); margin-top: 6px; }
.where b { color: var(--ink); }
.progress { font: 400 16px var(--display); color: var(--gold-2); letter-spacing: .04em; }

button, input, select { font: 800 15px var(--ui); color: var(--ink); background: var(--paper); border: 2.5px solid var(--edge); border-radius: 10px; padding: 8px 14px; }
button { cursor: pointer; min-height: 44px; box-shadow: var(--shadow); transition: transform .08s; }
button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(35,42,74,.35); }
button.on { background: var(--ink); color: var(--paper); }
button.ghost { box-shadow: none; background: transparent; min-height: 34px; padding: 4px 10px; font-size: 13px; }
button.go { background: var(--green); color: #fff; border-color: var(--green-2); box-shadow: 0 4px 0 var(--green-2); font: 400 20px var(--display); letter-spacing: .04em; padding: 8px 26px; }
button.go.pause { background: var(--paper); color: var(--ink); border-color: var(--edge); box-shadow: var(--shadow); }

section { margin: 8px 0; }
.status { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.tray { display: flex; align-items: center; gap: 10px; margin: 8px 2px 0; }
.tray .label { font: 800 11px var(--ui); text-transform: uppercase; letter-spacing: .12em; color: var(--dim); }
.coins { flex: 1 1 0; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; min-height: 24px; }
.coins i { width: 20px; height: 20px; border-radius: 50%; background: var(--gold); box-shadow: inset 0 -3px 0 var(--gold-2); border: 2.5px solid var(--edge); }
.coins i.on { background: var(--green); box-shadow: inset 0 -3px 0 var(--green-2); }
.coins i.lost { background: transparent; box-shadow: none; border-style: dashed; opacity: .55; }
.clock { font: 400 20px var(--display); min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }

.arena { position: relative; border: 3px solid var(--edge); border-radius: 12px; overflow: hidden; background: #5c9a3c; line-height: 0; box-shadow: 0 6px 0 rgba(35,42,74,.35); }
canvas { width: 100%; display: block; touch-action: none; }
.arena .fx { position: absolute; left: 0; top: 0; pointer-events: none; }
.toast { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 7px 12px; border-radius: 9px; font: 800 13px var(--ui); line-height: 1.2; pointer-events: none; }

.result { border: 3px solid var(--edge); background: var(--paper); padding: 12px 16px; font: 400 clamp(18px, 3.5vw, 24px)/1.15 var(--display); letter-spacing: .02em; margin: 10px 0; border-radius: 12px; box-shadow: var(--shadow); text-align: center; }
.result.win { background: var(--gold); }
.result.lose { background: #f3d6cd; }

.roster { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; }
.roster button { padding: 0; min-height: 0; display: flex; flex-direction: column; align-items: stretch; border-radius: 12px; overflow: visible; position: relative; background: var(--paper); }
.roster .face { height: 84px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; border-radius: 9px 9px 0 0; background: var(--sand); }
.roster .face img { height: 80px; width: auto; transform: translateY(4px); transition: transform .12s; }
.roster button.on .face img { transform: translateY(2px) scale(1.06); }
.roster .label { font: 400 14px var(--display); letter-spacing: .06em; text-transform: uppercase; padding: 6px 4px 7px; text-align: center; border-top: 2.5px solid var(--edge); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.35); border-radius: 0 0 9px 9px; }
.roster .cost { position: absolute; top: -9px; right: -4px; display: flex; gap: 2px; }
.roster .help { position: absolute; top: -10px; left: -6px; width: 26px; height: 26px; min-height: 0; padding: 0; border-radius: 50%; font: 400 15px/22px var(--display); background: var(--paper); box-shadow: 0 2px 0 rgba(35,42,74,.35); z-index: 2; }
.roster .cost i { width: 18px; height: 18px; border-radius: 50%; background: var(--gold); box-shadow: inset 0 -3px 0 var(--gold-2); border: 2.5px solid var(--edge); }
.roster button.on { box-shadow: 0 0 0 3px var(--green), var(--shadow); border-color: var(--green-2); }
.roster button:disabled { opacity: .4; }
.hint { margin: 6px 2px; color: var(--dim); font-size: 13px; }

.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.controls .seg { display: inline-flex; }
.controls .seg button { border-radius: 0; margin-left: -2.5px; min-width: 52px; font: 400 16px var(--display); }
.controls .seg button:first-child { border-radius: 10px 0 0 10px; margin-left: 0; } .controls .seg button:last-child { border-radius: 0 10px 10px 0; }

.debug { border: 2px dashed var(--paper-2); background: transparent; border-radius: 10px; padding: 6px 10px; margin-top: 16px; font-size: 13px; }
.debug summary { cursor: pointer; color: var(--dim); }
.debug .row { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0; align-items: center; }
.debug input { padding: 4px 6px; }
.debug button { min-height: 34px; padding: 4px 10px; font-size: 13px; box-shadow: none; }
.live { font: 11.5px/1.35 var(--mono); background: var(--paper); padding: 8px; margin: 6px 0 0; overflow-x: auto; white-space: pre; border-radius: 6px; }

@media (max-width: 560px) {
  .roster { gap: 6px; }
  .roster .face { height: 64px; } .roster .face img { height: 60px; }
  .roster .label { font-size: 12px; }
  h1 { text-shadow: 1.5px 1.5px 0 var(--gold); }
}

/* win moment */
.arena.flash::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255,235,140,.95), rgba(255,215,60,.6) 40%, rgba(255,215,60,0) 75%); animation: flash 1.1s ease-out forwards; pointer-events: none; }
@keyframes flash { 0% { opacity: 0 } 15% { opacity: 1 } 100% { opacity: 0 } }
.summary { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; background: rgba(35,42,74,.55); padding: 16px; }
.summary .card { position: relative; width: min(520px, 100%); background: var(--paper); border: 3px solid var(--edge); border-radius: 18px; padding: 110px 20px 18px; text-align: center; box-shadow: 0 10px 0 rgba(35,42,74,.35); animation: card-in .45s cubic-bezier(.2,.9,.3,1.3); }
@keyframes card-in { from { transform: translateY(40px) scale(.9); opacity: 0 } }
.summary .hero { position: absolute; left: 50%; top: -70px; transform: translateX(-50%); width: 180px; height: 180px; }
.summary .hero img { position: relative; z-index: 2; height: 180px; width: auto; display: block; margin: 0 auto; animation: hero-pop .6s cubic-bezier(.2,.9,.3,1.4); transform-origin: 50% 100%; }
@keyframes hero-pop { from { transform: scale(.4) } }
.summary .hero .burst { position: absolute; inset: 10px; border-radius: 50%; background: radial-gradient(circle, var(--gold) 0, rgba(232,181,42,.5) 45%, rgba(232,181,42,0) 70%); animation: burst 1.2s ease-out infinite alternate; }
@keyframes burst { from { transform: scale(.85) } to { transform: scale(1.1) } }
.summary h2 { font: 400 clamp(30px, 8vw, 44px)/1 var(--display); margin: 0; color: var(--ink); text-shadow: 2px 2px 0 var(--gold); letter-spacing: .03em; }
.summary .sub { font: 800 12px var(--ui); text-transform: uppercase; letter-spacing: .12em; color: var(--dim); margin: 6px 0 14px; }
.summary .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.summary .stats div { background: var(--sand); border-radius: 10px; padding: 8px 4px; display: flex; flex-direction: column; }
.summary .stats b { font: 400 24px/1 var(--display); font-variant-numeric: tabular-nums; }
.summary .stats span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin-top: 3px; }
.summary .squad { display: flex; justify-content: center; gap: 10px; margin: 14px 0 16px; flex-wrap: wrap; }
.summary .squad div { display: flex; flex-direction: column; align-items: center; width: 64px; }
.summary .squad img { height: 54px; width: auto; }
.summary .squad b { font: 400 16px var(--display); }
.summary .squad small { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.summary .squad .lost { color: var(--red); }
.summary .actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* world illustration behind the page, softened so the board stays readable */
body { --bg: none; }
body { background: transparent; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; background: linear-gradient(rgba(244,234,210,.55), rgba(244,234,210,.55)), var(--bg) center / cover no-repeat; }
/* chapter title card */
.title { position: fixed; inset: 0; z-index: 950; background: #232a4a center / cover no-repeat; display: grid; place-items: center; cursor: pointer; animation: fade-in .6s ease-out; }
.title.out { animation: fade-out .5s ease-in forwards; }
.title.dim .words { opacity: 0; transition: opacity .4s; }
.title.dim .veil { background: rgba(35,42,74,.35); transition: background .4s; }
@keyframes fade-in { from { opacity: 0 } } @keyframes fade-out { to { opacity: 0 } }
.title .veil { position: absolute; inset: 0; background: linear-gradient(to top, rgba(35,42,74,.75), rgba(35,42,74,0) 55%); }
.title .words { position: relative; text-align: center; color: #fff; padding: 20px; animation: card-in .7s cubic-bezier(.2,.9,.3,1.2); }
.title .chapter { font: 800 14px var(--ui); letter-spacing: .2em; text-transform: uppercase; opacity: .85; }
.title h2 { font: 400 clamp(44px, 10vw, 96px)/1 var(--display); margin: 8px 0; text-shadow: 3px 3px 0 var(--ink), 0 10px 30px rgba(0,0,0,.4); letter-spacing: .02em; }
.title .season { font: 800 16px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.title .tap { margin-top: 40px; font: 800 12px var(--ui); letter-spacing: .14em; text-transform: uppercase; opacity: .7; animation: dlg-bob 1.2s infinite; }

/* ---------- front door ---------- */
.screen { position: fixed; inset: 0; z-index: 940; background: var(--ink) center / cover no-repeat; overflow: auto; }
.title-screen { display: grid; place-items: center; }
.title-screen .veil { position: absolute; inset: 0; background: linear-gradient(to top, rgba(35,42,74,.85), rgba(35,42,74,.15) 60%); }
.title-screen .words { position: relative; text-align: center; color: #fff; padding: 20px; animation: card-in .7s cubic-bezier(.2,.9,.3,1.2); }
.mark-big { font: 400 clamp(56px, 13vw, 128px)/.95 var(--display); margin: 0; letter-spacing: .02em; color: #fff; text-shadow: 4px 4px 0 var(--ink), 0 14px 40px rgba(0,0,0,.45); }
.title-screen .tag { font: 800 14px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 10px 0 26px; }
.title-screen .actions { display: flex; gap: 10px; justify-content: center; }
.title-screen .actions .go { font-size: 26px; padding: 10px 40px; }
.title-screen .peek { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
/* a pop is a clipped box pinned to one edge; the portrait moves inside it, so only head and shoulders ever show */
.title-screen .pop { position: absolute; overflow: hidden; --h: min(30vh, 240px); }
.title-screen .pop img { position: absolute; height: var(--h); width: auto; left: 50%; top: 50%; }
.title-screen .pop.bottom, .title-screen .pop.top { width: calc(var(--h) * .9); height: var(--h); }
.title-screen .pop.left, .title-screen .pop.right { width: var(--h); height: calc(var(--h) * .9); }
.title-screen .pop.bottom { bottom: 0; } .title-screen .pop.top { top: 0; } .title-screen .pop.left { left: 0; } .title-screen .pop.right { right: 0; }
.title-screen .pop img { transform: translate(-50%, -50%); }
.title-screen .pop.bottom img { animation: pop-b 2.8s ease-in-out forwards; }
.title-screen .pop.top img { animation: pop-t 2.8s ease-in-out forwards; }
.title-screen .pop.left img { animation: pop-l 2.8s ease-in-out forwards; }
.title-screen .pop.right img { animation: pop-r 2.8s ease-in-out forwards; }
@keyframes pop-b { 0% { transform: translate(-50%, 60%) scale(1) } 25% { transform: translate(-50%, 0%) scale(1) } 50% { transform: translate(-50%, -3%) scale(1.1) } 72% { transform: translate(-50%, 0%) scale(1.04) } 100% { transform: translate(-50%, 60%) scale(1) } }
@keyframes pop-t { 0% { transform: translate(-50%, -160%) rotate(180deg) scale(1) } 25% { transform: translate(-50%, -100%) rotate(180deg) scale(1) } 50% { transform: translate(-50%, -97%) rotate(180deg) scale(1.1) } 72% { transform: translate(-50%, -100%) rotate(180deg) scale(1.04) } 100% { transform: translate(-50%, -160%) rotate(180deg) scale(1) } }
@keyframes pop-l { 0% { transform: translate(-50%, -50%) rotate(90deg) translateY(110%) scale(1) } 25% { transform: translate(-50%, -50%) rotate(90deg) translateY(50%) scale(1) } 50% { transform: translate(-50%, -50%) rotate(90deg) translateY(47%) scale(1.1) } 72% { transform: translate(-50%, -50%) rotate(90deg) translateY(50%) scale(1.04) } 100% { transform: translate(-50%, -50%) rotate(90deg) translateY(110%) scale(1) } }
@keyframes pop-r { 0% { transform: translate(-50%, -50%) rotate(-90deg) translateY(110%) scale(1) } 25% { transform: translate(-50%, -50%) rotate(-90deg) translateY(50%) scale(1) } 50% { transform: translate(-50%, -50%) rotate(-90deg) translateY(47%) scale(1.1) } 72% { transform: translate(-50%, -50%) rotate(-90deg) translateY(50%) scale(1.04) } 100% { transform: translate(-50%, -50%) rotate(-90deg) translateY(110%) scale(1) } }
.title-screen .peek-old { position: absolute; bottom: -12px; right: 4vw; display: flex; gap: 0; align-items: flex-end; pointer-events: none; }
.title-screen .peek img { height: min(28vh, 220px); width: auto; margin: 0 -18px; animation: peek .9s cubic-bezier(.2,.9,.3,1.3) both; }
.title-screen .peek img:nth-child(2) { height: min(34vh, 260px); animation-delay: .12s; z-index: 1; }
.title-screen .peek img:nth-child(3) { animation-delay: .24s; }
@keyframes peek { from { transform: translateY(60%) } }
.levels-screen { background: var(--ground); }
.levels-screen .bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: rgba(244,234,210,.92); border-bottom: 2px solid var(--rule, #d8cfb6); }
.levels-screen h2 { font: 400 26px var(--display); margin: 0; }
.levels-screen .bar span { margin-left: auto; font: 400 15px var(--display); color: var(--gold-2); }
.chapters { max-width: 760px; margin: 0 auto; padding: 14px; display: grid; gap: 14px; }
.chapter { position: relative; border: 3px solid var(--edge); border-radius: 14px; overflow: hidden; background: var(--ink) center / cover no-repeat; color: #fff; aspect-ratio: 16 / 7; display: flex; align-items: flex-end; cursor: pointer; box-shadow: var(--shadow); }
.chapter .veil { position: absolute; inset: 0; background: linear-gradient(to top, rgba(35,42,74,.85), rgba(35,42,74,0) 60%); }
.chapter .words { position: relative; padding: 12px 16px; width: 100%; display: flex; align-items: flex-end; gap: 12px; }
.chapter .num { font: 800 12px var(--ui); letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.chapter h3 { font: 400 clamp(24px, 5vw, 34px)/1 var(--display); margin: 2px 0 0; text-shadow: 2px 2px 0 var(--ink); }
.chapter .season { font: 800 11px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.chapter .done { margin-left: auto; font: 400 20px var(--display); color: var(--gold); }
.chapter.locked { filter: grayscale(.8) brightness(.6); cursor: default; }
.chapter.locked .done { color: #fff; opacity: .8; font: 800 12px var(--ui); letter-spacing: .12em; text-transform: uppercase; }
.steps { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin: -4px 0 4px; }
.steps button { min-height: 44px; padding: 0; font: 400 16px var(--display); border-radius: 10px; }
.steps button.cleared { background: var(--gold); }
.steps button.next { background: var(--green); color: #fff; border-color: var(--green-2); box-shadow: 0 4px 0 var(--green-2); }
.steps button:disabled { opacity: .35; box-shadow: none; }
@media (max-width: 560px) { .steps { grid-template-columns: repeat(5, 1fr); } .chapter { aspect-ratio: 16 / 9; } }

/* ---------- play screen as a game screen ---------- */
body { padding: 0 0 calc(16px + env(safe-area-inset-bottom)); max-width: none; }
.stage { max-width: 880px; margin: 0 auto; padding: 8px 10px 0; display: flex; flex-direction: column; gap: 8px; }
.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 2px 2px; }
.hud .hud-btn { justify-self: start; }
.hud .clock { justify-self: end; }
.hud .where { font: 400 18px var(--display); letter-spacing: .03em; color: var(--ink); text-shadow: 1px 1px 0 rgba(255,255,255,.6); text-align: center; white-space: nowrap; }
.hud .where b { color: var(--gold-2); }
.hud .clock { min-width: 64px; text-align: right; font: 400 18px var(--display); color: var(--ink); white-space: nowrap; }
.hud-btn { min-height: 36px; padding: 4px 14px; font: 400 15px var(--display); letter-spacing: .04em; border-radius: 10px; }
header, .status, .progress { display: none; }
.roster { margin-top: 12px; }
.tray { margin: 0 2px; justify-content: center; }
.controls { justify-content: center; margin-top: 2px; }
.controls .ghost { text-decoration: none; opacity: 1; background: var(--paper); border: 2.5px solid var(--edge); box-shadow: var(--shadow); min-height: 44px; font-size: 15px; }
.debug { max-width: 880px; margin: 16px auto 0; }
@media (max-width: 560px) { .stage { padding: 6px 6px 0; } .hud .where { font-size: 15px; } }

/* ---------- portrait stage: phone = the screen; laptop = board left, rail right ---------- */
.stage { max-width: 1100px; }
.arena { width: fit-content; margin: 0 auto; }
@media (min-width: 900px) {
  .stage { display: grid; grid-template-columns: auto 320px; grid-template-rows: auto 1fr; grid-template-areas: "hud rail" "board rail"; column-gap: 20px; row-gap: 8px; align-items: start; justify-content: center; }
  .hud { grid-area: hud; width: 100%; }
  .arena { grid-area: board; margin: 0; }
  .rail { grid-area: rail; display: flex; flex-direction: column; gap: 12px; }
  .roster { grid-template-columns: repeat(2, 1fr); margin-top: 0; }
  .controls { flex-direction: column; align-items: stretch; }
  .controls .seg { justify-content: center; }
  .controls .go { font-size: 24px; }
}
@media (min-width: 900px) { .roster { row-gap: 10px; } .roster button .face { height: 72px; } .roster button .face img { height: 70px; } }

.levels-screen .qa { max-width: 760px; margin: 0 auto; padding: 4px 14px 40px; text-align: center; }

.summary .par { font: 400 16px var(--display); color: var(--dim); margin: -8px 0 10px; letter-spacing: .04em; }
.summary .par.good { color: var(--green); }
.summary.lose .card { padding-top: 90px; }
.summary.lose h2 { text-shadow: 2px 2px 0 var(--red); }
.summary.lose .hero .burst { background: radial-gradient(circle, rgba(200,64,42,.6) 0, rgba(200,64,42,.25) 45%, rgba(200,64,42,0) 70%); }
.summary .map { display: block; margin: 0 auto 10px; border: 2px solid var(--edge); border-radius: 8px; max-height: 260px; width: auto; }
.roster .label { display: flex; align-items: center; justify-content: center; gap: 4px; }
.roster .label .ic { width: 14px; height: 14px; opacity: .9; }
.roster .label span { margin-right: 2px; }

/* ---------- the rail: beside the board on a laptop, a pull-up sheet on a phone ---------- */
.rail .handle { display: none; }
@media (min-width: 900px) {
  .stage { max-width: none; padding: 8px 16px 0; }
}
@media (max-width: 899px) {
  .stage { padding-bottom: 120px; }
  .rail { position: fixed; left: 0; right: 0; bottom: 0; z-index: 800; background: var(--paper); border-top: 3px solid var(--edge); border-radius: 18px 18px 0 0;
    padding: 6px 12px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px;
    transform: translateY(calc(100% - 108px)); transition: transform .28s cubic-bezier(.2,.9,.3,1.1); box-shadow: 0 -8px 30px rgba(35,42,74,.25); max-height: 80vh; overflow: hidden; }
  .rail.open { transform: none; overflow: auto; }
  .rail .handle { display: block; all: unset; align-self: center; width: 56px; height: 22px; cursor: pointer; }
  .rail .handle i { display: block; width: 44px; height: 5px; margin: 8px auto; border-radius: 3px; background: var(--edge); opacity: .5; }
  .rail .controls { order: 1; }
  .rail .tray { order: 2; }
  .rail .roster { order: 3; margin-top: 4px; }
  .rail #result { order: 0; }
  .controls { flex-wrap: nowrap; }
  .controls .go { flex: 1; }
}

.chapter .feat { position: absolute; right: 14px; bottom: 0; height: 68%; width: auto; transform-origin: 50% 100%; animation: dlg-breathe 3.2s ease-in-out infinite; filter: drop-shadow(0 4px 0 rgba(0,0,0,.35)); }
.chapter .feat.hop { animation: dlg-hop .4s ease-out, dlg-breathe 3.2s ease-in-out .4s infinite; }
.chapter.locked .feat { display: none; }
.chapter .words { padding-right: 120px; }

/* ---------- the rail, in the order of play ---------- */
.rail { display: flex; flex-direction: column; gap: 12px; }
.rail .roster { margin-top: 0; }
.rail .tray { justify-content: flex-start; gap: 8px; margin: -2px 2px 0; }
.rail .tray .label { font: 800 11px var(--ui); text-transform: uppercase; letter-spacing: .12em; color: var(--dim); }
.rail .controls { margin: 0; }
.rail .controls .go { width: 100%; font-size: 24px; padding: 12px 20px; }
.rail .quiet { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rail .quiet .seg button { min-height: 34px; min-width: 44px; font: 400 14px var(--display); box-shadow: none; padding: 0 8px; }
.rail .quiet .ghost { min-height: 34px; padding: 4px 12px; font: 800 13px var(--ui); box-shadow: none; opacity: .85; }
/* card badges live inside the card */
.roster button { overflow: hidden; }
.roster .cost { top: 6px; right: 6px; }
.roster .cost i { width: 16px; height: 16px; border-width: 2px; }
.roster .help { top: 6px; left: 6px; width: 22px; height: 22px; font-size: 13px; line-height: 18px; box-shadow: none; opacity: .9; }
.roster button.on { box-shadow: 0 0 0 3px var(--green), var(--shadow); }
@media (max-width: 899px) {
  .rail .controls { order: 1; } .rail .tray { order: 2; } .rail .roster { order: 3; } .rail .quiet { order: 4; } .rail #result { order: 0; }
}
