* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00ff00;
    --secondary-color: #00cc00;
    --dark-bg: #1a1a2e;
    --dark-bg2: #16213e;
    --text-color: #00ff00;
    --shadow-color: rgba(0, 255, 0, 0.3);
    --glow-color: rgba(0, 255, 0, 0.8);
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-bg2) 100%);
    font-family: 'Arial', sans-serif;
    color: var(--text-color);
    padding: 20px;
}

.container {
    text-align: center;
    background: rgba(0, 0, 0, 0.85);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 0 40px var(--shadow-color), inset 0 0 40px rgba(0, 0, 0, 0.5);
    max-width: 900px;
    width: 100%;
}

h1 {
    font-size: 48px;
    margin-bottom: 30px;
    text-shadow: 0 0 20px var(--glow-color);
    letter-spacing: 3px;
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { text-shadow: 0 0 20px var(--glow-color); }
    50% { text-shadow: 0 0 40px var(--glow-color); }
}

/* Difficulty Panel */
.difficulty-panel {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.1), rgba(0, 200, 0, 0.1));
    padding: 30px;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    margin-bottom: 30px;
    box-shadow: 0 0 20px var(--shadow-color);
}

.difficulty-panel h2 {
    margin-bottom: 20px;
    text-shadow: 0 0 10px var(--glow-color);
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.difficulty-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--dark-bg);
    border: 2px solid var(--primary-color);
    padding: 15px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px var(--shadow-color);
}

.difficulty-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--glow-color);
}

.difficulty-btn:active {
    transform: scale(0.98);
}

.difficulty-btn.active {
    background: linear-gradient(135deg, #ffaa00, #ff8800);
    border-color: #ffaa00;
    box-shadow: 0 0 25px rgba(255, 170, 0, 0.8);
}

/* Game Info */
.game-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.info-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.info-box {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 10px var(--shadow-color);
}

.info-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.info-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--glow-color);
}

/* Scoreboard */
.scoreboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin: 30px auto;
    padding: 20px;
    background: rgba(0, 255, 0, 0.05);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    box-shadow: 0 0 20px var(--shadow-color);
}

.score-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-label {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-color);
    text-shadow: 0 0 5px var(--glow-color);
    font-weight: bold;
}

.score {
    font-size: 56px;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 0 0 15px var(--glow-color);
    margin-bottom: 10px;
}

.stars {
    font-size: 24px;
    letter-spacing: 5px;
    animation: star-twinkle 1.5s ease-in-out infinite;
}

@keyframes star-twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Canvas */
#pongCanvas {
    display: block;
    background: linear-gradient(to right, rgba(0, 255, 0, 0.05), transparent, rgba(0, 255, 0, 0.05));
    border: 3px solid var(--primary-color);
    border-radius: 10px;
    margin: 30px auto;
    box-shadow: 0 0 30px var(--shadow-color), inset 0 0 20px rgba(0, 255, 0, 0.1);
    max-width: 100%;
    height: auto;
}

/* Badges Display */
.badges-display {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 255, 0, 0.05);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    box-shadow: 0 0 15px var(--shadow-color);
}

.badge-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.badge {
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: grayscale(100%);
    opacity: 0.3;
    transform: scale(0.8);
}

.badge.unlocked {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1);
    animation: badge-unlock 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes badge-unlock {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.badge:hover.unlocked {
    transform: scale(1.2) rotate(10deg);
}

/* Controls */
.controls {
    margin: 20px 0;
    font-size: 14px;
    color: #888;
    line-height: 2;
    padding: 15px;
    background: rgba(0, 255, 0, 0.05);
    border-radius: 8px;
}

.controls p {
    margin: 5px 0;
}

.controls strong {
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--glow-color);
}

/* Buttons */
.game-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--dark-bg);
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px var(--shadow-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--glow-color);
}

.btn:active {
    transform: scale(0.98);
}

.btn-pause {
    background: linear-gradient(135deg, #00ccff, #0099ff);
    border: 2px solid #00ccff;
}

.btn-reset {
    background: linear-gradient(135deg, #ff6666, #ff3333);
    border: 2px solid #ff6666;
}

.btn-modal {
    padding: 12px 25px;
    font-size: 14px;
    margin-top: 15px;
}

/* Status Message */
.status-message {
    margin-top: 15px;
    padding: 10px 15px;
    font-size: 14px;
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--glow-color);
    min-height: 20px;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, var(--dark-bg), var(--dark-bg2));
    border: 3px solid var(--primary-color);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 50px var(--glow-color);
    max-width: 500px;
    animation: modalSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.5) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    font-size: 32px;
    margin-bottom: 20px;
    text-shadow: 0 0 15px var(--glow-color);
}

.modal-stats {
    background: rgba(0, 255, 0, 0.05);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.modal-stats p {
    margin: 10px 0;
    font-size: 18px;
    color: var(--text-color);
}

.badge-unlocked {
    color: #ffaa00;
    font-weight: bold;
    margin-top: 15px;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 32px;
        margin-bottom: 20px;
    }

    .difficulty-buttons {
        grid-template-columns: 1fr 1fr;
    }

    .scoreboard {
        gap: 30px;
        grid-template-columns: 1fr 1fr;
    }

    .score {
        font-size: 40px;
    }

    .info-row {
        grid-template-columns: 1fr;
    }

    #pongCanvas {
        width: 100%;
        max-width: 600px;
    }

    .badge-row {
        gap: 10px;
    }

    .badge {
        font-size: 24px;
    }

    .modal-content {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .difficulty-buttons {
        grid-template-columns: 1fr;
    }

    .difficulty-btn {
        font-size: 14px;
        padding: 12px 15px;
    }

    .scoreboard {
        gap: 20px;
    }

    .score {
        font-size: 36px;
    }

    .controls {
        font-size: 12px;
    }

    .game-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        padding: 12px 15px;
        font-size: 14px;
    }

    .badge {
        font-size: 20px;
    }
}