/* Quarter Circle - an arcade cabinet: the instruction card by day (warm card stock, red and teal ink), the cabinet
 * at night (deep violet, neon coral and cyan). Frame meters use green (startup), red (active) and blue (recovery). */
:root {
  --bg: #f3eee3; --panel: #fffaf1; --panel2: #f7f0e2; --ink: #1d1a2b; --muted: #635b6e; --line: #d8cdb8;
  --hot: #c63a24; --hot-ink: #ffffff; --cool: #0d7179; --gold: #7a5300; --gold-bg: #fbecc4;
  --fs: #2b8a46; --fa: #c63a24; --fr: #2c63c4; --bed: #e9e1d1;
  --ok: #1f7a3c; --ok-bg: #e2f3e6; --warn: #a33a13; --warn-bg: #fde6dc; --info: #3d4f8f; --info-bg: #e6eaf8;
  --nerf: #a8261a; --nerf-bg: #fde2dd; --buff: #136b45; --buff-bg: #dcf3e7; --keep: #4a4560; --keep-bg: #ebe8f2;
  --shadow: 0 2px 0 rgba(29, 26, 43, .12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0d1a; --panel: #1a1730; --panel2: #221e3d; --ink: #efeaf7; --muted: #aaa3c2; --line: #3a3360;
    --hot: #ff6f52; --hot-ink: #1a0b07; --cool: #46d6d1; --gold: #ffd062; --gold-bg: #3a2f12;
    --fs: #52d27c; --fa: #ff6f52; --fr: #77a8ff; --bed: #2a2549;
    --ok: #7fe0a0; --ok-bg: #173523; --warn: #ffab8c; --warn-bg: #3d1d14; --info: #aab8ff; --info-bg: #1e2448;
    --nerf: #ff9e8f; --nerf-bg: #3f1a17; --buff: #7ee3b3; --buff-bg: #14372a; --keep: #cfc9e6; --keep-bg: #2b2647;
    --shadow: 0 2px 0 rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0d1a; --panel: #1a1730; --panel2: #221e3d; --ink: #efeaf7; --muted: #aaa3c2; --line: #3a3360;
  --hot: #ff6f52; --hot-ink: #1a0b07; --cool: #46d6d1; --gold: #ffd062; --gold-bg: #3a2f12;
  --fs: #52d27c; --fa: #ff6f52; --fr: #77a8ff; --bed: #2a2549;
  --ok: #7fe0a0; --ok-bg: #173523; --warn: #ffab8c; --warn-bg: #3d1d14; --info: #aab8ff; --info-bg: #1e2448;
  --nerf: #ff9e8f; --nerf-bg: #3f1a17; --buff: #7ee3b3; --buff-bg: #14372a; --keep: #cfc9e6; --keep-bg: #2b2647;
  --shadow: 0 2px 0 rgba(0, 0, 0, .4);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
a { color: var(--cool); }
.hidden { display: none !important; }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.none { color: var(--muted); list-style: none; font-style: italic; }
h1, h2, h3 { line-height: 1.2; overflow-wrap: anywhere; }
h2, .ph { font-style: italic; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; }

/* header */
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 3px solid var(--hot); background: var(--panel); }
.back { font-size: .875rem; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; font-style: italic; text-transform: uppercase; letter-spacing: .04em; }
.logo { width: 30px; height: 30px; }
.lg-gate { fill: var(--ink); } .lg-arc { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; } .lg-head { fill: var(--gold); } .lg-ball { fill: var(--hot); }
.session { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pill { border: 2px solid var(--ink); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 5px 14px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
.pill:hover:not(:disabled) { background: var(--panel2); }
.pill.solid { background: var(--hot); border-color: var(--hot); color: var(--hot-ink); }
.pill.solid:hover:not(:disabled) { filter: brightness(1.08); background: var(--hot); }
.pill.ghost { border-style: dashed; cursor: default; }
.pill.big { padding: 9px 22px; font-size: 1rem; text-transform: uppercase; font-style: italic; letter-spacing: .03em; }
.pill.tiny { padding: 2px 10px; font-size: .8rem; }
.pill:disabled { opacity: .5; cursor: not-allowed; }
.pill:focus-visible, .chip:focus-visible, .lane:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--cool); outline-offset: 2px; }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; }
.hero { padding: 24px 0 8px; }
.kicker { margin: 0 0 8px; font-size: .9rem; color: var(--muted); border-left: 4px solid var(--gold); padding-left: 10px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 4.6vw, 2.8rem); font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .01em; }
.lede { margin: 0; max-width: 760px; }

/* lanes and samples */
.lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 8px; }
.lane { text-align: left; border: 3px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 12px; padding: 10px 14px; font: inherit; font-weight: 800; font-style: italic; text-transform: uppercase; cursor: pointer; box-shadow: var(--shadow); }
.lane.on { border-color: var(--hot); background: var(--panel2); }
.lane-no { display: inline-block; background: var(--ink); color: var(--bg); border-radius: 6px; padding: 0 6px; margin-right: 6px; font-style: normal; }
.lane.on .lane-no { background: var(--hot); color: var(--hot-ink); }
.lane-sub { display: block; font-weight: 500; font-style: normal; text-transform: none; font-size: .85rem; color: var(--muted); }
.samples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 14px; }
.chipset { display: contents; }
.chip { border: 2px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 3px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.chip.on { border-color: var(--cool); background: var(--panel2); font-weight: 700; }

/* panels and the stage grid */
.stage { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.panel { background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 16px; margin: 0 0 14px; box-shadow: var(--shadow); min-width: 0; }
.ph { margin: 0 0 10px; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.ph-no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: var(--ink); color: var(--bg); font-style: normal; font-size: .9rem; flex: none; }
.panel h3 { margin: 14px 0 6px; font-size: 1rem; }
.fld { display: block; margin: 0 0 10px; font-weight: 600; }
.fld input, .fld select, .fld textarea { display: block; width: 100%; margin-top: 4px; font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 2px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.fld textarea { resize: vertical; min-height: 120px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drop { border: 2px dashed var(--line); border-radius: 8px; padding: 8px 10px; color: var(--muted); }
.drop.over { border-color: var(--cool); background: var(--panel2); }
.filepick { color: var(--cool); text-decoration: underline; cursor: pointer; }
.filepick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.note { background: var(--gold-bg); color: var(--ink); border-left: 4px solid var(--gold); padding: 6px 10px; border-radius: 6px; }
.gate { background: var(--info-bg); color: var(--ink); padding: 8px 10px; border-radius: 8px; }
.runrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.cardrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }

/* the quirk reading */
.qread { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.qr { display: flex; gap: 10px; align-items: center; background: var(--panel2); border-radius: 10px; padding: 6px 8px; border-left: 5px solid var(--line); }
.qr.c-grab { border-left-color: var(--gold); } .qr.c-projectile { border-left-color: var(--cool); } .qr.c-rush { border-left-color: var(--hot); } .qr.c-counter { border-left-color: var(--fr); }
.qr-stick { flex: none; width: 66px; }
.qr-body { min-width: 0; }
.qr-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qr-text { display: block; overflow-wrap: anywhere; }
.cue { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 4px; background: var(--keep-bg); color: var(--keep); }

/* joystick glyph */
.stick { width: 66px; height: 48px; display: block; }
.st-gate { fill: var(--bed); stroke: var(--line); stroke-width: 1.5; }
.st-dot { fill: var(--muted); }
.st-path { fill: none; stroke: var(--hot); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.st-head { fill: var(--hot); }
.st-second { opacity: .65; }
.st-hold { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-dasharray: 3 2; }
.st-x { fill: var(--ink); font: 700 7px ui-monospace, Menlo, monospace; text-anchor: middle; }
.st-btn circle { stroke-width: 1.5; }
.st-p circle { fill: var(--cool); stroke: var(--cool); } .st-k circle { fill: var(--gold); stroke: var(--gold); }
.st-btn text { fill: var(--bg); font: 800 9px system-ui, sans-serif; text-anchor: middle; }

/* character select */
.select { background: linear-gradient(180deg, var(--panel2), var(--panel)); }
.selcard { display: flex; gap: 14px; align-items: center; }
.pwrap { flex: none; }
.portrait { width: 64px; height: 64px; display: block; }
.portrait.big { width: 104px; height: 104px; }
.pt-bg { stroke: none; }
.pt-frame { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 2; }
.pt-glyph { fill: rgba(255, 255, 255, .28); stroke: rgba(255, 255, 255, .6); stroke-width: 1.2; }
.pt-ini { fill: #fff; font: 900 15px system-ui, sans-serif; text-anchor: middle; letter-spacing: .04em; }
.pt-0 .pt-bg { fill: #b23a2a; } .pt-1 .pt-bg { fill: #0f6b73; } .pt-2 .pt-bg { fill: #6a3fa0; } .pt-3 .pt-bg { fill: #8a5b00; } .pt-4 .pt-bg { fill: #2a5aa8; } .pt-5 .pt-bg { fill: #2c7a3e; }
.selinfo { min-width: 0; }
.fname { margin: 0; font-size: 1.6rem; font-weight: 900; font-style: italic; text-transform: uppercase; line-height: 1.1; overflow-wrap: anywhere; }
.fepi { margin: 2px 0 0; font-style: italic; }
.fstyle { margin: 6px 0 0; display: inline-block; background: var(--ink); color: var(--bg); padding: 1px 8px; border-radius: 4px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stats { display: grid; gap: 5px; margin: 14px 0 6px; }
.sbar { display: grid; grid-template-columns: 72px 1fr 20px; gap: 8px; align-items: center; font-size: .85rem; }
.sbar-k { text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.sbar-segs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.sbar-segs i { height: 12px; border-radius: 2px; background: var(--bed); }
.sbar-segs i.on { background: var(--hot); }
.sbar-v { font-weight: 800; text-align: right; }

/* the move list */
.legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 8px; }
.lg-k { display: inline-flex; align-items: center; gap: 5px; }
.lg-k::before { content: ""; width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.lg-k.s::before { background: var(--fs); } .lg-k.a::before { background: var(--fa); } .lg-k.r::before { background: var(--fr); }
.mvlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mv { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--panel); }
.mv.is-super { border-color: var(--gold); background: var(--panel2); }
.mv.flagged { border-color: var(--hot); }
.mv-stick { flex: none; width: 66px; padding-top: 2px; }
.mv-body { min-width: 0; flex: 1; }
.mv-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mv-name { font-size: 1.05rem; font-style: italic; overflow-wrap: anywhere; }
.tag { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 4px; background: var(--keep-bg); color: var(--keep); }
.tag.super { background: var(--gold-bg); color: var(--gold); }
.tag.t-projectile { background: var(--info-bg); color: var(--info); } .tag.t-grab { background: var(--warn-bg); color: var(--warn); }
.mv-meter { margin: 6px 0 4px; }
.fmeter { width: 100%; max-width: 420px; height: 18px; display: block; }
.fm-bed { fill: var(--bed); } .fm-s { fill: var(--fs); } .fm-a { fill: var(--fa); } .fm-r { fill: var(--fr); }
.fm-tick { stroke: var(--muted); stroke-width: .8; }
.fm-more { fill: var(--ink); font: 700 9px ui-monospace, monospace; text-anchor: end; }
.mv-nums { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.mv-nums label { display: inline-flex; gap: 4px; align-items: center; }
.mv-nums input { width: 62px; font: inherit; color: var(--ink); background: var(--bg); border: 2px solid var(--line); border-radius: 6px; padding: 1px 4px; }
.mv-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.flag { font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.flag.ok { background: var(--ok-bg); color: var(--ok); }
.mv-does, .mv-tell { margin: 4px 0 0; }
.mv-tell { color: var(--muted); }

/* training mode (tune ask) */
.tread { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.tr { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--panel2); }
.call { font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; padding: 2px 9px; border-radius: 4px; }
.call.c-nerf { background: var(--nerf-bg); color: var(--nerf); } .call.c-buff { background: var(--buff-bg); color: var(--buff); } .call.c-keep, .call.c-none { background: var(--keep-bg); color: var(--keep); }

/* progress */
.progress h3 { margin-top: 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.step { color: var(--muted); } .step.active { color: var(--ink); font-weight: 700; } .step.done { color: var(--ok); }
.step-ic { display: inline-block; width: 1.2em; font-family: ui-monospace, monospace; }
.raw { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; background: var(--bg); padding: 10px; border-radius: 8px; font-size: .8rem; }

/* results */
.res-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.res-head h2 { margin: 0; font-size: 1.3rem; min-width: 0; }
.badge { display: inline-block; font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .04em; padding: 4px 12px; border-radius: 6px; border: 2px solid currentColor; font-size: .85rem; }
.v-forged { color: var(--gold); background: var(--gold-bg); }
.v-tournament_ready { color: var(--ok); background: var(--ok-bg); } .v-needs_patch { color: var(--gold); background: var(--gold-bg); } .v-broken { color: var(--nerf); background: var(--nerf-bg); } .v-none { color: var(--muted); }
.summary { font-size: 1.05rem; }
.quotes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bubble { margin: 0; background: var(--panel2); border: 2px solid var(--line); border-radius: 14px 14px 14px 2px; padding: 8px 12px; }
.bubble.win { border-radius: 14px 14px 2px 14px; border-color: var(--gold); }
.bubble span { display: block; }
.bubble q { font-weight: 700; font-style: italic; }
.plain { list-style: none; margin: 0; padding: 0; }
.gmoves li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.gmoves p { margin: 2px 0 0; }
.patch { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pn { border: 2px solid var(--line); border-left-width: 6px; border-radius: 10px; padding: 8px 12px; }
.pn.c-nerf { border-left-color: var(--nerf); } .pn.c-buff { border-left-color: var(--buff); } .pn.c-keep { border-left-color: var(--keep); }
.pn-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pn-ch { margin: 6px 0; padding-left: 0; list-style: none; }
.arrow { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; font-weight: 900; font-family: ui-monospace, monospace; }
.arrow.up { background: var(--buff-bg); color: var(--buff); } .arrow.down { background: var(--nerf-bg); color: var(--nerf); }
.pn-meter { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; align-items: center; margin: 2px 0; }
.pn p { margin: 4px 0 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.recon { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
.recon li { padding: 5px 10px; border-radius: 6px; font-size: .9rem; }
.recon .ok { background: var(--ok-bg); color: var(--ok); } .recon .warn { background: var(--warn-bg); color: var(--warn); } .recon .info { background: var(--info-bg); color: var(--info); }
.recon .none { background: var(--ok-bg); color: var(--ok); font-style: normal; }

/* exports, roster, about, footer */
.exports { display: flex; flex-wrap: wrap; gap: 8px; }
.roster { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tile { display: flex; gap: 10px; align-items: center; border: 2px solid var(--line); border-radius: 10px; padding: 8px; background: var(--panel2); }
.tile-pic { flex: none; }
.tile-info { min-width: 0; display: grid; gap: 2px; }
.tile-info b { overflow-wrap: anywhere; font-style: italic; text-transform: uppercase; }
.tile-acts { display: flex; gap: 6px; margin-top: 2px; }
.roster .none { grid-column: 1 / -1; }
.aboutbox p { margin: 0; }
.foot { max-width: 1120px; margin: 0 auto; padding: 16px; border-top: 2px solid var(--line); color: var(--muted); font-size: .875rem; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: 10px; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); transition: opacity .5s; font-size: .9rem; }
.toast.err { background: var(--hot); color: var(--hot-ink); }
.toast a { color: inherit; font-weight: 700; }
.toast.gone { opacity: 0; }

@media (max-width: 860px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .lanes, .two, .cols, .quotes { grid-template-columns: minmax(0, 1fr); }
  .bar { padding: 8px 12px; }
  .session { margin-left: 0; width: 100%; }
  .portrait.big { width: 84px; height: 84px; }
  .fname { font-size: 1.3rem; }
  .mv { gap: 8px; padding: 8px; }
  .mv-stick, .qr-stick { width: 54px; }
  .stick { width: 54px; height: 40px; }
  .sbar { grid-template-columns: 74px 1fr 18px; font-size: .8rem; }
}
@media print {
  .bar, .lanes, .samples, .runrow, .gate, .exportbox, .histbox, .cardrow, .toasts, #askForge, #askTune, .drop { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { box-shadow: none; border-color: #999; break-inside: avoid; }
}
