/* Sammy Ahmed: an RPG in colour chapters. Jersey 10 for display, Jersey 20 for text: both pixel faces drawn on a grid, set at whole multiples so every pixel stays square. */

:root {
  --bone: #e6e0d2;
  --ink: #1a1a1a;
  --coral: #ed4b44;
  --green: #18bc42;
  --yellow: #f2c21a;
  --night: #1a1a1a;
  --night-2: #2a2a33;
  --night-3: #3d3d4a;
  --accent: var(--green);
  --wood: #cf9a58;
  --planks: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='64' shape-rendering='crispEdges'%3E%3Crect width='96' height='64' fill='%23cf9a58'/%3E%3Cg fill='%23bd8645'%3E%3Crect y='28' width='96' height='4'/%3E%3Crect y='60' width='96' height='4'/%3E%3Crect x='40' width='4' height='28'/%3E%3Crect x='88' y='32' width='4' height='28'/%3E%3C/g%3E%3C/svg%3E");

  --font-display: "Jersey 10", "Arial Narrow", sans-serif;
  --font-text: "Jersey 20", "Arial Narrow", sans-serif;

  --step-body: 1.25rem;
  --step-lead: clamp(1.5rem, 0.8rem + 1.5vw, 2.25rem);
  --step-head: clamp(2.75rem, 1rem + 4.6vw, 5rem);
  --step-display: clamp(4rem, 13.2vw, 16rem);
  --step-hero: min(15.5vw, 22svh);

  --bar: 2.875rem;
  --margin: clamp(1rem, 2.2vw, 2rem);
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(5rem, 9vw, 9rem);

  --n: 4px;
  --n2: 8px;
  --notch: polygon(0 var(--n2), var(--n) var(--n2), var(--n) var(--n), var(--n2) var(--n), var(--n2) 0,
    calc(100% - var(--n2)) 0, calc(100% - var(--n2)) var(--n), calc(100% - var(--n)) var(--n), calc(100% - var(--n)) var(--n2), 100% var(--n2),
    100% calc(100% - var(--n2)), calc(100% - var(--n)) calc(100% - var(--n2)), calc(100% - var(--n)) calc(100% - var(--n)), calc(100% - var(--n2)) calc(100% - var(--n)), calc(100% - var(--n2)) 100%,
    var(--n2) 100%, var(--n2) calc(100% - var(--n)), var(--n) calc(100% - var(--n)), var(--n) calc(100% - var(--n2)), 0 calc(100% - var(--n2)));
  --notch-bottom: polygon(0 0, 100% 0, 100% calc(100% - var(--n2)), calc(100% - var(--n)) calc(100% - var(--n2)), calc(100% - var(--n)) calc(100% - var(--n)), calc(100% - var(--n2)) calc(100% - var(--n)), calc(100% - var(--n2)) 100%,
    var(--n2) 100%, var(--n2) calc(100% - var(--n)), var(--n) calc(100% - var(--n)), var(--n) calc(100% - var(--n2)), 0 calc(100% - var(--n2)));

  --edge-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' shape-rendering='crispEdges'%3E%3Crect width='12' height='12'/%3E%3Crect x='24' width='12' height='12'/%3E%3Crect y='12' width='48' height='12'/%3E%3C/svg%3E");
  --t-press: 120ms;

  /* the chosen player: width in sprite pixels at a height of 22, and where the ball starts as a fraction of the sprite */
  --cw: 12.8; --hx: 1; --hy: 0.7;
}

html[data-char="mazu"], html[data-char="shigi"] { --cw: 11.2; --hx: 1.08; --hy: 0.66; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: auto; }
body { font-synthesis: none; margin: 0; background: var(--bone); color: var(--ink); font-family: var(--font-text); font-size: var(--step-body); line-height: 1.5; overflow-x: clip; }
h1, h2, h3, p, figure, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:target { scroll-margin-top: calc(var(--bar) + 1rem); }
::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--margin); top: -4rem; z-index: 40; padding: 0.6rem 1rem; background: var(--accent); color: var(--ink); font-weight: 700; }
.skip:focus { top: 0.75rem; }
.nums { font-variant-numeric: tabular-nums; }

/* ---------- type ---------- */
.display, .head, h1 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; hyphens: none; letter-spacing: 0.01em; }
.display { font-size: var(--step-display); line-height: 0.86; }
.head { font-size: var(--step-head); line-height: 0.92; }
.lead { font-size: var(--step-lead); line-height: 1.2; text-wrap: balance; }
p { max-width: 62ch; text-wrap: pretty; }
.role h3, .mini h3, .earlier h3, .spell-list h3 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.01em; line-height: 1; font-size: var(--step-lead); }

/* ---------- the pixel shape: stepped corners on filled blocks, never an outline ---------- */
.box { background: var(--frame, var(--ink)); padding: 6px; clip-path: var(--notch); }
.box > .in { background: var(--panel, var(--bone)); color: var(--panel-ink, var(--ink)); padding: 1rem 1.25rem; clip-path: var(--notch); --n: 3px; --n2: 6px; position: relative; }

/* every picture gets the same treatment: one ratio, grey, then multiplied onto a flat tint from the palette */
.plate { background: var(--tint, var(--coral)); isolation: isolate; clip-path: var(--notch); --n: 6px; --n2: 12px; }
.plate img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% var(--pos, 45%); mix-blend-mode: multiply; filter: grayscale(1) contrast(1.15); }
figure figcaption { margin-top: 0.9rem; max-width: 46ch; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3.75rem; padding: 0 2.25rem; background: var(--ink); color: var(--bone); text-decoration: none; font-weight: 700; font-size: var(--step-body); white-space: nowrap; clip-path: var(--notch); transition: transform var(--t-press) steps(2, end); }
.button:active { transform: translateY(4px); }
.button:focus-visible { outline: none; background: var(--focus-bg, var(--accent)); color: var(--ink); transform: translateY(3px); }
@media (hover: hover) and (pointer: fine) { .button:hover { transform: translateY(-4px); } }

/* ---------- HUD: the game's status bar. It sits in the page, so text scrolls beneath it, never behind it ---------- */
.hud { position: sticky; z-index: 30; top: 0; min-height: var(--bar); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 var(--margin) 0.25rem; background: var(--night); color: var(--bone); font-size: var(--step-body); font-weight: 600; clip-path: var(--notch-bottom); --n: 3px; --n2: 6px; }
.xp { display: flex; gap: 3px; }
.xp i { width: 0.6rem; height: 1rem; background: var(--night-3); }
.xp i.on { background: var(--accent); }

/* ---------- chapters: one flat colour each, hard edges ---------- */
.chap, .foot { position: relative; --edge: 24px; }
.chap { padding: var(--section) var(--margin); background: var(--bg); color: var(--fg); }
/* the top of every sheet is a pixel edge: one row of blocks over a solid row, so the sheet below shows through the gaps */
.chap::before, .foot::before { content: ""; position: absolute; left: 0; right: 0; top: calc(-1 * var(--edge)); height: var(--edge); background: var(--bg, var(--bone)); -webkit-mask: var(--edge-mask) 0 0 / 48px 24px repeat-x; mask: var(--edge-mask) 0 0 / 48px 24px repeat-x; pointer-events: none; }
.chap .button { background: var(--btn, var(--ink)); color: var(--btn-ink, var(--bone)); }

/* ---------- title screen: the name on the waterline, its one sentence right beneath, the player on the floor ---------- */
.opening { background: var(--night); --pad: clamp(1.5rem, 4svh, 3rem); --px: clamp(5px, min(1svh, 1.9vw), 13px); --floor-h: max(calc(13 * var(--px) + 1.5rem), 17svh); --cable: clamp(1.25rem, 4svh, 2.5rem); position: relative; display: grid; grid-template-columns: minmax(0, 1fr); }
/* the arena is one picture seen from the side: wall of stands, lights that reach the floor, hardwood, two goals and the player. The title text hangs over it, and on wide screens the arena holds while the character sheet slides up over it. */
.arena { grid-row: 1; grid-column: 1; position: relative; isolation: isolate; overflow: hidden; background: var(--night); }
.hero { --fg: var(--ink); --focus-bg: var(--bone); grid-row: 1; grid-column: 1; position: relative; z-index: 1; min-height: calc(100svh - var(--bar)); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; padding: 0 var(--margin) calc(1.5rem + 22 * var(--px)); color: var(--ink); }
.stands { position: absolute; inset: 0; background: var(--night-2) url("assets/crowd-biffy.svg") 0 0 / 960px 192px; }
.stands::after { content: ""; position: absolute; inset: 0; background: url("assets/crowd-biffy-b.svg") 0 0 / 960px 192px; }
html[data-char="mazu"] .stands { background-image: url("assets/crowd-mazu.svg"); }
html[data-char="mazu"] .stands::after { background-image: url("assets/crowd-mazu-b.svg"); }
html[data-char="shigi"] .stands { background-image: url("assets/crowd-shigi.svg"); }
html[data-char="shigi"] .stands::after { background-image: url("assets/crowd-shigi-b.svg"); }
.haze i { position: absolute; top: 0; left: 0; right: 0; height: 30%; background: var(--night); opacity: 0.3; }
.haze i:nth-child(2) { height: 20%; }
.haze i:nth-child(3) { height: 10%; }
.parquet { position: absolute; left: 0; right: 0; bottom: 0; height: var(--floor-h); background: var(--wood) var(--planks); background-size: 96px 64px; }
.parquet::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--bone); }
.parquet::after { content: ""; position: absolute; left: 50%; top: 32%; width: min(30%, 26rem); height: 44%; transform: translateX(-50%); border: 6px solid var(--bone); border-radius: 50%; }
.parquet i { position: absolute; top: 6px; bottom: 0; width: 6px; background: var(--bone); }
.parquet i:first-child { left: 24%; }
.parquet i:last-child { right: 24%; }
.lights i { position: absolute; top: 0; bottom: 0; left: var(--x); width: 0; }
.lights u { position: absolute; top: 0; left: -2.25rem; width: 4.5rem; height: 0.9rem; background: var(--yellow); }
.lights i::before, .lights i::after { content: ""; position: absolute; top: 0.9rem; bottom: var(--floor-h); left: 50%; background: var(--yellow); opacity: 0.07; transform: translateX(-50%); }
.lights i::before { width: 19rem; clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); }
.lights i::after { width: 9rem; clip-path: polygon(35% 0, 65% 0, 100% 100%, 0 100%); opacity: 0.08; }
.lights b { position: absolute; left: -6rem; width: 12rem; bottom: calc(var(--floor-h) * 0.12); height: calc(var(--floor-h) * 0.3); background: var(--bone); opacity: 0.16; clip-path: polygon(12% 0, 88% 0, 88% 25%, 100% 25%, 100% 75%, 88% 75%, 88% 100%, 12% 100%, 12% 75%, 0 75%, 0 25%, 12% 25%); }
.goal { --hpx: calc(var(--px) * 1.4); position: absolute; bottom: calc(0.75rem + 2 * var(--px)); width: calc(24 * var(--hpx)); height: calc(34 * var(--hpx)); background: url("assets/hoop-tall.svg") 0 0 / 100% 100% no-repeat; image-rendering: pixelated; }
.goal::after { content: ""; position: absolute; left: calc(10 * var(--hpx)); bottom: -0.3rem; width: calc(11 * var(--hpx)); height: 0.5rem; background: var(--ink); opacity: 0.3; }
.goal-r { right: var(--margin); }
.goal-l { left: var(--margin); transform: scaleX(-1); }
/* the name hangs from the roof on a scoreboard */
.board { grid-row: 1; justify-self: center; position: relative; margin-top: var(--cable); max-width: 100%; }
.board .cable { position: absolute; bottom: 100%; width: 6px; height: var(--cable); background: var(--night-3); }
.board .cable:first-child { left: 14%; }
.board .cable:nth-child(2) { right: 14%; }
.frame { --frame: var(--night-3); --panel: var(--night); --panel-ink: var(--bone); }
.board .in { padding: 0.35rem clamp(0.75rem, 2vw, 1.75rem) 0.6rem; }
.ticker { display: flex; align-items: center; justify-content: center; gap: 0.15em; margin-top: 0.4rem; min-height: 1.2em; font-size: min(2.25rem, 5.9vw); line-height: 1.2; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; color: var(--accent); max-width: none; }
.caret { width: 0.5em; height: 0.85em; background: currentColor; }
.hero-name { text-align: center; font-size: var(--step-hero); line-height: 0.86; color: var(--bone); }
.lines .line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.lines [data-line] { display: block; }
.talk { grid-row: 2; align-self: start; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 1.25rem; margin-top: clamp(1.25rem, 3svh, 2.25rem); }
.talk .button { background: var(--accent); color: var(--ink); }
.talk { justify-self: center; width: min(100%, 46rem); }
.walker { --hpx: calc(var(--px) * 1.4); position: absolute; z-index: 1; left: calc(var(--margin) + 8 * var(--hpx)); right: calc(var(--margin) + 8 * var(--hpx)); bottom: 1rem; container-type: inline-size; height: calc(22 * var(--px)); }
.pace { position: relative; width: calc(var(--cw) * var(--px)); height: 100%; transform: translateX(calc(50cqw - var(--cw) * var(--px) / 2)); }
.pace::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: -0.3rem; height: 0.45rem; background: var(--ink); opacity: 0.3; }
.char { display: none; position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; max-width: none; image-rendering: pixelated; }
html:not([data-char]) .char-biffy, html[data-char="biffy"] .char-biffy, html[data-char="mazu"] .char-mazu, html[data-char="shigi"] .char-shigi { display: block; }
.dribble { position: absolute; left: calc(var(--hx) * 100% - 2 * var(--px)); top: calc(var(--hy) * 100%); width: calc(4 * var(--px)); height: calc(4 * var(--px)); max-width: none; image-rendering: pixelated; }
/* the player select: three big boxes over the button */
.cta { width: min(100%, 36rem); margin-inline: auto; display: flex; flex-direction: column; align-items: stretch; gap: 1.25rem; }
.pick-label { align-self: center; font-weight: 700; font-size: 1.25rem; line-height: 1; color: var(--bone); background: var(--night); padding: 0.4rem 0.9rem; margin-bottom: -0.5rem; max-width: none; }
.pick.big { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.pick.big button { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; width: auto; height: auto; padding: 6px 6px 0.5rem; color: var(--bone); font-weight: 700; font-size: 1.25rem; line-height: 1; --n: 4px; --n2: 8px; }
.pick.big button[aria-checked="true"] { color: var(--ink); }
.pick.big button img { width: 100%; height: clamp(5rem, 15svh, 9rem); }
.pick { display: flex; align-items: center; gap: 0.5rem; }
.pick button { width: 3.5rem; height: 3.5rem; padding: 4px; background: var(--night-3); clip-path: var(--notch); --n: 3px; --n2: 6px; transition: transform var(--t-press) steps(2, end); }
.pick button[aria-checked="true"] { background: var(--bone); transform: translateY(-4px); }
.pick button img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; background: var(--night-2); image-rendering: pixelated; }
.pick button:focus-visible { outline: none; background: var(--accent); }
.pick.labelled { flex-wrap: wrap; gap: 0.75rem; }
.pick.labelled button { width: auto; height: auto; display: flex; align-items: center; gap: 0.6rem; padding: 4px 1rem 4px 4px; color: var(--bone); text-align: left; line-height: 1.1; font-weight: 700; }
.pick.labelled button[aria-checked="true"] { color: var(--ink); }
.pick.labelled button img { width: 3.5rem; height: 3.5rem; flex: none; }
html:not(.js) .pick { display: none; }

/* ---------- character sheet (night): split ---------- */
.sheet { --bg: var(--night); --fg: var(--bone); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--gutter); align-items: start; }
.sheet-copy { display: grid; gap: 2.25rem; align-content: start; padding-left: clamp(0rem, 3vw, 3rem); }
.sheet-copy .lead { max-width: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 2rem var(--gutter); }
.stats dt { font-family: var(--font-display); font-size: var(--step-head); line-height: 0.9; }
.stats .plus { margin-left: 0.04em; }
.stats dd { margin-top: 0.4rem; max-width: 22ch; }
.base { font-weight: 700; }

/* ---------- quest log (coral): ledger rows ---------- */
.quests { --bg: var(--coral); --fg: #0f0f0f; }
.quests-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--gutter); align-items: end; margin-bottom: clamp(3rem, 6vw, 5.5rem); }
.quests-head .lead { justify-self: end; max-width: 24ch; text-align: right; }
.quest { position: relative; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 4fr) minmax(0, 5fr); column-gap: var(--gutter); padding: 2rem 1.5rem 2rem 2.25rem; margin-inline: -1.5rem; }
.quest + .quest { margin-top: 1rem; }
.when { display: grid; gap: 0.75rem; justify-items: start; align-content: start; font-weight: 600; }
.tag { display: inline-block; padding: 0.15rem 0.8rem; background: var(--night); color: var(--bone); clip-path: var(--notch); font-weight: 700; --n: 3px; --n2: 6px; }
.role { position: relative; display: grid; gap: 0.35rem; align-content: start; }
.role h3 { position: relative; }
.role h3::before { content: ""; position: absolute; left: -1.5rem; top: 0.32em; width: 0.8rem; height: 1rem; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); opacity: 0; }
.did { display: grid; gap: 0.7rem; }
.did li { position: relative; padding-left: 1.1rem; }
.did li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 0.45rem; height: 0.45rem; background: currentColor; }
.quest.is-active { background: var(--night); color: var(--bone); clip-path: var(--notch); --n: 6px; --n2: 12px; }
.quest.is-active .tag { background: var(--bone); color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .quest:hover .role h3::before { opacity: 1; animation: cursor 700ms steps(1) infinite; }
}
.earlier { margin-top: clamp(4rem, 7vw, 6.5rem); display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); column-gap: var(--gutter); }
.earlier li { display: flex; justify-content: space-between; gap: 1.5rem; padding-block: 0.35rem; }
.earlier .yr { white-space: nowrap; font-weight: 600; }

/* ---------- spell book and equipment (yellow): a grid of spells over the gear and its picture ---------- */
.spells { --bg: var(--yellow); --fg: var(--ink); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: clamp(3.5rem, 7vw, 6rem); align-items: start; }
.spells-h { grid-column: 1 / span 4; }
.spell-list { grid-column: 5 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.75rem var(--gutter); }
.spell-list p { margin-top: 0.5rem; max-width: 34ch; }
.gear { grid-column: 1 / span 5; display: grid; gap: 1.5rem; align-content: start; }
.slots { width: 100%; border-collapse: collapse; font-size: var(--step-lead); line-height: 1.25; }
.slots th, .slots td { padding: 0.55rem 0; text-align: left; font-weight: 400; vertical-align: baseline; }
.slots th { width: 38%; font-family: var(--font-text); font-size: var(--step-body); font-weight: 700; }
.pack { max-width: 40ch; }
.stick { grid-column: 7 / -1; }

/* ---------- side quests (green): a strip of three, project, picture, project ---------- */
.side { --bg: var(--green); --fg: var(--ink); display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) minmax(0, 4fr); grid-template-areas: "h h h" "a pic b"; gap: clamp(2rem, 4vw, 3.5rem) var(--gutter); align-items: stretch; }
.side-h { grid-area: h; }
.side-pic { grid-area: pic; }
.mini-a { grid-area: a; }
.mini-b { grid-area: b; }
.mini { background: var(--bone); color: var(--ink); padding: 1.75rem 1.75rem 2rem; clip-path: var(--notch); display: grid; gap: 0.75rem; align-content: space-between; }
.mini p { max-width: 44ch; }
@media (max-width: 63.99em) { .mini { align-content: start; } }

/* ---------- boss battle (night): one arena across the whole width ---------- */
.boss { --bg: var(--night); --fg: var(--bone); --btn: var(--accent); --btn-ink: var(--ink); --focus-bg: var(--bone); }
.boss-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--gutter); align-items: end; margin-bottom: clamp(2rem, 4vw, 3rem); }
.boss-copy { display: grid; gap: 1.5rem; align-content: start; }
.boss-copy .lead { max-width: none; }
.boss-talk { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem 1.5rem; align-items: end; }
.boss .dialog { --frame: var(--bone); --panel: var(--night-2); --panel-ink: var(--bone); max-width: none; }
.msg { min-height: 2.9em; max-width: none; }
.score { font-family: var(--font-display); font-size: var(--step-head); line-height: 0.9; }
.score .made { color: var(--accent); }
.best { grid-column: 1 / -1; font-weight: 600; }
.boss-stage { display: grid; gap: 1rem; }
.stage { --s: calc(100cqw / 130); container-type: inline-size; position: relative; aspect-ratio: 16 / 7; background: var(--night-2); overflow: clip; clip-path: var(--notch); --n: 8px; --n2: 16px; }
.floor { position: absolute; left: 0; right: 0; bottom: 0; height: 24%; background: var(--night-3); }
.enemy { position: absolute; left: 4%; top: 6%; --frame: var(--bone); --panel: var(--night); --panel-ink: var(--bone); min-width: 14rem; }
.enemy .in { padding: 0.6rem 1rem 0.8rem; }
.en-name { font-weight: 700; }
.hp { display: flex; gap: 4px; margin-top: 0.45rem; }
.hp i { width: 2rem; height: 0.9rem; background: var(--coral); transition: transform 240ms steps(4, end), opacity 240ms steps(4, end); transform-origin: left center; }
.hp i.gone { transform: scaleX(0); opacity: 0; }
.hoop { position: absolute; right: 6%; top: 8%; width: calc(24 * var(--s) * 1.15); height: calc(24 * var(--s) * 1.15); background: url("assets/hoop.svg") 0 0 / 100% 100% no-repeat; image-rendering: pixelated; }
.hero-sprite { position: absolute; left: 8%; bottom: 20%; width: calc(var(--cw) * var(--s)); height: calc(22 * var(--s)); }
.still { width: 100%; height: 100%; background: url("assets/char-biffy.svg") 50% 100% / 100% 100% no-repeat; image-rendering: pixelated; }
html[data-char="mazu"] .still { background-image: url("assets/char-mazu.svg"); }
html[data-char="shigi"] .still { background-image: url("assets/char-shigi.svg"); }
.ball { position: absolute; left: calc(8% + var(--hx) * var(--cw) * var(--s) - 2 * var(--s)); bottom: calc(20% + (1 - var(--hy)) * 22 * var(--s) - 4 * var(--s)); width: calc(4 * var(--s)); height: calc(4 * var(--s)); background: url("assets/ball.svg") 0 0 / 100% 100% no-repeat; image-rendering: pixelated; }
.meter { position: absolute; left: 4%; right: 4%; bottom: 5%; height: 2.5rem; background: var(--night); overflow: hidden; }
.zone { position: absolute; top: 0; bottom: 0; background: var(--accent); }
.marker { position: absolute; top: 0; bottom: 0; left: 0; width: 0.6rem; background: var(--bone); will-change: transform; }
.shoot { width: 100%; min-height: 4.25rem; font-size: var(--step-lead); touch-action: manipulation; }
html:not(.js) .stage, html:not(.js) .shoot, html:not(.js) .score { display: none; }

/* ---------- continue? (coral): split ---------- */
.cont { --bg: var(--coral); --fg: #0f0f0f; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--gutter); }
.cont-copy { display: grid; gap: 1.5rem; align-content: start; }
.cont-copy .lead { max-width: none; }
.count { line-height: 0.8; font-variant-numeric: tabular-nums; }
.pad { justify-self: end; width: min(100%, 40rem); }

/* ---------- credits (bone): the name returns at full width ---------- */
.foot { background: var(--bone); color: var(--ink); padding: var(--section) var(--margin) 1.75rem; }
.thanks { white-space: nowrap; }
.foot-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--gutter); margin-top: 3.5rem; align-items: start; }
.foot-note { font-size: var(--step-lead); line-height: 1.2; font-weight: 600; }
.credits { line-height: 1.55; max-width: 62ch; }
.foot-last { display: flex; justify-content: space-between; gap: 1rem; margin-top: 5rem; font-weight: 600; }

/* ---------- the arena holds for one screen while the character sheet slides up over it as an opaque sheet ---------- */
@media (min-width: 64em) and (prefers-reduced-motion: no-preference) {
  .opening .arena { grid-row: 1 / span 2; align-self: start; position: sticky; top: var(--bar); height: calc(100svh - var(--bar)); }
  .opening .sheet { z-index: 2; }
}

/* ---------- tablet and below ---------- */
@media (max-width: 63.99em) {
  :root { --step-display: 14vw; }
  .thanks { white-space: normal; }
  .sheet, .boss-head, .foot-row { grid-template-columns: minmax(0, 1fr); row-gap: 2.5rem; }
  .sheet-copy { padding-left: 0; }
  .quests-head { grid-template-columns: minmax(0, 1fr); row-gap: 1rem; }
  .quests-head .lead { justify-self: start; text-align: left; max-width: 24ch; }
  .quest { grid-template-columns: minmax(0, 1fr); row-gap: 0.9rem; margin-inline: -1rem; padding: 1.5rem 1rem 1.5rem 1.75rem; }
  .role h3::before { display: none; }
  .when { grid-template-columns: auto auto; justify-content: space-between; width: 100%; }
  .earlier { grid-template-columns: minmax(0, 1fr); row-gap: 1rem; }
  .earlier li { flex-direction: column; gap: 0.1rem; }
  .spells { grid-template-columns: minmax(0, 1fr); }
  .spells-h, .spell-list, .gear, .stick { grid-column: 1; }
  .side { grid-template-columns: minmax(0, 1fr); grid-template-areas: "h" "pic" "a" "b"; }
  .goal, .walker { --hpx: calc(var(--px) * 1.1); }
  .stage { aspect-ratio: 16 / 10; }
  .cont { grid-template-columns: minmax(0, 1fr); row-gap: 2.5rem; }
  .pad { justify-self: start; }
}

/* ---------- phone ---------- */
@media (max-width: 47.99em) {
  .goal, .walker { --hpx: calc(var(--px) * 0.9); }
  .opening { --pad: 1.5rem; --px: clamp(5px, 0.85svh, 8px); }
  .lights i:nth-child(even) { display: none; }
  .lights i::before { width: 12rem; }
  .lights i::after { width: 6rem; }
  .lights b { left: -4rem; width: 8rem; }
  .talk { align-items: stretch; margin-top: 1.25rem; }
  .cta { gap: 0.75rem; }
  .cta .button { padding: 0 1rem; min-width: 0; }
  .pick { gap: 0.375rem; }
  .pick button { width: 3rem; height: 3rem; }
  .spell-list { grid-template-columns: minmax(0, 1fr); }
  .slots th { width: 42%; }
  .boss-talk { grid-template-columns: minmax(0, 1fr); }
  .count { font-size: 34vw; }
  .enemy { min-width: 0; left: 3%; }
  .hp i { width: 1.2rem; }
}

/* ---------- motion: transform, opacity and stepped frames; content stays visible without script ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .lines [data-line] { transform: translateY(105%); animation: line-up 800ms steps(9, end) forwards; animation-delay: calc(var(--i, 0) * 140ms + 150ms); }
  .js [data-rise] { opacity: 0; transform: translateY(22px); animation: rise 640ms steps(5, end) forwards; animation-delay: calc(var(--i, 0) * 160ms + 150ms); }
  .js [data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity 520ms steps(5, end), transform 520ms steps(5, end); transition-delay: calc(var(--i, 0) * 100ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .char { animation: bob 640ms steps(1) infinite; }
  .dribble { animation: bounce 640ms infinite; }
  .pace { animation: patrol 14s infinite; }
  .stands::after { animation: twinkle 2.4s steps(1) infinite; }
  .lights i::before { animation: flicker 7s steps(1) infinite; }
  .lights i:nth-child(2n)::before { animation-delay: -3s; }
  .lights i:nth-child(3n)::before { animation-delay: -5s; }
  .more { animation: cursor 800ms steps(1) infinite; }
  .caret { animation: cursor 800ms steps(1) infinite; }
  .count { animation: pulse 1s steps(1) infinite; }
}
@keyframes line-up { to { transform: none; } }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes bob { 0% { transform: translateY(0); } 50% { transform: translateY(calc(-0.6 * var(--px))); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); animation-timing-function: steps(4, end); } 50% { transform: translateY(calc((1 - var(--hy)) * 22 * var(--px) - 4 * var(--px) - 0.3rem)); animation-timing-function: steps(4, end); } }
@keyframes patrol {
  0% { transform: translateX(0) scaleX(1); animation-timing-function: steps(70, end); }
  49.9% { transform: translateX(calc(100cqw - var(--cw) * var(--px))) scaleX(1); }
  50% { transform: translateX(calc(100cqw - var(--cw) * var(--px))) scaleX(-1); animation-timing-function: steps(70, end); }
  99.9% { transform: translateX(0) scaleX(-1); }
  100% { transform: translateX(0) scaleX(1); }
}
@keyframes flicker { 0%, 100% { opacity: 0.1; } 92% { opacity: 0.04; } 94% { opacity: 0.1; } 96% { opacity: 0.02; } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes cursor { 50% { opacity: 0; } }
@keyframes pulse { 0%, 100% { transform: none; } 50% { transform: translateY(-4px); } }
