* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; font-family: Verdana, 'Trebuchet MS', Tahoma, sans-serif; color: #fff; user-select: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; display: none; z-index: 4; --amber: rgba(255, 170, 0, 0.88); }
#hud.on { display: block; }

/* 1.6 dynamic crosshair */
#crosshair { --gap: 4px; position: absolute; left: 50%; top: 50%; }
#crosshair, #xhPreview { --len: 8px; --thick: 2px; }
#xhPreview.xh-small { --gap: 1px; }
#xhPreview.xh-large { --gap: 8px; }
#crosshair i, #xhPreview i { position: absolute; background: rgb(50, 250, 50); }
#crosshair .t, #crosshair .b, #xhPreview .t, #xhPreview .b { width: var(--thick); height: var(--len); left: calc(var(--thick) / -2); }
#crosshair .l, #crosshair .r, #xhPreview .l, #xhPreview .r { height: var(--thick); width: var(--len); top: calc(var(--thick) / -2); }
#crosshair .t { bottom: var(--gap); } #crosshair .b { top: var(--gap); }
#crosshair .l { right: var(--gap); } #crosshair .r { left: var(--gap); }

#dmgflash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 50%, rgba(200,0,0,.6) 100%); }
#flashwhite { position: absolute; inset: 0; opacity: 0; background: #fff; }
#dmgind { position: absolute; left: 50%; top: 50%; }
.dmgarc { position: absolute; left: -60px; top: -140px; width: 120px; height: 280px; transform-origin: 60px 140px; }
.dmgarc::before { content: ''; position: absolute; left: 30px; top: 0; width: 60px; height: 18px; border-radius: 50% 50% 0 0;
  border-top: 5px solid rgba(255,30,30,.85); }

/* AWP scope */
#scope { position: absolute; inset: 0; display: none; }
#scope .lens { position: absolute; inset: 0; background: radial-gradient(circle at center, transparent 0, transparent 44vh, #000 44.2vh); }
#scope .h { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #000; }
#scope .v { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #000; }

/* amber HUD numbers */
.stat { color: var(--amber); font-size: 34px; font-weight: bold; font-family: 'Arial Black', Verdana, sans-serif; letter-spacing: 1px; text-shadow: 0 0 2px rgba(0,0,0,.6); }
.stat .ic { font-size: 26px; margin-right: 8px; opacity: .9; }
.stat.low { color: rgba(255, 40, 30, .95); }
#bl { position: absolute; left: 22px; bottom: 14px; display: flex; gap: 40px; }
#timer { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); }
#br { position: absolute; right: 24px; bottom: 14px; text-align: right; }
#moneyRow { margin-bottom: 26px; }
#money { font-size: 30px; }
#moneyDelta { font-size: 22px; font-weight: bold; margin-right: 10px; transition: opacity .5s; opacity: 0; }
#moneyDelta.up { color: rgba(80,255,80,.9); } #moneyDelta.down { color: rgba(255,60,40,.9); }
.ammo .sep { margin: 0 12px; opacity: .6; }
#reserve { font-size: 28px; }

#radar { position: absolute; top: 12px; left: 12px; }
#icons { position: absolute; left: 16px; top: 200px; display: flex; gap: 14px; align-items: center; }
.ico { color: var(--amber); font-weight: bold; font-size: 24px; font-family: 'Arial Black', sans-serif; }
.ico.buyz { color: rgba(60,230,60,.9); font-size: 34px; }
.ico.c4 { color: rgba(60,230,60,.9); } .ico.c4.blink { color: rgba(255,40,30,.95); }
.ico.kit { color: rgba(60,230,60,.9); font-size: 16px; }

#killfeed { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.kf { background: rgba(0,0,0,.35); padding: 3px 8px; font-size: 13px; font-weight: bold; }
.kf.me { outline: 1px solid rgba(255,40,40,.8); }
.kfw { color: var(--amber, #fa0); font-weight: normal; font-size: 11px; color: rgba(255,170,0,.9); margin: 0 4px; }
.hs { color: rgba(255,170,0,.9); font-size: 11px; }
#slots { position: absolute; top: 140px; right: 14px; display: flex; flex-direction: column; gap: 4px; opacity: 0; transition: opacity .3s; text-align: right; }
#slots div { color: rgba(255,170,0,.55); font-size: 13px; border-right: 3px solid rgba(255,170,0,.3); padding: 2px 8px; background: rgba(0,0,0,.25); }
#slots div b { margin-right: 8px; }
#slots div.on { color: rgba(255,200,60,1); border-color: rgba(255,170,0,1); }
#chat { position: absolute; left: 22px; bottom: 80px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: bold; text-shadow: 1px 1px 1px #000; color: #eee; }

#center { position: absolute; top: 22%; width: 100%; text-align: center; opacity: 0; transition: opacity .4s; text-shadow: 1px 1px 2px #000; }
#centerTitle { font-size: 30px; font-weight: bold; color: #fff; }
#centerSub { font-size: 16px; margin-top: 4px; color: #ddd; }
#center.warn #centerTitle { color: #ff5040; }
#hint { position: absolute; bottom: 120px; width: 100%; text-align: center; font-size: 16px; text-shadow: 1px 1px 2px #000; display: none; }
#hint b { color: var(--amber); }
#progress { position: absolute; top: 62%; left: 50%; transform: translateX(-50%); width: 300px; display: none; text-align: center; font-size: 14px; }
#progress .bar { height: 10px; border: 1px solid var(--amber); margin-top: 6px; }
#progressBar { height: 100%; background: var(--amber); width: 0; }
#spectate { position: absolute; bottom: 70px; width: 100%; text-align: center; font-size: 17px; text-shadow: 1px 1px 2px #000; display: none; }

/* scoreboard */
#scoreboard { position: absolute; top: 12%; left: 50%; transform: translateX(-50%); display: none; gap: 24px; background: rgba(0,0,0,.72); padding: 18px 22px; border: 1px solid rgba(255,170,0,.4); }
.sbteam h2 { margin: 0 0 8px; color: var(--c); display: flex; justify-content: space-between; font-size: 18px; }
.sbteam table { border-collapse: collapse; min-width: 380px; font-size: 13px; }
.sbteam th { text-align: left; font-size: 11px; opacity: .6; padding: 3px 8px; font-weight: normal; }
.sbteam td { padding: 4px 8px; color: var(--c); }
.sbteam td.st { color: #bbb; font-size: 11px; }
.sbteam tr.me td { background: rgba(255,255,255,.12); }

/* text buy menu */
#buy { position: absolute; left: 20px; top: 250px; display: none; background: rgba(0,0,0,.55); padding: 12px 18px; min-width: 300px; pointer-events: auto; }
.buyhead { color: var(--amber); font-weight: bold; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 20px; }
#buyMoney { color: rgba(80,255,80,.9); }
#buyBody h3 { margin: 4px 0 8px; font-size: 15px; color: #fff; }
.bi { color: #f0e6c8; font-size: 15px; padding: 3px 0; cursor: pointer; display: flex; gap: 8px; }
.bi b { color: var(--amber); width: 20px; }
.bi span { margin-left: auto; color: rgba(80,255,80,.9); }
.bi.poor { opacity: .45; } .bi.poor span { color: #f55; }
.bi:hover { color: #fff; }

/* overlays */
.overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(40,30,15,.6), rgba(0,0,0,.85)); z-index: 10; }
#menu { display: flex; }
.panel { background: rgba(20,18,15,.92); border: 1px solid #6b5a3c; padding: 30px 40px; text-align: center; max-width: 760px; }
.panel.small { min-width: 320px; }
.panel.wide { max-width: 940px; }
.panel h1 { margin: 0; font-size: 50px; letter-spacing: 6px; font-weight: 900; color: #f0d6a0; }
.panel h1 span { color: #e0a040; }
.panel h1.win { color: #7fe07f; } .panel h1.lose { color: #ff6050; }
.tag { opacity: .7; margin-top: 4px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin: 22px 0; text-align: left; }
.opts label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; opacity: .9; }
.opts select, .opts input { font: inherit; padding: 6px; background: #2a2620; color: #fff; border: 1px solid #6b5a3c; }
button#play, button#again, button#quit { font: inherit; font-size: 22px; font-weight: 800; letter-spacing: 3px; padding: 12px 50px; background: #e0a040; color: #1a1408; border: 0; cursor: pointer; }
button#quit { font-size: 15px; padding: 8px 20px; margin-top: 14px; background: #555; color: #fff; }
button:hover { filter: brightness(1.12); }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; margin-top: 22px; font-size: 12px; opacity: .75; text-align: left; }
.keys b { color: #f0d6a0; }
#endScore { font-size: 40px; font-weight: 800; margin: 8px 0 16px; }
#endBoard { display: flex; gap: 20px; margin-bottom: 20px; text-align: left; }

/* admin panel + console */
#admin { position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.45); font-family: Verdana, sans-serif; }
.adm-win { width: min(1180px, 96vw); max-height: 94vh; display: flex; flex-direction: column; background: rgba(28,30,26,.97); border: 1px solid #8a7a50; box-shadow: 0 10px 40px #000; }
.adm-title { padding: 8px 12px; background: #4c5844; color: #e8e4c8; font-weight: bold; display: flex; align-items: center; gap: 14px; }
.adm-title span { font-weight: normal; font-size: 11px; opacity: .7; }
.adm-title button { margin-left: auto; }
.adm-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.3fr); gap: 14px; padding: 12px; overflow: auto; }
.adm-cols h3 { margin: 4px 0 8px; font-size: 13px; color: #ffaa00; text-transform: uppercase; letter-spacing: 1px; }
#admin button { font: inherit; font-size: 12px; background: #3c4436; color: #e8e4c8; border: 1px solid #6e7a5e; padding: 6px 8px; cursor: pointer; }
#admin button:hover:not(:disabled) { background: #56624c; }
#admin button:disabled { opacity: .35; cursor: default; }
.adm-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.adm-status { font-size: 12px; color: #cfcab0; background: rgba(0,0,0,.3); padding: 8px; margin-bottom: 12px; line-height: 1.6; }
.adm-status .ta { color: #ff4d3d; } .adm-status .td { color: #99ccff; }
.adm-map { display: flex; gap: 6px; margin-bottom: 8px; } .adm-map select { flex: 1; min-width: 0; font: inherit; font-size: 12px; background: #1c1e1a; color: #fff; border: 1px solid #6e7a5e; padding: 4px; }
#adm-next:empty { display: none; } #adm-next button { margin-left: 6px; padding: 1px 8px; font-size: 11px; }
.adm-cvars { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; }
.adm-cvars label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: #cfcab0; }
.adm-cvars label.chk { flex-direction: row; align-items: center; gap: 6px; font-size: 12px; }
.adm-cvars input[type=number], .adm-cvars select { min-width: 0; width: 100%; box-sizing: border-box; font: inherit; font-size: 12px; background: #1c1e1a; color: #fff; border: 1px solid #6e7a5e; padding: 4px; }
.adm-bots { display: flex; flex-direction: column; gap: 3px; max-height: 290px; overflow: auto; }
.adm-bot { display: grid; grid-template-columns: minmax(0, 1.2fr) auto auto minmax(0, 1.1fr) auto auto; gap: 6px; align-items: center; font-size: 12px; padding: 3px 6px; background: rgba(0,0,0,.25); border-left: 3px solid; }
.adm-bot.attackers { border-color: #ff4d3d; } .adm-bot.defenders { border-color: #99ccff; }
.adm-bot button { padding: 2px 6px !important; }
.adm-bot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-btns button { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-console { border-top: 1px solid #6e7a5e; display: flex; flex-direction: column; }
#adm-log { height: 150px; overflow-y: auto; padding: 6px 10px; font-family: 'Courier New', monospace; font-size: 12px; color: #d8d4b8; background: rgba(0,0,0,.45); white-space: pre-wrap; }
#adm-log .cmd { color: #ffaa00; } #adm-log .err { color: #ff6050; }
#adm-input { font: 13px 'Courier New', monospace; background: #111; color: #fff; border: 0; border-top: 1px solid #333; padding: 8px 10px; outline: none; }
button#openAdmin { font: inherit; font-size: 15px; padding: 8px 20px; margin-top: 14px; background: #4c5844; color: #fff; border: 0; cursor: pointer; }

/* multiplayer */
.mp { margin-top: 20px; padding-top: 14px; border-top: 1px solid #6b5a3c; text-align: left; }
.mp h3 { margin: 0 0 10px; font-size: 14px; color: #e0a040; text-transform: uppercase; letter-spacing: 1px; }
.mprow { display: flex; gap: 10px; margin-bottom: 8px; }
.mprow input, .mprow select { flex: 1; font: inherit; padding: 7px; background: #2a2620; color: #fff; border: 1px solid #6b5a3c; }
.mprow button { flex: 1; font: inherit; font-size: 15px; font-weight: bold; padding: 9px; background: #4c5844; color: #fff; border: 0; cursor: pointer; }
.mprow button:disabled { opacity: .35; cursor: default; }
.mpinfo { font-size: 12px; opacity: .85; min-height: 16px; }
.mpinfo.err { color: #ff6a50; opacity: 1; }
.mpinfo code { color: #f0d6a0; }
/* server browser (lobby) */
.lobbyOnly { display: none; } #mpBox.lobby .lobbyOnly { display: block; } #mpBox.lobby .lanOnly { display: none; }
#mpBox.lobby span.lobbyOnly { display: inline; } #mpBox.lobby .mprow.lobbyOnly { display: flex; }
/* menu tabs */
.tabs { display: flex; gap: 4px; margin: 18px 0 0; border-bottom: 2px solid #e0a040; }
.tabs .tab { flex: 1; font: inherit; font-size: 14px; font-weight: bold; padding: 10px 6px; background: #2a2620; color: #cdbb94; border: 1px solid #6b5a3c; border-bottom: 0; cursor: pointer; }
.tabs .tab.on { background: #e0a040; color: #1a1408; border-color: #e0a040; }
.tabs .tab[data-tab="mp"] { flex: 1.4; font-size: 16px; }
.tabpane { display: none; text-align: left; } .tabpane.on { display: block; }
#tab-mp .mp { margin-top: 0; border-top: 0; padding-top: 16px; }
.tabintro { opacity: .8; margin: 16px 0 0; text-align: center; }
#tab-solo .menubtns { margin-top: 6px; }
#gameOpts.inMp .soloOnly { display: none; }
#gameOpts.inMp { margin: 12px 0; }
#createBox { margin-top: 12px; border: 1px solid #6b5a3c; background: rgba(0,0,0,.25); padding: 0 12px; }
#createBox[open] { padding-bottom: 12px; }
#createBox summary { cursor: pointer; padding: 10px 0; font-weight: bold; color: #e0a040; letter-spacing: 1px; }
.mprow button.big { font-size: 17px; letter-spacing: 2px; background: #e0a040; color: #1a1408; }
#srvList:empty { display: none; }
#srvList { display: flex; flex-direction: column; gap: 4px; max-height: 210px; overflow-y: auto; margin-bottom: 10px; }
.srv { display: grid; grid-template-columns: 1.6fr 1.2fr 1fr 48px 96px; gap: 8px; align-items: center; font-size: 13px; padding: 5px 8px; background: rgba(0,0,0,.3); border-left: 3px solid #6b5a3c; }
.srv.off { border-left-color: #e0a040; } .srv.mine { border-left-color: #6fd36f; }
.srv .sn { font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .srv .sn i { font-weight: normal; font-size: 11px; color: #e0a040; }
.srv .sm, .srv .smo { opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .srv .sp { text-align: center; }
.srv button { font: inherit; font-size: 13px; font-weight: bold; padding: 5px; background: #4c5844; color: #fff; border: 0; cursor: pointer; }
.srv button:disabled { opacity: .35; cursor: default; }
.srvEmpty { font-size: 13px; opacity: .7; padding: 8px; background: rgba(0,0,0,.2); }
.srvCreate select { flex: .7; } .srvCreate button { flex: 1.1; }
#admin.noadmin .adm-cols { display: none !important; }
#netinfo { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); display: none; font-size: 12px; color: #ddd; background: rgba(0,0,0,.4); padding: 3px 10px; }
#netinfo b { color: rgba(255,170,0,.95); }

/* ---------------- touch controls (phones & tablets) */
body.touch, body.touch * { -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
body.touch #c { touch-action: none; }
#touch { position: fixed; inset: 0; z-index: 2; display: none; touch-action: none; }
.t-look { position: absolute; inset: 0; }
.t-stick { position: absolute; display: none; width: 0; height: 0; pointer-events: none; }
.t-base { position: absolute; width: 130px; height: 130px; left: -65px; top: -65px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08); }
.t-knob { position: absolute; left: 0; top: 0; width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.35); transform: translate(-50%,-50%); }
#touch .tb { position: absolute; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: rgba(255,255,255,.9);
  font: bold 18px Verdana, sans-serif; display: flex; align-items: center; justify-content: center; touch-action: none; padding: 0; backdrop-filter: blur(2px); }
#touch .tb.on { background: rgba(255,170,0,.45); border-color: rgba(255,200,80,.9); }
#touch .fire { right: max(18px, env(safe-area-inset-right)); bottom: 150px; width: 100px; height: 100px; font-size: 20px; background: rgba(255,60,40,.22); border-color: rgba(255,120,100,.6); }
#touch .jump { right: 136px; bottom: 76px; width: 68px; height: 68px; font-size: 28px; }
#touch .crouch { right: max(24px, env(safe-area-inset-right)); bottom: 68px; width: 62px; height: 62px; font-size: 28px; }
#touch .reload { right: 136px; bottom: 166px; width: 54px; height: 54px; }
#touch .alt { right: 140px; bottom: 236px; width: 50px; height: 50px; font-size: 22px; }
#touch .cycle { right: max(30px, env(safe-area-inset-right)); bottom: 270px; width: 56px; height: 56px; font-size: 24px; }
#touch .use { right: 214px; bottom: 120px; width: 62px; height: 62px; background: rgba(60,200,60,.3); }
.t-top { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
#touch .tb.small { position: static; border-radius: 8px; width: auto; height: 34px; padding: 0 12px; font-size: 13px; }
.touchhelp { display: none; font-size: 12px; opacity: .8; margin-top: 14px; text-align: left; line-height: 1.5; }
body.touch .touchhelp { display: block; }
body.touch .keys { display: none; }
#rotate { display: none; position: fixed; inset: 0; z-index: 50; background: #000; color: #f0d6a0; font-size: 22px; text-align: center; align-items: center; justify-content: center; flex-direction: column; }
@media (orientation: portrait) { body.touch #rotate { display: flex; } }

/* small landscape screens: compact HUD and menus */
@media (max-height: 520px) {
  .stat { font-size: 22px; } .stat .ic { font-size: 17px; }
  #money { font-size: 20px; } #moneyRow { margin-bottom: 8px; } #reserve { font-size: 18px; }
  #bl { left: 12px; bottom: 8px; gap: 22px; } #br { right: 14px; bottom: 8px; } #timer { bottom: 8px; }
  body.touch #br { right: auto; left: 50%; transform: translateX(80px); bottom: 8px; }
  body.touch #timer { transform: translateX(-160%); }
  #radar { width: 110px; height: 110px; top: 6px; left: 6px; }
  #icons { top: 122px; left: 10px; } .ico { font-size: 16px; } .ico.buyz { font-size: 22px; }
  #killfeed { top: 46px; } .kf { font-size: 11px; }
  #chat { bottom: 46px; font-size: 11px; }
  #centerTitle { font-size: 22px; } #centerSub { font-size: 13px; }
  #buy { top: 120px; left: 10px; min-width: 240px; max-height: calc(100vh - 140px); overflow: auto; }
  .bi { font-size: 16px; padding: 6px 0; }
  #scoreboard { top: 4%; padding: 10px; transform: translateX(-50%) scale(.8); transform-origin: top center; }
  .panel { padding: 14px 18px; max-height: 96vh; overflow: auto; max-width: 96vw; }
  .panel h1 { font-size: 30px; letter-spacing: 3px; }
  .opts { gap: 6px 14px; margin: 10px 0; }
  button#play, button#again { font-size: 16px; padding: 9px 30px; }
  .mprow button { font-size: 13px; padding: 7px; }
  .adm-win { max-height: 98vh; } .adm-cols { grid-template-columns: 1fr 1fr; }
}

/* touch: centered, two-column buy menu with big tap targets */
body.touch #buy { left: 50%; top: 50%; transform: translate(-50%, -50%); max-height: 88vh; overflow: auto; min-width: min(520px, 90vw); }
body.touch #buyBody { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
body.touch #buyBody h3 { grid-column: 1 / -1; }
body.touch .bi { font-size: 15px; padding: 7px 4px; border-bottom: 1px solid rgba(255,255,255,.08); }

/* ---------------- map creator */
.menubtns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
button#editorBtn { font: inherit; font-size: 16px; font-weight: bold; padding: 12px 22px; background: #4c5844; color: #fff; border: 0; cursor: pointer; }
#editor { position: fixed; inset: 0; z-index: 30; display: none; background: #1d1b17; color: #eee; font-family: Verdana, sans-serif; }
#editor aside { width: 300px; padding: 14px; overflow-y: auto; background: #26231d; border-right: 1px solid #4a4130; display: flex; flex-direction: column; gap: 8px; }
#editor h2 { margin: 0; color: #f0d6a0; font-size: 18px; letter-spacing: 1px; }
#editor h3 { margin: 10px 0 0; font-size: 12px; color: #e0a040; text-transform: uppercase; }
#editor input#ed-name { font: inherit; padding: 7px; background: #15130f; color: #fff; border: 1px solid #6b5a3c; }
#editor button { font: inherit; font-size: 12px; background: #3c4436; color: #e8e4c8; border: 1px solid #6e7a5e; padding: 6px 8px; cursor: pointer; }
#editor button:hover { background: #56624c; }
#editor button.on { background: #8a6a2c; border-color: #ffb040; color: #fff; }
.ed-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ed-tool { display: flex; align-items: center; gap: 6px; text-align: left; }
.ed-tool i { width: 14px; height: 14px; border: 1px solid #000; flex: none; }
.ed-tool kbd { margin-left: auto; font-size: 10px; opacity: .6; }
.ed-row { display: flex; gap: 4px; align-items: center; font-size: 12px; flex-wrap: wrap; }
.ed-row button { flex: 1; }
.ed-chk { font-size: 12px; display: flex; gap: 6px; align-items: center; }
.ed-check { font-size: 12px; background: rgba(0,0,0,.3); padding: 8px; line-height: 1.6; }
.ed-check .ok { color: #7fe07f; } .ed-check .bad { color: #ff6a50; } .ed-check .warn { color: #ffcf60; } .ed-check .stats { opacity: .7; margin-top: 4px; }
#editor button.ed-play { background: #b0702a; border-color: #ffb040; color: #fff; font-size: 15px; font-weight: bold; padding: 10px; }
.ed-lib { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.ed-libitem { display: flex; gap: 4px; align-items: center; } .ed-libitem span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#editor main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
#ed-canvas { box-shadow: 0 6px 30px #000; cursor: crosshair; touch-action: none; image-rendering: pixelated; }
.ed-help { font-size: 12px; opacity: .7; text-align: center; padding: 0 10px; }
.ed-status { font-size: 13px; color: #7fe07f; min-height: 18px; } .ed-status.err { color: #ff6a50; }
@media (max-height: 520px), (max-width: 760px) {
  #editor { flex-direction: row; } #editor aside { width: 230px; padding: 8px; gap: 5px; }
  .ed-tools { grid-template-columns: 1fr; } .ed-tool kbd, .ed-help { display: none; }
}

#editor select#ed-theme { flex: 1; font: inherit; font-size: 12px; background: #15130f; color: #fff; border: 1px solid #6b5a3c; padding: 4px; }

#editor select#ed-copy { flex: 2; font: inherit; font-size: 12px; background: #3c4436; color: #e8e4c8; border: 1px solid #6e7a5e; padding: 5px; }

/* user options in the pause menu */
#userOpts { margin: 14px 0 18px; padding: 12px 14px; background: rgba(0,0,0,.35); border-radius: 6px; text-align: left; cursor: default; }
#userOpts h3 { margin: 0 0 10px; font-size: 15px; letter-spacing: 1px; color: #e8b04a; }
#userOpts label { display: block; margin-bottom: 12px; }
#userOpts input[type=range] { width: 100%; margin-top: 6px; }
#pSensVal, #pFovVal, #pVolVal { float: right; color: #e8b04a; font-weight: bold; }
#userOpts .xhRow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#userOpts .xhRow button { padding: 4px 10px; margin: 0; }
#userOpts .xhRow button.on { background: #e8b04a; color: #111; }
#xhPreview { --gap: 4px; position: relative; display: inline-block; width: 44px; height: 44px; margin-left: 6px; background: rgba(0,0,0,.5); border-radius: 4px; }
#xhPreview i { margin: 22px 0 0 22px; }
#xhPreview .t { bottom: calc(44px - 22px + var(--gap)); margin-top: 0; top: auto; }
#xhPreview .b { top: var(--gap); }
#xhPreview .l { right: calc(44px - 22px + var(--gap)); margin-left: 0; left: auto; }
#xhPreview .r { left: var(--gap); }
#userOpts .xhRow + .xhRow { margin-top: 10px; }
#gfxInfo, #mvInfo { font-size: 11px; opacity: .65; margin: 4px 0 8px; min-height: 13px; }
#userOpts label.chkRow { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; cursor: pointer; }
#fps { position: fixed; top: 6px; left: 50%; transform: translateX(-50%); z-index: 9; display: none; pointer-events: none;
  font: bold 13px monospace; color: #7dff7d; background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 4px; text-shadow: 0 1px 0 #000; }

/* kill confirmation banner */
#killBanner { position: absolute; left: 50%; top: 64%; transform: translateX(-50%); text-align: center; pointer-events: none; opacity: 0; transition: opacity .35s; text-shadow: 0 2px 4px #000, 0 0 12px rgba(0,0,0,.6); }
#killBanner.on { opacity: 1; }
#killBanner.pop .kb-title { animation: kbPop .35s cubic-bezier(.2,1.6,.4,1); }
#killBanner .kb-icons { font-size: 22px; color: #ff6a50; letter-spacing: 4px; }
#killBanner .kb-title { font-size: 22px; font-weight: 900; letter-spacing: 4px; color: #fff; }
#killBanner .kb-sub { font-size: 14px; font-weight: bold; letter-spacing: 3px; color: #ffd24a; margin-top: 2px; }
#killBanner.hs .kb-title { color: #ffd24a; font-size: 26px; }
#killBanner.multi .kb-title { font-size: 34px; color: #ffb030; -webkit-text-stroke: 1px #5a2000; }
#killBanner.m4 .kb-title { font-size: 40px; color: #ff7a20; }
#killBanner.m5 .kb-title { font-size: 46px; color: #ff3b2a; animation: kbPop .35s cubic-bezier(.2,1.6,.4,1), kbShake .5s .35s; }
@keyframes kbPop { from { transform: scale(2.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes kbShake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@media (pointer: coarse) { #killBanner { top: 30%; } #killBanner .kb-title { font-size: 18px; } #killBanner.multi .kb-title { font-size: 26px; } }
#userOpts label.muteRow { margin: -4px 0 12px; }
/* ACE banner (everybody) */
#aceBanner { position: absolute; left: 0; right: 0; top: 36%; text-align: center; pointer-events: none; opacity: 0; transition: opacity .5s; text-shadow: 0 3px 6px #000, 0 0 18px rgba(0,0,0,.7); }
#aceBanner.on { opacity: 1; }
#aceBanner .ace-title { font-size: 84px; font-weight: 900; letter-spacing: 18px; color: #ffd24a; -webkit-text-stroke: 1px #7a4c00;
  background: linear-gradient(#fff6c8, #ffc021 55%, #c07800); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: none; filter: drop-shadow(0 3px 3px rgba(0,0,0,.8)) drop-shadow(0 0 14px rgba(255,170,0,.45)); }
#aceBanner .ace-sub { font-size: 18px; font-weight: bold; color: #fff; letter-spacing: 1px; }
#aceBanner.pop .ace-title { animation: acePop .6s cubic-bezier(.2,1.5,.4,1); }
@keyframes acePop { 0% { transform: scale(3); opacity: 0; letter-spacing: 60px; } 100% { transform: scale(1); opacity: 1; } }
@media (pointer: coarse) { #aceBanner { top: 18%; } #aceBanner .ace-title { font-size: 52px; letter-spacing: 10px; } #aceBanner .ace-sub { font-size: 13px; } }
#userOpts label.xhStatic { margin: 6px 0 10px; }

/* "[E] Ramasser ..." when aiming at a weapon on the floor */
#usePrompt { position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); display: none; pointer-events: none;
  font-size: 15px; color: #fff; background: rgba(0,0,0,.5); padding: 5px 12px; border-radius: 4px; white-space: nowrap; text-shadow: 0 1px 2px #000; }
#usePrompt b { color: #ffc84a; }
#usePrompt kbd { display: inline-block; font: bold 13px monospace; color: #111; background: #ffc84a; border-radius: 3px; padding: 1px 6px; margin-right: 6px; }

/* deathmatch */
#timer .dms { display: block; font-size: 13px; font-weight: bold; letter-spacing: 0; color: #ffd27a; text-align: center; margin-top: 2px; }
#buyBody .dmfree { color: #9fe39f; font-size: 12px; cursor: default; }
#endScore .podium { display: flex; gap: 22px; justify-content: center; font-size: 20px; flex-wrap: wrap; }
#endScore .podium b { color: #ffc84a; }

/* deathmatch leaderboard, top centre */
#dmBoard { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); min-width: 230px; display: none; pointer-events: none;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,200,74,.35); border-radius: 6px; padding: 5px 10px 6px; font-size: 13px; text-shadow: 0 1px 2px #000; }
#dmBoard .dbh { font-size: 10px; letter-spacing: 2px; color: #ffc84a; text-align: center; margin-bottom: 3px; }
#dmBoard .dbr { display: flex; align-items: center; gap: 8px; padding: 1px 4px; border-radius: 3px; }
#dmBoard .dbr i { width: 14px; font-style: normal; color: #aaa; text-align: right; }
#dmBoard .dbr span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
#dmBoard .dbr b { color: #ffc84a; min-width: 34px; text-align: right; }
#dmBoard .dbr.me { background: rgba(255,200,74,.22); }
#dmBoard .dbr.dots { justify-content: center; color: #888; padding: 0; line-height: 8px; }
@media (pointer: coarse) { #dmBoard { top: 4px; font-size: 11px; min-width: 180px; } }

/* alive players per team, top centre */
#teamBar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: none; align-items: center; gap: 10px; pointer-events: none; text-shadow: 0 1px 2px #000; }
#teamBar .tb { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.45); border-bottom: 3px solid var(--c); border-radius: 4px; padding: 4px 10px; }
#teamBar .n { font-size: 26px; font-weight: bold; color: var(--c); min-width: 18px; text-align: center; }
#teamBar .sc { font-size: 15px; color: #ddd; opacity: .85; }
#teamBar .pips { display: flex; gap: 3px; }
#teamBar .pips i { width: 9px; height: 18px; border-radius: 2px; background: var(--c); }
#teamBar .pips i.d { background: rgba(255,255,255,.15); }
#teamBar .vs { font-size: 11px; letter-spacing: 2px; color: #aaa; }
@media (max-width: 900px), (max-height: 500px) { #teamBar { top: 4px; transform: translateX(-50%) scale(.8); transform-origin: top center; } }
