:root { --bg: #070b13; --panel: rgba(8, 13, 23, .86); --line: rgba(120,190,255,.2); --ink: #e8f1fb; --dim: #8fa3b8; --t0: #2fe6ff; --t1: #ff4cb8; --ok: #59e6ff; --bad: #ff5a4a; --gold: #ffb347; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.35 system-ui, "Segoe UI", Roboto, sans-serif; overflow: hidden; touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 100%; height: 100%; display: block; }
#app, .screen { position: fixed; inset: 0; }

/* menu */
#menu { display: grid; place-items: center; background: radial-gradient(ellipse at 50% 30%, #16233a 0%, #070b13 70%); padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom); }
.menu-card { width: min(720px, 100%); text-align: center; }
.logo { font-weight: 900; font-size: clamp(40px, 9vw, 76px); letter-spacing: .14em; display: flex; justify-content: center; align-items: center; gap: .2em; }
.logo span:first-child { color: var(--t0); } .logo span:last-child { color: var(--t1); }
.logo-line { width: .9em; height: .14em; background: linear-gradient(90deg, var(--t0), var(--t1)); transform: skewX(-30deg); border-radius: 3px; }
.tag { color: var(--dim); margin: 4px 0 26px; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: linear-gradient(160deg, #142033, #0b1320); border: 1px solid var(--line); border-radius: 16px; padding: 18px 12px 14px; display: grid; justify-items: center; gap: 4px; min-height: 132px; }
.tile:hover, .tile:focus-visible { border-color: var(--t0); outline: none; box-shadow: 0 0 18px rgba(47,230,255,.25); }
.tile-icon { width: 46px; height: 46px; color: var(--gold); }
.tile b { font-size: 18px; } .tile small { color: var(--dim); }
.chips { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.chips button { display: flex; align-items: center; gap: 8px; padding: 10px 16px; min-height: 48px; border-radius: 999px; border: 1px solid var(--line); background: #101a2a; }
.chips button span { width: 22px; height: 22px; color: var(--gold); }
.toggle { display: inline-flex; gap: 8px; align-items: center; margin-top: 22px; color: var(--dim); min-height: 44px; }

/* game */
#board { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#labels { position: absolute; inset: 0; pointer-events: none; }
#rain { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.chip { position: absolute; transform: translate(-50%, -100%); background: rgba(10,12,16,.85); border: 1px solid var(--line); border-radius: 8px; padding: 2px 7px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.chip.dmg { color: #fff; border-color: var(--bad); } .chip.dmg small { color: var(--dim); font-weight: 500; margin-left: 4px; }
.float { position: absolute; transform: translate(-50%, -100%); font-weight: 900; font-size: 24px; color: #fff; text-shadow: 0 2px 6px #000; animation: rise 1s ease-out forwards; }
.float small { display: block; font-size: 12px; color: var(--gold); text-align: center; }
@keyframes rise { to { transform: translate(-50%, -190%); opacity: 0; } }
.hud-top { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left)); right: calc(8px + env(safe-area-inset-right)); display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.icon-btn { width: 46px; height: 46px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); padding: 10px; }
.score { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 14px; }
.team { display: flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 900; }
.team.t0 { color: var(--t0); } .team.t1 { color: var(--t1); }
.shape { width: 14px; height: 14px; display: inline-block; background: currentColor; }
.shape.circle { border-radius: 50%; } .shape.hex { clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%); }
.rounds { display: flex; gap: 4px; }
.rounds i { width: 10px; height: 10px; border-radius: 3px; background: #223148; }
.rounds i.done { background: #4d6280; } .rounds i.now { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.rounds i.sd { background: #4a1c26; } .rounds i.sd.done { background: #8a3a46; } .rounds i.sd.now { background: var(--bad); box-shadow: 0 0 6px var(--bad); }
.rounds i.sd:not(.sd ~ .sd) { margin-left: 3px; }
/* The turn banner and the camera buttons live in the top bar's markup: below it on tall screens (absolute), in its row on short ones. */
.turn { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 140px); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; font-weight: 700; display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.turn:empty { display: none; }
.turn .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.turn .order { display: inline-flex; gap: 4px; align-items: center; flex: none; }
.turn .order i { display: inline-block; width: 10px; height: 10px; background: var(--c); }
.turn .order i.s0 { border-radius: 50%; } .turn .order i.s1 { clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%); }
.turn .order i.used { opacity: .25; } .turn .order i.now { width: 14px; height: 14px; box-shadow: 0 0 0 2px #fff; }
.turn .order b { width: 1px; height: 12px; background: var(--line); margin: 0 2px; }
.toast { position: absolute; top: calc(110px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: #3a1f1c; border: 1px solid var(--bad); color: #ffd9d4; padding: 8px 14px; border-radius: 10px; max-width: 90vw; text-align: center; }
.toast.info { background: #1c2a3a; border-color: var(--ok); color: #d9f1ff; }
.cam { position: absolute; right: 0; top: 56px; display: grid; gap: 8px; }
.cam .icon-btn.on { border-color: var(--gold); color: var(--gold); } /* S03b: fit toggle showing the whole arena */
.hud-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 10px; pointer-events: none; }
.hud-bottom > * { pointer-events: auto; }
.roster { display: flex; gap: 6px; flex: none; }
.portrait { width: 64px; min-height: 44px; border-radius: 12px; background: var(--panel); border: 2px solid var(--line); padding: 6px 5px 4px; display: grid; justify-items: center; align-content: start; gap: 3px; position: relative; overflow: hidden; }
.portrait .ico { width: 30px; height: 30px; }
.portrait.t0 .ico { color: var(--t0); } .portrait.t1 .ico { color: var(--t1); }
.portrait.sel { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.3); }
.portrait.used { opacity: .45; } .portrait.out { opacity: .35; filter: grayscale(1); }
/* vitality: a segmented bar as wide as the card; segments shrink rather than spill (the Warden has 7) */
.portrait .vit { display: flex; gap: 2px; width: 100%; height: 6px; } .portrait .vit.dense { gap: 1px; }
.portrait .vit i { flex: 1 1 0; min-width: 0; border-radius: 1px; background: #5fd38b; } .portrait .vit i.lost { background: #223148; }
.portrait small { font-size: 10px; color: var(--dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portrait .ret { height: 12px; margin: -3px 0; font-size: 10px; line-height: 12px; font-weight: 800; color: #000; background: var(--gold); border-radius: 999px; padding: 0 6px; }
.portrait .carry { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; color: #9ff3ff; }
.portrait.carrying { border-color: #7fe9ff; box-shadow: inset 0 0 8px rgba(47,230,255,.35); } .portrait.carrying.sel { border-color: #fff; }
.preview { flex: 1; min-width: 0; text-align: center; font-weight: 600; text-shadow: 0 1px 4px #000; padding-bottom: 6px; }
.preview .why { color: var(--dim); font-weight: 500; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; max-width: 52vw; }
.act { min-width: 64px; min-height: 64px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); display: grid; justify-items: center; align-content: center; gap: 2px; padding: 6px 8px; }
.act span { width: 26px; height: 26px; } .act small { font-size: 11px; color: var(--dim); white-space: nowrap; }
.act.on { border-color: var(--gold); background: #33291a; } .act.on span { color: var(--gold); }
.act.confirm { background: #17402c; border-color: #4fd18b; } .act.confirm span { color: #6ff0a5; }
.act.cancel span { color: var(--bad); }
.recap { position: absolute; left: 8px; top: calc(64px + env(safe-area-inset-top)); margin: 0; padding: 0; list-style: none; max-width: 240px; font-size: 12px; color: var(--dim); display: grid; gap: 2px; pointer-events: none; }
.recap li { background: rgba(10,12,16,.6); border-radius: 6px; padding: 2px 6px; overflow-wrap: anywhere; }
.recap li b.t0 { color: var(--t0); } .recap li b.t1 { color: var(--t1); }

/* options, mood */
.hud-right { display: flex; gap: 8px; }
.opts { display: grid; gap: 4px; justify-items: center; margin-top: 18px; }
.opts .toggle { margin-top: 0; }
.hl { display: flex; gap: 10px; align-items: center; color: var(--dim); min-height: 44px; }
.hl span { white-space: nowrap; } .hl input[type=range] { width: 150px; min-width: 0; accent-color: var(--t0); height: 44px; margin: 0; }
.hl-val { min-width: 54px; text-align: left; color: var(--ink); font-weight: 700; }
.hl-track { display: grid; flex: 1 1 auto; min-width: 0; } .hl-track input[type=range] { width: 100%; }
.hl-scale { display: flex; justify-content: space-between; margin: -12px 0 2px; font-size: 11px; line-height: 14px; color: var(--dim); }
.opt-sheet { position: absolute; right: 8px; top: calc(64px + env(safe-area-inset-top)); width: min(330px, calc(100vw - 16px)); max-height: calc(100dvh - 72px); overflow: auto; background: rgba(8, 13, 23, .95); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px 10px; z-index: 6; }
.opt-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.opt-head .icon-btn { width: 44px; height: 44px; padding: 10px; }
.opt-note { margin: 4px 0 0; font-size: 12px; color: var(--dim); }
.mood { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, transparent 58%, rgba(2, 4, 10, .5) 100%); }
@media (max-height: 500px) { .opt-sheet { top: calc(56px + env(safe-area-inset-top)); width: 290px; padding: 2px 10px 6px; } .opt-note { display: none; } }

/* menu on short screens (phone landscape): smaller logo and tiles, options in one row, so the card fits without scrolling */
@media (max-height: 500px) {
  #menu { padding: calc(6px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left)); }
  .logo { font-size: clamp(28px, 9vh, 48px); } .tag { margin: 0 0 6px; font-size: 12px; }
  .menu-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px; }
  .tile { min-height: 0; padding: 7px 8px; gap: 2px; border-radius: 14px; } .tile-icon { width: 30px; height: 30px; } .tile b { font-size: 16px; } .tile small { font-size: 12px; line-height: 1.2; }
  .chips { margin-top: 6px; } .opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; margin-top: 4px; }
}

/* deployment */
.deploy-panel { display: grid; gap: 6px; justify-items: end; }
.deploy-panel .presets, .deploy-panel .slots { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.deploy-panel .slots span { color: var(--dim); font-size: 12px; margin-right: 2px; }
.pill { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; }
.slot { min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px dashed var(--line); background: var(--panel); font-weight: 700; color: var(--dim); }
.slot.has { border-style: solid; color: var(--ink); } .slot.save { padding: 0 10px; color: var(--gold); }
.pill.on, .slot.on { border-color: var(--gold); background: #33291a; color: var(--gold); }
.overlay.opaque { background: #0b0e12; }

/* overlays */
.overlay { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(8,10,14,.72); padding: 16px; }
.result-card, .help-card { background: linear-gradient(160deg, #142033, #0a111c); border: 1px solid var(--line); border-radius: 20px; padding: 24px; width: min(560px, 100%); text-align: center; }
.result-card h2 { font-size: 34px; margin: 0 0 6px; } .result-card p { color: var(--dim); margin: 0 0 14px; }
.result-score { font-size: 48px; font-weight: 900; margin-bottom: 18px; } .result-score .t0 { color: var(--t0); } .result-score .t1 { color: var(--t1); }
.row { display: flex; gap: 10px; justify-content: center; align-items: center; }
.row button { min-height: 48px; min-width: 96px; border-radius: 12px; border: 1px solid var(--line); background: #101a2a; padding: 0 18px; }
.row button.primary { background: var(--gold); color: #1a1405; font-weight: 800; border: 0; }
.help-page { display: grid; gap: 10px; justify-items: center; }
.help-art { width: 100%; aspect-ratio: 16/9; border-radius: 14px; background: #10141a; border: 1px solid var(--line); }
.help-page h3 { margin: 4px 0 0; font-size: 20px; } .help-page p { margin: 0; color: var(--dim); }
#help-dots i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #223148; margin: 0 3px; } #help-dots i.on { background: var(--gold); }

@media (max-width: 720px) {
  .portrait { width: 56px; } .portrait .ico { width: 24px; height: 24px; }
  .act { min-width: 54px; min-height: 54px; } .actions { max-width: 100%; }
  .pill { padding: 0 10px; font-size: 13px; }
  .hud-bottom { flex-wrap: wrap; } .preview { order: -1; flex-basis: 100%; }
  .recap { display: none; } .team { font-size: 20px; } .rounds { gap: 3px; } .rounds i { width: 7px; }
}
.result-card, .help-card { max-height: calc(100dvh - 24px); overflow: auto; }
@media (max-height: 520px) { .help-art { max-height: 38dvh; aspect-ratio: auto; height: 38dvh; } .help-card, .result-card { padding: 12px 16px; } .help-page p { font-size: 13px; } .result-score { font-size: 32px; margin-bottom: 8px; } .result-card h2 { font-size: 26px; } }

/* phone landscape and other short screens: everything on the top bar, a slimmer bottom bar, so the board gets the middle */
@media (max-height: 500px) {
  .hud-top { top: calc(6px + env(safe-area-inset-top)); left: calc(6px + env(safe-area-inset-left)); right: calc(6px + env(safe-area-inset-right)); }
  .hud-top { gap: 6px; justify-content: flex-start; }
  .icon-btn { width: 44px; height: 44px; padding: 9px; border-radius: 11px; }
  .score { padding: 3px 10px; margin: 0 auto; flex: none; gap: 8px; } .team { font-size: 20px; }
  .turn { position: static; transform: none; max-width: none; flex: 0 1 auto; min-width: 0; font-size: 13px; padding: 0 10px; height: 44px; gap: 8px; }
  .cam { position: static; grid-auto-flow: column; gap: 6px; }
  .hud-right { gap: 6px; }
  .recap { display: none; }
  .toast { top: calc(52px + env(safe-area-inset-top)); }
  .hud-bottom { padding: 4px calc(6px + env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) calc(6px + env(safe-area-inset-left)); }
  .portrait { width: 56px; padding: 4px 4px 3px; gap: 2px; } .portrait .ico { width: 22px; height: 22px; } .portrait small { font-size: 9px; } .portrait .vit { height: 5px; }
  .act { min-width: 50px; min-height: 50px; padding: 4px 6px; border-radius: 12px; } .act span { width: 22px; height: 22px; }
  .preview { font-size: 13px; padding-bottom: 2px; }
}

/* rotate-to-landscape screen (phones: shortest side under 768 CSS px) */
#rotate { display: none; position: fixed; inset: 0; z-index: 50; place-items: center; background: radial-gradient(ellipse at 50% 38%, #14233a 0%, #0a111c 58%, #05080e 100%); color: var(--ink); }
.rot-stage { display: grid; justify-items: center; gap: 10px; }
.rot-art { width: min(92vw, 420px); height: auto; filter: drop-shadow(0 18px 30px rgba(0,0,0,.55)); }
.rot-phone { animation: rot-turn 3.2s cubic-bezier(.65,0,.35,1) infinite; transform-box: view-box; transform-origin: 0 0; }
.rot-arc { animation: rot-arc 3.2s ease-in-out infinite; }
@keyframes rot-turn { 0%, 18% { transform: translate(160px, 160px) rotate(0deg); } 52%, 86% { transform: translate(160px, 160px) rotate(90deg); } 100% { transform: translate(160px, 160px) rotate(0deg); } }
@keyframes rot-arc { 0%, 12% { opacity: 1; } 50%, 100% { opacity: .15; } }
.rot-mark .logo-line { display: block; width: 64px; height: 6px; background: linear-gradient(90deg, var(--t0), var(--t1)); transform: skewX(-30deg); border-radius: 3px; }
.rot-text { display: flex; gap: 8px; align-items: center; margin: 4px 0 0; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; color: var(--dim); }
.rot-icon { width: 20px; height: 20px; color: var(--gold); }
@media (prefers-reduced-motion: reduce) { .rot-phone, .rot-arc { animation: none; } .rot-phone { transform: translate(160px, 160px) rotate(90deg); } }
@media (orientation: portrait) and (max-width: 767px) and (max-height: 980px) { /* G14: small tablets held upright (e.g. 640x1024) play; phones still turn */
  #rotate { display: grid; }
  #app { visibility: hidden; }
}

/* Sound controls (S06 audio on main keeps these ids): menu link, top-bar speaker, Sound section inside the Options sheet, voice caption */
.sound-link { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--dim); }
.sound-link svg, .sound-btn svg { width: 22px; height: 22px; } [data-sound-open].muted .wave { opacity: .15; }
.opt-sound { display: grid; gap: 0; margin-top: 2px; padding-top: 4px; border-top: 1px solid var(--line); }
.opt-sub { font-size: 13px; color: var(--ink); }
.slider { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 44px; color: var(--dim); }
.slider input { width: 100%; min-width: 0; height: 44px; margin: 0; accent-color: #5fd0ff; }
.vo { position: absolute; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(80vw, 640px); width: max-content; padding: 6px 12px; border-radius: 10px; background: rgba(10,14,20,.78); color: #dfe8f2; font-style: italic; font-size: 14px; pointer-events: none; overflow-wrap: anywhere; }
@media (max-height: 500px) {
  .hud-top { gap: 5px; } .cam, .hud-right { gap: 5px; }
  /* two columns on short screens: highlight and energy saver left, sound right, so the sheet never needs to scroll */
  .opt-sheet { width: min(600px, calc(100vw - 16px)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 18px; align-content: start; }
  .opt-head { grid-column: 1 / -1; } .opt-sheet > .hl, .opt-sheet > .toggle, .opt-sheet > .intro-link { grid-column: 1; } .opt-sheet > .toggle { margin-top: 0; }
  .opt-sound { grid-column: 2; grid-row: 2 / span 5; border-top: 0; padding-top: 0; margin-top: 0; }
  .opt-sound .slider { grid-template-columns: 62px minmax(0, 1fr); }
  .vo { bottom: calc(108px + env(safe-area-inset-bottom)); font-size: 13px; max-width: 70vw; }
}

/* G06b arena chooser (graphics first): a menu link with the chosen arena's key image; a full sheet of key-art cards grouped
   by league, each with its home team's crest and colour bar, and a detail panel with a large preview. Names wrap, never cut. */
.arena-link { max-width: min(92vw, 420px); }
.arena-mini { width: 40px; height: 26px; flex: none; border-radius: 5px; overflow: hidden; display: grid; place-items: center; background: #101a2a; color: var(--gold); }
.arena-mini img { width: 100%; height: 100%; object-fit: cover; display: block; } .arena-mini svg { width: 20px; height: 20px; }
.arena-link #arena-name { text-align: left; line-height: 1.15; overflow-wrap: anywhere; }
.arena-sheet { position: fixed; inset: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); margin: 0 auto; max-width: 1280px; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, rgba(14, 22, 38, .98), rgba(6, 10, 18, .98)); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px 14px; z-index: 7; box-shadow: 0 20px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(160, 210, 255, .08); }
.arena-head { gap: 12px; } .arena-head b { font-size: 20px; letter-spacing: .04em; text-transform: uppercase; } .arena-head .arena-sub { flex: 1; color: var(--dim); font-weight: 400; font-size: 13px; }
.arena-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; }
.arena-grid { min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); grid-auto-rows: max-content; gap: 12px; align-content: start; padding: 2px 6px 6px 2px; scrollbar-width: thin; scrollbar-color: #2a3a55 transparent; }
.ac-group { grid-column: 1 / -1; margin: 8px 2px 0; display: flex; align-items: baseline; gap: 10px; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.ac-group small { letter-spacing: 0; text-transform: none; color: var(--dim); font-weight: 400; font-size: 12px; }
.arena-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 44px; padding: 0; text-align: left; border-radius: 14px; border: 1px solid rgba(120, 190, 255, .16); background: #0c1422; overflow: hidden; transition: transform .15s, border-color .15s, box-shadow .15s; }
.arena-card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--team, var(--gold)); } /* home team colour bar */
.arena-card:hover { transform: translateY(-2px); border-color: rgba(120, 190, 255, .4); }
.arena-card.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 8px 26px rgba(255, 179, 71, .22); }
.ac-img, .ac-mosaic { display: block; flex: none; aspect-ratio: 16 / 9; width: 100%; background: #070b13; overflow: hidden; }
.ac-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; } .ac-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.8) brightness(.75); min-height: 0; }
.ac-die { position: absolute; left: 50%; top: 28%; transform: translate(-50%, -50%); width: 52px; height: 52px; padding: 9px; border-radius: 14px; background: rgba(8, 13, 23, .85); color: var(--gold); border: 1px solid rgba(255, 179, 71, .5); }
.ac-badges { position: absolute; left: 8px; top: 8px; right: 56px; display: flex; flex-wrap: wrap; gap: 5px; }
.ac-size, .ad-badge { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: rgba(6, 10, 18, .82); color: #cfe3f5; border: 1px solid rgba(160, 210, 255, .25); }
.ac-size.large { color: var(--gold); border-color: rgba(255, 179, 71, .45); }
.ac-indoor { width: 24px; height: 22px; padding: 3px; border-radius: 999px; background: rgba(6, 10, 18, .82); color: #ffc58a; border: 1px solid rgba(255, 197, 138, .4); display: grid; place-items: center; }
.ac-crest { position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .7)); } .ac-crest svg { width: 100%; height: 100%; }
.ac-text { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 12px; min-width: 0; }
.ac-name { font-size: 15px; font-weight: 700; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
.ac-team { font-size: 12px; line-height: 1.25; color: var(--dim); overflow-wrap: anywhere; }
.arena-detail { min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow: hidden; border-radius: 14px; background: rgba(12, 20, 34, .9); border: 1px solid var(--line); padding: 10px; }
.ad-img { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #070b13; flex: none; box-shadow: inset 0 -4px 0 var(--team, var(--gold)); }
.ad-img img { width: 100%; height: 100%; object-fit: cover; display: block; } .ad-img .ac-mosaic { height: 100%; }
.ad-badge { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 5px; } .ad-badge svg { width: 14px; height: 14px; }
.ad-text { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.ad-text h3 { margin: 0; font-size: 22px; line-height: 1.15; overflow-wrap: anywhere; }
.ad-home { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); } .ad-home b { color: var(--team, var(--ink)); }
.ad-crest { width: 36px; height: 36px; flex: none; } .ad-crest svg { width: 100%; height: 100%; }
.ad-q { margin: 0; font-size: 15px; line-height: 1.35; color: var(--ink); font-style: italic; }
.ad-facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 13px; color: #cfe3f5; }
.ad-facts li { display: flex; align-items: center; gap: 6px; min-width: 0; } .ad-facts svg { width: 18px; height: 18px; flex: none; color: #5fd0ff; } .ad-facts span { overflow-wrap: anywhere; }
.ad-in { margin: 0; font-size: 12px; color: var(--dim); line-height: 1.3; }
.arena-use { flex: none; min-height: 48px; border-radius: 12px; border: 1px solid #4fd18b; background: linear-gradient(180deg, #1d5a3b, #14402a); color: #eafff3; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
/* tablets in portrait: the detail panel above the cards */
@media (orientation: portrait) and (min-width: 600px) {
  .arena-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .arena-grid { grid-row: 2; } .arena-detail { grid-row: 1; display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto auto; align-items: start; }
  .ad-img { grid-column: 1; grid-row: 1; } .arena-use { grid-column: 1; grid-row: 2; } .ad-text { grid-column: 2; grid-row: 1 / span 2; }
}
/* phones in landscape (short screens): a two-column card grid that scrolls, the detail panel beside it */
@media (max-height: 500px) {
  .arena-sheet { inset: 6px max(6px, env(safe-area-inset-right)) 6px max(6px, env(safe-area-inset-left)); padding: 6px 8px 8px; gap: 6px; border-radius: 14px; }
  .arena-head b { font-size: 16px; } .arena-head .arena-sub { font-size: 12px; }
  .arena-body { grid-template-columns: minmax(0, 1fr) minmax(240px, 38%); gap: 8px; }
  .arena-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ac-text { padding: 5px 8px 9px; } .ac-name { font-size: 13px; } .ac-team { font-size: 11px; }
  .ac-crest { width: 34px; height: 34px; } .ac-badges { left: 5px; top: 5px; right: 42px; } .ac-size { font-size: 10px; padding: 2px 6px; }
  .ac-die { width: 44px; height: 44px; padding: 8px; }
  .arena-detail { padding: 6px; gap: 6px; } .ad-img { aspect-ratio: 2 / 1; } .ad-text { gap: 4px; } .ad-text h3 { font-size: 16px; }
  .ad-home { font-size: 12px; gap: 6px; } .ad-crest { width: 26px; height: 26px; } .ad-q { font-size: 12.5px; line-height: 1.3; }
  .ad-facts { font-size: 11.5px; gap: 3px 6px; } .ad-facts svg { width: 14px; height: 14px; } .ad-in { display: none; }
  .arena-use { min-height: 44px; }
}
@media (max-height: 400px) { .ad-home { display: none; } .ad-facts li:nth-child(n + 3) { display: none; } }
/* bl-rules-5 help page 'Your squad': the six role icons */
.squad-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; box-sizing: border-box; height: 100%; align-content: center; }
.squad-art span { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #5fd0ff; }
.squad-art i { width: 34px; height: 34px; display: block; }
.squad-art i svg { width: 100%; height: 100%; }
.squad-art b { color: #e8edf5; font-size: 12px; font-weight: 600; }
@media (max-height: 520px) { .squad-art { gap: 2px; padding: 4px; } .squad-art i { width: 24px; height: 24px; } .squad-art b { font-size: 11px; } }

/* bl-rules-6 modes: the menu's mode button (cycles Any, Relay, Last Squad Standing, Emerald Rush, Capture the Flag, Control),
   the HUD mode tag beside the round marks, and the hit-chance figures in previews */
.mode-link .mode-ico { width: 22px; height: 22px; color: var(--gold); display: inline-flex; }
.mode-link .mode-ico svg { width: 22px; height: 22px; }
.mode-link span:last-child { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-tag { width: 18px; height: 18px; color: var(--gold); display: inline-flex; flex: none; }
.mode-tag svg { width: 18px; height: 18px; }
.chip.dmg b.pct { color: var(--gold); margin-left: 4px; }
.portrait .gems { position: absolute; top: 2px; left: 3px; font-size: 10px; font-weight: 800; color: #3dffa0; line-height: 1; }
.help-page .mode-note { color: var(--gold); }
/* bl-rules-6: the mode icon joins the top bar; on short screens keep the turn pill within its box (three activations a round = six order marks) */
@media (max-height: 500px) {
  .score { gap: 6px; } .mode-tag, .mode-tag svg { width: 14px; height: 14px; }
  .turn { gap: 6px; padding: 0 8px; } .turn .order { gap: 2px; flex: 0 1 auto; min-width: 0; } .turn .order i { width: 8px; height: 8px; flex: 0 1 8px; min-width: 3px; } .turn .order i.now { width: 11px; height: 11px; flex-basis: 11px; }
}

/* G09 Armoury: the code-built item library as a codex. A full sheet over the menu (like the arena chooser): a scrolling card
   list with game-rendered thumbnails beside a detail panel (3D turntable + a figure wearing the item, then the loadout line). */
.armoury-link .arm-ico { width: 22px; height: 22px; color: var(--gold); display: inline-flex; } .armoury-link .arm-ico svg { width: 22px; height: 22px; }
.armoury-sheet { position: fixed; inset: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); margin: 0 auto; max-width: 1280px; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, rgba(14, 22, 38, .98), rgba(6, 10, 18, .98)); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px 14px; z-index: 7; box-shadow: 0 20px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(160, 210, 255, .08); }
.arm-head { gap: 12px; } .arm-head b { font-size: 20px; letter-spacing: .04em; text-transform: uppercase; } .arm-head .arm-sub { flex: 1; min-width: 0; color: var(--dim); font-weight: 400; font-size: 13px; }
.arm-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 46%); gap: 14px; }
.arm-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: max-content; gap: 10px; align-content: start; padding: 2px 6px 6px 2px; scrollbar-width: thin; scrollbar-color: #2a3a55 transparent; }
.arm-group { grid-column: 1 / -1; margin: 6px 2px 0; display: flex; align-items: baseline; gap: 10px; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.arm-group small { letter-spacing: 0; color: var(--dim); font-weight: 400; font-size: 12px; }
.arm-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 44px; padding: 0 0 8px; text-align: left; border-radius: 12px; border: 1px solid rgba(120, 190, 255, .16); background: #0c1422; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.arm-card:hover { border-color: rgba(120, 190, 255, .4); }
.arm-card.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 8px 26px rgba(255, 179, 71, .2); }
.arm-thumb { display: block; aspect-ratio: 16 / 10; width: 100%; background: #0c1422; overflow: hidden; }
.arm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.arm-thumb img:not([src]) { visibility: hidden; }
.arm-cname { padding: 4px 9px 0; font-size: 14px; font-weight: 700; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
.arm-cslot { padding: 1px 9px 0; font-size: 11.5px; line-height: 1.25; color: var(--dim); overflow-wrap: anywhere; }
.arm-detail { min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow: hidden; border-radius: 14px; background: rgba(12, 20, 34, .9); border: 1px solid var(--line); padding: 10px; }
.arm-stage { position: relative; flex: 1 1 auto; min-height: 120px; border-radius: 10px; overflow: hidden; background: #070c16; touch-action: none; cursor: grab; }
.arm-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.arm-info { flex: none; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: hidden; }
.arm-info h3 { margin: 0; padding-top: 2px; font-size: 22px; line-height: 1.3; overflow-wrap: anywhere; }
.arm-info p { margin: 0; }
.arm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.arm-chip { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: rgba(6, 10, 18, .82); color: #cfe3f5; border: 1px solid rgba(160, 210, 255, .25); }
.arm-chip.soon { color: var(--gold); border-color: rgba(255, 179, 71, .5); } .arm-chip.look { color: #9fe8c4; border-color: rgba(120, 230, 180, .45); }
.arm-stats { font-size: 13px; font-weight: 700; color: #7fe9ff; letter-spacing: .03em; }
.arm-line { font-size: 15px; line-height: 1.35; color: var(--ink); }
.arm-down { font-size: 13px; line-height: 1.3; color: #ffb4a8; } .arm-down b { font-weight: 700; }
.arm-mount, .arm-cost { font-size: 12px; line-height: 1.3; color: var(--dim); }
.arm-play { display: flex; align-items: center; gap: 6px; font-size: 12.5px; line-height: 1.3; color: #cfe3f5; }
.arm-role { width: 18px; height: 18px; flex: none; color: var(--t0); display: inline-flex; } .arm-role svg { width: 18px; height: 18px; }
/* tablets in portrait: the detail panel above the cards */
@media (orientation: portrait) and (min-width: 600px) {
  .arm-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 46%) minmax(0, 1fr); }
  .arm-detail { grid-row: 1; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: stretch; } .arm-list { grid-row: 2; }
  .arm-stage { min-height: 0; } .arm-info { justify-content: center; }
}
/* phones in landscape (short screens): a two-column card list, the detail panel beside it with a smaller stage */
@media (max-height: 500px) {
  .armoury-sheet { inset: 6px max(6px, env(safe-area-inset-right)) 6px max(6px, env(safe-area-inset-left)); padding: 6px 8px 8px; gap: 6px; border-radius: 14px; }
  .arm-head b { font-size: 16px; } .arm-head .arm-sub { font-size: 12px; }
  .arm-body { grid-template-columns: minmax(0, 1fr) minmax(250px, 50%); gap: 8px; }
  .arm-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .arm-group { font-size: 12px; margin-top: 4px; padding-bottom: 3px; }
  .arm-card { padding-bottom: 5px; border-radius: 10px; } .arm-cname { font-size: 12.5px; padding: 3px 7px 0; } .arm-cslot { font-size: 10.5px; padding: 0 7px; }
  .arm-detail { padding: 6px; gap: 5px; } .arm-stage { min-height: 90px; }
  .arm-info { gap: 3px; } .arm-info h3 { font-size: 15px; line-height: 1.25; } .arm-chip { font-size: 9.5px; padding: 2px 6px; } .arm-tags { gap: 4px; }
  .arm-stats { font-size: 11.5px; } .arm-line { font-size: 12px; line-height: 1.28; } .arm-down { font-size: 11px; line-height: 1.25; }
  .arm-mount, .arm-cost, .arm-play { display: none; }
}
@media (max-height: 400px) { .arm-head .arm-sub { display: none; } .arm-stage { min-height: 80px; } }
/* bl-rules-8 Loadout screen (ld- prefix): graphics first. Six operative cards (role, weapon picture, five item chips drawn by the
   game, a 10-pip points meter), tabs for Standard issue and three saved loadouts, and a tray of item pictures for one slot. */
.ld-link .ld-ico { width: 22px; height: 22px; color: var(--gold); display: inline-flex; } .ld-link .ld-ico svg { width: 22px; height: 22px; }
.ld-sheet { position: fixed; inset: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); margin: 0 auto; max-width: 1180px; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, #0e1626, #060a12); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px 14px; z-index: 7; box-shadow: 0 20px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(160, 210, 255, .08); }
.ld-head { gap: 12px; } .ld-head b { font-size: 20px; letter-spacing: .04em; text-transform: uppercase; }
.ld-tabs { flex: 1; min-width: 0; display: flex; gap: 6px; justify-content: center; }
.ld-tab { min-width: 52px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: #0c1422; color: var(--dim); font-weight: 800; font-size: 16px; }
.ld-tab.on { color: #10141a; background: var(--gold); border-color: var(--gold); box-shadow: 0 6px 20px rgba(255, 179, 71, .25); }
.ld-tico { width: 20px; height: 20px; display: inline-flex; }
.ld-body { position: relative; flex: 1; min-height: 0; display: flex; }
.ld-squad { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); grid-auto-rows: max-content; gap: 10px; align-content: start; padding: 2px 4px 4px 2px; scrollbar-width: thin; scrollbar-color: #2a3a55 transparent; }
.ld-card { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px; border: 1px solid rgba(120, 190, 255, .16); background: radial-gradient(ellipse at 30% 0%, #13213a 0%, #0a111d 70%); min-width: 0; }
.ld-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ld-top b { flex: 1; min-width: 0; font-size: 15px; letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-rico { width: 22px; height: 22px; flex: none; color: var(--t0); display: inline-flex; }
.ld-pips { display: inline-flex; gap: 2px; flex: none; } .ld-pips i { width: 7px; height: 12px; border-radius: 2px; background: rgba(120, 190, 255, .16); } .ld-pips i.on { background: var(--gold); box-shadow: 0 0 6px rgba(255, 179, 71, .5); }
.ld-wpn { position: relative; display: block; width: 100%; min-height: 44px; padding: 0; border-radius: 10px; border: 1px solid rgba(120, 190, 255, .2); background: #0c1422; overflow: hidden; aspect-ratio: 16 / 6.5; }
.ld-wpn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ld-wpn small { position: absolute; left: 6px; bottom: 4px; max-width: calc(100% - 12px); font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(6, 10, 18, .82); color: #e8f1fb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-slots { display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)); gap: 5px; }
.ld-chip { min-width: 44px; min-height: 44px; aspect-ratio: 1; padding: 0; border-radius: 10px; border: 1px dashed rgba(120, 190, 255, .28); background: #0a111d; color: #5f7590; display: grid; place-items: center; overflow: hidden; }
.ld-chip.has { border-style: solid; border-color: rgba(255, 179, 71, .55); }
.ld-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ld-sico { width: 20px; height: 20px; display: inline-flex; }
.ld-wpn:disabled, .ld-chip:disabled { cursor: default; opacity: .92; }
.ld-sheet img:not([src]) { visibility: hidden; }
.ld-tray { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px; background: rgba(6, 10, 18, .97); border: 1px solid rgba(255, 179, 71, .4); }
.ld-thead { display: flex; align-items: center; gap: 8px; } .ld-thead b { flex: 1; min-width: 0; font-size: 16px; text-transform: uppercase; letter-spacing: .05em; }
.ld-line { margin: 0; min-height: 18px; font-size: 13px; color: var(--dim); overflow-wrap: anywhere; }
.ld-items { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); grid-auto-rows: max-content; gap: 8px; align-content: start; padding: 2px; }
.ld-item { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 44px; padding: 0 0 5px; border-radius: 10px; border: 1px solid rgba(120, 190, 255, .18); background: #0c1422; overflow: hidden; text-align: left; }
.ld-item img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.ld-item > .ld-sico { display: grid; place-items: center; width: 100%; height: auto; aspect-ratio: 16 / 10; color: #5f7590; } .ld-item > .ld-sico svg { width: 26px; height: 26px; }
.ld-item small { padding: 3px 7px 0; font-size: 12.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-item em { position: absolute; top: 4px; right: 4px; min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 999px; background: var(--gold); color: #10141a; font: 800 12px/1 system-ui, sans-serif; }
.ld-item.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.ld-item:disabled { opacity: .35; cursor: not-allowed; }
@media (max-height: 500px) {
  .ld-sheet { inset: 6px max(6px, env(safe-area-inset-right)) 6px max(6px, env(safe-area-inset-left)); padding: 6px 8px 8px; gap: 6px; border-radius: 14px; }
  .ld-head b { font-size: 16px; } .ld-tab { min-width: 48px; padding: 0 8px; font-size: 14px; }
  .ld-squad { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; } .ld-card { padding: 6px; gap: 4px; } .ld-wpn { aspect-ratio: 16 / 5; }
  .ld-items { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; } .ld-line { font-size: 12px; }
}
/* bl-rules-8 in play: the hazard strip beside the mode (amber = acts next round, dim = idle) and the Guard mark on a roster card */
.hz-strip { display: inline-flex; gap: 3px; flex: none; } .hz-strip i { width: 16px; height: 16px; display: inline-flex; color: #cfe3f5; opacity: .9; }
.hz-strip i.warn { color: var(--gold); opacity: 1; filter: drop-shadow(0 0 4px rgba(255, 179, 71, .7)); } .hz-strip i.idle { opacity: .4; }
.portrait .gd-mark { position: absolute; top: 3px; right: 3px; width: 13px; height: 13px; color: var(--gold); }
.hz-art span { gap: 2px; } .hz-art b { text-transform: none; }
.arm-chip.live { color: #7fe9ff; border-color: rgba(127, 233, 255, .5); } .arm-equip .sound-link { min-height: 44px; } .arm-equip svg { width: 20px; height: 20px; }
@media (max-height: 500px) { .hz-strip i { width: 13px; height: 13px; } .arm-equip .sound-link { padding: 0 10px; } }
/* ---------- G14 (owner items 12 and 13): training, tips, keyboard/controller, accessibility. Classes tu-* and ax-* ---------- */
/* menu: the Training tile, glowing with a "Start here" pill until training is done or dismissed */
.tile-learn .tu-ribbon { display: none; }
.tile-learn.tu-new { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(255,179,71,.35) inset, 0 0 22px rgba(255,179,71,.28); animation: tu-glow 2.4s ease-in-out infinite; }
.tile-learn.tu-new small { display: none; }
.tile-learn.tu-new .tu-ribbon { display: block; padding: 2px 10px; border-radius: 999px; background: var(--gold); color: #1a1405; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
@keyframes tu-glow { 50% { box-shadow: 0 0 0 1px rgba(255,179,71,.5) inset, 0 0 32px rgba(255,179,71,.45); } }
@media (min-height: 501px) and (max-height: 720px) { .opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; } } /* G14: mid-height tablets (1024x640) keep the menu on screen with the Access link */
.opt-head .opt-ax { margin-left: auto; margin-right: 6px; color: var(--gold); }

/* training card (intro and finish) */
.tu-card { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: calc(10px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left)); background: radial-gradient(ellipse at 50% 35%, rgba(22,35,58,.97), rgba(4,7,12,.98)); }
.tu-panel { position: relative; width: min(780px, 100%); display: grid; justify-items: center; gap: 10px; text-align: center; padding: 14px 8px 8px; }
.tu-panel .tu-close { position: absolute; top: 0; right: 0; }
.tu-title { margin: 0; font-size: clamp(26px, 5vw, 42px); font-weight: 900; letter-spacing: .06em; background: linear-gradient(90deg, var(--t0), #fff 50%, var(--t1)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tu-sub { margin: 0; color: var(--dim); }
.tu-lessons { list-style: none; margin: 4px 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.tu-lesson { position: relative; min-width: 0; display: grid; justify-items: center; gap: 6px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(160deg, #142033, #0b1320); animation: tu-rise .4s ease-out both; animation-delay: calc(var(--i) * 70ms); }
.tu-lart { width: 100%; max-width: 120px; aspect-ratio: 4 / 3; }
.tu-lname { display: flex; align-items: center; gap: 5px; font-weight: 700; }
.tu-lname i { width: 18px; height: 18px; color: var(--gold); flex: none; }
.tu-lesson.ok { border-color: #4fd18b; }
.tu-tick { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; color: #6ff0a5; }
.tu-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tu-row button { min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid var(--line); background: #101a2a; font-weight: 700; }
.tu-row button.primary { background: linear-gradient(160deg, #fff2c8, var(--gold) 45%, #d47a10); color: #0b0f17; border: 0; font-weight: 800; min-width: 150px; }
@keyframes tu-rise { from { opacity: 0; transform: translateY(10px) scale(.96); } }

/* the coach: one short instruction, an icon and the five lessons */
.tu-coach { position: absolute; z-index: 4; left: 50%; top: calc(104px + env(safe-area-inset-top)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 24px); padding: 0 0 0 12px; background: linear-gradient(90deg, rgba(48,34,10,.96), rgba(10,16,26,.96)); border: 1px solid var(--gold); border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 0 22px rgba(255,179,71,.25); }
.tu-coach .tu-ico { width: 28px; height: 28px; color: var(--gold); flex: none; }
.tu-coach .tu-text { min-width: 0; font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tu-coach[data-kind="wait"] .tu-text { color: var(--dim); font-weight: 600; }
.tu-steps { display: flex; gap: 4px; flex: none; }
.tu-steps i { width: 8px; height: 8px; border-radius: 50%; background: #3a4658; }
.tu-steps i.done { background: var(--gold); } .tu-steps i.now { background: #fff; box-shadow: 0 0 0 2px var(--gold); }
.tu-coach .tu-exit { flex: none; width: 44px; height: 44px; min-width: 44px; border: 0; background: transparent; border-radius: 999px; }
.tu-pop { animation: tu-pop .32s ease-out; }
.tu-nudge { animation: tu-nudge .4s ease-in-out; }
@keyframes tu-pop { from { opacity: .35; box-shadow: 0 0 0 6px rgba(255,179,71,.5); } } /* no scale: the exit button keeps its 44 px */
@keyframes tu-nudge { 25% { transform: translateX(calc(-50% - 8px)); } 75% { transform: translateX(calc(-50% + 8px)); } }
.tu-on #toast, .tu-on .recap { display: none !important; }

/* rings on the exact target: a frame round a button, an ellipse and a bobbing pointer on a board tile or unit */
.tu-ring { position: absolute; z-index: 5; pointer-events: none; }
.tu-ring.tu-el { border: 3px solid var(--gold); border-radius: 18px; box-shadow: 0 0 0 4px rgba(255,179,71,.22), 0 0 24px rgba(255,179,71,.6); animation: tu-pulse 1.2s ease-in-out infinite; }
.tu-ring.tu-cell { width: 0; height: 0; --s: 54px; }
.tu-ring.tu-cell::before { content: ''; position: absolute; left: calc(var(--s) / -2); top: calc(var(--s) * -.3); width: var(--s); height: calc(var(--s) * .6); border: 3px solid var(--gold); border-radius: 50%; box-shadow: 0 0 18px rgba(255,179,71,.85), inset 0 0 12px rgba(255,179,71,.5); animation: tu-pulse 1.2s ease-in-out infinite; }
.tu-ring.tu-cell::after { content: ''; position: absolute; left: -10px; top: calc(var(--s) * -.3 - 46px); border: 10px solid transparent; border-top: 16px solid var(--gold); filter: drop-shadow(0 2px 4px #000); animation: tu-bob 1s ease-in-out infinite; }
.tu-ring.tu-loud.tu-el, .tu-ring.tu-loud::before { box-shadow: 0 0 0 6px rgba(255,179,71,.4), 0 0 36px rgba(255,200,90,.95); }
@keyframes tu-pulse { 50% { opacity: .55; } }
@keyframes tu-bob { 50% { transform: translateY(-8px); } }
.tu-burst { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; align-content: center; gap: 6px; pointer-events: none; }
.tu-burst span { width: 72px; height: 72px; color: var(--gold); }
.tu-burst b { font-size: clamp(48px, 12vw, 110px); font-weight: 900; letter-spacing: .08em; background: linear-gradient(90deg, var(--t0), #fff, var(--t1)); -webkit-background-clip: text; background-clip: text; color: transparent; animation: tu-goal 1.1s ease-out both; }
@keyframes tu-goal { 0% { transform: scale(.6); opacity: 0; } 40% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

/* contextual tips: one card, top left, dismissed with one tap */
.tu-hint { position: absolute; z-index: 4; left: calc(8px + env(safe-area-inset-left)); top: calc(110px + env(safe-area-inset-top)); width: min(300px, calc(100vw - 16px)); display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; padding: 10px; background: rgba(8,13,23,.96); border: 1px solid var(--gold); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.5); animation: tu-rise .3s ease-out both; }
.tu-hint-ico { width: 34px; height: 34px; color: var(--gold); }
.tu-hint-t { display: grid; gap: 2px; min-width: 0; font-size: 13px; color: var(--dim); }
.tu-hint-t b { color: var(--ink); font-size: 15px; }
.tu-hint-row { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.tu-hint-row button { min-height: 44px; min-width: 64px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: #101a2a; font-weight: 700; }
.tu-hint-row .tu-ok { background: #17402c; border-color: #4fd18b; }
.tu-hinting .recap { visibility: hidden; }

/* accessibility sheet */
.ax-sheet { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-rows: auto minmax(0, 1fr); background: radial-gradient(ellipse at 50% 20%, rgba(20,32,52,.98), rgba(4,7,12,.98)); padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.ax-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 18px; }
.ax-head b { flex: 1; min-width: 0; }
.ax-head-ico { width: 28px; height: 28px; color: var(--gold); flex: none; }
.ax-grid { overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-content: start; padding: 2px 14px 14px; }
.ax-card { min-width: 0; display: grid; gap: 8px; align-content: start; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(160deg, #142033, #0b1320); }
.ax-wide { grid-column: 1 / -1; }
.ax-ct { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.ax-ct b { white-space: nowrap; }
.ax-ico { width: 22px; height: 22px; color: var(--gold); flex: none; }
.ax-art { height: 40px; }
.ax-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.ax-opt { flex: 1 1 0; min-width: 44px; min-height: 44px; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 4px 6px; border-radius: 10px; border: 1px solid var(--line); background: #0c1422; }
.ax-opt small { font-size: 12px; color: var(--dim); white-space: nowrap; }
.ax-opt.on { border-color: var(--gold); background: #33291a; } .ax-opt.on small { color: var(--ink); font-weight: 700; }
.ax-opt[data-ax-tips].on { border-color: #4fd18b; }
.ax-sw { width: 52px; height: 24px; }
.ax-card[data-card="palette"] .ax-opt { min-width: 0; padding: 4px 3px; } .ax-card[data-card="palette"] .ax-opt small { white-space: normal; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.ax-card[data-card="palette"] .ax-sw { width: 100%; max-width: 52px; }
.ax-t1 small { font-size: 13px; } .ax-t2 small { font-size: 16px; } .ax-t3 small { font-size: 19px; line-height: 1.1; }
.ax-keys { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.ax-kc { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--dim); }
.ax-kc kbd { min-width: 24px; padding: 2px 6px; border-radius: 6px; border: 1px solid #4a5a70; border-bottom-width: 3px; background: #101a2a; color: var(--ink); font: 700 12px/1.2 system-ui, sans-serif; text-align: center; white-space: nowrap; }
@media (max-height: 500px) { .ax-head { padding: 4px 10px; font-size: 16px; } .ax-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; padding: 2px 10px 10px; } .ax-card { padding: 8px; gap: 6px; } .ax-art { height: 30px; } }

/* confirm dialog */
.ax-confirm { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 12px; background: rgba(3,5,9,.72); }
.ax-confirm-card { width: min(380px, 100%); display: grid; justify-items: center; gap: 12px; padding: 18px; text-align: center; border-radius: 16px; border: 1px solid var(--line); background: #0d1522; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.ax-confirm-ico { width: 40px; height: 40px; color: var(--gold); }
.ax-confirm-title { font-size: 17px; }
.ax-confirm-row { display: flex; gap: 10px; width: 100%; }
.ax-confirm-row button { flex: 1; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: #101a2a; font-weight: 700; }
.ax-yes.danger { background: #3a1f1c; border-color: var(--bad); } .ax-yes:not(.danger) { background: #17402c; border-color: #4fd18b; }

/* hold to confirm: a bar fills along the button while it is held */
.ax-hold .act.confirm, .ax-hold #handoff-go { position: relative; overflow: hidden; }
.ax-hold .act.confirm::after, .ax-hold #handoff-go::after { content: ''; position: absolute; left: 0; bottom: 0; height: 5px; width: 0; background: #6ff0a5; }
.ax-hold .ax-holding::after { width: 100%; transition: width .45s linear; }

/* keyboard and controller: focus frame, board cursor, key hints (desktop) */
.ax-focus, button:focus-visible, input:focus-visible { outline: 3px solid var(--gold) !important; outline-offset: 2px; }
.ax-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.ax-cursor { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.ax-cursor i { position: absolute; width: 12px; height: 9px; border: 3px solid var(--gold); filter: drop-shadow(0 0 4px rgba(255,179,71,.9)); }
.ax-cursor i:nth-child(1) { left: -22px; top: -15px; border-right: 0; border-bottom: 0; } .ax-cursor i:nth-child(2) { left: 10px; top: -15px; border-left: 0; border-bottom: 0; }
.ax-cursor i:nth-child(3) { left: -22px; top: 6px; border-right: 0; border-top: 0; } .ax-cursor i:nth-child(4) { left: 10px; top: 6px; border-left: 0; border-top: 0; }
.ax-key { display: none; }
.ax-keyhints .ax-key { display: block; position: absolute; top: 2px; right: 2px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 4px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); color: var(--ink); font: 700 9px/12px system-ui, sans-serif; text-align: center; pointer-events: none; }
.ax-keyhints #game .act, .ax-keyhints .hud-top .icon-btn, .ax-keyhints #game .pill, .ax-keyhints #game .slot { position: relative; }

/* side shapes: badges over every unit, and marks beside side-coloured names */
.ax-shape { position: absolute; width: 18px; height: 18px; transform: translate(-50%, -100%); pointer-events: none; filter: drop-shadow(0 1px 2px #000); }
.ax-shapes .recap b.t0::before, .ax-shapes .result-score .t0::before { content: '\25CF\00a0'; }
.ax-shapes .recap b.t1::before, .ax-shapes .result-score .t1::before { content: '\2B22\00a0'; }

/* high-contrast HUD */
.ax-contrast { --panel: rgba(0,0,0,.96); --line: rgba(255,255,255,.72); --dim: #d8e4f2; }
.ax-contrast .preview { text-shadow: none; background: rgba(0,0,0,.88); border-radius: 10px; padding: 4px 10px; }
.ax-contrast .chip, .ax-contrast .recap li, .ax-contrast .vo { background: #000; }
.ax-contrast .mood { display: none; }

/* reduced motion, hit shake and subtitles */
.ax-reduce *, .ax-reduce *::before, .ax-reduce *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
.ax-reduce .float { animation: none !important; }
.ax-reduce .ax-hold .ax-holding::after, .ax-hold.ax-reduce .ax-holding::after { transition-duration: .45s !important; }
.ax-nosubs #vo { display: none !important; }

/* larger text (the text-heavy pieces only; the default size changes nothing) */
.ax-big .preview { font-size: calc(15px * var(--ax-text)); } .ax-big .preview .why { font-size: calc(13px * var(--ax-text)); }
.ax-big .toast, .ax-big .vo, .ax-big .help-page p { font-size: calc(15px * var(--ax-text)); }
.ax-big .recap { font-size: calc(12px * var(--ax-text)); } .ax-big .chip { font-size: calc(13px * var(--ax-text)); }
.ax-big .tu-coach .tu-text { font-size: calc(17px * var(--ax-text)); } .ax-big .tu-hint-t { font-size: calc(13px * var(--ax-text)); } .ax-big .tu-hint-t b { font-size: calc(15px * var(--ax-text)); }

/* short screens (phones in landscape) */
@media (max-height: 500px) {
  .tu-coach { top: calc(56px + env(safe-area-inset-top)); gap: 8px; padding-left: 10px; } .tu-coach .tu-text { font-size: 15px; } .tu-coach .tu-ico { width: 24px; height: 24px; }
  .tu-hint { top: calc(56px + env(safe-area-inset-top)); width: min(280px, calc(100vw - 16px)); padding: 8px; }
  .tu-panel { gap: 6px; padding-top: 6px; } .tu-title { font-size: 26px; } .tu-lessons { gap: 6px; } .tu-lesson { padding: 6px 4px; gap: 3px; } .tu-lart { max-width: 72px; }
  .tu-lname { font-size: 13px; } .tu-row button { min-height: 44px; }
}

/* bl-rules-9 four-way Control: sides 2 and 3 (north, east) with their own colour and shape (diamond, triangle), the four-score bar */
:root { --t2: #ffb347; --t3: #9b6bff; }
.team.t2 { color: var(--t2); } .team.t3 { color: var(--t3); }
.shape.diamond { transform: rotate(45deg) scale(.8); border-radius: 2px; } .shape.tri { clip-path: polygon(50% 6%, 96% 92%, 4% 92%); }
.turn .order i.s2 { transform: rotate(45deg) scale(.8); border-radius: 1px; } .turn .order i.s3 { clip-path: polygon(50% 6%, 96% 92%, 4% 92%); }
.turn .order i.s2.now { transform: rotate(45deg) scale(.85); }
.portrait.t2 .ico { color: var(--t2); } .portrait.t3 .ico { color: var(--t3); }
.recap li b.t2 { color: var(--t2); } .recap li b.t3 { color: var(--t3); }
.result-score .t2 { color: var(--t2); } .result-score .t3 { color: var(--t3); }
.ax-shapes .recap b.t2::before, .ax-shapes .result-score .t2::before { content: '\25C6\00a0'; }
.ax-shapes .recap b.t3::before, .ax-shapes .result-score .t3::before { content: '\25B2\00a0'; }
.score.four { gap: 8px; padding: 6px 10px; }
.score.four .team { font-size: 20px; gap: 5px; }
.score.four .team.t0 { order: 0; } .score.four .team.t1 { order: 1; } .score.four .mode-tag, .score.four .hz-strip, .score.four .rounds { order: 2; } .score.four .team.t2 { order: 3; } .score.four .team.t3 { order: 4; }
.score.four .team.lead b { text-decoration: underline 3px; text-underline-offset: 4px; }
.result-score.four { font-size: 34px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.result-score.four span.win { text-decoration: underline 4px; text-underline-offset: 6px; }
.ac-plan, .ad-plan { display: block; width: 100%; height: 100%; background: #060a12; }
.ac-plan svg, .ad-plan svg { width: 100%; height: 100%; display: block; }

/* intro film v2: autoplay, any button skips */
.intro-film { position: fixed; inset: 0; z-index: 9000; background: #05070c; cursor: pointer; }
.intro-film video { width: 100%; height: 100%; object-fit: contain; background: #05070c; pointer-events: none; }
.intro-film .intro-sound { position: absolute; left: max(1rem, env(safe-area-inset-left)); bottom: max(1rem, env(safe-area-inset-bottom)); display: flex; gap: .4rem; align-items: center; min-height: 44px; padding: .5rem 1rem; border-radius: 999px; border: 1px solid #39e6ff88; background: #0b1220cc; color: #e8f6ff; font: inherit; cursor: pointer; }
.intro-film .intro-sound svg { width: 1.2rem; height: 1.2rem; }
.intro-film .intro-hint { position: absolute; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); color: #e8f6ff99; font-size: .85rem; letter-spacing: .04em; animation: intro-hint 4s ease forwards; }
@keyframes intro-hint { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
.intro-film button:focus-visible { outline: 3px solid #39e6ff; outline-offset: 3px; }
