:root {
    --green: #00ff6a;
    --green-dim: rgba(0, 255, 106, 0.15);
    --blue: #3b82f6;
    --blue-dim: rgba(59, 130, 246, 0.15);
    --purple: #a855f7;
    --purple-dim: rgba(168, 85, 247, 0.15);
    --red: #ef4444;
    --yellow: #eab308;
    --bg: #09090b;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.06);
    --border-bright: rgba(255, 255, 255, 0.1);
    --text: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --font: 'Inter', -apple-system, sans-serif;
    --font-mono: 'Fira Code', monospace;
    --radius: 12px;
    --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body.loading {
    overflow: hidden;
}

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

/* ===================== BACKGROUND ===================== */

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}

.bg-glow-1 {
    width: 500px;
    height: 500px;
    background: rgba(0, 255, 106, 0.04);
    top: -150px;
    right: -100px;
}

.bg-glow-2 {
    width: 400px;
    height: 400px;
    background: rgba(59, 130, 246, 0.04);
    bottom: -100px;
    left: -100px;
}

/* ===================== LOADER ===================== */

/* ===================== DEFACE LOADER ===================== */

.loader-screen {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s, visibility 0.5s;
    overflow: hidden;
}

.loader-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.deface-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.015) 2px,
        rgba(0, 255, 65, 0.015) 4px
    );
    pointer-events: none;
    z-index: 1;
}

.deface-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* Glitch title */
.deface-glitch {
    font-family: 'Unbounded', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: #ff0033;
    text-transform: uppercase;
    position: relative;
    text-shadow:
        0 0 10px rgba(255, 0, 51, 0.7),
        0 0 40px rgba(255, 0, 51, 0.3);
    animation: glitchText 3s infinite;
    margin-bottom: 0.3rem;
}

.deface-glitch::before,
.deface-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.deface-glitch::before {
    color: #0ff;
    animation: glitchBefore 2s infinite;
    clip-path: inset(0 0 60% 0);
}

.deface-glitch::after {
    color: #f0f;
    animation: glitchAfter 2s infinite;
    clip-path: inset(40% 0 0 0);
}

@keyframes glitchText {
    0%, 100% { transform: none; opacity: 1; }
    7% { transform: skew(-2deg); }
    10% { transform: none; }
    27% { transform: skew(2deg); }
    30% { transform: none; }
    50% { opacity: 0.8; }
    50.1% { opacity: 1; }
    72% { transform: skew(-1deg); }
    75% { transform: none; }
}

@keyframes glitchBefore {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

@keyframes glitchAfter {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(3px); }
    40% { transform: translateX(-3px); }
    60% { transform: translateX(2px); }
    80% { transform: translateX(-2px); }
}

.deface-sub {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #ff0033;
    opacity: 0.8;
    min-height: 1.2em;
    margin-bottom: 0.75rem;
}

.deface-skull {
    opacity: 0;
    transition: opacity 0.5s ease;
    margin-bottom: 0.5rem;
}

.deface-skull.visible {
    opacity: 1;
}

.deface-ascii {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: #ff0033;
    text-shadow: 0 0 8px rgba(255, 0, 51, 0.5);
    line-height: 1.2;
    display: inline-block;
    text-align: center;
    margin: 0;
}

.deface-lines {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--green);
    text-align: left;
    max-width: 600px;
    margin: 0 auto 1.25rem;
    white-space: nowrap;
}

.deface-lines::-webkit-scrollbar { display: none; }

.deface-line {
    opacity: 0;
    animation: defaceLineIn 0.2s ease forwards;
    margin-bottom: 0.15rem;
}

@keyframes defaceLineIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 0.7; transform: translateX(0); }
}

.deface-bar-wrapper {
    width: 200px;
    height: 3px;
    background: rgba(255, 0, 51, 0.15);
    border-radius: 2px;
    margin: 0 auto 0.5rem;
    overflow: hidden;
}

.deface-bar {
    height: 100%;
    background: #ff0033;
    width: 0%;
    box-shadow: 0 0 10px rgba(255, 0, 51, 0.5);
    transition: width 0.1s linear;
}

.deface-percent {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #ff0033;
    text-shadow: 0 0 10px rgba(255, 0, 51, 0.4);
}

/* Screen flicker on load */
.loader-screen.flicker {
    animation: screenFlicker 0.15s linear 3;
}

@keyframes screenFlicker {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* ===================== DASHBOARD ===================== */

.dashboard {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===================== HERO ===================== */

.hero {
    text-align: center;
    padding: 2rem 0 1rem;
}

.hero-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--green);
    background: var(--green-dim);
    border: 1px solid rgba(0, 255, 106, 0.15);
    padding: 0.3rem 1rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 6.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-decoration: underline;
    text-decoration-color: var(--green);
    text-decoration-thickness: 6px;
    text-underline-offset: 12px;
}

.hero-highlight {
    color: var(--green);
    text-shadow: 0 0 30px rgba(0, 255, 106, 0.4);
}

.hero-sub {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
}

.stat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-dot-green {
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: pulse 2s ease infinite;
}

.stat-dot-blue {
    background: var(--blue);
    box-shadow: 0 0 8px var(--blue);
}

.stat-dot-purple {
    background: var(--purple);
    box-shadow: 0 0 8px var(--purple);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    color: var(--text);
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* ===================== CARDS ===================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s ease;
}

.card:hover {
    border-color: var(--border-bright);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-icon {
    color: var(--green);
    font-size: 0.5rem;
    animation: pulse 2s ease infinite;
}

.card-icon-blue { color: var(--blue); }
.card-icon-purple { color: var(--purple); }

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.card-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--green);
    background: var(--green-dim);
    border: 1px solid rgba(0, 255, 106, 0.12);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    animation: pulse 2s ease infinite;
}

/* ===================== NODE IP GRID ===================== */

.node-ip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1px;
    background: var(--border);
}

.node-ip-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: var(--bg);
    transition: background 0.3s ease;
}

.node-ip-item:hover {
    background: var(--bg-card-hover);
}

.node-ip-item.flash {
    animation: rowFlash 0.5s ease;
}

@keyframes rowFlash {
    0% { background: rgba(0, 255, 106, 0.06); }
    100% { background: var(--bg); }
}

.node-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.node-dot.active {
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}

.node-index {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    min-width: 24px;
}

.node-ip {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

.node-port {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.node-flag {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    border: 1px solid var(--border);
}

/* ===================== BOTTOM ROW ===================== */

.bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* ===================== LOG ===================== */

.log-list {
    padding: 0.5rem 0;
    max-height: 220px;
    overflow-y: auto;
}

.log-list::-webkit-scrollbar { width: 4px; }
.log-list::-webkit-scrollbar-track { background: transparent; }
.log-list::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }

.log-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.log-time {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.log-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.log-dot-green { background: var(--green); }
.log-dot-blue { background: var(--blue); }
.log-dot-yellow { background: var(--yellow); }

.log-text {
    color: var(--text-secondary);
}

/* ===================== INFO ===================== */

.info-rows {
    padding: 0.25rem 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.info-value {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text);
    font-weight: 500;
}

/* ===================== SPOTIFY ===================== */

.spotify-card .card-header {
    border-bottom: 1px solid var(--border);
}

.card-icon-svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.spotify-icon {
    color: #1db954;
}

.spotify-status {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.spotify-status.offline {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.spotify-status.live {
    color: #1db954;
    background: rgba(29, 185, 84, 0.1);
    border: 1px solid rgba(29, 185, 84, 0.2);
    animation: pulse 2s ease infinite;
}

.spotify-body {
    padding: 1rem 1.25rem;
}

.spotify-idle {
    padding: 0.5rem 0;
}

.spotify-idle-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.spotify-playing {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.spotify-album {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-card);
}

.spotify-info {
    flex: 1;
    min-width: 0;
}

.spotify-track {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-artist {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
}

.spotify-progress-bar {
    width: 100%;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.spotify-progress {
    height: 100%;
    background: #1db954;
    border-radius: 2px;
    width: 0%;
    transition: width 1s linear;
}

/* ===================== SOCIAL BUTTONS ===================== */

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.25s ease;
    backdrop-filter: blur(10px);
}

.social-btn:hover {
    border-color: var(--border-bright);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.social-btn-discord:hover {
    border-color: rgba(88, 101, 242, 0.3);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.15);
}

.btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ===================== FOOTER ===================== */

.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 0 0;
    font-size: 0.75rem;
}

.footer-brand {
    color: var(--text-secondary);
    font-weight: 600;
}

.footer-sep {
    color: var(--text-muted);
}

.footer-status {
    color: var(--text-muted);
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 768px) {
    .hero-title { font-size: 4.5rem; }

    .bottom-row {
        grid-template-columns: 1fr;
    }

    .node-ip-grid {
        grid-template-columns: 1fr;
    }

    .dashboard {
        padding: 2rem 1rem 2rem;
    }
}

@media (max-width: 480px) {
    .hero-title { font-size: 3.2rem; }

    .hero-stats {
        flex-direction: column;
        align-items: center;
    }

    .stat-pill { width: 100%; justify-content: center; }
}
