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

#grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

body {
    background: #0a0a1a;
    background-image: radial-gradient(ellipse at 20% 50%, rgba(0, 60, 120, 0.15) 0%, transparent 60%),
                      radial-gradient(ellipse at 80% 20%, rgba(120, 0, 80, 0.1) 0%, transparent 50%);
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.15), 0 0 60px rgba(0, 212, 255, 0.05); }
    50% { box-shadow: 0 0 30px rgba(0, 212, 255, 0.25), 0 0 80px rgba(0, 212, 255, 0.1); }
}

@keyframes float-corn {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
    25% { transform: translateY(-8px) rotate(5deg); opacity: 0.8; }
    50% { transform: translateY(-4px) rotate(-3deg); opacity: 1; }
    75% { transform: translateY(-10px) rotate(2deg); opacity: 0.7; }
}

@keyframes scan-line {
    0% { top: -10%; }
    100% { top: 110%; }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes shake-no {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    20% { transform: translateX(-3px) rotate(-2deg); }
    40% { transform: translateX(3px) rotate(2deg); }
    60% { transform: translateX(-2px) rotate(-1deg); }
    80% { transform: translateX(2px) rotate(1deg); }
}

.animate-fade-in-up {
    animation: fade-in-up 0.6s ease-out forwards;
}

.animate-slide-in {
    animation: slide-in 0.5s ease-out forwards;
}

.viewer-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}

.corn-float {
    animation: float-corn 4s ease-in-out infinite;
}

.corn-shake {
    animation: shake-no 0.6s ease-in-out infinite;
}

.scan-line::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(0, 212, 255, 0.08);
    animation: scan-line 8s linear infinite;
    pointer-events: none;
}

.rules-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    border: 2px solid rgba(0, 212, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.rules-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
}

.btn-connect {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-connect:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.btn-connect:disabled {
    background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
    color: #555;
    cursor: not-allowed;
}

.btn-danger {
    background: linear-gradient(135deg, #ff3366 0%, #cc2255 100%);
    transition: all 0.3s ease;
}

.btn-danger:hover {
    box-shadow: 0 5px 20px rgba(255, 51, 102, 0.4);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, #ff9933 0%, #cc7722 100%);
    transition: all 0.3s ease;
}

.btn-warning:hover {
    box-shadow: 0 5px 20px rgba(255, 153, 51, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, #2a2a4e 0%, #1a1a3e 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.2);
    transform: translateY(-1px);
}

.checkbox-custom {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(0, 212, 255, 0.5);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.checkbox-custom:checked {
    background: #00d4ff;
    border-color: #00d4ff;
}

.checkbox-custom:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #0a0a1a;
    font-weight: 800;
    font-size: 14px;
}

.vnc-container {
    background: #0d0d1a;
    border: 2px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.vnc-container canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
}

.toast {
    animation: fade-in-up 0.4s ease-out;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.connected {
    background: #00ff88;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}

.status-dot.connecting {
    background: #ffcc00;
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.6);
    animation: pulse-glow 1s ease-in-out infinite;
}

.status-dot.disconnected {
    background: #ff3366;
    box-shadow: 0 0 8px rgba(255, 51, 102, 0.6);
}

.rules-reminder {
    background: rgba(10, 10, 26, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.15);
    backdrop-filter: blur(10px);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a1a;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}