/* Mech Academy — dark industrial game UI. Layout: full-bleed 3D stage with HUD plates in the corners; learning screens open as large cards over the dimmed hangar. */
:root {
  --void: #07090D;
  --panel: rgba(10, 14, 20, 0.78);
  --panel-solid: #0E141C;
  --line: #2A3442;
  --line-strong: #3B4859;
  --text: #E8EDF2;
  --muted: #9AA8B8;
  --amber: #F2B233;
  --amber-hot: #FFC24A;
  --cyan: #5FE6F2;
  --danger: #FF7A45;
  --good: #6EE7A0;
  --display: 'Oxanium', 'Rajdhani', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --read: 'Andika', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --cut: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--void); color: var(--text); font-family: var(--body); font-size: 16px; overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
[hidden] { display: none !important; }

#stage { position: fixed; inset: 0; visibility: hidden; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#app { position: fixed; inset: 0; pointer-events: none; }
#app > * { pointer-events: auto; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 18px) max(16px, env(safe-area-inset-left, 0px)); }
.screen.pass { pointer-events: none; }
.screen.pass .plate, .screen.pass button, .screen.pass .interactive { pointer-events: auto; }
#app > .battle-hud { pointer-events: none; }
#app > .hangar-screen { pointer-events: none; }

.plate { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); clip-path: var(--cut); }
.eyebrow { font: 600 11px var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; letter-spacing: .04em; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 10px 20px; border: 1px solid var(--line-strong); background: rgba(20, 28, 38, .9);
  font: 700 15px var(--display); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; clip-path: var(--cut); transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--cyan); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--amber); color: #14100A; border-color: var(--amber); }
.btn.primary:hover { background: var(--amber-hot); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn.danger:hover { background: rgba(255, 122, 69, .12); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.big { min-height: 64px; font-size: 20px; padding: 12px 28px; }
.icon-btn { width: 48px; height: 48px; min-height: 48px; padding: 0; }

/* credits chip */
.credits { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; }
.credits .num { font: 700 24px var(--display); font-variant-numeric: tabular-nums; line-height: 1; }
.credits .lbl { font: 600 10px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.credits.bump .num { animation: bump .5s ease; color: var(--amber-hot); }
@keyframes bump { 30% { transform: scale(1.25); } }

/* ---------- title ---------- */
.title-bg { position: absolute; inset: 0; background: #07090D url('../assets/vanguard-concept.png') center 30% / cover no-repeat; }
.title-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,9,13,.92) 0%, rgba(7,9,13,.72) 38%, rgba(7,9,13,.15) 70%, rgba(7,9,13,.35) 100%), linear-gradient(0deg, rgba(7,9,13,.9) 0%, rgba(7,9,13,0) 40%); }
.title-wrap { position: relative; display: flex; flex-direction: column; gap: 16px; max-width: 560px; margin-block: auto; }
.logo { font: 800 clamp(40px, 7vw, 76px) / .92 var(--display); letter-spacing: .06em; }
.logo span { color: var(--amber); display: block; }
.tagline { font-size: 18px; color: #C9D3DE; max-width: 40ch; line-height: 1.5; margin: 0; }
.pilots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pilot-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; text-align: left; cursor: pointer; min-height: 96px; }
.pilot-card:hover { border-color: var(--amber); }
.badge { width: 38px; height: 38px; flex: none; display: grid; place-items: center; font: 800 16px var(--display); color: #0B0E13; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.pilot-card .badge { width: 40px; height: 40px; font-size: 18px; }
.pilot-card b { font: 700 18px var(--display); letter-spacing: .04em; }
.pilot-card small { color: var(--muted); font-size: 13px; }
.pilot-card.add { align-items: center; justify-content: center; border-style: dashed; color: var(--muted); }
.title-foot { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.storage-note { font-size: 12px; color: var(--muted); }

/* ---------- forms / cards ---------- */
.center-card { margin: auto; width: min(560px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 22px; max-height: 100%; overflow: auto; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .field .label { font: 600 12px var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.field input[type=text], .field input[type=password] { min-height: 52px; padding: 10px 14px; background: #0A0F15; border: 1px solid var(--line-strong); color: var(--text); font: 600 20px var(--body); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-width: 56px; min-height: 48px; padding: 8px 14px; border: 1px solid var(--line-strong); background: #0A0F15; font: 700 18px var(--display); cursor: pointer; clip-path: var(--cut); }
.chip[aria-pressed=true] { background: var(--amber); color: #14100A; border-color: var(--amber); }
.swatch { width: 48px; height: 48px; border: 2px solid transparent; cursor: pointer; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.swatch[aria-pressed=true] { outline: 3px solid var(--text); outline-offset: -6px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.error { color: var(--danger); font-size: 14px; min-height: 1em; margin: 0; }

/* ---------- hangar HUD ---------- */
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; padding: 10px 16px 10px 14px; border-left: 3px solid var(--amber); }
.brand .name { font: 700 18px var(--display); letter-spacing: .06em; }
.brand .sub { font-size: 13px; color: var(--muted); }
.top-right { display: flex; gap: 10px; align-items: center; }
.hud-mid { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 0; padding-block: 12px; }
.hud-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.hangar-model-loading { position: fixed; z-index: 10; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 12px; padding: 14px 20px; border: 1px solid var(--cyan); background: rgba(7, 13, 20, .94); color: var(--text); font: 700 14px var(--display); letter-spacing: .08em; text-transform: uppercase; clip-path: var(--cut); pointer-events: none; }
.hangar-model-loading[hidden] { display: none; }
.hangar-model-spinner { width: 18px; height: 18px; flex: none; border: 2px solid rgba(95, 230, 242, .28); border-top-color: var(--cyan); border-radius: 50%; animation: hangar-spin .8s linear infinite; }
@keyframes hangar-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hangar-model-spinner { animation: none; } }

.mech-card { width: min(340px, 100%); padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.mech-card h2 { font-size: 30px; font-weight: 800; letter-spacing: .08em; }
.mech-card .cls { font-size: 14px; color: var(--muted); margin-top: 2px; }
.stats { display: grid; grid-template-columns: 88px 1fr 22px; gap: 8px 12px; align-items: center; }
.stats .k { font: 600 11px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stats .v { font: 700 14px var(--display); text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: rgba(255,255,255,.08); position: relative; overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--cyan); transition: width .4s; }
.damage-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.damage-row .pct { font-weight: 700; }
.damage-row .pct.bad { color: var(--danger); }
.damage-row .pct.ok { color: var(--good); }

.side-panel { width: min(330px, 100%); padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: 100%; overflow: auto; }
.side-panel .tabs { display: flex; gap: 6px; }
.tab { flex: 1; min-height: 40px; background: transparent; border: 1px solid var(--line); font: 700 12px var(--display); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; color: var(--muted); }
.tab[aria-selected=true] { color: var(--text); border-color: var(--amber); background: rgba(242,178,51,.08); }
.up-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 10px 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.up-row b { font: 700 15px var(--display); letter-spacing: .06em; }
.up-row small { color: var(--muted); font-size: 12px; grid-column: 1; }
.pips { display: flex; gap: 4px; grid-column: 1; }
.pips i { width: 22px; height: 6px; background: var(--line); }
.pips i.on { background: var(--cyan); }
.cost-btn { grid-column: 2; grid-row: 1 / span 3; min-width: 92px; min-height: 44px; font-size: 14px; }
.shop-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); align-items: center; }
.shop-item b { font: 700 17px var(--display); }
.shop-item small { color: var(--muted); }
.shop-item .btn { grid-column: 2; grid-row: 1 / span 2; min-width: 110px; }
.shop-item.active { border-color: var(--amber); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.act { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 20px 10px 16px; text-align: left; cursor: pointer; }
.act:hover { border-color: var(--cyan); }
.act span { display: flex; flex-direction: column; gap: 2px; }
.act b { font: 700 17px var(--display); letter-spacing: .06em; }
.act em { font-style: normal; font-size: 13px; color: var(--cyan); font-weight: 600; }
.act.go { background: var(--amber); color: #14100A; border-color: var(--amber); padding: 10px 30px; }
.act.go b { font-size: 22px; letter-spacing: .16em; }
.act.go:hover { background: var(--amber-hot); }
.act.go:disabled { background: #4a4030; color: #b9ab8a; border-color: #4a4030; cursor: not-allowed; }
.hint { font-size: 12px; color: var(--muted); text-align: right; width: 100%; }

/* ---------- learning cards ---------- */
.dim { position: absolute; inset: 0; background: rgba(5, 7, 10, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.learn { position: relative; margin: auto; width: min(860px, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--panel-solid); border: 1px solid var(--line-strong); clip-path: var(--cut); overflow: hidden; }
.learn-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.learn-head h2 { font-size: 20px; }
.learn-body { padding: 24px; overflow: auto; display: flex; flex-direction: column; gap: 20px; }
.progress-dots { display: flex; gap: 6px; }
.progress-dots i { width: 18px; height: 6px; background: var(--line); }
.progress-dots i.done { background: var(--good); }
.progress-dots i.miss { background: var(--danger); }
.progress-dots i.now { background: var(--amber); }
.earned { font: 700 15px var(--display); color: var(--amber); letter-spacing: .06em; }

/* math */
.skill-tag { align-self: flex-start; font: 600 12px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); border: 1px solid rgba(95,230,242,.4); padding: 4px 10px; }
.problem { font: 800 clamp(40px, 8vw, 72px) / 1.1 var(--display); text-align: center; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.problem.small { font-size: clamp(26px, 4.5vw, 40px); }
.visual { display: flex; justify-content: center; align-items: center; gap: 22px; flex-wrap: wrap; min-height: 60px; }
.dots { display: grid; grid-template-columns: repeat(5, 28px); gap: 10px; }
.dot { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFE7A8, var(--amber) 55%, #9a6a10); box-shadow: 0 0 12px rgba(242,178,51,.55); }
.dot.cyan { background: radial-gradient(circle at 35% 35%, #DDFBFF, var(--cyan) 55%, #1a7f8a); box-shadow: 0 0 12px rgba(95,230,242,.55); }
.dot.gone { background: transparent; box-shadow: none; border: 2px dashed #56606c; }
.vis-op { font: 800 36px var(--display); color: var(--muted); }
.blocks { display: flex; gap: 6px; align-items: flex-end; }
.ten { width: 14px; height: 100px; background: repeating-linear-gradient(0deg, var(--cyan) 0 9px, #0E141C 9px 10px); }
.one { width: 14px; height: 9px; background: var(--amber); }
.frac { display: flex; gap: 3px; }
.frac i { width: 30px; height: 40px; border: 2px solid var(--line-strong); }
.frac i.on { background: var(--cyan); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.choice { min-height: 84px; font: 800 34px var(--display); background: #121A24; border: 2px solid var(--line-strong); cursor: pointer; clip-path: var(--cut); font-variant-numeric: tabular-nums; }
.choice:hover { border-color: var(--cyan); }
.choice.right { background: rgba(110,231,160,.18); border-color: var(--good); }
.choice.wrong { background: rgba(255,122,69,.14); border-color: var(--danger); }
.answer-box { min-height: 76px; display: flex; align-items: center; justify-content: center; font: 800 44px var(--display); border: 2px solid var(--line-strong); background: #0A0F15; font-variant-numeric: tabular-nums; }
.answer-box.right { border-color: var(--good); }
.answer-box.wrong { border-color: var(--danger); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 380px; width: 100%; margin-inline: auto; }
.key { min-height: 64px; font: 800 28px var(--display); background: #121A24; border: 1px solid var(--line-strong); cursor: pointer; }
.key:hover { border-color: var(--cyan); }
.key.go { background: var(--amber); color: #14100A; border-color: var(--amber); font-size: 18px; letter-spacing: .12em; }
.feedback { min-height: 28px; text-align: center; font: 700 20px var(--display); letter-spacing: .04em; }
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--danger); }
.streak { display: flex; align-items: center; gap: 8px; font: 600 13px var(--display); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.streak i { width: 12px; height: 12px; background: var(--line); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.streak i.on { background: var(--amber); }

/* reading */
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.book { display: flex; flex-direction: column; gap: 10px; padding: 0; text-align: left; cursor: pointer; background: #121A24; border: 1px solid var(--line-strong); clip-path: var(--cut); overflow: hidden; }
.book:hover { border-color: var(--amber); }
.book canvas { width: 100%; height: 110px; display: block; }
.book .meta { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.book b { font: 700 17px var(--display); letter-spacing: .03em; }
.book small { color: var(--muted); font-size: 13px; }
.book .stars { color: var(--amber); letter-spacing: .2em; font-size: 14px; }
.book.locked { opacity: .55; }
.page-art { width: 100%; height: 160px; display: block; border: 1px solid var(--line); }
.page-text { font: 400 clamp(26px, 4.4vw, 40px) / 1.65 var(--read); display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; text-align: center; padding: 8px 4px; }
.w { position: relative; padding: 0 4px; border-radius: 6px; cursor: pointer; transition: color .15s, background .15s; color: #C9D3DE; border: 0; background: transparent; font: inherit; line-height: inherit; }
.w.done { color: var(--good); }
.w.current { color: #fff; background: rgba(95,230,242,.16); box-shadow: inset 0 -3px 0 var(--cyan); }
.w.stuck { animation: pulse 1s ease-in-out infinite; }
.w.missed { color: var(--danger); text-decoration: underline wavy; text-underline-offset: 8px; }
.w.helped { color: var(--amber); }
@keyframes pulse { 50% { background: rgba(242,178,51,.3); } }
.mic-row { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.mic { width: 84px; height: 84px; border-radius: 50%; border: 2px solid var(--cyan); background: #0E1E24; display: grid; place-items: center; cursor: pointer; position: relative; }
.mic.on { background: var(--cyan); }
.mic.on svg path, .mic.on svg rect { stroke: #062026; }
.mic.on::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--cyan); animation: ring 1.4s ease-out infinite; }
@keyframes ring { from { opacity: .9; transform: scale(.9); } to { opacity: 0; transform: scale(1.35); } }
.mic-status { font-size: 15px; color: var(--muted); max-width: 32ch; }
.heard { font-size: 13px; color: var(--muted); text-align: center; min-height: 18px; font-style: italic; }
.quiz-q { font: 700 clamp(22px, 3.6vw, 30px) / 1.4 var(--read); text-align: center; }
.quiz-choices { display: grid; gap: 10px; }
.quiz-choices .choice { font: 700 22px var(--read); min-height: 64px; }

/* summary */
.summary { text-align: center; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.summary .big-num { font: 800 64px var(--display); color: var(--amber); line-height: 1; }
.summary p { margin: 0; color: #C9D3DE; font-size: 17px; }

/* ---------- battle HUD ---------- */
.battle-hud { pointer-events: none; }
.battle-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hp-plate { padding: 12px 16px; width: min(340px, 60vw); display: flex; flex-direction: column; gap: 8px; }
.hp-bar { height: 14px; background: rgba(255,255,255,.08); position: relative; overflow: hidden; }
.hp-bar > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--good), #b4f5cf); transition: width .2s; }
.hp-bar.low > i { background: linear-gradient(90deg, var(--danger), #ffb08f); }
.hp-label { display: flex; justify-content: space-between; font: 600 12px var(--display); letter-spacing: .14em; color: var(--muted); }
.enemy-plate { padding: 12px 16px; text-align: right; }
.enemy-plate b { font: 800 28px var(--display); display: block; line-height: 1; }
.weapons { display: flex; gap: 10px; }
.weapon { padding: 10px 14px; width: 150px; display: flex; flex-direction: column; gap: 6px; }
.weapon .bar > i { background: var(--cyan); transition: none; }
.weapon.heat .bar > i { background: linear-gradient(90deg, var(--amber), var(--danger)); }
.crosshair { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; pointer-events: none; transition: transform .08s; }
.crosshair.locked { transform: scale(.8); }
.battle-bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.controls-help { padding: 14px 18px; font-size: 14px; line-height: 1.7; max-width: 420px; }
.controls-help kbd { font: 700 12px var(--display); background: #1B2430; border: 1px solid var(--line-strong); padding: 1px 6px; }
.help-feedback { color: var(--cyan); }
.stick { position: relative; width: 150px; height: 150px; border-radius: 50%; background: rgba(10,14,20,.55); border: 2px solid var(--line-strong); pointer-events: auto; touch-action: none; }
.stick .knob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(95,230,242,.35); border: 2px solid var(--cyan); }
.fire-btns { display: flex; gap: 14px; align-items: flex-end; pointer-events: auto; }
.fire { width: 96px; height: 96px; border-radius: 50%; border: 2px solid var(--cyan); background: rgba(14,30,36,.7); font: 800 14px var(--display); letter-spacing: .1em; touch-action: none; }
.fire.cannon { border-color: var(--amber); width: 110px; height: 110px; }
.fire:active { background: rgba(95,230,242,.35); }
.facing-panel { position: absolute; left: 18px; top: 88px; width: 184px; padding: 9px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; pointer-events: auto; }
.facing-panel > div { display: flex; flex-direction: column; gap: 2px; }
.facing-panel b { font: 700 17px var(--display); font-variant-numeric: tabular-nums; color: var(--cyan); }
.facing-panel > div:nth-child(2) b { color: var(--amber); }
.facing-panel p { grid-column: 1 / -1; min-height: 14px; margin: 0; color: var(--danger); font: 600 11px var(--display); letter-spacing: .04em; }
.weapon-out-of-arc .facing-panel { border-color: var(--danger); }
.aim-assist-toggle { grid-column: 1 / -1; justify-self: start; display: inline-flex; gap: 10px; align-items: center; min-height: 32px; border: 1px solid var(--line-strong); background: rgba(10,14,20,.8); padding: 4px 9px; color: var(--muted); font: 700 11px var(--display); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.aim-assist-toggle b { color: var(--amber); font-size: 11px; }
.aim-assist-toggle[aria-pressed="true"] { border-color: var(--cyan); color: var(--text); }
.aim-assist-toggle[aria-pressed="true"] b { color: var(--cyan); }
.aim-assist-toggle:disabled { opacity: .6; cursor: not-allowed; }
.practice-nudge { position: absolute; z-index: 6; left: 50%; top: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(460px, calc(100vw - 32px)); padding: 8px 10px 8px 14px; font-size: 13px; color: #C9D3DE; pointer-events: auto; transition: opacity .35s, transform .35s; }
.practice-nudge b { color: var(--amber); font: 700 11px var(--display); letter-spacing: .13em; text-transform: uppercase; margin-right: 8px; }
.practice-nudge button { flex: none; width: 28px; height: 28px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; }
.practice-nudge button:hover { border-color: var(--cyan); color: var(--cyan); }
.battle-hud .tech-btn { position: absolute; z-index: 8; top: 88px; right: 18px; }
.touch-deck { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: clamp(8px, 3vw, 22px); width: min(620px, 100%); pointer-events: none; }
.touch-stick-group { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.touch-label { color: var(--muted); font: 700 10px var(--display); letter-spacing: .12em; text-align: center; white-space: nowrap; }
.touch-deck .stick { width: 126px; height: 126px; display: grid; place-items: center; overflow: hidden; }
.touch-deck .stick .knob { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
.stick-axis { pointer-events: none; text-align: center; color: rgba(201,211,222,.52); font: 700 10px/1.35 var(--display); letter-spacing: .1em; }
.aim-group { position: relative; }
.aim-touch-actions { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; pointer-events: auto; }
.aim-fire-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.aim-touch-actions .fire { width: 58px; height: 44px; min-height: 44px; border-radius: 3px; padding: 0 5px; font-size: 10px; letter-spacing: .06em; }
.aim-touch-actions .fire.cannon { width: 58px; height: 44px; }
.aim-touch-actions .secondary-fire { border-color: var(--cyan); }
.center-torso { min-height: 34px; padding: 0 8px; border: 1px solid var(--amber); background: rgba(30,25,14,.9); color: var(--amber); font: 800 10px var(--display); letter-spacing: .08em; cursor: pointer; touch-action: manipulation; }
.center-torso:disabled { opacity: .55; cursor: not-allowed; }
.touch-deck .stick, .touch-deck button { pointer-events: auto; }
.touch-deck .stick:active, .touch-deck .fire.held { border-color: var(--amber-hot); background-color: rgba(242,178,51,.22); }
.battle-bottom > .weapon-list { align-self: flex-end; }
.result { margin: auto; width: min(520px, 100%); padding: 30px; text-align: center; display: flex; flex-direction: column; gap: 18px; pointer-events: auto; }
.result h1 { font-size: 48px; font-weight: 800; letter-spacing: .1em; }
.result h1.win { color: var(--amber); }
.result h1.lose { color: var(--danger); }

/* parent corner */
.parent-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.parent-table th, .parent-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.parent-table th { font: 600 11px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* toast */
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 84px); transform: translate(-50%, -8px); opacity: 0; transition: opacity .25s, transform .25s; background: var(--panel-solid); border: 1px solid var(--amber); padding: 12px 20px; font: 600 16px var(--body); max-width: calc(100% - 40px); text-align: center; pointer-events: none; z-index: 50; clip-path: var(--cut); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* boot */
.boot { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.boot b { font: 700 14px var(--display); letter-spacing: .3em; text-transform: uppercase; color: var(--amber); }
.meter { width: 180px; height: 2px; background: var(--line); overflow: hidden; position: relative; }
.meter i { position: absolute; inset: 0; width: 40%; background: var(--amber); animation: sweep 1.1s ease-in-out infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

@media (max-width: 760px), (max-height: 520px) {
  .hud-mid { flex-direction: column; align-items: stretch; justify-content: flex-end; }
  .hud-mid .side-panel { display: none; }
  .hud-mid.show-panel .side-panel { display: flex; position: absolute; inset: 80px 16px 120px; width: auto; z-index: 5; }
  .mech-card .stats { display: none; }
  .mech-card { width: 100%; }
  .actions { width: 100%; }
  .act { flex: 1 1 140px; min-height: 56px; padding: 8px 12px; }
  .act.go { flex: 1 1 100%; justify-content: center; }
  .learn-body { padding: 16px; }
  .weapons .weapon { width: 110px; }
  .controls-help { display: none; }
  .hint { display: none; }
}
@media (min-width: 761px) and (min-height: 521px) { .panel-toggle { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::after { animation: none !important; transition: none !important; } }

/* ---------- placement missions + grown-ups dashboard ---------- */
.missions { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; border-left: 3px solid var(--cyan); }
.sel { min-height: 44px; background: #0A0F15; color: var(--text); border: 1px solid var(--line-strong); padding: 0 10px; font: 600 16px var(--body); }
.parent { gap: 26px; }
.pcard { display: flex; flex-direction: column; gap: 18px; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.pcard:first-child { border-top: 0; padding-top: 0; }
.kpi { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.kpi b, .kcard b { font: 800 30px var(--display); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi small, .kcard small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kcard { display: flex; flex-direction: column; gap: 6px; padding: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--c); color: var(--c); font: 700 12px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.two-col > div { min-width: 0; overflow-x: auto; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; padding: 14px; background: rgba(255,255,255,.02); border: 1px solid var(--line); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 16px; height: 4px; margin-right: 6px; vertical-align: middle; }
.legend i.dash { background: repeating-linear-gradient(90deg, #9AA8B8 0 5px, transparent 5px 10px); }
.note { margin: 0; padding: 10px 14px; border-left: 3px solid var(--amber); background: rgba(242,178,51,.06); font-size: 14px; }
.method { font-size: 14px; line-height: 1.6; color: #C9D3DE; }
.method summary { cursor: pointer; font: 700 14px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--text); min-height: 44px; display: flex; align-items: center; }
.method p { margin: 0 0 10px; max-width: 75ch; }
.parent-table td .bar { min-width: 80px; }

/* ---------- classic shelf cover art ---------- */
.classic-shelf .cs-cover {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line-strong);
  background: #121a24;
}
.classic-shelf .cs-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(95, 230, 242, .18);
  background: linear-gradient(135deg, rgba(95, 230, 242, .07), transparent 46%, rgba(7, 9, 13, .18));
}
.classic-shelf .cs-cover-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: transparent;
  background: #121a24;
}

/* ---------- mech loadout, paint and shop ---------- */
.class-tag { display: inline-block; font: 700 11px var(--display); letter-spacing: .18em; text-transform: uppercase; color: #0B0E13; background: var(--amber); padding: 2px 8px; margin-bottom: 6px; }
.side-panel .tabs { flex-wrap: wrap; }
.side-panel .tab { min-width: 64px; }
.side-panel { width: min(360px, 100%); }
.up-row .row .cost-btn { grid-column: auto; grid-row: auto; }
.swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.sw { aspect-ratio: 1; min-height: 32px; border: 2px solid rgba(255,255,255,.12); cursor: pointer; padding: 0; clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px)); }
.sw[aria-pressed=true] { border-color: #fff; box-shadow: inset 0 0 0 2px #0B0E13; }
.chip.small { min-width: 0; min-height: 40px; font-size: 13px; padding: 6px 10px; }
.shop-item.viewing { border-color: var(--cyan); }
.weapon-list { padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; min-width: 200px; max-width: 260px; }
.wrow { display: flex; flex-direction: column; gap: 4px; }
.wrow .eyebrow { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; }
.wrow em { font-style: normal; color: var(--cyan); }
.wrow .bar > i { background: var(--cyan); transition: none; }
.wrow.heat .bar > i { background: linear-gradient(90deg, var(--amber), var(--danger)); }
.wrow.heat.hot .eyebrow { color: var(--danger); }
@media (max-width: 760px) { .weapon-list { min-width: 150px; max-width: 170px; } .swatches { grid-template-columns: repeat(8, minmax(0, 1fr)); } }

.shop-item .view-btn { grid-column: 1 / -1; grid-row: auto; min-height: 36px; padding: 4px 10px; font-size: 12px; }

/* ---------- concept art in the hangar ---------- */
.title-bg { transition: background-image 1.2s ease; }
.card-art { width: calc(100% + 40px); margin: -16px -20px 0; height: 120px; object-fit: cover; object-position: center 30%; display: block; border-bottom: 1px solid var(--line); }
.class-banner { height: 64px; background-size: cover; background-position: center 35%; display: flex; align-items: flex-end; padding: 8px 10px; border: 1px solid var(--line); position: relative; margin-top: 6px; }
.class-banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(7,9,13,.85), rgba(7,9,13,.1)); }
.class-banner span { position: relative; font: 700 12px var(--display); letter-spacing: .2em; text-transform: uppercase; color: #fff; }
.shop-item.has-art { grid-template-columns: 64px 1fr auto; }
.shop-item.has-art .mech-art { grid-row: 1 / span 3; width: 64px; height: 92px; object-fit: cover; object-position: center 25%; border: 1px solid var(--line); }
.shop-item.has-art .btn { grid-column: 3; }
.shop-item.has-art .view-btn { grid-column: 2 / -1; }
@media (max-width: 760px) { .card-art { display: none; } .mech-card { padding: 10px 14px; gap: 8px; } .mech-card h2 { font-size: 22px; } }

/* ---------- Store and Fleet ---------- */
.nav-btn { min-height: 48px; padding: 8px 16px; font-size: 14px; gap: 8px; }
.nav-btn.primary-nav { border-color: var(--amber); color: var(--amber); }
.learn.wide { width: min(1180px, 100%); height: min(860px, 100%); }
.store-tabs { display: flex; gap: 6px; padding: 10px 18px 0; border-bottom: 1px solid var(--line); }
.store-tabs .tab { flex: 0 0 auto; min-width: 120px; min-height: 44px; border-bottom: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.store-card { display: flex; flex-direction: column; background: #121A24; border: 1px solid var(--line-strong); clip-path: var(--cut); overflow: hidden; }
.store-card.owned { border-color: #3a4a3a; }
.store-card.active { border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
.store-card .art { position: relative; height: 190px; background: #0A0F15; overflow: hidden; }
.store-card .art img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; display: block; }
.store-card .art .class-tag { position: absolute; left: 10px; top: 10px; margin: 0; }
.badge-on { position: absolute; right: 10px; top: 10px; font: 700 11px var(--display); letter-spacing: .14em; text-transform: uppercase; padding: 3px 8px; background: var(--good); color: #0B0E13; }
.badge-on.owned { background: var(--cyan); }
.store-card .info { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.store-card h3 { font-size: 22px; letter-spacing: .06em; }
.store-card .role { margin: -6px 0 0; color: var(--cyan); font-size: 13px; font-weight: 600; }
.store-card .lore { margin: 0; color: #C9D3DE; font-size: 14px; line-height: 1.45; }
.store-card .stats { grid-template-columns: 74px 1fr 22px; }
.actions-row { margin-top: auto; gap: 8px; }
.actions-row .btn { min-height: 44px; padding: 8px 12px; font-size: 13px; }
.need { margin: 0; font-size: 12px; color: var(--amber); }
.store-note { margin: 0; color: var(--muted); font-size: 14px; }
.weapon-art { height: 150px !important; background: radial-gradient(ellipse at center, #1d2a3a, #0A0F15 70%) !important; display: grid; place-items: center; }
.weapon-art img { object-fit: contain !important; width: 90% !important; height: 90% !important; }
.spec { width: 100%; border-collapse: collapse; font-size: 13px; }
.spec th { text-align: left; color: var(--muted); font: 600 11px var(--display); letter-spacing: .12em; text-transform: uppercase; padding: 4px 0; width: 38%; vertical-align: top; }
.spec td { padding: 4px 0; }
.owned-line { margin: 0; font-size: 13px; color: var(--good); font-weight: 600; }
.up-row.with-thumb { grid-template-columns: 64px 1fr auto; }
.up-row.with-thumb .mini-thumb { grid-row: 1 / span 2; width: 64px; height: 40px; object-fit: contain; background: #0A0F15; }
.up-row.with-thumb .cost-btn { grid-column: 3; }
.paint-chips { display: flex; gap: 6px; align-items: center; }
.paint-chips i { width: 18px; height: 18px; border: 1px solid rgba(255,255,255,.2); }
.paint-chips span { font: 700 13px var(--display); color: var(--muted); margin-left: 4px; }
.dmg { display: grid; grid-template-columns: 74px 1fr 46px; gap: 12px; align-items: center; font-size: 13px; }
.dmg > span:first-child { font: 600 11px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.dmg .bar > i { background: var(--good); }
.dmg .bar.hurt > i { background: var(--danger); }
.dmg .bad { color: var(--danger); font-weight: 700; text-align: right; } .dmg .ok { color: var(--good); text-align: right; }
.loadout { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.loadout li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.loadout li span { color: var(--muted); }
.loadout em { font-style: normal; color: var(--cyan); font-size: 12px; }
.loadout em.empty { color: var(--muted); }
.storage-row, .locked-row { display: flex; gap: 12px; overflow-x: auto; padding: 8px 0 4px; }
.stored { flex: 0 0 160px; display: flex; flex-direction: column; gap: 4px; padding: 10px; background: #121A24; border: 1px solid var(--line); }
.stored img { width: 100%; height: 80px; object-fit: contain; background: #0A0F15; }
.stored small, .locked small { color: var(--muted); font-size: 12px; }
.locked { flex: 0 0 140px; display: flex; flex-direction: column; gap: 4px; padding: 0 0 10px; text-align: left; background: #121A24; border: 1px solid var(--line); cursor: pointer; }
.locked img { width: 100%; height: 120px; object-fit: cover; object-position: center 22%; filter: grayscale(.85) brightness(.6); }
.locked b, .locked small { padding: 0 10px; }
.locked:hover img { filter: none; }
@media (max-width: 760px) { .nav-btn { padding: 6px 10px; font-size: 12px; } .store-tabs .tab { min-width: 0; flex: 1; } .top-right { flex-wrap: wrap; justify-content: flex-end; } }
.up-row.with-thumb b, .up-row.with-thumb small { grid-column: 2; }

/* ---- Missions ---- */
.pass-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 4px; background: var(--amber); color: #0B0E13; font: 800 13px var(--display); clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.mission-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.passes { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.passes small, .goal small, .note { color: var(--muted); font-size: 13px; }
.pass-row { display: flex; gap: 8px; }
.pass-row i { width: 26px; height: 34px; background: #121A24; border: 1px solid var(--line-strong); clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%); }
.pass-row i.on { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 12px rgba(242,178,51,.5); }
.sec { margin: 18px 0 8px; font: 700 15px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); display: flex; justify-content: space-between; align-items: baseline; }
.sec span { color: var(--muted); font-size: 13px; letter-spacing: .06em; }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.goal { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; border-left: 3px solid var(--line-strong); }
.goal.done { border-left-color: var(--good); }
.goal .g-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.g-check { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line-strong); font-weight: 800; color: #0B0E13; }
.goal.done .g-check { background: var(--good); border-color: var(--good); }
.goal .bar, .daily .bar { height: 8px; background: #0A0F15; border: 1px solid var(--line); }
.goal .bar i, .daily .bar i { display: block; height: 100%; background: var(--cyan); }
.goal.done .bar i, .d-goal.done .bar i { background: var(--good); }
.warn { color: var(--danger); margin: 0 0 8px; }
.store-card.mission { padding: 0; }
.store-card.mission.locked { opacity: .55; }
.store-card.mission .m-body { padding: 14px 16px 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.store-card.mission h4 { margin: 0; font: 700 20px var(--display); }
.store-card.mission p { margin: 0; color: #C9D3DE; font-size: 14px; min-height: 40px; }
.m-num { font: 700 11px var(--display); letter-spacing: .16em; color: var(--amber); }
.m-meta { display: flex; gap: 14px; color: var(--muted); font-size: 13px; }
.store-card.mission .stars { color: var(--amber); letter-spacing: .18em; font-size: 22px; }
.store-card.mission > .btn { margin: 8px 16px 14px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding-bottom: 12px; }
.bdg { padding: 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; opacity: .5; }
.bdg.got { opacity: 1; border-left: 3px solid var(--amber); }
.bdg .medal { width: 36px; height: 36px; display: grid; place-items: center; background: #121A24; color: var(--muted); font: 800 18px var(--display); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.bdg.got .medal { background: var(--amber); color: #0B0E13; }
.bdg small { color: var(--muted); font-size: 12px; }
.daily { padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; text-align: left; cursor: pointer; border: 1px solid var(--line-strong); border-left: 3px solid var(--amber); color: inherit; min-width: 260px; }
.daily-row { display: flex; gap: 12px; }
.d-goal { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #C9D3DE; min-width: 90px; }
.d-goal.done span { color: var(--good); }
.act em { display: block; font-style: normal; font-weight: 500; font-size: 12px; color: var(--muted); }
.act.go { flex-direction: column; justify-content: center; gap: 0; }
.act.go em { color: #5a4a22; font-size: 12px; font-weight: 700; letter-spacing: .08em; }

/* ---- Sound Lab ---- */
.lesson-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.lesson { display: flex; align-items: center; gap: 14px; padding: 12px 16px; text-align: left; cursor: pointer; color: inherit; width: 100%; border-left: 3px solid var(--line-strong); }
.lesson:disabled { opacity: .45; cursor: not-allowed; }
.lesson.done { border-left-color: var(--good); }
.lesson.next { border-left-color: var(--amber); box-shadow: inset 0 0 0 1px rgba(242,178,51,.4); }
.lesson .l-no { width: 34px; height: 34px; display: grid; place-items: center; background: #121A24; font: 800 16px var(--display); flex: none; }
.lesson .l-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.lesson .l-body small { color: var(--muted); font-size: 13px; }
.lesson .l-stars { color: var(--amber); letter-spacing: .12em; font-size: 18px; white-space: nowrap; }
.gap-word { text-align: center; font: 700 64px var(--read); letter-spacing: .08em; margin: 6px 0; }
.gap-word .gap { color: var(--amber); border-bottom: 4px solid var(--amber); margin: 0 4px; display: inline-block; min-width: 1.2em; line-height: .7; }
.choices.big { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }

/* stuck-word coach */
.coach[hidden] { display: none; }
.coach-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; padding: 10px 14px; margin: 8px 0; border: 1px solid var(--cyan, #5FE6F2); border-radius: 12px; background: rgba(95,230,242,.08); }
.coach-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.coach-parts { font-family: var(--read, inherit); font-weight: 700; font-size: 34px; display: flex; gap: 8px; align-items: center; }
.coach-parts i { color: var(--muted); font-style: normal; }
.cp { padding: 2px 8px; border-radius: 8px; transition: background .15s, color .15s; }
.cp.on { background: #F2B233; color: #111; }
.w.model { background: #F2B233; color: #111; border-radius: 6px; }
.page-art { object-fit: cover; }

/* Tech Support */
.tech-btn { pointer-events: auto; align-self: flex-end; min-width: 92px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); background: rgba(14,30,36,.7); color: var(--muted); font: 800 14px var(--display); letter-spacing: .1em; display: flex; flex-direction: column; align-items: center; touch-action: manipulation; }
.tech-btn small { font: 700 11px var(--display); }
.tech-btn.ready { border-color: var(--good); color: var(--text, #fff); box-shadow: 0 0 14px rgba(80,220,140,.45); animation: pulse 1.2s ease-in-out infinite; }
.tech-overlay { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(5,8,12,.72); pointer-events: auto; padding: 12px; overflow: auto; }
.tech-box { width: min(560px, 100%); display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; }

/* radar */
.radar { position: absolute; right: 12px; top: 74px; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.radar canvas { width: 120px; height: 120px; display: block; }
.radar .eyebrow { font-size: 10px; }
@media (max-width: 700px) { .radar canvas { width: 92px; height: 92px; } }

/* ---------- phones held sideways (short and wide) ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .screen { padding-block: 8px; }
  .hud-top { gap: 6px; }
  .brand .name { font-size: 15px; } .brand .sub { font-size: 11px; }
  .hud-mid { flex-direction: row; align-items: flex-start; justify-content: space-between; padding-block: 4px; }
  .hud-mid.show-panel .side-panel { inset: 56px 12px 70px 40%; }
  .card-art, .mech-card .stats, .hint { display: none; }
  .mech-card { width: 220px; padding: 8px 12px; gap: 6px; }
  .mech-card h2 { font-size: 20px; } .mech-card .cls { font-size: 12px; }
  .hud-bottom { flex-wrap: nowrap; align-items: flex-end; gap: 8px; }
  .missions { padding: 6px 10px; gap: 6px; } .missions .btn { min-height: 38px; padding: 4px 10px; font-size: 12px; }
  .daily { padding: 6px 10px; }
  .actions { flex-wrap: nowrap; width: auto; gap: 6px; }
  .act { flex: 0 0 auto; min-height: 46px; padding: 6px 12px; gap: 8px; } .act b { font-size: 13px; } .act em { font-size: 11px; }
  .act.go { flex: 0 0 auto; padding: 6px 18px; } .act.go b { font-size: 16px; }
  .nav-btn { padding: 4px 8px; font-size: 11px; }
  .credits .num { font-size: 20px; }
  .stick { width: 120px; height: 120px; } .stick .knob { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
  .fire { width: 78px; height: 78px; font-size: 12px; } .fire.cannon { width: 90px; height: 90px; }
  .battle-bottom { padding-bottom: 6px; }
}

/* ---------- battle on touch screens ---------- */
.stick, .fire-btns { flex: none; }
@media (max-width: 600px) and (orientation: portrait) {
  .radar { top: 128px; }
  .battle-top { flex-wrap: wrap; }
  .hp-plate { width: 100%; }
  .battle-bottom .row { position: static; }
  .battle-bottom .weapon-list { position: absolute; right: 12px; bottom: 150px; min-width: 150px; max-width: 170px; }
  .stick { width: 128px; height: 128px; }
  .fire { width: 84px; height: 84px; } .fire.cannon { width: 96px; height: 96px; }
}

/* ---------- the classroom (math, reading and every other learning screen) ---------- */
.dim.classroom { position: absolute; inset: 0; background: linear-gradient(rgba(236,243,250,.35), rgba(236,243,250,.55)), url(../assets/classroom.jpg) center / cover no-repeat; animation: roomIn .7s ease-out both; }
@keyframes roomIn { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }

.room-tag { color: var(--amber); letter-spacing: .22em; margin-bottom: 2px; }
.dim.classroom { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* ---------- independent legs / torso battle controls ---------- */
.battle-hud:where(:has(.touch-deck)) .tech-btn { left: 16px; right: auto; top: calc(env(safe-area-inset-top, 0px) + 88px); }
@media (max-width: 600px) and (orientation: portrait) {
  .battle-hud { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }
  .battle-hud .battle-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .battle-hud .battle-top > .row { gap: 6px; }
  .battle-hud .hp-plate { width: auto; min-width: 0; padding: 8px 10px; }
  .battle-hud .hp-plate > .row { gap: 4px; font-size: 11px; }
  .battle-hud .hp-plate .eyebrow { font-size: 9px; letter-spacing: .1em; }
  .battle-hud .enemy-plate { padding: 8px 10px; }
  .battle-hud .enemy-plate b { font-size: 22px; }
  .battle-hud .icon-btn { width: 42px; height: 42px; min-height: 42px; }
  .battle-hud .radar { top: 126px; right: 10px; transform: scale(.64); transform-origin: top right; }
  .battle-hud .facing-panel { left: 10px; top: 128px; width: 166px; padding: 8px 9px; gap: 5px 8px; }
  .battle-hud .facing-panel .eyebrow { font-size: 10px; letter-spacing: .14em; }
  .battle-hud .facing-panel b { font-size: 17px; }
  .battle-hud .facing-panel p { min-height: 24px; font-size: 10px; line-height: 1.2; }
  .battle-hud .aim-assist-toggle { min-height: 36px; padding: 5px 8px; font-size: 11px; }
  .battle-hud .aim-assist-toggle b { font-size: 12px; }
  .battle-hud .practice-nudge { left: 12px; right: 12px; top: 362px; transform: none; max-width: none; width: auto; justify-content: space-between; padding: 7px 9px 7px 12px; gap: 7px; font-size: 12px; }
  .battle-hud .practice-nudge b { font-size: 10px; margin-right: 4px; }
  .battle-hud .practice-nudge button { width: 32px; height: 32px; }
  .battle-hud .tech-btn { top: 304px; left: 12px; min-width: 92px; min-height: 44px; padding: 5px 10px; font-size: 13px; }
  .battle-hud .tech-btn small { font-size: 11px; }
  .battle-hud .battle-bottom { width: 100%; justify-content: center; padding: 0; gap: 0; }
  .battle-hud .touch-deck { width: 100%; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; }
  .battle-hud .touch-stick-group { gap: 4px; }
  .battle-hud .touch-deck .stick { width: clamp(104px, 30vw, 116px); height: clamp(104px, 30vw, 116px); }
  .battle-hud .touch-deck .stick .knob { width: 50px; height: 50px; margin: -25px 0 0 -25px; }
  .battle-hud .stick-axis { font-size: 10px; }
  .battle-hud .touch-label { font-size: 11px; letter-spacing: .09em; }
  .battle-hud .aim-touch-actions { width: 100%; gap: 4px; }
  .battle-hud .aim-fire-row { gap: 8px; }
  .battle-hud .aim-touch-actions .fire, .battle-hud .aim-touch-actions .fire.cannon { width: 58px; height: 44px; min-height: 44px; font-size: 10px; }
  .battle-hud .center-torso { min-width: 112px; min-height: 44px; padding-inline: 8px; font-size: 10px; }
  .battle-hud .touch-deck + .weapon-list { position: absolute; left: 12px; right: auto; top: 260px; bottom: auto; transform: none; width: 166px; min-width: 0; max-width: 166px; padding: 5px 8px; gap: 4px; }
  .battle-hud .touch-deck + .weapon-list .wrow:not(.heat) { display: none; }
  .battle-hud .touch-deck + .weapon-list .wrow .eyebrow { font-size: 10px; letter-spacing: .16em; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .battle-hud { padding: 8px max(10px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 6px) max(10px, env(safe-area-inset-left, 0px)); }
  .battle-hud .radar { top: 92px; right: 10px; transform: scale(.62); transform-origin: top right; }
  .battle-hud .facing-panel { left: 10px; top: 82px; width: 166px; padding: 7px 9px; gap: 4px 8px; }
  .battle-hud .facing-panel .eyebrow { font-size: 10px; }
  .battle-hud .facing-panel b { font-size: 16px; }
  .battle-hud .facing-panel p { font-size: 9px; min-height: 20px; }
  .battle-hud .aim-assist-toggle { min-height: 34px; }
  .battle-hud .practice-nudge { left: 190px; right: auto; top: 154px; transform: none; width: min(240px, calc(100vw - 430px)); max-width: 240px; padding: 5px 7px 5px 9px; gap: 6px; font-size: 11px; }
  .battle-hud .practice-nudge b { font-size: 9px; }
  .battle-hud .practice-nudge button { width: 30px; height: 30px; }
  .battle-hud .tech-btn { top: 244px; left: 10px; right: auto; min-width: 92px; min-height: 44px; padding: 5px 9px; }
  .battle-hud .tech-btn small { font-size: 11px; }
  .battle-hud .touch-deck + .weapon-list { position: absolute; left: 10px; right: auto; top: 200px; bottom: auto; transform: none; width: 166px; min-width: 0; max-width: 166px; padding: 4px 7px; }
  .battle-hud .touch-deck + .weapon-list .wrow:not(.heat) { display: none; }
  .battle-hud .touch-deck + .weapon-list .wrow .eyebrow { font-size: 10px; }
  .battle-hud .battle-bottom { width: 100%; padding-bottom: 0; justify-content: center; }
  .battle-hud .touch-deck { width: min(520px, 100%); grid-template-columns: 1fr 1fr; gap: 30px; }
  .battle-hud .touch-deck .stick { width: 108px; height: 108px; }
  .battle-hud .touch-deck .stick .knob { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
  .battle-hud .touch-label { font-size: 10px; }
  .battle-hud .aim-touch-actions { gap: 4px; }
  .battle-hud .aim-fire-row { gap: 8px; }
  .battle-hud .aim-touch-actions .fire, .battle-hud .aim-touch-actions .fire.cannon { width: 58px; height: 44px; min-height: 44px; font-size: 10px; }
  .battle-hud .center-torso { min-width: 112px; min-height: 44px; font-size: 10px; padding-inline: 7px; }
}

/* ---------- light classroom theme: every learning card ---------- */
.learn.lt {
  --panel-solid: rgba(250,252,255,.94); --panel: rgba(255,255,255,.9);
  --line: #D3DCE6; --line-strong: #B4C2D1;
  --text: #14202E; --muted: #52647A;
  --amber: #C98300; --amber-hot: #B87500; --cyan: #0B7F91; --danger: #C2410C; --good: #12814A;
  color: var(--text); color-scheme: light;
  background: rgba(250,252,255,.94); backdrop-filter: blur(6px); border-color: var(--line-strong);
  box-shadow: 0 18px 50px rgba(7,20,40,.35);
}
.learn.lt .btn { background: #EEF3F8; color: var(--text); border-color: var(--line-strong); }
.learn.lt .btn:hover { border-color: var(--cyan); background: #E2ECF5; }
.learn.lt .btn.primary, .learn.lt .btn.go { background: #F2B233; color: #14100A; border-color: #E0A020; }
.learn.lt .btn.ghost { background: transparent; }
.learn.lt .bar { background: #DCE5EE; }
.learn.lt .plate { background: #fff; border-color: var(--line-strong); color: var(--text); }
.learn.lt .credits .lbl, .learn.lt .eyebrow { color: var(--muted); }
.learn.lt .room-tag { color: #B87500; }
.learn.lt input, .learn.lt select, .learn.lt textarea, .learn.lt .sel { background: #fff; color: var(--text); border-color: var(--line-strong); }

.learn.lt .choice, .learn.lt .key, .learn.lt .chip, .learn.lt .book, .learn.lt .lesson .l-no, .learn.lt .bdg .medal, .learn.lt .stored, .learn.lt .locked, .learn.lt .pass-row i { background: #fff; color: var(--text); border-color: var(--line-strong); }
.learn.lt .choice:hover, .learn.lt .key:hover, .learn.lt .chip:hover, .learn.lt .book:hover { border-color: var(--cyan); background: #EAF6F8; }
.learn.lt .answer-box, .learn.lt .field input[type=text], .learn.lt .field input[type=password], .learn.lt .goal .bar, .learn.lt .daily .bar { background: #fff; color: var(--text); border-color: var(--line-strong); }
.learn.lt .mic { background: #E6F5F8; }
.learn.lt .book .meta, .learn.lt .book small { color: var(--muted); }
.learn.lt .book h3, .learn.lt .book b, .learn.lt .book strong { color: var(--text); }
.learn.lt .hint, .learn.lt p, .learn.lt .sub { color: var(--muted); }
.learn.lt h1, .learn.lt h2, .learn.lt h3 { color: var(--text); }
.learn.lt .w { color: #8A9BB0; }
.learn.lt .w.done { color: var(--good); }
.learn.lt .w.current { color: #0A2530; background: rgba(11,127,145,.16); box-shadow: inset 0 -3px 0 var(--cyan); }
.learn.lt .w.helped { color: var(--amber); }
.learn.lt .w.missed { color: var(--danger); }
.learn.lt .w.model { background: #F2B233; color: #111; }

/* ---------- game logo ---------- */
.logo-img { margin: 0 0 4px; }
.logo-img img { display: block; width: min(380px, 80vw); height: auto; filter: drop-shadow(0 10px 30px rgba(0,0,0,.55)); -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 82%, transparent 100%); mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 82%, transparent 100%); }
@media (max-height: 520px) and (orientation: landscape) { .logo-img img { width: min(260px, 40vw); } .tagline { font-size: 13px; } }

/* login */
.loginbox { display: flex; flex-direction: column; gap: 12px; padding: 16px; width: min(360px, 100%); }
.acct { display: flex; flex-direction: column; gap: 12px; }
.loginbox[hidden], .acct[hidden], .pilots[hidden], [hidden].eyebrow { display: none; }
.loginbox input, .acct input { font-size: 16px; }
@media (max-height: 520px) { .loginbox { flex-direction: row; flex-wrap: wrap; align-items: end; width: 100%; padding: 10px 12px; gap: 8px; } .loginbox .field { flex: 1 1 140px; } .loginbox .error { flex-basis: 100%; margin: 0; } }

.loginbox { width: min(540px, 100%); }
.loginbox .fields { display: flex; gap: 12px; flex-wrap: wrap; }
.loginbox .fields .field { flex: 1 1 200px; }
.loginbox .fields input { min-height: 46px; font-size: 18px; }
.loginbox .error:empty { display: none; }
.screen:has(.title-wrap) { overflow-y: auto; }
@media (max-height: 520px) and (orientation: landscape) {
  .title-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); column-gap: 20px; row-gap: 8px; max-width: none; align-items: start; margin-block: 0; }
  .title-wrap > div:first-child { grid-area: 1 / 1 / 3 / 2; }
  .title-wrap > .tagline { grid-area: 1 / 2; margin: 0; }
  .title-wrap > div:nth-child(3) { grid-area: 2 / 2; }
  .title-wrap > .title-foot { grid-area: 3 / 1 / 4 / 3; }
  .loginbox { padding: 10px 12px; gap: 8px; width: 100%; flex-direction: column; }
  .loginbox .fields { flex-wrap: nowrap; } .loginbox .fields .field { flex: 1 1 0; min-width: 0; }
  .loginbox .fields input { min-height: 40px; }
}
.loginbox { box-sizing: border-box; min-width: 0; }
.loginbox input { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-height: 520px) and (orientation: landscape) { .loginbox { align-items: stretch; } .loginbox .row { flex-wrap: nowrap; } .loginbox .btn { min-height: 40px; padding-inline: 14px; } }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--muted); font: 600 13px var(--body); text-align: left; text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--amber); }
button.plate.brand { color: inherit; font: inherit; }

/* ---- home and classroom menus ---- */
.home-wrap { position: relative; display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 980px; margin: 0 auto; min-height: 100%; }
.screen:has(.home-wrap) { overflow-y: auto; }
.home-title { font-size: clamp(26px, 4.4vw, 44px); margin: 6px 0 0; text-align: center; letter-spacing: .02em; }
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: auto 0; }
.home-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 200px; padding: 22px 16px; text-align: center; cursor: pointer; color: inherit; font: inherit; }
.home-card > svg, .home-card > .badge { width: 52px; height: 52px; }
.home-card b { font-size: clamp(20px, 2.6vw, 28px); letter-spacing: .02em; }
.home-card em { font-style: normal; color: var(--muted, #9aa7b6); font-size: 14px; max-width: 24ch; }
.home-card:hover, .home-card:focus-visible { border-color: #5FE6F2; transform: translateY(-2px); }
.home-card .pass-badge { position: static; margin-top: 4px; }
.home-wrap .missions, .home-wrap .daily { align-self: stretch; }
@media (max-width: 720px) { .home-grid { grid-template-columns: 1fr; margin: 8px 0; } .home-card { min-height: 0; display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; text-align: left; justify-items: start; align-items: center; padding: 16px; } .home-card > svg, .home-card > .badge { grid-row: 1 / span 3; justify-self: center; } .home-card em { max-width: none; } .home-card .pass-badge { white-space: nowrap; margin-top: 4px; } }
@media (max-height: 520px) and (orientation: landscape) { .home-title { display: none; } .home-card { min-height: 0; padding: 14px 10px; } .home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .home-card em { display: none; } }

/* ---- records ---- */
.home-grid { grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); }
.rec-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.rec-tabs .btn[aria-selected="true"] { background: var(--amber, #F2B233); color: #0B0E13; border-color: transparent; }
.rec-rank { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.rank-name { font: 800 clamp(28px, 5vw, 44px) var(--display, inherit); color: var(--amber, #F2B233); letter-spacing: .04em; text-transform: uppercase; }
.rank-bar { flex: 1 1 240px; display: flex; flex-direction: column; gap: 6px; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.rec { display: flex; flex-direction: column; gap: 4px; }
.rec-num { font: 800 clamp(24px, 4vw, 34px) var(--display, inherit); }
.home-wrap h3.sec { margin: 6px 0 -6px; }
.home-wrap { padding-bottom: 20px; }
#rbody { display: flex; flex-direction: column; gap: 14px; }
#rbody .plate { padding: 14px 16px; background: rgba(11, 14, 19, .88); }
#rbody h3.sec { margin: 8px 0 -4px; }
#rbody .rec-rank { padding: 16px 18px; }
#rbody .parent-table { width: 100%; }
#rbody select.sel { margin-left: 8px; vertical-align: middle; }

/* Classroom screen uses the classroom painting, lightly veiled so the cards stay readable */
.title-bg.class-bg { background: #07090D url('../assets/classroom.jpg') center / cover no-repeat; }
.title-bg.class-bg::after { background: linear-gradient(180deg, rgba(236,243,250,.45) 0%, rgba(236,243,250,.2) 40%, rgba(236,243,250,.5) 100%); }

/* Classroom hub: the whole screen uses the light theme, matching the painting */
.screen.room-lt {
  --panel: rgba(255,255,255,.92); --panel-solid: #fff; --line: #CBD7E3; --line-strong: #A9BACB;
  --text: #14202E; --muted: #4A5D74; --amber: #C98300; --amber-hot: #B87500; --cyan: #0B7F91;
  color: var(--text); color-scheme: light;
}
.room-lt .plate { background: rgba(255,255,255,.92); border-color: var(--line-strong); color: var(--text); box-shadow: 0 8px 26px rgba(20,40,70,.16); }
.room-lt .brand { border-left-color: #F2B233; }
.room-lt .brand svg, .room-lt .home-card > svg { color: #0B7F91; stroke: #0B7F91; }
.room-lt .home-card { color: var(--text); }
.room-lt .home-card b { color: #0F1B2A; }
.room-lt .home-card em { color: var(--muted); }
.room-lt .home-card:hover, .room-lt .home-card:focus-visible { border-color: #0B7F91; background: #fff; box-shadow: 0 12px 30px rgba(11,127,145,.25); }
.room-lt .btn { background: #EEF3F8; color: var(--text); border-color: var(--line-strong); }
.room-lt .btn:hover { border-color: #0B7F91; background: #E2ECF5; }
.room-lt .btn.primary { background: #F2B233; color: #14100A; border-color: #E0A020; }
.room-lt .eyebrow, .room-lt .credits .lbl { color: var(--muted); }
.room-lt .bar { background: #DCE5EE; }
.room-lt .pass-badge { background: #F2B233; color: #14100A; }

/* Home screen: hangar key art, darkened toward the bottom where the menu cards sit */
.title-bg.home-bg { background: #07090D url('../assets/home.jpg') center 35% / cover no-repeat; }
.title-bg.home-bg::after { background: linear-gradient(180deg, rgba(7,9,13,.55) 0%, rgba(7,9,13,.05) 22%, rgba(7,9,13,.15) 50%, rgba(7,9,13,.78) 100%); }
.screen:has(.home-bg) .home-title { text-shadow: 0 2px 14px rgba(0,0,0,.85), 0 0 3px rgba(0,0,0,.7); }
@media (min-width: 721px) { .screen:has(.home-bg) .home-grid { margin: auto 0 3vh; } .screen:has(.home-bg) .home-card { min-height: 170px; } }

/* Clan themes: the pilot's clan colors the hangar and menus */
body[data-clan="deepstrike"] { --amber: #2FB8C9; --amber-hot: #5FE6F2; --cyan: #5FE6F2; --panel: rgba(7, 17, 27, 0.80); --line: #2C5A6B; --line-strong: #2C5A6B; }
body[data-clan="voltcoil"] { --amber: #3FD16A; --amber-hot: #B6FF2E; --cyan: #B6FF2E; --panel: rgba(7, 20, 13, 0.80); --line: #2E6B3E; --line-strong: #2E6B3E; }
body[data-clan="steelclaw"] { --amber: #E8803F; --amber-hot: #FFA24A; --cyan: #FFA24A; --panel: rgba(22, 13, 8, 0.80); --line: #7A4A2C; --line-strong: #7A4A2C; }
body[data-clan="stormwing"] { --amber: #4C7DFF; --amber-hot: #7FD8FF; --cyan: #7FD8FF; --panel: rgba(8, 13, 30, 0.80); --line: #2F4A8A; --line-strong: #2F4A8A; }
body[data-clan="frostfang"] { --amber: #9BD3F5; --amber-hot: #D5F1FF; --cyan: #D5F1FF; --panel: rgba(10, 18, 28, 0.80); --line: #4C6F8C; --line-strong: #4C6F8C; }
body[data-clan="ironmane"] { --amber: #F2B233; --amber-hot: #FFC24A; --cyan: #FFC24A; --panel: rgba(24, 12, 12, 0.80); --line: #7B3B2E; --line-strong: #7B3B2E; }
body[data-clan] .btn.primary { color: #0B0E13; }
.crest { display: block; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,.55)); }
.brand .crest { width: 44px; height: 44px; flex: none; }
.clan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: min(860px, 100%); margin: 0 auto; }
.clan-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; cursor: pointer; text-align: center; color: inherit; font: inherit; border-top: 3px solid var(--cc); }
.clan-card img { width: min(150px, 28vw); height: auto; transition: transform .15s; }
.clan-card b { font: 800 20px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.clan-card small { color: var(--muted); }
.clan-card:hover, .clan-card:focus-visible, .clan-card[aria-pressed=true] { border-color: var(--cc); box-shadow: 0 0 0 1px var(--cc), 0 10px 30px color-mix(in srgb, var(--cc) 35%, transparent); }
.clan-card:hover img { transform: translateY(-3px) scale(1.03); }
@media (max-width: 720px) { .clan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cup-row td:first-child { width: 34px; } .cup-row img { width: 40px; height: 40px; }

.home-card > img.hicon { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0,0,0,.55)); transition: transform .15s; }
.home-card:hover > img.hicon, .home-card:focus-visible > img.hicon { transform: translateY(-3px) scale(1.04); }
@media (max-width: 720px) { .home-card > img.hicon { width: 56px; height: 56px; } }

/* While a live 3D view is behind the menus, blurring it every frame is costly and can flicker or tear. Use plain translucent panels instead. */
body.live3d .plate, body.live3d .dim, body.live3d .learn.lt { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* ---------- Briefing Room ---------- */
.screen.br { background: #07090D; overflow: hidden; }
.br-bg { position: absolute; inset: 0; overflow: hidden; }
.br-stage { position: absolute; left: 50%; top: 50%; width: max(100vw, 177.78vh); aspect-ratio: 16 / 9; transform: translate(-50%, -50%); }
.br-stage > img:first-child { width: 100%; height: 100%; display: block; }
.br-crest { position: absolute; left: 50.6%; top: 27.2%; height: 19%; width: auto; aspect-ratio: 1; transform: translate(-50%, -50%); opacity: .9; mix-blend-mode: screen; filter: drop-shadow(0 0 10px var(--cyan, #5FE6F2)) drop-shadow(0 0 26px var(--cyan, #5FE6F2)); pointer-events: none; animation: crestPulse 4.5s ease-in-out infinite; }
@keyframes crestPulse { 0%, 100% { opacity: .75; } 50% { opacity: .95; } }
.br-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,7,10,.72) 0%, rgba(5,7,10,.15) 30%, rgba(5,7,10,0) 50%, rgba(5,7,10,.15) 70%, rgba(5,7,10,.72) 100%), linear-gradient(0deg, rgba(5,7,10,.55), rgba(5,7,10,0) 30%); pointer-events: none; }
.br-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px 18px 18px; }
.br-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.br-title { text-align: center; text-shadow: 0 2px 12px rgba(0,0,0,.85); }
.br-title h2 { font-size: clamp(20px, 3vw, 28px); }
.br-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(230px, 28%) 1fr minmax(290px, 32%); gap: 14px; }
.br-board { grid-column: 1; display: flex; flex-direction: column; gap: 12px; padding: 14px; min-height: 0; background: rgba(8, 12, 18, .82); }
.br-side { grid-column: 3; display: flex; flex-direction: column; min-height: 0; padding: 0; background: rgba(8, 12, 18, .86); }
.pass-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.m-list { display: flex; flex-direction: column; gap: 6px; overflow: auto; min-height: 0; }
.m-row { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; padding: 10px 12px; min-height: 48px; color: var(--text); background: rgba(18, 26, 36, .9); border: 1px solid var(--line-strong); font: 600 15px var(--body, inherit); cursor: pointer; }
.m-row:hover:not(:disabled), .m-row:focus-visible { border-color: var(--amber); }
.m-row.sel { border-color: var(--amber); box-shadow: inset 3px 0 0 var(--amber); background: rgba(30, 38, 50, .95); }
.m-row.lk { opacity: .5; cursor: default; }
.m-row .m-n { width: 24px; font: 800 14px var(--display, inherit); color: var(--muted); }
.m-row .m-name { flex: 1; }
.m-row .m-st { color: var(--amber); letter-spacing: .1em; font-size: 14px; }
.br-tabs { display: flex; border-bottom: 1px solid var(--line); }
.br-tabs button { flex: 1; min-height: 46px; background: transparent; color: var(--muted); border: 0; font: 700 13px var(--display, inherit); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.br-tabs button[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--amber); }
.br-pane { padding: 16px; overflow: auto; min-height: 0; }
.br-brief { display: flex; flex-direction: column; gap: 12px; }
.br-brief h3 { margin: 0; font: 800 24px var(--display, inherit); letter-spacing: .04em; }
.br-brief .lead { margin: 0; color: #C9D3DE; font-size: 16px; line-height: 1.4; }
.br-brief .m-num { color: var(--amber); font: 700 12px var(--display, inherit); letter-spacing: .14em; }
.br-brief .m-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.br-brief .m-meta span { padding: 4px 9px; background: rgba(255,255,255,.07); border: 1px solid var(--line); font-size: 13px; }
.br-brief .stars { color: var(--amber); font-size: 26px; letter-spacing: .18em; }
.br-brief .tips { margin: 0; padding-left: 0; list-style: none; color: #C9D3DE; font-size: 14px; display: flex; flex-direction: column; gap: 3px; }
.br-brief .tips li::first-letter { color: var(--amber); }
.deb-res { font: 800 34px var(--display, inherit); letter-spacing: .08em; }
.deb-res.win { color: var(--good, #4ADE80); } .deb-res.lose { color: var(--danger, #FF5C5C); }
.deb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.deb-grid > div { padding: 10px; background: rgba(255,255,255,.06); border: 1px solid var(--line); display: flex; flex-direction: column; }
.deb-grid b { font: 800 24px var(--display, inherit); }
.deb-grid small { color: var(--muted); }
.br-brief .dim-note { font-size: 13px; color: var(--muted); margin-left: 6px; }
.br-brief .goal-grid.one { display: flex; flex-direction: column; gap: 8px; }
.br-brief .goal { padding: 10px 12px; background: rgba(255,255,255,.06); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.br-brief .goal.done { border-color: var(--good, #4ADE80); }
.br-brief .badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.br-brief .bdg { padding: 8px; background: rgba(255,255,255,.05); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; opacity: .6; }
.br-brief .bdg.got { opacity: 1; border-color: var(--amber); }
.br-brief .bdg small { color: var(--muted); font-size: 11px; }
.br-brief .bdg .medal { font-size: 20px; color: var(--amber); }
@media (max-width: 900px) {
  .screen.br { overflow-y: auto; }
  .br-wrap { flex: none; min-height: 100%; }
  .br-grid { display: flex; flex-direction: column; flex: none; }
  .br-board, .br-side { grid-column: auto; }
  .br-board { max-height: 300px; }
  .br-shade { background: rgba(5,7,10,.55); position: fixed; }
  .br-bg { position: fixed; }
  .br-title { order: 3; flex-basis: 100%; }
}
@media (max-height: 520px) and (orientation: landscape) and (min-width: 901px) { .br-title .eyebrow { display: none; } .br-wrap { padding: 8px 12px; gap: 8px; } }

/* Portrait phones: battles ask for landscape, everything else fits the narrow screen */
.rotate-hint { display: none; }
/* Include the safety caption without making armor overlap Classic steering. */
.battle-hud .hp-plate.battle-safety-plate { padding: 6px 12px; gap: 3px; }
@media (max-width: 760px) {
  .battle-hud .hp-plate.battle-safety-plate { padding: 4px 10px; }
}
.battle-hud[data-control-mode="easy"] .rotate-hint { display: none; }
@media (max-width: 760px) and (orientation: portrait) {
  /* Keep the free-practice/armor label unobscured; radar stays on the right. */
  .battle-hud .battle-control-toggle {
    top: 132px; left: 12px; right: auto;
    max-width: calc(100vw - 150px); font-size: 11px; padding: 6px 10px;
  }
}
@media (orientation: portrait) and (max-width: 700px) and (pointer: coarse) {
  .rotate-hint { display: flex; flex-direction: column; align-items: center; gap: 4px; position: absolute; left: 12px; right: 12px; top: 64px; padding: 10px 14px; text-align: center; background: rgba(8,12,18,.92); border: 1px solid var(--amber); pointer-events: none; z-index: 5; animation: hintOut 1s 6s forwards; }
  .rotate-hint b { color: var(--amber); font: 800 16px var(--display, inherit); letter-spacing: .06em; text-transform: uppercase; }
  .rotate-hint span { color: #C9D3DE; font-size: 13px; }
}
@keyframes hintOut { to { opacity: 0; visibility: hidden; } }
@media (max-width: 720px) {
  .home-card > img.hicon { grid-row: 1 / span 3; grid-column: 1; width: 56px; height: 56px; justify-self: center; }
  .home-card > b, .home-card > em, .home-card > .pass-badge { grid-column: 2; }
  .home-card > em { text-align: left; }
}

/* Storybook pictures: show them large, at their 3:2 shape, with rounded corners like a picture book */
img.page-art.page-pic { height: auto; aspect-ratio: 3 / 2; max-height: min(46vh, 440px); width: 100%; object-fit: cover; border-radius: 14px; border: 0; box-shadow: 0 6px 20px rgba(20, 30, 50, .18); }
@media (max-width: 600px) { img.page-art.page-pic { max-height: 34vh; border-radius: 10px; } }

/* Home background in the pilot's clan colors */
body[data-clan="deepstrike"] .title-bg.home-bg { background-image: url('../assets/home-deepstrike.jpg'); }
body[data-clan="voltcoil"] .title-bg.home-bg { background-image: url('../assets/home-voltcoil.jpg'); }
body[data-clan="steelclaw"] .title-bg.home-bg { background-image: url('../assets/home-steelclaw.jpg'); }
body[data-clan="stormwing"] .title-bg.home-bg { background-image: url('../assets/home-stormwing.jpg'); }
body[data-clan="frostfang"] .title-bg.home-bg { background-image: url('../assets/home-frostfang.jpg'); }
body[data-clan="ironmane"] .title-bg.home-bg { background-image: url('../assets/home-ironmane.jpg'); }

/* Voice tune-up */
.tune { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; max-width: 640px; }
.tune h3 { margin: 0; font-size: 24px; }
.tune .lead { margin: 0; font-size: 17px; line-height: 1.45; }
.tune .note { margin: 0; color: var(--muted); }
.tune-text { font: 700 clamp(24px, 4vw, 34px)/1.35 var(--body, inherit); padding: 14px 18px; border-radius: 12px; background: rgba(255,255,255,.7); border: 1px solid var(--line); }
.tune-text.big { font-size: clamp(36px, 7vw, 56px); letter-spacing: .02em; }
.tune-meter { width: 100%; max-width: 420px; height: 12px; border-radius: 6px; background: rgba(0,0,0,.08); overflow: hidden; }
.tune-meter i { display: block; height: 100%; width: 0; background: var(--amber, #F2B233); transition: width .08s linear; }
.plate.act.tune-new { box-shadow: 0 0 0 2px var(--amber, #F2B233) inset; }
img.book-pic { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }

/* The word the child is on pulses while the computer is hearing/checking it */
.page-text .w.hearing { box-shadow: 0 0 0 3px rgba(63, 209, 106, .55); animation: hearPulse 1s ease-in-out infinite; }
@keyframes hearPulse { 50% { box-shadow: 0 0 0 6px rgba(63, 209, 106, .2); } }

/* Keep story navigation and reading controls in view; only the text area can scroll for unusually long pages. */
.screen:has(.learn-body > .page-text) { overflow: hidden; }
.learn:has(.learn-body > .page-text) {
  width: min(1180px, 100%);
  height: 100%;
  max-height: 100%;
  min-height: 0;
}
.learn:has(.learn-body > .page-text) .learn-head { flex: 0 0 auto; }
.learn-body:has(> .page-text) {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  gap: clamp(6px, 1.2vh, 12px);
  padding: clamp(10px, 2vh, 20px) clamp(14px, 2.5vw, 30px);
}
.learn-body:has(> .page-text) > .row:first-child,
.learn-body:has(> .page-text) > .heard,
.learn-body:has(> .page-text) > .mic-row,
.learn-body:has(> .page-text) > .row:last-child { flex: 0 0 auto; }
.learn-body:has(> .page-text) > .page-art {
  flex: 0 1 auto;
  height: clamp(64px, 19vh, 190px);
  max-height: 22vh;
  min-height: 0;
  object-fit: cover;
}
.learn-body:has(> .page-text) > img.page-art.page-pic {
  height: auto;
  max-height: clamp(64px, 19vh, 190px);
}
.learn-body:has(> .page-text) > .page-text {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: safe center;
  gap: 2px clamp(6px, 1vw, 14px);
  padding: 4px 2px;
  font-size: clamp(20px, 2.5vw, 32px);
  line-height: 1.2;
}
.learn-body:has(> .page-text) > .coach:not([hidden]) {
  flex: 0 0 auto;
  max-height: 16vh;
  overflow: auto;
  margin: 0;
}
.learn-body:has(> .page-text) > .mic-row { gap: 8px; min-width: 0; }
.learn-body:has(> .page-text) .mic-status { min-width: 0; }
.learn-body:has(> .page-text) > .row:last-child { align-items: center; gap: 10px; min-width: 0; }
.learn-body:has(> .page-text) > .row:last-child > span {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 68ch;
  font-size: clamp(11px, 1.2vw, 14px) !important;
  line-height: 1.3;
}
.learn-body:has(> .page-text) > .row:last-child > button { flex: 0 0 auto; }

@media (max-width: 760px) {
  .learn:has(.learn-body > .page-text) .learn-head { gap: 8px; padding: 8px 10px; }
  .learn:has(.learn-body > .page-text) .learn-head h2 { font-size: 18px; }
  .learn:has(.learn-body > .page-text) .learn-head .room-tag,
  .learn:has(.learn-body > .page-text) .learn-head > div:first-child > .eyebrow:not(.room-tag) { display: none; }
  .learn:has(.learn-body > .page-text) .learn-head > .row { gap: 6px !important; }
  .learn:has(.learn-body > .page-text) .learn-head .earned { font-size: 11px; }
  .learn:has(.learn-body > .page-text) .learn-head .credits { padding: 4px 8px !important; }
  .learn:has(.learn-body > .page-text) .learn-head .icon-btn { width: 40px; height: 40px; min-height: 40px; }
  .learn-body:has(> .page-text) { gap: 6px; padding: 8px 10px; }
  .learn-body:has(> .page-text) > .page-art {
    height: clamp(52px, 9vh, 80px);
    max-height: 9vh;
  }
  .learn-body:has(> .page-text) > img.page-art.page-pic { max-height: clamp(52px, 9vh, 80px); }
  .learn-body:has(> .page-text) > .page-text { font-size: clamp(16px, 4.35vw, 19px); line-height: 1.14; }
  .learn-body:has(> .page-text) .mic { width: 60px; height: 60px; }
  .learn-body:has(> .page-text) .mic-status { font-size: 12px; max-width: 24ch; }
  .learn-body:has(> .page-text) > .mic-row .btn { min-height: 40px; padding: 6px 10px; font-size: 12px; letter-spacing: .06em; }
  .learn-body:has(> .page-text) > .row:last-child { gap: 6px; }
  .learn-body:has(> .page-text) > .row:last-child > button { min-height: 44px; padding: 8px 12px; }
}

@media (max-height: 620px) {
  .learn-body:has(> .page-text) { gap: 4px; padding-block: 6px; }
  .learn-body:has(> .page-text) > .page-art,
  .learn-body:has(> .page-text) > img.page-art.page-pic { display: none; }
  .learn:has(.learn-body > .page-text) .learn-head { padding-block: 5px; }
  .learn:has(.learn-body > .page-text) .learn-head h2 { font-size: 16px; }
  .learn-body:has(> .page-text) > .page-text { font-size: clamp(12px, 2.4vh, 15px); line-height: 1.08; }
  .learn-body:has(> .page-text) .mic { width: 50px; height: 50px; }
  .learn-body:has(> .page-text) > .row:last-child > span { display: none; }
}

/* Secondary reading answer layouts: specific selectors intentionally outrank
   the generic .choices/.choice math-drill rules above. */
.secondary-reader-body:has(.secondary-quiz) {
  display: block;
  min-height: 0;
  overflow: auto;
}
.secondary-reader-body:has(.secondary-quiz) .secondary-quiz,
.learn-body .secondary-placement-quiz {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  width: 100%;
  max-width: 900px;
  min-width: 0;
  margin: 0 auto;
  text-align: left;
  font-size: 18px;
  line-height: 1.5;
}
.secondary-reader-body:has(.secondary-quiz) .secondary-quiz > h2,
.learn-body .secondary-placement-quiz > h2 {
  font-size: clamp(19px, 2vw, 26px);
  line-height: 1.35;
  margin: 12px 0;
}
.secondary-reader-body:has(.secondary-quiz) .secondary-quiz-progress,
.learn-body .secondary-placement-progress {
  width: 100%;
  padding: 8px 10px;
  background: var(--panel-solid, #0E141C);
  border-bottom: 1px solid var(--line);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.secondary-quiz-context {
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--line);
}
.secondary-reader-body:has(.secondary-quiz) .secondary-choice-grid,
.learn-body .secondary-placement-quiz .secondary-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  gap: 12px;
  margin: 18px 0;
}
.secondary-reader-body:has(.secondary-quiz) .secondary-choice-grid > .choice,
.learn-body .secondary-placement-quiz .secondary-choice-grid > .choice {
  width: 100%;
  min-width: 0;
  min-height: 84px;
  padding: 14px 18px;
  font: 500 18px/1.45 var(--body);
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
}
.secondary-reader-body:has(.secondary-quiz) .secondary-choice-grid.has-long-answer,
.learn-body .secondary-placement-quiz .secondary-choice-grid.has-long-answer {
  grid-template-columns: minmax(0, 1fr);
}
.secondary-reader-body:has(.secondary-quiz) .secondary-choice-grid > .choice.long-answer,
.learn-body .secondary-placement-quiz .secondary-choice-grid > .choice.long-answer {
  text-align: left;
  padding: 16px 20px;
}
.secondary-reader-body:has(.secondary-quiz) .secondary-choice-grid.has-long-answer > .choice,
.learn-body .secondary-placement-quiz .secondary-choice-grid.has-long-answer > .choice {
  text-align: left;
  padding: 16px 20px;
}
.secondary-reader-body:has(.secondary-quiz) .secondary-review,
.learn-body .secondary-placement-quiz .secondary-review {
  width: 100%;
  min-width: 0;
  margin: 4px 0;
}
.secondary-reader-body:has(.secondary-quiz) .secondary-review > summary,
.learn-body .secondary-placement-quiz .secondary-review > summary {
  min-height: 44px;
  display: list-item;
  list-style-position: inside;
  padding: 8px 12px;
  border: 1px solid var(--line);
  cursor: pointer;
}
.secondary-reader-body:has(.secondary-quiz) .secondary-review-text,
.learn-body .secondary-placement-quiz .secondary-review-text {
  max-height: min(28vh, 220px);
  overflow: auto;
  white-space: pre-line;
  padding: 8px 12px;
  border-left: 2px solid var(--cyan);
}
.secondary-review-text p { text-align: left; }
.secondary-reader-body:has(.secondary-quiz) .secondary-quiz #secondary-feedback,
.learn-body .secondary-placement-quiz #secondary-feedback { width: 100%; }

/* Algebra expressions retain parenthetical groups on one line. The helper
   reduces type size against the actual available tile width. */
.learn-body .math-choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.learn-body .math-choice-grid > .math-expression-choice {
  min-width: 0;
  padding: 12px 10px;
  font-size: 26px;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}
.learn-body .math-word-choice-grid {
  grid-template-columns: minmax(0, 1fr);
}
.learn-body .math-word-choice-grid > .choice:not(.math-expression-choice) {
  font: 500 18px/1.45 var(--body);
  white-space: normal;
  text-align: left;
  padding: 14px 18px;
}
@media (max-width: 600px) {
  .secondary-reader-body:has(.secondary-quiz) .secondary-quiz > h2,
  .learn-body .secondary-placement-quiz > h2 { margin: 8px 0; }
  .secondary-reader-body:has(.secondary-quiz) .secondary-choice-grid,
  .learn-body .secondary-placement-quiz .secondary-choice-grid { margin: 12px 0; gap: 10px; }
  .learn:has(.secondary-reader-body) .learn-head,
  .learn:has(.secondary-placement-quiz) .learn-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .learn:has(.secondary-reader-body) .learn-head h2,
  .learn:has(.secondary-placement-quiz) .learn-head h2 {
    font-size: 20px;
    line-height: 1.25;
    letter-spacing: .02em;
  }
  .learn:has(.secondary-reader-body) .learn-head > div:first-child > .eyebrow:not(.room-tag),
  .learn:has(.secondary-placement-quiz) .learn-head > div:first-child > .eyebrow:not(.room-tag) {
    font-size: 11px;
    letter-spacing: .03em;
    line-height: 1.4;
  }
  .learn-body .math-word-choice-grid > .choice:not(.math-expression-choice) { font-size: 16px; }
  .secondary-reader-body:has(.secondary-quiz) .secondary-choice-grid > .choice,
  .learn-body .secondary-placement-quiz .secondary-choice-grid > .choice {
    font-size: 16px;
    min-height: 64px;
    padding: 12px 14px;
  }
  .secondary-reader-body:has(.secondary-quiz) .secondary-choice-grid.has-long-answer > .choice,
  .learn-body .secondary-placement-quiz .secondary-choice-grid.has-long-answer > .choice {
    font-size: 16px;
    padding: 12px 16px;
  }
}
@media (max-width: 420px) {
  .learn-body .math-choice-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Home Squad Battle card: inherit the active clan palette and existing plate-card treatment. */
.home-grid:has(> #h-coop) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-card.home-squad-card {
  position: relative;
  border-color: color-mix(in srgb, var(--line) 76%, var(--amber));
  background-image: linear-gradient(150deg, color-mix(in srgb, var(--amber) 11%, transparent), transparent 64%);
}
.home-card.home-squad-card:hover,
.home-card.home-squad-card:focus-visible {
  border-color: var(--amber-hot, var(--amber));
}
.home-card.home-squad-card:focus-visible { outline: 2px solid var(--amber-hot, var(--amber)); outline-offset: 3px; }
.home-card.home-squad-card:disabled { cursor: default; opacity: .72; transform: none; }
.home-card.home-squad-card:disabled:hover { border-color: var(--line); }
.home-squad-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
}
.home-squad-art > img.hicon {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .55));
  transition: transform .15s, filter .15s;
}
.home-card.home-squad-card:hover .home-squad-art > img.hicon,
.home-card.home-squad-card:focus-visible .home-squad-art > img.hicon { transform: translateY(-3px) scale(1.04); }
.home-card.home-squad-card[data-state="locked"] .home-squad-art > img.hicon,
.home-card.home-squad-card[data-state="unavailable"] .home-squad-art > img.hicon {
  filter: grayscale(.75) brightness(.55) drop-shadow(0 4px 8px rgba(0, 0, 0, .45));
}
.home-squad-art-lock {
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid color-mix(in srgb, var(--amber) 65%, var(--line));
  border-radius: 50%;
  color: var(--amber-hot, var(--amber));
  background: var(--panel-solid);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .55);
}
.home-squad-art-lock[hidden] { display: none; }
.home-squad-art-lock svg { width: 14px; height: 14px; }
.home-card.home-squad-card b { color: var(--amber-hot, var(--amber)); }
.home-card.home-squad-card em { color: var(--muted, #9aa7b6); }
.home-squad-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 22px;
  color: var(--amber-hot, var(--amber));
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .025em;
}
.home-squad-status[hidden] { display: none; }
.home-squad-lock { display: inline-flex; }
.home-squad-lock[hidden] { display: none; }
.home-squad-lock svg { width: 14px; height: 14px; }
.home-squad-badge {
  display: inline-block;
  max-width: 100%;
  margin-top: 2px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--amber-hot, var(--amber));
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.home-squad-badge[hidden] { display: none; }

@media (min-width: 721px) {
  .home-grid:has(> #h-coop) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .screen:has(.home-grid > #h-coop) .home-card { min-height: clamp(128px, 17vh, 170px); }
}
@media (max-width: 720px) {
  .home-grid:has(> #h-coop) { grid-template-columns: 1fr; }
  .home-card.home-squad-card .home-squad-art { grid-row: 1 / span 3; grid-column: 1; width: 56px; height: 56px; justify-self: center; }
  .home-squad-art > img.hicon { width: 56px; height: 56px; }
  .home-card.home-squad-card > b,
  .home-card.home-squad-card > em,
  .home-card.home-squad-card > .home-squad-status,
  .home-card.home-squad-card > .home-squad-badge { grid-column: 2; }
  .home-card.home-squad-card > em { text-align: left; }
  .home-squad-crest { width: 22px; height: 22px; right: -2px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .home-grid:has(> #h-coop) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .screen:has(.home-grid > #h-coop) .home-card { min-height: 0; padding: 8px 7px; gap: 3px; }
  .screen:has(.home-grid > #h-coop) .home-card > img.hicon { width: 42px; height: 42px; }
  .screen:has(.home-grid > #h-coop) .home-squad-art > img.hicon { width: 42px; height: 42px; }
  .screen:has(.home-grid > #h-coop) .home-card > b { font-size: 14px; }
  .screen:has(.home-grid > #h-coop) .home-squad-card em { display: block; max-width: none; font-size: 10px; line-height: 1.15; text-align: center; }
  .screen:has(.home-grid > #h-coop) .home-squad-art { width: 42px; height: 42px; }
  .screen:has(.home-grid > #h-coop) .home-card.home-squad-card b { font-size: 13px; }
  .screen:has(.home-grid > #h-coop) .home-squad-status { min-height: 14px; gap: 3px; font-size: 9px; }
  .screen:has(.home-grid > #h-coop) .home-squad-lock svg { width: 11px; height: 11px; }
  .screen:has(.home-grid > #h-coop) .home-squad-badge { padding: 2px 5px; font-size: 9px; }
}
@media (max-height: 520px) and (orientation: landscape) and (max-width: 720px) {
  .screen:has(.home-grid > #h-coop) .home-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
  .screen:has(.home-grid > #h-coop) .home-card > img.hicon { width: 36px; height: 36px; }
  .screen:has(.home-grid > #h-coop) .home-squad-art > img.hicon { width: 36px; height: 36px; }
  .home-card.home-squad-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
  .home-card.home-squad-card .home-squad-art { width: 36px; height: 36px; }
  .home-squad-art-lock { width: 18px; height: 18px; right: 0; bottom: 0; }
  .home-squad-art-lock svg { width: 11px; height: 11px; }
  .home-card.home-squad-card > em,
  .home-card.home-squad-card > .home-squad-status,
  .home-card.home-squad-card > .home-squad-badge { text-align: center; }
}
