/* FPS Game Starter layout (shanebrumback.com live demo styles), self-hosted for Arena Blasters. */
@font-face { font-family: "Press Start 2P"; src: url("./assets/fonts/press-start-2p.woff2") format("woff2"); font-display: swap; }
  html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1220; font-family: Arial, Helvetica, sans-serif; }
  body.bg #crosshair, body.bg #hud, body.bg #score, body.bg #killfeed { display: none; }
  #blocker { position: fixed; inset: 0; display: flex; cursor: pointer; align-items: center; justify-content: center; background: rgba(5, 10, 20, 0.72); z-index: 10; }
  #panel { max-width: 460px; padding: 24px 28px; border: 1px solid #22d3ee; border-radius: 10px; background: rgba(8, 18, 32, 0.92); color: #e2e8f0; text-align: center; }
  #panel h1 { margin: 0 0 8px; font-size: 22px; color: #22d3ee; letter-spacing: 1px; }
  #panel p { margin: 6px 0; font-size: 14px; line-height: 1.45; }
  #panel { max-height: calc(100vh - 24px); overflow-y: auto; box-sizing: border-box; }
  /* Short landscape phones (iPhone SE is 667 x 375): shrink the panel so the button always fits. */
  @media (max-height: 500px) {
    #panel { padding: 12px 18px; max-width: 420px; }
    #panel h1 { font-size: 18px; margin-bottom: 4px; }
    #panel p { font-size: 12.5px; line-height: 1.35; margin: 4px 0; }
    #play { margin-top: 8px !important; padding: 8px 20px !important; }
  }
  #play { margin-top: 14px; padding: 12px 34px; font-size: 18px; font-weight: bold; color: #0b1220; background: #22d3ee; border: 0; border-radius: 6px; cursor: pointer; }
  #crosshair { position: fixed; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; pointer-events: none; z-index: 5; }
  #crosshair:before, #crosshair:after { content: ""; position: absolute; background: #e2e8f0; }
  #crosshair:before { left: 8px; top: 0; width: 2px; height: 18px; }
  #crosshair:after { top: 8px; left: 0; height: 2px; width: 18px; }
  #flash { position: fixed; right: 16%; bottom: 14%; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(255,240,180,0.95) 0%, rgba(255,170,60,0.6) 35%, rgba(255,120,0,0) 70%); opacity: 0; pointer-events: none; z-index: 4; }
  #lookZone { position: fixed; top: 0; right: 0; width: 50%; height: 100%; z-index: 5; display: none; touch-action: none; user-select: none; -webkit-user-select: none; }
  body.touch-on #lookZone { display: block; }
  body.touch-on #joy, body.touch-on .tbtn { display: block; }
  #rotate { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; padding: 24px; background: #0a061a; color: #22d3ee; font: 700 16px/1.4 "Press Start 2P", monospace; z-index: 2147483647; touch-action: none; }
  #rotate > div { display: flex; flex-direction: column; align-items: center; gap: 18px; } #rotate .za-rot-ph { width: 46px; height: 78px; border: 4px solid #22d3ee; border-radius: 9px; animation: zaRot 1.6s ease-in-out infinite; } #rotate .za-rot-sub { font-size: 10px; color: #aaa; } #rotate .rotate-continue-btn { font-family: Arial, sans-serif; } @keyframes zaRot{0%,20%{transform:rotate(0)}60%,100%{transform:rotate(90deg)}}
  /* ZA standard: portrait shows the page/menu normally; the rotate prompt only appears AFTER Play
     (touch play started, or the tutorial's LIVE DEMO put this frame into play mode). */
  body.portrait.touch-on #rotate, body.portrait.in-frame:not(.bg) #rotate { display: flex; }
  /* ZA-standard top-right Exit (red X) + fullscreen toggle; only during touch play, standalone page
     (inside the tutorial iframe the parent page draws the same two buttons). */
  body.touch-on:not(.in-frame) #demoExit, body.touch-on:not(.in-frame) #demoMax.fs-ok { display: flex; }
  body.touch-on { touch-action: none; overscroll-behavior: none; }
  #killfeed { position: fixed; left: 50%; top: 34%; transform: translateX(-50%); color: #fbbf24; font: bold 26px/1.2 Arial, sans-serif; text-shadow: 0 2px 6px rgba(0,0,0,0.8); opacity: 0; transition: opacity 0.25s; pointer-events: none; z-index: 5; text-align: center; }
  #hud { white-space: pre; }
  #respawn { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; color: #fff; font: bold 52px/1.1 Arial, sans-serif; text-shadow: 0 3px 10px rgba(0,0,0,0.9); opacity: 0; transition: opacity 0.2s; pointer-events: none; z-index: 7; width: 92vw; }
  #respawn b { display: block; color: #ff4d4d; letter-spacing: 2px; }
  #respawn span { display: block; margin-top: 10px; font-size: 20px; color: #e5e7eb; }
  @media (max-height: 500px), (max-width: 600px) { #respawn { font-size: 34px; } #respawn span { font-size: 15px; } }
  #hurt { position: fixed; inset: 0; pointer-events: none; z-index: 6; opacity: 0; box-shadow: inset 0 0 160px 60px rgba(220,30,30,0.9); background: rgba(200,0,0,0.18); }
  #panel h1.over { color: #ef4444; }
  /* Phones in landscape: keep the thumbs' controls clear of the screen edges and safe areas, and keep
     the HUD small so nothing crowds them. The compact stats panel (top left) and SCORE bar (top center) come from
     ../css/mobile-gameplay-hud.css (shared by every site game). */
  html, body { height: 100%; }
  @media (max-height: 500px) {
    body.touch-on #hud { display: block; }
    #killfeed { font-size: 18px; top: 24%; }
  }
  /* Multiplayer (Step 16c): PLAY MULTIPLAYER button, room / invite panel and the live scoreboard */
  #mpOpen { margin: 14px 0 0 8px; padding: 12px 22px; font-size: 18px; font-weight: bold; color: #1a1205; background: #fbbf24; border: 0; border-radius: 6px; cursor: pointer; }
  #mpView { display: none; margin-top: 8px; }
  #mpView button { margin: 6px 4px 0; padding: 9px 14px; font-size: 14px; font-weight: bold; border: 0; border-radius: 6px; cursor: pointer; color: #0b1220; background: #e2e8f0; }
  #mpView #mpStart { padding: 12px 28px; font-size: 18px; background: #22d3ee; }
  #mpView #mpShare { background: #fbbf24; }
  #mpView input { width: 150px; padding: 6px 8px; border-radius: 5px; border: 1px solid #334155; background: #0b1220; color: #e2e8f0; font-size: 14px; }
  #mpLink { display: none !important; }   /* AB: the invite link is never shown, only copied / shared */
  #mpStatus { color: #fbbf24; }
  #mpBoard { position: fixed; right: 14px; top: 56px; display: none; padding: 6px 12px; background: rgba(8, 18, 32, 0.75); border-right: 3px solid #22d3ee; color: #e2e8f0; font: 12px/1.45 monospace; white-space: pre; pointer-events: none; z-index: 5; }
  body.mp-on #mpBoard { display: block; }
  @media (pointer: coarse) { #mpBoard { top: 64px; } }
  @media (max-height: 500px) { #mpOpen { margin-top: 8px; padding: 8px 14px; font-size: 15px; } #mpView #mpStart { padding: 8px 18px; font-size: 15px; } #mpBoard { top: 34px; font-size: 9px; } }
  /* AB: Arena Blasters additions */
  body.ab-offline .mp-ui:not(.ab-keep), body.ab-offline #mpBoard { display: none !important; }
  #abPlayingAs { color: #fbbf24; font-weight: bold; }
  #abMapName { color: #86efac; font-weight: bold; letter-spacing: 2px; margin: 2px 0 6px; }
  #abLobbyBtn { margin: 14px 0 0 8px; padding: 12px 22px; font-size: 18px; font-weight: bold; color: #0b1220; background: #e2e8f0; border: 0; border-radius: 6px; cursor: pointer; }
  @media (max-height: 500px) { #abLobbyBtn { margin-top: 8px; padding: 8px 14px; font-size: 15px; } }
  body.ab-game #gameCanvas { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; display: block; }
  /* AB Nov 16: third person. The starter's screen-space gun flash belongs to the (hidden) first-person rifle. */
  #flash { display: none !important; }
  /* Top-right X / fullscreen: above the look zone, joystick, buttons and the START panel; always tappable. */
  #demoExit, #demoMax { z-index: 40; pointer-events: auto; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
  /* AB Nov 16 (d): START / pause menu = buttons only. Big neon pills (Neon Turret Rush look) in the lobby's
     Bangers font and colours: gold START GAME, magenta CHANGE FIGHTER, cyan INSTALL APP. No text panel;
     GAME OVER shows just a compact title + one result line above the buttons. */
  #blocker { background: radial-gradient(ellipse at center, rgba(9, 7, 22, 0.30) 0%, rgba(9, 7, 22, 0.72) 75%); }
  #panel { max-width: none; width: auto; padding: 12px; border: 0; border-radius: 0; background: transparent; overflow: visible;
    display: flex; flex-direction: column; align-items: center; gap: 16px; }
  #panel > h1, #panel > p { display: none; }
  #panel > #touchNote, #panel > #keysNote { display: none !important; }   /* the controls live in the home page #abInfo panel */
  #panel > h1.over { display: block; margin: 0; font: 400 58px/1 Bangers, Impact, sans-serif; letter-spacing: 4px; color: #ff5a4a;
    text-shadow: 0 4px 0 #381328, 0 0 26px rgba(255, 77, 77, 0.55); }
  #panel > #title.over ~ #goal { display: block; margin: -8px 0 2px; font: 800 13px/1.4 Arial, sans-serif; letter-spacing: 2px;
    text-transform: uppercase; color: #ffe4ae; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); }
  #panel > #play, #panel > #abLobbyBtn, #panel > #abInstallPanel, #panel > #mpOpen {
    margin: 0; border: 4px solid #fff; border-radius: 999px; cursor: pointer; color: #fff;
    font: 400 26px/1 Bangers, Impact, sans-serif; letter-spacing: 2.5px; text-transform: uppercase;
    min-width: 250px; padding: 11px 30px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
    transition: transform 0.15s, filter 0.15s; -webkit-tap-highlight-color: transparent; }
  #panel > #play { min-width: 320px; padding: 15px 46px; font-size: 40px; letter-spacing: 3px; color: #3a1208; text-shadow: 0 1px 0 #ffe9b8;
    background: linear-gradient(180deg, #ffe58f 0%, #ffad27 52%, #ff632d 100%);
    box-shadow: 0 6px 0 #843618, 0 0 22px rgba(255, 154, 44, 0.75), 0 0 40px rgba(255, 99, 45, 0.35); }
  #panel > #abLobbyBtn { background: linear-gradient(180deg, #ff7ee0 0%, #d23aa0 52%, #8124b4 100%);
    box-shadow: 0 5px 0 #4a1260, 0 0 22px rgba(255, 79, 210, 0.6); }
  #panel > #abInstallPanel { background: linear-gradient(180deg, #8ff6ff 0%, #22b8f0 52%, #3b4fd8 100%);
    box-shadow: 0 5px 0 #1b2a80, 0 0 22px rgba(34, 211, 238, 0.6); }
  #panel > #abInstallPanel[hidden] { display: none; }
  #panel > #mpOpen { background: linear-gradient(180deg, #c49bff 0%, #8b5cf6 52%, #5b21b6 100%); box-shadow: 0 5px 0 #2e1065, 0 0 22px rgba(167, 139, 250, 0.6); }
  /* AB Nov 16 (f): the online panel in the same neon-pill style */
  #panel > #mpView { color: #e9e4ff; font: 700 14px/1.4 Arial, sans-serif; text-align: center; max-width: 560px; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
  #panel > #mpView p { margin: 6px 0; }
  #panel > #mpView #mpChooseStatus, #panel > #mpView #mpStatus { color: #8ff6ff; letter-spacing: 1px; text-transform: uppercase; font-size: 12px; }
  #panel > #mpView button { margin: 6px 5px 0; border: 3px solid #fff; border-radius: 999px; color: #fff; padding: 7px 20px;
    font: 400 18px/1 Bangers, Impact, sans-serif; letter-spacing: 2px; text-transform: uppercase; text-shadow: 0 2px 0 rgba(0,0,0,0.35);
    background: linear-gradient(180deg, #8a93b8 0%, #4b5378 52%, #2a2f4d 100%); box-shadow: 0 4px 0 #161a30, 0 0 14px rgba(160,170,255,0.35);
    transition: transform 0.15s, filter 0.15s; -webkit-tap-highlight-color: transparent; }
  #panel > #mpView button:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.1); }
  #panel > #mpView .mp-big, #panel > #mpView .mp-start { font-size: 24px; padding: 10px 28px; color: #3a1208; text-shadow: 0 1px 0 #ffe9b8;
    background: linear-gradient(180deg, #ffe58f 0%, #ffad27 52%, #ff632d 100%); box-shadow: 0 5px 0 #843618, 0 0 20px rgba(255,154,44,0.6); }
  #panel > #mpView #mpPrivateOpen, #panel > #mpView #mpShare { color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,0.35);
    background: linear-gradient(180deg, #c49bff 0%, #8b5cf6 52%, #5b21b6 100%); box-shadow: 0 5px 0 #2e1065, 0 0 20px rgba(167,139,250,0.6); }
  #panel > #mpView #mpReroll { font-size: 14px; padding: 4px 12px; border-width: 2px; }
  @media (max-height: 500px) { #panel > #mpView { font-size: 12px; } #panel > #mpView p { margin: 3px 0; }
    #panel > #mpView button { font-size: 15px; padding: 5px 14px; border-width: 2px; margin-top: 4px; }
    #panel > #mpView .mp-big, #panel > #mpView .mp-start { font-size: 18px; padding: 7px 20px; } #panel > #mpView .mp-hint:not(#mpChooseStatus) { display: none; } }
  /* AB Nov 16 (j): simple private match: HOST / JOIN tabs, one big pill per step, no explanatory text */
  #panel > #mpView #mpPrivateView > div, #panel > #mpView #mpInviteView { margin: 4px 0; }
  #panel > #mpView .mp-tabs { display: inline-flex; gap: 0; padding: 4px; border-radius: 999px; background: rgba(8, 6, 20, 0.6); border: 2px solid rgba(255,255,255,0.25); }
  #panel > #mpView .mp-tab { margin: 0; padding: 6px 22px; font-size: 18px; border: 0; background: transparent; box-shadow: none; color: #c9acc8; }
  #panel > #mpView .mp-tab.on { color: #3a1208; text-shadow: none; background: linear-gradient(180deg, #ffe58f 0%, #ffad27 52%, #ff632d 100%); box-shadow: 0 0 14px rgba(255,154,44,0.6); }
  #panel > #mpView .mp-toggle { color: #8ff6ff; background: linear-gradient(180deg, #23405a 0%, #13233a 100%); box-shadow: 0 4px 0 #0a1422, 0 0 14px rgba(34,211,238,0.35); }
  #panel > #mpView .mp-toggle.on { color: #062a33; text-shadow: none; background: linear-gradient(180deg, #b6fbff 0%, #22d3ee 52%, #0e8fb0 100%); box-shadow: 0 4px 0 #0b4a5c, 0 0 18px rgba(34,211,238,0.6); }
  #panel > #mpView .mp-code { font: 400 20px/1 Bangers, Impact, sans-serif; letter-spacing: 2px; color: #c9acc8; }
  #panel > #mpView .mp-code b { color: #fff3d4; letter-spacing: 4px; margin-right: 8px; }
  #panel > #mpView .mp-code #mpStatus { font: 800 11px/1 Arial, sans-serif; }
  #panel > #mpView #mpJoinCode { width: 170px; margin: 6px 5px 0; padding: 9px 16px; border: 3px solid #fff; border-radius: 999px; background: rgba(8, 6, 20, 0.75);
    color: #fff3d4; font: 400 22px/1 Bangers, Impact, sans-serif; letter-spacing: 4px; text-align: center; text-transform: uppercase; vertical-align: top; box-sizing: border-box; }
  #panel > #mpView #mpJoinCode::placeholder { color: #8a7a9c; letter-spacing: 3px; }
  #panel > #mpView #mpJoinCode:focus { outline: none; box-shadow: 0 0 18px rgba(255,173,39,0.7); }
  #panel > #mpView .mp-invite-card { display: inline-flex; flex-direction: column; gap: 4px; padding: 10px 26px; border: 3px solid #ffe5ad; border-radius: 18px;
    background: #1b1230e6; box-shadow: 0 6px 0 #843618, 0 0 24px rgba(255,173,39,0.55); }
  #panel > #mpView .mp-invite-game { font: 400 26px/1 Bangers, Impact, sans-serif; letter-spacing: 2px; color: #fff3d4; }
  #panel > #mpView #mpInviteCount { font: 800 12px/1.2 Arial, sans-serif; letter-spacing: 1.5px; color: #8ff6ff; text-transform: uppercase; }
  #panel > #mpView #mpInviteCount.hot { color: #ffd36b; }
  @media (max-height: 500px) { #panel > #mpView .mp-tab { font-size: 14px; padding: 4px 16px; margin: 0; } #panel > #mpView .mp-code { font-size: 15px; }
    #panel > #mpView #mpJoinCode { width: 140px; font-size: 17px; padding: 6px 12px; border-width: 2px; margin-top: 4px; }
    #panel > #mpView .mp-invite-card { padding: 6px 18px; } #panel > #mpView .mp-invite-game { font-size: 20px; } }
  /* AB Nov 16 (k): one-button menu: PLAY (online quick match), a smaller purple PRIVATE MATCH, LEAVE MATCH when paused */
  #panel > #mpOpen { display: none !important; }
  #panel > #goal { display: none; }
  #panel > #abPrivate, #panel > #abLeave { margin: 0; border: 3px solid #fff; border-radius: 999px; cursor: pointer; color: #fff; min-width: 210px; padding: 8px 26px;
    font: 400 22px/1 Bangers, Impact, sans-serif; letter-spacing: 2.5px; text-transform: uppercase; text-shadow: 0 2px 0 rgba(0,0,0,0.35);
    background: linear-gradient(180deg, #c49bff 0%, #8b5cf6 52%, #5b21b6 100%); box-shadow: 0 5px 0 #2e1065, 0 0 20px rgba(167,139,250,0.6);
    transition: transform 0.15s, filter 0.15s; -webkit-tap-highlight-color: transparent; }
  #panel > #abLeave { background: linear-gradient(180deg, #8a93b8 0%, #4b5378 52%, #2a2f4d 100%); box-shadow: 0 4px 0 #161a30, 0 0 14px rgba(160,170,255,0.35); }
  @media (max-height: 500px) { #panel > #abPrivate, #panel > #abLeave { min-width: 180px; padding: 6px 20px; font-size: 18px; border-width: 2px; } }
  #panel > button:hover:not(:disabled) { transform: translateY(-2px) scale(1.03); filter: brightness(1.1); }
  #panel > button:active:not(:disabled) { transform: translateY(2px) scale(0.99); }
  #panel > #play:disabled { filter: grayscale(0.6); cursor: not-allowed; }
  @media (max-height: 500px) {
    #panel { gap: 10px; padding: 6px; }
    #panel > #play { min-width: 250px; padding: 9px 34px !important; margin: 0 !important; font-size: 30px; border-width: 3px; }
    #panel > #abLobbyBtn, #panel > #abInstallPanel, #panel > #mpOpen { min-width: 200px; padding: 7px 22px; margin: 0; font-size: 20px; border-width: 3px; }
    #panel > h1.over { font-size: 40px; } #panel > #title.over ~ #goal { font-size: 11px; margin-top: -4px; }
  }
  /* AB Nov 16 (e): top-left stats panel, same size, lobby colours + a soft neon edge like the menu pills. */
  #hud.mg-hud { font: 600 12px/1.5 Arial, Helvetica, sans-serif; letter-spacing: 0.3px; color: #f1f5f9;
    background: rgba(9, 7, 22, 0.82); border: 2px solid rgba(34, 211, 238, 0.75); border-radius: 12px;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.35), inset 0 0 10px rgba(34, 211, 238, 0.12); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
  #hud .t { font: 400 15px/1.2 Bangers, Impact, sans-serif; letter-spacing: 2px; color: #ffb33d; }
  #hud .l { color: #7fd8e6; font-weight: 600; }
  #hud .v { color: #ffffff; font-weight: 700; }
  #hud .hi { color: #ffc24a; font-weight: 800; }
  #hud .ok { color: #4ade80; font-weight: 800; }
  #hud .warn { color: #fbbf24; font-weight: 800; }
  #hud .bad { color: #ff4d4d; font-weight: 800; }
  #hud .off { color: #94a3b8; font-weight: 700; }
  #hud .sh { color: #67e8f9; font-weight: 700; }
  @media (max-height: 500px) {
    #hud.mg-hud { font-size: 8.5px; line-height: 1.35; border-width: 1.5px; border-radius: 8px; letter-spacing: 0.2px;
      box-shadow: 0 0 8px rgba(34, 211, 238, 0.35), inset 0 0 6px rgba(34, 211, 238, 0.12); }
    #hud .t { font-size: 10.5px; letter-spacing: 1.5px; }
  }


  /* AB Nov 16 (p): phone / touch HUD layout. Nothing overlaps from 640 x 360 up to 1024 x 480 landscape, inside the safe areas:
     stats panel top-left (compact, width capped so it ends before the centred SCORE bar), SCORE bar top-centre,
     fullscreen + X top-right, the PLAYER scoreboard BELOW those two buttons and above JUMP / FIRE, and the kill feed /
     DROP IN! text small under the SCORE bar instead of in the middle of the view. */
  body.touch-on #hud.mg-hud { top: calc(6px + var(--mg-safe-t)); left: calc(6px + var(--mg-safe-l)); padding: 3px 8px;
    font-size: 9px; line-height: 1.35; max-width: calc(50vw - 136px - var(--mg-safe-l)); overflow: hidden; box-sizing: border-box; white-space: pre-line; }
  body.touch-on #hud .t { font-size: 11px; }
  body.touch-on #score.mg-score { top: calc(6px + var(--mg-safe-t)); left: 50%; right: auto; transform: translateX(-50%);
    padding: 3px 10px; font-size: 11px; white-space: nowrap; max-width: calc(100vw - 2 * (124px + var(--mg-safe-r))); overflow: hidden; box-sizing: border-box; }
  body.touch-on #mpBoard { top: calc(var(--mg-corner-top) + var(--mg-corner-size) + 8px + var(--mg-safe-t)); right: calc(8px + var(--mg-safe-r));
    padding: 3px 8px; font-size: 9px; line-height: 1.4; max-height: calc(100vh - 58px - var(--mg-safe-t) - 104px - var(--mg-safe-b)); overflow: hidden; box-sizing: border-box; }
  body.touch-on #killfeed { top: calc(34px + var(--mg-safe-t)); font-size: 14px; max-width: 40vw; white-space: normal; }
