/* Braincell Breakdown menus: Brawl-style cartoon UI (2026-09-30 Brawl pass).
   Theme tokens per 00_Planning/CLAUDE_BRAWL_PASS_BRIEF.md section 6b. */
:root {
  --blue-hi: #2f7bff;
  --blue-lo: #0b3fa8;
  --panel: #1f5fe0;
  --panel-dark: #0d2e7a;
  --ink: #0d1b3d;
  --yellow: #ffd23f;
  --yellow-edge: #c9951a;
  --text-dark: #1a1a1a;
  --green: #8bd36a;
  --team-blue: #7ec8e3;
  --red: #ff4b5c;
  --gold: #ffc53d;
  --head-font: "Arial Black", Impact, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #0b0d10;
  overflow: hidden;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #f2f2f2;
  touch-action: none;
}

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* mobile browsers (Brave included) can size 100vh against
                     the viewport as if the address bar is already hidden,
                     clipping the stage behind it with no way to scroll to
                     the rest; dvh is supposed to track the actual visible
                     area instead. */
  height: calc(var(--vh, 1vh) * 100); /* still overridden by the JS-computed
                     --vh custom property (see index.html's inline script)
                     when it's available — dvh alone wasn't reliable enough
                     on Brave/Android in practice. Falls back to the 100dvh/
                     100vh above (via the var() default) if --vh isn't set. */
  display: flex;
  align-items: center;
  justify-content: center;
}

#game {
  background: #1c2b1e;
  touch-action: none;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  max-height: calc(var(--vh, 1vh) * 100);
  width: min(100vw, calc(var(--vh, 1vh) * 177.777778));
  height: auto;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(8, 18, 48, 0.88);
  text-align: center;
  padding: 24px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.overlay.hidden, .hub.hidden, .hidden {
  display: none;
}

/* Landscape-only enforcement. Pure CSS (not JS-toggled) so it works
   regardless of Screen Orientation API support (iOS Safari lacks the lock).
   Every screen is built for landscape, so portrait phones are blocked with
   a clear prompt instead of reflowing a fixed landscape layout. */
.rotateOverlay {
  position: absolute;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(8, 10, 12, 0.96);
  text-align: center;
  padding: 24px;
}

@media (orientation: portrait) and (pointer: coarse) {
  .rotateOverlay {
    display: flex;
  }
}

/* "Tap for full screen" pill, shown by game.js after rotating to landscape
   (fullscreen needs a tap; rotating alone can't enter it). */
.fullscreenPrompt {
  position: absolute;
  z-index: 9000;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  padding: 7px 18px;
  border: 2px solid #ffd23f;
  border-radius: 999px;
  background: rgba(8, 16, 23, 0.9);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.fullscreenPrompt[hidden] {
  display: none;
}

/* ---------- Headline typography ---------- */
.overlay h1, .smallTitle, .brawlerName, .statsTitle, #resultTitle, .hubFighterName, .eventMode, .playBtn, .hubNav {
  font-family: var(--head-font);
  text-transform: uppercase;
  letter-spacing: 1px;
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--ink), 0 3px 0 rgba(13, 27, 61, 0.6);
}

.overlay h1 {
  margin: 0;
  font-size: clamp(26px, 5vw, 52px);
  color: #fff;
}

.smallTitle {
  margin: 0;
  font-size: clamp(22px, 4vw, 34px);
  color: #fff;
}

.subtitle {
  margin: 0;
  opacity: 0.9;
  font-size: clamp(13px, 2vw, 18px);
}

.hint {
  margin-top: 6px;
  opacity: 0.65;
  font-size: clamp(11px, 1.6vw, 14px);
  max-width: 640px;
}

/* ---------- Buttons ---------- */
.primaryBtn, .secondaryBtn {
  font-family: var(--head-font);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  padding: 12px 30px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  cursor: pointer;
  letter-spacing: 1px;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.primaryBtn {
  background: var(--yellow);
  color: var(--text-dark);
  box-shadow: 0 4px 0 var(--yellow-edge), 0 6px 0 var(--ink);
}

.secondaryBtn {
  background: #3c85ff;
  color: #fff;
  box-shadow: 0 4px 0 var(--panel-dark), 0 6px 0 var(--ink);
  text-shadow: 0 2px 0 var(--ink);
}

.primaryBtn:hover:not(:disabled), .secondaryBtn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.primaryBtn:active:not(:disabled), .secondaryBtn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.primaryBtn:disabled, .secondaryBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- Generic menu panels (pause, settings, how-to, onboarding, workshop) ---------- */
.titlePanel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 720px;
  /* Content panels carry a max-height + overflow so a panel too tall for a
     short landscape-phone viewport scrolls internally instead of clipping
     (html/body are overflow: hidden). Three stacked fallbacks for the same
     reason #stage has them. */
  max-height: 92vh;
  max-height: 92dvh;
  max-height: calc(var(--vh, 1vh) * 92);
  overflow-y: auto;
  background: var(--panel);
  border: 4px solid var(--panel-dark);
  border-radius: 14px;
  box-shadow: 0 6px 0 var(--ink), inset 0 0 0 2px rgba(255, 255, 255, 0.12);
  padding: 22px 28px;
}

.titleButtonRow {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.controlsGrid {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
  text-align: left;
}

.controlsCol h2 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--yellow);
  letter-spacing: 0.5px;
}

.controlsCol p {
  margin: 3px 0;
  font-size: 14px;
  opacity: 0.92;
}

.menuMeta { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 20px; }
.editionTag { color: #bfe0ff; font-size: 10px; font-weight: 800; letter-spacing: 2px; }
.starBalance { background: var(--gold); color: #25313b; padding: 8px 15px; border-radius: 999px; border: 3px solid var(--ink); font-weight: 800; white-space: nowrap; }
.rewardLine { color: var(--gold); font-size: 22px; font-weight: 800; margin: 0; text-shadow: 0 2px 0 var(--ink); }

/* Workshop (content is generated by src/ui/workshop.js; keep these generic) */
.workshopPanel { max-width: 950px; width: 100%; background: var(--panel); }
.shopGrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; }
.shopCard { background: #1a4fc0; border: 3px solid var(--panel-dark); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.shopCard img { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; border: 3px solid var(--gold); }
.shopCard h2 { font-size: 14px; margin: 0; }
.shopCard p { font-size: 11px; margin: 0; color: #d6e6ff; }
.shopCard button { font-size: 13px; padding: 10px 15px; margin-top: auto; }
.shopMessage { min-height: 20px; margin: 0; color: #ffe08a; font-size: 13px; }
#starBundles { width: 100%; text-align: left; border-top: 2px solid var(--panel-dark); padding-top: 12px; }
#starBundles summary { cursor: pointer; font-weight: 700; }
.bundleGrid { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 12px; }
.bundleGrid button { font-size: 13px; padding: 12px; }
.workshopPanel > #closeWorkshopBtn { position: sticky; bottom: 0; flex: 0 0 auto; }
#trainingModules { display: grid; gap: 10px; width: 100%; text-align: left; }
#trainingModules > h2 { margin: 8px 0 0; font-size: 18px; }
#trainingFighter { width: 100%; min-height: 42px; padding: 8px; font: inherit; color: #fff; background: #133778; border: 2px solid #739beb; border-radius: 8px; }
#trainingModules .trainingCard { align-items: flex-start; gap: 8px; }
#trainingModules .trainingCard h3 { margin: 0; font-size: 16px; }
#trainingModules .trainingCard p { font-size: 13px; line-height: 1.5; }
.trainingCards { display: grid; gap: 10px; }
@media (min-width: 700px) { .trainingCards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.workshopPanel > #closeWorkshopBtn { box-shadow: 0 0 0 8px var(--panel); z-index: 2; }
.workshopPanel > #shopMessage { padding-bottom: 44px; }

.settingsPanel { width: 400px; max-width: 100%; }
.settingsPanel label { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 15px; font-size: 15px; }
.settingsPanel input { accent-color: var(--yellow); }
.settingsPanel select { padding: 8px; background: #123f9e; color: #fff; border: 2px solid var(--ink); border-radius: 8px; }

.pauseButton { position: absolute; top: max(65px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); padding: 7px 16px; border: 2px solid var(--ink); border-radius: 10px; background: rgba(31, 95, 224, 0.9); color: #fff; font-weight: 900; cursor: pointer; z-index: 2; }
#pauseScreen, #workshopScreen, #settingsScreen { z-index: 5; }

/* ---------- Home hub ---------- */
.titleScreen.hub {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 96px;
  grid-template-rows: 56px minmax(0, 1fr) auto;
  grid-template-areas:
    "top top top"
    "left stage ."
    "bottom bottom bottom";
  gap: 8px 14px;
  align-items: stretch;
  justify-items: stretch;
  padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  text-align: left;
  background-image:
    linear-gradient(180deg, rgba(8, 28, 100, 0.35) 0%, rgba(10, 45, 135, 0.45) 45%, rgba(8, 28, 100, 0.9) 78%, rgba(6, 20, 78, 0.96) 100%),
    radial-gradient(ellipse at 50% 42%, rgba(47, 123, 255, 0.35), rgba(11, 63, 168, 0.75) 80%),
    url("assets/ui/menu_bg.jpg");
  background-size: cover;
  background-position: center;
}

.titleScreen.hub.hidden { display: none !important; }

.hubTop {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hubStats { display: flex; gap: 8px; margin: 0 auto; min-width: 0; }

.hubChip, .hubStat, .hubIcon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: var(--panel-dark);
  color: #fff;
  font-family: var(--head-font);
  font-size: 15px;
  white-space: nowrap;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}
.hubChip { cursor: pointer; background: var(--panel); flex-direction: column; justify-content: center; gap: 0; border-radius: 12px; line-height: 1.1; min-width: 96px; }
.hubChipName { font-size: 14px; text-transform: uppercase; }
.hubChipSub { font-size: 11px; opacity: 0.85; font-family: "Segoe UI", sans-serif; }
.hubStat.trophies { color: #ffe08a; }
.hubStat.coins { color: var(--gold); }
.hubStat.gems { color: #7dff9a; }
.hubIcon { cursor: pointer; width: 44px; padding: 0; justify-content: center; font-size: 22px; border-radius: 12px; background: var(--panel); }

.hubLeft {
  grid-area: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: start;
}

.hubNav {
  position: relative;
  width: 84px;
  height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  border-radius: 14px;
  border: 4px solid var(--ink);
  background: var(--panel);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--panel-dark), 0 6px 0 var(--ink);
  -webkit-text-stroke: 1px var(--ink);
}
.hubNav:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.hubNav:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.hubNav:disabled { opacity: 0.55; filter: grayscale(0.6); cursor: not-allowed; }
.hubNavIcon { font-size: 28px; line-height: 1; -webkit-text-stroke: 0; text-shadow: none; }
.hubBadge { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; border-radius: 50%; background: var(--red); border: 2px solid var(--ink); font-size: 13px; line-height: 18px; text-align: center; -webkit-text-stroke: 0; }

.hubStage {
  grid-area: stage;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  text-align: center;
  gap: 2px;
}

.hubPreviewSlot {
  height: 300px;
  aspect-ratio: 1;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-height: 0;
}
.hubPreviewSlot canvas { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.45)); }

.hubFighterName { margin: 0; font-size: 26px; color: #fff; line-height: 1.1; }
.hubFighterMeta, .hubNextGoal { margin: 0; font-size: 14px; font-weight: 700; color: #fff; text-shadow: 0 2px 0 var(--ink); }
.hubNextGoal { font-size: 12px; opacity: 0.9; }
.hubNextGoal:empty { display: none; }

.hubBottom {
  grid-area: bottom;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.eventCard {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  min-width: 190px;
  border-radius: 12px;
  border: 4px solid var(--ink);
  background: #0f2a6b;
  color: #fff;
  text-transform: uppercase;
  text-align: left;
  box-shadow: 0 4px 0 var(--ink);
}
.eventMode { font-size: 20px; color: #fff; }
.eventArena { font-weight: 800; font-size: 13px; letter-spacing: 0.5px; }
.eventSub { font-size: 11px; opacity: 0.8; font-weight: 600; }
.eventCard.clickable { cursor: pointer; transition: transform 0.08s ease; }
.eventCard.clickable:hover, .eventCard.clickable:focus-visible { transform: translateY(-2px); outline: 3px solid #ffd23f; outline-offset: 2px; }
.eventCard.clickable:active { transform: translateY(1px); }

.eventWrap { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.botCountRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 4px 12px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: #0f2a6b;
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
}
.botCountLabel { font-size: 13px; letter-spacing: 0.5px; }
.botCountValue { min-width: 22px; text-align: center; font-size: 20px; }
.botCountBtn {
  width: 40px;
  height: 36px;
  border-radius: 10px;
  border: 3px solid var(--ink);
  background: var(--green);
  color: #10240f;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation; /* no double-tap zoom on fast taps */
}
.botCountBtn:disabled { opacity: 0.4; cursor: default; }

.sideChips { display: flex; gap: 10px; align-items: stretch; }

.sideBtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 150px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 4px solid var(--ink);
  background: var(--panel);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.sideBtn:hover { transform: translateY(-2px); }
.sideBtn.selected { border-color: var(--yellow); background: #2a6cf0; box-shadow: 0 3px 0 var(--yellow-edge); }
.sideName { font-weight: 800; font-size: 15px; text-transform: uppercase; }
.sideCharacter { font-size: 11px; opacity: 0.85; }
#pickSmooth .sideName { color: var(--green); }
#pickSmart .sideName { color: var(--team-blue); }

.hubPlayWrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.playBtn, .primaryBtn.playBtn {
  width: 220px;
  height: 72px;
  padding: 0;
  font-size: 34px;
  border-radius: 16px;
  border: 4px solid var(--ink);
  background: var(--yellow);
  color: var(--text-dark);
  -webkit-text-stroke: 0;
  paint-order: normal;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 0 var(--yellow-edge), 0 7px 0 var(--ink);
}

.hubMiniRow { display: flex; gap: 8px; }
.hubMini {
  background: rgba(8, 24, 80, 0.55);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.hubMini:hover { background: var(--panel); }

/* ---------- Brawler (fighter) panel ---------- */
.brawlerScreen { padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); gap: 0; }

.brawlerPanel {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 12px 18px;
  background: var(--panel);
  border: 4px solid var(--panel-dark);
  border-radius: 14px;
  box-shadow: 0 6px 0 var(--ink), inset 0 0 0 2px rgba(255, 255, 255, 0.12);
  text-align: left;
}

.brawlerHeader { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; min-width: 0; }
.brawlerHeader .hubStat { margin-left: auto; height: 36px; }

.backBtn {
  flex: 0 0 auto;
  width: 44px;
  height: 40px;
  border-radius: 10px;
  border: 3px solid var(--ink);
  background: var(--yellow);
  color: var(--text-dark);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--yellow-edge), 0 5px 0 var(--ink);
}

.brawlerTag {
  padding: 5px 14px;
  border-radius: 999px;
  background: #bfe0ff;
  color: var(--ink);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.lockPill {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(10, 20, 50, 0.85);
  border: 2px solid var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lockPill + .hubStat { margin-left: 0; }

.brawlerBody {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}

.brawlerStage { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 0; min-width: 0; }
.brawlerStageInner { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 0; min-width: 0; }
.brawlerNameBlock { text-align: center; line-height: 1.05; }
.brawlerName { margin: 0; font-size: clamp(22px, 3.2vw, 36px); color: #fff; }
.brawlerRole { margin: 2px 0 0; font-weight: 800; font-size: 13px; letter-spacing: 1px; color: var(--yellow); text-transform: uppercase; text-shadow: 0 2px 0 var(--ink); }
.signatureName { margin: 0; font-size: 12px; font-weight: 700; opacity: 0.9; }
.signatureName:empty { display: none; }

.arrowBtn {
  flex: 0 0 auto;
  width: 52px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  text-shadow: 0 3px 0 var(--ink);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
}
.arrowBtn:hover { transform: scale(1.12); }
.arrowBtn:active { transform: scale(0.95); }

.charPreviewSlot {
  width: 320px;
  height: 320px;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  flex: 0 1 auto;
  min-height: 0;
}
.charPreviewSlot.dragging { cursor: grabbing; }
.charPreviewSlot canvas { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.4)); }

.brawlerStats {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: rgba(8, 24, 80, 0.55);
  border: 3px solid var(--panel-dark);
  border-radius: 12px;
  min-height: 0;
}
.statsTitle { margin: 0 0 2px; font-size: 16px; color: #fff; }

.statRow {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 3px solid var(--ink);
  font-weight: 800;
  font-size: 12px;
  color: #fff;
  text-shadow: 0 1px 0 var(--ink);
  background: #123f9e;
}
.statRow.health { background: linear-gradient(90deg, #3fa94a, #5cc85f); }
.statRow.attack { background: linear-gradient(90deg, #d8283b, #ff5766); }
.statRow.super { background: linear-gradient(90deg, #d99a0d, #ffc53d); color: var(--text-dark); text-shadow: none; }
.statRow.range { background: linear-gradient(90deg, #2f6fd1, #55a0ff); }
.upgradeDelta { color: #7dff8a; font-weight: 800; }
.scopeNote { font-size: 11px; opacity: 0.8; }
.statIcon { font-size: 16px; line-height: 1; }
.statLabel { flex: 1 1 auto; text-transform: uppercase; letter-spacing: 0.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statValue { font-family: var(--head-font); font-size: 16px; }
.statSub { margin: 0; font-size: 12px; opacity: 0.9; font-weight: 600; }
.statSub:empty { display: none; }

.powerRow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; font-size: 13px; }
.powerRow .statLabel { flex: 0 0 auto; }
.powerRow .statSub { flex: 1 1 auto; }
.upgradeBtn {
  padding: 6px 14px;
  border-radius: 10px;
  border: 3px solid var(--ink);
  background: var(--yellow);
  color: var(--text-dark);
  font-family: var(--head-font);
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--yellow-edge), 0 5px 0 var(--ink);
}
.upgradeBtn { max-width: 100%; white-space: normal; }
.upgradeBtn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.5); }

/* Portrait strip. game.js renders .charGridGroup > h3.charGridHeading +
   .charGridRow > .charTile; flatten into a single horizontally scrolling
   strip so it works with either that grouped markup or a flat one. */
.charGrid {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 4px 8px;
  scrollbar-width: thin;
  touch-action: pan-x;
  background: rgba(8, 24, 80, 0.4);
  border-radius: 12px;
}
.charGridGroup, .charGridRow { display: contents; }
.charGridHeading { display: none; }

.charTile {
  position: relative;
  flex: 0 0 auto;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  border: 3px solid var(--ink);
  background: #123f9e;
  color: #fff;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.charTile:hover { transform: translateY(-2px); }
.charTile.selected { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow-edge); }
.charTile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.charTile span { font-size: 9px; font-weight: 700; text-align: center; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.charTile.locked { filter: grayscale(1); opacity: 0.55; }
.charTile.locked::after { content: "🔒"; position: absolute; top: 2px; right: 2px; font-size: 16px; text-shadow: 0 1px 2px #000; }
.charTile.locked.selected { opacity: 0.8; }

.brawlerFooter { flex: 0 0 auto; display: flex; justify-content: center; gap: 14px; padding-bottom: 6px; }
.brawlerFooter .primaryBtn { padding: 8px 40px; font-size: 18px; }

/* ---------- Results ---------- */
.resultsPanel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(100%, 620px);
  max-height: 96%;
  overflow-y: auto;
  padding: 18px 26px 20px;
  background: var(--panel);
  border: 4px solid var(--panel-dark);
  border-radius: 14px;
  box-shadow: 0 6px 0 var(--ink), inset 0 0 0 2px rgba(255, 255, 255, 0.12);
}

#resultTitle {
  margin: 0;
  font-size: clamp(36px, 7vw, 68px);
  line-height: 1;
  color: var(--yellow);
  -webkit-text-stroke: 3px var(--ink);
  text-shadow: 0 4px 0 var(--ink);
}

.resultTrophyDelta { margin: 0; font-family: var(--head-font); font-size: 32px; color: var(--gold); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
.resultTrophyDelta:empty { display: none; }
.resultsPanel .subtitle:empty { display: none; }

.resultCards { display: flex; align-items: center; justify-content: center; gap: 14px; }
.resultVs { font-family: var(--head-font); font-size: 18px; color: #fff; text-shadow: 0 2px 0 var(--ink); }
.resultCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 150px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: rgba(8, 24, 80, 0.55);
  font-weight: 800;
}
.resultCard.player { border-color: var(--green); }
.resultCard.bot { border-color: var(--red); }
.resultCard img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--ink); background: #123f9e; }
.resultCardHp { font-size: 13px; opacity: 0.95; color: #d6ffd0; }
.resultCard.bot .resultCardHp { color: #ffd0d4; }

.resultButtons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------- Age gate + cookie consent (onboarding) ---------- */
.ageSliderRow { display: flex; align-items: center; gap: 14px; width: min(90vw, 460px); }

.stepBtn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: var(--green);
  color: #10240f;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 3px 0 #4f9a35, 0 5px 0 var(--ink);
}

.ageTrack {
  position: relative;
  flex: 1 1 auto;
  height: 44px;
  border-radius: 10px;
  background: #123f9e;
  border: 3px solid var(--ink);
  overflow: hidden;
  cursor: pointer;
  touch-action: none; /* finger drags set the age instead of scrolling the page */
  user-select: none;
}
.ageFill { position: absolute; inset: 0; width: 30%; background: linear-gradient(90deg, rgba(139, 211, 106, 0.8), rgba(139, 211, 106, 0.4)); }
.ageValue { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; height: 100%; font-weight: 700; font-size: 18px; }
.cookieText { max-width: 520px; text-align: left; }

/* Tutorial guide bubble: floats over the live arena canvas without blocking
   movement, top-right. */
.guideBubble {
  position: absolute;
  top: 10vh; /* clears the canvas tutorial step banner */
  right: 3vw;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: min(80vw, 420px);
  background: rgba(31, 95, 224, 0.92);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 14px;
  pointer-events: none;
}
.guideBubble.hidden { display: none; }
.guideBubbleAvatar { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 10px; object-fit: cover; border: 2px solid var(--yellow); }
.guideBubbleTextWrap { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.guideBubbleLine { margin: 0; font-size: 14px; text-align: left; line-height: 1.35; }
.guideSkipBtn { pointer-events: auto; background: transparent; border: none; color: rgba(255, 255, 255, 0.75); font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0; }

/* ---------- Narrow and short landscape screens (phones) ---------- */
@media (max-width: 600px) { .shopGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 960px) {
  .brawlerBody { grid-template-columns: minmax(0, 1fr) 240px; gap: 10px; }
  .eventCard { min-width: 150px; padding: 8px 12px; }
  .sideBtn { min-width: 120px; padding: 6px 10px; }
  .hubStat, .hubChip { font-size: 13px; padding: 0 10px; }
}

@media (max-height: 500px) {
  .overlay { padding-top: 8px; padding-bottom: 8px; gap: 10px; }
  .titlePanel { padding: 12px 18px; gap: 9px; }
  .titleButtonRow { gap: 8px; }
  .primaryBtn, .secondaryBtn { font-size: 14px; padding: 8px 18px; border-width: 2px; }
  .shopCard img { width: 48px; height: 48px; }

  .titleScreen.hub {
    grid-template-columns: 70px minmax(0, 1fr) 70px;
    grid-template-rows: 40px minmax(0, 1fr) auto;
    gap: 4px 10px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .hubChip, .hubStat, .hubIcon { height: 34px; font-size: 12px; border-width: 2px; }
  .hubChip { min-width: 70px; }
  .hubIcon { width: 34px; font-size: 18px; }
  .hubLeft { gap: 6px; }
  .hubNav { width: 62px; height: 62px; font-size: 9px; border-width: 3px; }
  .hubNavIcon { font-size: 20px; }
  .hubPreviewSlot { height: 190px; }
  .hubFighterName { font-size: 18px; }
  .hubFighterMeta { font-size: 11px; }
  .hubNextGoal { display: none; }
  .eventCard { padding: 5px 10px; min-width: 130px; border-width: 3px; }
  .eventMode { font-size: 14px; }
  .eventArena { font-size: 11px; }
  .eventSub { display: none; }
  .eventWrap { gap: 4px; }
  .botCountRow { padding: 2px 4px 2px 8px; border-width: 2px; }
  .botCountLabel { font-size: 11px; }
  .botCountValue { font-size: 16px; }
  .botCountBtn { width: 36px; height: 30px; font-size: 18px; border-width: 2px; }
  .sideBtn { min-width: 100px; padding: 4px 8px; border-width: 3px; }
  .sideName { font-size: 12px; }
  .sideCharacter { font-size: 9px; }
  .playBtn, .primaryBtn.playBtn { width: 150px; height: 52px; font-size: 24px; border-radius: 12px; }
  .hubMini { padding: 1px 9px; font-size: 10px; }
  .hubPlayWrap { gap: 3px; }

  .brawlerScreen { padding: 6px max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left)); }
  .brawlerPanel { padding: 6px 12px; gap: 4px; }
  .brawlerHeader .hubStat { height: 28px; }
  .backBtn { height: 32px; width: 38px; font-size: 14px; }
  .brawlerTag, .lockPill { font-size: 10px; padding: 3px 10px; }
  .brawlerBody { grid-template-columns: minmax(0, 1fr) 210px; gap: 8px; }
  .charPreviewSlot { width: 150px; height: 150px; }
  .brawlerName { font-size: 20px; }
  .brawlerRole { font-size: 10px; margin: 0; }
  .signatureName { display: none; }
  .arrowBtn { width: 36px; height: 56px; font-size: 30px; }
  .brawlerStats { padding: 6px 8px; gap: 4px; border-width: 2px; }
  .statsTitle { font-size: 12px; }
  .statRow { height: 24px; font-size: 10px; border-width: 2px; padding: 0 6px; }
  .statValue { font-size: 12px; }
  .powerRow { font-size: 11px; }
  .upgradeBtn { padding: 3px 10px; font-size: 10px; }
  .statSub { font-size: 10px; }
  .charGrid { padding: 3px 4px 4px; gap: 6px; }
  .charTile { width: 46px; padding: 2px; border-width: 2px; }
  .charTile span { display: none; }
  .charTile.locked::after { font-size: 12px; }
  .brawlerFooter { padding-bottom: 2px; }
  .brawlerFooter .primaryBtn { padding: 5px 30px; font-size: 14px; }

  .resultsPanel { padding: 8px 18px 10px; gap: 5px; }
  #resultTitle { font-size: 34px; -webkit-text-stroke-width: 2px; }
  .resultTrophyDelta { font-size: 22px; }
  .resultCards { gap: 8px; }
  .resultCard { min-width: 120px; padding: 5px 10px; flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .resultCard img { width: 44px; height: 44px; }
  .rewardLine { font-size: 16px; }
  .resultButtons { gap: 6px; }
}

/* === Match ceremony (M1-C) ===
   Owned by src/ui/matchFlow.js. All overlays are non-interactive. */
.mcLayer, .mcLayer * { pointer-events: none; }
.mcLayer { position: absolute; inset: 0; z-index: 40; overflow: hidden; font-family: var(--head-font); text-transform: uppercase; letter-spacing: 1px; color: #fff; }
.mcSr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
.mcLayer .mcKicker, .mcLayer .mcModeTitle, .mcLayer .mcArena, .mcLayer .mcName, .mcLayer .mcCount, .mcLayer .mcVs, .mcLayer .mcBanner, .mcLayer .mcRqTitle {
  -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink);
}
.mcOut { opacity: 0 !important; transition: opacity .2s ease; }

/* Low HP vignette */
.mcVignette { position: absolute; inset: 0; opacity: 0; transition: opacity .25s ease;
  background: radial-gradient(ellipse at center, rgba(255,75,92,0) 50%, rgba(255,40,60, calc(.3 + var(--mc-low, 0) * .55)) 100%);
  box-shadow: inset 0 0 calc(40px + var(--mc-low, 0) * 120px) rgba(230, 20, 40, calc(.3 + var(--mc-low, 0) * .7)); }
.mcVignette.mcOn { opacity: 1; }
.mcVignette.mcPulse { animation: mcBeat 1s ease-in-out infinite; }
@keyframes mcBeat { 50% { opacity: .55; } }

/* Intro card */
.mcIntro { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); padding: clamp(10px, 3vh, 28px) 5vw; text-align: center;
  background: linear-gradient(90deg, transparent, rgba(11,63,168,.94) 12%, rgba(11,63,168,.94) 88%, transparent);
  border-top: 4px solid var(--ink); border-bottom: 4px solid var(--ink); animation: mcSlideIn .4s cubic-bezier(.2,1.3,.4,1) both; }
.mcKicker { font-size: clamp(11px, 1.8vh, 16px); color: var(--yellow); }
.mcModeTitle { font-size: clamp(34px, 11vh, 92px); line-height: 1; margin: 4px 0; }
.mcArena { font-size: clamp(14px, 3vh, 28px); color: var(--team-blue); }
.mcRule { margin-top: 6px; font-family: "Segoe UI", Arial, sans-serif; text-transform: none; letter-spacing: 0; font-weight: 700; font-size: clamp(13px, 2.6vh, 22px); }
.mcMods { margin-top: 8px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.mcMod { background: var(--yellow); color: var(--text-dark); border: 3px solid var(--ink); border-radius: 999px; padding: 2px 12px; font-size: clamp(10px, 1.8vh, 14px); box-shadow: 0 3px 0 var(--yellow-edge); }
@keyframes mcSlideIn { from { transform: translateY(-50%) translateX(-60%); opacity: 0; } to { transform: translateY(-50%); opacity: 1; } }

/* Versus + countdown */
.mcVersus { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 2vw; padding: 0 3vw;
  background: radial-gradient(ellipse at center, rgba(11,63,168,.55), rgba(8,18,48,.88)); animation: mcFade .25s both; }
.mcCard { width: clamp(120px, 24vw, 280px); padding: clamp(8px, 2vh, 18px); border: 4px solid var(--panel-dark); border-radius: 14px; background: var(--panel); text-align: center; box-shadow: 0 6px 0 var(--ink); }
.mcGreen { border-color: #3d7a2a; background: linear-gradient(#5fa845, #2f6b21); }
.mcBlue { border-color: #1d5d85; background: linear-gradient(#4aa3d1, #1f5f8f); }
.mcLeft { animation: mcFromLeft .45s cubic-bezier(.2,1.2,.4,1) both; }
.mcRight { animation: mcFromRight .45s cubic-bezier(.2,1.2,.4,1) both; }
.mcPortrait { width: clamp(64px, 24vh, 190px); aspect-ratio: 1; margin: 0 auto 8px; border-radius: 12px; border: 4px solid var(--ink); background: rgba(0,0,0,.25); overflow: hidden; }
.mcPortrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mcName { font-size: clamp(15px, 3.4vh, 28px); line-height: 1.1; }
.mcFaction { font-size: clamp(10px, 1.8vh, 14px); color: var(--yellow); margin-top: 2px; }
.mcPower { display: inline-block; margin-top: 6px; background: var(--gold); color: var(--text-dark); border: 3px solid var(--ink); border-radius: 999px; padding: 1px 12px; font-size: clamp(10px, 1.9vh, 15px); }
.mcMid { flex: 0 0 auto; width: clamp(110px, 24vw, 300px); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mcVs { font-size: clamp(18px, 5vh, 40px); color: var(--red); }
.mcCount { min-height: 1.1em; font-size: clamp(54px, 22vh, 190px); line-height: 1; color: #fff; white-space: nowrap; }
.mcCount.mcTick { animation: mcPop .8s ease-out both; }
.mcCount.mcGo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2; font-size: clamp(40px, 17vh, 150px); color: var(--yellow); animation: mcPop .7s cubic-bezier(.2,1.6,.4,1) both; -webkit-text-stroke-width: 3px; }
.mcVersus:has(.mcGo) .mcVs { visibility: hidden; }
.mcVersus:has(.mcGo) .mcCard { filter: brightness(.55); }
@keyframes mcFromLeft { from { transform: translateX(-120%); } to { transform: none; } }
@keyframes mcFromRight { from { transform: translateX(120%); } to { transform: none; } }
@keyframes mcPop { 0% { transform: scale(2.2); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(.85); opacity: .85; } }
@keyframes mcFade { from { opacity: 0; } to { opacity: 1; } }

/* In-match banners */
.mcBanner { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); white-space: nowrap; max-width: 96vw; padding: .1em .7em; border: 4px solid var(--ink); border-radius: 14px;
  font-size: clamp(22px, 8vh, 64px); box-shadow: 0 5px 0 var(--ink); animation: mcBannerIn .35s cubic-bezier(.2,1.5,.4,1) both; }
.mcRedB { background: var(--red); }
.mcGoldB { background: var(--gold); color: #fff; }
@keyframes mcBannerIn { from { transform: translateX(-50%) scale(1.8); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }

/* Award tags (placed by the integrator on the results screen) */
.mcAwards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; pointer-events: none; }
.mcAward { display: inline-flex; align-items: center; gap: 8px; background: var(--yellow); color: var(--text-dark); border: 3px solid var(--ink); border-radius: 10px; padding: 3px 10px; box-shadow: 0 3px 0 var(--yellow-edge); font-family: var(--head-font); text-transform: uppercase; font-size: clamp(10px, 1.9vh, 14px); animation: mcTagIn .3s both; }
.mcAward:nth-child(2) { animation-delay: .1s; } .mcAward:nth-child(3) { animation-delay: .2s; } .mcAward:nth-child(n+4) { animation-delay: .3s; }
.mcAwardValue { background: var(--ink); color: var(--yellow); border-radius: 6px; padding: 0 7px; }
@keyframes mcTagIn { from { transform: scale(.4) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* Requeue interstitial */
.mcRequeue { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 2vh, 18px); padding: 4vh 6vw; text-align: center;
  background: radial-gradient(ellipse at center, var(--blue-hi), var(--blue-lo)); animation: mcFade .25s both; }
.mcRqTitle { font-size: clamp(24px, 8vh, 56px); }
.mcDots { display: flex; gap: 10px; } .mcDots i { width: 14px; height: 14px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--ink); animation: mcBounce 1s ease-in-out infinite; }
.mcDots i:nth-child(2) { animation-delay: .15s; } .mcDots i:nth-child(3) { animation-delay: .3s; }
@keyframes mcBounce { 50% { transform: translateY(-9px); } }
.mcTipLabel { font-size: clamp(10px, 1.8vh, 14px); color: var(--yellow); margin-top: 6px; }
.mcTip { max-width: min(640px, 88vw); min-height: 3.2em; background: var(--panel); border: 4px solid var(--panel-dark); border-radius: 14px; padding: 12px 18px; box-shadow: 0 5px 0 var(--ink);
  font-family: "Segoe UI", Arial, sans-serif; text-transform: none; letter-spacing: 0; font-weight: 700; font-size: clamp(13px, 2.8vh, 22px); }
.mcTipIn { animation: mcFade .4s both; }

@media (prefers-reduced-motion: reduce) {
  .mcIntro, .mcLeft, .mcRight, .mcCount.mcTick, .mcCount.mcGo, .mcBanner, .mcAward, .mcDots i, .mcVignette.mcPulse { animation: none !important; }
  .mcOut, .mcVignette { transition-duration: .05s; }
}
/* === end Match ceremony (M1-C) === */

/* === Results integration (M1-I, 2026-09-30) === */
.resultsPanel { max-height: calc(100% - 16px); overflow-y: auto; }
.resultPoseSlot { width: 96px; height: 96px; }
.resultPoseSlot canvas { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.4)); }
.resultCard .mcAwards { flex-direction: row; flex-wrap: wrap; justify-content: center; max-width: 230px; gap: 4px; margin-top: 2px; }
.resultCard .mcAward { font-size: clamp(9px, 1.6vh, 12px); padding: 2px 8px; }
.resultCard .mcAwardValue:empty { display: none; }
@media (max-height: 450px) {
  .resultPoseSlot { width: 52px; height: 52px; }
  .resultCard .mcAwards { max-width: 300px; }
  .resultTrophyDelta { margin: 0; }
  #resultDetail { display: none; }
  .resultButtons .primaryBtn, .resultButtons .secondaryBtn { padding: 5px 12px; font-size: 13px; }
}
/* === end results integration === */


/* ---------- Splash title (2026-10-01) ---------- */
.splash {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #06090c;
  overflow: hidden;
}
.splash.hidden { display: none; }
.splashBackdrop {
  position: absolute;
  inset: -40px;
  background: url("assets/ui/menu_bg.jpg") center / cover no-repeat;
  filter: blur(22px) brightness(0.45) saturate(1.2);
}
.splashArt {
  position: relative;
  width: min(100vw, calc(var(--vh, 1vh) * 100 * 1672 / 941));
  aspect-ratio: 1672 / 941;
  max-height: calc(var(--vh, 1vh) * 100);
  background: url("assets/ui/menu_bg.jpg") center / 100% 100% no-repeat;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
  animation: splashIn 0.6s ease-out both;
}
@keyframes splashIn { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.splashHot {
  position: absolute;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s, background-color 0.15s, transform 0.1s;
}
.splashHot:hover, .splashHot:focus-visible { background-color: rgba(255, 210, 63, 0.10); box-shadow: 0 0 24px 4px rgba(255, 210, 63, 0.45); outline: none; }
.splashHot:active { transform: scale(0.96); }
/* Positions in % of the art: PLAY 731..1026 x 715..803, SETTINGS 805..955 x 815..855. */
.splashPlay { left: 43.7%; top: 76%; width: 17.6%; height: 9.4%; animation: splashPulse 1.6s ease-in-out infinite; }
.splashSettings { left: 48.1%; top: 86.6%; width: 9%; height: 4.3%; }
@keyframes splashPulse {
  0%, 100% { box-shadow: 0 0 10px 0 rgba(255, 210, 63, 0.15); }
  50% { box-shadow: 0 0 34px 8px rgba(255, 210, 63, 0.5); }
}
/* Covers the painted QUIT (820..940 x 860..896) with a matching dark plate. */
.splashTraining {
  position: absolute;
  left: 47.6%;
  top: 91.1%;
  width: 10.2%;
  height: 4.4%;
  border: 0;
  border-radius: 6px;
  background: radial-gradient(ellipse at center, #0b1013 60%, rgba(11, 16, 19, 0.85) 100%);
  color: #e9e2cf;
  font-family: var(--head-font);
  font-size: clamp(9px, 1.35vw, 20px);
  letter-spacing: 0.12em;
  cursor: pointer;
  text-shadow: 0 1px 0 #000;
}
.splashTraining:hover, .splashTraining:focus-visible { color: #ffd23f; outline: none; text-shadow: 0 0 10px rgba(255, 210, 63, 0.7); }
.srOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- First-run welcome ---------- */
.welcomeScreen { isolation: isolate; background: #081230; overflow: hidden; }
/* Blurred art behind the panel (blur also hides the painted menu words). */
.welcomeScreen::before {
  content: "";
  position: absolute;
  inset: -40px;
  z-index: -1;
  background: linear-gradient(180deg, rgba(8, 18, 48, 0.55), rgba(8, 18, 48, 0.85)), url("assets/ui/menu_bg.jpg") center / cover no-repeat;
  filter: blur(14px);
}
.welcomePanel { max-width: 560px; }
.welcomeAvatar { width: 84px; height: 84px; flex-shrink: 0; padding: 3px; background: #fff; border-radius: 16px; object-fit: contain; border: 3px solid var(--yellow); box-shadow: 0 4px 0 var(--ink); }
.welcomeSteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; text-align: left; width: 100%; }
.welcomeSteps li { display: flex; align-items: center; gap: 12px; background: rgba(13, 27, 61, 0.55); border: 2px solid rgba(255, 255, 255, 0.15); border-radius: 12px; padding: 8px 12px; }
.welcomeSteps b { display: block; font-family: var(--head-font); letter-spacing: 0.5px; }
.welcomeSteps small { display: block; opacity: 0.8; }
.welcomeStepNum { flex: 0 0 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--yellow); color: var(--ink); font-family: var(--head-font); font-size: 18px; }
.welcomeStartBtn { width: auto !important; padding: 0 28px; }
.readyChecks { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; font-weight: 700; color: var(--green); }

@media (max-height: 500px) {
  .welcomeAvatar { width: 56px; height: 56px; }
  .welcomeSteps li { padding: 5px 10px; }
}

/* ---------- In-app browser notice ---------- */
.inAppNotice {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 8px 12px;
  background: rgba(13, 27, 61, 0.95);
  border: 2px solid var(--yellow);
  border-radius: 12px;
  font-size: 13px;
}
.inAppNotice.hidden { display: none; }
.inAppOpen { flex: 0 0 auto; color: var(--ink); background: var(--yellow); border-radius: 8px; padding: 5px 10px; font-weight: 700; text-decoration: none; }
.inAppOpen.hidden { display: none; }
.inAppDismiss { flex: 0 0 auto; background: transparent; border: 0; color: #fff; font-size: 16px; cursor: pointer; }

/* ---------- Story campaign: Office War Week (2026-10-01) ---------- */
.hubNav.story { background: linear-gradient(180deg, #ff9a3c, #d9531e); box-shadow: 0 4px 0 #8a2f0c, 0 6px 0 var(--ink); }
/* To-Do chip (2026-10-09): yellow clipboard next to the profile chip; badge = unfinished To-Do items. */
.hubChip.todoChip { position: relative; background: linear-gradient(180deg, #ffe27a, #ffc53d); color: var(--ink); -webkit-text-stroke: 0; }
.hubChip.todoChip .hubChipSub { opacity: 1; font-weight: 700; }
.reviewStripSlot:empty { display: none; }
.storyScreen, .storyCardScreen { background: radial-gradient(ellipse at 50% 20%, rgba(70, 22, 6, 0.94), rgba(8, 6, 18, 0.96)); }
.storyPanel, .storyCard {
  width: min(880px, 100%); max-height: calc(100% - 8px); overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 18px; border: 4px solid var(--ink); border-radius: 18px;
  background: linear-gradient(180deg, #2a1240, #140a24); color: #fff;
  box-shadow: 0 6px 0 var(--ink), 0 0 40px rgba(255, 140, 40, 0.25);
}
.storyKicker { margin: 0; font-size: 11px; letter-spacing: 2px; color: #ffb36b; }
.storyTitle { margin: 0; font-size: clamp(24px, 4.5vw, 42px); color: #ff9a3c; -webkit-text-stroke: 2px var(--ink); }
.storySub, .storySideNote { margin: 0; font-size: 13px; color: #e7d9ff; }
.storySideNote { color: #ffd23f; }
.storyNightList { list-style: none; margin: 4px 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.storyNight {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  padding: 8px 10px; border: 3px solid var(--ink); border-radius: 12px; text-align: left;
  background: #3b1d5a; color: #fff; cursor: pointer; font: inherit; box-shadow: 0 3px 0 var(--ink);
}
.storyNight:hover:not(:disabled) { filter: brightness(1.15); }
.storyNight:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.5); }
.storyNight.cleared { background: #2f4a1d; }
.storyNight.next { background: #7a3410; outline: 3px solid #ffd23f; }
.storyNightNum { font-size: 11px; color: #ffb36b; letter-spacing: 1px; }
.storyNightTitle { font-family: var(--head-font); font-size: 14px; line-height: 1.15; }
.storyNightMeta { font-size: 11px; color: #d6c8f0; }
.storyButtons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.storyCardTop { width: 100%; display: flex; justify-content: space-between; font-size: 12px; }
.onAir { color: #ff4b5c; font-weight: bold; letter-spacing: 1px; animation: onAirPulse 1.2s ease-in-out infinite; }
@keyframes onAirPulse { 50% { opacity: 0.35; } }
.storyCardDate { color: #ffb36b; }
.storyCardNight { margin: 0; font-size: 12px; letter-spacing: 2px; color: #ffb36b; }
.storyCardTitle { margin: 0; font-size: clamp(20px, 3.6vw, 34px); color: #ff9a3c; -webkit-text-stroke: 1.5px var(--ink); }
.storyCardBroadcast { margin: 0; font-style: italic; color: #ffe08a; font-size: 14px; }
.storyCardScene { margin: 0; font-size: 13px; line-height: 1.35; color: #f1eaff; }
.storyCardMemo { margin: 0; padding: 6px 10px; border-radius: 8px; background: #f4ecd2; color: #2a2a2a; font-size: 13px; font-family: "Courier New", monospace; }
.storyCardRules { margin: 0; font-size: 12px; color: #cbb8ef; }
.storyResultLine { margin: 4px 0; font-style: italic; color: #ffe08a; max-width: 640px; }
@media (max-height: 500px) {
  .storyPanel, .storyCard { padding: 10px 12px; gap: 5px; }
  .storyNightList { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
  .storyNight { padding: 5px 8px; }
  .storyCardScene, .storyCardBroadcast { font-size: 12px; }
}
/* ---------- Arena Challenge (2026-10-03) ---------- */
.hubNav.arena { background: linear-gradient(180deg, #ff5d73, #b3193a); box-shadow: 0 4px 0 #6b0c20, 0 6px 0 var(--ink); }
/* Five nav buttons don't fit above the event card on short phones; drop the
   disabled SOCIAL placeholder there until multiplayer exists. */
@media (max-height: 430px) {
  .hubLeft { gap: 5px; }
  .hubNav { width: 56px; height: 56px; }
  #socialBtn { display: none; }
}
.arenaScreen { background: radial-gradient(ellipse at 50% 20%, rgba(80, 8, 24, 0.94), rgba(8, 6, 18, 0.96)); }
.arenaKicker { color: #ff8fa0; }
.arenaTitle { color: #ff5d73; }
.arenaTierList .storyNight { background: #4a1630; }
.arenaTierList .storyNight.cleared { background: #2f4a1d; }
.arenaTierList .storyNightNum { color: #ff8fa0; }
.arenaStake { font-size: 12px; font-weight: 700; color: #ffe08a; }
.arenaRecord { font-size: 11px; color: #b9f3c0; }
.arenaMessage { margin: 0; min-height: 1em; font-size: 13px; color: #ffd23f; }
.rewardExtras { display: block; margin-top: 3px; font-size: 13px; font-weight: 700; color: #fff3b0; }
.resultsPanel .storyResultLine { font-size: 14px; margin: 2px 0; }
@media (max-height: 500px) { .rewardExtras { font-size: 11px; } .resultsPanel .storyResultLine { font-size: 12px; } }

/* Online account screen (2026-10-03) */
.accountPanel .hint a, .cookieText a, .settingsPanel .hint a { color: var(--yellow); }
.accountGoogleSlot { min-height: 44px; display: flex; justify-content: center; }
.accountName { font-size: 20px; font-weight: 700; margin: 0; }
.accountActions { display: grid; gap: 8px; width: 100%; }
.dangerBtn { border-color: #d64545; color: #ffb3b3; }
#accountSignedOut, #accountSignedIn { display: grid; gap: 10px; width: 100%; }
.accountPanel .hidden { display: none !important; }

.netPanel { max-width: 560px; max-height: 90vh; overflow: auto; padding: 20px; text-align: center; }
.netPanel p { margin: 10px 0; }
.netActions { display: grid; gap: 10px; }
.netActions label { display: grid; gap: 6px; font-weight: 700; }
.netActions input { font: 800 22px Arial, sans-serif; letter-spacing: .2em; text-align: center; text-transform: uppercase; padding: 8px; border-radius: 8px; }
.netRoomCode { font: 900 32px Arial, sans-serif; letter-spacing: .2em; color: var(--yellow); }
.netTabs { display: flex; gap: 8px; justify-content: center; margin: 6px 0 4px; }
.netTabs.hidden { display: none; }
.netTabs button { flex: 1; opacity: .6; }
.netTabs button[aria-selected="true"] { opacity: 1; outline: 2px solid var(--yellow); }
.netBack { margin-top: 10px; }
.lanApprove { display: grid; gap: 8px; margin: 8px 0; padding: 10px; border: 2px solid var(--yellow); border-radius: 10px; }
.lanApprove.hidden { display: none; }
.lanApprove p { margin: 0; font-weight: 800; }
.lanGames { display: grid; gap: 8px; margin: 8px 0; }
.lanGames:empty { display: none; }
.plaqueCard { padding: 16px; border: 2px solid #9e7b3c; border-radius: 8px; background: linear-gradient(135deg, #403020, #2a211b); box-shadow: inset 0 0 0 3px #32271e, 0 3px 8px #0006; }
.plaqueCard.earned { background: linear-gradient(135deg, #a77c35, #73501e); border-color: #edcf81; }
.plaqueStatus { font-size: 11px; letter-spacing: .12em; color: #e5c785; }
.plaqueName { font-size: 18px; line-height: 1.15; margin: 10px 0; }
.plaqueCondition, .plaqueReward, .plaqueProgressLabel { font-size: 13px; }
.plaqueProgress { width: 100%; accent-color: #edcf81; }
@media (max-height: 430px) { .plaqueWallScreen { padding: 12px !important; } .plaqueWallPanel { padding: 12px !important; } .plaqueWallTitle { font-size: 22px; margin: 0 100px 10px 0; } .plaqueWallCount, .plaqueWallPromotionSummary { font-size: 12px; margin: 6px 0; } .plaqueCard { padding: 10px; } }
@media (max-height: 430px) { .netPanel { padding: 10px 16px; } .netPanel h2 { margin: 0; } .netPanel p { font-size: 12px; margin: 6px 0; } .netActions { gap: 6px; } #socialBtn { display: flex !important; } .hubLeft { overflow-y: auto; } }

.loadingProgress { width: min(420px, 78vw); height: 18px; margin: 20px auto 10px; overflow: hidden; border: 2px solid #527aca; border-radius: 12px; background: #172443; }
.loadingProgress span { display: block; width: 0; height: 100%; background: #ffda3d; transition: width .15s linear; }
.loadingBytes { font-variant-numeric: tabular-nums; color: #cbd5e8; font-size: 15px; }

/* Optional AI Brain settings (src/ui/aiCoachSettings.js, 2026-10-14) */
.aiBrainSettings{margin-top:12px}
.aiBrainSettings summary{cursor:pointer}
.aiBrainSettings .aiRow{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0}
.aiBrainSettings input[type=password],.aiBrainSettings input[type=text],.aiBrainSettings select{max-width:100%;min-height:36px}
.aiBrainSettings [hidden]{display:none}

/* ---------- Upgrade your player (Training Room, 2026-10-17; src/ui/trainingRoom.js) ---------- */
.trRoom { z-index: 7; padding: 10px; }
.trCard {
  width: min(860px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: var(--panel);
  border: 4px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 8px 0 var(--ink);
  padding: 12px 18px 10px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.trCard .trTitle { margin: 0; font-size: 26px; text-align: center; color: var(--yellow); text-shadow: 0 3px 0 var(--ink); text-transform: uppercase; }
.trWho, .trWallet { margin: 0; text-align: center; font-weight: 800; font-size: 14px; }
.trWallet { font-size: 13px; opacity: 0.95; }
.trRows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.trRow {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name effect" "line line" "meter meter";
  gap: 2px 6px;
  background: var(--panel-dark);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 6px 8px;
}
.trSignature { border-color: var(--yellow); }
.trName { grid-area: name; display: flex; align-items: center; gap: 6px; text-transform: uppercase; font-size: 13px; }
.trIcon { width: 18px; text-align: center; }
.trStars { color: var(--yellow); font-size: 11px; letter-spacing: 1px; }
.trLine { grid-area: line; font-size: 11px; opacity: 0.85; font-weight: 600; }
.trEffect { grid-area: effect; font-size: 12px; font-weight: 800; color: #7dff8a; white-space: nowrap; }
.trMeter { grid-area: meter; display: flex; align-items: center; gap: 6px; }
.trBar { flex: 1 1 auto; display: flex; gap: 2px; min-width: 0; }
.trBar i { flex: 1 1 0; height: 10px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); }
.trBar i.on { background: var(--green); }
.trBar i.new { background: var(--yellow); }
.trCount { font-family: var(--head-font); font-size: 12px; min-width: 38px; text-align: right; }
.trStep {
  width: 34px; height: 30px;
  border-radius: 8px;
  border: 3px solid var(--ink);
  font-family: var(--head-font);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  background: var(--yellow);
  color: var(--text-dark);
  box-shadow: 0 2px 0 var(--ink);
}
.trMinus { background: #3c85ff; color: #fff; }
.trStep:disabled { opacity: 0.35; cursor: not-allowed; filter: grayscale(0.6); }
.trSummary { margin: 2px 0 0; text-align: center; font-weight: 800; font-size: 13px; }
.trMessage { margin: 0; text-align: center; font-weight: 800; font-size: 13px; color: var(--yellow); min-height: 1em; }
.trMessage:empty { display: none; }
.trButtons { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.trButtons .primaryBtn, .trButtons .secondaryBtn { padding: 8px 20px; font-size: 15px; }
.trNote { margin: 0; text-align: center; font-size: 11px; opacity: 0.8; }
.trOpenBtn.ready { animation: trPulse 1.2s ease-in-out infinite; }
@keyframes trPulse { 50% { transform: scale(1.05); filter: brightness(1.15); } }
@media (prefers-reduced-motion: reduce) { .trOpenBtn.ready { animation: none; } }
@media (max-height: 430px) {
  .trCard { padding: 6px 12px; gap: 4px; }
  .trCard .trTitle { font-size: 20px; }
  .trRow { padding: 3px 6px; grid-template-areas: "name effect" "meter meter"; }
  .trLine, .trNote { display: none; }
  .trStep { height: 26px; }
}
@media (max-width: 560px) { .trRows { grid-template-columns: 1fr; } }
