
  html, body {
    margin: 0; padding: 0; overflow: hidden; background: #171a18 !important; font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    width: 100%; height: 100%; min-width: 100%; min-height: 100%; touch-action: none;
    -webkit-touch-callout: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  html { --xxiii-safe-area-left: env(safe-area-inset-left, 0px); }
  button, input, select, textarea { font-family:inherit; }
  /* Fullscreen/F11: keep the render surface flush with every viewport edge. */
  canvas {
    position: fixed; inset:0; left:0; top:0; width: 100vw !important; height: 100vh !important; display: block; touch-action: none;
    -webkit-touch-callout: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  }
  /* iOS Safari updates dv* units after rotating before it updates legacy vh/vw. */
  @supports (width: 100dvw) {
    canvas { width:100dvw !important; height:100dvh !important; }
    #startScreen { width:100dvw; height:100dvh; min-height:100dvh; }
  }
  /* The renderer itself must be sized against its fixed viewport containing
     block, rather than iOS's occasionally stale vw/vh units after rotation. */
  #xxiii-game-canvas {
    position:fixed !important; inset:0 !important;
    left:0 !important; right:0 !important; top:0 !important; bottom:0 !important;
    width:100% !important; height:100% !important;
    min-width:0 !important; min-height:0 !important;
    max-width:none !important; max-height:none !important;
    margin:0 !important; border:0 !important; padding:0 !important; box-sizing:border-box !important;
    background:#171a18;
  }
  /* Phone gameplay is portrait-only. iPhone browser chrome controls part of
     the landscape viewport differently per browser, so blocking that mode is
     more reliable than rendering a partially visible match. */
  #xxiiiPortraitOnly {
    position:fixed; inset:0; z-index:200001; display:none;
    align-items:center; justify-content:center; padding:24px; box-sizing:border-box;
    color:#effffb; text-align:center;
    background:radial-gradient(circle at 50% 35%, #173e3a 0%, #0a1618 45%, #050708 100%);
    font-family:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  }
  .xxiiiPortraitOnlyCard { max-width:310px; }
  .xxiiiPortraitOnlyIcon { width:min(236px,72vw); height:auto; margin:0 auto 20px; }
  .xxiiiPortraitOnlyIcon svg { display:block; width:100%; height:auto; filter:drop-shadow(0 0 13px rgba(30,240,214,.26)); }
  .xxiiiPortraitOnlyCard h1 { margin:0; font-size:24px; font-weight:950; letter-spacing:.02em; }
  .xxiiiPortraitOnlyCard p { margin:11px 0 0; color:rgba(235,255,250,.76); font-size:14px; font-weight:700; line-height:1.45; }
  @media (hover:none) and (pointer:coarse) and (orientation:landscape) {
    /* Extend far beyond the layout viewport. Chrome iOS can reserve unsafe
       strips outside it; the browser clips this backdrop at the real screen. */
    html, body { background:#050708 !important; }
    #xxiiiPortraitOnly {
      display:flex;
      top:-100vh; right:-100vw; bottom:-100vh; left:-100vw;
    }
  }
  /* Chrome on iPhone can reserve the left notch/Dynamic Island inset outside
     the layout viewport in landscape. The custom property remains 0 on every
     normal viewport; JS only supplies a measured left bleed in that case. */
  @media (hover:none) and (pointer:coarse) and (orientation:landscape) and (max-height:520px) {
    #xxiii-game-canvas {
      left:calc(0px - var(--xxiii-landscape-canvas-bleed-left, 0px)) !important;
      width:calc(100% + var(--xxiii-landscape-canvas-bleed-left, 0px)) !important;
    }
  }
  * { -webkit-touch-callout: none; }
  input, textarea { -webkit-user-select: text; -moz-user-select: text; user-select: text; -webkit-touch-callout: default; }
  #startScreen { width: 100vw; height: 100vh; min-height: 100vh; }
  /* XXIII Football — FPS Walk mode */
  #fpsWalkBtn { background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.07)); border:1px solid rgba(255,255,255,.28); }
  #fpsWalkOverlay { position:fixed; inset:0; z-index:80; pointer-events:none; display:none; font-family:inherit; }
  #fpsWalkOverlay.active { display:block; }
  #fpsWalkControls { position:absolute;top:62px;right:14px;max-width:80vw;text-align:right;color:#d9fff0;background:rgba(0,0,0,.65);border:1px solid #ffffff26;border-radius:9px;padding:10px 12px;font-size:12px;line-height:1.8; }
  body.fps-walk-mode #pauseOverlay { display:none !important; }
  #fpsWalkCrosshair { position:absolute; left:50%; top:50%; width:18px; height:18px; transform:translate(-50%,-50%); }
  #fpsWalkCrosshair:before, #fpsWalkCrosshair:after { content:''; position:absolute; background:rgba(255,255,255,.9); box-shadow:0 0 4px rgba(0,0,0,.7); }
  #fpsWalkCrosshair:before { left:8px; top:1px; width:2px; height:16px; }
  #fpsWalkCrosshair:after { left:1px; top:8px; width:16px; height:2px; }
  #fpsWalkInfo { position:absolute; top:14px; left:50%; transform:translateX(-50%); color:#fff; background:rgba(0,0,0,.58); border:1px solid rgba(255,255,255,.16); border-radius:10px; padding:8px 13px; font-size:12px; text-align:center; backdrop-filter:blur(5px); }
  #fpsWalkExit { position:absolute; top:14px; right:14px; pointer-events:auto; color:#fff; background:rgba(0,0,0,.62); border:1px solid rgba(255,255,255,.25); border-radius:9px; padding:9px 13px; font-weight:800; cursor:pointer; }
  body.fps-walk-mode #ui, body.fps-walk-mode #turn, body.fps-walk-mode #rosterBar, body.fps-walk-mode #hint, body.fps-walk-mode #phaseBadge, body.fps-walk-mode #goalMsg, body.fps-walk-mode #powerBarWrap, body.fps-walk-mode #topRightControls, body.fps-walk-mode #shotTimer, body.fps-walk-mode #replayLabel, body.fps-walk-mode #replayOverlay, body.fps-walk-mode #fps { display:none !important; }

  /* Futuristic in-match score HUD: every value stays live HTML so team names,
     kit colours and the score can change without stretching a static image. */
  #ui.xxiiiScoreHud {
    --hud-mint:#19f0d7;
    --turn-kit-color:var(--hud-mint);
    position:absolute; top:12px; left:50%; transform:translateX(-50%);
    z-index:10; display:flex; align-items:stretch; justify-content:center;
    width:min(720px, calc(100vw - 24px)); min-height:66px; box-sizing:border-box;
    color:#effffb; isolation:isolate; user-select:none; pointer-events:none;
    border:1px solid rgba(85,255,231,.82); border-radius:18px 18px 24px 24px;
    background:linear-gradient(105deg, rgba(4,19,19,.94), rgba(7,38,35,.9) 50%, rgba(4,19,19,.94));
    box-shadow:0 0 0 2px rgba(31,255,220,.14), 0 0 19px rgba(19,238,209,.55), inset 0 1px rgba(220,255,248,.28), inset 0 -10px 24px rgba(0,0,0,.36);
  }
  #ui.xxiiiScoreHud::after {
    content:""; position:absolute; z-index:-1; left:31%; right:31%; bottom:-23px; height:23px;
    border:1px solid var(--turn-kit-color); border-top:0; border-radius:0 0 16px 16px;
    background:linear-gradient(180deg, rgba(9,44,40,.95), rgba(1,17,17,.94));
    box-shadow:0 7px 13px rgba(0,0,0,.32), 0 0 13px var(--turn-kit-color), inset 0 -5px 13px color-mix(in srgb, var(--turn-kit-color) 26%, transparent);
  }
  .xxiiiScoreTeam { flex:1 1 0; min-width:0; display:flex; align-items:center; gap:8px; padding:10px 16px; }
  .xxiiiScoreTeam--one { justify-content:flex-start; }
  .xxiiiScoreTeam--two { justify-content:flex-end; }
  .xxiiiKitSwatch {
    display:block; flex:0 0 17px; width:17px; height:37px; border-radius:4px;
    background:#fff; border:1px solid rgba(237,255,250,.86);
    box-shadow:0 0 11px color-mix(in srgb, var(--kit-color, #fff) 72%, transparent), inset 0 0 8px rgba(255,255,255,.35);
  }
  .xxiiiScoreNames { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; }
  .xxiiiScoreTeam--one .xxiiiScoreNames { text-align:right; }
  .xxiiiScoreTeamName {
    min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
    font-size:clamp(11px, 1.55vw, 16px); font-weight:900; letter-spacing:.075em; line-height:1.1;
    text-shadow:0 1px 4px #000, 0 0 10px currentColor;
  }
  .xxiiiScoreTeam--one .xxiiiScoreTeamName { text-align:right; }
  .xxiiiScorePlayers { min-width:0; font-size:10px; line-height:1.05; color:rgba(235,255,248,.8); }
  .xxiiiScorePlayers span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .xxiiiScorePlayers span.active { color:#fff; font-weight:900; text-shadow:0 0 7px #19f0d7; }
  .xxiiiScorePlayers[hidden] { display:none; }
  .xxiiiScoreValue {
    flex:0 0 39px; width:39px; height:39px; display:grid; place-items:center; box-sizing:border-box;
    color:#f4fffc; font-size:24px; font-weight:950; font-variant-numeric:tabular-nums;
    border:1px solid var(--hud-mint); border-radius:8px; background:linear-gradient(145deg, rgba(3,31,29,.98), rgba(1,12,13,.98));
    box-shadow:inset 0 0 14px rgba(0,237,209,.16), 0 0 9px rgba(24,255,221,.35);
  }
  .xxiiiScoreBrand {
    flex:0 0 118px; align-self:stretch; display:flex; flex-direction:column; align-items:center; justify-content:center;
    color:var(--hud-mint); text-align:center; text-shadow:0 0 10px rgba(24,255,222,.76);
    background:linear-gradient(155deg, rgba(9,62,56,.62), rgba(1,20,20,.25));
    clip-path:polygon(11% 0, 89% 0, 100% 22%, 85% 100%, 15% 100%, 0 22%);
  }
  .xxiiiScoreBrand strong { font-size:24px; font-style:italic; font-weight:1000; letter-spacing:.055em; transform:skewX(-7deg); line-height:.82; }
  .xxiiiScoreBrand small { margin-top:5px; font-size:7px; font-weight:900; letter-spacing:.45em; transform:translateX(.2em); }
  #turn {
    position:absolute; top:84px; left:50%; transform:translateX(-50%);
    color:#dce2dc; font-size:12px; font-weight:800; letter-spacing:.03em;
    background:transparent; border:0; padding:0; border-radius:0; z-index:11; user-select:none; pointer-events:none;
    max-width:min(260px, calc(100vw - 24px)); box-sizing:border-box; text-align:center; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
    text-shadow:0 1px 4px #00120f;
  }
  #turnLabel { color:rgba(235,255,248,.78); }
  #turnTeam { font-weight:950; text-shadow:0 0 8px currentColor; }
  /* Keep the compact phone HUD in landscape too.  Width alone is not a
     reliable phone signal after rotation: modern iPhones exceed 600px. */
  @media (max-width:600px), (hover:none) and (pointer:coarse) and (orientation:landscape) and (max-height:520px) {
    #ui.xxiiiScoreHud { top:8px; width:calc(100vw - 16px); min-height:54px; border-radius:13px 13px 18px 18px; }
    .xxiiiScoreTeam { gap:5px; padding:7px 8px; }
    .xxiiiKitSwatch { flex-basis:10px; width:10px; height:29px; border-radius:3px; }
    .xxiiiScoreValue { flex-basis:31px; width:31px; height:31px; font-size:19px; border-radius:6px; }
    .xxiiiScoreBrand { flex-basis:78px; }
    .xxiiiScoreBrand strong { font-size:18px; }
    .xxiiiScoreBrand small { margin-top:3px; font-size:5px; }
    .xxiiiScoreTeamName { font-size:10px; letter-spacing:.03em; }
    .xxiiiScorePlayers { font-size:8px; }
    #ui.xxiiiScoreHud::after { left:35%; right:35%; bottom:-17px; height:17px; }
    #turn { top:65px; font-size:10px; }
  }
  #hint {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,0.7); font-size: 12px; text-align: center;
    background: rgba(0,0,0,0.3); padding: 6px 14px; border-radius: 8px;
    z-index: 10; user-select: none; pointer-events: none; max-width: 90vw;
  }
  #topRightControls {
    position: absolute; top: 12px; right: 12px; z-index: 10;
    display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 70vw;
  }
  #formationChangeBtn {
    background:rgba(18,64,47,.84); color:#ecfff4; border:1px solid rgba(106,244,166,.66);
    padding:8px 12px; border-radius:8px; cursor:pointer; font-size:13px; font-weight:800;
  }
  #formationChangeBtn:hover:not(:disabled) { background:rgba(42,191,119,.28); border-color:#8ff5b4; }
  #formationChangeBtn:disabled {
    opacity:.36; filter:blur(.55px) saturate(.35); cursor:not-allowed;
  }
  #formationChangeMenu {
    flex:1 0 100%; min-width:220px; box-sizing:border-box; padding:9px;
    border:1px solid rgba(106,244,166,.45); border-radius:9px; background:rgba(7,23,16,.96);
    box-shadow:0 8px 20px rgba(0,0,0,.3),0 0 18px rgba(71,230,145,.12);
  }
  #formationChangeMenu[hidden] { display:none!important; }
  #formationChangeTitle {
    margin:0 0 7px; color:#9dffcb; font-size:11px; font-weight:900; letter-spacing:.45px;
  }
  #formationChangeChoices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
  .formationChangeChoice {
    min-height:34px; border:1px solid rgba(255,255,255,.22); border-radius:7px;
    background:rgba(255,255,255,.08); color:#fff; cursor:pointer; font:800 12px/1 inherit;
  }
  .formationChangeChoice:hover { background:rgba(255,255,255,.16); }
  .formationChangeChoice.selected {
    border-color:#8ff5b4; background:rgba(80,230,145,.18); color:#eafff1;
  }
  #reset {
    background: rgba(0,0,0,0.45); color: #fff; border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  }
  #reset:hover { background: rgba(0,0,0,0.65); }
  #pauseBtn {
    background: rgba(0,0,0,.45); color: #fff; border: 1px solid rgba(255,255,255,.3);
    padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  }
  #pauseBtn:hover { background: rgba(0,0,0,.65); }
  #pauseBtn.active { background:rgba(43,199,125,.3); color:#effff5; border-color:#8ff5b4; }
  #netRandomForfeit{background:rgba(148,34,34,.72);color:#fff;border:1px solid rgba(255,160,160,.68);padding:8px 14px;border-radius:8px;cursor:pointer;font-size:13px;font-weight:800}
  #netRandomForfeit:hover{background:rgba(191,43,43,.9)}
  #netRandomForfeit[hidden]{display:none!important}
  #pauseOverlay {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
    z-index: 26; display: none; color: #fff; background: rgba(0,0,0,.55);
    padding: 10px 20px; border-radius: 10px; font-size: 20px; font-weight: 800;
    letter-spacing: .5px; pointer-events: none;
  }
  #goalMsg {
    position: absolute; top: 36%; left: 50%; transform: translate(-50%, -50%);
    width: min(900px, 82vw); line-height: 0;
    z-index: 20; display: none; opacity: 0; pointer-events: none;
    isolation: isolate;
  }
  #goalMsg.goal-visible {
    display: block; animation: goal-logo-fade 1.4s linear both;
  }
  /* A soft painted halo avoids blur filters over the live WebGL scene. */
  #goalMsg::before {
    content: ''; position: absolute; inset: 12% -3%; z-index: -1;
    background: radial-gradient(ellipse at center, var(--goal-glow, transparent) 0%, transparent 70%);
  }
  #goalMsg img { display: block; width: 100%; height: auto; }
  @keyframes goal-logo-fade {
    0% { opacity: 0; }
    21.43%, 78.57% { opacity: 1; }
    100% { opacity: 0; }
  }
  #winMsg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.55); display: none; align-items: center; justify-content: center;
    flex-direction: column; z-index: 30; color: #fff; text-align: center;
  }
  #winMsg .title { font-size: 40px; font-weight: 800; margin-bottom: 8px; }
  #winAvatar {
    width: 82px; height: 82px; object-fit: cover; border-radius: 50%;
    margin-bottom: 14px; border: 3px solid #f6c83c;
    box-shadow: 0 5px 20px rgba(0,0,0,.45);
  }
  #winMsg .sub { font-size: 15px; color: rgba(255,255,255,0.75); margin-bottom: 22px; }
  #winMsg button {
    background: #fff; color: #111; border: none; padding: 10px 22px;
    border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  }
  canvas { display: block; touch-action: none; }
  #powerBarWrap {
    position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
    display: none; flex-direction: column; align-items: center; gap: 6px;
    z-index: 15; user-select: none; pointer-events: none;
  }
  #powerBarTrack {
    width: 26px; height: 220px; border-radius: 13px;
    background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.25);
    box-shadow: 0 4px 14px rgba(0,0,0,.35), inset 0 0 6px rgba(0,0,0,.5);
    display: flex; align-items: flex-end; overflow: hidden;
  }
  #powerBarFill {
    width: 100%; height: 0%;
    background: linear-gradient(0deg, #3ddc5a 0%, #f4e04d 55%, #ff4d4d 100%);
    border-radius: 0 0 12px 12px;
    transition: height 0.03s linear;
  }
  #powerBarLabel {
    color: #e8ece8; font-size: 11px; font-weight: 700; letter-spacing: .5px;
    background: rgba(22,26,24,0.75); padding: 3px 9px; border-radius: 6px;
    transition: color .12s, background .12s;
  }
  #powerBarWrap.cancelZone #powerBarFill { background: rgba(150,155,150,.55); }
  #powerBarWrap.cancelZone #powerBarLabel { color: #ffd7d7; background: rgba(120,20,20,.75); }
  #powerBarWrap.cancelZone #powerBarTrack { border-color: rgba(255,120,120,.55); }
  #mobileDefenseCancel {
    position: absolute; right: 12px; top: calc(50% - 152px);
    width: 42px; height: 42px; border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    padding: 0; border: 1px solid rgba(255,255,255,.42);
    background: rgba(28,32,30,.88); color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,.38);
    font-size: 21px; font-weight: 800; line-height: 1;
    z-index: 25; touch-action: manipulation; user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  body:not(.touch) #mobileDefenseCancel { display: none !important; }
  #mobileDefenseCancel:active { transform: scale(.94); background: rgba(110,35,35,.95); }
  #spinSelector {
    position: fixed; width: 128px; height: 128px; margin: -64px 0 0 -64px;
    display: none; z-index: 40; pointer-events: none;
  }
  #spinRing {
    position: absolute; inset: 0; border-radius: 50%;
    background: none;
    border: none;
    box-shadow: none;
  }
  #spinRing::before {
    content: "";
    position: absolute; inset: 0;
    border-radius: 50%;
    background: url("../assets/images/spin_ball.png") center / contain no-repeat;
    opacity: .58;
    pointer-events: none;
  }
  /* Show the currently selected ball inside the right-click spin preview. */
  #spinRing.storeBall::before {
    background-image: var(--store-spin-image, none);
    opacity: .62;
  }
  #spinRing.xxiiiBall::before {
    background-image: url("../assets/images/spin_ball.png");
    opacity: .58;
  }
  #spinRing.wcBall::before {
    background-image: url("../assets/images/xxiii_wc_ball.png");
    opacity: .48;
  }
  #spinRing.premBall::before {
    background-image: url("../assets/images/xxiii-prem-spin.png");
    opacity: .62;
  }
  #spinRing.classicBall::before {
    background-image: none;
    background: radial-gradient(circle at 34% 28%, #ffffff 0 8%, #eeeeea 24%, #cfcfca 58%, #8d8d88 100%);
    box-shadow: inset -12px -10px 18px rgba(0,0,0,.24), inset 8px 7px 12px rgba(255,255,255,.65);
    opacity: .92;
  }
  #spinRing.neonBall::before {
    background-image: none;
    background: radial-gradient(circle at 34% 28%, #bff8ff 0 7%, #39d8ff 28%, #087aa0 62%, #062e3a 100%);
    box-shadow: inset -12px -10px 18px rgba(0,0,0,.28), 0 0 18px rgba(57,216,255,.38);
    opacity: .92;
  }
  #spinCrosshairV, #spinCrosshairH {
    position: absolute; background: rgba(255,255,255,0.28);
  }
  #spinCrosshairV { left: 50%; top: 6px; bottom: 6px; width: 1px; transform: translateX(-50%); }
  #spinCrosshairH { top: 50%; left: 6px; right: 6px; height: 1px; transform: translateY(-50%); }
  #spinMarker {
    position: absolute; left: 50%; top: 50%; width: 18px; height: 18px;
    margin: -9px 0 0 -9px; border-radius: 50%;
    background: #ffe14d; border: 2px solid #171a18;
    box-shadow: 0 0 8px rgba(255,225,77,.8);
  }
  #spinLabels span {
    position: absolute; color: rgba(255,255,255,0.55); font-size: 9px; font-weight: 700;
    letter-spacing: .3px; white-space: nowrap;
  }
  #spinLabels .top { top: -16px; left: 50%; transform: translateX(-50%); }
  #spinLabels .bottom { bottom: -16px; left: 50%; transform: translateX(-50%); }
  #spinLabels .left { left: -8px; top: 50%; transform: translate(-100%, -50%); }
  #spinLabels .right { right: -8px; top: 50%; transform: translate(100%, -50%); }
  #spinBadge {
    /* The score HUD, turn label, spin status and timer are a fixed vertical
       stack. Keep each lane independent so enabling all three never overlaps. */
    position:absolute; top:104px; left:50%; transform:translateX(-50%);
    display: none; color: #ffe14d; font-size: 12px; font-weight: 700;
    background: rgba(22,26,24,0.85); padding: 5px 12px; border-radius: 8px;
    z-index: 10; user-select: none; pointer-events: none; white-space: nowrap;
  }

  /* ===================== START SCREEN / MATCH SETTINGS ===================== */
  #startScreen {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 20%, rgba(55,70,60,.92), rgba(9,11,10,.97));
    color: #fff; font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow: auto; padding: 20px; box-sizing: border-box;
  }
  #startScreen button, #startScreen input, #startScreen select, #startScreen textarea { font-family:inherit; }
  #startCard {
    width: min(814px, 100%);
    max-height: min(94vh, calc(100vh - 40px));
    max-height: min(94dvh, calc(100dvh - 40px));
    box-sizing: border-box; overflow: auto;
    background: rgba(20,24,21,.96); border: 1px solid rgba(255,255,255,.14);
    border-radius: 22px; padding: 26px; box-shadow: 0 24px 80px rgba(0,0,0,.5);
  }
  #startCard h1 { margin: 0 0 4px; font-size: 34px; letter-spacing: .5px; }
  #startCard .lead { color: rgba(255,255,255,.62); margin: 0 0 22px; }
  .settingGrid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
  .setting { background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09); border-radius: 14px; padding: 14px; }
  .setting h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.6); }
  .choices { display:flex; flex-wrap:wrap; gap:8px; }
  .choiceBtn, .goalBtn {
    border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07);
    color:#fff; border-radius: 10px; padding: 9px 12px; cursor:pointer; font-weight:700;
    box-sizing:border-box;
  }
  .choiceBtn.selected, .goalBtn.selected { border-color: #fff; background: rgba(255,255,255,.19); box-shadow: 0 0 0 2px rgba(255,255,255,.08) inset; }
  .choiceBtn:focus-visible, .goalBtn:focus-visible { outline:2px solid rgba(255,255,255,.72); outline-offset:2px; }
  .swatch { display:inline-block; width:12px; height:12px; border-radius:50%; margin-right:6px; vertical-align:-1px; }
  #coinArea { margin-top:14px; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
  #coinBtn, #startBtn, #resumeBtn {
    border:none; border-radius:11px; padding:11px 16px; cursor:pointer; font-weight:800;
  }
  #coinBtn { background:#f4c542; color:#171a18; }
  #coinBtn .coinFlipIcon { display:inline-block; width:16px; height:16px; margin-right:4px; vertical-align:-3px; }
  #startBtn { background:#fff; color:#111; min-width:170px; }
  #resumeBtn { background:#4ade80; color:#0c1a10; min-width:170px; order:-1; }
  #coinArea.resume-only > :not(#resumeBtn) { display:none !important; }
  #coinResult { font-weight:800; min-height:22px; }
  #startBtn:disabled { opacity:.35; cursor:not-allowed; }
  .coin { display:inline-flex; width:28px; height:28px; border-radius:50%; background:#f4c542; color:#5b4100; align-items:center; justify-content:center; font-weight:900; box-shadow:0 2px 8px rgba(0,0,0,.35); }
  .smallNote { margin-top:12px; font-size:12px; color:rgba(255,255,255,.45); line-height:1.5; }
  #shotTimer {
    position:absolute; top:134px; left:50%; transform:translateX(-50%);
    z-index:16; display:none; color:#fff; background:rgba(170,25,25,.92);
    border:1px solid rgba(255,255,255,.25); border-radius:10px; padding:5px 12px;
    font-weight:900; font-size:18px; min-width:68px; text-align:center;
  }
  /* Online mode uses exactly the same centered stack as local and AI games. */
  body.net-online-active #shotTimer,
  body.net-online-active.net-online-m2 #shotTimer { position:absolute; top:134px; }
  /* This follows the base rules above so compact score HUDs use their own
     shorter, equally-spaced stack. */
  @media (max-width:600px) {
    #spinBadge { top:82px; font-size:10px; padding:4px 9px; }
    #shotTimer,
    body.net-online-active #shotTimer,
    body.net-online-active.net-online-m2 #shotTimer { top:112px; font-size:16px; min-width:58px; padding:4px 10px; }
  }
  #replayBtn {
    background:rgba(0,0,0,.45); color:#fff; border:1px solid rgba(255,255,255,.3);
    padding:8px 14px; border-radius:8px; cursor:pointer; font-size:13px;
  }
  #replayBtn:disabled { opacity:.4; cursor:not-allowed; }
  #replayLabel {
    position:absolute; top:36%; left:50%; transform:translate(-50%,-50%);
    color:#fff; background:rgba(0,0,0,.62); padding:10px 18px; border-radius:10px;
    z-index:25; display:none; font-size:20px; font-weight:800;
  }

  #teamSetup { grid-column: 1 / -1; }
  #teamSetup .teamSetupHeading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
  #teamSetup .teamSetupHeading h3 { margin:0; }
  #teamSetup .teamSetupHeading #guestKitNote { margin:0; text-align:right; }
  /* The online 1v1 lobby mirrors Custom Local: two balanced team columns. */
  #teamSetup.net1lobby .teamInputs { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .teamTitle { font-size:14px; font-weight:900; margin-bottom:10px; }
  .teamInputs { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
  .teamBox { background:rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.08); border-radius:12px; padding:12px; }
  .teamName {
    width:100%; box-sizing:border-box; margin-bottom:10px; padding:10px 11px;
    border-radius:9px; border:1px solid rgba(255,255,255,.16); background:rgba(0,0,0,.18);
    color:#fff; outline:none; font-weight:700;
  }
  .teamName:focus { border-color:rgba(255,255,255,.5); }
  .kitCustomizer { display:flex; gap:14px; align-items:center; background:rgba(0,0,0,.16); border:1px solid rgba(255,255,255,.08); border-radius:10px; padding:10px; }
  .kitPreviewWrap { flex:0 0 auto; width:88px; height:118px; display:flex; align-items:center; justify-content:center; background:radial-gradient(circle at 50% 30%, rgba(255,255,255,.12), rgba(0,0,0,.08)); border-radius:8px; }
  .kitPreviewSvg { width:80px; height:110px; filter:drop-shadow(0 3px 5px rgba(0,0,0,.3)); }
  .kitPreviewCanvas { display:none; width:100%; height:100%; filter:drop-shadow(0 3px 5px rgba(0,0,0,.3)); }
  /* The game canvas uses a global fullscreen rule; keep kit previews inside their card. */
  .kitPreviewWrap > canvas.kitPreviewCanvas {
    position:relative !important; left:auto !important; top:auto !important; right:auto !important; bottom:auto !important;
    width:100% !important; height:100% !important; max-width:100%; max-height:100%; box-sizing:border-box;
    flex:0 0 auto; pointer-events:auto; touch-action:none; cursor:grab; user-select:none;
  }
  /* Random 1v1 has four small, independent WebGL kit previews.  They must
     never inherit the fullscreen render-surface rule declared at the top of
     this file. */
  .xxiiiRandomPlayerKit > canvas.xxiiiRandomPlayerKitCanvas {
    position:relative !important; inset:auto !important;
    width:48px !important; height:56px !important; max-width:48px !important; max-height:56px !important;
    display:block !important; flex:0 0 56px; pointer-events:none; touch-action:auto; z-index:auto;
  }
  .kitPreviewWrap > canvas.kitPreviewCanvas.isDragging { cursor:grabbing; }
  .kitPickers { flex:1 1 auto; display:flex; flex-direction:column; gap:7px; min-width:0; }
  .kitPickerRow { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12.5px; font-weight:700; color:rgba(255,255,255,.82); }
  .kitPickerRow input[type="color"] {
    -webkit-appearance:none; appearance:none; width:34px; height:26px; padding:0; border:1px solid rgba(255,255,255,.3);
    border-radius:7px; background:none; cursor:pointer; flex:0 0 auto;
  }
  .kitPickerRow input[type="color"]::-webkit-color-swatch-wrapper { padding:2px; }
  .kitPickerRow input[type="color"]::-webkit-color-swatch { border:none; border-radius:5px; }
  .kitPickerRow input[type="color"]::-moz-color-swatch { border:none; border-radius:5px; }
  .kitOptionControls { display:flex; align-items:center; gap:6px; }
  .kitOptionControls input[type="color"] { -webkit-appearance:none; appearance:none; width:28px; height:24px; padding:0; border:1px solid rgba(255,255,255,.3); border-radius:6px; background:none; cursor:pointer; }
  .kitOptionControls input[type="color"]::-webkit-color-swatch-wrapper { padding:2px; }
  .kitOptionControls input[type="color"]::-webkit-color-swatch { border:none; border-radius:4px; }
  .kitOptionControls input[type="color"]::-moz-color-swatch { border:none; border-radius:4px; }
  .kitOptionControls input[type="color"]:disabled { opacity:.38; cursor:not-allowed; }
  .kitToggleGroup { display:inline-flex; overflow:hidden; border:1px solid rgba(255,255,255,.24); border-radius:7px; }
  .kitToggleGroup button { border:0; border-right:1px solid rgba(255,255,255,.18); min-width:29px; padding:4px 6px; background:rgba(255,255,255,.06); color:rgba(255,255,255,.7); font:800 10px/1 inherit; cursor:pointer; }
  .kitToggleGroup button:last-child { border-right:0; }
  .kitToggleGroup button.isActive { background:rgba(123,240,165,.24); color:#a8ffca; }
  .kitToggleGroup button:hover { background:rgba(255,255,255,.15); }
  /* Do not inherit the game's global touch suppression inside the native
     color dialog trigger, especially while the 2v2 player DnD is enabled. */
  #teamSetup.net2on input[type="color"] { touch-action:auto; -webkit-user-select:auto; user-select:auto; pointer-events:auto; }
  @media (max-width: 480px) {
    .kitCustomizer { flex-direction:column; align-items:stretch; }
    .kitPreviewWrap { width:100%; height:130px; }
  }
  .formationChoice { display:flex; flex-direction:column; gap:7px; }
  #formationSetup .teamTitle { display:none; }
  .formationCard {
    display:flex; align-items:center; gap:9px; text-align:left; padding:6px 8px;
    border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.05);
    color:#fff; border-radius:9px; cursor:pointer; font-weight:800;
  }
  .formationCard.selected { border-color:#fff; background:rgba(255,255,255,.15); }
  .formationThumb { width:82px; height:44px; flex:0 0 82px; border-radius:6px; background:#184f32; border:1px solid rgba(255,255,255,.25); position:relative; overflow:hidden; }
  .formationThumb:before { content:""; position:absolute; inset:4px; border:1px solid rgba(255,255,255,.65); border-radius:2px; }
  .formationThumb:after { content:""; position:absolute; left:50%; top:4px; bottom:4px; border-left:1px solid rgba(255,255,255,.5); }
  .dots { position:absolute; inset:0; }
  .dot { position:absolute; width:4px; height:4px; margin:-2px 0 0 -2px; border-radius:50%; background:#fff; box-shadow:0 0 0 1px rgba(0,0,0,.4); }
  #menuBtn {
    position:absolute; top:12px; left:12px; z-index:10; background:rgba(0,0,0,.45); color:#fff;
    border:1px solid rgba(255,255,255,.3); padding:8px 14px; border-radius:8px; cursor:pointer; font-size:13px;
  }
  #replayOverlay {
    position:fixed; left:50%; bottom:18px; transform:translateX(-50%);
    z-index:80; display:none; align-items:center; gap:8px;
    background:linear-gradient(125deg,rgba(18,43,34,.97),rgba(7,17,13,.96)); border:1px solid rgba(143,245,180,.48);
    border-radius:12px; padding:8px 10px; box-shadow:0 10px 30px rgba(0,0,0,.45),inset 0 0 0 1px rgba(255,255,255,.06);
    max-width:96vw;
  }
  #replayProgress { width:min(220px,42vw); accent-color:#8ff5b4; cursor:pointer; }
  .replayCtl {
    border:1px solid rgba(143,245,180,.38); background:rgba(4,20,13,.7); color:#f2fff7; border-radius:8px;
    padding:6px 10px; cursor:pointer; font-weight:800; font-size:13px; white-space:nowrap; transition:background .18s ease,border-color .18s ease,transform .18s ease;
  }
  .replayCtl:hover,.replayCtl:focus-visible { border-color:#8ff5b4; background:rgba(51,209,122,.24); color:#fff; transform:translateY(-1px); }
  #replayTime,#replaySpeed { color:rgba(236,255,244,.8); font-size:11px; min-width:62px; text-align:center; }
  #replaySpeed { min-width:38px; font-size:10px; }
  #closeReplay { margin-left:2px; }
  #qualitySetup .qualityRow { display:flex; flex-wrap:wrap; gap:8px; }
  #qualitySetup .choiceBtn { flex:1 1 150px; text-align:left; line-height:1.35; }
  #qualitySetup .qDesc { display:block; font-size:11px; font-weight:400; opacity:.72; margin-top:2px; }
  #qualityNote { margin-top:10px; font-size:11.5px; color:rgba(255,255,255,.62); line-height:1.5; }
  #qualitySetup .renderResolutionSetting { margin-top:14px; }
  #qualitySetup .renderResolutionSetting h4 { margin:0 0 7px; font-size:12px; letter-spacing:.55px; text-transform:uppercase; color:rgba(255,255,255,.82); }
  #qualitySetup .renderResolutionRow { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
  #qualitySetup .renderResolutionRow .choiceBtn { min-width:0; min-height:40px; padding:7px 3px; text-align:center; font-size:12px; font-weight:800; }
  #qualitySetup .renderResolutionNote { margin-top:6px; color:rgba(255,255,255,.57); font-size:10.5px; line-height:1.35; }
  #qualityReload {
    margin-left:8px; background:rgba(255,255,255,.12); color:#fff; border:1px solid rgba(255,255,255,.28);
    padding:4px 10px; border-radius:7px; cursor:pointer; font-size:11.5px;
  }
  #qualityReload:hover { background:rgba(255,255,255,.22); }
  #skipDefense {
    background:rgba(20,91,58,.9); color:#effff5; border:1px solid rgba(111,246,173,.78);
    padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 700;
    display: none;
  }
  #skipDefense:hover { background:rgba(50,205,132,.32); border-color:#9dffcb; }
  #phaseBadge {
    position: absolute; top: 86px; left: 50%; transform: translateX(-50%);
    z-index: 10; display: none !important; pointer-events: none; user-select: none;
    font-size: 12.5px; font-weight: 800; letter-spacing: .5px;
    color: #171a18; background: rgba(244,197,66,.92);
    padding: 5px 14px; border-radius: 8px;
  }
  /* --- телефон / таблет: по-едри мишени за пръст --- */
  body.touch #hint { font-size: 12.5px; bottom: 8px; padding: 7px 12px; max-width: 94vw; }
  body.touch #reset, body.touch #pauseBtn, body.touch #netRandomForfeit, body.touch #replayBtn, body.touch #skipDefense,
  body.touch #menuBtn { padding: 11px 15px; font-size: 14px; }
  body.touch #topRightControls { gap: 7px; max-width: 62vw; }
  body.touch #ui:not(.xxiiiScoreHud) { font-size: 15px; padding: 7px 13px; gap: 13px; }
  body.touch #fps { bottom: 68px; }
  #fps {
    position:fixed; left:12px; bottom:40px; z-index:12; display:none;
    color:#cfe6d2; font-size:12px; font-weight:700; letter-spacing:.3px;
    background:rgba(0,0,0,.42); padding:4px 9px; border-radius:7px;
    pointer-events:none; user-select:none;
  }
  #confettiLayer { position:fixed; inset:0; z-index:70; pointer-events:none; overflow:hidden; }
  .confettiPiece { position:absolute; top:-16px; width:9px; height:14px; animation:confettiFall 1.8s cubic-bezier(.15,.7,.25,1) forwards; }
  @keyframes confettiFall { to { transform:translate3d(var(--dx),110vh,0) rotate(var(--rot)); opacity:0; } }
  @media (max-width: 650px) {
    .teamInputs { grid-template-columns:1fr; }
  }

  @media (max-width: 650px) {
    .settingGrid { grid-template-columns: 1fr; }
    #startCard { padding:20px; }
    #startCard h1 { font-size:28px; }
    #topRightControls { max-width: 96vw; }
    #replayOverlay { bottom: 10px; padding: 6px 8px; gap: 6px; flex-wrap:wrap; justify-content:center; width:calc(100vw - 20px); box-sizing:border-box; }
    #replayProgress { width: 34vw; }
  }

  /* ---------- multiplayer lobby ---------- */
  #netRow { display:flex; flex-wrap:wrap; gap:8px; animation:none; transition:none; }
  #netSetup, #netSetup * { animation:none!important; transition:none!important; }
  #netPanel { margin-top:10px; display:flex; flex-direction:column; gap:8px; }
  #netCodeWrap, #netJoinWrap { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
  #netCode {
    font:700 22px/1 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-variant-numeric:tabular-nums; letter-spacing:4px;
    background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.25);
    border-radius:8px; padding:6px 12px; color:#fff;
    -webkit-user-select:text; -moz-user-select:text; user-select:text;
    -webkit-touch-callout:default; cursor:text;
  }
  #netCodeInput {
    font:700 18px/1 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-variant-numeric:tabular-nums; letter-spacing:4px;
    text-transform:uppercase; width:150px; padding:8px 10px; border-radius:8px;
    border:1px solid rgba(255,255,255,.25); background:rgba(0,0,0,.35); color:#fff;
  }
  #netStatus { font-size:12px; color:rgba(255,255,255,.82); min-height:16px; }
  #netStatus.ok { color:#6ee79a; }
  #netStatus.err { color:#ff8b8b; }
  #netBanner {
    position:fixed; left:50%; top:88px; transform:translateX(-50%);
    z-index:40; padding:5px 14px; border-radius:999px; display:none;
    background:rgba(0,0,0,.55); border:1px solid rgba(255,255,255,.2);
    color:#fff; font-size:12px; font-weight:700; letter-spacing:.4px;
    backdrop-filter:blur(6px); pointer-events:none; white-space:normal; text-align:center; line-height:1.35;
    max-width:calc(100vw - 24px); box-sizing:border-box;
  }
  #netBanner.wait { color:#ffd98a; }
  #netBanner.mine { color:#7bf0a5; }

  /* ---------- splash / заглавен екран ---------- */
  #splash {
    position:fixed; inset:0; z-index:200; display:flex;
    align-items:flex-end; justify-content:center;
    background:#05070a url('../assets/images/intro-final.jpg') center/cover no-repeat;
    opacity:1; transition:opacity .45s ease;
  }
  #splash.hide { opacity:0; pointer-events:none; }
  #splashVideo {
    position:absolute; inset:0; width:100%; height:100%;
    object-fit:cover; display:block; background:#05070a;
  }
  /* Guaranteed fallback for browsers that reset a completed video to frame 0. */
  #splash.is-frozen #splashVideo { visibility:hidden; }
  /* Fit the full title on phones; keep identical framing on the final still. */
  @media (hover:none) and (pointer:coarse) {
    #splash { background-size:contain; background-position:center; }
    #splashVideo { object-fit:contain; object-position:center; }
  }
  @media (hover:none) and (pointer:coarse) and (orientation:portrait) {
    /* The lettering is centred at approximately (654,314) in the 1280x720
       frame. Centre that point, rather than the frame including its reflection. */
    #splash {
      background-position:calc(50% - 1.1vw) calc(50% + 3.6vw);
    }
    #splashVideo {
      object-position:calc(50% - 1.1vw) calc(50% + 3.6vw);
    }
    @supports (height:100dvh) {
      #splash { height:100dvh; bottom:auto; }
    }
  }
  #splashSoundBtn {
    position:absolute; top:22px; right:22px; z-index:5;
    width:46px; height:46px; border-radius:50%; border:1px solid rgba(255,255,255,.3);
    background:rgba(0,0,0,.42); color:#fff; font-size:20px; cursor:pointer;
    display:none; align-items:center; justify-content:center;
    box-shadow:0 6px 20px rgba(0,0,0,.3); backdrop-filter:blur(8px);
  }
  #splashSoundBtn:hover { background:rgba(0,0,0,.62); transform:scale(1.04); }
  #splash.hide #splashVideo { pointer-events:none; }

  #splash::after {
    content:''; position:absolute; inset:0; pointer-events:none;
    background:
      radial-gradient(120% 80% at 50% 25%, rgba(0,0,0,0) 35%, rgba(0,0,0,.55) 100%),
      linear-gradient(to bottom, rgba(0,0,0,0) 45%, rgba(3,6,10,.92) 100%);
  }
  #splashInner {
    position:relative; z-index:2; text-align:center;
    padding:0 20px 7vh; display:flex; flex-direction:column;
    align-items:center; gap:14px;
  }
  #splashTag {
    font-size:13px; letter-spacing:5px; text-transform:uppercase;
    color:rgba(255,255,255,.72); text-shadow:0 2px 12px rgba(0,0,0,.9);
  }
  #playBtn {
    font:800 20px/1 inherit; letter-spacing:3px; text-transform:uppercase;
    padding:16px 54px; border-radius:999px; cursor:pointer;
    color:#07110b; border:0;
    background:linear-gradient(180deg,#8ff5b4,#33d17a);
    box-shadow:0 10px 34px rgba(51,209,122,.45), 0 0 0 1px rgba(255,255,255,.35) inset;
    transition:transform .14s ease, box-shadow .14s ease;
  }
  #playBtn:hover { transform:translateY(-2px); box-shadow:0 16px 42px rgba(51,209,122,.6), 0 0 0 1px rgba(255,255,255,.5) inset; }
  #playBtn:active { transform:translateY(1px) scale(.985); }
  #playBtn:disabled, #playBtn.isOptimizing {
    cursor:wait; pointer-events:none; filter:blur(.7px) saturate(.42); opacity:.62;
    box-shadow:0 6px 20px rgba(0,0,0,.30); transform:none;
  }
  #splashHint { font-size:11px; color:rgba(255,255,255,.5); letter-spacing:1px; }
  @media (max-width:640px) {
    #playBtn { font-size:17px; padding:14px 42px; }
    #splashTag { font-size:11px; letter-spacing:3px; }
    #splashInner { padding-bottom:9vh; }
  }
  #netDiag {
    position:fixed; left:8px; bottom:8px; z-index:41; display:none;
    font:11px/1.35 ui-monospace, Menlo, Consolas, monospace;
    color:rgba(255,255,255,.75); background:rgba(0,0,0,.5);
    border:1px solid rgba(255,255,255,.15); border-radius:7px;
    padding:4px 9px; pointer-events:none; max-width:92vw;
  }

  /* ---------- 2v2 онлайн ---------- */
  .net2Players { display:none; margin:0 0 10px; }
  .localPartyPlayers { margin:0 0 10px; }
  .localPartyPlayers[hidden] { display:none; }
  .localPartyPlayers .playerName { display:block; width:100%; box-sizing:border-box; margin-bottom:6px; padding:8px 10px; border-radius:9px; border:1px solid rgba(255,255,255,.16); background:rgba(0,0,0,.18); color:#fff; outline:none; font-weight:700; font-size:13px; }
  .localPartyPlayers .playerName:focus { border-color:rgba(255,255,255,.5); }
  #teamSetup.net2on .net2Players { display:block; }
  .net2Label { font-size:11px; font-weight:800; letter-spacing:.6px; color:rgba(255,255,255,.65); margin-bottom:6px; text-transform:uppercase; }
  .net2Row { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
  .net2Row .playerName {
    flex:1 1 auto; min-width:0; box-sizing:border-box; padding:8px 10px; border-radius:9px;
    border:1px solid rgba(255,255,255,.16); background:rgba(0,0,0,.18); color:#fff;
    outline:none; font-weight:700; font-size:13px;
  }
  .net2Row .playerName:focus { border-color:rgba(255,255,255,.5); }
  .net2Row .playerName:disabled { opacity:.9; }
  .net2Row.net2CanDrag { cursor:grab; user-select:none; touch-action:none; }
  .net2Row.net2CanDrag:active { cursor:grabbing; }
  .net2Row.net2DragSource { opacity:.45; }
  .net2Row.net2DropTarget { outline:2px dashed rgba(255,255,255,.75); outline-offset:2px; border-radius:10px; background:rgba(255,255,255,.06); }
  .net2DragHint { display:none; margin:-2px 0 7px; font-size:10px; color:rgba(255,255,255,.5); }
  #teamSetup.net2host .net2DragHint { display:block; }
  .slotDot {
    flex:0 0 auto; width:10px; height:10px; border-radius:50%;
    background:rgba(255,255,255,.22); box-shadow:0 0 0 2px rgba(255,255,255,.08);
    transition:background .2s, box-shadow .2s;
  }
  .slotDot.on { background:#4ade80; box-shadow:0 0 9px #4ade80; }
  .slotTag { flex:0 0 auto; font-size:10px; font-weight:800; letter-spacing:.5px; color:rgba(255,255,255,.55); text-transform:uppercase; }
  #netMyName {
    font:700 14px/1 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; width:150px; padding:9px 10px; border-radius:8px;
    border:1px solid rgba(255,255,255,.25); background:rgba(0,0,0,.35); color:#fff;
  }
  #rosterBar {
    position:absolute; top:88px; left:50%; transform:translateX(-50%); z-index:10;
    display:none; gap:10px; align-items:stretch; justify-content:center; flex-wrap:wrap;
    max-width:96vw; pointer-events:none; user-select:none;
  }
  #rosterBar.show { display:flex; }
  .rosterTeam {
    display:flex; align-items:center; gap:7px; padding:5px 9px; border-radius:11px;
    background:rgba(22,26,24,.88); border:2px solid transparent; font-size:12px; font-weight:700;
    transition:border-color .2s;
  }
  .rosterTeam .rTeamName { font-size:10px; letter-spacing:.5px; text-transform:uppercase; max-width:20vw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .rosterP {
    padding:3px 10px; border-radius:999px; background:rgba(255,255,255,.08);
    color:rgba(255,255,255,.66); white-space:nowrap; max-width:26vw; overflow:hidden; text-overflow:ellipsis;
  }
  .rosterP.active { background:#fff; color:#0c120e; box-shadow:0 0 0 2px rgba(255,255,255,.3), 0 0 14px rgba(255,255,255,.45); }
  .rosterP.me::before { content:'\2605 '; }
  /* 2v2 has all HUD layers active. Keep the player-turn banner below the
     shot timer instead of sharing the score HUD's middle lane. */
  #netBanner.m2 { top:174px; }
  @media(max-width:640px){
    #rosterBar { flex-direction:column; align-items:center; gap:4px; }
    .rosterP { max-width:36vw; }
    #netBanner.m2 { top:150px; }
  }

/* Separate the desktop TURN tray from the scoreboard by two CSS pixels.
   Keep the label's line box centred within the matching 24px tray. */
body:not(.touch) #ui.xxiiiScoreHud::after {
  top:calc(100% + 3px); bottom:auto; height:24px; box-sizing:border-box;
  border-top:1px solid var(--turn-kit-color); border-radius:8px 8px 16px 16px;
}
body:not(.touch) #ui.xxiiiScoreHud + #turn {
  top:80px; height:24px; line-height:24px; padding:0;
  left:50%; transform:translateX(-50%); text-align:center;
}
@media(max-width:600px) {
  body:not(.touch) #ui.xxiiiScoreHud::after {height:20px;}
  body:not(.touch) #ui.xxiiiScoreHud + #turn {top:64px;height:20px;line-height:20px;}
}

#xxiiiQuickVar{position:fixed;left:max(12px,env(safe-area-inset-left));bottom:max(10px,env(safe-area-inset-bottom));width:76px;height:42px;z-index:13;display:grid;place-items:center;padding:7px;border:1px solid #65eeb64d;border-radius:8px;background:#071611b8;cursor:pointer;touch-action:manipulation}#xxiiiQuickVar img{display:block;width:100%;height:auto;pointer-events:none}#xxiiiQuickVar:disabled{opacity:.35;cursor:default}#xxiiiQuickVar[hidden],body.xxiii-main-menu-open #xxiiiQuickVar,body.fps-walk-mode #xxiiiQuickVar{display:none!important}#xxiiiQuickVar:focus-visible{outline:2px solid #7affc1;outline-offset:3px}body #fps,body.touch #fps{left:max(12px,env(safe-area-inset-left));bottom:calc(max(10px,env(safe-area-inset-bottom)) + 49px)}
