body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    color: white;
}

.game-container {
    position: relative;
    width: 800px;
    height: 500px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 255, 0.3);
    overflow: hidden;
}

#game-board {
    width: 100%;
    height: 100%;
    background: #0f3460;
    position: relative;
    overflow: hidden;
}

.paddle {
    position: absolute;
    width: 15px;
    height: 100px;
    background: white;
    border-radius: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: box-shadow 0.3s;
}

#paddle-left {
    left: 20px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#paddle-right {
    right: 20px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#ball {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #e94560;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.8);
}

.center-line {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 2px;
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-50%);
    z-index: 1;
}

.score {
    position: absolute;
    top: 30px;
    font-size: 60px;
    color: rgba(255, 255, 255, 0.5);
    z-index: 2;
    font-weight: bold;
}

#score-left {
    left: 30%;
}

#score-right {
    right: 30%;
}

.controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background: #e94560;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    background: #ff6b81;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
}

.game-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    font-weight: bold;
    color: white;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 10;
    background: rgba(15, 52, 96, 0.8);
    padding: 20px 40px;
    border-radius: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

.game-message.visible {
    opacity: 1;
}

.glow {
    animation: glow 0.5s;
}

@keyframes glow {
    0% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.9);
    }

    100% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }
}

.hit-effect {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    animation: expand 0.6s linear forwards;
}

@keyframes expand {
    0% {
        width: 20px;
        height: 20px;
        opacity: 0.8;
    }

    100% {
        width: 80px;
        height: 80px;
        opacity: 0;
    }
}

.difficulty-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    display: flex;
    gap: 5px;
}

.difficulty-btn {
    padding: 5px 10px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.difficulty-btn.active {
    background: #e94560;
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    position: absolute;
    bottom: 20px;
    width: 100%;
    justify-content: space-between;
    padding: 0 40px;
    box-sizing: border-box;
    z-index: 3;
}

.mobile-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    user-select: none;
}

@media (max-width: 800px) {
    .game-container {
        width: 95vw;
        height: 80vh;
    }

    .mobile-controls {
        display: flex;
    }
}
.dark-mode .navbar{
    background: rgba(255, 255, 255, 0.2);
}

/* Navbar */
.navbar {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: transparent;
    padding: 15px;
    display: flex;
    justify-content: flex-start;
}

/* Back Button */
.back-button {
    background: #2867f0;
    color: white;
    border: none;
    padding: 0.8rem 20px;
    width: 4rem;
    height: 2.5rem;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: #0190f6;
    transform: scale(1.05);
}

.toggle-btn {
    position: fixed;
    top: 0;
    right: 30px;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 30px;
    cursor: pointer;
    transition: 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toggle theme style */
#toggleTheme {
    background: transparent;
    box-shadow: none;
    position: absolute;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Click animation (subtle scaling effect) */
#toggleTheme:active {
    transform: scale(0.9);
    opacity: 0.7;
}

/* Dark mode effect */
.dark-mode #toggleTheme {
    background: transparent;
    box-shadow: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Click animation in dark mode */
.dark-mode #toggleTheme:active {
    transform: scale(0.9);
    opacity: 0.7;
}

.toggle-btn:hover {
    background: #0056b3;
}

body.dark-mode {
    background: #121212;
    color: #fff;
}

/* Dark mode for header */
.dark-mode nav {
    background: linear-gradient(135deg, #1e1e1e, #333);
}

.dark-mode .game-container{
    background: #2A2A2A;
}
.dark-mode .game-container h2,
.dark-mode .timer{
    text-shadow: none;
}
.dark-mode .game-container button{
    color: #1e1e1e;
}
.dark-mode .game-container button:hover{
    background-color: #121212;
    color: #fff;
}
.dark-mode #game-board{
    background: #292828;
}