:root {
  --navy: #16213A; --navy2: #0e1626; --red: #C8102E; --gold: #E0A526; --teal: #2FB59A;
  --ice: #F2F6F8; --shadow: #2A3142; --white: #fff;
  --disp: "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: "Barlow", system-ui, sans-serif;
  --u: min(1vw, 1.6vh);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1220; color: #fff; font-family: var(--text); user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
kbd { font-family: var(--disp); font-weight: 700; font-size: 0.8em; padding: 0.05em 0.4em; border-radius: 3px; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.35); margin: 0 0.15em; }

/* ---------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud-crest { position: absolute; left: max(10px, env(safe-area-inset-left)); top: 8px; width: clamp(96px, 15vw, 210px); filter: drop-shadow(0 3px 6px rgba(0,0,0,0.45)); }
#scorebug { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; height: clamp(30px, 4.6vh, 40px); font-family: var(--disp); font-weight: 700; letter-spacing: 0.04em; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.4)); }
#scorebug > div { display: flex; align-items: center; padding: 0 clamp(8px, 1.2vw, 16px); }
.sb-team { background: var(--navy); border-top: 3px solid var(--gold); font-size: clamp(14px, 2vh, 19px); clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%); padding-left: 18px !important; white-space: nowrap; }
.sb-mid { background: var(--red); font-size: clamp(12px, 1.7vh, 15px); }
#fade { position: fixed; inset: 0; background: #0d1220; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 4; }
#fade.on { opacity: 1; }
.sb-team { --tc: var(--gold); }
#scorebug .sb-team { border-top-color: var(--tc); }
.sb-team.away { clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); padding-left: 14px !important; padding-right: 18px !important; }
.sb-team .abbr { display: none; }
.sb-score { background: rgba(14,22,38,0.94); font-size: clamp(18px, 2.6vh, 24px); font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2.1em; justify-content: center; }
.sb-mid { gap: 8px; }
.sb-mid b { font-variant-numeric: tabular-nums; font-size: clamp(14px, 2vh, 18px); }
#faceoff { position: absolute; left: 50%; top: max(24%, 116px); transform: translateX(-50%); width: min(400px, 74vw); background: rgba(14,22,38,0.8); border-top: 4px solid var(--gold); padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 6px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); }
.fo-title { font-family: var(--disp); font-style: italic; font-weight: 900; font-size: clamp(24px, 4.4vh, 40px); letter-spacing: 0.05em; text-align: center; }
#faceoff.go .fo-title { color: var(--gold); animation: foPulse .5s ease-in-out infinite alternate; }
@keyframes foPulse { from { transform: scale(1); } to { transform: scale(1.08); } }
.fo-row { display: grid; grid-template-columns: minmax(0, 9em) 1fr 2.2em; align-items: center; gap: 10px; font-family: var(--disp); font-weight: 700; letter-spacing: 0.04em; }
.fo-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.fo-bar { height: 12px; background: rgba(255,255,255,0.12); }
.fo-bar i { display: block; height: 100%; background: var(--gold); transform-origin: left; transform: scaleX(0); transition: transform .08s; }
.fo-row.them .fo-bar i { background: var(--red); }
.fo-row b { font-size: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.fo-row b.pop { animation: tapPop .15s ease-out; }
@keyframes tapPop { from { transform: scale(1.5); color: var(--gold); } to { transform: scale(1); } }
.sb-stat { background: rgba(14,22,38,0.92); gap: 6px; font-size: clamp(11px, 1.5vh, 13px); color: #b8c3d6; }
.sb-stat b { color: #fff; font-size: clamp(16px, 2.3vh, 21px); font-variant-numeric: tabular-nums; min-width: 1.1em; text-align: center; }
.sb-stat:last-child { clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); padding-right: 20px !important; }
#hud-right { position: absolute; right: max(10px, env(safe-area-inset-right)); top: 10px; display: flex; gap: 8px; pointer-events: auto; }
.hud-btn { width: 40px; height: 40px; background: rgba(14,22,38,0.85); border: 2px solid rgba(255,255,255,0.75); border-radius: 50%; font-family: var(--disp); font-weight: 800; font-size: 22px; display: grid; place-items: center; }
.pause-ico { width: 12px; height: 14px; border-left: 4px solid #fff; border-right: 4px solid #fff; }
#coach { position: absolute; left: 0; right: 0; margin: 0 auto; width: fit-content; top: clamp(54px, 9vh, 70px); display: flex; align-items: stretch; max-width: min(620px, 60vw); opacity: 0; transition: none; }
#coach.show { animation: wipeIn 0.35s cubic-bezier(.2,.8,.2,1) forwards; }
#coach.hide { animation: wipeOut 0.3s ease-in forwards; }
.coach-tag { background: var(--gold); color: var(--navy); font-family: var(--disp); font-weight: 800; font-size: 15px; letter-spacing: 0.08em; padding: 8px 12px; display: flex; align-items: center; clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%); }
  .coach-text { flex: 1 1 auto; min-width: 0; background: rgba(14,22,38,0.94); border-bottom: 2px solid var(--gold); padding: 8px 22px 8px 12px; font-weight: 600; font-size: clamp(14px, 2.1vh, 18px); line-height: 1.25; overflow-wrap: break-word; }
@keyframes wipeIn { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes wipeOut { from { opacity: 1; clip-path: inset(0 0 0 0); } to { opacity: 0; clip-path: inset(0 0 0 100%); } }
#callout { position: absolute; left: 0; right: 0; top: 30%; display: flex; flex-direction: column; align-items: center; opacity: 0; }
#callout.show { animation: calloutIn 2.1s cubic-bezier(.2,.8,.2,1) forwards; }
.callout-bar { background: var(--red); padding: 4px 60px; clip-path: polygon(24px 0, 100% 0, calc(100% - 24px) 100%, 0 100%); border-top: 4px solid #fff; }
.callout-bar span { font-family: var(--disp); font-style: italic; font-weight: 900; font-size: clamp(54px, 12vh, 110px); letter-spacing: 0.04em; line-height: 1.05; display: block; }
.callout-sub { margin-top: 6px; background: var(--navy); padding: 6px 22px; font-family: var(--disp); font-weight: 700; font-size: clamp(16px, 2.6vh, 22px); letter-spacing: 0.06em; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.callout-sub:empty { display: none; }
@keyframes calloutIn { 0% { opacity: 0; transform: translateX(-30vw) skewX(-12deg); } 14% { opacity: 1; transform: none; } 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(30vw) skewX(-12deg); } }
#sprint-meter { position: absolute; width: 64px; height: 6px; background: rgba(14,22,38,0.7); border: 1px solid rgba(255,255,255,0.6); border-radius: 3px; left: -100px; top: -100px; overflow: hidden; opacity: 0; transition: opacity .25s; }
#sprint-meter i { display: block; height: 100%; width: 100%; background: #fff; transform-origin: left; }
#sprint-meter.on { opacity: 1; }
#sprint-meter.low i { background: var(--red); }

/* ---------- touch controls */
#controls { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
#stick-zone { position: absolute; left: 0; top: 70px; bottom: 0; width: 50%; pointer-events: auto; }
#stick { position: absolute; width: calc(var(--s) * 1px); height: calc(var(--s) * 1px); --s: 150; left: 40px; bottom: 30px; pointer-events: none; opacity: 0.55; transition: opacity .2s; }
#stick.active { opacity: 1; transition: none; }
#stick-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(255,255,255,0.85); background: radial-gradient(circle, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.22) 70%, rgba(255,255,255,0.05) 100%); box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
#stick-ring::before, #stick-ring::after { content: ""; position: absolute; left: 50%; top: 8%; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 10px solid rgba(255,255,255,0.85); transform: translateX(-50%); }
#stick-ring::after { top: auto; bottom: 8%; border-bottom: 0; border-top: 10px solid rgba(255,255,255,0.85); }
#stick-knob { position: absolute; left: 50%; top: 50%; width: 44%; height: 44%; margin: -22% 0 0 -22%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #2c3b60, var(--navy) 60%, #0b1120); border: 3px solid #fff; box-shadow: 0 5px 12px rgba(0,0,0,0.45); }
#buttons { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; }
.act { position: absolute; pointer-events: auto; width: calc(var(--d) * 1px); height: calc(var(--d) * 1px); border-radius: 50%; touch-action: none; transition: transform .06s, filter .15s, opacity .15s; }
.act img { width: 100%; height: 100%; display: block; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4)); }
.act .lbl { position: absolute; left: 0; right: 0; bottom: 17%; text-align: center; font-family: var(--disp); font-weight: 800; font-size: calc(var(--d) * 0.15px); letter-spacing: 0.05em; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.6); pointer-events: none; }
.act kbd { position: absolute; top: -4px; right: -2px; font-size: 11px; background: rgba(14,22,38,0.9); pointer-events: none; display: none; }
body.keys .act kbd { display: block; }
.act.off { opacity: 0.5; filter: grayscale(0.85) brightness(0.8); }
.act.down { transform: scale(0.9); filter: brightness(1.15); }
.act.glow img { filter: drop-shadow(0 0 10px rgba(47,181,154,0.95)) drop-shadow(0 0 22px rgba(47,181,154,0.6)); }
.act.glow { animation: none; }
.act.live img { filter: drop-shadow(0 0 8px rgba(255,255,255,0.35)) drop-shadow(0 4px 6px rgba(0,0,0,0.4)); }
.act .lbl { transform: translateY(0); }
.act[data-act="grab"] .lbl, .act[data-act="slap"] .lbl, .act[data-act="power"] .lbl, .act[data-act="sprint"] .lbl, .act[data-act="switch"] .lbl, .act[data-act="pass"] .lbl { bottom: 12%; }
.act.aiming img { filter: drop-shadow(0 0 10px rgba(255,255,255,0.9)) drop-shadow(0 4px 6px rgba(0,0,0,0.4)); }

/* ---------- menus */
#menus { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.screen { position: absolute; inset: 0; pointer-events: auto; display: flex; flex-direction: column; background: linear-gradient(160deg, rgba(14,22,38,0.92), rgba(22,33,58,0.86) 55%, rgba(14,22,38,0.94)); overflow: hidden; animation: screenIn .35s cubic-bezier(.2,.8,.2,1); }
.screen.overlay { background: rgba(10,14,24,0.72); align-items: center; justify-content: center; }
@keyframes screenIn { from { opacity: 0; transform: translateX(-3vw); } to { opacity: 1; transform: none; } }
#scr-title { background: linear-gradient(180deg, rgba(10,14,24,0.25), rgba(10,14,24,0.55) 60%, rgba(10,14,24,0.85)); align-items: center; justify-content: center; }
.title-wrap { display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 2vh, 18px); padding: 16px; }
.title-crest { width: min(62vw, 46vh * 1.77, 560px); filter: drop-shadow(0 10px 24px rgba(0,0,0,0.55)); animation: crestIn .6s cubic-bezier(.2,.8,.2,1); }
@keyframes crestIn { from { opacity: 0; transform: scale(0.9) translateY(10px); } to { opacity: 1; transform: none; } }
.title-sub { font-family: var(--disp); font-weight: 700; font-style: italic; letter-spacing: 0.3em; font-size: clamp(14px, 2.4vh, 20px); color: var(--gold); background: rgba(14,22,38,0.8); padding: 4px 18px; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.menu-col { display: flex; flex-direction: column; gap: 10px; width: min(340px, 80vw); }
.mbtn { font-family: var(--disp); font-weight: 800; font-size: clamp(18px, 3vh, 26px); letter-spacing: 0.08em; padding: clamp(8px, 1.5vh, 13px) 22px; background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.8); clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); transition: transform .08s, background .15s; display: flex; align-items: center; justify-content: center; gap: 10px; }
.mbtn small { font-size: 0.5em; opacity: 0.7; letter-spacing: 0.05em; }
.mbtn:hover { background: rgba(255,255,255,0.2); }
.mbtn:active { transform: scale(0.97); }
.mbtn.primary { background: var(--red); border-color: var(--red); }
.mbtn.primary:hover { background: #dd1736; }
.mbtn.ghost { border-color: rgba(255,255,255,0.35); background: transparent; }
.mbtn:disabled { opacity: 0.4; }
.who { font-size: 13px; color: #b8c3d6; min-height: 1em; }
.bar { display: flex; align-items: center; gap: 12px; padding: 10px max(14px, env(safe-area-inset-left)); background: var(--navy2); border-bottom: 3px solid var(--red); flex: none; }
.bar h2 { margin: 0; font-family: var(--disp); font-style: italic; font-weight: 900; font-size: clamp(22px, 4vh, 34px); letter-spacing: 0.05em; }
.bar-fill { flex: 1; height: 6px; background: repeating-linear-gradient(115deg, var(--gold) 0 10px, transparent 10px 18px); opacity: 0.5; }
.back { font-family: var(--disp); font-weight: 800; letter-spacing: 0.08em; padding: 6px 14px 6px 18px; background: rgba(255,255,255,0.12); clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 50%); font-size: 16px; }
.team-grid { flex: 1; min-height: 0; grid-auto-rows: max-content; overflow-y: auto; touch-action: pan-y; padding: 14px max(14px, env(safe-area-inset-left)) 110px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; align-content: start; }
.tcard { position: relative; text-align: left; background: rgba(14,22,38,0.92); border: 2px solid rgba(255,255,255,0.12); padding: 0 0 10px; overflow: hidden; transition: transform .1s, border-color .15s; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%); }
.tcard:hover { border-color: rgba(255,255,255,0.4); }
.tcard.sel { border-color: #fff; transform: translateY(-2px); box-shadow: 0 0 0 2px var(--gold) inset; }
.tc-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--c1); border-bottom: 4px solid var(--c2); }
.tc-name { font-family: var(--disp); font-weight: 900; font-style: italic; font-size: 24px; letter-spacing: 0.03em; line-height: 1; color: var(--ct); text-shadow: 0 1px 0 rgba(0,0,0,0.25); }
.tc-city { font-family: var(--disp); font-weight: 600; font-size: 12px; letter-spacing: 0.12em; opacity: 0.85; color: var(--ct); }
.tc-roster { display: flex; gap: 3px; padding: 8px 10px 4px; }
.tc-roster img { width: 34px; height: 34px; border-radius: 50%; background: #c9ced6; object-fit: cover; border: 2px solid rgba(255,255,255,0.4); }
.tc-stats { padding: 2px 10px; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; font-size: 11px; font-weight: 600; color: #b8c3d6; letter-spacing: 0.04em; }
.statbar { height: 6px; background: rgba(255,255,255,0.12); position: relative; }
.statbar i { position: absolute; left: 0; top: 0; bottom: 0; background: #fff; }
.statbar i.hi { background: var(--gold); }
.statbar i.lo { background: #8892a6; }
.tc-sw { padding: 6px 10px 0; font-size: 12.5px; line-height: 1.35; }
.tc-sw b { font-family: var(--disp); letter-spacing: 0.08em; font-weight: 800; margin-right: 4px; }
.tc-sw .s b { color: var(--teal); } .tc-sw .w b { color: #ff6b7f; }
.tcard.build { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 200px; border-style: dashed; border-color: rgba(255,255,255,0.4); }
.tcard.build .plus { font-family: var(--disp); font-size: 56px; font-weight: 300; line-height: 1; }
.tcard.build .t { font-family: var(--disp); font-weight: 800; letter-spacing: 0.1em; font-size: 20px; }
.pickbar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 14px; padding: 10px max(14px, env(safe-area-inset-left)); background: var(--navy2); border-top: 3px solid var(--gold); transform: translateY(110%); transition: transform .3s cubic-bezier(.2,.8,.2,1); flex-wrap: wrap; }
.pickbar.show { transform: none; }
.pick-info { min-width: 120px; }
.pick-name { font-family: var(--disp); font-weight: 900; font-style: italic; font-size: 24px; line-height: 1; }
.pick-hint { font-size: 11px; letter-spacing: 0.1em; color: #b8c3d6; font-weight: 700; }
.pick-roster { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
.pr { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border: 2px solid transparent; min-width: 64px; }
.pr img { width: 44px; height: 44px; border-radius: 50%; background: #c9ced6; object-fit: cover; }
.pr span { font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap; }
.pr.sel { border-color: var(--gold); background: rgba(224,165,38,0.12); }
.build { flex: 1; display: flex; gap: 16px; padding: 14px max(14px, env(safe-area-inset-left)); overflow: hidden; min-height: 0; }
.build-left { width: min(380px, 44%); display: flex; flex-direction: column; gap: 10px; overflow-y: auto; touch-action: pan-y; }
.build-right { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-family: var(--disp); font-weight: 800; letter-spacing: 0.1em; font-size: 14px; color: var(--gold); }
.field input { font: 600 18px var(--text); padding: 8px 10px; background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.35); color: #fff; outline: none; user-select: text; -webkit-user-select: text; }
.field input:focus { border-color: #fff; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 40px; height: 30px; position: relative; border: 2px solid rgba(255,255,255,0.25); background: linear-gradient(135deg, var(--a) 0 55%, var(--b) 55% 78%, var(--c) 78%); }
.sw.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--gold); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.slot { display: flex; align-items: center; gap: 6px; padding: 5px; background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.15); text-align: left; }
.slot img { width: 34px; height: 34px; border-radius: 50%; background: #c9ced6; object-fit: cover; }
.slot .sl-t { font-size: 10px; letter-spacing: 0.1em; color: #b8c3d6; font-weight: 700; }
.slot .sl-n { font-family: var(--disp); font-weight: 700; font-size: 14px; line-height: 1.05; }
.slot.sel { border-color: var(--gold); background: rgba(224,165,38,0.14); }
.build-stats { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; align-items: center; font-size: 12px; font-weight: 700; color: #b8c3d6; }
.save-note { font-size: 13px; color: #b8c3d6; min-height: 1.2em; }
.breed-head { font-family: var(--disp); font-weight: 800; letter-spacing: 0.08em; font-size: 18px; margin-bottom: 8px; }
.breed-grid { flex: 1; overflow-y: auto; touch-action: pan-y; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; align-content: start; padding-bottom: 20px; }
.bcard { text-align: left; background: rgba(14,22,38,0.9); border: 2px solid rgba(255,255,255,0.15); padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.bcard.sel { border-color: var(--gold); }
.bc-top { display: flex; align-items: center; gap: 8px; }
.bc-top img { width: 46px; height: 46px; border-radius: 50%; background: #c9ced6; object-fit: cover; }
.bc-name { font-family: var(--disp); font-weight: 800; font-size: 18px; line-height: 1; }
.bc-blurb { font-size: 11.5px; color: #c9d1de; line-height: 1.3; }
.howto { flex: 1; overflow-y: auto; touch-action: pan-y; padding: 16px max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 8px; max-width: 900px; width: 100%; margin: 0 auto; }
.how-row { display: flex; gap: 14px; align-items: center; background: rgba(14,22,38,0.85); padding: 10px 14px; font-size: clamp(14px, 2.2vh, 17px); line-height: 1.35; }
.how-k { flex: none; width: 84px; font-family: var(--disp); font-weight: 900; font-style: italic; font-size: 22px; letter-spacing: 0.05em; border-left: 4px solid #fff; padding-left: 8px; }
.how-k.grab { border-color: var(--teal); } .how-k.pass { border-color: #9fd0ff; } .how-k.slap { border-color: var(--gold); } .how-k.power { border-color: var(--red); }
.pause-box { background: var(--navy2); border-top: 4px solid var(--red); padding: 22px 28px; display: flex; flex-direction: column; gap: 10px; min-width: min(320px, 86vw); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%); }
.pause-box h2 { margin: 0 0 6px; font-family: var(--disp); font-style: italic; font-weight: 900; font-size: 36px; letter-spacing: 0.05em; }
.sum-stats { display: flex; gap: 10px; }
.sum-stats div { flex: 1; background: rgba(255,255,255,0.07); padding: 8px; text-align: center; }
.sum-stats b { display: block; font-family: var(--disp); font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sum-stats span { font-size: 11px; letter-spacing: 0.1em; color: #b8c3d6; font-weight: 700; }
.sum-note { font-size: 15px; color: #dfe5ee; max-width: 320px; }
#loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.load-bar { width: 200px; height: 6px; background: rgba(255,255,255,0.15); }
.load-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.load-txt { font-family: var(--disp); font-weight: 800; letter-spacing: 0.2em; font-size: 14px; }

@media (max-width: 560px) {
  #hud-crest { width: 84px; }
  #scorebug { top: 58px; left: 12px; transform: none; height: 30px; }
  #scorebug .sb-team .full { display: none; }
  #scorebug .sb-team .abbr { display: inline; }
  #faceoff { top: 140px; }
  #coach { top: 98px; max-width: 92vw; }
  .coach-text { font-size: 14px; }
}
@media (max-width: 700px) {
  .build { flex-direction: column; overflow-y: auto; touch-action: pan-y; }
  .build-left { width: 100%; overflow: visible; }
  .build-right { min-height: 60vh; }
  .team-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  #scorebug .sb-stat span { display: none; }
}
@media (max-height: 460px) {
  .team-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
  .tc-stats { font-size: 10px; }
  .tc-sw { font-size: 11.5px; }
  .title-wrap { padding: 10px 16px max(28px, env(safe-area-inset-bottom)); gap: 7px; }
  .title-crest { width: min(62vw, 40vh * 1.77, 560px); }
  .menu-col { gap: 8px; }
}

.boot-note { display: none; font-family: var(--disp); font-weight: 800; letter-spacing: 0.2em; font-size: 14px; color: #b8c3d6; }
body.booting .menu-col { display: none; }
body.booting .boot-note { display: block; }

/* ---------- online */
.online { flex: 1; min-height: 0; overflow-y: auto; touch-action: pan-y; display: flex; flex-wrap: wrap; gap: 18px; padding: 16px max(16px, env(safe-area-inset-left)); align-content: flex-start; justify-content: center; }
.on-col { display: flex; flex-direction: column; gap: 12px; width: min(420px, 100%); }
.on-team { display: flex; align-items: center; gap: 10px; background: rgba(14,22,38,0.92); border-left: 6px solid var(--c1, var(--gold)); padding: 8px 10px; }
.on-team .ot-k { font-family: var(--disp); font-weight: 800; letter-spacing: 0.1em; font-size: 12px; color: var(--gold); }
.on-team .ot-n { font-family: var(--disp); font-weight: 900; font-style: italic; font-size: 22px; line-height: 1; }
.on-team .ot-t { flex: 1; min-width: 0; }
.on-team .mbtn { font-size: 15px; padding: 6px 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-family: var(--disp); font-weight: 800; font-size: clamp(16px, 2.6vh, 20px); letter-spacing: 0.06em; padding: 8px 14px; border: 2px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.06); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.chip.sel { border-color: var(--gold); background: rgba(224,165,38,0.18); color: #fff; }
.on-note { font-size: 13.5px; color: #c9d1de; line-height: 1.4; }
.on-msg { font-size: 14px; color: #ffd27a; min-height: 1.2em; line-height: 1.35; }
.lob-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lob-side { background: rgba(14,22,38,0.9); border-top: 4px solid var(--c1, var(--gold)); padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; }
.lob-side h3 { margin: 0 0 2px; font-family: var(--disp); font-weight: 900; font-style: italic; font-size: 18px; letter-spacing: 0.05em; }
.lob-seat { font-size: 14px; font-weight: 600; padding: 4px 8px; background: rgba(255,255,255,0.06); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lob-seat.open { color: #8892a6; font-style: italic; }
.lob-seat.me { background: rgba(224,165,38,0.2); }
.lob-link { display: flex; gap: 6px; }
.lob-link input { flex: 1; min-width: 0; font: 600 13px var(--text); padding: 6px 8px; background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.3); color: #fff; user-select: text; -webkit-user-select: text; }
.lob-link .mbtn { font-size: 15px; padding: 6px 14px; }
@media (max-height: 460px) {
  .title-crest { width: min(62vw, 32vh * 1.77, 560px); }
  .title-wrap { gap: 5px; padding-top: 6px; }
  .menu-col { gap: 6px; }
  .menu-col .mbtn { padding: 5px 22px; font-size: 17px; }
  .on-col { width: min(380px, 100%); gap: 9px; }
  .online { gap: 14px; padding-top: 10px; }
  .online .mbtn { padding: 7px 22px; font-size: 18px; }
}

/* ---------- pass target tag */
#pass-tag { position: absolute; left: -200px; top: -200px; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; opacity: 0; transition: opacity .12s; pointer-events: none; }
#pass-tag.on { opacity: 1; }
#pass-tag .pt-k { background: #fff; color: var(--navy); font-family: var(--disp); font-weight: 800; font-size: 11px; letter-spacing: 0.14em; padding: 1px 8px; clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
#pass-tag .pt-n { background: rgba(14,22,38,0.94); border-bottom: 2px solid #fff; font-family: var(--disp); font-weight: 800; font-size: clamp(14px, 2.2vh, 18px); letter-spacing: 0.05em; padding: 2px 10px; white-space: nowrap; }
#pass-tag::after { content: ""; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 8px solid #fff; margin-top: 1px; }

/* ---------- tutorial panel */
body.tut #scorebug { display: none; }
#tut { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: min(560px, 56vw); background: rgba(14,22,38,0.92); border-top: 4px solid var(--gold); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); pointer-events: auto; }
#tut.step { animation: wipeIn .35s cubic-bezier(.2,.8,.2,1); }
.tut-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px 0; font-family: var(--disp); font-weight: 800; letter-spacing: 0.08em; }
.tut-tag { background: var(--gold); color: var(--navy); font-size: 12px; padding: 1px 8px; clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.tut-step { font-size: 13px; color: #b8c3d6; font-variant-numeric: tabular-nums; }
.tut-name { font-style: italic; font-weight: 900; font-size: clamp(20px, 3.4vh, 28px); flex: 1; line-height: 1; }
.tut-skip { font-family: var(--disp); font-weight: 800; font-size: 13px; letter-spacing: 0.1em; padding: 4px 10px; border: 1px solid rgba(255,255,255,0.45); color: #dfe5ee; }
.tut-text { padding: 4px 12px 8px; font-weight: 600; font-size: clamp(14px, 2.2vh, 18px); line-height: 1.3; }
.tut-bar { height: 5px; background: rgba(255,255,255,0.12); margin: 0 12px 10px; }
.tut-bar i { display: block; height: 100%; width: 100%; background: var(--teal); transform-origin: left; transform: scaleX(0); transition: transform .15s; }
.tut-nice { position: absolute; right: 14px; bottom: 16px; font-family: var(--disp); font-style: italic; font-weight: 900; font-size: 22px; color: var(--teal); opacity: 0; }
.tut-nice.show { animation: niceIn 1.1s ease-out forwards; }
@keyframes niceIn { 0% { opacity: 0; transform: translateX(-12px); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
.act.tut-hl::after, #stick.tut-hl #stick-ring::before { content: ""; }
.act.tut-hl::after { position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--gold); animation: hlPulse 1s ease-in-out infinite; pointer-events: none; }
#stick.tut-hl { opacity: 1; }
#stick.tut-hl #stick-ring { animation: hlRing 1s ease-in-out infinite; }
@keyframes hlPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: 0.45; } }
@keyframes hlRing { 0%, 100% { box-shadow: 0 0 0 0 rgba(224,165,38,0.9); } 50% { box-shadow: 0 0 0 10px rgba(224,165,38,0); } }
.how-tut { align-self: center; margin-bottom: 4px; font-size: clamp(16px, 2.6vh, 22px); }
@media (max-width: 560px) {
  #tut { top: 96px; width: 94vw; }
}

/* ---------- landing */
#scr-landing { background: none; align-items: center; justify-content: center; animation: none; }
.land-dark { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(10,14,24,0.9), #03050a 75%); transition: opacity 1.6s ease-out; }
#scr-landing.struck .land-dark { opacity: 0.72; }
.land-flash { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, #ffffff, #dbe9ff 45%, #9fc3ff); opacity: 0; pointer-events: none; mix-blend-mode: screen; }
#scr-landing.struck .land-flash { animation: flash 1.1s ease-out forwards; }
@keyframes flash { 0% { opacity: 1; } 8% { opacity: 0.25; } 14% { opacity: 0.95; } 40% { opacity: 0.35; } 100% { opacity: 0; } }
.land-bolt { position: absolute; top: 0; height: 100%; width: auto; opacity: 0; mix-blend-mode: screen; pointer-events: none; }
.land-bolt.b1 { left: 50%; transform: translateX(-62%); }
.land-bolt.b2 { left: 50%; transform: translateX(-20%) scaleX(-1); height: 82%; }
#scr-landing.struck .land-bolt.b1 { animation: bolt .55s linear forwards; }
#scr-landing.struck .land-bolt.b2 { animation: bolt .45s linear .07s forwards; }
@keyframes bolt { 0% { opacity: 1; } 18% { opacity: 0.2; } 30% { opacity: 1; } 55% { opacity: 0.85; } 100% { opacity: 0; } }
.land-wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: clamp(12px, 3.5vh, 28px); opacity: 0; }
#scr-landing.struck .land-wrap { opacity: 1; }
.land-crest { width: min(78vw, 52vh * 1.77, 680px); filter: drop-shadow(0 12px 30px rgba(0,0,0,0.6)); }
#scr-landing.struck .land-crest { animation: crestStrike 1.3s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes crestStrike { 0% { transform: scale(1.14); filter: brightness(4) drop-shadow(0 0 40px #cfe3ff); } 10% { transform: translate(-6px, 3px) scale(1.06); } 18% { transform: translate(5px, -3px) scale(1.04); } 26% { transform: translate(-3px, 2px) scale(1.02); } 60% { filter: brightness(1.15) drop-shadow(0 0 26px rgba(160,200,255,0.55)); } 100% { transform: none; filter: drop-shadow(0 12px 30px rgba(0,0,0,0.6)); } }
#land-enter { min-width: min(300px, 70vw); font-size: clamp(22px, 4vh, 32px); letter-spacing: 0.2em; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .35s, transform .35s cubic-bezier(.2,.8,.2,1); }
#land-enter { display: none; }
#scr-landing.ready #land-enter { display: flex; opacity: 1; transform: none; pointer-events: auto; animation: enterIn .4s cubic-bezier(.2,.8,.2,1); }
@keyframes enterIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.land-tap { position: absolute; left: 0; right: 0; bottom: calc(18% - 18px); display: none; flex-direction: column; align-items: center; gap: 6px; font-family: var(--disp); pointer-events: auto; cursor: pointer; padding: 18px 0; }
.land-tap b { font-weight: 800; letter-spacing: 0.3em; font-size: clamp(18px, 3.2vh, 26px); animation: tapBreath 1.6s ease-in-out infinite; }
.land-tap span { font-family: var(--text); font-size: 13px; color: #8f9bb0; letter-spacing: 0.04em; }
#scr-landing.locked .land-tap { display: flex; transition: opacity .5s ease-out; }
#scr-landing.leaving .land-tap { opacity: 0; }
#scr-landing.leaving .land-tap b { animation: none; }
#scr-landing.locked { cursor: pointer; }
@keyframes tapBreath { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@media (max-height: 460px) { .land-crest { width: min(70vw, 50vh * 1.77, 680px); } }
.land-bolt { -webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent); }
body.tut #faceoff { top: max(36%, 150px); }
.land-tap:focus { outline: none; }
