/*==========================================
1. Grund-Setup und Variablen
==========================================*/
:root {
    /* Die Startfarbe - wird vom JS interaktiv verändert */
    --bg-color: #1e3a8a; 
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Verhindert Scrollbalken */
    touch-action: none; /* Deaktiviert Browser-Gesten für Mobile */
    overscroll-behavior-y: contain; /* Verhindert "Pull-to-refresh" */
}

body {
    background-color: var(--bg-color);
    /* Transition sorgt für den weichen Farbübergang bei Bewegung */
    transition: background-color 0.4s ease-out; 
    display: flex;
    align-items: center;
    justify-content: center;
}

/*==========================================
2. Das Spielfeld (Container)
==========================================*/
.pong {
    position: absolute;
    width: 1920px;
    height: 1080px;
    /* ENTFERNE top: 50% und left: 50% hier! */
    background: transparent; 
   
    transform-origin: center center; /* Wichtig für die Skalierung aus der Mitte */
}

/*==========================================
3. Spielelemente
==========================================*/
.pong * {
    position: absolute;
}

.paddle {
    background: #ffffff;
    height: 210px;
    width: 70px;
    /* Ein leichter Glow-Effekt lässt die Paddles edler wirken */
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.paddle-player { 
    /* Spieler-Paddle (Links) */
    background: #ffffff;
}

.paddle-enemy {
    /* Gegner-Paddle (Rechts) */
    background: #ffffff;
}

.ball {
    background: #ffffff;
    height: 70px;
    width: 70px;
    border-radius: 0; /* Quadratischer Ball für Retro-Look */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/*==========================================
4. Score-Anzeige
==========================================*/
.score {
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Arial', sans-serif;
    font-size: 60px;
    font-weight: bold;
    top: 0px;
    width: 0px;
    text-align: center;
}

.score-player {
    left: 480px; /* Positioniert auf der linken Hälfte */
}

.score-enemy {
    right: 480px; /* Positioniert auf der rechten Hälfte */
}

/*==========================================
5. Technische Fixes
==========================================*/
canvas {
    touch-action: none;
    user-select: none;
    display: block;
}