:root {
    --ink: #1d1d1b;
    --ink-2: #4a463f;
    --muted: #7a7366;
    --cream: #fbf6ea;
    --paper: #fffdf7;
    --tile: #ece5d5;
    --line: #ddd3bf;
    --yellow: #ffc72c;
    --yellow-2: #f2b200;
    --red: #c8102e;
    --red-2: #8e0b20;
    --green: #1f8a4c;
    --green-bg: #e6f4ea;
    --bad-bg: #fbe7e7;
    --display: "Archivo Black", "Archivo", system-ui, sans-serif;
    --body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
    --radius: 14px;
    --shadow: 0 1px 0 rgba(0,0,0,.04), 0 8px 24px -12px rgba(60,40,10,.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--body);
    color: var(--ink);
    background-color: var(--cream);
    /* Grey diner floor tile */
    background-image:
        linear-gradient(45deg, rgba(0,0,0,.025) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.025) 75%),
        linear-gradient(45deg, rgba(0,0,0,.025) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.025) 75%);
    background-size: 56px 56px;
    background-position: 0 0, 28px 28px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}
/* itch.io build: the page may sit in an iframe with scrolling="no", so the
   body is the scroll container instead of the document */
html.static-build { height: 100%; overflow: hidden; }
html.static-build body { height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }
main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px 48px; outline: none; }
a { color: var(--red); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; line-height: 1.05; margin: 0; }
button { font: inherit; color: inherit; }
.ico { width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -0.2em; }

/* ---------- top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 24px;
    padding: 10px 20px;
    background: var(--ink); color: #fff;
    border-bottom: 4px solid var(--yellow);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-tile {
    width: 34px; height: 34px; border-radius: 4px; background: var(--red);
    box-shadow: inset 0 0 0 3px var(--red-2), 0 0 0 3px #77736a;
    position: relative;
}
.brand-tile::after { content: ""; position: absolute; inset: 9px; border-radius: 2px; background: var(--yellow); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-family: var(--display); font-weight: 400; font-size: 1.15rem; text-transform: uppercase; letter-spacing: .02em; color: var(--yellow); }
.brand-text small { font-size: .68rem; text-transform: uppercase; letter-spacing: .16em; color: #b9b3a6; margin-top: 3px; }
.nav { display: flex; gap: 4px; }
.nav a { color: #e9e4d8; text-decoration: none; font-weight: 700; font-size: .92rem; padding: 7px 12px; border-radius: 8px; }
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a.active { background: var(--yellow); color: var(--ink); }
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { font-weight: 700; font-size: .9rem; color: #e9e4d8; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 10px; cursor: pointer; text-decoration: none;
    font-weight: 800; padding: 10px 16px; font-size: .95rem; line-height: 1.1;
    transition: transform .08s ease, box-shadow .15s ease, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 11px; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: 14px 22px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-yellow { background: var(--yellow); color: var(--ink); box-shadow: 0 3px 0 var(--yellow-2); }
.btn-yellow:hover { background: #ffd04d; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #33322e; }
.btn-ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn-ghost-dark { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn-ghost-dark:hover { background: var(--ink); color: #fff; }
.link-btn { background: none; border: 0; padding: 0; color: var(--red); font-weight: 700; cursor: pointer; text-decoration: underline; }
.link-btn:disabled { color: var(--muted); cursor: default; text-decoration: none; opacity: .6; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* ---------- shared bits ---------- */
.eyebrow { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); margin: 0 0 8px; }
.eyebrow b { color: var(--red); }
.lede { font-size: 1.08rem; color: var(--ink-2); max-width: 60ch; }
.sub { color: var(--muted); margin: 6px 0 18px; }
.notice { background: var(--paper); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; font-size: .92rem; color: var(--ink-2); max-width: 60ch; }
.notice-bad { border-color: var(--red); background: var(--bad-bg); }
.tag { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; background: var(--tile); color: var(--ink-2); }
.tag-pass { background: var(--green); color: #fff; }
.tag-lock { background: #d8d2c4; color: var(--muted); }
.back { display: inline-block; font-weight: 700; text-decoration: none; color: var(--ink-2); margin-bottom: 10px; }
.back:hover { color: var(--red); }
.page-head { padding: 34px 0 20px; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3.2rem); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 44px 0 28px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); text-transform: uppercase; }
.hero h1 span { color: var(--red); }
.hero .lede { margin: 18px 0 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.hero-plate { position: relative; justify-self: center; width: min(320px, 80vw); }
.hero-plate .plate-svg { width: 100%; filter: drop-shadow(0 18px 24px rgba(60,40,10,.25)); transform: rotate(-6deg); }
.hero-call {
    position: absolute; left: -18%; bottom: 10%; max-width: 260px;
    background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 12px 12px 12px 2px;
    font-weight: 700; font-size: .9rem; box-shadow: var(--shadow); transform: rotate(-2deg);
}
.hero-call span { font-family: var(--display); color: var(--yellow); margin-right: 4px; }

.stats-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0 34px; }
.stats-strip > div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.stats-strip b { font-family: var(--display); font-weight: 400; font-size: 1.5rem; }
.stats-strip span { color: var(--muted); font-size: .85rem; }

/* ---------- levels ---------- */
.levels h2 { font-size: 1.8rem; }
.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.level-card {
    position: relative; display: flex; flex-direction: column; gap: 8px;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 18px 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow);
    transition: transform .12s ease, border-color .12s;
}
a.level-card:hover { transform: translateY(-2px); border-color: var(--ink); }
.level-card.passed { border-color: var(--green); }
.level-card.locked { opacity: .55; }
.level-card h3 { font-size: 1.2rem; padding-right: 36px; }
.level-card p { margin: 0; color: var(--ink-2); font-size: .92rem; flex: 1; }
.level-num { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; background: var(--red); color: var(--yellow); font-family: var(--display); }
.level-card.locked .level-num { background: #b5ae9f; color: #fff; }
.pips { display: flex; gap: 4px; }
.pips i { flex: 1; height: 6px; border-radius: 3px; background: var(--tile); }
.pips i.ok { background: var(--green); }
.pips i.bad { background: var(--red); }
.level-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }

/* ---------- chart ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 16px; }
.chart-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.chart-card h2 { font-size: 1.35rem; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 3px solid var(--yellow); display: inline-block; }
.chart-card p { margin: 0 0 10px; color: var(--ink-2); }
.chart-split { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
.chart-split > .plate-svg { width: 100%; }
.legend-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px dashed var(--line); }
.legend-row:first-child { border-top: 0; }
.legend-icons { display: flex; flex: 0 0 auto; min-width: 52px; }
.legend-icons svg + svg { margin-left: -14px; }
.legend-row b { display: block; }
.legend-row span { color: var(--muted); font-size: .9rem; }
.spot-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; font-size: .9rem; color: var(--ink-2); }
.spot-list b { display: inline-block; min-width: 34px; color: var(--red); }
.note { font-size: .9rem; background: #fff6d6; border-radius: 8px; padding: 8px 12px; }
.plate-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.plate-row figure { margin: 0; text-align: center; }
.plate-row figcaption { font-size: .85rem; color: var(--muted); }
.plate-row figcaption b { display: block; color: var(--ink); }
.rules { margin: 0; padding-left: 20px; color: var(--ink-2); }
.rules li { margin: 6px 0; }
.learn-go { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 0; text-align: center; }
.learn-go .sub { margin: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }

/* ---------- plates ---------- */
.plate-svg { display: block; width: 100%; height: auto; overflow: visible; }
.plate-body { fill: #fbfaf5; stroke: #d9d3c5; stroke-width: 2; }
.plate-rope { fill: none; stroke: #9b6b3f; stroke-width: 6; stroke-dasharray: 2 4; opacity: .75; }
.plate-well { fill: #f7f4ec; stroke: #ebe4d4; stroke-width: 2; }
.spot { fill: rgba(29,29,27,.035); stroke: rgba(29,29,27,.16); stroke-width: 1.5; stroke-dasharray: 3 4; transition: fill .1s; }
.spot-free { stroke-dasharray: 1 5; stroke: rgba(29,29,27,.1); }
.spot.hot { fill: rgba(255,199,44,.55); stroke: var(--yellow-2); stroke-dasharray: none; }
.spot-label { font: 800 15px var(--body); fill: var(--red); paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.mark { cursor: grab; filter: drop-shadow(0 2px 1.5px rgba(0,0,0,.28)); }
.mark.is-selected > * { outline: none; }
.mark.is-selected { filter: drop-shadow(0 0 0 #000) drop-shadow(0 0 3px var(--red)) drop-shadow(0 0 3px var(--red)); }

/* ---------- play ---------- */
.play { padding-top: 18px; }
.play-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 14px; }
.play-head .back { margin: 0; }
.play-title { display: flex; flex-direction: column; line-height: 1.1; }
.play-title .eyebrow { margin: 0; }
.play-title b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: .82rem; font-weight: 700; }
.chip-btn { cursor: pointer; }
.chip-btn:hover { border-color: var(--ink); }

.call-bar {
    display: flex; align-items: center; gap: 14px;
    background: var(--ink); color: #fff; border-radius: var(--radius);
    padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.mark-tile { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 4px; background: var(--red); box-shadow: inset 0 0 0 4px var(--red-2), 0 0 0 4px #6d6a62, 0 0 0 5px #3b3a36; }
.call-text { flex: 1; font-size: clamp(1.1rem, 2.6vw, 1.55rem); font-weight: 800; line-height: 1.3; }
.call-text > b { font-family: var(--display); font-weight: 400; color: var(--yellow); margin-right: 6px; }
.call-text .sep { color: var(--yellow); font-style: normal; margin: 0 10px; }
.call-hidden { color: #b9b3a6; font-weight: 600; }
.call-hidden .link-btn { color: var(--yellow); }
/* Floats on the call bar so the one-time download can't shift the plates mid-drag */
.call-bar { position: relative; }
.voice-status { position: absolute; right: 12px; top: -11px; padding: 2px 9px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: .72rem; font-weight: 800; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.voice-status:empty { display: none; }
.clock { font-variant-numeric: tabular-nums; font-weight: 800; color: #b9b3a6; min-width: 52px; text-align: right; }

.play-body { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
.play-body > * { min-width: 0; }
.line { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 340px)); justify-content: center; gap: 14px; }
.plate-card { background: var(--tile); border-radius: var(--radius); padding: 10px 12px 12px; border: 2px solid transparent; }
.plate-card .plate-svg { max-width: 300px; margin: 0 auto; }
.plate-card.is-right { border-color: var(--green); background: var(--green-bg); }
.plate-card.is-wrong { border-color: var(--red); background: var(--bad-bg); }
.plate-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.plate-num { font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.sizes { display: inline-flex; background: var(--paper); border-radius: 8px; padding: 2px; border: 1px solid var(--line); }
.sizes button { border: 0; background: transparent; padding: 4px 8px; border-radius: 6px; font-size: .75rem; font-weight: 800; cursor: pointer; color: var(--muted); }
.sizes button[aria-checked="true"] { background: var(--ink); color: #fff; }
.sizes button:disabled { cursor: default; }
.plate-tools { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: .88rem; font-weight: 700; }
.plate-tools span { color: var(--ink-2); }

.tray-wrap { position: sticky; top: 76px; }
@media (max-width: 760px) { .tray-wrap { top: auto; } }
.tray { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); max-height: calc(100vh - 96px); overflow-y: auto; }
.tray-help { margin: 0 0 8px; font-size: .86rem; color: var(--ink-2); min-height: 2.6em; }
.tray-group h4 { margin: 8px 0 4px; font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.tray-items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tray-item {
    display: flex; flex-direction: column; align-items: center; gap: 0;
    background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: 4px 2px 5px;
    /* app.js handles every touch on an item: sideways swipes scroll the tray, anything else drags */
    cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.tray-item:hover { border-color: var(--ink-2); }
.tray-item.selected { border-color: var(--red); background: #fff1c2; box-shadow: 0 0 0 2px var(--red) inset; }
.tray-item span { font-size: .7rem; font-weight: 700; line-height: 1.1; text-align: center; color: var(--ink-2); }
.tray-item svg { pointer-events: none; }
.tray .btn-block { margin-top: 14px; }
.kbd-help { font-size: .72rem; color: var(--muted); text-align: center; margin: 8px 0 0; }

.drag-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; opacity: 0; filter: drop-shadow(0 8px 10px rgba(0,0,0,.3)); }
.drag-ghost.show { opacity: .95; }

/* ---------- results ---------- */
.result-bar {
    position: sticky; bottom: 12px; z-index: 20; margin-top: 18px;
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    padding: 14px 18px; border-radius: var(--radius); color: #fff; box-shadow: 0 12px 30px -10px rgba(0,0,0,.4);
}
.result-bar.ok { background: var(--green); }
.result-bar.bad { background: var(--red-2); }
.result-bar.passed { background: var(--ink); border: 3px solid var(--yellow); }
.result-bar.passed b { color: var(--yellow); }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.result-bar b { font-family: var(--display); font-weight: 400; font-size: 1.4rem; display: block; }
.result-bar span { opacity: .9; font-weight: 700; }
.verdict { font-weight: 800; margin: 2px 0 6px; }
.verdict.ok { color: var(--green); }
.verdict.bad { color: var(--red); }
.issues { margin: 0 0 8px; padding-left: 18px; font-size: .88rem; }
.issues li { margin: 3px 0; }
details summary { cursor: pointer; font-weight: 800; font-size: .88rem; }
.key { display: grid; grid-template-columns: 110px 1fr; gap: 12px; margin-top: 8px; align-items: start; }
.key p { margin: 0 0 4px; }
.key-call { font-size: .95rem; }
.key-ticket { font-size: .82rem; color: var(--muted); }
.key-size { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.explain { margin: 4px 0; padding-left: 16px; font-size: .82rem; color: var(--ink-2); }

/* ---------- progress ---------- */
.table-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); overflow-x: auto; }
.table-card h2 { font-size: 1.2rem; margin-bottom: 10px; }
.progress-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.progress-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 6px 8px; border-bottom: 2px solid var(--line); }
.progress-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.progress-table tr.locked td { color: var(--muted); }
.bar { display: inline-block; vertical-align: middle; width: 90px; height: 8px; border-radius: 4px; background: var(--tile); overflow: hidden; margin-right: 8px; }
.bar i { display: block; height: 100%; background: var(--green); }
.history { margin-top: 16px; }
.history-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.recent, .missed { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.recent .dot { flex: 0 0 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--green); }
.recent li.bad .dot { background: var(--red); }
.recent small { display: block; color: var(--muted); }
.missed li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.missed span { font-weight: 800; color: var(--red); }

/* ---------- dialog, toast, footer ---------- */
.learn-dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(1100px, 94vw); max-height: 88vh; background: var(--cream); box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.learn-dialog::backdrop { background: rgba(20,18,14,.55); }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--ink); color: #fff; }
.learn-dialog .chart-grid { padding: 16px; }
.dialog-check { padding: 0 16px 18px; }
.toast-msg {
    position: fixed; left: 50%; bottom: 24px; z-index: 120; transform: translate(-50%, 30px); opacity: 0;
    background: var(--ink); color: var(--yellow); font-weight: 800; padding: 12px 18px; border-radius: 12px;
    transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 32px); text-align: center;
}
.toast-msg.show { opacity: 1; transform: translate(-50%, 0); }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding: 18px 20px; background: var(--ink); color: #b9b3a6; font-size: .8rem; }
.site-footer p { margin: 0; max-width: 70ch; }
.kdsites-credit { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; opacity: .85; }
.kdsites-credit:hover { opacity: 1; color: #fff; }
.kdsites-credit img { width: 25px; height: 28px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
    .play-body { grid-template-columns: 1fr; }
    .tray-wrap { position: sticky; top: auto; bottom: 0; z-index: 15; }
    .tray { border-radius: var(--radius) var(--radius) 0 0; box-shadow: 0 -10px 30px -12px rgba(0,0,0,.35); }
    /* One sideways-scrolling strip of items, so the plates stay in view */
    .tray-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
    .tray-group { display: flex; flex-direction: column; flex: 0 0 auto; }
    .tray-group h4 { margin: 0 0 3px; }
    .tray-items { display: flex; gap: 6px; }
    .tray-item { width: 66px; flex: 0 0 auto; scroll-snap-align: start; }
    .tray .btn-block { margin-top: 10px; padding: 12px; }
    .kbd-help { display: none; }
    .history-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    main { padding: 0 16px 40px; }
    /* Two rows on a phone; let it scroll away so the plates get the screen */
    .topbar { position: static; gap: 10px; padding: 8px 16px; flex-wrap: wrap; }
    .brand-text small { display: none; }
    .nav { order: 3; width: 100%; justify-content: space-between; }
    .nav a { flex: 1; text-align: center; }
    .hero { grid-template-columns: 1fr; padding-top: 26px; gap: 20px; }
    .hero-plate { width: 200px; }
    .hero-call { left: -40%; font-size: .78rem; max-width: 190px; }
    .stats-strip { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
    .stats-strip > div { padding: 10px 12px; }
    .stats-strip b { font-size: 1.05rem; }
    .stats-strip span { font-size: .72rem; }
    .chart-split { grid-template-columns: 1fr; }
    .chart-split > .plate-svg { max-width: 220px; margin: 0 auto; }
    .spot-list { grid-template-columns: 1fr; }
    .call-bar { flex-wrap: wrap; gap: 10px; padding: 12px; }
    .mark-tile { width: 30px; height: 30px; }
    .call-text { flex-basis: calc(100% - 50px); }
    /* Floats on the call bar so the one-time download can't shift the plates mid-drag */
.call-bar { position: relative; }
.voice-status { position: absolute; right: 12px; top: -11px; padding: 2px 9px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: .72rem; font-weight: 800; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.voice-status:empty { display: none; }
.clock { margin-left: auto; }
    .chips { margin-left: 0; }
    .line { grid-template-columns: 1fr; }
    .plate-card .plate-svg { max-width: 210px; }
    .key { grid-template-columns: 90px 1fr; }
    .tray { padding: 10px; }
    .tray-help { display: none; }
}

/* ---------- phone play screen ----------
   The call, plates and tray all fit on screen; only the plates scroll. This
   doesn't depend on the page scrolling, which some embeds (itch.io) block. */
@media (max-width: 760px) {
    body.playing { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
    body.playing .topbar, body.playing .site-footer { display: none; }
    body.playing main { display: flex; flex-direction: column; min-height: 0; padding: 0 12px; }
    body.playing .play { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 8px; }
    body.playing .play-head { flex: none; flex-wrap: nowrap; gap: 8px; margin-bottom: 8px; }
    body.playing .play-head .back { font-size: .85rem; white-space: nowrap; }
    body.playing .play-title .eyebrow { display: none; }
    body.playing .play-title b { font-size: 1rem; white-space: nowrap; }
    body.playing .chips { flex-wrap: nowrap; overflow-x: auto; margin-left: auto; scrollbar-width: none; }
    body.playing .chip { padding: 4px 9px; font-size: .75rem; white-space: nowrap; }
    body.playing .call-bar { flex: none; margin-bottom: 8px; padding: 8px 10px; gap: 8px; }
    body.playing .call-text { font-size: 1.05rem; }
    /* stretch: the desktop grid's align-items:start would let the tray grow to its strip's full width */
    body.playing .play-body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
    body.playing .line { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; align-content: start; }
    body.playing .plate-card { padding: 6px 10px 4px; }
    /* As big as the height left over between the call bar and the tray allows */
    body.playing .plate-card .plate-svg { max-width: min(340px, calc((100dvh - 390px) * .75)); }
    body.playing .tray-wrap { position: static; flex: none; margin: 0 -12px; }
    body.playing .tray { border-radius: var(--radius) var(--radius) 0 0; padding: 8px 10px; }
    body.playing .tray-group h4 { font-size: .6rem; }
    body.playing .tray-item { width: 60px; padding: 3px 2px 4px; }
    body.playing .tray-item svg { width: 40px; height: 40px; }
    body.playing .tray .btn-block { margin-top: 8px; padding: 10px; }
    body.playing .result { flex: none; }
    body.playing .result-bar { position: static; margin: 8px 0; padding: 10px 14px; }
    body.playing .result-bar b { font-size: 1.1rem; }
    body.playing .result-bar .btn-lg { padding: 10px 14px; font-size: .95rem; }
}
