/* BATTLE ROYALE browser demo (dirtnap.parttimemonkey.com/battleroyale).
   GENERATED by web-demos/battleroyale/tools/sync_site.py from the
   demo's index.html <style> block - edit THERE, never here. */

  /* notch/home-indicator insets as vars: DOM overlays use them in
     calc() and game.js reads them for the canvas-drawn HUD */
  :root {
    --sat: env(safe-area-inset-top, 0px);
    --sar: env(safe-area-inset-right, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
  }
  html, body { margin: 0; height: 100%; background: #070503; overflow: hidden; }
  canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    cursor: none;
    background: #070503;
    touch-action: none;   /* the touch controls own every gesture */
    -webkit-user-select: none; user-select: none;
  }
  /* top-left: the ORANGE wishlist slab (web only - the Poki build
     strips it) with the hamburger button under it; everything else
     lives in the small "pause" popup that opens to the hamburger's
     right (nothing actually pauses). Esc toggles it, an outside click
     closes it. */
  #topui {
    position: fixed; z-index: 9;
    top: calc(14px + var(--sat) * 0.6); left: calc(16px + var(--sal) * 0.6);
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    pointer-events: none;
  }
  #topui a, #topui button {
    pointer-events: auto;
    font-family: Silkscreen, monospace; font-size: 16px; letter-spacing: 1px;
    text-decoration: none; border: 0; padding: 8px 16px; cursor: pointer;
  }
  #wishlist {
    color: #1a0e04; background: #e07f1e;
    box-shadow: 4px 4px 0 #000000;
  }
  #wishlist:hover { background: #ff9a3c; }
  #menurow {
    display: flex; flex-direction: row; align-items: flex-start; gap: 10px;
  }
  #menu-btn {
    width: 38px; height: 38px; padding: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 4px;
    background: rgba(38, 26, 15, 0.85);
    box-shadow: 4px 4px 0 #000000;
  }
  #menu-btn:hover { background: rgba(74, 50, 27, 0.95); }
  #menu-btn span { display: block; width: 18px; height: 3px; background: #e8dcc8; }
  #menu-btn:hover span { background: #ffe9b0; }
  #pausemenu {
    display: none;
    flex-direction: column; align-items: stretch; gap: 8px;
    background: rgba(20, 14, 8, 0.96);
    box-shadow: 8px 8px 0 #000000;
    padding: 12px;
    pointer-events: auto;
  }
  #pausemenu.show { display: flex; }
  #pausemenu button {
    text-align: left;
    color: #e8dcc8; background: rgba(38, 26, 15, 0.85);
  }
  #pausemenu button:hover {
    background: rgba(74, 50, 27, 0.95); color: #ffe9b0;
  }
  /* SFX / MUSIC rows: icon + always-visible slider */
  .aurow { display: flex; align-items: center; gap: 8px; }
  #sfx-btn, #music-btn {
    width: 34px; height: 34px; padding: 0;
    display: flex; align-items: center; justify-content: center;
  }
  /* EXACT 2x of the 10-11 px icon art - integer scale stays crisp */
  #sfx-btn img, #music-btn img {
    height: 20px; width: auto; image-rendering: pixelated;
  }
  .aurow input[type="range"] {
    width: 110px; accent-color: #e07f1e;
    pointer-events: auto;
  }
  /* the Poki flavor plays without chat (platform.noChat) */
  body.nochat #chat { display: none; }
  body.nochat .chat-key { display: none; }
  /* in-round scoreboard under the canvas minimap: DOM, because the
     canvas upscale can't draw Silkscreen under 8 canvas px (reads huge
     on screen) - 16 CSS px here is visibly smaller and always crisp.
     JS pins right/top to the minimap's screen rect. */
  #hud-roster {
    position: fixed; z-index: 5; display: none;
    flex-direction: column; gap: 5px;
    background: rgba(10, 7, 4, 0.55);
    padding: 8px 10px;   /* symmetric top/bottom on purpose */
    font-family: Silkscreen, monospace; font-size: 16px; letter-spacing: 1px;
    pointer-events: none;
  }
  #hud-roster.show { display: flex; }
  .hrow {
    display: flex; justify-content: space-between; align-items: center;
    gap: 14px; color: #e8dcc8;
  }
  .hrow.me { color: #ff9a3c; }
  .hrow.dead { opacity: 0.45; color: #8a6a5a; }
  .hrow .hnm { display: flex; align-items: center; gap: 6px; }
  .hrow .hsc { color: #ffd25a; }
  /* the HOW TO PLAY popup's key grid */
  #howto .rows {
    display: grid; grid-template-columns: auto auto;
    gap: 8px 28px; font-size: 16px; color: #e8dcc8;
  }
  #howto .rows b { color: #ffd25a; font-weight: normal; }
  #howto-goal { font-size: 16px; color: #ffe9b0; letter-spacing: 2px; }
  #howto .hsec { font-size: 16px; color: #8a7c64; margin-top: 8px; }
  /* always-on chat, bottom left on EVERY screen */
  #chat {
    position: fixed; z-index: 7;
    bottom: calc(16px + var(--sab) * 0.6);
    left: calc(16px + var(--sal) * 0.6);
    display: flex; flex-direction: column; gap: 6px;
    pointer-events: none;
    font-family: Silkscreen, monospace; font-size: 16px; letter-spacing: 1px;
  }
  #chat-log {
    display: flex; flex-direction: column; gap: 3px;
    color: #e8dcc8; max-width: min(46vw, 360px);
    text-shadow: 1px 1px #000, -1px 1px #000, 1px -1px #000, -1px -1px #000;
  }
  .chat-msg { word-wrap: break-word; }
  .chat-msg .cname { color: #ffd25a; }
  .chat-msg .cname.me { color: #ff9a3c; }
  #chat-input {
    pointer-events: auto;
    width: min(40vw, 260px);
    font-family: Silkscreen, monospace; font-size: 16px; letter-spacing: 1px;
    color: #ffe9b0; background: rgba(10, 7, 4, 0.7);
    border: 0; outline: 0; padding: 7px 9px;
  }
  #chat-input::placeholder { color: #8a7c64; }
  #chat-input:focus {
    background: rgba(38, 26, 15, 0.95);
    outline: 1px solid #ffd25a;
  }
  /* the big center announce (ROUND N, GO, X WINS THE ROUND) */
  #announce {
    position: fixed; top: 38%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: Silkscreen, monospace;
    font-size: 64px;
    color: #ffd25a; letter-spacing: 4px; white-space: nowrap;
    text-shadow: -4px 0 #141008, 4px 0 #141008, 0 -4px #141008, 0 4px #141008,
      3px 3px #141008, -3px 3px #141008, 3px -3px #141008, -3px -3px #141008;
    pointer-events: none;
    display: none;
  }
  #announce.show { display: block; animation: apop 0.2s ease-out; }
  /* long status texts (NEXT ROUND SEATS YOU...) sit calmer and may wrap */
  #announce.long { font-size: 32px; white-space: normal; max-width: 92vw; }
  @keyframes apop {
    from { transform: translate(-50%, -50%) scale(1.6); }
    to { transform: translate(-50%, -50%) scale(1); }
  }
  /* shared overlay panel look (name gate, intermission, podium).
     justify-content flex-start + pbox margin:auto = centered when it
     fits, scrollable from the TOP when the embed is too short - a
     center-justified overflow clips BOTH ends and strands the buttons
     (measured in the Poki playground at 640x360) */
  .panel {
    position: fixed; inset: 0; z-index: 6;
    display: none;
    flex-direction: column;
    align-items: center; justify-content: flex-start;
    gap: 20px;
    background: rgba(5, 3, 2, 0.72);
    padding: 20px;
    overflow-y: auto; overflow-x: hidden;
    cursor: auto;   /* the bare canvas rule hides the OS cursor - not here */
    font-family: Silkscreen, monospace; color: #e8dcc8; letter-spacing: 1px;
  }
  .panel.show { display: flex; }
  .panel .pbox {
    position: relative;   /* the drain bars anchor to the bottom edge */
    margin: auto;         /* centers when it fits, scrolls when not */
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    background: rgba(20, 14, 8, 0.96);
    border: 0;
    padding: 22px 28px;
    box-shadow: 8px 8px 0 #000000;   /* hard-edged, pure black */
    flex-shrink: 0;
  }
  .tbar {
    position: absolute; bottom: 0; left: 0; height: 6px;
    background: #ffd25a; width: 100%;
  }
  .panel button {
    font-family: Silkscreen, monospace; font-size: 16px; letter-spacing: 1px;
    color: #e8dcc8; background: rgba(38, 26, 15, 0.85);
    border: 0; padding: 9px 20px; cursor: pointer;
  }
  .panel button:hover:enabled { background: rgba(74, 50, 27, 0.95); color: #ffe9b0; }
  .panel button:disabled { color: #8a7c64; cursor: default; }
  /* name gate */
  #gate-name, #rename-input {
    font-family: Silkscreen, monospace; font-size: 24px; letter-spacing: 2px;
    color: #ffe9b0; background: #14100a; border: 0; outline: 0;
    padding: 10px 14px; text-align: center; width: min(70vw, 320px);
    text-transform: uppercase;
  }
  #gate .glogo { width: min(60vw, 420px); image-rendering: auto; }
  /* intermission scoreboard */
  #inter-logo { width: min(50vw, 340px); image-rendering: auto; }
  #inter-sub { font-size: 24px; color: #ffd25a; letter-spacing: 4px;
               margin-top: -6px; margin-bottom: 34px; }
  #inter-players { width: min(80vw, 360px); text-align: left;
                   font-size: 16px; color: #8a7c64; margin-bottom: -4px; }
  #inter-rows { display: flex; flex-direction: column; gap: 10px;
                min-width: min(80vw, 360px); }
  .irow {
    display: grid; grid-template-columns: 1fr 44px 40px 26px;
    align-items: center; gap: 10px;
    font-size: 16px; color: #b9ac96;
  }
  .irow.me { color: #ff9a3c; }
  .irow .iname { display: flex; align-items: center; gap: 8px; }
  .irow .igain { color: #7ce07a; text-align: right; }
  .irow .iscore { color: #ffd25a; text-align: right; font-size: 24px; }
  .irow .iready { text-align: center; }
  .bot-ic { width: 16px; height: 14px; image-rendering: pixelated; }
  .check-ic { width: 18px; height: 18px; image-rendering: pixelated; }
  #inter-timer { font-size: 16px; color: #b9ac96; }
  #inter-timer-n { font-size: 48px; color: #ffd25a; line-height: 0.9; }
  #inter-waiting { font-size: 16px; color: #b9ac96; min-height: 14px; }
  #inter .side { display: flex; gap: 12px; }
  /* podium: blocks 2-1-3, characters + names on top, ties share a block */
  #podium-head { font-size: 32px; color: #ffd25a; }
  #podium-head.win { font-size: 64px; letter-spacing: 6px;
    text-shadow: -4px 0 #141008, 4px 0 #141008, 0 -4px #141008,
      0 4px #141008; }
  /* the final scoreboard hangs off the podium box's RIGHT side - the
     podium itself stays centered */
  #podium-score {
    position: absolute; left: calc(100% + 18px); top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 14, 8, 0.96);
    box-shadow: 8px 8px 0 #000000;
    padding: 18px 22px;
    display: flex; flex-direction: column; gap: 10px;
    min-width: 180px;
  }
  #pscore-head { font-size: 16px; color: #8a7c64; }
  .prow {
    display: flex; justify-content: space-between; align-items: center;
    gap: 18px; font-size: 16px; color: #b9ac96;
  }
  .prow.me { color: #ff9a3c; }
  .prow .pnm { display: flex; align-items: center; gap: 8px; }
  .prow .psc { color: #ffd25a; font-size: 24px; }
  /* the side scoreboard hangs OFF the podium box - anything narrower
     than a roomy desktop window (Poki's ~1020px embed included) clips
     it against the edge, so it hides early */
  @media (max-width: 1120px) { #podium-score { display: none; } }
  #podium-bottom {
    position: absolute; bottom: 10px; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
  }
  #podium-trailer {
    width: min(52vw, 380px); aspect-ratio: 16 / 9;
    border: 0; background: #000; pointer-events: none;
    box-shadow: 8px 8px 0 #000000;
  }
  #podium-wl {
    font-family: Silkscreen, monospace; font-size: 16px; letter-spacing: 1px;
    color: #1a0e04; text-decoration: none;
    background: #e07f1e;
    padding: 9px 20px;
    box-shadow: 4px 4px 0 #000000;
  }
  #podium-wl:hover { background: #ff9a3c; }
  #podium-blocks {
    display: flex; align-items: flex-end; justify-content: center; gap: 6px;
  }
  .pcol { display: flex; flex-direction: column; align-items: center; }
  .pblock { image-rendering: pixelated; }
  .p1 .pblock { width: min(30vw, 240px); }
  .p2 .pblock { width: min(26vw, 212px); }
  .p3 .pblock { width: min(23vw, 186px); }
  .pchars { display: flex; gap: 6px; align-items: flex-end;
            margin-bottom: -2px; }
  .pchar { display: flex; flex-direction: column; align-items: center;
           gap: 4px; }
  .pimg { width: 66px; image-rendering: pixelated; }
  .pname { font-size: 16px; color: #ffe9b0; }
  .pname.me { color: #ff9a3c; }
  .pscore { font-size: 16px; color: #ffd25a; }
  /* landscape-only on touch: portrait gets a full-screen rotate ask
     (a browser cannot force the orientation itself) */
  #touch-note {
    position: fixed; inset: 0; z-index: 10;
    background: #070503;
    display: none;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 18px; padding: 24px; text-align: center;
  }
  #touch-note img { width: min(80vw, 400px); }
  #touch-note .big {
    font-family: Silkscreen, monospace; font-size: 24px; letter-spacing: 2px;
    color: #ffd25a;
    text-shadow: 2px 2px #141008, -2px 2px #141008,
      2px -2px #141008, -2px -2px #141008;
  }
  @media (hover: none) and (pointer: coarse) and (orientation: portrait) {
    #touch-note { display: flex; }
  }
  /* the PWA hint under the rotate ask (web only - the Poki build
     strips it): installed, the game runs fullscreen without browser
     chrome, which no API can do on iPhone Safari */
  #pwa-hint {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px; margin-top: 10px;
  }
  .pwa-small {
    font-family: Silkscreen, monospace; font-size: 16px;
    letter-spacing: 1px; color: #b9ac96;
  }
  #pwa-btn {
    font-family: Silkscreen, monospace; font-size: 16px; letter-spacing: 1px;
    color: #1a0e04; background: #e07f1e;
    border: 0; padding: 10px 22px; cursor: pointer;
    box-shadow: 4px 4px 0 #000000;
  }
  #pwa-ios { display: none; color: #ffd25a; }
  /* touch devices: no practical mid-game typing - the chat input goes,
     the log stays; HOW TO PLAY swaps to the touch control rows; the
     wishlist slab makes way for the thumbs; the in-round scoreboard
     drops to HALF size (8px = Silkscreen's native, stays crisp) */
  body.touch #chat-input { display: none; }
  #howto-touch { display: none; }
  body.touch #howto-keys { display: none; }
  body.touch #howto-touch { display: grid; }
  body.touch #wishlist { display: none; }
  body.touch #hud-roster {
    font-size: 8px; gap: 3px; padding: 4px 6px; letter-spacing: 0;
  }
  body.touch .hrow { gap: 7px; }
  body.touch .hrow .bot-ic { width: 8px; height: 7px; }
  /* touch fullscreen gate: blocks play until the tap that grants it
     (game.js fsGateSync decides when it shows) */
  #fs-gate {
    position: fixed; inset: 0; z-index: 11;
    display: none;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 24px; padding: 24px;
    background: rgba(5, 3, 2, 0.88);
  }
  #fs-gate.show { display: flex; }
  #fs-btn {
    font-family: Silkscreen, monospace; font-size: 24px; letter-spacing: 2px;
    color: #1a0e04; background: #e07f1e;
    border: 0; padding: 16px 34px; cursor: pointer;
    box-shadow: 6px 6px 0 #000000;
  }
  /* Silkscreen is an 8 px pixel font: sizes stay on multiples of 8 or
     the browser antialiases them mushy */
  @media (max-width: 980px) { #announce { font-size: 48px; } }
  @media (max-width: 620px) { #announce { font-size: 32px; } }
  /* small embeds (the Poki playground): compact panel type so the
     whole intermission fits without scrolling. These sit LAST in the
     sheet on purpose - equal-specificity base rules above would win
     the cascade otherwise (shipped once). Silkscreen's tall line
     boxes (~2x the font size) are the main overflow. */
  /* the FULL panel needs ~650px of height, so the compact tier must
     engage well above it - Poki's desktop embed (~590px) sat in the
     gap between 560 and fitting, and overflowed */
  @media (max-height: 680px) {
    #announce { font-size: 32px; }
    #announce.long { font-size: 16px; }
    .panel { gap: 10px; padding: 12px; }
    .panel .pbox { gap: 8px; padding: 14px 20px; line-height: 1.15; }
    #inter-logo { width: min(26vw, 150px); }
    #inter-sub { font-size: 16px; margin-top: 0; margin-bottom: 4px; }
    #inter-rows { gap: 6px; }
    .irow .iscore { font-size: 16px; }
    #inter-timer-n { font-size: 32px; }
    #podium-head { font-size: 24px; }
    #podium-head.win { font-size: 32px; }
    #podium-trailer { display: none; }
    /* the match-over screen breathes on phones: the bottom strip flows
       UNDER the podium box instead of hovering over it, and the
       wishlist shrinks to fit below everything */
    #podium-bottom {
      position: static; left: auto; bottom: auto; transform: none;
      margin-top: 4px;
    }
    #podium-wl { font-size: 16px; padding: 6px 14px; }
    .pimg { width: 52px; }
  }
  @media (max-height: 420px) {
    #inter-logo { display: none; }
    #inter-sub { margin-bottom: 0; }
    #inter-players { margin-bottom: 0; }
    .panel .pbox { gap: 6px; padding: 10px 18px; line-height: 1; }
    #inter-rows { gap: 4px; }
    #inter-timer-n { font-size: 24px; }
    .panel button { padding: 6px 16px; line-height: 1; }
    #podium-head { font-size: 16px; }
    .p1 .pblock { width: min(20vw, 120px); }
    .p2 .pblock { width: min(17vw, 106px); }
    .p3 .pblock { width: min(15vw, 94px); }
    .pimg { width: 40px; }
    .pname, .pscore { font-size: 8px; letter-spacing: 0; }
  }
