:root {
    --bg-dark: #0a0a12;
    --bg-panel: #12121f;
    --bg-card: #1a1a2e;
    --accent-green: #00ff9f;
    --accent-cyan: #00e5ff;
    --accent-red: #ff3d5a;
    --accent-yellow: #ffd600;
    --accent-orange: #ff8c00;
    --text-primary: #e0e0f0;
    --text-muted: #6a6a8a;
    --glow-green: 0 0 20px rgba(0, 255, 159, 0.3);
    --glow-cyan: 0 0 20px rgba(0, 229, 255, 0.2);
    --glow-red: 0 0 15px rgba(255, 61, 90, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'IBM Plex Sans', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 0%, rgba(0, 255, 159, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(0, 229, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace !important;
}

.font-sans {
    font-family: 'IBM Plex Sans', sans-serif !important;
}

/* Scanline overlay */
.scanlines::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    pointer-events: none;
    z-index: 2;
    border-radius: inherit;
}

/* CRT glow effect */
.crt-glow {
    box-shadow: 
        inset 0 0 60px rgba(0, 229, 255, 0.05),
        0 0 40px rgba(0, 229, 255, 0.08),
        0 0 80px rgba(0, 229, 255, 0.04);
}

/* Blinking live dot */
@keyframes blink-live {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent-green); }
    50% { opacity: 0.3; box-shadow: 0 0 2px var(--accent-green); }
}

.live-dot {
    animation: blink-live 1.5s ease-in-out infinite;
}

/* Pulse connecting */
@keyframes pulse-connect {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.pulse-connect {
    animation: pulse-connect 1s ease-in-out infinite;
}

/* Corn strikethrough */
.corn-banned {
    position: relative;
    display: inline-block;
}

.corn-banned::after {
    content: '';
    position: absolute;
    top: 45%;
    left: -4px;
    right: -4px;
    height: 3px;
    background: var(--accent-red);
    transform: rotate(-20deg);
    border-radius: 2px;
}

/* Power button */
.power-btn {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid var(--text-muted);
    background: var(--bg-panel);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.power-btn:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
}

.power-btn.connected {
    border-color: var(--accent-green);
    box-shadow: 0 0 20px rgba(0, 255, 159, 0.3);
}

.power-btn.connected:hover {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(255, 61, 90, 0.3);
}

.power-icon {
    width: 24px;
    height: 24px;
}

/* VNC container */
.vnc-container {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(0, 229, 255, 0.15);
}

.vnc-container canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

/* Rules card styling */
.rule-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9), rgba(18, 18, 31, 0.95));
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: 10px;
    padding: 14px 18px;
    transition: all 0.3s ease;
}

.rule-card:hover {
    border-color: rgba(0, 229, 255, 0.25);
    transform: translateY(-1px);
}

/* Status badge */
.status-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

/* Checkbox custom */
.corn-checkbox {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    background: var(--bg-panel);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.corn-checkbox:checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.corn-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--bg-dark);
    font-weight: 900;
    font-size: 14px;
}

/* Fade in animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-1 { animation: fadeInUp 0.5s ease forwards; animation-delay: 0.1s; opacity: 0; }
.fade-in-2 { animation: fadeInUp 0.5s ease forwards; animation-delay: 0.2s; opacity: 0; }
.fade-in-3 { animation: fadeInUp 0.5s ease forwards; animation-delay: 0.3s; opacity: 0; }
.fade-in-4 { animation: fadeInUp 0.5s ease forwards; animation-delay: 0.4s; opacity: 0; }
.fade-in-5 { animation: fadeInUp 0.5s ease forwards; animation-delay: 0.5s; opacity: 0; }

/* Connecting animation */
@keyframes connectingDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

.connecting-dots::after {
    content: '';
    animation: connectingDots 1.5s steps(1) infinite;
}

/* Noise texture overlay */
.noise-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* VNC display div styling */
#vnc-display {
    width: 100%;
    min-height: 300px;
}

#vnc-display canvas {
    max-width: 100%;
}

@media (max-width: 768px) {
    .power-btn {
        width: 44px;
        height: 44px;
    }
    .power-icon {
        width: 18px;
        height: 18px;
    }
}