/* Command Deck theme — shared with the module overlay. Inks from the design handoff. */
:root {
    --bg: #080506;
    --panel: #0d0809;
    --panel-border: rgba(196, 168, 98, 0.18);
    --gold: #c4a862;
    --cream: #ece6da;
    --cream-dim: rgba(236, 230, 218, 0.55);
    --scarlet: #e0322f;
    --blurple: #5865F2;
    --mono: ui-monospace, Menlo, Consolas, monospace;
    --grotesk: -apple-system, "Segoe UI", system-ui, sans-serif;
    --cinzel: "Cinzel", serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--cream);
    font-family: var(--grotesk);
    -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--mono); }

/* --- Flash banner --- */
.flash-banner {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 10px 16px; font-size: 13px;
}
.flash-success { background: #163d29; color: #b7f0cf; }
.flash-error { background: #45161a; color: #f3b9be; }
.flash-close { background: none; border: none; color: inherit; font-size: 18px; cursor: pointer; line-height: 1; }

/* --- Auth --- */
.auth-body { display: flex; }
.auth-shell { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; min-height: 100vh; }
.auth-card {
    width: min(400px, 100%); background: var(--panel); border: 1px solid var(--panel-border);
    border-radius: 12px; padding: 40px 36px 32px; display: flex; flex-direction: column; align-items: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.auth-logo { object-fit: contain; margin-bottom: 18px; opacity: 0.92; }
.auth-title { font-family: var(--cinzel); font-weight: 600; font-size: 26px; letter-spacing: 0.14em; margin: 0; }
.auth-divider { width: 54px; height: 2px; background: var(--gold); opacity: 0.6; margin: 18px 0 22px; }
.btn-discord {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    background: var(--blurple); color: #fff; border: none; border-radius: 8px; padding: 13px 0;
    font: 600 13.5px var(--grotesk); text-decoration: none; cursor: pointer; transition: background 0.15s;
}
.btn-discord:hover { background: #6a76f4; }
.auth-note { margin: 20px 0 0; font-size: 11.5px; color: var(--cream-dim); text-align: center; line-height: 1.5; }
.auth-demo { margin-top: 16px; font-size: 11.5px; color: var(--gold); text-decoration: none; letter-spacing: 0.04em; }
.auth-demo:hover { text-decoration: underline; }

/* --- Top bar --- */
.topbar {
    display: flex; align-items: center; height: 54px; padding: 0 20px; gap: 22px;
    background: var(--panel); border-bottom: 1px solid var(--panel-border);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-logo { object-fit: contain; }
.wordmark { font-family: var(--cinzel); font-weight: 600; letter-spacing: 0.22em; font-size: 15px; }
.topbar-tab {
    font: 600 10px var(--grotesk); letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--cream-dim); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent;
}
.topbar-tab.active { color: var(--cream); border-bottom-color: var(--gold); }
.topbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.topbar-user { font-size: 12.5px; }
.role-label {
    font: 600 9px var(--grotesk); letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--gold); margin-left: 4px;
}
.topbar-logout { font-size: 11px; color: var(--cream-dim); text-decoration: none; }
.topbar-logout:hover { color: var(--cream); }

/* --- Home --- */
.home-shell { display: flex; align-items: center; justify-content: center; padding: 60px 24px; }
.home-card {
    max-width: 460px; background: var(--panel); border: 1px solid var(--panel-border);
    border-radius: 12px; padding: 34px; text-align: center;
}
.home-title { font-family: var(--cinzel); font-weight: 600; font-size: 20px; margin: 0 0 14px; }
.home-body { font-size: 13.5px; color: var(--cream-dim); line-height: 1.6; margin: 0 0 22px; }
.btn-ghost {
    display: inline-block; border: 1px solid var(--gold); color: var(--gold); border-radius: 8px;
    padding: 9px 18px; font: 600 11px var(--grotesk); letter-spacing: 0.08em; text-transform: uppercase;
    text-decoration: none;
}
.btn-ghost:hover { background: rgba(196, 168, 98, 0.08); }
.home-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* --- Radar --- */
.radar-body { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.radar-main { flex: 1; min-height: 0; padding: 14px 16px 16px; }
.radar-card {
    position: relative; height: 100%; border: 1px solid rgba(196, 168, 98, 0.14); border-radius: 12px;
    overflow: hidden; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(70% 60% at 45% 40%, #14100f 0%, #0a0708 70%), #0a0708;
}
.radar-world { position: relative; }
.radar-svg { display: block; overflow: visible; }

/* Overlays */
.ov { position: absolute; z-index: 5; }
.ov-objects { top: 12px; left: 12px; }
.ov-topright { top: 12px; right: 14px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.ov-legend { bottom: 12px; left: 14px; display: flex; flex-wrap: wrap; gap: 6px 12px; max-width: 40%; }
.ov-zoom {
    bottom: 12px; right: 14px; display: flex; align-items: center; gap: 8px;
    background: rgba(13, 8, 9, 0.85); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 8px; padding: 5px 9px;
}
.ov-btn {
    background: rgba(13, 8, 9, 0.85); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 8px;
    padding: 8px 13px; cursor: pointer; color: var(--cream);
    font: 600 10px var(--grotesk); letter-spacing: 0.1em; text-transform: uppercase;
}
.ov-btn:hover { border-color: rgba(196, 168, 98, 0.5); }
.ov-stat {
    display: flex; align-items: center; gap: 6px; background: rgba(13, 8, 9, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 8px; padding: 7px 12px; font-size: 12px;
}
.ov-menu {
    position: absolute; margin-top: 6px; background: var(--panel); border: 1px solid var(--panel-border);
    border-radius: 8px; padding: 6px; min-width: 190px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.ov-objects .ov-menu { left: 0; top: 100%; }
.ov-you-menu { right: 0; top: 100%; }
.ov-menu-item {
    display: flex; align-items: center; gap: 9px; width: 100%; background: none; border: none;
    border-radius: 6px; padding: 7px 9px; cursor: pointer; text-align: left; color: var(--cream); font-size: 11.5px;
}
.ov-menu-item:hover { background: rgba(196, 168, 98, 0.08); }
.ov-menu-item .sw { margin-left: auto; width: 26px; height: 15px; border-radius: 9px; position: relative; transition: background 0.15s; }
.ov-menu-item .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #0d0809; transition: left 0.15s; }
.ov-menu-item .sw.on { background: rgba(196, 168, 98, 0.7); }
.ov-menu-item .sw.on::after { left: 13px; }
.ov-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--cream-dim); }

.zoom-btn { background: none; border: none; color: var(--cream); font-size: 16px; cursor: pointer; width: 18px; line-height: 1; }
.zoom-pct { font-size: 11px; min-width: 38px; text-align: center; }

/* Waiting interlude */
.waiting {
    position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 16px; background: rgba(8, 5, 6, 0.55);
}
/* A class-level display:flex would otherwise beat the [hidden] UA rule, so pin it. */
.waiting[hidden] { display: none; }
.waiting-sigil {
    width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--gold);
    animation: breathe 2.6s ease-in-out infinite;
}
.waiting-title { font-family: var(--cinzel); font-weight: 600; font-size: 22px; letter-spacing: 0.2em; }
.waiting-sub { font-size: 11px; color: var(--cream-dim); letter-spacing: 0.04em; }
.waiting-dots { display: flex; gap: 8px; }
.waiting-dots span {
    width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg);
    animation: pulse 1.4s ease-in-out infinite;
}
.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes breathe { 0%, 100% { opacity: 0.4; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* Entity animations, driven by the SVG renderer */
.rd-breathe { animation: rd-breathe 2.6s ease-in-out infinite; }
@keyframes rd-breathe { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.rd-pulse { transform-box: fill-box; transform-origin: center; animation: rd-pulse 2.2s ease-out infinite; }
@keyframes rd-pulse { 0% { opacity: 0.9; transform: scale(0.85); } 100% { opacity: 0; transform: scale(1.7); } }

@media (max-width: 640px) {
    .ov-legend { display: none; }
    .radar-main { padding: 0; }
    .radar-card { border: none; border-radius: 0; }
}
