* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0; user-select: none; -webkit-user-select: none;
  touch-action: none; overflow: hidden;
}
/* 560px was capping tablets to ~2/3 of the screen. Phones are all narrower
   than 560 so this changes nothing there, but an iPad now uses its width. */
#app { height: 100%; display: flex; flex-direction: column; max-width: min(100%, 820px); margin: 0 auto; }

#hdr { display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
#hdr .pill { background: #1e293b; border: 2px solid #334155; border-radius: 999px; padding: 6px 11px; font-weight: 800; font-size: 15px; min-width: 44px; min-height: 44px; display: flex; align-items: center; cursor: pointer; justify-content: center; color: inherit; font-family: inherit; }
#hdrHome { border: none; background: #38bdf8; color: #0f172a; font-size: 18px; }
#hdrStatus { flex: 1; min-width: 0; text-align: center; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #94a3b8; }

.scr { flex: 1; display: none; flex-direction: column; overflow-y: auto; padding: 6px 14px 18px; }
.scr.on { display: flex; }

#scr-menu { align-items: center; text-align: center; gap: 12px; justify-content: center; }
#scr-menu h1 { font-size: clamp(32px, 9vw, 44px); color: #f8fafc; }
#scr-menu .sub { color: #94a3b8; font-weight: 600; margin-bottom: 4px; }
#tierRow { display: flex; gap: 8px; width: 100%; }
.tierCard { flex: 1; background: #1e293b; border: 3px solid #334155; border-radius: 16px; padding: 10px 4px; font-weight: 800; font-size: 14px; line-height: 1.35; cursor: pointer; color: #e2e8f0; }
.tierCard small { display: block; color: #94a3b8; font-weight: 700; }
.tierCard .te { font-size: 26px; display: block; }
.tierCard.sel { border-color: #38bdf8; background: #0c4a6e; }
button.big { width: 100%; border: none; border-radius: 16px; min-height: 56px; font-size: 19px; font-weight: 800; background: #1e293b; color: #e2e8f0; border: 3px solid #334155; cursor: pointer; font-family: inherit; }
button.big:active { transform: translateY(2px); }
button.big.primary { background: #38bdf8; border-color: #0ea5e9; color: #0f172a; }
#statsLine { color: #94a3b8; font-weight: 700; }

/* play */
/* the level label is absolutely centred: with space-between, a growing hearts
   list pushed it off-centre as lives were collected */
#playTop { position: relative; display: flex; align-items: center; justify-content: space-between; font-weight: 800; padding: 2px 2px 6px; font-size: 15px; min-height: 22px; }
#lvlLabel { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; pointer-events: none; }
#lives, #score { white-space: nowrap; }
#lives { color: #fb7185; letter-spacing: 1px; }
#score { color: #fbbf24; }
/* reserved height: effect chips must never shift the canvas */
#fxRow { height: 26px; display: flex; gap: 6px; align-items: center; overflow: hidden; margin-bottom: 4px; }
.fx { background: #1e293b; border: 2px solid #334155; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.fx.bad { border-color: #ef4444; color: #fca5a5; }
.fx.good { border-color: #22c55e; color: #86efac; }
.fx.spd { border-color: #f59e0b; color: #fcd34d; }
.fx.combo { border-color: #e879f9; color: #f0abfc; }

#stageWrap { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; }
canvas#stage { display: block; background: #020617; border-radius: 12px; box-shadow: 0 0 0 3px #1e293b; touch-action: none; }

.ovl { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(2,6,23,0.86); border-radius: 12px; padding: 16px; }
.ovl.on { display: flex; }
.ovlCard { text-align: center; width: 100%; max-width: 300px; display: flex; flex-direction: column; gap: 10px; }
#ovlTitle { font-size: 26px; font-weight: 800; color: #f8fafc; }
#ovlSub { color: #94a3b8; font-weight: 700; min-height: 22px; }

#scr-how .card { background: #1e293b; border: 3px solid #334155; border-radius: 16px; padding: 14px; margin-bottom: 10px; font-size: 15px; line-height: 1.55; font-weight: 600; }
#scr-how h2 { margin-bottom: 8px; color: #f8fafc; }

/* The legend (docs/offline-games-pwa.md R-L1). Same row shape as Chef Quest's
   and Diner Rush's — one column of swatches at a fixed width, so the marks
   line up down the page and the eye can run the column instead of the text.
   The swatch colours come from data.js, not from here: a brick retuned in the
   palette must not need a stylesheet edit to stay honest. */
.lgSub { font-weight: 800; font-size: 13.5px; color: #94a3b8; margin: 10px 0 5px; }
.legend { display: flex; flex-direction: column; gap: 7px; }
.lgRow { display: flex; align-items: center; gap: 10px; }
.lgArt { flex: none; width: 46px; height: 22px; display: flex; align-items: center; justify-content: center; font-style: normal; }
.lgArt.lgbrick { border-radius: 3px; box-shadow: inset 0 3px 0 rgba(255,255,255,0.35), inset 0 -4px 0 rgba(0,0,0,0.2); }
.lgArt.lgpad { height: 12px; border-radius: 5px; }
.lgArt.lgball s { width: 15px; height: 15px; border-radius: 50%; text-decoration: none; }
/* Bigger than the falling capsule, on purpose. The canvas draws it at 18x14
   with a 9px glyph because it is moving and only has to be recognised; a
   legend row is read once, standing still, and has to be LEGIBLE. */
.lgArt.lgCap { width: 34px; height: 25px; border-radius: 8px; color: #04121f; font-size: 16px; line-height: 1; font-weight: 800; margin-left: 6px; }
.lgTxt { display: flex; flex-direction: column; min-width: 0; }
.lgTxt b { font-size: 14px; font-weight: 800; }
.lgTxt small { font-size: 12.5px; color: #94a3b8; line-height: 1.3; font-weight: 600; }

#toast { position: fixed; left: 50%; bottom: 78px; transform: translateX(-50%); background: #f8fafc; color: #0f172a; font-weight: 800; padding: 9px 16px; border-radius: 999px; opacity: 0; transition: opacity 0.25s; pointer-events: none; z-index: 40; }
#toast.on { opacity: 1; }

/* docs/offline-pwa.md R-C15 — the PAGE must never scroll.
   The product is a fixed frame: header, a named scroll region, footer. If the
   document scrolls too, the header scrolls away, the version chip drifts, and
   a drag that reaches the end of the inner region chains out to the page and
   drags the whole board under the player's thumb. That is the "double scroll".
   `overflow: hidden` stops the second scrollbar; `overscroll-behavior: none`
   stops the chaining, which is the half that is invisible on a desktop mouse
   and obvious on a phone. */
html, body {
    overflow: hidden;
    overscroll-behavior: none;
}
