/*
 * (c) multiplay3d.com 2026, all rights reserved. This is a non-profit and non-commercial project. This file must not be sold for profit, rented out by anybody, distributed by other party than multiplay3d.com or used elsewhere without prior written concent by multiplay3d.com.
 */
html,body { width:100%; height:100%; margin:0; overflow:hidden; background:#000; color:#ddd; font:14px/1.35 system-ui,sans-serif; }
#game { position:fixed; inset:0; width:100%; height:100%; display:block; }
#toolbar { position:fixed; z-index:20; top:10px; left:10px; right:10px; display:flex; gap:8px; align-items:center; pointer-events:auto; }
#toolbar > label { padding:6px 2px 6px 8px; color:#eee; font-weight:600; text-shadow:1px 1px #000; }
button,#serverMap { border:1px solid #666; background:rgba(20,20,20,.90); color:#eee; padding:7px 10px; border-radius:4px; cursor:pointer; }
#serverMap { min-width:230px; }
button:disabled,#serverMap:disabled { opacity:.45; cursor:default; }
#mapInfo { padding:6px 9px; background:rgba(0,0,0,.60); border-radius:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#startPanel { position:fixed; z-index:10; left:50%; top:50%; transform:translate(-50%,-50%); width:min(900px,calc(100% - 40px)); max-height:calc(100vh - 100px); overflow:auto; padding:24px 28px; background:rgba(0,0,0,.79); border:1px solid #555; box-shadow:0 15px 55px #000; }
#startPanel h1 { margin:0 0 12px; font-size:24px; }
#startPanel .introHero { position:relative; margin:0 0 16px; cursor:pointer; outline:none; }
#startPanel .introHero:focus-visible { box-shadow:0 0 0 2px #fff; border-radius:8px; }
#startPanel .introHero img { display:block; width:100%; height:auto; border:1px solid #444; border-radius:8px; box-shadow:0 10px 30px rgba(0,0,0,.45); }
#startPanel .introSoundToggle { position:absolute; left:14px; bottom:14px; padding:8px 12px; border:1px solid rgba(255,255,255,.55); border-radius:5px; background:rgba(0,0,0,.72); color:#fff; font-weight:700; text-shadow:0 1px 2px #000; pointer-events:none; }
#hud { position:fixed; inset:0; z-index:8; pointer-events:none; }
.hidden { display:none; }
#crosshair { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); font:26px/1 monospace; color:#fff; text-shadow:0 0 4px #000; }
#stats { position:absolute; left:18px; bottom:18px; display:flex; gap:18px; padding:8px 12px; background:rgba(0,0,0,.55); font-family:monospace; font-size:16px; }
#debug { position:absolute; right:14px; bottom:14px; text-align:right; white-space:pre; font:12px/1.3 monospace; color:#ddd; text-shadow:1px 1px #000; }
#messages { position:absolute; left:18px; bottom:62px; width:min(600px,70vw); text-shadow:1px 1px #000; }
.message { margin-top:3px; opacity:.95; }
code { color:#fff; }
@media (max-width:900px) { #toolbar { flex-wrap:wrap; } #mapInfo { max-width:100%; } #serverMap { min-width:190px; flex:1; } }

/* v18 bot controls/feed */
#botCount {
  width: 46px;
  background: rgba(22,22,22,.92);
  color: #ddd;
  border: 1px solid #555;
  border-radius: 3px;
  padding: 4px 5px;
  font: inherit;
}
#botFeed {
  position: fixed;
  left: 10px;
  top: 104px;
  z-index: 6;
  white-space: pre;
  pointer-events: none;
  font: 11px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: rgba(235,235,235,.68);
  text-shadow: 0 1px 2px rgba(0,0,0,.9);
  background: rgba(0,0,0,.18);
  padding: 5px 7px;
  border-radius: 3px;
  max-width: 260px;
}


.toolbarLink { color:#fff; background:#333; padding:4px 8px; text-decoration:none; border-radius:3px; }

/* v89 startup-selectable precomputed lighting */
#startPanel .lightingOption { margin: 0 0 16px; padding: 10px 12px; border: 1px solid #3f4b55; border-radius: 6px; background: rgba(25,32,38,.82); }
#startPanel .lightingOption label { display:flex; gap:10px; align-items:flex-start; cursor:pointer; }
#startPanel .lightingOption input { margin-top:4px; accent-color:#6bc46d; transform:scale(1.15); }
#startPanel .lightingOption span { display:flex; flex-direction:column; gap:2px; }
#startPanel .lightingOption small { color:#aeb9c2; line-height:1.3; }

/* v92 real map-load progress */
#startPanel .mapLoadProgress { margin:0 0 16px; padding:10px 12px; border:1px solid #46525d; border-radius:6px; background:rgba(10,15,19,.90); }
#startPanel .mapLoadProgress[hidden] { display:none; }
#startPanel .mapLoadProgressHead { display:flex; justify-content:space-between; gap:16px; margin-bottom:7px; font:600 12px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace; color:#dfe7ed; }
#startPanel .mapLoadProgressTrack { height:12px; overflow:hidden; border:1px solid #52616d; border-radius:999px; background:#11181d; box-shadow:inset 0 1px 4px rgba(0,0,0,.8); }
#startPanel .mapLoadProgressFill { width:0%; height:100%; border-radius:inherit; background:linear-gradient(90deg,#2a8d47,#79e56f,#d8ff9a); box-shadow:0 0 10px rgba(115,229,111,.45); transition:width .16s ease-out; }
#startPanel .mapLoadProgress.error .mapLoadProgressFill { background:linear-gradient(90deg,#7d2222,#e15151); box-shadow:0 0 10px rgba(225,81,81,.35); }
#startPanel .mapLoadProgress.done .mapLoadProgressFill { background:linear-gradient(90deg,#2a8d47,#9af287); }

/* v113 server-authoritative multiplayer match shutdown warning */
#matchTimeWarning { position:absolute; left:50%; top:72px; transform:translateX(-50%); min-width:280px; max-width:min(760px,82vw); box-sizing:border-box; padding:10px 16px; border:1px solid rgba(255,177,92,.85); border-radius:6px; background:rgba(56,28,8,.88); color:#ffe2bc; text-align:center; font:700 18px/1.25 ui-monospace,SFMono-Regular,Consolas,monospace; text-shadow:0 1px 2px #000; box-shadow:0 3px 14px rgba(0,0,0,.45); }
#matchTimeWarning.finalMinute { border-color:rgba(255,90,90,.95); background:rgba(75,8,8,.90); color:#ffd1d1; font-size:24px; }
#matchTimeWarning.ended { border-color:#aaa; background:rgba(20,20,20,.92); color:#fff; font-size:22px; }

/* v130 timeout scoreboard */
#matchResults { pointer-events:auto; position:absolute; inset:0; z-index:80; display:flex; align-items:center; justify-content:center; padding:24px; box-sizing:border-box; background:rgba(0,0,0,.72); }
#matchResults.hidden, #matchResults[hidden] { display:none !important; }
.matchResultsCard { width:min(980px,96vw); max-height:88vh; overflow:auto; box-sizing:border-box; padding:22px; border:1px solid rgba(255,255,255,.28); border-radius:8px; background:rgba(14,16,20,.97); color:#f5f5f5; box-shadow:0 10px 38px rgba(0,0,0,.65); }
.matchResultsCard h2 { margin:0 0 8px; font:700 28px/1.1 ui-monospace,SFMono-Regular,Consolas,monospace; }
#matchResultsSummary { margin:0 0 18px; color:#c9ccd2; font:14px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace; }
.matchResultsTableWrap { overflow-x:auto; }
.matchResultsTable { width:100%; border-collapse:collapse; font:15px/1.35 ui-monospace,SFMono-Regular,Consolas,monospace; }
.matchResultsTable th, .matchResultsTable td { padding:8px 10px; border-bottom:1px solid rgba(255,255,255,.12); text-align:right; white-space:nowrap; }
.matchResultsTable th:nth-child(2), .matchResultsTable td:nth-child(2), .matchResultsTable th:nth-child(3), .matchResultsTable td:nth-child(3) { text-align:left; }
.matchResultsTable tbody tr.you { background:rgba(255,255,255,.09); font-weight:700; }
.matchResultsTable tbody tr:first-child { background:rgba(210,170,75,.16); }
.matchResultsActions { margin-top:18px; text-align:right; }
.matchResultsActions a { display:inline-block; padding:10px 14px; border:1px solid rgba(255,255,255,.34); border-radius:5px; color:#fff; text-decoration:none; font:700 14px ui-monospace,SFMono-Regular,Consolas,monospace; }

/* v131 flashbang whiteout. Kept below the result dialog (z=80) so the final
   scoreboard always remains readable even if a flash detonates at timeout. */
#flashbangOverlay.flashbangOverlay {
  position:absolute;
  inset:0;
  z-index:65;
  pointer-events:none;
  background:#fff;
  opacity:0;
  mix-blend-mode:screen;
  will-change:opacity;
}

/* v221: terminal multiplayer shutdown must not leave an interactive stale BSP behind. */
body.multiplayerGameClosed #hud { z-index:100; }
body.multiplayerGameClosed #toolbar { pointer-events:none; opacity:.25; }
body.multiplayerGameClosed #game { pointer-events:none; }
body.multiplayerGameClosed #crosshair,
body.multiplayerGameClosed #stats,
body.multiplayerGameClosed #botFeed,
body.multiplayerGameClosed #debug,
body.multiplayerGameClosed #messages,
body.multiplayerGameClosed #matchTimeWarning { visibility:hidden; }
body.multiplayerGameClosed .matchResultsActions { display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; }

/* v226 multiplayer-only brand watermark. Created only by main.js when
   mode=multiplayer, so singleplayer does not even load the image asset. */
#multiplayerWatermark {
  position:fixed;
  z-index:9;
  top:54px;
  right:14px;
  width:clamp(118px, 10.5vw, 154px);
  height:auto;
  opacity:.32;
  pointer-events:none;
  user-select:none;
  -webkit-user-drag:none;
}
@media (max-width:900px) {
  #multiplayerWatermark { top:92px; width:118px; opacity:.28; }
}
