/* Modern Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-cyan: #06b6d4;
    --primary-purple: #a855f7;
    --primary-pink: #ec4899;
    --accent-yellow: #fbbf24;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
}

body {
    margin: 0;
    font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Glass Morphism Effect */
.glass-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Score Cards */
.score-card {
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
    transition: all 0.3s ease;
}

.score-card:hover {
    transform: scale(1.05);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-purple));
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
    font-family: 'Orbitron', monospace;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(6, 182, 212, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-cyan);
    transform: scale(1.1);
}

/* Game Mode Buttons */
.game-mode-btn {
    padding: 0.5rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
}

.game-mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.game-mode-btn.active {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-purple));
    border-color: transparent;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

/* Select Custom */
.select-custom {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.8);
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
}

.select-custom:hover {
    border-color: var(--primary-cyan);
    background: rgba(15, 23, 42, 0.95);
}

.select-custom:focus {
    outline: none;
    border-color: var(--primary-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

/* Canvas Container */
.canvas-container {
    position: relative;
    width: 100%;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(6, 182, 212, 0.3);
}

#pongCanvas {
    display: block;
    width: 100%;
    height: auto;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    cursor: none;
}

/* Game Overlay */
.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: fadeIn 0.3s ease;
}

.game-overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    padding: 2rem;
    animation: slideUp 0.5s ease;
}

/* Keyboard Keys */
.kbd {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.25rem;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

/* Instruction Items */
.instruction-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.instruction-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
}

.modal-close {
    font-size: 2rem;
    font-weight: bold;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--primary-cyan);
    transform: rotate(90deg);
}

.setting-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    color: white;
}

/* Toggle Switch */
.toggle {
    appearance: none;
    width: 3rem;
    height: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle:checked {
    background: var(--primary-cyan);
}

.toggle::before {
    content: '';
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    background: white;
    border-radius: 50%;
    top: 0.125rem;
    left: 0.125rem;
    transition: all 0.3s ease;
}

.toggle:checked::before {
    transform: translateX(1.5rem);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(6, 182, 212, 0.5),
                     0 0 20px rgba(168, 85, 247, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(6, 182, 212, 0.8),
                     0 0 40px rgba(168, 85, 247, 0.5);
    }
}

@keyframes blob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

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

.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

.animate-fade-in-up {
    animation: slideUp 1s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animation-delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-400 {
    animation-delay: 0.4s;
}

.animate-scale-in {
    animation: scaleIn 0.8s ease-out;
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .glass-card {
        padding: 1rem !important;
    }
}

@media (max-width: 768px) {
    .btn-primary {
        font-size: 0.875rem;
        padding: 0.625rem 1.25rem;
    }
    
    .game-mode-btn {
        font-size: 0.75rem;
        padding: 0.375rem 1rem;
    }
    
    #pongCanvas {
        border-radius: 0.5rem;
    }
    
    .overlay-content {
        padding: 1.5rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    .instruction-item {
        padding: 0.75rem;
    }
    
    .setting-item {
        padding: 0.75rem;
    }
}

/* Print Styles */
@media print {
    .btn-primary, .btn-secondary, .game-mode-btn {
        display: none;
    }
}