/* Savage XR browser client: full-screen canvas + DOM overlay (menus, HUD, scoreboard). */
:root {
  --bg: #07090b;
  --panel: rgba(12, 14, 16, 0.82);
  --panel-edge: rgba(201, 164, 92, 0.55);
  --gold: #e8c76a;
  --text: #e9e3d4;
  --muted: #a49c8a;
  --human: #6fa8dc;
  --beast: #d4774a;
  --danger: #ff5a4a;
  --ok: #7ed37a;
  --font: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --gui-font: "XR Standard", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --title-font: "XR Englishtowne", Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 14px/1.35 var(--font); }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; }
[hidden] { display: none !important; }
button { font: inherit; color: var(--text); background: linear-gradient(#3a3226, #221d16); border: 1px solid var(--panel-edge); border-radius: 3px; padding: 8px 16px; cursor: pointer; }
button:hover:not(:disabled) { background: linear-gradient(#5a4a31, #2f271b); border-color: var(--gold); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: linear-gradient(#7a5b23, #45330f); border-color: var(--gold); color: #fff6dd; font-weight: 600; }
button.link { background: none; border: none; color: var(--muted); text-decoration: underline; padding: 4px; }
input[type=text], input:not([type]), input.name, input.chat-input { font: inherit; color: var(--text); background: rgba(0, 0, 0, 0.55); border: 1px solid var(--panel-edge); border-radius: 3px; padding: 7px 9px; }

.boot { position: fixed; inset: 0; display: grid; place-items: center; color: var(--muted); }

/* ---------- screens ---------- */
.screens { position: fixed; inset: 0; z-index: 30; }
.screen { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, #1b1814, #050506 70%) center / cover no-repeat; overflow: auto; padding: 16px; }
.screen.ingame, .screen.disconnected { background: rgba(0, 0, 0, 0.55); }
.panel { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 6px; padding: 22px 26px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); max-width: min(560px, 100%); }
.panel.wide { max-width: min(980px, 100%); width: 100%; }
.panel.small { max-width: 340px; width: 100%; }
.panel h1, .panel h2 { margin: 0 0 10px; color: var(--gold); letter-spacing: 0.04em; }
.title { font-family: var(--title-font); font-size: 44px; margin: 0; color: var(--gold); text-shadow: 0 2px 0 #000, 0 0 18px rgba(232, 199, 106, 0.35); letter-spacing: 0.06em; }
.subtitle { margin: 4px 0 14px; color: var(--muted); }
.note { color: var(--muted); font-size: 13px; }
.warn { color: var(--danger); }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.menu-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; min-width: 220px; }
.status { min-height: 1.4em; color: var(--muted); margin: 10px 0 0; }
.status.error, .error .status { color: var(--danger); }
.progress { height: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #a07a2a, var(--gold)); transition: width 0.2s; }
.row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; margin: 8px 0; }

/* home page: menu | games | community (client/ui/menus.js mainMenu) */
.screen.main { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 640px) minmax(0, 340px); grid-template-areas: "menu games community"; align-content: center; align-items: start; justify-items: stretch; justify-content: start; gap: 20px; padding: 16px max(16px, 4vw); background-size: cover; background-position: center; }
.main-left { grid-area: menu; display: flex; flex-direction: column; gap: 10px; background: rgba(0, 0, 0, 0.55); padding: 24px 28px; border-radius: 6px; border: 1px solid rgba(201, 164, 92, 0.3); max-width: 340px; width: 100%; }
.main .logo { max-width: 300px; display: none; }
.main.with-logo .logo { display: block; }
.main.with-logo .fallback-title { display: none; }
.field { display: grid; gap: 4px; color: var(--muted); }
.server { color: var(--muted); font-size: 12px; margin: 0; }
select { font: inherit; color: var(--text); background: rgba(0, 0, 0, 0.55); border: 1px solid var(--panel-edge); border-radius: 3px; padding: 6px 8px; }
.gate .online { color: var(--ok); margin: 0 0 10px; }

/* home page game browser (client/ui/browser.js) */
.games-panel { grid-area: games; min-width: 0; max-height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 10px; background: rgba(0, 0, 0, 0.55); padding: 18px 20px; border-radius: 6px; border: 1px solid rgba(201, 164, 92, 0.3); }
.games-head { display: flex; align-items: center; gap: 12px; }
.games-head h2 { margin: 0; color: var(--gold); letter-spacing: 0.04em; font-size: 20px; }
.games-head .online { flex: 1; color: var(--muted); font-size: 13px; }
.games-head .create-game { padding: 6px 12px; }
.game-list { display: grid; gap: 8px; overflow-y: auto; min-height: 0; }
.game-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; padding: 8px 12px 8px 8px; background: rgba(12, 14, 16, 0.85); }
.game-card.invited { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 0 18px rgba(232, 199, 106, 0.25); }
.game-thumb { width: 64px; height: 64px; border-radius: 3px; border: 1px solid rgba(201, 164, 92, 0.35); background: radial-gradient(circle at 40% 35%, #3b4a2c, #161a12 70%) center / cover no-repeat; }
.game-main { display: grid; gap: 2px; min-width: 0; }
.game-title { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.game-name { font-size: 16px; font-weight: 700; color: #fff6dd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-tag { flex: none; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); border: 1px solid var(--panel-edge); border-radius: 3px; padding: 0 5px; }
.game-map { font-size: 13px; }
.game-phase { color: var(--muted); font-size: 12px; }
.game-card[data-phase=normal] .game-phase, .game-card[data-phase=warmup] .game-phase { color: var(--ok); }
.game-count { display: grid; justify-items: end; gap: 2px; white-space: nowrap; }
.game-count b { font-size: 15px; color: var(--gold); }
.game-count small { color: var(--muted); font-size: 12px; }
.games-panel .status { margin: 0; }
.games-panel .status:empty { display: none; }
.create-form { display: grid; gap: 2px; width: min(460px, 100%); }
.create-form .row { grid-template-columns: minmax(0, 1fr) minmax(0, 230px); }
.create-form .row select, .create-form .row input.name { width: 100%; }
.create-form .row input[type=checkbox] { justify-self: start; }
.map-preview { height: 150px; margin-bottom: 6px; border-radius: 4px; border: 1px solid var(--panel-edge); background: radial-gradient(circle at 40% 35%, #3b4a2c, #161a12 70%) center / cover no-repeat; }
.event-form .row input.when { width: 100%; font: inherit; color: var(--text); background: rgba(0, 0, 0, 0.55); border: 1px solid var(--panel-edge); border-radius: 3px; padding: 6px 8px; color-scheme: dark; }

/* accounts and community (client/ui/community.js) */
button.small { padding: 4px 10px; font-size: 13px; }
.account-bar { display: grid; gap: 6px; padding: 8px 0 4px; border-bottom: 1px solid rgba(201, 164, 92, 0.25); }
.account-bar p { margin: 0; }
.account-bar .signed-in { color: var(--text); }
.account-buttons { display: flex; gap: 8px; }
.account-buttons button { flex: 1; padding: 6px 10px; }
.role-tag { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); border: 1px solid var(--panel-edge); border-radius: 3px; padding: 0 5px; vertical-align: middle; }
.role-tag[data-role=admin] { color: #ff9b8a; border-color: rgba(255, 120, 100, 0.6); }
input.name[readonly] { color: var(--muted); }
.community-panel { grid-area: community; min-width: 0; max-height: calc(100vh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: rgba(0, 0, 0, 0.55); padding: 18px 20px; border-radius: 6px; border: 1px solid rgba(201, 164, 92, 0.3); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-top: 4px; }
.panel-head h2 { margin: 0; color: var(--gold); letter-spacing: 0.04em; font-size: 20px; }
.community-panel .note, .community-panel .status { margin: 0; }
.community-panel .note:empty, .community-panel .status:empty { display: none; }
a.discord-link { display: block; text-align: center; text-decoration: none; color: #fff; font-weight: 600; background: linear-gradient(#5865f2, #4250c8); border: 1px solid #8891f7; border-radius: 3px; padding: 8px 12px; }
a.discord-link:hover { background: linear-gradient(#6a76f5, #4c59d6); }
.event-list { display: grid; gap: 8px; }
.event-item { display: grid; gap: 3px; padding: 8px 10px; background: rgba(12, 14, 16, 0.85); border: 1px solid rgba(201, 164, 92, 0.35); border-radius: 3px; }
.event-item.live { border-color: var(--ok); }
.event-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.event-title b { color: #fff6dd; overflow-wrap: anywhere; }
.event-when { flex: none; color: var(--muted); font-size: 12px; }
.event-item.live .event-when { color: var(--ok); font-weight: 600; }
.event-meta, .event-text { color: var(--muted); font-size: 12px; margin: 0; overflow-wrap: anywhere; }
.event-actions { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.lb-tabs { display: flex; gap: 4px; }
.lb-tabs button.active { border-color: var(--gold); background: linear-gradient(#6e5320, #3a2b0e); }
table.leaderboard { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.leaderboard th { color: var(--muted); font-weight: 400; text-align: right; padding: 2px 4px; }
.leaderboard td { text-align: right; padding: 3px 4px; border-top: 1px solid rgba(201, 164, 92, 0.15); }
.leaderboard th:nth-child(2), .leaderboard td:nth-child(2) { text-align: left; width: 100%; }
.leaderboard td:first-child { color: var(--gold); }
button.player-link { background: none; border: none; padding: 0 4px 0 0; color: var(--text); text-decoration: underline dotted; }
button.player-link:hover:not(:disabled) { background: none; color: var(--gold); }
.auth-form { display: grid; gap: 4px; width: min(400px, 100%); }
.auth-form .row { grid-template-columns: minmax(0, 1fr) minmax(0, 220px); }
.auth-form .row input { width: 100%; }
.auth-form .link { justify-self: start; }
.profile-panel h2 { display: flex; align-items: center; gap: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.stat { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; background: rgba(12, 14, 16, 0.85); border: 1px solid rgba(201, 164, 92, 0.3); border-radius: 3px; text-align: center; }
.stat b { font-size: 20px; color: var(--gold); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }
.role-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.role-row .note { flex-basis: 100%; margin: 0; }

/* team select */
.team-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 12px 0; }
.team-card { display: grid; gap: 6px; justify-items: center; padding: 14px; min-height: 260px; background: rgba(0, 0, 0, 0.5); }
.team-card.race-human { border-color: var(--human); }
.team-card.race-beast { border-color: var(--beast); }
.team-card.current { box-shadow: 0 0 0 2px var(--gold) inset; }
.race-art { width: 100%; height: 150px; background: center / contain no-repeat; }
.team-card:not(:has(.has-art)) .race-art { background: radial-gradient(circle, rgba(255, 255, 255, 0.07), transparent 70%); }
.team-name { font-size: 22px; font-weight: 700; color: var(--gold); }
.count, .cmdr { color: var(--muted); }
.roster { list-style: none; padding: 0; margin: 4px 0 0; color: var(--text); font-size: 12px; max-height: 90px; overflow: auto; }
.map { color: var(--muted); margin: 0; }

/* loadout */
/* the columns scroll on their own: a long shop list never scrolls the whole screen (header and portrait stay put) */
.screen.loadout { display: flex; flex-direction: column; align-items: stretch; padding: 0; background-size: cover; overflow: hidden; }
.loadout-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(200px, 1fr) minmax(240px, 1.2fr) minmax(220px, 1.2fr); grid-template-rows: minmax(0, 1fr); gap: 14px; padding: 18px; overflow: hidden; }
.loadout .loadout-grid > .col { min-height: 0; overflow-y: auto; }
.loadout-bar { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: center; padding: 12px 18px; background: rgba(0, 0, 0, 0.75); border-top: 1px solid var(--panel-edge); }
.loadout-bar .status { flex: 1; margin: 0; }
.spawn-points { display: flex; gap: 8px; flex-wrap: wrap; }
.loadout .col { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 6px; padding: 12px; }
.loadout h2 { font-size: 17px; color: var(--gold); margin: 0 0 8px; }
.unit-list, .shop { display: grid; gap: 6px; }
.unit, .item { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; text-align: left; padding: 5px 8px; }
.item { grid-template-columns: 34px 1fr auto auto; }
.unit.selected { border-color: var(--gold); background: linear-gradient(#6e5320, #3a2b0e); }
.unit.locked, .item.locked { filter: grayscale(1); }
.unit.unknown .label, .item.unknown .label { opacity: 0.75; }
.item.owned { border-color: var(--ok); }
.item.expensive .cost { color: var(--danger); }
.cost { color: var(--gold); font-variant-numeric: tabular-nums; }
.kind { color: var(--muted); font-size: 11px; }
.icon { width: 32px; height: 32px; object-fit: contain; background: rgba(0, 0, 0, 0.4); border-radius: 2px; }
.icon:not([src]) { visibility: hidden; }
.portrait { height: 256px; background: center / contain no-repeat; }
.unit-name { margin: 6px 0 2px; color: var(--gold); font-size: 22px; text-align: center; }
.unit-info { text-align: center; color: var(--muted); margin: 0 0 8px; }
.gold { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--gold); font-size: 20px; font-weight: 700; }
.coin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2a8, #c99a22 60%, #7a5a10); }
.inventory-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.slot { position: relative; display: grid; justify-items: center; gap: 2px; padding: 4px; min-height: 64px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(201, 164, 92, 0.35); border-radius: 3px; font-size: 11px; }
.slot.empty { opacity: 0.5; }
.slot .sell { padding: 1px 6px; font-size: 11px; }
.slot-label { text-align: center; }
.unit.refused:not(.selected), .item.refused { filter: grayscale(0.85); }
.unit .label, .item .label { display: grid; gap: 1px; }
.unit .reason, .item .reason { color: #ff8a70; font-size: 11px; line-height: 1.15; }
.item.expensive .reason { color: var(--danger); }
.unit.pending, .item.pending, .slot .sell.pending { animation: loadout-wait 0.6s ease-in-out infinite alternate; }
@keyframes loadout-wait { from { border-color: var(--panel-edge); } to { border-color: var(--gold); box-shadow: 0 0 6px rgba(232, 199, 106, 0.6); } }
/* tooltip panel (ui_update_description_panel.cfg): name, health, the object's tooltip, cost and the server's answer */
.loadout-info { margin-top: 10px; padding: 8px 10px; min-height: 64px; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(201, 164, 92, 0.35); border-radius: 4px; font-size: 13px; }
.loadout-info .info-name { color: var(--gold); font-weight: 700; }
.loadout-info .info-text { color: rgb(204, 178, 51); margin: 3px 0; }
.loadout-info .info-line { color: var(--muted); }
.loadout-info .info-reason { color: #ff8a70; }
.loadout-info .info-req { color: rgb(230, 51, 51); }
.loadout-info .info-hint { color: var(--muted); font-style: italic; }
/* last loadout, presets and levels (loadout-memory.js, level-banner.js) */
.last-loadout { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.last-loadout .summary { color: var(--muted); font-size: 12px; }
.buy-last, .presets button { padding: 4px 10px; font-size: 13px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.presets-label { color: var(--gold); font-size: 13px; }
.presets select, .presets input { font: inherit; font-size: 13px; color: var(--text); background: rgba(0, 0, 0, 0.55); border: 1px solid var(--panel-edge); border-radius: 3px; padding: 4px 6px; }
.presets select { max-width: 150px; }
.presets input { width: 120px; }
.levels { margin-top: 10px; font-size: 12px; }
.levels summary { cursor: pointer; color: var(--gold); font-size: 13px; }
.level-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; max-height: 210px; overflow-y: auto; }
.level-list li { display: grid; grid-template-columns: 26px 1fr; column-gap: 6px; padding: 2px 4px; border-radius: 2px; color: var(--muted); }
.level-list li.reached { color: var(--text); }
.level-list li.next { background: rgba(232, 199, 106, 0.12); }
.level-list .lvl { color: var(--gold); text-align: right; font-variant-numeric: tabular-nums; }
.level-list .reward-text { grid-column: 2; font-style: italic; opacity: 0.8; }

/* ---------- HUD (1024x768 virtual units scaled by --s, see client/ui/hud.js) ---------- */
.hud { --s: 1; position: fixed; inset: 0; z-index: 10; pointer-events: none; text-shadow: 1px 1px 1px #000; font-size: calc(14px * var(--s)); overflow: hidden; }
.v { position: absolute; left: calc(var(--x) * var(--s) * 1px); top: calc(var(--y) * var(--s) * 1px); width: calc(var(--w, 0) * var(--s) * 1px); height: calc(var(--h, 0) * var(--s) * 1px); }
.v.ax-r { left: calc(100% - (1024 - var(--x)) * var(--s) * 1px); }
.v.ax-c { left: calc(50% + (var(--x) - 512) * var(--s) * 1px); }
.v.ay-b { top: calc(100% - (768 - var(--y)) * var(--s) * 1px); }
.v.ay-c { top: calc(50% + (var(--y) - 384) * var(--s) * 1px); }
.panel-v > .v { position: absolute; }
img.art { display: block; object-fit: fill; pointer-events: none; }
img.art:not(.has-art) { visibility: hidden; }
.hud { font-family: var(--gui-font); }
.lbl { font-size: calc(var(--fs, 14) * var(--s) * 1px); line-height: 1; white-space: nowrap; }
.slider { background: #000; overflow: hidden; }
.slider .fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0); background: #888 center / 100% 100%; transition: width 0.1s linear, height 0.1s linear; }
.slider.vertical .fill { top: auto; width: 100%; height: var(--p, 0); }
.slider.health .fill:not(.has-art) { background-color: #c41f1f; }
.slider.stamina .fill:not(.has-art) { background-color: #20c6d8; }
.slider.exp .fill:not(.has-art) { background-color: #e8c33a; }
.slider.mana .fill:not(.has-art) { background-color: #a55cf2; }
.slider.base .fill:not(.has-art) { background-color: #3bc23b; }
.slider.base { background: transparent; }
.inventory .slot { display: grid; place-items: center; min-height: 0; padding: 0; gap: 0; border: 0; border-radius: 0; background: none; }
.inventory .slot img { width: 92%; height: 92%; object-fit: contain; background: none; border-radius: 0; }
.inventory .selection img { width: 100%; height: 100%; }
.inventory .selection:not(:has(.has-art)) { outline: calc(2px * var(--s)) solid var(--gold); }
.inventory .back:not(.has-art) ~ .slot { background: rgba(0, 0, 0, 0.45); }
.ammo { text-align: left; }
.hp-digits, .stam-digits, .mana-digits { text-align: center; }
.gold-digits { text-align: center; }
.gold-gain { display: grid; align-content: start; font-size: calc(14px * var(--s)); }
.gold-gain .up { color: var(--ok); } .gold-gain .down { color: var(--danger); }
.coin-art img { width: 100%; height: 100%; }
.coin-art:not(:has(.has-art)) { border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2a8, #c99a22 60%, #7a5a10); }
.carry { display: flex; align-items: center; justify-content: flex-end; gap: calc(3px * var(--s)); font-size: calc(15px * var(--s)); line-height: 1.2; transform-origin: right center; }
.carry .res-icon { width: calc(16px * var(--s)); height: calc(16px * var(--s)); }
.carry .res-icon:not(.has-art) { display: none; }
.carry .carry-text { padding: 0 calc(4px * var(--s)); border-radius: 2px; background: rgba(0, 0, 0, 0.45); color: #fff; white-space: nowrap; }
.carry[data-res=stone] .carry-text { color: #ff6a5a; }
.carry[data-res=gold] .carry-text { color: #ffff33; }
.carry.full .carry-text { color: #fff; background: rgba(190, 20, 20, 0.8); }
.carry.pulse { animation: carry-pulse 0.5s ease-out 2; }
@keyframes carry-pulse { from { transform: scale(1.35); } to { transform: none; } }
.inventory .item-hint { display: grid; align-content: center; text-align: center; line-height: 1.15; background: rgba(0, 0, 0, 0.5); border-radius: 4px; }
.team .back:not(.has-art) { background: rgba(0, 0, 0, 0.45); border-radius: 4px; }
.workers { text-align: left; }
.chat-backdrop { background: rgba(0, 0, 0, 0.3); }
.chat-log { display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; font-size: calc(14px * var(--s)); line-height: 1; }
.chat-row { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.old { display: none; }
.hud.chatting .chat-row.old { display: block; opacity: 0.7; }
.chat-name { color: var(--gold); }
.chat-row[data-ch=team] .chat-name { color: var(--ok); }
.chat-entry { display: flex; gap: 4px; align-items: center; pointer-events: auto; font-size: calc(14px * var(--s)); }
.chat-input { flex: 1; padding: 2px 4px !important; font-size: calc(14px * var(--s)) !important; }
.chat .front { pointer-events: none; }
.feed { display: grid; align-content: start; gap: 1px; font-size: calc(14px * var(--s)); opacity: 0.85; }
.obit { display: flex; gap: 6px; padding: 0 4px; }
.obit .skull { color: #6f6; } .obit.friendly .skull { color: #f55; }
.notices { display: grid; align-content: start; justify-items: center; font-size: calc(13px * var(--s)); }
.server-status { text-align: center; background: rgba(51, 51, 51, 0.5); padding-top: calc(4px * var(--s)); }
.respawn { text-align: center; }
.task { text-align: center; }
.net { color: var(--muted); font-weight: normal; }
.damage-overlay { position: absolute; inset: 0; opacity: 0; }
.crosshair { --spread: 0; position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.crosshair .ring { position: absolute; width: calc((32 + var(--spread)) * var(--s) * 1px); height: calc((32 + var(--spread)) * var(--s) * 1px); left: 0; top: 0; transform: translate(-50%, -50%); border-radius: 50%; }
.crosshair .ring img { width: 100%; height: 100%; opacity: 0.85; }
.crosshair .ring:not(:has(.has-art)) { border: 1px solid rgba(255, 255, 255, 0.5); }
.crosshair .ticks i { position: absolute; background: rgba(255, 255, 255, 0.7); }
.crosshair .ticks .t { left: 0; top: calc((-10 - var(--spread) / 2) * var(--s) * 1px); width: 1px; height: calc(8px * var(--s)); }
.crosshair .ticks .b { left: 0; top: calc((2 + var(--spread) / 2) * var(--s) * 1px); width: 1px; height: calc(9px * var(--s)); }
.crosshair .ticks .l { top: 0; left: calc((-10 - var(--spread) / 2) * var(--s) * 1px); width: calc(9px * var(--s)); height: 1px; }
.crosshair .ticks .r { top: 0; left: calc((2 + var(--spread) / 2) * var(--s) * 1px); width: calc(9px * var(--s)); height: 1px; }
.crosshair.melee .ticks { display: none; }
.crosshair:has(.has-art) .ticks { display: none; }
.hud.no-unit .inventory, .hud.no-unit .health, .hud.no-unit .mana { display: none; }
.name-tag { position: absolute; left: 50%; top: calc(50% + (-40 - 2 * 18 - 4) * var(--s) * 1px); transform: translateX(-50%); display: grid; justify-items: center; gap: calc(2px * var(--s)); }
.tag-team { font-size: calc(14px * var(--s)); color: #fff; }
.tag-name { font-size: calc(18px * var(--s)); }
.tag-health { position: relative; width: calc(60px * var(--s)); height: calc(8px * var(--s)); background: #c00; }
.tag-health .fill { position: absolute; inset: 0 auto 0 0; width: var(--p, 0); background: #24f; }
.tag-hp { font-size: calc(12px * var(--s)); line-height: 1; color: #fff; }

/* scoreboard + banners */
.scoreboard { position: fixed; left: 50%; top: 10%; transform: translateX(-50%); z-index: 20; width: min(900px, 94vw); pointer-events: none; }
.score-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.score-team { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 6px; padding: 10px; }
.score-team[data-team="1"] h3 { color: var(--human); } .score-team[data-team="2"] h3 { color: var(--beast); }
.score-team h3 { margin: 0 0 6px; }
.score-team table { width: 100%; border-collapse: collapse; font-size: 13px; }
.score-team th { text-align: left; color: var(--muted); font-weight: normal; }
.score-team td, .score-team th { padding: 2px 4px; }
.score-team tr.me td { color: var(--gold); }
.banner { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; pointer-events: none; }
.end-banner { text-align: center; text-shadow: 0 2px 6px #000; }
.end-banner h1 { font-size: 64px; margin: 0; color: var(--gold); }
.end-banner.with-art h1 { display: none; }
.end-art { width: min(520px, 90vw); height: 180px; background: center / contain no-repeat; }

/* friends, parties and clans (client/ui/social.js) */
.side-pane { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.side-pane[hidden] { display: none; }
.side-tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(201, 164, 92, 0.35); }
button.side-tab { flex: 1 1 0; min-width: 0; padding: 6px 4px; font-size: 13px; background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); white-space: nowrap; }
button.side-tab:hover:not(:disabled) { background: rgba(201, 164, 92, 0.12); color: var(--text); }
button.side-tab.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }
.party-strip { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: rgba(12, 14, 16, 0.85); border: 1px solid var(--gold); border-radius: 3px; }
.party-strip[hidden] { display: none; }
.party-strip .panel-head { margin-top: 0; }
.party-strip .panel-head h2 { font-size: 16px; flex: 1; }
.party-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.party-invite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; }
.party-star { color: var(--gold); }
.friend-list { display: grid; gap: 4px; }
.friend-list:empty { display: none; }
.friend-row { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 13px; }
.friend-row.request { padding: 4px 6px; background: rgba(201, 164, 92, 0.12); border-radius: 3px; }
.friend-main { display: grid; flex: 1; min-width: 0; }
.friend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-status { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-actions { display: flex; flex: none; align-items: center; gap: 4px; }
.friend-actions button.small { padding: 2px 8px; font-size: 12px; }
.presence-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #5a5f66; }
.presence-dot[data-state=online] { background: var(--ok); }
.presence-dot[data-state=game] { background: var(--gold); box-shadow: 0 0 4px var(--gold); }
.presence-dot[data-state=invited] { background: none; border: 1px dashed var(--muted); }
.clan-tag { color: var(--gold); font-weight: 600; margin-right: 2px; }
button.player-link.clan-tag { text-decoration: none; }
.add-friend { display: flex; gap: 6px; }
.add-friend input { flex: 1; min-width: 0; }
button.my-clan { display: grid; width: 100%; gap: 2px; padding: 8px 10px; text-align: left; }
button.my-clan small { color: var(--muted); font-size: 12px; font-weight: 400; }
.clan-board button.player-link { text-align: left; overflow-wrap: anywhere; }
.clan-members { margin: 8px 0; }
.clan-members th:nth-child(2), .clan-members td:nth-child(2) { text-align: left; width: 100%; }
.clan-members td:first-child { color: var(--gold); }
.clan-members td { white-space: nowrap; }
.clan-invited { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 6px 0; font-size: 13px; }
.clan-rename { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; font-size: 13px; color: var(--muted); }
.clan-rename input:first-of-type { width: 80px; }
.clan-rename input:nth-of-type(2) { flex: 1; min-width: 140px; }
.profile-clan { margin: 4px 0; }
.side-pane > button[hidden] { display: none; }
.profile-actions { margin-bottom: 8px; }

@media (max-width: 1280px) {
  .screen.main { grid-template-columns: minmax(0, 320px) minmax(0, 680px); grid-template-areas: "menu games" "menu community"; }
  .games-panel { max-height: 62vh; }
  .community-panel { max-height: none; overflow: visible; }
}
@media (max-width: 860px) {
  .screen.main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "menu" "games" "community"; align-content: start; justify-content: stretch; }
  .main-left { max-width: none; }
  .games-panel { max-height: none; }
}
@media (max-width: 520px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-form .row { grid-template-columns: minmax(0, 1fr); }
  .game-card { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; }
  .game-thumb { width: 48px; height: 48px; }
  .game-name { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 720px) {
  .loadout-grid { grid-template-columns: 1fr; grid-template-rows: none; overflow: auto; }
  .loadout .loadout-grid > .col { overflow: visible; }
}

/* Tutorial (client/ui/tutorial.js): the step on top of the screen, also over the loadout; the frame over part of the HUD. */
.tutorial-panel { position: fixed; left: 50%; top: 7%; transform: translateX(-50%); z-index: 31; width: min(620px, 92vw); padding: 10px 16px; background: rgba(8, 10, 12, .82); border: 1px solid rgba(255, 255, 255, .22); border-radius: 4px; pointer-events: none; font-size: 15px; line-height: 1.4; text-shadow: 1px 1px 1px #000; }
.tutorial-panel[hidden] { display: none; }
.tutorial-line[data-act="1"] { font-weight: 700; }
.tutorial-frame { border: 3px solid #e8d36a; box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .55); box-sizing: border-box; animation: tutorial-pulse 1.2s ease-in-out infinite alternate; }
.tutorial-frame[hidden] { display: none; }
@keyframes tutorial-pulse { from { border-color: #e8d36a; } to { border-color: #fff6c0; } }
