:root {
  --bg: #0c1013;
  --panel: rgba(16, 21, 25, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --text: #e7eaeb;
  --dim: #8d989e;
  --accent: #ffb22e;
  --friend: #45cbd9;
  --enemy: #ff6447;
  --font: Bahnschrift, "DIN Alternate", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); user-select: none; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font-family: inherit; }

/* ------------------------------------------------------------ menus */
#menu { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; padding: 5vh 6vw; overflow-y: auto; }
#menuShade { position: fixed; inset: 0; background: linear-gradient(100deg, rgba(8, 11, 13, 0.95) 0%, rgba(8, 11, 13, 0.8) 30%, rgba(8, 11, 13, 0.25) 58%, rgba(8, 11, 13, 0.05) 100%), linear-gradient(0deg, rgba(8, 11, 13, 0.55) 0%, rgba(8, 11, 13, 0) 30%); z-index: -1; }
#menu.deep #menuShade { background: rgba(8, 11, 13, 0.82); }
header { margin-bottom: 4vh; }
.logo { font-size: clamp(40px, 7vw, 84px); font-weight: 700; letter-spacing: 0.12em; line-height: 1; font-stretch: condensed; }
.logo span { color: var(--accent); }
.tag { color: var(--dim); letter-spacing: 0.35em; text-transform: uppercase; font-size: 13px; margin-top: 10px; }
.screen { display: flex; gap: 4vw; align-items: flex-start; flex-wrap: wrap; }
.mainnav { display: flex; flex-direction: column; gap: 10px; width: min(440px, 100%); }
.navbtn { text-align: left; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid transparent; color: var(--text); padding: 16px 20px; cursor: pointer; transition: border-color 0.12s, transform 0.12s, background 0.12s; }
.navbtn b { display: block; font-size: 22px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.navbtn span { color: var(--dim); font-size: 13px; }
.navbtn:hover, .navbtn:focus-visible { border-left-color: var(--accent); background: rgba(30, 38, 44, 0.95); transform: translateX(4px); outline: none; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 22px 26px; backdrop-filter: blur(6px); }
.panel.side { width: min(380px, 100%); }
.panel.wide { width: min(880px, 100%); }
.panel.narrow { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; }
h2 { margin: 0 0 16px; font-size: 26px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
h3 { margin: 16px 0 8px; font-size: 14px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
p { color: var(--dim); font-size: 14px; line-height: 1.5; margin: 6px 0 12px; }
.hint { font-size: 13px; }
.error { color: var(--enemy); min-height: 1em; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0; font-size: 13px; }
.keys dt { color: var(--text); white-space: nowrap; }
.keys dd { margin: 0; color: var(--dim); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .opt > label { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.field label b { color: var(--text); font-weight: 600; margin-left: 6px; }
input[type=text], input[type=password] { background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line); color: var(--text); padding: 10px 12px; font: inherit; font-size: 17px; letter-spacing: 0.06em; user-select: text; }
input[type=text]:focus, input[type=password]:focus { outline: 1px solid var(--accent); }
#joinCode { width: 120px; text-transform: uppercase; text-align: center; font-size: 22px; letter-spacing: 0.3em; }
input[type=range] { accent-color: var(--accent); width: 100%; }
.check { color: var(--dim); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.btn { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--text); padding: 11px 22px; font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.btn:hover, .btn:focus-visible { background: rgba(255, 255, 255, 0.14); outline: none; }
.btn.primary { background: var(--accent); color: #15120a; border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { background: #ffc55e; }
.btn.danger:hover { background: rgba(255, 100, 71, 0.3); border-color: var(--enemy); }
.btn:disabled { opacity: 0.4; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 18px; }
.row.between { justify-content: space-between; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cols.three { grid-template-columns: repeat(3, 1fr); }
.card { background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); padding: 16px 18px; }
.card h3 { margin-top: 0; }
.card.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.card.pick { cursor: pointer; }
.card.pick:hover { background: rgba(255, 255, 255, 0.05); }
.stat { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: center; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin-top: 6px; }
.stat i { display: block; height: 5px; background: rgba(255, 255, 255, 0.1); }
.stat i b { display: block; height: 100%; background: var(--accent); }
.code { font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.code b { font-size: 32px; color: var(--accent); letter-spacing: 0.3em; margin-left: 10px; user-select: text; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; margin: 6px 0; }
.opt { display: flex; flex-direction: column; gap: 6px; }
.opt.full { grid-column: 1 / -1; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button { flex: 1 1 auto; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--dim); padding: 8px 10px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: #15120a; font-weight: 700; }
.seg button:disabled { cursor: default; }
.seg button:not(.on):not(:disabled):hover { color: var(--text); background: rgba(255, 255, 255, 0.12); }
.teamcol h3 { margin-top: 0; }
.teamcol.t0 h3 { color: var(--friend); }
.teamcol.t1 h3 { color: var(--enemy); }
.chip { padding: 6px 10px; background: rgba(255, 255, 255, 0.06); margin-bottom: 4px; font-size: 14px; display: flex; justify-content: space-between; }
.chip.bot { color: var(--dim); font-style: italic; }
.chip.me { box-shadow: inset 2px 0 0 var(--accent); }
.chip small { color: var(--dim); }
/* a level badge: the level on a small shield */
.lvl { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 24px; height: 19px; padding: 0 4px 3px; margin-right: 7px; vertical-align: middle; position: relative; top: -1px;
  font-size: 11px; font-weight: 700; font-style: normal; letter-spacing: 0; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: none;
  color: #0c1013; background: linear-gradient(180deg, color-mix(in srgb, var(--lv) 100%, #fff 0%), color-mix(in srgb, var(--lv) 78%, #000)); clip-path: polygon(0 0, 100% 0, 100% 66%, 50% 100%, 0 66%); --lv: #98a4aa; }
.lvl.t1 { --lv: #cf9159; } .lvl.t2 { --lv: #dfe6ea; } .lvl.t3 { --lv: #ffc93c; } .lvl.t4 { --lv: #45cbd9; } .lvl.t5 { --lv: #ff6447; color: #fff; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(8, 11, 13, 0.85); font-size: 20px; letter-spacing: 0.3em; text-transform: uppercase; }
.overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(6, 8, 10, 0.6); }
@media (max-width: 720px) { .cols, .cols.three, .opts { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ scope */
#scope { --r: min(43vh, 47vw); position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0; visibility: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) calc(var(--r) * 0.7), rgba(0, 0, 0, 0.5) calc(var(--r) - 3px), #000 var(--r)); }
#scope svg { position: absolute; left: 50%; top: 50%; width: calc(var(--r) * 2); height: calc(var(--r) * 2); transform: translate(-50%, -50%); }

/* ------------------------------------------------------------ hud */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
#vignette { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, rgba(160, 0, 0, 0) 45%, rgba(160, 0, 0, 0.75) 100%); }
#dmgdir { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#dmgdir i { position: absolute; left: -110px; top: -110px; width: 220px; height: 220px; border-radius: 50%; border: 10px solid transparent; border-top-color: rgba(255, 60, 40, 0.85); filter: blur(1px); }
#crosshair { position: absolute; left: 50%; top: 50%; --gap: 8px; }
#crosshair i { position: absolute; background: #fff; box-shadow: 0 0 2px #000; }
#crosshair i:nth-child(1) { width: 2px; height: 8px; left: -1px; top: calc(-8px - var(--gap)); }
#crosshair i:nth-child(2) { width: 2px; height: 8px; left: -1px; top: var(--gap); }
#crosshair i:nth-child(3) { width: 8px; height: 2px; top: -1px; left: calc(-8px - var(--gap)); }
#crosshair i:nth-child(4) { width: 8px; height: 2px; top: -1px; left: var(--gap); }
#hitmarker { position: absolute; left: 50%; top: 50%; opacity: 0; transform: rotate(45deg); --c: #fff; }
#hitmarker i { position: absolute; background: var(--c); box-shadow: 0 0 2px #000; }
#hitmarker i:nth-child(1) { width: 2px; height: 10px; left: -1px; top: -17px; }
#hitmarker i:nth-child(2) { width: 2px; height: 10px; left: -1px; top: 7px; }
#hitmarker i:nth-child(3) { width: 10px; height: 2px; top: -1px; left: -17px; }
#hitmarker i:nth-child(4) { width: 10px; height: 2px; top: -1px; left: 7px; }

#topbar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; gap: 3px; }
.tscore { display: flex; align-items: center; gap: 12px; padding: 6px 14px; background: rgba(10, 14, 16, 0.7); min-width: 120px; }
.tscore.friendly { border-bottom: 3px solid var(--friend); justify-content: flex-end; }
.tscore.enemy { border-bottom: 3px solid var(--enemy); }
.tname { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tval { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
#clock { background: rgba(10, 14, 16, 0.85); padding: 4px 18px; text-align: center; min-width: 120px; }
#modeName { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
#timer { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
#timer.hot { color: var(--enemy); }
#subline { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); min-height: 12px; }

#killfeed { position: absolute; top: 16px; right: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 14px; }
#killfeed div { background: rgba(10, 14, 16, 0.65); padding: 3px 9px; transition: opacity 0.5s; }
#killfeed .f { color: var(--friend); } #killfeed .e { color: var(--enemy); } #killfeed .me { color: var(--accent); font-weight: 700; }
#killfeed em { font-style: normal; color: var(--dim); margin: 0 7px; font-size: 12px; letter-spacing: 0.06em; }

#popups { position: absolute; left: 50%; top: 61%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
#popups div { font-size: 18px; letter-spacing: 0.1em; text-transform: uppercase; animation: pop 1.9s ease-out forwards; }
#popups div b { color: var(--accent); margin-right: 10px; }
@keyframes pop { 0% { opacity: 0; transform: translateY(8px) scale(1.25); } 10% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }

#banner { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); text-align: center; opacity: 0; transition: opacity 0.3s; white-space: nowrap; }
#bannerMain { font-size: clamp(30px, 5vw, 58px); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
#bannerSub { font-size: 15px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--dim); margin-top: 4px; }
#banner.good #bannerMain { color: var(--friend); } #banner.bad #bannerMain { color: var(--enemy); } #banner.info #bannerMain { color: var(--accent); }

#prompt { position: absolute; left: 50%; top: 68%; transform: translateX(-50%); font-size: 16px; letter-spacing: 0.1em; background: rgba(10, 14, 16, 0.7); padding: 6px 14px; display: none; }
#prompt b { color: var(--accent); }
#progress { position: absolute; left: 50%; top: 73%; transform: translateX(-50%); width: 260px; height: 14px; background: rgba(10, 14, 16, 0.8); border: 1px solid var(--line); display: none; }
#progressFill { height: 100%; background: var(--accent); width: 0; }
#progressLabel { position: absolute; left: 0; right: 0; top: -22px; text-align: center; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; }
#breath { position: absolute; left: 50%; top: calc(50% + min(43vh, 47vw) - 34px); transform: translateX(-50%); width: 120px; height: 4px; background: rgba(255, 255, 255, 0.15); display: none; z-index: 6; }
#breathFill { height: 100%; background: #fff; width: 100%; }
#breath.locked #breathFill { background: var(--enemy); }
#death { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); text-align: center; display: none; }
#deathBy { font-size: 26px; letter-spacing: 0.12em; text-transform: uppercase; }
#deathBy b { color: var(--enemy); }
#deathSub { font-size: 14px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); margin-top: 6px; }

#weapon { position: absolute; right: 22px; bottom: 20px; text-align: right; }
#wname { font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
#ammo { font-variant-numeric: tabular-nums; line-height: 1; }
#ammoMag { font-size: 50px; font-weight: 700; }
#ammoMag.low { color: var(--enemy); }
#ammoRes { font-size: 20px; color: var(--dim); margin-left: 8px; }
#ammoRes::before { content: "/ "; }
#hpwrap { width: 190px; height: 5px; background: rgba(255, 255, 255, 0.15); margin-top: 8px; margin-left: auto; }
#hpbar { height: 100%; background: #fff; width: 100%; transition: width 0.12s; }
#bombTag { display: none; font-size: 12px; letter-spacing: 0.2em; color: #15120a; background: var(--accent); padding: 3px 8px; margin-bottom: 8px; font-weight: 700; text-shadow: none; }
#minimap { position: absolute; left: 18px; top: 16px; background: rgba(10, 14, 16, 0.6); border: 1px solid var(--line); }

#markers i { position: absolute; transform: translate(-50%, -50%); font-style: normal; text-align: center; font-size: 11px; letter-spacing: 0.08em; color: #fff; }
#markers i b { display: grid; place-items: center; width: 30px; height: 30px; margin: 0 auto 2px; border: 2px solid var(--accent); background: rgba(10, 14, 16, 0.55); color: var(--accent); font-size: 16px; transform: rotate(45deg); }
#markers i b span { transform: rotate(-45deg); }
#markers i.bomb b { border-color: var(--enemy); color: var(--enemy); }

#scoreboard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, 92vw); background: rgba(10, 14, 16, 0.9); border: 1px solid var(--line); padding: 16px 20px; text-shadow: none; }
#scoreboard h4 { margin: 0 0 10px; font-size: 14px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--dim); font-weight: 600; display: flex; justify-content: space-between; }
#scoreboard table { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 14px; }
#scoreboard th { text-align: right; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); font-weight: 400; padding: 2px 8px; }
#scoreboard th:first-child, #scoreboard td:first-child { text-align: left; }
#scoreboard td { text-align: right; padding: 4px 8px; font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, 0.04); border-bottom: 2px solid rgba(10, 14, 16, 0.9); }
#scoreboard tr.me td { background: rgba(255, 178, 46, 0.18); }
#scoreboard tr.dead td { color: var(--dim); }
#scoreboard caption { text-align: left; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; padding: 4px 8px; font-weight: 700; }
#scoreboard table.f caption { color: var(--friend); } #scoreboard table.e caption { color: var(--enemy); }
#scoreboard td small { color: var(--dim); margin-left: 6px; }

/* narrow windows: keep the corners from colliding with the score bar */
@media (max-width: 1100px) {
  #killfeed { top: 84px; }
  #minimap { top: auto; bottom: 18px; width: 180px; height: 120px; }
}

/* ------------------------------------------------------------ classes + equipment */
#flash { position: fixed; inset: 0; z-index: 8; background: #fff; opacity: 0; pointer-events: none; }
#equip { display: flex; gap: 16px; justify-content: flex-end; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
#equip span i { font-style: normal; color: var(--accent); margin-right: 7px; border: 1px solid var(--line); padding: 0 5px; background: rgba(10, 14, 16, 0.6); }
#equip span b { color: var(--text); margin-left: 7px; }
#equip span.out { opacity: 0.35; }
.desc { margin: 2px 0 0; font-size: 12px; min-height: 1.5em; }
.statrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 20px; }
#classTabs { flex: 0 0 auto; }
#classTabs button { min-width: 92px; }
@media (max-width: 720px) { .statrow { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ main screen */
#scr-main { flex: 1; align-items: stretch; justify-content: space-between; }
.mainnav { justify-content: flex-start; }
.navbtn.hero { background: var(--accent); border-color: var(--accent); color: #15120a; padding: 20px 22px; }
.navbtn.hero b { font-size: 34px; font-weight: 700; letter-spacing: 0.14em; }
.navbtn.hero span { color: rgba(21, 18, 10, 0.75); font-weight: 600; }
.navbtn.hero:hover, .navbtn.hero:focus-visible { background: #ffc55e; border-left-color: #fff; }
.navrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.navbtn.slim { padding: 12px 20px; }
.navbtn.slim b { font-size: 16px; }
.opcard { align-self: flex-end; width: min(340px, 100%); background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--friend); padding: 18px 20px; backdrop-filter: blur(6px); display: flex; flex-direction: column; gap: 14px; }
.ophead { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.oprifle { font-size: 26px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin: 4px 0 8px; }
.oprifle small { display: block; font-size: 12px; font-weight: 400; letter-spacing: 0.14em; color: var(--accent); margin-top: 2px; }
.opclass ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; color: var(--text); }
.opclass li span { display: block; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
button.link { background: none; border: none; color: var(--accent); font: inherit; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; cursor: pointer; padding: 0; }
button.link:hover { text-decoration: underline; }
#menuFoot { margin-top: 3vh; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(231, 234, 235, 0.45); }
#menu.deep #menuFoot { display: none; }

/* ------------------------------------------------------------ invite links */
#lobbyInvite { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 14px; }
.invite { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); padding: 8px 12px; }
.invite span { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.invite code { font-family: Consolas, monospace; font-size: 15px; color: var(--text); user-select: text; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite .btn { padding: 6px 14px; font-size: 12px; }
.invite small { grid-column: 2 / -1; font-size: 12px; color: var(--dim); }
.invite small.ok { color: #6fd08c; }
.invite small.warn { color: var(--accent); }
@media (max-width: 720px) { .invite { grid-template-columns: 1fr auto; } .invite span { grid-column: 1 / -1; } }

/* ------------------------------------------------------------ logo */
.logo { display: flex; align-items: center; }
.logo img { height: 1.02em; width: 1.02em; margin-right: 0.22em; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5)); }

/* ------------------------------------------------------------ match option hint */
.opthint { margin: 10px 0 0; font-size: 13px; letter-spacing: 0.03em; color: var(--text); opacity: 0.6; }

/* ------------------------------------------------------------ profiles */
.xpbar { height: 6px; background: rgba(255, 255, 255, 0.1); }
.xpbar b { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.7s ease-out; }
#callsign[readonly] { color: var(--accent); cursor: default; }
#callsign[readonly]:focus { outline: none; }
#opSignIn { align-self: flex-start; }
/* the Profile entry is one line (name on the left, who is signed in on the right) so the main menu still fits a 720px-high window */
.mainnav, .navrow { gap: 8px; }
.navbtn.line { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.navbtn.line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#acctForm p { margin: 0; }
#acctError:empty { display: none; }
.oprank { display: flex; flex-direction: column; gap: 6px; }
.oprank .ophead b { color: var(--text); font-size: 15px; margin-left: 4px; }
.oprank small, .profname small { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); font-variant-numeric: tabular-nums; }
#profTabs { flex: 0 0 auto; }
#profTabs button { min-width: 120px; }
.profhead { display: flex; gap: 18px; align-items: center; margin: 2px 0 16px; }
.proflevel { flex: 0 0 auto; width: 84px; height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px solid var(--accent); background: rgba(0, 0, 0, 0.3); }
.proflevel span { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.proflevel b { font-size: 38px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.profname { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.profname > b { font-size: 26px; letter-spacing: 0.06em; overflow: hidden; text-overflow: ellipsis; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.tile { background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); padding: 10px 12px; }
.tile span { display: block; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
.tile b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* the achievements scroll inside the panel so the buttons under them stay on screen */
.achgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: max(220px, calc(100vh - 470px)); overflow-y: auto; padding-right: 6px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; }
.ach { background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); border-left: 3px solid transparent; padding: 9px 12px; display: flex; flex-direction: column; gap: 5px; }
.ach.got { border-left-color: var(--accent); }
.ach.done { border-color: var(--accent); }
.achhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.achhead b { font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.ach.locked .achhead b { color: var(--dim); }
.ach p { margin: 0; font-size: 12px; line-height: 1.35; min-height: 2.7em; }
.ach .xpbar { height: 4px; }
.ach small { font-size: 11px; letter-spacing: 0.1em; color: var(--dim); font-variant-numeric: tabular-nums; }
.ach.done small { color: var(--accent); text-transform: uppercase; }
.pips { display: flex; gap: 3px; flex: 0 0 auto; }
.pips i { width: 8px; height: 8px; border: 1px solid var(--dim); }
.pips i.on { background: var(--accent); border-color: var(--accent); }
.soundcard { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.soundinfo b { display: block; font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.soundinfo small { color: var(--dim); font-size: 12px; }
#profBody .check { margin-top: 4px; }
@media (max-width: 720px) { .tiles { grid-template-columns: 1fr 1fr; } .achgrid { grid-template-columns: 1fr; } }

/* after-match progress, top right: over the kill feed, clear of the scoreboard and the menus */
#xpToast { position: fixed; top: 16px; right: 18px; z-index: 45; width: 320px; max-width: calc(100vw - 36px); background: rgba(12, 16, 19, 0.94); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 14px 16px; pointer-events: none; display: flex; flex-direction: column; gap: 6px; animation: toastin 0.35s ease-out; transition: opacity 0.6s; }
#xpToast.out { opacity: 0; }
@keyframes toastin { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
#xpToast p { margin: 0; font-size: 13px; }
.thead { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
.tgain { font-size: 32px; font-weight: 700; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.tparts, .tlevel { font-size: 12px; letter-spacing: 0.06em; color: var(--dim); font-variant-numeric: tabular-nums; }
.tlevel { color: var(--text); }
.tup { margin-top: 4px; padding: 6px 10px; background: var(--accent); color: #15120a; font-size: 14px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.tunlock { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.tach { display: flex; flex-direction: column; }
.tach b { font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.tach span { font-size: 12px; color: var(--dim); }

/* ------------------------------------------------------------ desktop app download (main menu, top right) */
.getapp { position: fixed; top: 22px; right: 26px; z-index: 3; display: flex; flex-direction: column; gap: 2px; padding: 10px 16px 9px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); color: var(--text); transition: background 0.12s, transform 0.12s; }
.getapp b { font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.getapp span { font-size: 12px; color: var(--dim); }
.getapp:hover, .getapp:focus-visible { background: rgba(30, 38, 44, 0.95); transform: translateY(1px); outline: none; }
@media (max-width: 900px) { .getapp { display: none; } }

/* ------------------------------------------------------------ public server list */
h3.sub { margin: 14px 0 8px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.srvlist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.srv { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 18px; padding: 10px 14px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.srv b { display: block; font-size: 17px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.srv span { font-size: 13px; color: var(--dim); }
.srv .count { font-size: 14px; letter-spacing: 0.06em; white-space: nowrap; color: var(--text); }
.srv .count.live { color: var(--friend); }
.srv.full { border-left-color: var(--line); }

/* ------------------------------------------------------------ ping (under the minimap) */
#ping { position: absolute; left: 18px; top: 186px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); text-shadow: 0 1px 2px #000; }
#ping.good { color: #9fe3a8; } #ping.ok { color: #ffd27a; } #ping.bad { color: #ff7a5c; }
#ping:not(:empty)::before { content: 'Ping '; color: var(--dim); }

/* ------------------------------------------------------------ chat */
#chat { position: absolute; left: 18px; bottom: 112px; width: min(440px, 42vw); display: flex; flex-direction: column; gap: 6px; }
#chatLog { display: flex; flex-direction: column; gap: 2px; font-size: 14px; max-height: 196px; overflow: hidden; scrollbar-width: none; }
#chatLog::-webkit-scrollbar { display: none; }
#chatLog > :first-child { margin-top: auto; } /* lines sit at the bottom, and can still be scrolled back through */
#chatLog div { flex: 0 0 auto; padding: 2px 8px; background: rgba(10, 14, 16, 0.55); width: fit-content; max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; transition: opacity 0.6s; text-shadow: 0 1px 2px #000; }
#chatLog div.old { opacity: 0; }
/* typing: the whole match's lines come back */
#chat.open #chatLog { max-height: min(44vh, 420px); overflow-y: auto; }
#chat.open #chatLog div.old { opacity: 1; transition: opacity 0.15s; }
#chatLog .multi { --mk: #5ab8ff; border-left: 3px solid var(--mk); background: linear-gradient(90deg, color-mix(in srgb, var(--mk) 26%, rgba(10, 14, 16, 0.7)), rgba(10, 14, 16, 0.55)); }
#chatLog .multi em { font-style: normal; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mk); text-shadow: 0 0 10px color-mix(in srgb, var(--mk) 60%, transparent), 0 1px 2px #000; }
#chatLog .multi.m3 { --mk: #ffc93c; } #chatLog .multi.m4 { --mk: #ff8a3d; } #chatLog .multi.m5 { --mk: #ff4d7a; }
#chatLog .multi.m5 em { animation: mkpulse 0.9s ease-in-out 3; }
@keyframes mkpulse { 50% { filter: brightness(1.5); } }
#chatLog b { font-weight: 600; }
#chatLog .f b { color: var(--friend); } #chatLog .e b { color: var(--enemy); } #chatLog .me b { color: var(--accent); }
#chatLog .sys { color: var(--dim); font-style: italic; }
#chatInput { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; background: rgba(10, 14, 16, 0.85); border: 1px solid var(--line); border-left: 3px solid var(--accent); font-size: 15px; }
#chatInput span { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
#chatInput b { font-weight: 400; white-space: pre-wrap; overflow-wrap: anywhere; }
#chatInput i { width: 8px; height: 1.05em; background: var(--accent); align-self: center; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chatbox { margin: 10px 0 4px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); }
.chatbox #lobbyChatLog { max-height: 84px; overflow-y: auto; padding: 6px 10px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.chatbox #lobbyChatLog:empty { display: none; }
.chatbox #lobbyChatLog b { color: var(--accent); font-weight: 600; }
.chatbox #lobbyChatLog .sys { color: var(--dim); font-style: italic; }
.chatbox input { width: 100%; box-sizing: border-box; border: 0; border-top: 1px solid var(--line); font-size: 14px; padding: 8px 10px; letter-spacing: 0.02em; }

/* ------------------------------------------------------------ key bindings */
.binds { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; margin: 4px 0 12px; }
.binds div { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--dim); }
.binds button { min-width: 104px; padding: 5px 8px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 13px; letter-spacing: 0.06em; cursor: pointer; }
.binds button:hover { border-color: var(--accent); }
.binds button.wait { border-color: var(--accent); color: var(--accent); }
.keys.fixed { margin-bottom: 12px; opacity: 0.8; }
@media (max-width: 720px) { .binds { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ key bindings: four groups side by side */
.panel.wide.controls { width: min(1180px, 100%); }
.controls > .row.between { align-items: baseline; margin-bottom: 2px; }
.controls h2 { margin: 0; }
.controls .hint { margin: 0; }
.bindgroups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 24px; align-items: start; }
.bindgroup h3 { margin: 10px 0 7px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.bindgroups .binds { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.binds div { min-height: 26px; }
.binds span { min-width: 0; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.binds > small { display: flex; align-items: center; gap: 8px; margin: 5px 0 1px; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); opacity: 0.85; }
.binds > small::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.binds button { flex: none; min-width: 92px; height: 26px; padding: 0 8px; transition: border-color 0.1s, background 0.1s; }
.binds button:hover, .binds button:focus-visible { border-color: var(--accent); background: rgba(255, 255, 255, 0.07); outline: none; }
.binds button.mine { border-color: rgba(255, 178, 46, 0.5); }
.binds button.none { color: var(--dim); }
.binds button.wait { background: rgba(255, 178, 46, 0.12); }
.fixedkeys { display: flex; flex-wrap: wrap; gap: 5px 22px; margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.fixedkeys b { margin-right: 7px; color: var(--text); font-weight: 600; }
.controls .row.end { margin-top: 14px; }
@media (max-width: 1150px) { .bindgroups { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .bindgroups { grid-template-columns: 1fr; } }
/* the Controls screen over a match or a survival world: the game behind is dimmed right down */
#menu.ingame #menuShade { background: rgba(6, 8, 10, 0.9); }

/* ------------------------------------------------------------ pause menu: resume, then settings beside controls / window / leave */
.pausebox { width: min(780px, calc(100vw - 32px)); max-height: calc(100vh - 24px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; display: flex; flex-direction: column; gap: 16px; padding: 20px 26px 24px; }
.phead { display: flex; justify-content: space-between; align-items: baseline; }
.phead h2 { margin: 0; }
#pWhere { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
.btn.pbig { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 22px; font-size: 17px; }
kbd { font: inherit; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; line-height: 1; padding: 3px 6px; border: 1px solid currentColor; opacity: 0.65; }
.pcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 26px; align-items: start; }
.psec { display: flex; flex-direction: column; gap: 11px; }
.psec h3 { margin: 0; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.pside { display: flex; flex-direction: column; gap: 18px; }
.pwin { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pwin .btn, .psec > .btn, .pconfirm .btn { padding: 9px 8px; font-size: 13px; letter-spacing: 0.1em; }
.pwin .btn:only-child, .pwin .btn.solo { grid-column: 1 / -1; }
body:not(.desk) .deskonly { display: none; }
body:not(.desk) #pFull { grid-column: 1 / -1; }
#pEnd.hidden + #pLeave { grid-column: 1 / -1; }
.pconfirm { display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 12px; border: 1px solid var(--enemy); background: rgba(255, 100, 71, 0.1); }
.pconfirm span { flex: 1; font-size: 13px; letter-spacing: 0.06em; color: var(--text); }
.btn.on { border-color: var(--accent); color: var(--accent); }
.btn.danger:focus-visible { background: rgba(255, 100, 71, 0.3); border-color: var(--enemy); }
.btn:focus-visible, .seg button:focus-visible, .navbtn:focus-visible, .check input:focus-visible, input[type=range]:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
.check { cursor: pointer; line-height: 1.3; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; flex: none; margin: 0; }
.check:hover { color: var(--text); }
@media (max-width: 640px) { .pcols { grid-template-columns: 1fr; } }

/* panels arrive with a short fade instead of popping in */
@keyframes panelin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.overlay:not(.hidden) > .panel, #menu.deep .screen:not(.hidden) > .panel { animation: panelin 0.14s ease-out; }
.overlay:not(.hidden) { animation: shadein 0.14s ease-out; }
@keyframes shadein { from { background-color: rgba(6, 8, 10, 0); } }

/* ------------------------------------------------------------ crosshair and prompt: readable over snow and sand */
#crosshair i, #hitmarker i { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), 0 0 3px rgba(0, 0, 0, 0.6); }
#prompt { background: rgba(10, 14, 16, 0.8); border-bottom: 2px solid var(--accent); text-shadow: none; }
#prompt b { display: inline-block; min-width: 22px; margin: 0 3px; padding: 0 5px; border: 1px solid var(--accent); text-align: center; font-size: 14px; }

/* ------------------------------------------------------------ key hints (bottom centre; Settings turns them off) */
#keyhints { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 16px; white-space: nowrap; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(231, 234, 235, 0.78); }
#keyhints b { display: inline-block; min-width: 20px; margin-right: 6px; padding: 2px 5px 1px; background: rgba(10, 14, 16, 0.66); border: 1px solid rgba(255, 255, 255, 0.28); color: var(--text); font-weight: 600; letter-spacing: 0.04em; text-align: center; }
#hud.nohints #keyhints { display: none; }
@media (max-width: 900px) { #keyhints { display: none; } }

/* ------------------------------------------------------------ big screens: drawn larger (main.js fitUi sets --mz for the menus, --hz for the match HUD) */
#menu, #pause, #xpToast { zoom: var(--mz, 1); }
#hud:not(.surv) { zoom: var(--hz, 1); }
#menu { padding: calc(5vh / var(--mz, 1)) calc(6vw / var(--mz, 1)); }
.pausebox { width: min(780px, calc(100vw / var(--mz, 1) - 32px)); max-height: calc(100vh / var(--mz, 1) - 24px); }
.achgrid { max-height: max(220px, calc(100vh / var(--mz, 1) - 470px)); }
#breath { top: calc(50% + min(43vh, 47vw) / var(--hz, 1) - 34px); }

/* pause menu: the three classes on one row; the close button stays lit while it asks */
#pLoadout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#pLoadout button { padding: 8px 4px; font-size: 11.5px; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn.danger.armed { background: rgba(255, 100, 71, 0.3); border-color: var(--enemy); }
.pconfirm { margin-top: -5px; }

/* ------------------------------------------------------------ settings: two columns, so it fits a 720-line window */
.setcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 30px; align-items: start; }
.setcol { display: flex; flex-direction: column; gap: 13px; }
.setcol h3 { margin: 0; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.setcol h3:not(:first-child) { margin-top: 6px; }
.setcol .btn { align-self: flex-start; padding: 9px 18px; font-size: 13px; }
.panel.settings { width: min(820px, 100%); }
.panel.settings .row.end { margin-top: 14px; }
@media (max-width: 720px) { .setcols { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ short windows (720 lines): the same menus, packed a little tighter */
@media (max-height: 830px) {
  header { margin-bottom: 2.6vh; }
  #menu.deep { padding-top: 3.2vh; padding-bottom: 3.2vh; }
  #menu.deep .logo { font-size: clamp(36px, 5vw, 58px); }
  #menu.deep .tag { font-size: 11px; margin-top: 7px; }
  .srv { padding: 6px 14px; }
  .srv b { font-size: 15px; }
  .srvlist { gap: 4px; }
  h3.sub { margin: 9px 0 6px; }
  #scr-private .card { padding: 11px 16px; }
  #scr-private .card p { display: none; }
  #scr-private .card h3 { margin-bottom: 8px; }
  #privateHint { margin: 8px 0 0; }
  #scr-private .row.end { margin-top: 8px; }
  #scr-private h2 { margin-bottom: 8px; }
}

/* a menu taller than the window scrolls with a thin bar, like the lists inside it */
#menu { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; }
