:root {
    --bg: #000;
    --fg: #fff;
    --fg-dim: rgba(255,255,255,0.55);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg);
    color: var(--fg);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow: hidden;
}

#blazor-error-ui {
    background: #ff3366;
    color: white;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.stage {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

#cosmos {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: block;
}

.content {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.orb-area {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    pointer-events: none;   /* canvas underneath catches mouse here */
}

.orb {
    --glow-intensity: 0;  /* 0..1, driven by JS based on perf headroom */
    width: min(60vh, 70vw);
    aspect-ratio: 1;
    border-radius: 50%;
    box-shadow: 0 0 calc(60px * var(--glow-intensity)) rgba(255, 80, 255, calc(0.35 * var(--glow-intensity)));
    cursor: pointer;
    user-select: none;
    transition: transform .25s ease-out, box-shadow 1.2s ease-out, filter 1.2s ease-out;
    pointer-events: auto;
    object-fit: cover;
}
.orb.glow {
    box-shadow:
        0 0 calc(140px * var(--glow-intensity)) rgba(255, 80, 255, calc(0.8 * var(--glow-intensity))),
        0 0 calc(40px * var(--glow-intensity)) rgba(255, 255, 255, calc(0.6 * var(--glow-intensity)));
    filter: brightness(calc(1 + 0.18 * var(--glow-intensity))) saturate(calc(1 + 0.35 * var(--glow-intensity)));
    transform: scale(1.04);
}

.identity {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 0 4vw 4vh;
    pointer-events: auto;   /* propagates `auto` to descendants via inherit */
}
.identity-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin: 0;
    color: var(--fg);
}

.links {
    display: flex;
    gap: 14px;
}
.links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition:
        transform .18s cubic-bezier(.2, .9, .3, 1.4),
        background .15s ease-out,
        border-color .15s ease-out,
        box-shadow .15s ease-out;
}
.links a:hover,
.links a:focus-visible {
    background: rgba(0, 0, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.95);
    transform: scale(1.18) translateY(-3px);
    box-shadow:
        0 0 28px rgba(255, 100, 255, 0.55),
        0 0 14px rgba(255, 255, 255, 0.55),
        0 6px 18px rgba(0, 0, 0, 0.7);
    outline: none;
}
.links a::after {
    content: attr(aria-label);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(20, 20, 30, 0.95);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 10px;
    letter-spacing: 0.05em;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease-out, transform .15s ease-out;
}
.links a:hover::after,
.links a:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.links a {
    position: relative; /* for ::after tooltip anchoring */
}
.links img {
    width: 18px;
    height: 18px;
    filter: invert(1);
    opacity: 0.88;
    transition: opacity .15s ease-out;
}
.links a:hover img,
.links a:focus-visible img {
    opacity: 1;
}

.heatmap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--fg-dim);
}
.heatmap-toggles {
    display: flex;
    gap: 12px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--fg-dim);
}
.heatmap-toggles label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}
.heatmap-toggles input[type=checkbox] {
    accent-color: #9af;
    width: 11px;
    height: 11px;
}
.heatmap-grid {
    max-width: 100%;
}
.heatmap-state {
    font-family: ui-monospace, monospace;
    font-size: 10px;
    color: var(--fg-dim);
    height: 42px;
    display: flex;
    align-items: center;
}
.heatmap-grid rect {
    transition: opacity .12s ease-out;
}
.heatmap-grid rect:hover {
    opacity: 0.75;
}
.heatmap-tooltip {
    position: fixed;
    z-index: 100;
    pointer-events: none;
    background: rgba(20, 20, 30, 0.95);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 6px 10px;
    border-radius: 4px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 11px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#cosmos-hud {
    position: fixed;
    top: 10px;
    right: 14px;
    z-index: 50;
    color: rgba(255, 255, 255, 0.55);
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 10px;
    letter-spacing: 0.04em;
    line-height: 1.55;
    text-align: right;
    pointer-events: none;
    user-select: none;
}
#cosmos-hud .hud-big {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}
#cosmos-hud .hud-dim {
    color: rgba(255, 255, 255, 0.35);
}
