/* Shared look (flat, 2026-11-11 owner pick "A flat"): solid colours, one soft shadow per surface, no outlined or hard-shadowed
   text. Text floating over the 3D scene gets a soft blur shadow so it stays readable. Earlier candy version: git history. Compaction tiers at the bottom keep every card inside the viewport.
   Original wooden version: .work/kit_backup_2026-11-02\tpc.css */
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fd3ff; font-family: "Arial Rounded MT Bold", "Nunito", "Segoe UI", system-ui, sans-serif; }
canvas { display: block; touch-action: none; }
[hidden] { display: none !important; }
:root { --f: "Arial Rounded MT Bold", "Nunito", "Segoe UI", system-ui, sans-serif; --navy: #0f2f86; --cream: #fff1c9; --gold: #f2b43a; }
html body .card, html body .card *, html body #hud, html body #hud *, html body #hint, html body #flash, html body #title, html body #time, html body #turn,
html body #lv-banner, html body #lv-banner * { font-family: var(--f); }
.card { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, 88vw); padding: 40px 26px 22px; box-sizing: border-box;
  background: #1a4fc4; border-radius: 22px; color: #fff; text-align: center; font-weight: 800; z-index: 5; box-shadow: 0 16px 36px rgba(0,10,60,.45); }
.ribbon { position: absolute; left: 50%; top: -26px; transform: translateX(-50%); padding: 7px 34px 9px; border-radius: 16px;
  background: #f5a400; color: #fff; font: 900 26px var(--f); white-space: nowrap; max-width: 96%; box-sizing: border-box; box-shadow: 0 6px 16px rgba(0,10,60,.3); }
.card p { margin: 8px 0; font-size: 18px; } .card .small { font-size: 14px; opacity: .95; }
.big { font: 900 24px var(--f); padding: 10px 46px 12px; margin-top: 10px; border: 0; border-radius: 16px; color: #fff; cursor: pointer;
  background: #22b04a; box-shadow: 0 6px 16px rgba(0,30,10,.3); }
.big:active { transform: translateY(2px); box-shadow: 0 3px 8px rgba(0,30,10,.3); }
.link { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--cream); font: 800 15px var(--f); cursor: pointer; text-decoration: underline; }
.final { font: 900 30px var(--f); margin: 4px 0; }
.final span { font-size: 64px; color: #ffd84a; }
.pad { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 4px 10px; text-align: left; margin: 10px auto 4px; width: fit-content; max-width: 100%; font-size: 15px; }
.pad kbd { font: 900 13px var(--f); color: #fff; min-width: 28px; height: 28px; padding: 0 7px; box-sizing: border-box; border-radius: 14px; display: inline-grid; place-items: center;
  background: #3a4458; }
.pad b { font: 900 12px var(--f); color: #ffd84a; text-transform: uppercase; letter-spacing: 1px; opacity: 1; }
.pad kbd.k { background: #fff6dc; color: var(--navy); border-radius: 9px; white-space: nowrap; }
.pad kbd.a { background: #22b04a; } .pad kbd.b { background: #e8423a; }
.pad kbd.x { background: #1f7fe6; } .pad kbd.y { background: #f5a400; }
.rows { margin: 10px auto; display: grid; gap: 6px; width: 84%; }
.rows div { display: flex; align-items: center; gap: 10px; background: rgba(6,24,90,.55); border-radius: 14px; padding: 4px 12px 4px 8px; font: 900 18px var(--f); }
.rows div.me { background: rgba(120,180,255,.4); box-shadow: 0 0 0 3px var(--gold); } .rows div span:last-child { margin-left: auto; }
.rows b { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 3px solid #fff; }
#title { color: #fff; font: 900 22px var(--f); text-shadow: 0 2px 10px rgba(0,20,80,.5); }
:where(#title) { position: fixed; top: 14px; left: 16px; }
/* layout defaults are zero-specificity (:where) so a page that styles its own #hud/#hint/#flash keeps its layout, whichever stylesheet loads last */
:where(#hud) { position: fixed; top: 12px; left: 0; right: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; pointer-events: none; padding: 0 8px; box-sizing: border-box; }
body #hud .chip { background: #fffaf0; border: 0; border-radius: 999px; box-sizing: border-box;
  padding: 2px clamp(10px, 1.9vh, 16px) 2px 3px; font: 900 clamp(15px, 3.3vh, 26px) var(--f); color: var(--navy); gap: clamp(5px, 1vh, 9px); max-width: 100%;
  box-shadow: 0 4px 12px rgba(0,0,40,.25); display: flex; align-items: center; white-space: nowrap; }
body #hud .chip i { font: 900 clamp(11px, 1.9vh, 15px) var(--f); font-style: normal; color: #fff; min-width: clamp(24px, 4.4vh, 34px); height: clamp(24px, 4.4vh, 34px); padding: 0 5px; box-sizing: border-box;
  border-radius: 999px; display: grid; place-items: center; background: #1f7fe6; }
body #hud .chip b { color: var(--navy); }
body #hud .lv-chip, body #hud .lv-combo { color: #fff; border: 0; border-radius: 999px; box-sizing: border-box; padding: 2px clamp(10px, 2vh, 16px); height: auto;
  font: 900 clamp(15px, 3vh, 22px) var(--f); box-shadow: 0 4px 12px rgba(0,0,40,.25); }
body #hud .lv-chip { background: #1f7fe6; }
body #hud .lv-combo { background: #f5a400; }
body #time { background: #fffaf0; border: 0; border-radius: 999px; box-sizing: border-box; padding: 2px 18px; color: var(--navy);
  font: 900 clamp(18px, 3.5vh, 26px) var(--f); box-shadow: 0 4px 12px rgba(0,0,40,.25); }
#hint { color: #fff; font: 900 clamp(16px, 3vh, 32px) var(--f); white-space: nowrap; max-width: 90vw; box-sizing: border-box;
  background: #1a4fc4; padding: 5px 22px; border-radius: 999px; pointer-events: none; box-shadow: 0 6px 16px rgba(0,0,40,.3); }
#flash:not(:empty) { font: 900 72px var(--f); color: #fff; white-space: nowrap; max-width: 96vw;
  text-shadow: 0 3px 18px rgba(0,20,80,.6); pointer-events: none; z-index: 4; }

/* menu extras that modes.js and levels.js inject later in the head: more specific selectors win */
.card .md-rows { margin: 8px auto 2px; }
.card .md-row > b { font: 900 12px var(--f); color: #ffd84a; opacity: 1; }
.card .md-row.focus > b { color: #fff; }
.card .md-row button, .card .lv-pick button { font: 900 15px var(--f); padding: 7px 12px 8px; border-radius: 999px; border: 0; color: #fff; line-height: 1.2;
  background: #f5a400; box-shadow: 0 4px 10px rgba(0,0,40,.25); }
.card .md-row button.on, .card .lv-pick button.on { background: #1f7fe6; box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(0,0,40,.25); }
.card .lv-pick { margin: 8px 0 2px; }
.card .lv-pick button { border-radius: 18px; max-width: 150px; }
.card .lv-pick .st { color: #fff6a8; }
.card .lv-pick.many button { width: 58px; border-radius: 16px; }
.card .lv-stars { font: 900 44px var(--f); color: #ffd84a; }
.card .lv-stars .off { color: rgba(255,255,255,.3); }
.card .md-slots div { border: 3px dashed rgba(255,241,201,.6); border-radius: 14px; background: rgba(6,24,90,.35); font: 900 12px var(--f); }
.card .md-slots div.in { border-style: solid; border-color: var(--cream); }
.card .md-best { font: 800 13px var(--f); }
.card .lv-info { margin: 4px 0 0; min-height: 0; }
#lv-banner b { text-shadow: 0 3px 18px rgba(0,20,80,.6); }
#lv-banner span { background: #1a4fc4; border-radius: 999px; }
.pt-row div { border-radius: 999px; }

html body :where(#hint) { position: fixed; height: fit-content; bottom: 22px; left: 50%; transform: translateX(-50%); }
html body :where(#flash:not(:empty)) { position: fixed; top: 40%; left: 50%; transform: translate(-50%, -50%); }
/* a modal card owns the screen: the HUD behind the end card is hidden, and the corner game title is hidden while a round runs (the lv-chip lives in the same corner) */
body:has(#end:not([hidden])) :is(#hud, #time, #turn, #hint, #title, #flash, #breakbar, #dis, #hc, #power, #meter, #meterLbl) { visibility: hidden; }
body:has(#hud:not([hidden])) #title { display: none; }
@media (max-width: 1100px) { body:has(#menu:not([hidden])) #title { display: none; } }

/* compaction tiers: Chromium zoom shrinks the whole card (and the ribbon that sticks out 26px above it) so it always fits; the long
   legends (Volley, Brawl, Fort Wars) also get a wider card and tighter inner spacing */
@media (min-height: 900px) { .card { zoom: 1.2; } }
@media (max-height: 800px) {
  .card { width: min(600px, 92vw); padding: 40px 22px 16px; zoom: .9; } .card p { font-size: 16px; margin: 5px 0; }
  .card .pad { font-size: 14px; gap: 2px 10px; margin: 6px auto 2px; } .pad kbd { height: 24px; min-width: 24px; font-size: 12px; }
  .card .md-rows { margin: 6px auto 2px; gap: 6px; } .card .lv-pick { margin: 6px 0 2px; } .big { padding: 7px 40px 9px; margin-top: 6px; font-size: 22px; }
  .card .md-row button, .card .lv-pick button { padding: 5px 12px 6px; } .card .small { font-size: 13px; }
}
@media (max-height: 640px) { .card { zoom: .78; } }
@media (max-height: 560px) { .card { zoom: .62; } }
@media (max-height: 500px) { .card { zoom: .55; } }
@media (max-height: 440px) { .card { zoom: .55; } }

/* Flat look, every game: page styles from the candy era outline or hard-shadow their own text (58 pages). One rule removes the
   outlines everywhere and the shadows on solid surfaces; text floating over the 3D scene keeps a soft blur shadow (above). */
body :not(svg, svg *) { -webkit-text-stroke: 0 !important; }
body :is(button, .card, .card *, #hud, #hud *, #time, #hint, .chip, .pad, .pad *, kbd) { text-shadow: none !important; }
