:root {
    --neon-blue: #00ffff;
    --neon-red: #ff0055;
    --bg-color: #0d0d12;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1b0033 0%, #000000 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

#game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    /* Mobil çentik ve güvenli alan hesaplamaları */
    padding-top: env(safe-area-inset-top, 10px);
    padding-bottom: env(safe-area-inset-bottom, 10px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

#score-board {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    padding: 10px 20px;
    box-sizing: border-box;
    position: absolute;
    top: env(safe-area-inset-top, 20px);
    z-index: 10;
    pointer-events: none;
}

.score {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}
#score-p2 { color: var(--neon-red); text-shadow: 0 0 10px var(--neon-red); }
#score-p1 { color: var(--neon-blue); text-shadow: 0 0 10px var(--neon-blue); }

#game-container {
    flex-grow: 1;
    width: 100%;
    max-width: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

canvas {
    background-color: #1a1a24;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 0 30px rgba(0, 255, 255, 0.2);
    touch-action: none;
    transition: box-shadow 0.3s, border-color 0.3s;
}

canvas.glow-p1 {
    border-color: var(--neon-blue) !important;
    box-shadow: inset 0 0 40px rgba(0,255,255,0.4), 0 0 60px var(--neon-blue) !important;
}

canvas.glow-p2 {
    border-color: var(--neon-red) !important;
    box-shadow: inset 0 0 40px rgba(255,0,85,0.4), 0 0 60px var(--neon-red) !important;
}

#goal-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    pointer-events: none;
    animation: goalPop 2s ease-out forwards;
}

#goal-text {
    font-size: 4rem;
    color: white;
    text-align: center;
    text-shadow: 0 0 20px rgba(255,255,255,0.8);
    margin: 0;
}

@keyframes goalPop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

#game-over-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #1a1a24;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid var(--neon-blue);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

#winner-text {
    color: white;
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-shadow: 0 0 10px white;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.neon-btn {
    background: transparent;
    border: 2px solid;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

.neon-btn.blue {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0,255,255,0.3);
}
.neon-btn.blue:hover { background: var(--neon-blue); color: black; }

.neon-btn.red {
    border-color: var(--neon-red);
    box-shadow: 0 0 10px rgba(255,0,85,0.3);
}
.neon-btn.red:hover { background: var(--neon-red); color: white; }
