/* Piano Attack: THE STAGE (2026-10-01). The sheet on the ground, the two rows, the
   zones, the HUD, the card, the debrief and the keys under the stage, shared by the
   lab (piano-attack-lab.html) and the game (piano-attack.html). Each host has its
   own chrome in its own file, per the rule. Fonts: the host's. */
/* the stage: a sky and a ground on a canvas, the paper over the top of it, the
   plane and its bullets on a second canvas over both */
.pa-stage { position: relative; width: 100%; height: clamp(500px, 46vw, 660px); background: #0c1020; border: 2px solid #0a0c12; border-radius: 10px; overflow: hidden;
  user-select: none; -webkit-user-select: none; }
.pa-stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
#fx { pointer-events: none; z-index: 3; }
/* the plane: the paper's own coordinates, which the script (lay) puts on the stage: across the top in the side
   view, down on the ground in the field where the sheet lies on it. The floor of that field is under it. */
.pa-plane { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; z-index: 2; }
.pa-field { position: absolute; left: 0; right: 0; overflow: hidden; display: none; z-index: 1; }
.pa-field-in { position: absolute; top: 0; bottom: 0; background-repeat: repeat; image-rendering: pixelated; will-change: transform; }
.pa-paper { position: absolute; left: 0; top: 0; z-index: 2; overflow: hidden; background: var(--paper);
  border-bottom: 3px solid #1b1710; box-shadow: inset 0 0 0 3px #1b1710, inset 0 0 0 5px #c9b98f; }
/* a sheet that lies on the ground has an edge all round, and a shadow under it */
.pa-stage[data-field="ground"] .pa-paper { border-bottom: 0; outline: 10px solid rgba(20, 14, 6, .2); outline-offset: 0; }
#row-ground .knob { margin-top: 6px; }
/* the plane's hit zone and its range, on the page: highlighter, so the ink under it stays ink */
.pa-zone { position: absolute; top: 3px; bottom: 3px; pointer-events: none; mix-blend-mode: multiply; z-index: 2; overflow: hidden; }
.pa-zone.sweet { background: #ffe47a; border-right: 2px solid #c79a14; }
.pa-zone.reach { background: linear-gradient(90deg, #fff1b8, #fffdf3); }
.pa-zone::before { content: attr(data-label); position: absolute; left: 7px; top: 5px; font: 700 10px/1 Barlow, sans-serif; letter-spacing: .8px; text-transform: uppercase; color: #6b5310; white-space: nowrap; }
.pa-zone.reach::before { color: #8a7a45; }
/* past the plane's own row a bullet is a long shot: the Reach part's ground, on either row */
.pa-zone.far { background: repeating-linear-gradient(-45deg, #ffe9cf 0 9px, #fff6ea 9px 18px); border-right: 2px dashed #c98a3a; }
.pa-zone.far::before { color: #9a6420; }
.pa-zone.thin::before { content: none; }
/* THE ENEMY'S ATTACK ZONE: red, under the plane and a little in front of it (Lionel, 10-02). It lies over the first
   stretch of the hit zone, and the two multiply to orange where both sides can shoot. */
.pa-zone.foe { background: #ff6a5a; border-right: 2px solid #b8231a; z-index: 3; }
.pa-zone.foe::before { color: #7a1810; }
/* on the sheet that lies on the ground the top of each row is the lane of the measures' names, so a zone says what it is along the bottom */
.pa-stage[data-field="ground"] .pa-zone::before { top: auto; bottom: 5px; }
.pa-now { position: absolute; top: 3px; bottom: 3px; width: 2px; background: #2f7fc4; z-index: 6; pointer-events: none; }
.pa-strip { position: absolute; left: 0; top: 0; will-change: transform; color: #17130c; z-index: 1; }
.pa-strip svg { display: block; overflow: visible; }
.pa-noengrave { padding: 40px; color: #5a4a2a; font-weight: 700; }
/* past the plane's reach the page is still readable and plainly not yet in play */
.pa-veil { position: absolute; top: 3px; bottom: 3px; right: 3px; background: rgba(244, 234, 210, .58); border-left: 2px dashed rgba(27, 23, 16, .45); pointer-events: none; z-index: 3; }
.pa-gutter { position: absolute; left: 3px; top: 0; bottom: 3px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .25s; z-index: 4;
  background: linear-gradient(90deg, var(--paper) calc(100% - 34px), rgba(244, 234, 210, 0)); color: #17130c; }
.pa-gutter.on { opacity: 1; }
/* the second row: not yet the plane's, so its veil is lighter and its clefs sit past the tunnel's wall */
.pa-paper.two .pa-veil { background: rgba(244, 234, 210, .4); }
.pa-paper.two .pa-gutter { left: 0; }
.pa-paper.two .pa-zone::before { left: calc(var(--gut, 0px) - 20px); }
.pa-paper[hidden] { display: none; }
.pa-gutter svg { display: block; }

.pa-hud { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 9px 12px; pointer-events: none;
  font: 700 17px/1 "Barlow Condensed", Barlow, sans-serif; letter-spacing: 1px; color: #fff; text-shadow: 2px 2px 0 #14161c; }
.pa-hud .hp { display: flex; align-items: center; gap: 8px; }
.pa-hud .meter { display: block; width: 190px; height: 14px; background: #14161c; border: 2px solid #14161c; }
.pa-hud .meter i { display: block; height: 100%; width: 100%; background: repeating-linear-gradient(90deg, #e2362f 0 12px, #14161c 12px 14px); transition: width .12s; }
.pa-hud u { text-decoration: none; font-variant-numeric: tabular-nums; }
.pa-hud .fx { display: flex; gap: 6px; }
.pa-hud .fx span { background: #ffe45c; color: #14161c; text-shadow: none; padding: 3px 7px; font-size: 13px; }
.pa-hud .mid { font: 500 14px/1.2 Barlow, sans-serif; letter-spacing: 0; color: rgba(255, 255, 255, .9); text-align: center; }
/* the mission's own number, the largest thing in the middle of the HUD ("the levels number needs to be larger") */
.pa-hud .mid b { font: 700 24px/1 "Barlow Condensed", Barlow, sans-serif; letter-spacing: 1px; text-transform: uppercase; color: #ffe45c; margin-right: 10px; vertical-align: -2px; }
.pa-hud .mid .k { color: #8ff0a0; font-weight: 700; } .pa-hud .mid .l { color: #ff9a8a; font-weight: 700; }
.pa-hud .ammo { display: flex; align-items: center; gap: 8px; font-size: 19px; }
.pa-hud .ammo u { min-width: 30px; text-align: right; font-size: 24px; color: #ffe45c; }
.pa-hud .ammo.dry u, .pa-hud .ammo.dry b { color: #ff5a4a; }
.pa-hud .ammo em { font-style: normal; color: #8ff0a0; font-size: 17px; }
/* the tally of bullets, drawn as bullets: crates of a hundred, boxes of twenty-five, clips of five, cartridges */
.pa-hud .ammo canvas { display: block; image-rendering: pixelated; margin-right: 6px; }
.pa-hud .fx span.bad { background: #ff5a4a; color: #fff; }
.pa-hud .fx span.weapon { background: #ff8a3c; color: #14161c; }
/* the tank: a short gauge under the hull's, red when a mission's worth is not in it */
.pa-hud .fuel { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 14px; }
.pa-hud .fuel .meter { width: 120px; height: 10px; }
.pa-hud .fuel .meter i { background: repeating-linear-gradient(90deg, #ffb23e 0 8px, #14161c 8px 10px); }
.pa-hud .fuel.low .meter i { background: repeating-linear-gradient(90deg, #ff5a4a 0 8px, #14161c 8px 10px); }
.pa-hud .fuel.low u { color: #ff5a4a; }
.pa-hud .fuel[hidden] { display: none; }
.pa-hud .left { display: flex; flex-direction: column; align-items: flex-start; }
.pa-hud .fx span.rush { background: #8ff0a0; color: #0e2415; font-weight: 700; }
.pa-hud .mid .ff { color: #ffe45c; font-weight: 700; margin-left: 6px; }

.pa-card { position: absolute; left: 50%; top: 56%; transform: translate(-50%, -50%); z-index: 5; text-align: center; pointer-events: none;
  background: rgba(20, 22, 28, .86); border: 2px solid #ffe45c; padding: 12px 22px; font: 700 20px/1.25 "Barlow Condensed", Barlow, sans-serif; letter-spacing: 1px; text-transform: uppercase; color: #fff; }
.pa-card b { display: block; color: #ffe45c; font-size: 26px; }
.pa-card span { display: block; font: 500 14px/1.3 Barlow, sans-serif; letter-spacing: 0; text-transform: none; color: var(--soft); }
.pa-card em { display: block; margin-top: 6px; font-style: normal; font-size: 15px; animation: pa-blink 1s steps(2) infinite; }
@keyframes pa-blink { 50% { opacity: .35; } }
/* The panel hangs with its own 58%-point at the stage's 58%-point, so however tall it is it stays INSIDE the stage,
   and past the stage's height it scrolls with its buttons kept in sight (.db-foot). It was centred at 58% and had
   no limit: with ten skills listed (2026-10-02) it ran out under the keys and took its buttons with it. */
.pa-debrief { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -58%); z-index: 6; width: min(400px, 86%); max-height: calc(100% - 12px); overflow-y: auto; background: rgba(18, 20, 26, .95); border: 2px solid #ffe45c; padding: 14px 18px 12px; text-align: center; }
.pa-debrief .db-foot { position: sticky; bottom: -12px; margin: 8px -18px -12px; padding: 8px 18px 12px; background: rgba(18, 20, 26, .98); box-shadow: 0 -8px 10px -8px rgba(0, 0, 0, .7); }
.pa-debrief h3 { font: 700 28px/1 "Barlow Condensed", Barlow, sans-serif; letter-spacing: 2px; color: #ffe45c; }
.pa-debrief .stars { font-size: 30px; line-height: 1.2; letter-spacing: 6px; color: #3a3f4c; }
.pa-debrief .stars .on { color: #ffe45c; font-style: normal; } .pa-debrief .stars i { font-style: normal; }
.pa-debrief dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 14px; margin: 8px 0; text-align: left; font-size: 14px; }
.pa-debrief dt { color: var(--soft); } .pa-debrief dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.pa-debrief dd small { font-weight: 400; color: var(--dim); }
.pa-debrief .pay { color: #8ff0a0; font-weight: 700; margin: 6px 0; }
.pa-debrief .pay span { color: var(--dim); font-weight: 400; }
.pa-debrief .pay small { display: block; margin-top: 2px; font-weight: 400; font-size: 12px; color: var(--soft); }
.pa-debrief .row { display: flex; gap: 8px; justify-content: center; }
.pa-debrief button { font: 700 14px/1 "Barlow Condensed", Barlow, sans-serif; letter-spacing: .5px; text-transform: uppercase; padding: 9px 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg3); color: var(--ink); cursor: pointer; }
.pa-debrief button.go { background: #ffe45c; color: #14161c; border-color: #ffe45c; }
.pa-debrief .hint { margin: 8px 0 0; font-size: 12.5px; color: var(--dim); }

/* the keys under the stage: the pointer plays them, and the letters on them */
.pa-keys { position: relative; height: 74px; margin-top: 6px; background: #0a0c12; border: 2px solid #0a0c12; border-radius: 0 0 8px 8px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.pa-keys i { position: absolute; top: 0; display: block; font-style: normal; cursor: pointer; --lit: 0; }
.pa-keys .w { height: 100%; background: #ecebe4; border-right: 1px solid #8f8d84; border-radius: 0 0 4px 4px; }
.pa-keys .b { height: 58%; background: #1b1d24; border-radius: 0 0 3px 3px; z-index: 2; }
.pa-keys i.down { background: #6fd3ff; }
.pa-keys .w.live { background: color-mix(in srgb, #ffe45c calc(var(--lit) * 100%), #ecebe4); }
.pa-keys .b.live { background: color-mix(in srgb, #e0a82a calc(var(--lit) * 100%), #1b1d24); }
.pa-keys u { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; text-decoration: none; font: 700 12px/1 ui-monospace, Menlo, monospace; color: #6d6a5e; }
.pa-keys .b u { bottom: 5px; color: #9aa0ad; font-size: 10px; }
.pa-keys s { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; text-decoration: none; font: 500 10px/1 Barlow, sans-serif; color: #8f8d84; }

