  html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1124; }
  #view { position: fixed; inset: 0; }
  canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: default;
    user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
  body.fp canvas { cursor: crosshair; }
  #cross { position: fixed; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; pointer-events: none; display: none; }
  #cross::before, #cross::after { content: ''; position: absolute; background: rgba(255,255,255,.9); box-shadow: 0 0 2px rgba(0,0,0,.8); }
  #cross::before { left: 8px; top: 0; width: 2px; height: 18px; }
  #cross::after { top: 8px; left: 0; height: 2px; width: 18px; }
  body.fp #cross { display: block; }
  #palette { position: fixed; right: 16px; bottom: 16px; display: none; padding: 8px; background: rgba(20,12,28,.55);
    border: 1px solid rgba(255,220,230,.3); border-radius: 3px; pointer-events: none; }
  body.fp #palette { display: block; }
  body.fp.gunmode #palette, body.fp.gunmode #cross, body.fp.nademode #palette { display: none; }
  #gunCross { position: fixed; left: 50%; top: 50%; width: 0; height: 0; display: none; pointer-events: none; --g: 5px; }
  body.fp.gunmode #gunCross { display: block; }
  #gunCross i { position: absolute; background: rgba(255,255,255,.92); box-shadow: 0 0 2px rgba(0,0,0,.85); }
  #gunCross i:nth-child(1) { width: 2px; height: 7px; left: -1px; top: calc(-7px - var(--g)); }
  #gunCross i:nth-child(2) { width: 2px; height: 7px; left: -1px; top: var(--g); }
  #gunCross i:nth-child(3) { width: 7px; height: 2px; top: -1px; left: calc(-7px - var(--g)); }
  #gunCross i:nth-child(4) { width: 7px; height: 2px; top: -1px; left: var(--g); }
  #ammo { position: fixed; right: 22px; bottom: 18px; display: none; color: #fff; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
  body.fp.gunmode #ammo { display: block; }
  #ammo .row { display: flex; justify-content: flex-end; }
  #ammoNum { font: bold 38px/1 ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
  #ammoNum.low { color: #ff8a6a; }
  #ammoTicks { display: flex; gap: 2px; justify-content: flex-end; margin-top: 7px; }
  #ammoTicks i { width: 3px; height: 13px; background: #fff; border-radius: 1px; box-shadow: 0 1px 2px rgba(0,0,0,.5); }
  #ammoTicks i.spent { background: rgba(255,255,255,.18); box-shadow: none; }
  #reloadBar { height: 3px; margin-top: 6px; background: rgba(255,255,255,.12); visibility: hidden; }
  #reloadBar b { display: block; height: 100%; width: 0; background: #fff; }
  #ammo.reloading #reloadBar { visibility: visible; }
  #health { position: fixed; left: 22px; bottom: 18px; display: none; color: #fff; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
  body.fp #health { display: block; }
  #hpNum { font: bold 38px/1 ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
  #hpNum.low { color: #ff8a6a; } #hpNum.over { color: #ffd84a; text-shadow: 0 0 10px rgba(255,216,74,.6); }
  #hpBar { width: 120px; height: 5px; margin-top: 7px; background: rgba(255,255,255,.18); box-shadow: 0 1px 2px rgba(0,0,0,.5); }
  #hpBar b { display: block; height: 100%; width: 100%; background: #fff; transition: width .15s; }
  #gunCross.hit i { background: #ff4a4a; }
  #killfeed { position: fixed; right: 16px; top: 40px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: none;
    font: 14px Georgia, serif; color: #fff; }
  #killfeed div { padding: 4px 10px; background: rgba(20,14,26,.62); border-radius: 3px; transition: opacity .7s; }
  #killfeed div.out { opacity: 0; }
  #killfeed .who { font-weight: bold; }
  #respawn { position: fixed; left: 50%; top: 42%; transform: translate(-50%,-50%); display: none; pointer-events: none;
    font: bold 64px/1 ui-monospace, Menlo, Consolas, monospace; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.7); }
  #respawn.show { display: block; }
  /* watching: small, at the bottom (who you watch, or that you wait) */
  body.spectating #respawn { top: auto; bottom: 9%; transform: translateX(-50%); font-size: 22px; opacity: .85; }
  #join { position: fixed; left: 50%; top: 45%; transform: translate(-50%,-50%); display: none; width: 260px; padding: 14px; color: #fff;
    background: rgba(30,30,34,.9); border: 1px solid rgba(255,255,255,.25); border-radius: 4px; font: 14px Georgia, serif; z-index: 20; }
  body.joining #join { display: block; }
  #join label { display: flex; align-items: center; gap: 8px; }
  #join input { flex: 1; font: 14px Georgia, serif; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.35); border-radius: 3px; padding: 5px 7px; }
  #join label + label { margin-top: 8px; }
  #join select { flex: 1; font: 14px Georgia, serif; color: #fff; background: #2a2230; border: 1px solid rgba(255,255,255,.35); border-radius: 3px; padding: 4px 5px; }
  #join label > :first-child, #join label { white-space: nowrap; }
  #join .tabs { display: flex; gap: 6px; margin-top: 10px; }
  #join button { flex: 1; font: 13px Georgia, serif; color: #fff; border-radius: 3px; padding: 7px 4px; cursor: pointer;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.3); }
  #joinTeams button { text-shadow: 0 1px 3px rgba(0,0,0,.5); }
  #join button:hover { filter: brightness(1.15); }
  #gunCross.hit.head i { background: #ffd23f; }

  #palGrid { display: grid; grid-template-columns: repeat(8, 16px); gap: 2px; }
  #palGrid div { width: 16px; height: 16px; box-sizing: border-box; }
  #palGrid div.sel { outline: 2px solid #fff; outline-offset: 1px; position: relative; z-index: 1; box-shadow: 0 0 0 3px rgba(0,0,0,.6); }
  #palSize { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: #fff; font: 12px Georgia, serif; }
  #palSize i { width: 16px; height: 16px; background: var(--c, #888); border: 1px solid rgba(255,255,255,.7); box-sizing: border-box; }
  #palSize.quarter i { width: 8px; height: 8px; margin: 4px; }
  #palSize.lit i { box-shadow: 0 0 6px 2px var(--c); }
  #palLight { margin-left: auto; font-weight: normal; opacity: .85; }
  #palLight.on { color: #ffd77a; opacity: 1; }
  #palLight.na { opacity: .4; }
  #palGrid div.lc::after { content: ''; display: block; width: 4px; height: 4px; margin: 6px; border-radius: 50%; background: rgba(0,0,0,.45); }
  canvas:active { cursor: grabbing; }
  #opts { display: none; margin-top: 10px; padding: 10px 12px; background: rgba(30,18,40,.55); border: 1px solid rgba(255,220,230,.35);
    border-radius: 3px; backdrop-filter: blur(6px); pointer-events: auto; font: 13px/1.3 Georgia, serif; width: max-content; }
  #opts.open { display: grid; grid-template-columns: auto auto; gap: 6px 12px; align-items: center; max-height: calc(100vh - 200px); overflow-y: auto; }
  #opts input[type=range] { width: 110px; }
  #opts .range { display: flex; align-items: center; gap: 8px; }
  #opts output { min-width: 32px; font-variant-numeric: tabular-nums; }
  #opts select { font: 13px Georgia, serif; background: rgba(255,255,255,.9); border: 0; border-radius: 2px; padding: 2px 4px; }
  /* the model editor: everything floats over the model, in dark glass panels */
  #editor { display: none; }
  body.editor #editor { display: block; }
  #edTools, .ed-toggle, #edTabs .tab, #edFoot button { backdrop-filter: blur(8px); }
  #edTools { position: fixed; left: 16px; top: 16px; display: flex; flex-direction: column; gap: 2px; padding: 6px;
    background: rgba(24,16,30,.78); border: 1px solid rgba(255,220,230,.22); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.35); }
  #edTools button { width: 62px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; color: #f3e9ee;
    background: none; border: 1px solid transparent; border-radius: 8px; font: 11px Georgia, serif; cursor: pointer; }
  #edTools button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  #edTools button:hover:not(:disabled) { background: rgba(255,255,255,.1); }
  #edTools button.on { background: #c8352c; border-color: #e9b04a; color: #fff6e8; }
  #edTools button:disabled { opacity: .35; cursor: default; }
  body.edgun #edTpose, body.edobj #edTpose { display: none; }
  #edTools hr { width: 70%; border: 0; border-top: 1px solid rgba(255,220,230,.2); margin: 5px auto; }
  #edSizes { display: flex; flex-direction: column; gap: 2px; }
  #edSizes:empty { display: none; }
  #edSizes button { padding: 6px 0; }
  #edSizes i { display: block; background: currentColor; border-radius: 1px; }
  #edSwitch { position: fixed; right: 16px; top: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
  .ed-toggle { display: flex; padding: 4px; gap: 4px; background: rgba(24,16,30,.78); border: 1px solid rgba(255,220,230,.25); border-radius: 999px;
    box-shadow: 0 8px 28px rgba(0,0,0,.35); }
  .ed-toggle button { font: 15px Georgia, serif; color: #f3e9ee; background: none; border: 0; border-radius: 999px; padding: 8px 20px; cursor: pointer; transition: background .15s; }
  .ed-toggle.big button { font-size: 19px; padding: 11px 28px; }
  .ed-toggle button:hover:not(.on) { background: rgba(255,255,255,.1); }
  .ed-toggle button.on { background: #c8352c; color: #fff6e8; box-shadow: 0 0 0 1px #e9b04a inset; }
  #edTabs { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 4px;
    max-width: calc(100vw - 560px); overflow-x: auto; padding: 0 4px; scrollbar-width: thin; }
  /* narrower screens: the tabs sit above Save, left of the palette */
  @media (max-width: 1150px) { #edTabs { left: 16px; transform: none; bottom: 64px; max-width: calc(100vw - 250px); }
    #edTabs .tab { border-bottom: 1px solid rgba(255,220,230,.22); border-radius: 10px; } #edTabs .tab.on { padding-bottom: 11px; } }
  #edTabs .tab { flex: none; display: flex; align-items: center; gap: 7px; font: 15px Georgia, serif; color: #f3e9ee; background: rgba(24,16,30,.66);
    border: 1px solid rgba(255,220,230,.22); border-bottom: 0; border-radius: 10px 10px 0 0; padding: 9px 16px 11px; cursor: pointer; }
  #edTabs .tab:hover { background: rgba(40,28,48,.85); }
  #edTabs .tab.on { background: rgba(200,53,44,.92); border-color: #e9b04a; color: #fff6e8; padding-bottom: 15px; }
  #edTabs .tab .dot { width: 7px; height: 7px; border-radius: 50%; background: #ffd77a; }
  #edTabs .tab em { font: italic 11px Georgia, serif; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.18); }
  #edTabs .tab .x { opacity: 0; font-size: 17px; line-height: 1; margin-right: -6px; }
  #edTabs .tab:hover .x { opacity: .6; }
  #edTabs .tab .x:hover { opacity: 1; color: #ffb0a8; }
  #edTabs .tab.plus { font-size: 20px; padding: 7px 15px 9px; }
  #edFoot { position: fixed; left: 16px; bottom: 16px; display: flex; gap: 6px; }
  #edFoot button { font: 14px Georgia, serif; color: #f3e9ee; background: rgba(24,16,30,.78); border: 1px solid rgba(255,220,230,.25); border-radius: 8px;
    padding: 9px 16px; cursor: pointer; }
  #edFoot button:hover { background: rgba(60,42,70,.9); }
  #edFoot button.go { font-size: 16px; padding: 9px 26px; background: #c8352c; border-color: #e9b04a; color: #fff6e8; }
  #edFoot button.go:hover { background: #d8463c; }
  /* team colour shows as a rainbow in the palette (and on the model) */
  body.editor:not(.edgun) #palGrid div.flex1 { background: conic-gradient(#ff5a5a, #ffd84a, #5ce07a, #4ab8ff, #b07aff, #ff5a5a) !important; }
  /* a box of its own above the grid (characters): the team colour the model shows (click the swatch, then a colour in
     the grid), and how much of its outside is team colour */
  #palTeam { position: absolute; right: -1px; bottom: 100%; margin-bottom: 8px; display: none; align-items: center; gap: 9px; padding: 7px 10px;
    background: rgba(20,12,28,.55); border: 1px solid rgba(255,220,230,.3); border-radius: 3px; color: #fff; font: 12px Georgia, serif; white-space: nowrap; }
  body.editor:not(.edgun) #palTeam { display: flex; }
  #palTeamCol { width: 22px; height: 16px; padding: 0; border: 1px solid rgba(255,255,255,.7); border-radius: 2px; cursor: pointer; }
  #palTeamCol.picking { outline: 2px solid #ffe3a3; outline-offset: 2px; animation: palPick 1s ease-in-out infinite alternate; }
  @keyframes palPick { to { outline-color: rgba(255,227,163,.25); } }
  #palTeamPct { font-weight: bold; font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }
  body.edobj #palTeamPct { display: none; }
  #palTeamPct.low { color: #ff6b5e; }
  /* the game mode editor: a flowchart board between settings (left) and tiles (right) */
  #controls { z-index: 25; }
  #ge { position: fixed; inset: 0; display: none; grid-template-columns: 300px 1fr 280px; grid-template-rows: 50px 1fr; background: #17131c; color: #eee6ee;
    font: 13px Georgia, serif; z-index: 10; }
  body.modeedit #ge { display: grid; }
  @media (max-width: 1200px) { #ge { grid-template-columns: 230px 1fr 220px; } #geTabs { max-width: calc(100vw - 470px); } }
  body.modeedit #menu { display: none; }
  #geTop { grid-column: 1 / 4; display: flex; align-items: flex-end; gap: 6px; padding: 0 12px; background: #1f1925; border-bottom: 1px solid rgba(255,220,230,.14); }
  #geTop .grow { flex: 1; }
  #geTop > button { align-self: center; font: 13px Georgia, serif; color: #f3e9ee; background: rgba(255,255,255,.08); border: 1px solid rgba(255,220,230,.22);
    border-radius: 6px; padding: 7px 13px; cursor: pointer; }
  #geTop > button:hover { background: rgba(255,255,255,.16); }
  #geTop > button.go { background: #c8352c; border-color: #e9b04a; color: #fff6e8; padding: 7px 20px; }
  #geTabs { display: flex; align-items: flex-end; gap: 3px; overflow-x: auto; max-width: calc(100vw - 520px); scrollbar-width: thin; }
  #geTabs .tab { flex: none; display: flex; align-items: center; gap: 7px; font: 14px Georgia, serif; color: #d9cfdc; background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,220,230,.16); border-bottom: 0; border-radius: 8px 8px 0 0; padding: 8px 14px; cursor: pointer; }
  #geTabs .tab:hover { background: rgba(255,255,255,.1); }
  #geTabs .tab.on { background: #17131c; color: #fff; border-color: rgba(255,220,230,.35); box-shadow: inset 0 2px 0 #c8352c; }
  #geTabs .tab .dot { width: 7px; height: 7px; border-radius: 50%; background: #ffd77a; }
  #geTabs .tab .x { opacity: 0; font-size: 16px; line-height: 1; } #geTabs .tab:hover .x { opacity: .6; } #geTabs .tab .x:hover { opacity: 1; color: #ffb0a8; }
  #geTabs .tab.plus { font-size: 18px; padding: 6px 13px; }
  #geLeft, #geRight { overflow-y: auto; background: #1b1621; padding: 10px 14px 20px; scrollbar-width: thin; }
  #geLeft { border-right: 1px solid rgba(255,220,230,.12); } #geRight { border-left: 1px solid rgba(255,220,230,.12); }
  #geLeft h4 { margin: 16px 0 8px; font-size: 11px; font-weight: normal; letter-spacing: .12em; text-transform: uppercase; color: #ffd6e0; }
  #geLeft h4.warn { color: #ffb37a; } #geLeft h4.ok { color: #a6e3a1; }
  .gs-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
  .gs-row > span { flex: 1; opacity: .85; }  .gs-row input[type=number], .gs-row select, .gi-row input, .gi-row select { width: 120px; font: 13px Georgia, serif; color: #fff; background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.22); border-radius: 4px; padding: 4px 6px; }
  .gs-row select option, .gi-row select option { color: #222; }
  .gs-team { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
  .gs-team input { flex: 1; min-width: 0; font: 13px Georgia, serif; color: #fff; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.22); border-radius: 4px; padding: 4px 6px; }
  .gs-swatch { flex: none; width: 26px; height: 26px; border: 2px solid rgba(255,255,255,.5); border-radius: 5px; cursor: pointer; padding: 0; }
  .gs-swatch:hover { border-color: #fff; }
  .gs-need { display: flex; align-items: center; gap: 8px; margin: 6px 0; } .gs-need > span { flex: 1; opacity: .85; }
  .gs-role { display: flex; align-items: center; gap: 7px; margin: 6px 0; } .gs-role > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .gs-role .gs-mark { display: flex; align-items: center; gap: 3px; font-size: 12px; opacity: .85; }
  .gs-role select.gs-look { width: 90px; font: 12px Georgia, serif; color: #fff; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.22); border-radius: 4px; padding: 3px 4px; }
  .gs-role select.gs-look option { color: #222; }
  .gs-need select.gs-look { width: 96px; font: 12px Georgia, serif; color: #fff; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.22); border-radius: 4px; padding: 3px 4px; }
  .gs-need select.gs-look option { color: #222; }
  .gi-row input[type=checkbox] { width: auto; align-self: flex-start; transform: scale(1.2); }
  .gs-need em { font-style: normal; opacity: .6; font-size: 12px; }
  .gs-need input { width: 64px; font: 13px Georgia, serif; color: #fff; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.22); border-radius: 4px; padding: 4px 6px; }
  .gs-max { margin-top: -2px; } .gs-max .gs-mark { flex: 1; display: flex; align-items: center; gap: 4px; font-size: 12px; opacity: .85; } .gs-max input[type=checkbox] { width: auto; }
  .ge-pop { position: fixed; z-index: 40; display: none; width: 288px; padding: 6px; background: #241d2b; border: 1px solid rgba(255,220,230,.3); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
  .ge-pop.show { display: grid; } .ge-pop:not(.show) { display: none; }
  .gs-prob { margin: 4px 0; padding: 5px 8px; line-height: 1.35; border-left: 2px solid #ffb37a; background: rgba(255,179,122,.08); border-radius: 0 4px 4px 0; }
  #geCanvas { position: relative; overflow: hidden; cursor: default; background-color: #15111a;
    background-image: radial-gradient(circle, rgba(255,255,255,.09) 1px, transparent 1.2px); }
  #geCanvas.panning { cursor: grabbing; }
  #geWorld { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
  #geWires { position: absolute; left: 0; top: 0; overflow: visible; }
  #geWires path { fill: none; }
  #geWires path.w { stroke-width: 2; pointer-events: none; }
  #geWires path.w.sel { stroke: #ffe3a3 !important; stroke-width: 3; }
  #geWires path.w.temp { stroke: #ffe3a3; stroke-dasharray: 6 4; }
  #geWires path.hit { stroke: transparent; stroke-width: 12; pointer-events: stroke; cursor: pointer; }
  .gn { position: absolute; width: 200px; height: 54px; display: flex; align-items: stretch; background: #241d2b; border: 1px solid rgba(255,255,255,.14);
    border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.35); cursor: grab; user-select: none; }
  .gn.sel { border-color: #ffe3a3; box-shadow: 0 0 0 2px rgba(255,227,163,.35), 0 4px 14px rgba(0,0,0,.35); }
  /* gold: the game's flow (every mode has these); grey: asks the map for something */
  .gn.must { border: 2px solid #e8b94a; box-shadow: 0 0 0 1px rgba(232,185,74,.25), 0 0 14px rgba(232,185,74,.18), 0 4px 14px rgba(0,0,0,.35); }
  .gn.req { border: 2px solid #9a94a3; }
  .gn.sel { border-color: #ffe3a3; }
  .gn.shake { animation: geShake .35s; }
  @keyframes geShake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
  .gic { flex: none; width: 40px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; background: var(--cc); border-radius: 5px 0 0 5px; }
  .gtx { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 9px; gap: 2px; }
  .gtx b { font-weight: normal; font-size: 13.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gtx small { font-size: 11px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gin { position: absolute; width: 10px; height: 10px; background: #17131c; border: 2px solid var(--cc); border-radius: 2px; left: 50%; top: -7px; transform: translateX(-50%); }
  .gout { position: absolute; width: 10px; height: 10px; bottom: -7px; transform: translateX(-50%); cursor: crosshair; background: #17131c; border: 2px solid var(--cc); border-radius: 2px;
    display: flex; align-items: center; justify-content: center; font: bold 11px/1 Arial, sans-serif; font-style: normal; color: #fff; }
  .gout:hover { background: #ffe3a3; color: #17131c; }
  /* outputs that mean something carry their mark: Yes a tick, No a cross, next round, game won */
  .gout.o-yes, .gout.o-no, .gout.o-next, .gout.o-over { width: 16px; height: 16px; bottom: -10px; border-radius: 4px; }
  .gout.o-yes { background: #2f7d3a; border-color: #7fc97f; } .gout.o-no { background: #8f3328; border-color: #e0816b; }
  .gout.o-next { background: #4a4552; border-color: #b7b0c0; } .gout.o-over { background: #8a6a17; border-color: #ffc23a; }
  #geInspect { margin-bottom: 12px; padding: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,220,230,.16); border-radius: 6px; }
  #geInspect.empty { display: none; }
  .gi-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 15px; color: #fff; }
  .gi-head i { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-style: normal; background: var(--cc); border-radius: 4px; }
  .gi-give { margin-bottom: 8px; font-size: 11.5px; opacity: .7; line-height: 1.4; }
  .gi-row { display: flex; flex-direction: column; gap: 3px; margin: 7px 0; } .gi-row > span { font-size: 11.5px; opacity: .75; }
  .gi-row input, .gi-row select { width: 100%; box-sizing: border-box; }
  .ge-cols { display: grid; grid-template-columns: repeat(16, 1fr); gap: 1px; }
  .ge-cols i { aspect-ratio: 1; cursor: pointer; border-radius: 1px; } .ge-cols i.on { outline: 2px solid #fff; outline-offset: 1px; position: relative; z-index: 1; }
  .gi-del { margin-top: 6px; width: 100%; font: 12px Georgia, serif; color: #ffb0a8; background: none; border: 1px solid rgba(255,140,130,.35); border-radius: 4px; padding: 5px; cursor: pointer; }
  .gi-del:hover { background: rgba(255,140,130,.12); }
  #geFilter { width: 100%; box-sizing: border-box; margin-bottom: 8px; font: 13px Georgia, serif; color: #fff; background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.2); border-radius: 4px; padding: 6px 8px; }
  .gp-cat { width: 100%; display: flex; align-items: center; justify-content: space-between; margin: 8px 0 4px; padding: 6px 8px; font: 13px Georgia, serif; color: #fff;
    background: rgba(255,255,255,.05); border: 0; border-left: 3px solid var(--cc); border-radius: 3px; cursor: pointer; }
  .gp-cat b { font-weight: normal; font-size: 11px; padding: 1px 7px; border-radius: 8px; border: 1px solid var(--cc); }
  .gp-item { display: flex; align-items: center; gap: 8px; margin: 3px 0; padding: 4px 6px 4px 4px; border: 1px solid rgba(255,255,255,.08); border-radius: 4px; cursor: grab; user-select: none; }
  .gp-item:hover { background: rgba(255,255,255,.07); border-color: var(--cc); }
  .gp-item.must { border-color: rgba(232,185,74,.7); } .gp-item.req { border-color: rgba(154,148,163,.75); }
  .gp-item.have { cursor: pointer; opacity: .62; } .gp-item.have:hover { opacity: 1; }
  .gp-item i { width: 24px; height: 24px; flex: none; display: flex; align-items: center; justify-content: center; font-style: normal; color: #fff; background: var(--cc); border-radius: 3px; }
  .gp-ghost { position: fixed; z-index: 30; transform: translate(-50%,-50%); padding: 10px 14px; pointer-events: none; color: #fff; font: 13px Georgia, serif;
    background: #241d2b; border: 1px solid var(--cc); border-left: 6px solid var(--cc); border-radius: 6px; opacity: .9; }
  body.gesaving #geSaveBox { display: block; }
  #geSaveBox { z-index: 16; width: min(440px, calc(100vw - 32px)); }
  #geSaveBox .row input { max-width: none; }
  /* the Save box */
  body.edsaving #edSaveBox { display: block; }
  #edSaveBox { z-index: 16; width: min(500px, calc(100vw - 32px)); }
  #edSaveBox .row input { max-width: none; }
  #esTeam .meter { position: relative; flex: 1; height: 10px; border-radius: 5px; background: rgba(255,255,255,.12); overflow: hidden; }
  #esTeam .meter b { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #ff5a5a, #ffd84a, #5ce07a, #4ab8ff, #b07aff); }
  #esTeam .meter i { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; }
  #esTeam.low output { color: #ff8a80; }
  #esTeam output { min-width: 108px; text-align: right; font-size: 13px; }
  body.editor #ui, body.editor #fps { display: none; }
  body.editor #palette { display: block; pointer-events: auto; }
  body.editor #palSize { display: none; }
  body.editor #palGrid div { cursor: pointer; }
  body.editor canvas { cursor: crosshair; }
  #controls { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); display: none; z-index: 20; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow-y: auto;
    max-height: calc(100vh - 32px); overflow: auto; padding: 16px 20px 18px; color: #fff; background: rgba(24,16,30,.92);
    border: 1px solid rgba(255,220,230,.3); border-radius: 4px; font: 13px Georgia, serif; }
  #controls.open { display: block; }
  #controls .head { display: flex; align-items: center; justify-content: space-between; font-size: 18px; margin-bottom: 10px; }
  #controls .head button { font: 12px Georgia, serif; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.3);
    border-radius: 3px; padding: 5px 10px; cursor: pointer; }
  #controls .cols { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 4px 28px; }
  #controls h4 { margin: 10px 0 6px; font-size: 13px; font-weight: normal; color: #ffd6e0; letter-spacing: .04em; }
  #controls dl { display: grid; grid-template-columns: auto auto; gap: 4px 14px; margin: 0; }
  #controls dt { opacity: .75; }
  /* only the sections for what you are doing (data-ctx, set by toggleControls); everything from the main menu */
  #controls:not([data-ctx=all]) section { display: none; }
  #controls[data-ctx=fp] section[data-show=fp], #controls[data-ctx=mapedit] section[data-show=mapedit],
  #controls[data-ctx=mapedit-fp] section[data-show=mapedit-fp], #controls[data-ctx=models] section[data-show=models],
  #controls[data-ctx=modeedit] section[data-show=modeedit] { display: block; }
  #controls:not([data-ctx=all]) .cols { grid-template-columns: repeat(auto-fit, minmax(240px, max-content)); }
  #controls dd { margin: 0; text-align: right; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
  @media (max-width: 1100px) { #controls .cols { grid-template-columns: repeat(2, minmax(180px, 1fr)); } }
  @media (max-width: 560px) { #controls .cols { grid-template-columns: 1fr; } }
  #toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 8px 14px; color: #fff;
    background: rgba(30,18,40,.8); border: 1px solid rgba(255,220,230,.4); border-radius: 3px; font: 13px Georgia, serif;
    opacity: 0; transition: opacity .3s; pointer-events: none; }
  #toast.show { opacity: 1; }
  #fps { position: fixed; right: 16px; top: 14px; color: #fff; font: 13px Georgia, serif; text-shadow: 0 1px 4px rgba(0,0,0,.7); display: none; pointer-events: none; }
  /* in a match: time of day top left, the map top right */
  #ui, #mapPick { position: fixed; top: 16px; display: none; margin: 0; }
  #ui { left: 16px; } #mapPick { right: 16px; }
  body.match:not(.online) #fps { top: 56px; }   /* (single player: under the map picker) */
  body.match #ui, body.match #mapPick { display: flex; }
  body.match.locked #ui, body.match.locked #mapPick { opacity: .55; pointer-events: none; }
  body.online.locked #ui, body.online.locked #mapPick { display: none; }   /* online, the score bars have the top: these come back when paused */
  body.online #ui, body.online #mapPick { display: none; }   /* online: the host picks the next game's map, time and mode on the end screen (#nextGame) */
  #nextGame { position: fixed; left: 40px; top: 50%; transform: translateY(-50%); display: none; flex-direction: column; gap: 10px; padding: 16px 18px; z-index: 5;
    background: rgba(20,12,28,.62); border: 1px solid rgba(255,220,230,.25); border-radius: 4px; color: #fff; font: 14px Georgia, serif; animation: pauseIn .6s ease both; }
  body.hosting.between #nextGame, body.owner.between #nextGame { display: flex; }
  body.paused #nextGame { display: none; }
  /* the end of a game, the mouse free: Exit to the main menu (bottom right) */
  #overExit { position: fixed; right: 22px; bottom: 96px; display: none; z-index: 13; padding: 9px 26px; font: 18px Georgia, serif; letter-spacing: .06em; color: #fff; cursor: pointer;
    background: rgba(20,12,28,.62); border: 1px solid rgba(255,220,230,.3); border-radius: 4px; animation: pauseIn .6s ease both; }
  #overExit:hover { background: rgba(255,255,255,.14); border-color: rgba(255,227,163,.6); }
  body.online.gameover:not(.locked):not(.paused):not(.touch) #overExit { display: block; }
  #nextGame h5 { margin: 0 0 2px; font: 12px Georgia, serif; letter-spacing: .25em; text-transform: uppercase; opacity: .75; }
  #nextGame label { display: flex; flex-direction: column; gap: 4px; }
  #nextGame span { font-size: 12px; opacity: .7; }
  #nextGame select { font: 15px Georgia, serif; padding: 5px 8px; min-width: 190px; color: #fff; background: rgba(255,255,255,.07); border: 1px solid rgba(255,220,230,.28); border-radius: 3px; cursor: pointer; }
  #nextGame select:hover, #nextGame select:focus { background: rgba(255,255,255,.14); outline: none; border-color: rgba(255,227,163,.6); }
  #nextGame option { background: #2a2233; color: #fff; }
  /* paused: the match's own screen (scores, timers, markers, the game over, the scoreboard) fades out under the menu, back on Resume */
  #hud, #hudMsg, #hudCount, #hudOver, #hudProg, #hudWays, #board, #killfeed, #respawn { transition: opacity .3s; }
  body.paused #hud, body.paused #hudMsg, body.paused #hudCount, body.paused #hudOver, body.paused #hudProg, body.paused #hudWays, body.paused #board, body.paused #killfeed, body.paused #respawn { opacity: 0 !important; }
  body.paused #pause { animation: pauseIn .3s ease-out; }
  @keyframes pauseIn { from { opacity: 0; } }
  body.match #killfeed { top: 60px; }
  /* the game mode's screen */
  #hud { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
    color: #fff; font: 13px Georgia, serif; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
  body.online.fp #hud { display: flex; }
  #hudScore { display: flex; gap: 14px; }
  .hs-team { display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 8px; padding: 6px 10px; background: rgba(20,14,26,.55);
    border: 1px solid rgba(255,255,255,.12); border-radius: 6px; }
  .hs-team.me { border-color: rgba(255,255,255,.45); }
  .hs-name { grid-column: 1 / 3; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--tc); filter: brightness(1.35); }
  .hs-bar { width: 150px; height: 10px; border-radius: 5px; background: rgba(255,255,255,.12); overflow: hidden; }
  .hs-bar b { display: block; height: 100%; background: var(--tc); box-shadow: 0 0 8px var(--tc); transition: width .3s; }
  .hs-num { font: bold 18px Georgia, serif; min-width: 26px; text-align: right; }
  .hs-pips { grid-column: 1 / 3; display: flex; gap: 4px; }
  .hs-pips i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--tc); }
  .hs-pips i.on { background: var(--tc); }
  #hudTimers { font: 16px Georgia, serif; letter-spacing: .04em; white-space: pre; }
  #hudTimers:empty { display: none; }
  #hudNote { display: flex; flex-direction: column; align-items: center; gap: 3px; }
  #hudNote div { padding: 3px 10px; background: rgba(20,14,26,.5); border-radius: 3px; transition: opacity .7s; }
  #hudNote div.out { opacity: 0; }
  #hudMsg { position: fixed; left: 50%; top: 28%; transform: translate(-50%,-50%); opacity: 0; pointer-events: none; white-space: nowrap;
    font: 42px Georgia, serif; letter-spacing: .03em; color: #fff; text-shadow: 0 3px 18px rgba(0,0,0,.75), 0 0 2px rgba(0,0,0,.6); }
  #hudMsg.show { animation: hudMsg 3.4s ease forwards; }
  @keyframes hudMsg { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.85); } 10%, 75% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; } }
  /* the countdown before a round: a big number each second, the last three red-hot, then GO */
  #hudCount { position: fixed; left: 50%; top: 43%; transform: translate(-50%,-50%); pointer-events: none; opacity: 0; z-index: 11;
    font: 120px/1 Georgia, serif; color: #fff; text-shadow: 0 4px 24px rgba(0,0,0,.6), 0 0 2px rgba(0,0,0,.8); }
  #hudCount.show { animation: hudCount 1s ease-out forwards; }
  #hudCount.last { color: #ffd6a0; text-shadow: 0 0 30px rgba(245,98,31,.75), 0 4px 24px rgba(0,0,0,.6); }
  #hudCount.go { font-size: 150px; letter-spacing: .08em; color: #ffe3a3; text-shadow: 0 0 40px rgba(250,217,55,.8), 0 4px 24px rgba(0,0,0,.6); animation: hudGo 1.2s ease-out forwards; }
  @keyframes hudCount { 0% { opacity: 0; transform: translate(-50%,-50%) scale(1.6); } 15% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-50%) scale(.85); } }
  @keyframes hudGo { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.6); } 20% { opacity: 1; transform: translate(-50%,-50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); } }
  body:not(.online) #hudCount { display: none; }
  /* the end of a game: who won, in their colour, over the final scores */
  #hudOver { position: fixed; left: 50%; top: 40%; transform: translate(-50%,-50%); display: none; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
    color: #fff; font: 15px Georgia, serif; text-shadow: 0 2px 12px rgba(0,0,0,.75); z-index: 11; }
  #hudOver.show { display: flex; animation: hudOver .9s ease both; }
  @keyframes hudOver { from { opacity: 0; transform: translate(-50%,-46%) scale(.9); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
  #hudOver > small { font-size: 13px; letter-spacing: .4em; text-transform: uppercase; opacity: .8; }
  #hudOver > b { font: 64px Georgia, serif; font-weight: normal; letter-spacing: .02em; color: var(--oc); filter: brightness(1.3); }
  #hudOver .ho-board { display: flex; flex-direction: column; gap: 4px; min-width: 260px; padding: 10px 16px; background: rgba(20,14,26,.6); border-radius: 6px;
    border-top: 3px solid var(--oc); }
  .ho-row { display: flex; justify-content: space-between; gap: 30px; font-size: 18px; } .ho-row span { color: var(--tc); filter: brightness(1.35); }
  .ho-row b { font: bold 20px Georgia, serif; color: #fff; filter: none; letter-spacing: 0; } .ho-row.first { font-size: 22px; } .ho-row.first b { font-size: 24px; }
  #hudOver > span { font-size: 15px; letter-spacing: .08em; opacity: .85; }
  body.gameover #hudWays, body.gameover #hudTimers, body.gameover #hudMsg { display: none !important; }
  #hudProg { position: fixed; left: 50%; top: 58%; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 5px; pointer-events: none;
    color: #fff; font: 14px Georgia, serif; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
  #hudProg.show { display: flex; }
  #hudProg div { width: 220px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.18); overflow: hidden; }
  #hudProg b { display: block; height: 100%; background: #ffe3a3; }
  #hudWays { position: fixed; inset: 0; pointer-events: none; display: none; }
  body.online.fp #hudWays { display: block; }
  #hudWays .way { position: absolute; transform: translate(-50%,-50%); padding: 4px 11px; border-radius: 12px; font: bold 17px Georgia, serif; color: #fff;
    background: rgba(20,14,26,.6); border: 3px solid var(--wc); box-shadow: 0 0 12px var(--wc); text-shadow: 0 1px 3px rgba(0,0,0,.7); white-space: nowrap; }
  /* standing in the zone: its marker big at the top of the screen, under the scores */
  #hudWays .way.here { top: 122px; font-size: 30px; padding: 6px 22px; border-width: 4px; border-radius: 18px; animation: wayHere 1.6s ease-in-out infinite; }
  @keyframes wayHere { 50% { box-shadow: 0 0 26px var(--wc); } }
  /* a teammate's name over their head */
  #hudWays .way.name { background: none; border: none; box-shadow: none; padding: 0; font: 13px Georgia, serif; color: var(--wc);
    text-shadow: 0 0 3px #000, 0 1px 2px #000; filter: brightness(1.35); }
  #hudWays .way.armed { animation: wayArmed .5s steps(2) infinite; }
  @keyframes wayArmed { 50% { border-color: #fff; } }
  #hudWays .way.far { opacity: .75; }
  #hudWays .way.role { background: var(--wc); border-color: rgba(255,255,255,.85); font-size: 12px; letter-spacing: .04em; }
  /* the scoreboard: eight players a side fit, more scroll (the wheel while Tab is held, a finger on a touch screen) */
  #board { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); display: none; align-items: flex-start; gap: 24px; padding: 18px 24px;
    max-height: min(218px, calc(100vh - 72px)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent;
    background: rgba(20,14,26,.85); border: 1px solid rgba(255,220,230,.25); border-radius: 8px; color: #fff; font: 14px Georgia, serif; z-index: 12; }
  #board.show { display: flex; }
  #board.over { top: auto; bottom: max(16px, 4vh); transform: translateX(-50%); }
  #board.over, body.touch #board { pointer-events: auto; touch-action: pan-y; }
  #hudOver.up { top: 30%; transition: top .6s ease; }
  /* when you die: whom you hurt that life */
  #hudDealt { position: fixed; right: 22px; top: 38%; display: none; min-width: 170px; padding: 10px 14px; background: rgba(20,14,26,.72); border: 1px solid rgba(255,220,230,.25);
    border-radius: 8px; color: #fff; font: 14px Georgia, serif; pointer-events: none; z-index: 11; }
  #hudDealt.show { display: block; animation: dealtIn .25s ease-out; }
  @keyframes dealtIn { from { opacity: 0; transform: translateX(16px); } }
  #hudDealt h5 { margin: 0 0 6px; font-size: 11px; font-weight: normal; letter-spacing: .1em; text-transform: uppercase; opacity: .65; }
  #hudDealt div { display: flex; justify-content: space-between; gap: 18px; margin: 3px 0; } #hudDealt b { font-variant-numeric: tabular-nums; color: #ffe3a3; }
  /* points: +100 killed someone, +25 an assist */
  #hudPts { position: fixed; left: 50%; bottom: 27%; transform: translateX(-50%); display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; pointer-events: none; z-index: 11; }
  #hudPts div { font: 16px Georgia, serif; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); animation: ptsUp 2.6s ease-out forwards; white-space: nowrap; }
  #hudPts div b { color: #ffd84a; margin-right: 8px; font-size: 19px; } #hudPts div.assist b { color: #f2f2da; font-size: 16px; }
  #hudPts div span { color: var(--tc, #fff); }
  @keyframes ptsUp { 0% { opacity: 0; transform: translateY(8px) scale(.9); } 10% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
  #board td i.bot { font-style: normal; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; opacity: .55; margin-left: 6px; }
  #board h4 { margin: 0 0 8px; font-size: 16px; font-weight: normal; letter-spacing: .06em; filter: brightness(1.3); }
  #board th { font-weight: normal; font-size: 11px; opacity: .6; padding: 0 10px; text-align: right; }
  #board td { padding: 3px 10px; text-align: right; font-variant-numeric: tabular-nums; }
  #board td:first-child { text-align: left; min-width: 120px; }
  #board tr.me td { color: #ffe3a3; }
  body.dying #cross, body.dying #gunCross, body.spectating #cross, body.spectating #gunCross, body.spectating #ammo, body.spectating #palette, body.spectating #health { display: none !important; }

  /* the main menu and the pause menu: big words over the scene, no panels */
  #menu { position: fixed; left: max(24px, 7vw); top: 50%; transform: translateY(-50%); display: none; }
  body.menu #menu { display: block; }
  /* the version the server is running (from /version), faint in the corner of the main menu */
  #version { position: fixed; right: 14px; bottom: 10px; display: none; font: 12px Georgia, serif; letter-spacing: .08em; color: #fff; opacity: .28; pointer-events: none; z-index: 2; }
  body.menu #version { display: block; }
  body.browsing #version, body.creating #version, body.settings #version { display: none; }
  #menuEditor { display: none; }
  body.menu-editor #menuEditor { display: flex; } body.menu-editor #menuMain { display: none; }
  #pause { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); display: none; align-items: center; }
  body.paused #pause { display: flex; }
  body.paused #pause button { text-align: center; }
  .menu-list { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; user-select: none; }
  .menu-list button { font: 30px/1.25 Georgia, "Times New Roman", serif; letter-spacing: .03em; color: #fff; background: none; border: 0;
    padding: 5px 2px; cursor: pointer; text-shadow: 0 2px 14px rgba(0,0,0,.7), 0 0 2px rgba(0,0,0,.5); opacity: .9;
    transition: transform .18s, color .18s, opacity .18s; }
  .menu-list button:hover:not(:disabled), .menu-list button:focus-visible { opacity: 1; color: #ffe3a3; transform: translateX(8px); outline: none; }
  #pause button:hover:not(:disabled), #pause button:focus-visible { transform: scale(1.05); }
  .menu-list button:disabled { opacity: .38; cursor: default; }
  .menu-list button.back { font-size: 21px; margin-top: 10px; opacity: .75; }

  /* cards: Options, the server browser, Create server */
  .card { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); display: none; z-index: 15; width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 48px); overflow-y: auto; padding: 18px 22px 20px; color: #fff; background: rgba(22,16,30,.9);
    border: 1px solid rgba(255,220,230,.3); border-radius: 6px; font: 14px Georgia, serif; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
  body.settings #settings { display: block; }
  body.settings #menu, body.settings #pause { visibility: hidden; }
  .card .head { display: flex; align-items: center; gap: 8px; font-size: 20px; margin-bottom: 6px; }
  .card .head span { flex: 1; }
  .card .head button { font: 13px Georgia, serif; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.3);
    border-radius: 3px; padding: 6px 12px; cursor: pointer; }
  .card h4 { margin: 16px 0 8px; font-size: 12px; font-weight: normal; letter-spacing: .12em; text-transform: uppercase; color: #ffd6e0; }
  .card .row { display: flex; align-items: center; gap: 12px; margin: 7px 0; }
  .card .row > label { flex: 0 0 160px; opacity: .85; }
  /* a graphics setting's cost: a small ? beside its name, the cost on hover */
  .card .imp { position: relative; display: inline-block; width: 15px; height: 15px; line-height: 15px; text-align: center; font-size: 11px;
    border: 1px solid rgba(255,255,255,.4); border-radius: 50%; opacity: .7; cursor: default; vertical-align: 1px; }
  .card .imp:hover, .card .imp:focus-visible { opacity: 1; outline: none; }
  .card .imp .tip { display: none; position: absolute; left: 22px; top: 50%; transform: translateY(-50%); z-index: 2; width: max-content; max-width: 220px;
    padding: 6px 9px; font-size: 12px; line-height: 1.4; text-align: left; color: #fff; background: rgba(12,8,18,.97);
    border: 1px solid rgba(255,220,230,.3); border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
  .card .imp:hover .tip, .card .imp:focus-visible .tip { display: block; }
  .card .seg { display: flex; flex-wrap: wrap; border: 1px solid rgba(255,255,255,.25); border-radius: 4px; overflow: hidden; }
  .card .seg button { font: 13px Georgia, serif; color: #fff; background: none; border: 0; border-left: 1px solid rgba(255,255,255,.15);
    padding: 6px 11px; cursor: pointer; }
  .card .seg button:first-child { border-left: 0; }
  .card .seg button:hover:not(.on):not(:disabled) { background: rgba(255,255,255,.1); }
  .card .seg button.on { background: #c8352c; color: #fff6e8; }
  .card .seg button:disabled { opacity: .45; cursor: default; }
  .card input[type=range] { flex: 1; accent-color: #c8352c; }
  .card output { min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
  .card input[type=text] { flex: 1; max-width: 220px; font: 14px Georgia, serif; color: #fff; background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.3); border-radius: 3px; padding: 6px 8px; }
  .card .soon { font-size: 12px; opacity: .6; }
  .card .head button, .card .bar button { font: 13px Georgia, serif; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.3);
    border-radius: 3px; padding: 6px 12px; cursor: pointer; }
  .card .head button:hover:not(:disabled), .card .bar button:hover:not(:disabled) { background: rgba(255,255,255,.2); }
  .card button.go, .card button.tog.on { background: #c8352c; border-color: #e9b04a; color: #fff6e8; }
  .card button.go:hover:not(:disabled) { background: #d8463c; }
  .card button:disabled { opacity: .45; cursor: default; }
  .card .bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
  .card .bar input { flex: 1; min-width: 120px; font: 14px Georgia, serif; color: #fff; background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.3); border-radius: 3px; padding: 6px 8px; }
  .card .bar .lbl { opacity: .7; }
  .card .grow { flex: 1; }
  .card select { font: 14px Georgia, serif; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.3); border-radius: 3px; padding: 5px 8px; }
  .card select option { color: #222; }
  .card input[type=checkbox] { width: 18px; height: 18px; accent-color: #c8352c; }
  .card.wide { width: min(860px, calc(100vw - 32px)); }
  body.browsing #browser, body.creating #create { display: block; }
  body.browsing #menu, body.creating #browser { visibility: hidden; }
  #create { z-index: 16; }
  #browser .list { height: min(52vh, 460px); overflow-y: auto; margin-top: 10px; border: 1px solid rgba(255,255,255,.15); border-radius: 4px; }
  #browser table { width: 100%; border-collapse: collapse; }
  #browser th { position: sticky; top: 0; text-align: left; font-weight: normal; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
    color: #ffd6e0; background: #241a2c; padding: 7px 10px; }
  #browser td { padding: 6px 10px; border-top: 1px solid rgba(255,255,255,.06); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
  #browser td:nth-child(2) { font-variant-numeric: tabular-nums; }
  #browser tbody tr { cursor: pointer; user-select: none; }
  #browser tbody tr:hover { background: rgba(255,255,255,.08); }
  #browser tbody tr.sel { background: rgba(200,53,44,.55); }
  #browser tbody tr.full { opacity: .5; }
  #brNote { padding: 28px 12px; text-align: center; opacity: .7; }
  #brNote:empty { display: none; }
  @media (max-width: 640px) { #browser th:nth-child(n+4), #browser td:nth-child(n+4) { display: none; } }
  #pauseInfo { margin-bottom: 14px; text-align: center; font: 15px/1.6 Georgia, serif; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
  #pauseInfo:empty { display: none; }
  #pauseInfo div + div { font-size: 13px; opacity: .8; }
  #pauseInfo button.code { font: bold 16px Georgia, serif; letter-spacing: .14em; color: #ffe3a3; background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,227,163,.5); border-radius: 3px; padding: 1px 8px; cursor: pointer; transform: none; opacity: 1; }
  body.guest #mapPick, body.guest #ui { display: none; }

  /* the map list (before Single player and the map editor) */
  #menuMaps { display: none; max-height: calc(100vh - 60px); overflow-y: auto; overflow-x: hidden; padding-right: 16px; }
  #menuSaved { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
  #menuSaved:not(:empty) { margin: 6px 0; }
  #menuSaved .saved { display: flex; align-items: center; gap: 6px; }
  .menu-list #menuSaved button.del { font-size: 22px; opacity: 0; padding: 0 6px; }
  #menuSaved .saved:hover button.del { opacity: .55; }
  .menu-list #menuSaved button.del:hover { opacity: 1; color: #ff7070; transform: none; }
  /* the Save map box */
  body.saving #saveMap { display: block; }
  body.saving #pause { visibility: hidden; }
  #saveMap { z-index: 16; width: min(440px, calc(100vw - 32px)); }
  #saveMap .row input { max-width: none; }
  body.menu-maps #menuMaps { display: flex; }
  body.menu-maps #menuMain, body.menu-maps #menuEditor { display: none; }
  #menuMaps .ed-only { display: none; }
  body.pick-ed #menuMaps .ed-only { display: block; }

  /* the map editor */
  #meBar { position: fixed; top: 16px; right: 16px; display: none; margin: 0; }
  body.mapedit #meBar { display: flex; }
  body.mapedit.locked #meBar { opacity: .55; pointer-events: none; }
  body.mapedit #meBar button:disabled { opacity: .4; cursor: default; }
  body.mapedit #mapPick, body.mapedit #health, body.mapedit #palLight { display: none; }
  body.mapedit #palette { display: block; pointer-events: auto; }
  body.mapedit #palGrid div, body.mapedit #palSize { cursor: pointer; }
  body.mapedit #palGrid { grid-template-columns: repeat(8, 20px); cursor: pointer; }
  body.mapedit #palGrid div { width: 20px; height: 20px; }
  body.mapedit #palGrid div.lc::after { margin: 8px; }
  body.mapedit canvas { cursor: crosshair; }
  #palMat { display: none; gap: 0; margin-bottom: 8px; border: 1px solid rgba(255,255,255,.25); border-radius: 3px; overflow: hidden; }
  body.mapedit #palMat { display: flex; }
  #palMat button { flex: 1; font: 12px Georgia, serif; color: #fff; background: none; border: 0; border-left: 1px solid rgba(255,255,255,.15); padding: 4px 0; cursor: pointer; }
  #palMat button:first-child { border-left: 0; }
  #palMat button.on { background: #c8352c; }
  #palMat button[hidden] { display: none; }
  /* in the map editor, the palette marks which colours can be water (a ripple) or lava (a diamond) */
  body.mapedit #palGrid div.wc::after { content: ''; display: block; width: 10px; height: 2px; margin: 9px 5px; border-radius: 1px; background: rgba(255,255,255,.75); }
  body.mapedit #palGrid div.vc::after { content: ''; display: block; width: 5px; height: 5px; margin: 7.5px; background: rgba(60,0,0,.6); transform: rotate(45deg); }
  #palMat button:disabled { opacity: .35; cursor: default; }
  #meInfo { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; display: none; font: 13px Georgia, serif; letter-spacing: .06em; color: #fff;
    opacity: .75; text-shadow: 0 1px 6px rgba(0,0,0,.7); font-variant-numeric: tabular-nums; white-space: pre; pointer-events: none; }
  body.mapedit #meInfo { display: block; }
  /* the map editor's game modes: what the chosen mode needs, bottom left */
  #meMode { position: fixed; left: 16px; bottom: 16px; display: none; width: 250px; padding: 10px; color: #fff; font: 13px Georgia, serif;
    background: rgba(20,12,28,.62); border: 1px solid rgba(255,220,230,.3); border-radius: 4px; backdrop-filter: blur(6px); }
  body.mapedit #meMode { display: block; }   /* in first person too: G steps through its rows */
  #meMode label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; opacity: .9; }
  #meMode select { flex: 1; font: 13px Georgia, serif; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.3); border-radius: 3px; padding: 4px 6px; }
  #meMode select option { color: #222; }
  #meNeeds .need { width: 100%; display: flex; align-items: center; gap: 8px; margin: 3px 0; padding: 6px 8px; font: 13px Georgia, serif; color: #fff; text-align: left;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 4px; cursor: pointer; }
  #meNeeds .need:hover { background: rgba(255,255,255,.12); }
  #meNeeds .need.fixed:hover { background: rgba(255,255,255,.07); } #meNeeds .need.fixed i { visibility: hidden; }   /* (dynamic spawns: a line, not a button) */
  #meNeeds .need.on { background: rgba(200,53,44,.75); border-color: #e9b04a; }
  #meNeeds .need i { width: 12px; height: 12px; border-radius: 2px; border: 1px solid rgba(255,255,255,.5); flex: none; }
  #meNeeds .need span { flex: 1; }
  #meNeeds .need b { font-weight: normal; color: #ff8a80; font-variant-numeric: tabular-nums; }
  #meNeeds .need.ok b { color: #a6e3a1; } #meNeeds .need.over b { color: #ffb37a; }
  #meNeeds .need.refuse { animation: needNo .45s; }
  @keyframes needNo { 0%, 50% { background: rgba(255,90,74,.65); } }
  #meNeeds .status { margin-top: 8px; font-size: 12px; color: #ff8a80; }
  #meNeeds .status.ok { color: #a6e3a1; }
  .btns { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: auto; }
  .btns:first-child { margin-top: 0; }
  #hint { display: none; }
  .btns button { font: 13px/1 Georgia, serif; color: #fff; background: rgba(30,18,40,.28);
    border: 1px solid rgba(255,220,230,.45); border-radius: 3px; padding: 7px 12px; cursor: pointer;
    backdrop-filter: blur(6px); transition: background .2s, color .2s; }
  .btns button:hover { background: rgba(255,255,255,.22); }
  .btns button:focus-visible { outline: 2px solid #ffd6e0; outline-offset: 2px; }
  .btns select { font: 13px/1 Georgia, serif; color: #fff; background: rgba(30,18,40,.28); border: 1px solid rgba(255,220,230,.45);
    border-radius: 3px; padding: 6px 8px; cursor: pointer; backdrop-filter: blur(6px); }
  .btns select option { color: #222; }
  .btns button.on { background: #c8352c; border-color: #e9b04a; color: #fff6e8; }
  .hint { margin-top: 10px; max-width: 360px; font: 12px/1.4 Georgia, serif; opacity: .8; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
  #loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 16px; color: #ffd6e0; transition: opacity .9s;
    background: #5a5a5a;
    font: 16px Georgia, serif; letter-spacing: .12em; }
  .spin { width: 44px; height: 44px; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff;
    border-radius: 50%; animation: s 1s linear infinite; }
  @keyframes s { to { transform: rotate(360deg); } }
  #loading .err { max-width: 460px; text-align: center; font: 14px/1.5 Georgia, serif; color: #fff; }

  /* touch screens (src/touch.js): the controls over the game while playing, the HUD clear of the thumbs */
  .touch-only { display: none !important; }
  body.touch .touch-only { display: inline-block !important; }
  body.touch.nofs [data-go="fullscreen"] { display: none !important; }
  body.touch [data-go="editor"], body.touch #pause [data-go="controls"], body.touch #setControls { display: none !important; }   /* (the editors and the key list are for mouse and keyboard) */
  #touch { position: fixed; inset: 0; z-index: 4; display: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
  body.touch.fp:not(.paused) #touch { display: block; }
  body.touch.fp:not(.paused) #ui, body.touch.fp:not(.paused) #mapPick { display: none !important; }
  /* (paused: the time of day bottom left, the map bottom right, clear of Resume top right) */
  body.touch #ui { top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); left: calc(16px + env(safe-area-inset-left)); }
  body.touch #mapPick { top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); right: calc(16px + env(safe-area-inset-right)); }
  /* health: a bar alone, centred at the bottom; ammo: "24/30" as text just right of it, its foot level with the bar's */
  #ammoMax { display: none; }
  /* (--hpw: the bar's width, 242px, less on a narrow screen so the ammo after it stays clear of Crouch: Crouch's left
     edge is 221px from the right, the ammo about 60px wide, at least 8px each side) */
  body.touch { --hpw: clamp(132px, calc(100vw - 594px - 2 * env(safe-area-inset-right, 0px)), 242px); }
  body.touch #health { left: 50%; right: auto; bottom: 10px; transform: translateX(-50%); }
  body.touch #hpNum, body.touch #ammoTicks, body.touch #reloadBar { display: none; }
  body.touch #hpBar { width: var(--hpw); height: 7px; margin: 0; border-radius: 4px; overflow: hidden; }
  body.touch #hpBar b { border-radius: 4px; } #hpBar b.low { background: #ff8a6a; } #hpBar b.over { background: #ffd84a; }
  /* (centred between the bar's right end and Crouch's left edge, 221px from the right; the digits sit about .18em above
     the foot of their line: that much lower, their foot is level with the bar's) */
  body.touch #ammo { left: calc((150vw + var(--hpw) / 2 - 221px - env(safe-area-inset-right, 0px)) / 2); right: auto; transform: translateX(-50%); bottom: calc(10px - .18em); font: bold 20px/1 ui-monospace, Menlo, Consolas, monospace; }
  body.touch #ammoNum, body.touch #ammoMax { font: inherit; }
  body.touch #ammoMax { display: inline; opacity: .7; }
  body.touch #ammo.reloading { opacity: .45; }
  #tStick { position: absolute; left: 96px; bottom: auto; top: calc(100% - 110px); width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.22); background: rgba(20,14,26,.16); pointer-events: none; opacity: .55; }
  #tStick.on { opacity: 1; }
  #tStick b { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%;
    background: rgba(255,255,255,.32); border: 2px solid rgba(255,255,255,.55); }
  #touch .tb { position: absolute; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 50%;
    color: #fff; font: bold 20px Georgia, serif; background: rgba(20,14,26,.34); border: 2px solid rgba(255,255,255,.4);
    touch-action: none; -webkit-tap-highlight-color: transparent; }
  #touch .tb.down, body.t-aim #tAim, body.t-crouch #tCrouch { background: rgba(255,255,255,.34); border-color: #fff; }
  #touch .tb svg { width: 56%; height: 56%; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
  #touch .tb svg .f { fill: #fff; }
  /* the right thumb's cluster, from the bottom right corner (and the notch's safe area): Fire (its middle 140px from the
     right, 111.5px up) with five round it, all one size (54px), a pentagon, each middle 92px from Fire's: Grenade straight
     above, Reload top right, Jump bottom right, Crouch bottom left, Aim top left (every 72 degrees); the bottom two 10px
     off the bottom. Each is placed by its middle (--x / --y from the right and the bottom) less half its size (--s) */
  #tFire, #tReload, #tNade, #tJump, #tCrouch, #tAim { width: var(--s); height: var(--s);
    right: calc(var(--x) - var(--s) / 2 + env(safe-area-inset-right)); bottom: calc(var(--y) - var(--s) / 2); }
  #tReload, #tNade, #tJump, #tCrouch, #tAim { --s: 54px; }
  #tFire { --s: 88px; --x: 140px; --y: 111.5px; background: rgba(200,53,44,.42); }
  #tFire.down { background: rgba(200,53,44,.7); }
  #tNade { --x: 140px; --y: 203.5px; }        /* 0 degrees */
  #tReload { --x: 52.5px; --y: 139.9px; }     /* 72: 92 sin 72 = 87.5 across, 92 cos 72 = 28.4 up */
  #tJump { --x: 85.9px; --y: 37.1px; }        /* 144: 54.1 across, 74.4 down */
  #tCrouch { --x: 194.1px; --y: 37.1px; }     /* 216 */
  #tAim { --x: 227.5px; --y: 139.9px; }       /* 288 */
  /* Use: only in a zone where the mode wants E held; the mode's word for it (Plant, Defuse...) on a rounded bar in the
     bottom middle, just over the health bar */
  #touch #tUse { left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translateX(-50%); height: 44px; min-width: 128px;
    padding: 0 24px; border-radius: 12px; font: bold 18px Georgia, serif; letter-spacing: .02em; white-space: nowrap; }
  #tBoard { width: 42px; height: 42px; left: calc(12px + env(safe-area-inset-left)); top: 12px; }
  #tPause { width: 42px; height: 42px; right: calc(12px + env(safe-area-inset-right)); top: 12px; }
  #touch #tNade, #touch #tUse, #touch #tBoard { display: none; }   /* (only when there is a grenade, a zone wanting E, a match) */
  body.t-nade #touch #tNade, body.t-use #touch #tUse, body.t-board #touch #tBoard { display: flex; }
  body.touch.match #killfeed, body.touch.online #killfeed { top: 62px; }
  body.touch #fps, body.touch.match #fps { right: calc(64px + env(safe-area-inset-right)); top: 24px; }
  /* a phone's screen is small: the match's words and numbers smaller, and messages wrap rather than run off it */
  body.touch #hudMsg { font-size: 22px; white-space: normal; text-align: center; width: max-content; max-width: 80vw; top: 30%; }
  body.touch #hudCount { font-size: 54px; } body.touch #hudCount.go { font-size: 64px; }
  body.touch #hudOver > b { font-size: 36px; } body.touch .ho-row { font-size: 15px; } body.touch .ho-row.first { font-size: 17px; }
  body.touch #respawn { font-size: 36px; } body.touch.spectating #respawn { font-size: 16px; }
  body.touch #hud { top: 6px; gap: 3px; font-size: 11px; } body.touch .hs-team { padding: 3px 7px; } body.touch .hs-bar { width: 90px; height: 7px; }
  body.touch .hs-num { font-size: 14px; } body.touch .hs-name { font-size: 9px; } body.touch #hudTimers { font-size: 13px; }
  body.touch #hudWays .way { font-size: 13px; padding: 2px 8px; border-width: 2px; } body.touch #hudWays .way.here { top: 82px; font-size: 18px; padding: 3px 12px; border-width: 3px; }
  body.touch #hudNote div { font-size: 12px; } body.touch #hudPts div { font-size: 13px; } body.touch #hudPts div b { font-size: 15px; }
  body.touch #killfeed { font-size: 10px; gap: 2px; } body.touch #killfeed div { padding: 2px 7px; }
  /* damage dealt: on the left, under Scores, over the move stick */
  body.touch #hudDealt { left: calc(12px + env(safe-area-inset-left)); right: auto; top: 64px; font-size: 10px; min-width: 110px; padding: 5px 8px; }
  body.touch #hudDealt h5 { font-size: 9px; margin-bottom: 3px; } body.touch #hudDealt div { margin: 1px 0; gap: 10px; } body.touch #hudProg { font-size: 12px; }
  body.touch #nextGame { left: calc(12px + env(safe-area-inset-left)); padding: 9px 11px; gap: 6px; font-size: 11px; }
  body.touch #nextGame select { font-size: 12px; padding: 3px 6px; min-width: 130px; } body.touch #nextGame h5 { font-size: 10px; } body.touch #nextGame span { font-size: 10px; }
  /* holding Scores or paused: only the world stays on screen (and the board, or the pause menu with its ✕), back after */
  body.touch:is(.t-boardup, .paused) :is(#hud, #hudMsg, #hudCount, #hudOver, #hudProg, #hudWays, #killfeed, #respawn, #hudDealt, #hudPts, #cross, #gunCross, #ammo, #health, #fps, #toast, #tStick, #touch .tb) { visibility: hidden !important; }   /* (!important: the rifle's crosshair sets its own every frame) */
  /* the end of a game: only Pause stays; the winner for 5 s, then it fades and the scoreboard sits in the middle */
  body.touch.gameover #touch .tb:not(#tPause), body.touch.gameover #tStick { display: none !important; }
  #tPause .ex, body.gameover #tPause .ps { display: none; } body.gameover #tPause .ex { display: inline; }   /* (after a game: ✕, out to the main menu) */
  body.touch.gameover #hud, body.touch #hudOver > small { display: none !important; }
  body.touch #hudOver.up { top: 10px; transform: translate(-50%,0); animation: none; }
  body.touch #hudOver.up > b, body.touch #hudOver.up .ho-board { display: none; }
  body.touch #board { padding: 10px 16px; gap: 18px; font-size: 13px; max-height: calc(100vh - 56px); }
  body.touch #board.over { top: calc(50% + 18px); bottom: auto; transform: translate(-50%,-50%); max-height: calc(100vh - 48px); }
  body.touch #board td { padding: 2px 8px; } body.touch #board h4 { margin-bottom: 4px; }
  body.touch #board td:first-child { min-width: 96px; }
  /* fullscreen on the main menu and the pause menu: corners out to go fullscreen, corners in to leave it */
  #tFull, #tResume { position: fixed; z-index: 20; width: 42px; height: 42px; right: calc(12px + env(safe-area-inset-right)); top: 12px; display: none; align-items: center; justify-content: center;
    padding: 0; border-radius: 50%; background: rgba(20,14,26,.34); border: 2px solid rgba(255,255,255,.4); -webkit-tap-highlight-color: transparent; }
  #tFull { width: 72px; height: 72px; right: calc(18px + env(safe-area-inset-right)); top: 18px; border-width: 3px; background: rgba(20,14,26,.5); }
  body.touch.menu:not(.browsing):not(.settings):not(.joining):not(.menu-maps) #tFull { display: flex; }
  body.touch.paused:not(.settings):not(.saving) #tResume { display: flex; }
  body.touch.nofs #tFull { display: none !important; }
  #tFull svg, #tResume svg { width: 56%; height: 56%; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
  #tFull .back, body.fs #tFull .go { display: none; } body.fs #tFull .back { display: inline; }
  /* held upright: turn sideways (over everything) */
  #rotate { position: fixed; inset: 0; z-index: 10000; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
    color: #fff; background: #140e1a; font: 18px Georgia, serif; letter-spacing: .04em; }
  #rotate .phone { width: 44px; height: 76px; border: 3px solid #fff; border-radius: 9px; animation: turnPhone 2.2s ease-in-out infinite; }
  @keyframes turnPhone { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
  @media (orientation: portrait) { body.touch #rotate { display: flex; } }
