:root {
    color-scheme: dark;
    --bg: #070b10;
    --panel: rgba(9, 14, 21, 0.82);
    --panel-solid: rgba(11, 17, 25, 0.96);
    --border: rgba(148, 163, 184, 0.22);
    --text: #eef4fb;
    --muted: #91a0b4;
    --accent: #5ea4ff;
    --accent-soft: rgba(94, 164, 255, 0.18);
    --ct: #89d0ff;
    --t: #ffcf72;
    --danger: #ff7777;
    --success: #7ce4a1;
    --shadow: 0 18px 56px rgba(0, 0, 0, 0.38);
    --dot-size: 15px;
    --text-size: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: "Segoe UI", "Nunito", sans-serif;
    background: var(--bg);
    color: var(--text);
}

button,
input,
select {
    font: inherit;
}

.shell,
.workspace {
    width: 100vw;
    height: 100vh;
    min-width: 0;
}

.workspace {
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    background:
        radial-gradient(circle at 12% 8%, rgba(94, 164, 255, 0.16), transparent 28%),
        linear-gradient(180deg, #0b1119 0%, #05080d 100%);
}

.topbar {
    position: fixed;
    z-index: 20;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    pointer-events: none;
}

.topbar h2 {
    margin: 0;
    font-size: clamp(20px, 2vw, 34px);
    letter-spacing: 0;
    line-height: 1;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8);
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
}

.topbar-actions {
    pointer-events: auto;
}

.settings-panel {
    position: fixed;
    z-index: 30;
    right: 16px;
    top: 68px;
    width: min(320px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.settings-header h1 {
    margin: 0;
    font-size: 15px;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 28px;
    color: var(--text);
    cursor: pointer;
}

.toggle-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.range-row {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 8px;
}

.range-row span {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.range-row input {
    width: 100%;
    accent-color: var(--accent);
}

.range-row output {
    color: var(--text);
    font-size: 12px;
    text-align: right;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field span {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.field select {
    width: 100%;
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgba(4, 8, 13, 0.82);
    color: var(--text);
    padding: 6px 8px;
    outline: none;
}

.field select:focus {
    border-color: rgba(94, 164, 255, 0.65);
}

.badge,
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 7px 10px;
    border: 1px solid rgba(94, 164, 255, 0.26);
    background: var(--accent-soft);
    color: var(--text);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.badge-live::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 14px rgba(124, 228, 161, 0.55);
}

.radar-frame {
    position: fixed;
    inset: 0;
    min-width: 0;
    min-height: 0;
}

.radar-stage {
    position: absolute;
    inset: 0;
    background: #05080d;
    overflow: hidden;
    cursor: grab;
}

.radar-stage.dragging {
    cursor: grabbing;
}

.radar-content {
    position: absolute;
    left: 0;
    top: 0;
    width: min(100vw, 100vh);
    height: min(100vw, 100vh);
    transform-origin: 0 0;
    will-change: transform;
}

#radar-image,
.marker-layer,
.empty-state {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#radar-image {
    display: block;
    object-fit: fill;
    user-select: none;
    -webkit-user-drag: none;
}

.marker-layer {
    pointer-events: none;
}

.empty-state {
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    background: rgba(5, 8, 13, 0.78);
    transition: opacity 160ms ease;
}

.empty-state.hidden {
    opacity: 0;
    pointer-events: none;
}

.empty-state h3 {
    margin: 0;
    font-size: 26px;
}

.empty-state p {
    margin: 0;
    max-width: 420px;
    color: var(--muted);
    line-height: 1.5;
}

.empty-eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.marker {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    will-change: transform;
}

.marker-dot {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--dot-size);
    height: var(--dot-size);
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(5, 9, 14, 0.32);
    transform: translate(-50%, -50%);
}

.marker.local .marker-dot {
    width: calc(var(--dot-size) + 4px);
    height: calc(var(--dot-size) + 4px);
    box-shadow: 0 0 0 6px rgba(94, 164, 255, 0.18);
}

.marker-label {
    position: absolute;
    left: 0;
    top: calc(var(--dot-size) * 0.5 + 6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    background: rgba(5, 9, 14, 0.88);
    color: var(--text);
    font-size: var(--text-size);
    line-height: 1.1;
    white-space: nowrap;
    transform: translateX(-50%);
}

.marker-health {
    color: var(--success);
    font-size: calc(var(--text-size) - 1px);
}

.hide-names .marker-name,
.hide-health .marker-health {
    display: none;
}

.hide-names.hide-health .marker-label {
    display: none;
}

.marker.ct .marker-dot {
    background: var(--ct);
}

.marker.t .marker-dot {
    background: var(--t);
}

.marker.dead .marker-dot {
    background: var(--danger);
    opacity: 0.6;
}

.marker.bomb .marker-dot {
    width: calc(var(--dot-size) + 2px);
    height: calc(var(--dot-size) + 2px);
    border-radius: 4px;
    background: #ff7f50;
}

.marker.concealed {
    opacity: 0.58;
}

.player-list,
.player-item,
.player-topline,
.player-meta {
    display: none;
}

code {
    font-family: "Cascadia Code", "Consolas", monospace;
}

@media (max-width: 720px) {
    .topbar {
        top: 10px;
        left: 10px;
        right: 10px;
    }

    .settings-panel {
        top: auto;
        right: 10px;
        bottom: 10px;
        left: 10px;
        width: auto;
    }
}
