/* HUD extensions (client/ui/hud-plugin.js, hud-extras.js, killfeed.js, ...): minimap, state icons, meters, kill feed,
   vote panel, markers, spectator card and the mouse-free dialogs. Virtual-unit panels use the .v classes of style.css. */

/* ---------- player minimap, map name ---------- */
.minimap { pointer-events: none; }
.minimap .map-widget { overflow: hidden; background: rgba(0, 0, 0, 0.35); }
.minimap .map-canvas { width: 100%; height: 100%; display: block; }
.minimap > img.front { z-index: 2; }
.minimap .map-widget { z-index: 1; }
.map-title { text-align: center; font-size: calc(13px * var(--s)); line-height: 1.2; color: var(--gold); text-shadow: 1px 1px 1px #000, 0 0 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- state icons (named while new or while Tab is held), meters, slot badges ---------- */
.states { display: flex; justify-content: flex-end; align-items: flex-start; gap: calc(5px * var(--s)); }
.state-icon { position: relative; flex: none; display: flex; align-items: center; }
.state-icon .state-box { position: relative; flex: none; width: calc(26px * var(--s)); height: calc(26px * var(--s)); border: 1px solid rgba(232, 199, 106, 0.8); background: rgba(0, 0, 0, 0.55); border-radius: 3px; }
.state-icon .state-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.state-icon .drain { position: absolute; left: 0; right: 0; top: 0; height: calc((1 - var(--f, 1)) * 100%); background: rgba(0, 0, 0, 0.6); pointer-events: none; }
.state-icon:not(.timed) .drain { display: none; }
.state-icon .state-timer { position: absolute; left: 0; right: 0; top: 100%; text-align: center; font-size: calc(11px * var(--s)); line-height: 1.1; color: #fff; text-shadow: 1px 1px 1px #000; }
.state-icon .state-name { display: none; margin-left: calc(3px * var(--s)); padding: 0 calc(5px * var(--s)); font-size: calc(12px * var(--s)); line-height: calc(20px * var(--s)); white-space: nowrap; color: #fff; background: rgba(0, 0, 0, 0.6); border-radius: 3px; text-shadow: 1px 1px 1px #000; }
.state-icon.named .state-name { display: block; }
.state-icon.ending { animation: state-blink 0.6s steps(2, jump-none) infinite; }
@keyframes state-blink { 0% { opacity: 1; } 100% { opacity: 0.45; } }
.slider.heat, .slider.charge { background: rgba(0, 0, 0, 0.55); border-radius: 2px; }
.slider.heat .fill { background: linear-gradient(90deg, #ffb300, #ff3b1d); }
.slider.heat.hot .fill { animation: state-blink 0.3s steps(2, jump-none) infinite; }
.slider.charge .fill { background: linear-gradient(90deg, #fff3b0, #ffe27a); }
.inventory .slot .badge { position: absolute; right: calc(2px * var(--s)); bottom: calc(1px * var(--s)); font-size: calc(12px * var(--s)); font-weight: 700; color: #fff; text-shadow: 1px 1px 1px #000, 0 0 3px #000; line-height: 1; pointer-events: none; }
.inventory .slot .badge.low { color: #ff6a5a; }
.inventory .slot .sweep { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--cd, 0) * 100%); background: rgba(0, 0, 0, 0.6); pointer-events: none; }

/* ---------- team notes ---------- */
.no-commander { display: grid; align-content: center; text-align: center; font-size: calc(13px * var(--s)); line-height: 1.1; color: #ff4040; background: rgba(0, 0, 0, 0.6); border: 1px solid #a01818; border-radius: 3px; }
.team-note { display: flex; justify-content: flex-end; text-shadow: 1px 1px 1px #000; overflow: hidden; }
.team-note .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; }   /* the name shrinks, the tithe stays whole */
.team-note .tithe { flex: none; }
.team .full { color: #fff !important; background: rgba(190, 20, 20, 0.7); border-radius: 2px; padding: 0 calc(2px * var(--s)); }

/* ---------- task bar: one line at the fitted size (--fs), or two lines (.wrap) ---------- */
.task-panel { text-shadow: 1px 1px 1px #000; }
.task-panel .back:not(.has-art) { background: rgba(0, 0, 0, 0.55); border: 1px solid var(--panel-edge); border-radius: 4px; }
.task-panel .task { display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; }
.task-panel .task-text { display: block; max-width: 100%; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-panel .task.wrap .task-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; }
.task-panel.slide { animation: task-slide 0.5s ease-out; }
@keyframes task-slide { from { transform: translateY(calc(-100px * var(--s))); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- kill feed + streak banner ---------- */
.feed { opacity: 1; justify-items: start; }
.obit { display: flex; align-items: center; gap: calc(6px * var(--s)); padding: 0 calc(5px * var(--s)); background: rgba(0, 0, 0, 0.35); border-radius: 2px; white-space: nowrap; line-height: 1.25; }
.obit .skull { display: inline-flex; align-items: center; }
.obit .skull-art { height: calc(18px * var(--s)); width: auto; }
.obit .weapon { display: inline-flex; align-items: center; gap: calc(4px * var(--s)); color: #ddd; font-size: 0.9em; }
.obit .weapon-icon { height: calc(20px * var(--s)); width: auto; }
.obit .killer.team-1, .obit .victim.team-1 { color: #8fc1ee; }
.obit .killer.team-2, .obit .victim.team-2 { color: #f09468; }
.obit.mine { background: rgba(120, 90, 10, 0.55); box-shadow: 0 0 0 1px var(--gold) inset; }
.obit.died { background: rgba(120, 0, 0, 0.5); }
.obit.suicide .victim { text-decoration: line-through; opacity: 0.8; }
.streaks { display: grid; justify-items: center; align-content: start; gap: calc(4px * var(--s)); pointer-events: none; }
.streak { font-size: calc(18px * var(--s)); color: #ffe27a; text-shadow: 2px 2px 3px #000; animation: streak-pop 0.4s ease-out; }
.streak.self { font-size: calc(32px * var(--s)); letter-spacing: 0.04em; }
.streak.hero, .streak.legend { color: #ff9a2a; }
.streak.skillful { color: #7fe0ff; }
@keyframes streak-pop { from { transform: scale(1.7); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- vote panel ---------- */
.vote-panel { font-size: calc(12px * var(--s)); padding: calc(8px * var(--s)) calc(10px * var(--s)); background: rgba(0, 0, 0, 0.72); border: calc(2px * var(--s)) solid var(--panel-edge); border-radius: 4px; text-shadow: 1px 1px 1px #000; }
.vote-panel .vote-head { text-align: right; color: #ddd; }
.vote-panel .vote-topic { font-size: calc(16px * var(--s)); color: #ffff33; margin-top: calc(2px * var(--s)); }
.vote-panel .vote-caller { color: #aaa; font-size: calc(11px * var(--s)); }
.vote-panel .vote-bar { position: relative; height: calc(8px * var(--s)); margin: calc(6px * var(--s)) 0; background: #222; border-radius: 2px; }
.vote-panel .vote-red, .vote-panel .vote-green { position: absolute; left: 0; top: 0; bottom: 0; transition: width 0.15s linear; border-radius: 2px; }
.vote-panel .vote-red { background: #c43030; }
.vote-panel .vote-green { background: #3ec23e; }
.vote-panel .vote-need { position: absolute; top: calc(-3px * var(--s)); bottom: calc(-3px * var(--s)); width: 2px; background: #fff; }
.vote-panel .vote-keys { display: flex; align-items: baseline; }
.vote-panel .vote-spacer { flex: 1; }
.vote-panel .vote-yes-label, .vote-panel .vote-yes { color: #4cff4c; }
.vote-panel .vote-no-label, .vote-panel .vote-no { color: #ff5050; }
.vote-panel .vote-keys.foreign { display: none; }
.vote-panel .vote-notice { color: #ffd24a; margin-top: calc(3px * var(--s)); }
.vote-panel .vote-mine { color: #cfe8ff; }
.vote-panel .vote-result { font-size: calc(15px * var(--s)); margin-top: calc(4px * var(--s)); }
.vote-panel .vote-result.passed { color: #4cff4c; }
.vote-panel .vote-result.failed, .vote-panel .vote-result.cancelled { color: #ff6a5a; }
.vote-panel.ended .vote-head, .vote-panel.ended .vote-keys { opacity: 0.6; }

/* ---------- projected markers ---------- */
.markers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.wp-beam { position: absolute; }
.wp-icon, .wp-arrow { position: absolute; }
.wp-dist, .wp-arrow-dist { position: absolute; transform: translateX(-50%); font-weight: 700; text-shadow: 2px 2px 0 #000; }
.wp-dist.attack, .wp-arrow-dist.attack { color: #ff4a3a; }
.wp-dist.move, .wp-arrow-dist.move { color: #4cff6a; }
.wp-arrow-dist { transform: none; }
.friendly-marker { position: absolute; }
.friendly-marker .friendly-icon { width: 100%; height: 100%; }
.friendly-marker.officer .friendly-icon { filter: hue-rotate(200deg) brightness(1.3); }
.friendly-marker .voice-icon { position: absolute; left: 25%; bottom: 105%; width: 70%; height: 70%; }

/* ---------- spectator card ---------- */
.spectator-card { text-align: center; background: rgba(0, 0, 0, 0.55); border: 1px solid var(--panel-edge); border-radius: 4px; padding: calc(4px * var(--s)); text-shadow: 1px 1px 1px #000; }
.spectator-card .sp-title { font-size: calc(12px * var(--s)); color: var(--muted); }
.spectator-card .sp-name { font-size: calc(20px * var(--s)); color: #fff; }
.spectator-card .sp-name[data-team="1"] { color: var(--human); }
.spectator-card .sp-name[data-team="2"] { color: var(--beast); }
.spectator-card .sp-sub { font-size: calc(12px * var(--s)); color: #ccc; }
.spectator-card .sp-hp { height: calc(6px * var(--s)); margin: calc(3px * var(--s)) calc(20px * var(--s)); background: #600; border-radius: 2px; overflow: hidden; }
.spectator-card .sp-fill { height: 100%; background: #3ec23e; }
.spectator-card .sp-hint { font-size: calc(11px * var(--s)); color: var(--muted); }

/* ---------- mouse-free dialogs (request / voice / call vote / end statistics) ---------- */
.hud.hud-votes { z-index: 35; }
.hud-dialogs { position: fixed; inset: 0; z-index: 26; pointer-events: none; font-family: var(--gui-font); }
.hud-dialogs > * { pointer-events: auto; }
.request-menu, .callvote, .voice-menu { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); width: min(440px, 94vw); max-height: 76vh; overflow: auto; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 6px; padding: 14px 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
.request-menu h3, .callvote h3, .voice-menu h3 { margin: 0 0 8px; color: var(--gold); }
.req-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.req-tab { padding: 4px 10px; font-size: 13px; }
.req-tab.selected { border-color: var(--gold); background: linear-gradient(#6e5320, #3a2b0e); }
.req-list, .cv-list { display: grid; gap: 4px; max-height: 40vh; overflow: auto; }
.req-item, .cv-item { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; text-align: left; padding: 4px 8px; }
.cv-item { grid-template-columns: 1fr; }
.cv-item.selected { border-color: var(--gold); }
.req-item .icon { width: 28px; height: 28px; }
.req-pending, .req-note, .cv-status { margin-top: 8px; color: var(--muted); min-height: 1.3em; }
.req-pending { color: #ffe27a; }
.req-buttons { display: flex; gap: 8px; margin-top: 10px; }
.cv-arg { display: grid; gap: 6px; margin-top: 8px; }
.cv-arg input, .cv-arg select { font: inherit; color: var(--text); background: rgba(0, 0, 0, 0.55); border: 1px solid var(--panel-edge); border-radius: 3px; padding: 5px 8px; }
.cv-selected { color: var(--gold); }
.voice-menu { left: 3%; top: 22%; transform: none; width: min(300px, 80vw); }
.voice-entry { display: flex; gap: 8px; padding: 3px 4px; cursor: pointer; }
.voice-entry:hover { background: rgba(255, 255, 255, 0.08); }
.voice-key { color: var(--gold); width: 1.2em; text-align: right; }
.voice-more { margin-left: auto; color: var(--muted); }
.voice-hint { color: var(--muted); font-size: 12px; margin-top: 8px; }
.voice-empty { color: var(--muted); }

.endstats { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.6); padding: 12px; }
.es-panel { width: min(1180px, 100%); max-height: 100%; display: grid; grid-template-rows: auto 1fr auto; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 6px; padding: 12px 16px; overflow: hidden; }
.es-head { text-align: center; }
.es-banner { height: 70px; background: center / contain no-repeat; }
.es-banner.has-art ~ .es-title { display: none; }
.es-title { margin: 0; font-size: 40px; color: var(--gold); }
.es-title.victory { color: #6ee26e; } .es-title.defeat { color: #ff6a5a; }
.es-sub { margin: 2px 0 8px; color: var(--muted); }
.es-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; overflow: auto; min-height: 0; }
.es-body h2 { margin: 0 0 6px; font-size: 18px; color: var(--gold); }
.es-team { margin-bottom: 10px; }
.es-team h3 { margin: 0 0 4px; }
.es-team[data-team="1"] h3 { color: var(--human); } .es-team[data-team="2"] h3 { color: var(--beast); }
.es-scroll { overflow-x: auto; }
.es-team table { border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.es-team th { color: var(--muted); font-weight: normal; text-align: right; padding: 2px 6px; }
.es-team td { padding: 2px 6px; text-align: right; font-variant-numeric: tabular-nums; }
.es-team th:first-child, .es-team td.es-name { text-align: left; }
.es-team tr.me td { color: var(--gold); }
.es-awards { display: grid; gap: 6px; align-content: start; }
.es-award { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: center; padding: 4px 6px; background: rgba(0, 40, 0, 0.45); border-radius: 4px; }
.es-award.me { box-shadow: 0 0 0 1px var(--gold) inset; }
.es-award-icon { width: 44px; height: 44px; background: center / contain no-repeat; }
.es-award-icon:not(.has-art) { background: radial-gradient(circle, rgba(255, 215, 90, 0.25), transparent 70%); }
.es-award-title { color: #4cff4c; font-size: 13px; }
.es-award-name { color: #fff; }
.es-award-info { color: #9a9a9a; font-size: 11px; }
.es-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.es-next { margin: 0; color: var(--muted); }
@media (max-width: 760px) { .es-body { grid-template-columns: 1fr; } }

/* ---------- scoreboard additions ---------- */
.score-head { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--muted); text-shadow: 1px 1px 1px #000; }
.score-team h3 { display: flex; justify-content: space-between; align-items: baseline; }
.score-team h3 small { font-weight: normal; color: var(--muted); font-size: 12px; }
.score-team td.gold { color: #ffe27a; }
.score-team tr.cmdr td.name { color: #ffd24a; }
.score-team .ready { color: #6ee26e; }
.score-resources { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 6px; padding: 10px; }
.score-resources h3 { margin: 0 0 6px; color: #1affa0; }
.score-resources ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.score-resources li { display: flex; justify-content: space-between; gap: 12px; }
.score-resources .res-gold b { color: #ff0; } .score-resources .res-stone b { color: #f66; }

/* ---------- loadout request ---------- */
.item-wrap { display: grid; grid-template-columns: 1fr auto; gap: 4px; }
.item-wrap .request { padding: 2px 8px; font-size: 12px; }
.pending-request { display: flex; gap: 8px; align-items: center; color: #ffe27a; }
.pending-request .cancel-request { padding: 2px 8px; font-size: 12px; }

/* ---------- level-up banner (level-banner.js): top centre, below the notices, kill streaks and server status ---------- */
.level-banner { display: grid; align-content: center; justify-items: center; gap: calc(2px * var(--s)); text-align: center; pointer-events: none;
  background: linear-gradient(rgba(40, 30, 8, 0.85), rgba(10, 8, 2, 0.75)); border: 1px solid rgba(232, 199, 106, 0.8); border-radius: 4px; }
.level-banner .level-title { color: #ffe27a; font-size: calc(19px * var(--s)); font-weight: 700; letter-spacing: 0.04em; line-height: 1.1; }
.level-banner .level-text { color: #fff; font-size: calc(13px * var(--s)); line-height: 1.15; }
.level-banner .level-stats { color: #7ed37a; font-size: calc(12px * var(--s)); line-height: 1.15; }
.level-banner.show { animation: level-banner 4.5s ease-out forwards; }
@keyframes level-banner { 0% { opacity: 0; transform: translateY(calc(-12px * var(--s))); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
