
:root,
[data-bs-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #f3f0f8;
    --text-primary: #1a1a2e;
    --text-secondary: #555570;
    --text-muted: #8e8ea0;
    --text-link: #6c5ce7;
    --border-color: rgba(0, 0, 0, 0.08);
    --badge-bg: rgba(0, 0, 0, 0.06);
    --theme-toggle-bg: rgba(0, 0, 0, 0.05);
    --theme-toggle-hover: rgba(0, 0, 0, 0.1);
    --selection-bg: #6c5ce7;
    --selection-text: #ffffff;
}

[data-bs-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #000000;
    --bg-card: #000000;
    --text-primary: #e8e8f0;
    --text-secondary: #a0a0b8;
    --text-muted: #6a6a80;
    --text-link: #a78bfa;
    --border-color: rgba(255, 255, 255, 0.06);
    --badge-bg: rgba(255, 255, 255, 0.08);
    --theme-toggle-bg: rgba(255, 255, 255, 0.08);
    --theme-toggle-hover: rgba(255, 255, 255, 0.12);
    --selection-bg: #a78bfa;
    --selection-text: #0a0a0f;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: var(--selection-bg);
    color: var(--selection-text);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: var(--theme-toggle-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.theme-toggle:hover {
    background: var(--theme-toggle-hover);
    color: var(--text-primary);
}

.theme-invert-light {
    transition: filter 0.3s ease;
}

[data-bs-theme="light"] .theme-invert-light {
    filter: invert(1);
}

/* ===========================
   NODE SERVER — layout spool
   =========================== */

html {
    height: 100%;
}

body.node-page {
    min-height: 100%;
    min-height: 100dvh;
    margin: 0;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
}

.node-theme-wrap {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 20;
}

#block {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: min(92vw, 36rem);
    padding: 0 0.5rem;
    z-index: 1;
}

.pool-logo {
    height: 11em;
    width: auto;
    max-width: min(92vw, 22rem);
    margin: 0 auto 1rem;
    display: block;
}

.node-logo {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%);
    height: 2rem;
    width: auto;
    max-width: 140px;
    z-index: 2;
    opacity: 0.9;
}

[data-bs-theme="light"] .node-logo {
    filter: invert(1);
}

#block h1 {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.2;
}

#block h2 {
    margin: 0.35rem 0 0.85rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-muted);
}

#info {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

#info2 {
    margin-top: 1em;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

#info .spinner-border {
    width: 1.05rem;
    height: 1.05rem;
    border-width: 0.15em;
    vertical-align: -12%;
}

.status-dot {
    position: relative;
    display: inline-block;
    width: 0.7em;
    height: 0.7em;
    margin-right: 0.15em;
    vertical-align: 0;
    border-radius: 50%;
    background: #56d364;
    box-shadow: 0 0 0 0 rgba(86, 211, 100, 0.55);
    animation: statusPulse 1.7s ease-out infinite;
}

.status-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: statusRing 1.7s ease-out infinite;
}

.status-dot.online {
    background: #56d364;
}

.status-dot.avoid {
    background: #f5a623;
}

.status-dot.decommissioned,
.status-dot.offline {
    background: #f85149;
    animation: none;
}

.status-dot.decommissioned::after,
.status-dot.offline::after {
    animation: none;
    display: none;
}

.status-dot.online + span {
    font-weight: 800;
    color: #56d364;
}

.status-dot.avoid + span {
    font-weight: 800;
    color: #f5a623;
}

.status-dot.decommissioned + span,
.status-dot.offline + span {
    font-weight: 800;
    color: #f85149;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes statusRing {
    0% { transform: scale(1); opacity: 0.55; }
    100% { transform: scale(2.35); opacity: 0; }
}

.flag {
    display: inline-block;
    min-width: 2.5em;
    padding: 0.2em 0.45em;
    background-color: var(--badge-bg);
    color: var(--text-muted);
    margin-right: -0.15em;
    transform: skewX(-10deg);
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    border: 1px solid var(--border-color);
}

.flag.on {
    background-color: rgba(220, 53, 69, 0.18);
    color: #ff7b85;
    border-color: rgba(220, 53, 69, 0.28);
}

.flag.sig {
    background-color: rgba(46, 160, 67, 0.08);
    color: var(--text-muted);
}

.flag.sig.on {
    background-color: rgba(46, 160, 67, 0.22);
    color: #56d364;
    border-color: rgba(46, 160, 67, 0.35);
}

.flag.warn.on {
    background-color: rgba(245, 166, 35, 0.2);
    color: #f5a623;
    border-color: rgba(245, 166, 35, 0.35);
}

@media (max-width: 576px) {
    #block h1 {
        font-size: 1.55rem;
    }

    #block h2 {
        font-size: 0.92rem;
    }

    #info {
        font-size: 1rem;
    }

    .pool-logo {
        height: 8em;
    }

    .node-logo {
        height: 1.65rem;
        bottom: 1.1rem;
    }

    .node-theme-wrap {
        top: 0.65rem;
        right: 0.65rem;
    }
}
