/* Quick play — /play and /fight/<id>.
   "Sticker sheet": one flat cobalt ground, chunky black outlines, yellow for
   the thing to press, and every monster framed in a comic panel. Phone-first,
   one column. Text colours are checked against the ground for contrast —
   keep red and green off the blue (they fail); they live inside white cards. */

:root {
    --ground: #2447F9;
    --ink: #111111;
    --white: #FFFFFF;
    --soft: #DCE3FF;          /* secondary text on the ground */
    --sun: #FFD23F;           /* primary action */
    --sun-soft: #FFE07A;      /* warning text on the ground */
    --coral: #FF5A4E;         /* damage, low health */
    --mint: #3DDC84;          /* healing, full health */
    --panel-warm: #FFE8A3;    /* comic panel behind your monster */
    --panel-cool: #BDE4FF;    /* comic panel behind the opponent */
    --display: "Baloo 2", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
    --body: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
    --step: 8px;
}

* { box-sizing: border-box; }

html { background: var(--ground); }

body {
    margin: 0;
    background: var(--ground);
    color: var(--white);
    font-family: var(--body);
    font-weight: 600;
    font-size: 17px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

.shell {
    max-width: 460px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: calc(var(--step) * 2) calc(var(--step) * 2.75) calc(var(--step) * 5);
    padding-bottom: max(calc(var(--step) * 5), env(safe-area-inset-bottom));
}

/* ---------- top bar ---------- */
.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--step);
    min-height: 44px;
    margin-bottom: var(--step);
}
.bar-name { color: var(--white); font-size: 15px; font-weight: 800; text-decoration: none; }
.bar-coins {
    font-family: var(--body); font-size: 14px; font-weight: 800;
    color: var(--ink); background: var(--sun);
    border: 3px solid var(--ink); border-radius: 999px;
    padding: 2px 12px; min-height: 34px;
}
.bar-coins:disabled { color: var(--ink); }

/* ---------- type ---------- */
h1 {
    margin: calc(var(--step) * 2) 0 var(--step);
    font-family: var(--display);
    font-size: 38px; line-height: 1; font-weight: 800;
    color: var(--white);
    overflow-wrap: anywhere;
}
.lede { margin: 0 0 calc(var(--step) * 2.5); max-width: 36ch; }
.note { margin: calc(var(--step) * 2) 0 0; color: var(--soft); font-size: 15px; min-height: 1.45em; }
.note.warn { color: var(--sun-soft); font-weight: 800; }
.quiet { color: var(--soft); }
.legal { font-size: 13px; }
.legal a { color: var(--white); }

/* ---------- the paper ---------- */
.paper {
    position: relative;
    aspect-ratio: 1;
    background: var(--white);
    border: 5px solid var(--ink);
    border-radius: 26px;
    box-shadow: 0 8px 0 var(--ink);
    overflow: hidden;
}
.paper canvas, .paper img { display: block; width: 100%; height: 100%; }
.paper canvas { touch-action: none; cursor: crosshair; transform-origin: 0 0; }
/* Shown only while the paper is zoomed in: one tap back to the whole drawing. */
.zoom-reset {
    position: absolute; right: 10px; top: 10px; z-index: 2;
    font-family: var(--display); font-weight: 700; font-size: 14px; line-height: 1;
    color: var(--ink); background: var(--sun);
    border: 3px solid var(--ink); border-radius: 999px;
    padding: 7px 12px; box-shadow: 0 3px 0 var(--ink);
}
.pinch-tip { margin: calc(var(--step) * 1.5) 0 0; font-size: 14px; color: var(--soft); text-align: center; }
.paper img { object-fit: contain; }
.paper-hint {
    position: absolute; inset: 0; margin: 0;
    display: grid; place-items: center;
    font-family: var(--display); font-weight: 600; font-size: 22px;
    color: #6B7499;
    pointer-events: none;
}

/* the generation wait: a sliding chunk under the drawing (the only looping
   motion), plus a clock in the text so the screen visibly ticks even where the
   animation doesn't run */
.paper-wait img { opacity: .5; }
.working {
    position: relative; height: 18px; margin-top: calc(var(--step) * 3);
    background: var(--white);
    border: 3px solid var(--ink); border-radius: 999px;
    overflow: hidden;
}
.working i {
    position: absolute; top: 0; bottom: 0; left: 0; width: 34%;
    background: var(--sun); border-right: 3px solid var(--ink); border-left: 3px solid var(--ink);
    will-change: transform;
    animation: working 1.4s ease-in-out infinite alternate;
}
@keyframes working { from { transform: translate3d(-10%, 0, 0); } to { transform: translate3d(205%, 0, 0); } }
.clock { color: var(--soft); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- drawing tools ---------- */
.tools {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: calc(var(--step) * 1.5) calc(var(--step) * 2);
    margin: calc(var(--step) * 3) 0 calc(var(--step) * 2);
}
.swatches, .sizes, .edits { display: flex; align-items: center; gap: 8px; }
.edits { margin-left: auto; }

.swatch, .size {
    width: 38px; height: 38px; padding: 0;
    border-radius: 50%;
    border: 3px solid var(--white);
    background: var(--white);
    display: grid; place-items: center;
}
.swatch i { width: 100%; height: 100%; border-radius: 50%; background: var(--c); }
.swatch[data-eraser] i {
    background: var(--white);
    background-image: linear-gradient(45deg, transparent 43%, var(--coral) 43% 57%, transparent 57%);
}
.size i { border-radius: 50%; background: var(--ink); width: var(--d); height: var(--d); }
.swatch[aria-checked="true"], .size[aria-checked="true"] { box-shadow: 0 0 0 4px var(--sun); }

/* ---------- buttons ---------- */
.go {
    display: block; width: 100%;
    font-family: var(--display); font-size: 23px; font-weight: 800; line-height: 1.1;
    color: var(--ink); background: var(--sun);
    border: 4px solid var(--ink); border-radius: 18px;
    min-height: 62px; padding: 4px 16px;
    margin-top: calc(var(--step) * 2);
    box-shadow: 0 6px 0 var(--ink);
}
#make { font-size: 19px; }            /* the longest label: keep it on one line at 360px */
.go:not(:disabled):active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.go:disabled { background: #AEBBFF; color: #3A4CB0; border-color: #1C2F9E; box-shadow: 0 6px 0 #1C2F9E; }

.tool, .alt {
    font-family: var(--display); font-size: 17px; font-weight: 600; line-height: 1.1;
    color: var(--ink); background: var(--white);
    border: 3px solid var(--ink); border-radius: 14px;
    min-height: 48px; padding: 2px 10px;
    box-shadow: 0 4px 0 var(--ink);
}
.row .alt { font-size: 16px; }
.tool { min-height: 40px; font-size: 15px; }
.tool:not(:disabled):active, .alt:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.tool:disabled, .alt:disabled { background: #AEBBFF; color: #3A4CB0; border-color: #1C2F9E; box-shadow: 0 4px 0 #1C2F9E; }
.row { display: flex; gap: calc(var(--step) * 1.25); margin-top: calc(var(--step) * 2); }
.row .alt { flex: 1 1 0; }

button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }

/* ---------- comic panels: every monster sits in a framed rectangle ----------
   Generated art is a mix of cut-outs and full painted scenes (the hit and pose
   frames have backgrounds). A panel gives both the same frame, so nothing
   depends on background removal being clean. */
.panel {
    background:
        radial-gradient(rgba(17, 17, 17, .13) 1.5px, transparent 1.7px) 0 0 / 10px 10px,
        var(--panel-warm);
    border: 5px solid var(--ink);
    box-shadow: 0 7px 0 var(--ink);
}
.reveal-monster, .fighter-art img { image-rendering: auto; }

/* ---------- the reveal ---------- */
.reveal {
    position: relative; aspect-ratio: 1;
    border-radius: 26px;
    overflow: hidden;
}
.reveal img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.reveal-drawing { background: var(--white); }
/* The monster wipes in over the doodle, top to bottom, once; then the paper goes. */
.reveal.play .reveal-monster { animation: wipe 1.3s steps(24) both; }
.reveal.play .reveal-drawing { animation: fadeout .35s 1.25s both; }
.reveal.shown .reveal-drawing { display: none; }
/* No art (missing, or it failed to load): a plain tile, never a broken image. */
.reveal.blank .reveal-monster { display: none; }
.reveal.blank.shown::before {
    content: "?";
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font-family: var(--display); font-weight: 800; font-size: 140px; color: var(--ink);
}
@keyframes wipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes fadeout { to { opacity: 0; } }

.stats {
    display: grid; grid-template-columns: auto 1fr auto;
    gap: 8px 12px; align-items: center;
    margin: calc(var(--step) * 4) 0 calc(var(--step) * 2);
    font-size: 15px;
}
.stats dt { color: var(--soft); }
.stats dd { margin: 0; }
.stats .track {
    height: 14px; background: var(--white);
    border: 3px solid var(--ink); border-radius: 999px; overflow: hidden;
}
.stats .track i { display: block; height: 100%; background: var(--sun); }
.stats .num { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.moves { margin: 0; color: var(--soft); font-size: 15px; }
.moves b { color: var(--white); font-weight: 800; }

/* ---------- the arena ---------- */
/* The move banner: names what is happening, in big type, above the fighters.
   It keeps its height when empty so the arena never jumps. */
.banner {
    margin: var(--step) 0 0; min-height: 58px;
    display: grid; place-items: center; text-align: center;
}
.banner b {
    display: inline-block; max-width: 100%;
    font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.15;
    color: var(--ink); background: var(--sun);
    border: 4px solid var(--ink); border-radius: 14px;
    padding: 5px 16px; box-shadow: 0 5px 0 var(--ink);
    transform: rotate(-2deg);
    overflow-wrap: anywhere;
}
.banner b:empty { visibility: hidden; }
.banner.right b { background: var(--panel-cool); transform: rotate(2deg); }
.banner.big b { background: var(--coral); font-size: 34px; transform: rotate(-3deg); }
.banner.in b { animation: banner-in .32s ease-out; }
/* Scale only, never opacity: the banner must be readable from its first frame. */
@keyframes banner-in { from { scale: .6; } 60% { scale: 1.12; } to { scale: 1; } }

.arena {
    position: relative;
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: start; gap: var(--step);
    margin-top: var(--step);
}
.versus {
    margin: 26% 0 0; width: 44px; height: 44px;
    display: grid; place-items: center;
    font-family: var(--display); font-weight: 800; font-size: 19px;
    color: var(--ink); background: var(--sun);
    border: 3px solid var(--ink); border-radius: 50%;
}
.fighter { min-width: 0; }
.fighter-art {
    position: relative; aspect-ratio: 1; width: 100%;
    display: grid; place-items: center;
    border-radius: 18px;
}
.fighter[data-seat="left"] .fighter-art { transform: rotate(-2.5deg); }
.fighter[data-seat="right"] .fighter-art {
    transform: rotate(2.5deg);
    background-color: var(--panel-cool);
}
/* Pinned to the square, not sized by percentage in the grid: Safari won't
   resolve a % height against an aspect-ratio box, so a tall image stretched
   its own cell and dropped out of line with the other fighter. */
.fighter-art img {
    /* Inset, so the panel colour shows as a mat around the art. Generated art
       now fills its square, and without the mat it would cover the warm (you)
       and cool (opponent) panel colours that tell the two sides apart. */
    position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px);
    object-fit: contain; border-radius: 8px;
}
.fighter[data-seat="right"] .fighter-art img { transform: scaleX(-1); }
.fighter-art.blank::before {
    content: "?";
    font-family: var(--display); font-weight: 800; font-size: 72px; color: var(--ink);
}
.fighter-art.blank img { display: none; }
.fighter.acting .fighter-name::before {
    content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px;
    border-radius: 50%; background: var(--sun); border: 2px solid var(--ink);
}
.fighter.lunge[data-seat="left"] .fighter-art { animation: lunge-r .46s ease-in-out; z-index: 1; }
.fighter.lunge[data-seat="right"] .fighter-art { animation: lunge-l .46s ease-in-out; z-index: 1; }
.fighter.struck .fighter-art { animation: struck .36s linear; }
.fighter.down[data-seat] .fighter-art { opacity: .55; filter: grayscale(1); transform: rotate(-14deg) translateY(8%); transition: all 1s; }
/* The attacker winds back, then throws itself most of the way across. */
@keyframes lunge-r { 18% { transform: translateX(-10%) rotate(-6deg); } 55% { transform: translateX(46%) rotate(8deg) scale(1.08); } }
@keyframes lunge-l { 18% { transform: translateX(10%) rotate(6deg); } 55% { transform: translateX(-46%) rotate(-8deg) scale(1.08); } }
.fighter.dodge[data-seat="left"] .fighter-art { animation: dodge-l .36s ease-out; }
.fighter.dodge[data-seat="right"] .fighter-art { animation: dodge-r .36s ease-out; }
@keyframes dodge-l { 45% { transform: translateX(-22%) rotate(-10deg); } }
@keyframes dodge-r { 45% { transform: translateX(22%) rotate(10deg); } }
.fighter.healed .fighter-art::after {
    content: ""; position: absolute; inset: 12%;
    border: 6px solid var(--mint); border-radius: 50%;
    animation: healed .6s ease-out both;
}
@keyframes healed { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.arena.quake { animation: quake .3s linear; }
@keyframes quake { 20% { transform: translate(-5px, 3px); } 45% { transform: translate(5px, -3px); } 70% { transform: translate(-3px, 2px); } }

/* The impact star: placed over whoever was hit and animated from the script. */
.burst {
    position: absolute; left: 0; top: 0; width: 100px; height: 100px;
    transform: translate(-50%, -50%);
    opacity: 0; pointer-events: none; z-index: 2; overflow: visible;
}
.burst polygon { fill: var(--sun); stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.burst.crit polygon { fill: var(--coral); }
@keyframes struck {
    0% { filter: brightness(3); }
    20% { transform: translateX(-9%) rotate(-5deg); filter: none; }
    50% { transform: translateX(9%) rotate(5deg); } 80% { transform: translateX(-4%); }
}

.hit {
    position: absolute; right: 0; top: 0; z-index: 3;
    font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.3;
    color: var(--ink); background: var(--coral);
    border: 3px solid var(--ink); border-radius: 999px;
    padding: 0 10px;
    transform: rotate(10deg);
    opacity: 0; pointer-events: none;
}
.hit.heal { background: var(--mint); }
.hit.miss { background: var(--white); font-size: 17px; }
.hit.crit { font-size: 30px; }
.hit.pop { animation: pop 1.2s ease-out; }

/* A label on the monster for things that are not damage: a stat going up or
   down, a status landing, a shield. */
.badge {
    position: absolute; left: 50%; bottom: 7%; z-index: 3;
    font-family: var(--display); font-weight: 800; font-size: 15px; line-height: 1.5;
    color: var(--ink); background: var(--white);
    border: 3px solid var(--ink); border-radius: 999px;
    padding: 0 10px; white-space: nowrap;
    transform: translateX(-50%);
    opacity: 0; pointer-events: none;
}
.badge.up { background: var(--mint); }
.badge.down { background: var(--coral); }
.badge.pop { animation: badge 1.3s ease-out; }
@keyframes badge {
    0% { opacity: 0; transform: translateX(-50%) scale(.5); }
    14% { opacity: 1; transform: translateX(-50%) scale(1.15); }
    24% { transform: translateX(-50%) scale(1); }
    82% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-25%); }
}
@keyframes pop {
    0% { opacity: 0; transform: rotate(10deg) scale(.4); }
    18% { opacity: 1; transform: rotate(10deg) scale(1.15); }
    30% { transform: rotate(10deg) scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: rotate(10deg) translateY(-30%); }
}

/* Two lines, always: full names fit, and both health bars stay level. */
.fighter-name {
    margin: 14px 0 6px;
    font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1.15;
    min-height: 2.3em;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; overflow-wrap: anywhere;
}
.fighter-owner {
    margin: 6px 0 0; font-size: 13px; color: var(--soft);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.45em;
}
.hp {
    height: 18px; background: var(--white);
    border: 3px solid var(--ink); border-radius: 999px; overflow: hidden;
}
.hp i { display: block; height: 100%; width: 100%; background: var(--mint); transition: width .6s ease-out, background-color .4s; }
.hp.mid i { background: var(--sun); }
.hp.low i { background: var(--coral); }

.call {
    margin: calc(var(--step) * 2.5) 0 0;
    min-height: 5.2em;
    background: var(--white); color: var(--ink);
    border: 4px solid var(--ink); border-radius: 20px;
    padding: 14px 16px;
    font-weight: 800; line-height: 1.35;
    box-shadow: 0 6px 0 var(--ink);
}

/* ---------- result ---------- */
#r-title { font-size: 60px; line-height: .95; margin-top: calc(var(--step) * 2.5); }
[data-result="win"] #r-title { color: var(--sun); text-shadow: 0 5px 0 var(--ink); }
.rating { margin: 0 0 var(--step); color: var(--soft); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- inbox ---------- */
.list { list-style: none; margin: 0 0 calc(var(--step) * 2); padding: 0; display: grid; gap: var(--step); }
.list a {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 10px 14px; min-height: 52px;
    background: var(--white); color: var(--ink); text-decoration: none;
    border: 3px solid var(--ink); border-radius: 14px;
    font-size: 15px; line-height: 1.3;
}
.list .outcome { flex: none; font-weight: 800; }
.list .held { color: #0B7A3B; }
.list .fell { color: #C62A1F; }
.list .new::before {
    content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px;
    border-radius: 50%; background: var(--coral); border: 2px solid var(--ink);
}
.list .empty { padding: 4px 0; color: var(--soft); }
.list button {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    width: 100%; padding: 10px 14px; min-height: 52px; text-align: left;
    font: inherit; font-size: 15px; line-height: 1.3;
    background: var(--white); color: var(--ink);
    border: 3px solid var(--ink); border-radius: 14px;
}
.list .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.list .who span { overflow: hidden; text-overflow: ellipsis; }
.list .who small { display: block; color: #4A5578; font-size: 13px; }
.list img.face {
    flex: none; width: 40px; height: 40px; object-fit: cover;
    border: 2px solid var(--ink); border-radius: 10px; background: var(--panel-warm);
}
.list.ranked { counter-reset: place; }
.list.ranked li { counter-increment: place; }
.list.ranked .who::before {
    content: counter(place); flex: none; width: 1.6em;
    font-family: var(--display); font-weight: 800; font-size: 18px; text-align: center;
}
.sub {
    margin: calc(var(--step) * 4) 0 var(--step);
    font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.15;
}
.alt.wide { display: block; width: 100%; margin-top: calc(var(--step) * 2); }
.quiet-button { background: transparent; color: var(--soft); border-color: var(--soft); box-shadow: none; }
.quiet-button.armed { background: var(--coral); color: var(--ink); border-color: var(--ink); }

/* The pick-your-fighter grid: two panels across on a phone. */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(var(--step) * 2); }
.grid button {
    padding: 0; font: inherit; color: var(--white); text-align: left;
    background: none; border: 0;
}
.grid .panel {
    display: block; position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden;
}
.grid .panel img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; border-radius: 10px; }
.grid .chosen .panel { outline: 5px solid var(--sun); outline-offset: 2px; }
.grid b { display: block; margin-top: 12px; font-family: var(--display); font-weight: 800; font-size: 17px; line-height: 1.15; overflow-wrap: anywhere; }
.grid small { color: var(--soft); font-size: 13px; }

/* The record: big numbers in a three-across grid. */
.record { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--step); margin: 0 0 calc(var(--step) * 2); }
.record div { background: var(--white); color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; padding: 8px 10px; }
.record dt { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #4A5578; }
.record dd { margin: 0; font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.1; }

/* ---------- the tab bar ---------- */
.tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
    display: flex; justify-content: center; gap: 4px;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    background: var(--white); border-top: 4px solid var(--ink);
}
.tabs[hidden] { display: none; }
.tabs button {
    position: relative; flex: 1 1 0; max-width: 104px; min-height: 46px; padding: 4px 2px;
    font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.1;
    color: var(--ink); background: transparent;
    border: 3px solid transparent; border-radius: 12px;
}
.tabs button[aria-current="page"] { background: var(--sun); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.tab-badge {
    position: absolute; top: -6px; right: 4px; min-width: 20px; padding: 0 5px;
    font-size: 12px; line-height: 20px; text-align: center;
    color: var(--ink); background: var(--coral);
    border: 2px solid var(--ink); border-radius: 999px;
}
/* Room for the bar, so the last thing on a screen is never under it. */
#app[data-tabs] { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* A monster that is still being made, in the roster. */
.grid .making .panel { display: grid; place-items: center; background: var(--white); }
.grid .making .panel img { opacity: .45; }
.grid .making .panel::after {
    content: "Being made"; position: relative; z-index: 1;
    font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--ink);
    background: var(--sun); border: 3px solid var(--ink); border-radius: 999px; padding: 2px 10px;
}

/* The "draw a new monster" tile at the end of the roster. */
.grid .new-tile .panel {
    display: grid; place-items: center; background: transparent;
    border: 4px dashed var(--soft); box-shadow: none;
    font-family: var(--display); font-weight: 800; font-size: 64px; color: var(--soft);
}

/* ---------- account form ---------- */
form label { display: block; margin-bottom: calc(var(--step) * 1.5); font-size: 15px; font-weight: 800; }
form input {
    display: block; width: 100%; margin-top: 6px;
    font-family: var(--body); font-size: 17px; font-weight: 600; color: var(--ink);
    background: var(--white); border: 3px solid var(--ink); border-radius: 14px;
    min-height: 52px; padding: 0 14px;
}
form input:focus { outline: 3px solid var(--sun); outline-offset: 2px; }

/* ---------- toast ---------- */
.toast {
    /* At the top, so it never sits on the button the player is about to press. */
    position: fixed; left: 50%; top: max(10px, env(safe-area-inset-top));
    transform: translateX(-50%);
    margin: 0; padding: 10px 18px; max-width: calc(100vw - 32px);
    background: var(--white); color: var(--ink);
    border: 3px solid var(--ink); border-radius: 999px;
    box-shadow: 0 4px 0 var(--ink);
    font-size: 15px; font-weight: 800; z-index: 5;
}

@media (min-width: 700px) {
    .shell { padding-top: calc(var(--step) * 4); }
}

@media (prefers-reduced-motion: reduce) {
    .working i { animation: none; width: 100%; border: 0; }
    .reveal.play .reveal-monster, .reveal.play .reveal-drawing,
    .fighter.lunge .fighter-art, .fighter.struck .fighter-art, .fighter.dodge .fighter-art,
    .fighter.healed .fighter-art::after, .arena.quake { animation: none; }
    .fighter.healed .fighter-art::after { display: none; }
    .reveal.play .reveal-drawing { display: none; }
    .hit.pop { animation: none; opacity: 1; }
    .hp i, .fighter.down .fighter-art { transition: none; }
    .go:active, .tool:active, .alt:active { transform: none; }
}
