@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap');

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

body {
    background: #001a00;
    color: #FFFFFF;
    font-family: 'Courier Prime', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 0, 0.03) 2px,
            rgba(0, 255, 0, 0.03) 4px
        );
}

.game-container {
    background: #002200;
    border: 3px solid #00aa00;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
    max-width: 900px;
}

.header {
    text-align: center;
    margin-bottom: 15px;
    position: relative;
}

.header h1 {
    font-size: 2.5em;
    color: #00ff00;
    text-shadow: 
        2px 2px 0px #004400,
        0 0 10px rgba(0, 255, 0, 0.5);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.speed-display {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: #000;
    color: #00ff00;
    padding: 5px 10px;
    border: 2px solid #00aa00;
    border-radius: 5px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.5s;
    font-size: 1.2em;
}

.score-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: #000;
    padding: 15px;
    border: 2px solid #00aa00;
    border-radius: 5px;
}

.score-section {
    text-align: center;
    flex: 1;
}

.player-name {
    font-size: 0.9em;
    color: #aaffaa;
    margin-bottom: 5px;
}

.score {
    font-size: 2.5em;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
    line-height: 1;
}

.games {
    font-size: 1.2em;
    color: #88ff88;
    margin-top: 5px;
}

.match-info {
    text-align: center;
    flex: 1;
}

#gameStatus {
    font-size: 1.2em;
    color: #ffff00;
    font-weight: bold;
    margin-bottom: 5px;
}

#ballSpeed {
    font-size: 1em;
    color: #ff8800;
}

#gameCanvas {
    border: 3px solid #00aa00;
    background: #001100;
    display: block;
    margin: 0 auto 15px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 255, 0, 0.2);
}

.power-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    background: #000;
    padding: 10px;
    border: 2px solid #ffaa00;
    border-radius: 5px;
}

.power-label {
    color: #ffaa00;
    font-weight: bold;
    font-size: 1.1em;
}

.power-bar {
    flex: 1;
    height: 20px;
    background: #333;
    border: 2px solid #ffaa00;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.power-fill {
    height: 100%;
    background: #44ff44;
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 8px;
}

.controls {
    background: #000;
    border: 2px solid #00aa00;
    border-radius: 5px;
    padding: 15px;
}

.control-section h3 {
    color: #00ff00;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.3em;
}

.control-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    padding: 3px 0;
}

.control-item span:first-child {
    color: #aaffaa;
}

.control-item span:last-child {
    color: #ffff00;
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 900px) {
    .game-container {
        margin: 10px;
        padding: 15px;
    }
    
    #gameCanvas {
        max-width: 100%;
        height: auto;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .score-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .score-section {
        display: flex;
        align-items: center;
        gap: 15px;
    }
}

/* Retro CRT effect */
.game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
    border-radius: 10px;
}

/* Glow effects */
.score, .header h1 {
    animation: neonGlow 2s ease-in-out infinite alternate;
}

@keyframes neonGlow {
    from {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 15px currentColor;
    }
    to {
        text-shadow: 
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 30px currentColor;
    }
}