/* ==================================================================
   Hero select hub (js/hub/*). Everything is scoped under .hub and all
   keyframes are prefixed hub- so nothing leaks into the game shell.
   --hero / --hero2 are set on .hub by HubUI for the focused hero.
   ================================================================== */

#hub-layer > .hub {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  font-family: var(--ui); color: var(--txt);
  --hero: #f99e1a; --hero2: #ffd23f; --herodark: #141a2e;
  --glass: linear-gradient(160deg, rgba(20, 28, 60, .86), rgba(8, 12, 30, .9));
  --panel-w: min(410px, 33vw);
}
.hub .hub-ui, .hub button, .hub input, .hub label { pointer-events: auto; }
.hub button { -webkit-tap-highlight-color: transparent; }
.hub-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 62% 58%, transparent 45%, rgba(3, 5, 14, .55) 100%),
    linear-gradient(0deg, rgba(4, 6, 16, .75), transparent 22%),
    linear-gradient(180deg, rgba(4, 6, 16, .6), transparent 18%);
}

/* ---------------- header ---------------- */
.hub-head { position: absolute; top: calc(14px + var(--safe-t)); left: 22px; right: 22px; display: flex; align-items: center; justify-content: space-between; }
.hub.ready .hub-head { animation: hub-drop .6s cubic-bezier(.2, .9, .3, 1.2) backwards; }
.hub-brand { display: flex; align-items: center; gap: 12px; pointer-events: none; }
.hub-emblem { width: 58px; height: 58px; flex: none; filter: drop-shadow(0 0 10px rgba(249, 158, 26, .45)); }
.hub-emblem .em-ring { stroke: var(--ow); transform-box: fill-box; transform-origin: center; animation: hub-rot 26s linear infinite; }
.hub-emblem .em-inner { stroke: rgba(255, 255, 255, .4); transform-box: fill-box; transform-origin: center; animation: hub-rot 14s linear infinite reverse; }
.hub-emblem .em-mark { fill: #fff; }
.hub-emblem .em-mark2 { fill: var(--ow); }
.hub-title { margin: 0; font-style: italic; font-weight: 800; font-size: clamp(26px, 3vw, 40px); line-height: .95; letter-spacing: .04em; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.hub-title span { color: var(--ow); }
.hub-subtitle { margin: 3px 0 0; font-style: italic; font-weight: 600; font-size: clamp(13px, 1.25vw, 16px); color: var(--dim); letter-spacing: .03em; }
.hub-gear { width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); background: rgba(10, 14, 30, .55); color: #fff; cursor: pointer; display: grid; place-items: center; transition: transform .25s, border-color .2s, background .2s; }
.hub-gear svg { width: 24px; height: 24px; }
.hub-gear:hover, .hub-gear.on, .hub-gear:focus-visible { border-color: var(--ow); transform: rotate(60deg); outline: none; }
.hub-settings {
  position: absolute; top: 60px; right: 0; width: min(320px, calc(100vw - 32px)); padding: 14px 16px 16px; z-index: 6;
  background: var(--glass); border-top: 4px solid var(--ow); box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: hub-pop .22s ease-out;
}
.hub-settings[hidden] { display: none; }
.hub-settings-title { font-style: italic; font-weight: 800; letter-spacing: .18em; color: var(--ow); margin-bottom: 10px; }
.hub-settings-body { display: flex; flex-wrap: wrap; gap: 10px; }
.hub-settings-body .toggle { flex: 1 1 130px; min-height: 44px; }
.hub-settings-body .slider { flex: 1 1 100%; justify-content: space-between; min-height: 40px; }
.hub-settings-body .slider input { flex: 1; max-width: 190px; min-height: 30px; }

/* ---------------- 3D-anchored name plates ---------------- */
.hub-plates { position: absolute; inset: 0; pointer-events: none; }
.hub-plate {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; padding: 5px 14px 5px 10px; min-height: 36px;
  border: 0; cursor: pointer; color: #fff; background: rgba(8, 12, 30, .78); white-space: nowrap;
  font-style: italic; font-weight: 800; font-size: 17px; letter-spacing: .06em; text-transform: uppercase;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  box-shadow: inset 4px 0 0 var(--rc); transition: background .2s, color .2s, font-size .2s, padding .2s;
  will-change: transform;
}
.hub-plate .role-ico { width: 16px; height: 16px; color: var(--rc); }
.hub-plate .pl-num { font-size: 11px; font-style: normal; opacity: .6; border: 1px solid rgba(255, 255, 255, .35); padding: 0 4px; border-radius: 3px; }
.hub-plate:hover { background: rgba(30, 38, 76, .92); }
.hub-plate.on { background: var(--hero); color: #111; font-size: 21px; padding: 7px 18px 7px 12px; box-shadow: inset 5px 0 0 #fff, 0 0 24px color-mix(in srgb, var(--hero) 60%, transparent); }
.hub-plate.on .role-ico { color: #111; }
.hub-plate.on .pl-num { border-color: rgba(0, 0, 0, .4); }

/* ---------------- speech bubble ---------------- */
.hub-bubble {
  position: absolute; left: 0; top: 0; max-width: min(300px, 70vw); padding: 8px 14px 9px; pointer-events: none;
  background: #fff; color: #10131f; font-weight: 700; font-style: italic; font-size: 18px; line-height: 1.15;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(50% + 10px) calc(100% - 10px), 50% 100%, calc(50% - 6px) calc(100% - 10px), 0 calc(100% - 10px));
  padding-bottom: 19px; opacity: 0; transition: opacity .25s; will-change: transform; transform-origin: 50% 100%;
}
.hub-bubble b { display: block; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: color-mix(in srgb, var(--hero) 70%, #000); }
.hub-bubble.show { opacity: 1; animation: hub-bubble .35s cubic-bezier(.2, 1.4, .4, 1); }

/* ---------------- dock: roster + info panel ---------------- */
.hub-dock { display: contents; }
.hub-panel {
  position: absolute; left: 22px; top: calc(96px + var(--safe-t)); bottom: 40px; width: var(--panel-w);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  background: var(--glass); border-left: 5px solid var(--hero);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color .3s, opacity .3s, transform .3s;
}
.hub.ready .hub-panel { animation: hub-slide .6s .08s cubic-bezier(.2, .9, .3, 1.1) backwards; }
.hub-panel-inner { min-height: 100%; display: flex; flex-direction: column; }
.hub-roster {
  position: absolute; bottom: 34px; right: 22px; left: calc(var(--panel-w) + 44px);
  display: flex; align-items: center; justify-content: center; gap: 14px; pointer-events: none;
  transition: opacity .3s;
}
.hub-roster > * { pointer-events: auto; }
.hub-tiles { display: none; }
.hub-keys { font-weight: 600; font-size: 15px; color: var(--dim); letter-spacing: .04em; pointer-events: none; }
.hub-keys .kbd { margin: 0 1px; }
.hub-arrow {
  width: 52px; height: 48px; border: 0; cursor: pointer; font-size: 18px; color: #fff; background: rgba(10, 14, 30, .7);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); transition: background .2s, color .2s, transform .15s;
}
.hub-arrow:hover, .hub-arrow:focus-visible { background: var(--hero); color: #111; outline: none; }
.hub-arrow:active { transform: scale(.92); }

/* ---------------- info panel card ---------------- */
.hp { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 0; flex: 1; animation: hub-card .38s cubic-bezier(.2, .9, .3, 1) backwards; }
.hp-top { display: flex; align-items: center; justify-content: space-between; font-weight: 700; letter-spacing: .14em; color: var(--dim); font-size: 14px; }
.hp-role { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 9px; background: var(--rc); color: #0c1020; font-weight: 800; font-style: italic; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.hp-role .role-ico { width: 15px; height: 15px; }
.hp-name {
  margin: 2px 0 0; font-family: var(--disp); font-weight: 900; text-transform: uppercase; color: #fff;
  font-size: clamp(54px, 6vw, 92px); line-height: .82; letter-spacing: .01em;
  text-shadow: 4px 4px 0 color-mix(in srgb, var(--hero) 75%, #000), 0 0 30px color-mix(in srgb, var(--hero) 40%, transparent);
}
.hp-real { font-weight: 600; font-style: italic; color: var(--dim); letter-spacing: .1em; text-transform: uppercase; font-size: 14px; margin-top: -4px; }
.hp-quote { margin: 2px 0 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--hero); font-style: italic; font-weight: 700; font-size: 21px; line-height: 1.1; color: var(--hero); }
.hp-intro { margin: 0; font-size: 16px; line-height: 1.32; color: #dfe4f2; font-weight: 500; }
.hp-game { display: flex; gap: 12px; align-items: center; padding: 10px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.hp-game-info { min-width: 0; }
.hp-kicker { font-size: 11px; font-weight: 800; font-style: italic; letter-spacing: .24em; color: var(--ow); }
.hp-gtitle { margin: 0; font-family: var(--disp); font-weight: 800; font-size: 30px; line-height: .95; text-transform: uppercase; color: #fff; }
.hp-genre { font-style: italic; font-weight: 600; color: var(--dim); font-size: 15px; }
.hp-hint { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: 15px; color: #cfd6ea; font-weight: 600; }
.hp-pin { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--hero); }
.hp-stats { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 6px; }
.hp-stat { padding: 6px 9px; background: rgba(255, 255, 255, .06); border-bottom: 3px solid rgba(255, 255, 255, .15); min-width: 0; }
.hp-stat span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .18em; color: var(--dim); }
.hp-stat b { display: block; font-style: italic; font-weight: 800; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-stat.ult { border-bottom-color: var(--hero); }
.hp-stat.ult b { color: var(--hero); }
.hub-play {
  position: sticky; bottom: 0; margin: 6px -20px 0; padding: 12px 22px 14px; min-height: 64px; border: 0; cursor: pointer;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; text-align: left; overflow: hidden;
  background: var(--hero); color: #10131f; transition: filter .2s, transform .15s;
  box-shadow: 0 -10px 24px rgba(4, 6, 16, .55);
}
.hub-play::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 45%, transparent 60%); transform: translateX(-100%); animation: hub-shine 2.6s ease-in-out infinite; pointer-events: none; }
.hub-play:hover, .hub-play:focus-visible { filter: brightness(1.12); outline: none; }
.hub-play:focus-visible { box-shadow: inset 0 0 0 3px #fff; }
.hub-play:active { transform: scale(.98); }
.hpl-main { font-family: var(--disp); font-weight: 900; font-size: 38px; line-height: 1; letter-spacing: .04em; }
.hpl-sub { font-style: italic; font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: .06em; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-play .kbd { border-color: rgba(0, 0, 0, .4); background: rgba(0, 0, 0, .12); }

/* ---------------- footer, lock-in, gate ---------------- */
.hub-foot { position: absolute; right: 22px; bottom: calc(10px + var(--safe-b)); font-size: 11.5px; color: rgba(169, 178, 201, .75); letter-spacing: .03em; pointer-events: none; }
.hub-flash { position: absolute; inset: 0; background: var(--hero); opacity: 0; pointer-events: none; mix-blend-mode: screen; }
.hub-flash.on { animation: hub-flash .7s ease-out both; }
.hub-lock { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); text-align: center; opacity: 0; pointer-events: none; white-space: nowrap; }
.hub-lock.on { animation: hub-stamp .75s cubic-bezier(.2, 1.3, .4, 1) both; }
.hl-kicker { display: block; font-style: italic; font-weight: 800; letter-spacing: .4em; font-size: clamp(16px, 2.2vw, 24px); color: #fff; }
.hl-name { display: block; font-family: var(--disp); font-weight: 900; text-transform: uppercase; font-size: clamp(70px, 14vw, 170px); line-height: .85; color: #fff; text-shadow: 6px 6px 0 color-mix(in srgb, var(--hero) 80%, #000), 0 0 50px var(--hero); }
.hl-game { display: block; font-style: italic; font-weight: 800; font-size: clamp(18px, 2.6vw, 30px); letter-spacing: .12em; color: var(--hero); text-transform: uppercase; }
.hub.locking .hub-panel, .hub.locking .hub-roster, .hub.locking .hub-plates, .hub.locking .hub-bubble { opacity: 0; transform: translateX(-24px); transition: opacity .25s, transform .3s; }
.hub-gate { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; cursor: pointer; background: radial-gradient(ellipse at center, rgba(8, 12, 30, .35), rgba(3, 5, 14, .82)); }
.hub-gate[hidden] { display: none; }
.hub-gate-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 20px; }
.hub-gate-card .hub-emblem.big { width: 110px; height: 110px; }
.hub-gate-card b { font-style: italic; font-weight: 800; font-size: clamp(26px, 4vw, 40px); letter-spacing: .12em; color: #fff; animation: hub-breathe 1.6s ease-in-out infinite alternate; }
.hub-gate-card span { font-weight: 600; font-style: italic; color: var(--dim); font-size: 16px; }

/* ---------------- game preview motifs ---------------- */
.pv { position: relative; flex: 0 0 132px; height: 92px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--hero) 55%, transparent); background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--hero) 28%, #0b1024) 0%, #070b1a 78%); }
.pv i, .pv b { position: absolute; display: block; font-style: normal; }
.pv svg { position: absolute; }
.pv-tag { position: absolute; left: 6px; right: 4px; bottom: 3px; font-size: 9.5px; font-weight: 700; font-style: italic; letter-spacing: .08em; color: rgba(255, 255, 255, .78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-pulse { left: 50%; top: 42%; width: 30px; height: 30px; margin: -15px; border-radius: 50%; border: 3px solid var(--hero); animation: hub-ping 1.4s ease-out infinite; }

/* Tracer: blink streaks + recall clock */
.pv-lane { left: 0; right: 0; height: 2px; opacity: .55; background: linear-gradient(90deg, transparent, var(--hero2), transparent) 0 0 / 50% 100% repeat-x; animation: hub-lane .5s linear infinite; }
.pv-lane.l1 { top: 26%; } .pv-lane.l2 { top: 48%; animation-duration: .38s; } .pv-lane.l3 { top: 70%; animation-duration: .62s; }
.pv-runner, .pv-ghost { top: 36%; width: 16px; height: 18px; margin-left: -8px; background: var(--hero); clip-path: polygon(0 0, 60% 0, 100% 50%, 60% 100%, 0 100%, 40% 50%); animation: hub-blink 2.6s infinite; }
.pv-runner { box-shadow: 0 0 12px var(--hero); }
.pv-ghost { opacity: .35; background: #5ee3ff; }
.pv-ghost.g1 { animation-delay: .07s; } .pv-ghost.g2 { animation-delay: .14s; opacity: .18; }
.pv-clock { right: 6px; top: 5px; width: 28px; height: 28px; fill: none; stroke: #5ee3ff; stroke-width: 3; stroke-linecap: round; transform-origin: center; animation: hub-rot 2.6s linear infinite reverse; }

/* Reinhardt: hex barrier shimmer taking fire */
.pv-barrier { position: absolute; left: 54%; top: 7px; bottom: 18px; width: 50px; overflow: hidden; transform: perspective(160px) rotateY(-30deg); border: 2px solid rgba(160, 220, 255, .9); background: linear-gradient(180deg, rgba(110, 190, 255, .38), rgba(110, 190, 255, .12)); box-shadow: 0 0 14px rgba(120, 200, 255, .65); }
.pv-barrier svg { inset: 0; width: 100%; height: 100%; }
.pv-barrier path { fill: rgba(140, 210, 255, .1); stroke: rgba(200, 240, 255, .7); stroke-width: 1.2; }
.pv-shimmer { inset: -10% -60%; background: linear-gradient(110deg, transparent 42%, rgba(255, 255, 255, .8) 50%, transparent 58%); animation: hub-shimmer 1.8s linear infinite; }
.pv-bullet { left: 4%; width: 12px; height: 3px; border-radius: 2px; background: #ff7a5a; box-shadow: 0 0 6px #ff7a5a; animation: hub-bullet 1.1s linear infinite; }
.pv-bullet.b1 { top: 28%; } .pv-bullet.b2 { top: 50%; animation-delay: .37s; } .pv-bullet.b3 { top: 66%; animation-delay: .74s; }
.pv-spark { left: 50%; width: 10px; height: 10px; margin: -5px; background: #fff; clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); animation: hub-spark 1.1s linear infinite; }
.pv-spark.s1 { top: 30%; } .pv-spark.s2 { top: 52%; animation-delay: .37s; }

/* Widowmaker: scope sweep across a sunset skyline */
.pv-scope { left: 50%; top: 44%; width: 74px; height: 74px; margin: -37px 0 0 -37px; border-radius: 50%; overflow: hidden; border: 3px solid #0b0b12; box-shadow: 0 0 0 2px var(--hero), inset 0 0 16px rgba(0, 0, 0, .85); background: linear-gradient(#ffd3a1, #f0886a 55%, #6a3c74); }
.pv-skyline { left: -60%; bottom: 0; width: 220%; height: 38%; background: repeating-linear-gradient(90deg, #2a1838 0 11px, #3b2352 11px 17px, #1f1230 17px 30px, #33204a 30px 36px); animation: hub-pan 3.2s ease-in-out infinite alternate; }
.pv-target { bottom: 34%; width: 7px; height: 15px; border-radius: 4px 4px 1px 1px; background: #1b0f26; animation: hub-pan 3.2s ease-in-out infinite alternate; }
.pv-target::before { content: ''; position: absolute; left: 50%; top: -6px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: #1b0f26; }
.pv-target.t1 { left: 58%; } .pv-target.t2 { left: 22%; bottom: 40%; transform: scale(.8); }
.pv-cross { inset: 0; background: linear-gradient(#10101a, #10101a) center / 1px 100% no-repeat, linear-gradient(#10101a, #10101a) center / 100% 1px no-repeat; }
.pv-laser { left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: #ff2d55; box-shadow: 0 0 6px #ff2d55; animation: hub-ping-dot 1s ease-in-out infinite alternate; }
.pv-hs { left: 0; right: 0; top: 8px; text-align: center; font-size: 9px; font-weight: 800; font-style: italic; color: #ff2d55; letter-spacing: .1em; opacity: 0; animation: hub-hs 3.2s infinite; }
.pv-chargebar { position: absolute; right: 8px; top: 8px; bottom: 18px; width: 5px; background: rgba(255, 255, 255, .15); }
.pv-chargebar i { left: 0; right: 0; bottom: 0; background: var(--hero2); animation: hub-charge 3.2s ease-in infinite; }

/* Mercy: golden Caduceus beam + healing */
.pv-beamsvg { left: 0; top: 0; width: 100%; height: calc(100% - 14px); }
.pv-beam { fill: none; stroke: #ffe07a; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 10 7; animation: hub-dash .5s linear infinite; }
.pv-beam-glow { fill: none; stroke: rgba(255, 224, 122, .32); stroke-width: 10; stroke-linecap: round; animation: hub-breathe 1.2s ease-in-out infinite alternate; }
.pv-staff { fill: #fff; stroke: #8fd8ff; stroke-width: 3; }
.pv-plus { fill: #fff6c8; transform-box: fill-box; transform-origin: center; animation: hub-beat 1.2s ease-in-out infinite; }
.pv-hp { position: absolute; right: 8px; top: 64%; width: 50px; height: 6px; background: rgba(255, 255, 255, .18); }
.pv-hp i { left: 0; top: 0; bottom: 0; background: #7cf29a; box-shadow: 0 0 6px #7cf29a; animation: hub-fill 2.4s ease-in-out infinite; }

/* Cassidy: spinning revolver cylinder under the noon sun */
.pv-sun { left: 10px; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle, #fff4c2, #f5a623 70%); box-shadow: 0 0 16px #f5a623; animation: hub-breathe 1.8s ease-in-out infinite alternate; }
.pv-cyl { left: 50%; top: 44%; width: 58px; height: 58px; margin: -29px 0 0 -29px; animation: hub-rot 1.9s steps(6) infinite; }
.pv-cyl circle { fill: #15161c; stroke: #a9adb8; stroke-width: 1.5; }
.pv-cyl .pv-cyl-body { fill: #6d717d; stroke: #2b2d33; stroke-width: 3; }
.pv-cyl .pv-cyl-pin { fill: #cfd2da; stroke: none; }
.pv-draw { right: 6px; top: 20px; font-family: var(--disp); font-weight: 900; font-size: 22px; color: var(--hero2); text-shadow: 2px 2px 0 #000; animation: hub-draw 1.9s steps(1) infinite; }

/* D.Va: Defense Matrix eating missiles */
.pv-matrix { left: 36%; top: 6px; width: 60%; height: calc(100% - 20px); }
.pv-matrix path { fill: rgba(255, 122, 182, .16); stroke: #ff7ab6; stroke-width: 1.4; animation: hub-hex 1.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
.pv-missile { left: -8%; width: 12px; height: 4px; border-radius: 2px; background: #ffb24a; box-shadow: -6px 0 8px rgba(255, 178, 74, .7); animation: hub-missile 1.2s linear infinite; }
.pv-missile.m1 { top: 26%; } .pv-missile.m2 { top: 46%; animation-delay: .4s; } .pv-missile.m3 { top: 64%; animation-delay: .8s; }

/* ---------------- keyframes (all hub- prefixed) ---------------- */
@keyframes hub-rot { to { transform: rotate(360deg); } }
@keyframes hub-drop { from { opacity: 0; transform: translateY(-24px); } }
@keyframes hub-slide { from { opacity: 0; transform: translateX(-60px) skewX(-6deg); } }
@keyframes hub-card { from { opacity: 0; transform: translateX(-26px); } }
@keyframes hub-pop { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes hub-bubble { from { scale: .6; } }
@keyframes hub-shine { 0%, 55% { transform: translateX(-100%); } 85%, 100% { transform: translateX(100%); } }
@keyframes hub-flash { 0% { opacity: .85; } 100% { opacity: 0; } }
@keyframes hub-stamp { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.8) skewX(-8deg); } 35% { opacity: 1; transform: translate(-50%, -50%) scale(1) skewX(-8deg); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1.06) skewX(-8deg); } }
@keyframes hub-breathe { from { opacity: .65; } to { opacity: 1; } }
@keyframes hub-ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes hub-ping-dot { from { opacity: .5; } to { opacity: 1; } }
@keyframes hub-lane { to { background-position: -100% 0; } }
@keyframes hub-blink { 0%, 18% { left: 12%; } 19%, 40% { left: 42%; } 41%, 62% { left: 72%; } 70% { left: 72%; filter: hue-rotate(0deg); } 92% { left: 12%; filter: hue-rotate(160deg); } 100% { left: 12%; } }
@keyframes hub-shimmer { from { transform: translateX(-60%); } to { transform: translateX(60%); } }
@keyframes hub-bullet { 0% { left: 2%; opacity: 1; } 88% { left: 50%; opacity: 1; } 89%, 100% { left: 50%; opacity: 0; } }
@keyframes hub-spark { 0%, 86% { transform: scale(0); opacity: 0; } 90% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(.4) rotate(45deg); opacity: 0; } }
@keyframes hub-pan { from { transform: translateX(-18%); } to { transform: translateX(18%); } }
@keyframes hub-hs { 0%, 46% { opacity: 0; } 50% { opacity: 1; transform: scale(1.3); } 70% { opacity: 1; transform: scale(1); } 80%, 100% { opacity: 0; } }
@keyframes hub-charge { 0% { height: 0; } 48% { height: 100%; } 50%, 100% { height: 0; } }
@keyframes hub-dash { to { stroke-dashoffset: -17; } }
@keyframes hub-beat { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.25); } }
@keyframes hub-fill { 0% { width: 18%; background: #ff4655; } 70% { width: 100%; background: #7cf29a; } 100% { width: 100%; } }
@keyframes hub-draw { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes hub-hex { 0%, 100% { opacity: .35; } 50% { opacity: 1; fill: rgba(255, 122, 182, .38); } }
@keyframes hub-missile { 0% { left: -8%; opacity: 1; } 30% { left: 34%; opacity: 1; } 34%, 100% { left: 36%; opacity: 0; } }

/* ---------------- narrow / portrait: carousel + bottom sheet ---------------- */
@media (max-width: 820px), (orientation: portrait) {
  .hub-head { top: calc(10px + var(--safe-t)); left: 12px; right: 12px; }
  .hub-emblem { width: 40px; height: 40px; }
  .hub-brand { gap: 9px; }
  .hub-title { font-size: 24px; }
  .hub-subtitle { font-size: 12.5px; }
  .hub-settings { top: 54px; }
  .hub-plates { display: none; }
  .hub-bubble { font-size: 15px; max-width: 64vw; }
  .hub-dock { display: flex; flex-direction: column; position: absolute; left: 0; right: 0; bottom: calc(26px + var(--safe-b)); }
  .hub-roster { position: static; display: block; padding: 0 8px 8px; pointer-events: none; }
  .hub-keys { display: none; }
  .hub-tiles { display: flex; gap: 4px; justify-content: center; overflow-x: auto; scrollbar-width: none; pointer-events: auto; }
  .hub-tiles::-webkit-scrollbar { display: none; }
  .hub-tile {
    flex: 1 1 0; min-width: 44px; max-width: 76px; height: 50px; border: 0; cursor: pointer; padding: 4px 2px 3px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: #fff; background: rgba(10, 14, 30, .8); box-shadow: inset 0 -3px 0 var(--c);
    clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); transition: background .2s, transform .2s;
  }
  .hub-tile .role-ico { width: 15px; height: 15px; color: var(--rc); }
  .ht-name { font-style: italic; font-weight: 800; font-size: 11.5px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .hub-tile.on { background: var(--c); color: #111; transform: translateY(-4px); box-shadow: inset 0 -3px 0 #fff, 0 6px 16px rgba(0, 0, 0, .45); }
  .hub-tile.on .role-ico { color: #111; }
  .hub-arrow { position: absolute; bottom: calc(100% + 16vh); width: 48px; height: 56px; font-size: 20px; background: rgba(10, 14, 30, .6); pointer-events: auto; }
  .hub-arrow[data-dir="-1"] { left: 8px; }
  .hub-arrow[data-dir="1"] { right: 8px; }
  .hub-panel {
    position: relative; left: auto; top: auto; bottom: auto; width: auto; height: clamp(210px, 42vh, 420px);
    border-left: 0; border-top: 4px solid var(--hero); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  }
  .hub.ready .hub-panel { animation-name: hub-rise; }
  .hp { padding: 12px 16px 0; gap: 8px; }
  .hp-name { font-size: clamp(42px, 13vw, 66px); }
  .hp-quote { font-size: 17px; }
  .hp-intro { font-size: 14.5px; }
  .hp-gtitle { font-size: 25px; }
  .pv { flex-basis: 112px; height: 84px; }
  .hp-stat b { font-size: 16px; }
  .hub-play { margin: 4px -16px 0; min-height: 58px; padding: 10px 18px 12px; }
  .hpl-main { font-size: 32px; }
  .hub-play .kbd { display: none; }
  .hub-foot { left: 8px; right: 8px; bottom: calc(4px + var(--safe-b)); text-align: center; font-size: 9.5px; line-height: 1.15; }
  .hub.locking .hub-panel, .hub.locking .hub-roster { transform: translateY(30px); }
}
@keyframes hub-rise { from { opacity: 0; transform: translateY(60px); } }

/* Short landscape screens (phones sideways): compact header + panel */
@media (max-height: 520px) and (orientation: landscape) {
  .hub-head { top: calc(6px + var(--safe-t)); }
  .hub-emblem { width: 36px; height: 36px; }
  .hub-title { font-size: 22px; }
  .hub-subtitle { font-size: 12px; }
  .hub-panel { top: calc(54px + var(--safe-t)); bottom: 22px; }
  .hp { gap: 6px; padding-top: 10px; }
  .hp-name { font-size: 44px; }
  .hp-intro { display: none; }
  .hub-roster { bottom: 18px; }
  .hub-foot { bottom: 3px; font-size: 10px; }
  .hub-plate { font-size: 14px; min-height: 30px; }
  .hub-plate.on { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .hub *, .hub *::before, .hub *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; }
}
