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

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    justify-content: center;
    align-items: center;
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    overflow: hidden;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-info {
    display: flex;
    justify-content: space-between;
    width: 600px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.player-info,
.score-info,
.game-code-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.info-label {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1.2rem;
    font-weight: bold;
}

#game-board {
    width: 600px;
    height: 400px;
    border: 3px solid white;
    position: relative;
    background: #000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

/* Linha central pontilhada */
#game-board::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: repeating-linear-gradient(to bottom,
            transparent,
            transparent 10px,
            white 10px,
            white 20px);
}

#ball {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #ffa726);
    position: absolute;
    top: 190px;
    left: 290px;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.7);
    transition: transform 0.1s;
}

#paddle1,
#paddle2 {
    width: 12px;
    height: 80px;
    position: absolute;
    top: 160px;
    border-radius: 6px;
    transition: top 0.05s ease-out;
}

#paddle1 {
    left: 20px;
    background: linear-gradient(to right, #4facfe, #00f2fe);
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.6);
}

#paddle2 {
    right: 20px;
    background: linear-gradient(to left, #ff6b6b, #ffa726);
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.6);
}

/* Elementos de UI */
.status-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-indicator.connected {
    background: rgba(76, 175, 80, 0.8);
}

.status-indicator.disconnected {
    background: rgba(244, 67, 54, 0.8);
}

.status-indicator.waiting {
    background: rgba(255, 152, 0, 0.8);
}

.waiting-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    z-index: 100;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    min-width: 300px;
}

.waiting-message h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
    color: #4facfe;
}

.waiting-message p {
    margin-bottom: 10px;
    opacity: 0.9;
}

.game-code {
    font-size: 2rem;
    font-weight: bold;
    color: #ffa726;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
}

.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    z-index: 200;
    backdrop-filter: blur(5px);
}

.game-over-screen h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.winner-message {
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
}

.player1-wins {
    color: #4facfe;
    text-shadow: 0 0 10px rgba(79, 172, 254, 0.7);
}

.player2-wins {
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.7);
}

.restart-button {
    margin-top: 20px;
    padding: 15px 30px;
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.6);
}

.restart-button:active {
    transform: translateY(0);
}

.instructions {
    margin-top: 20px;
    text-align: center;
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Animações */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }

    #game-board {
        width: 95vw;
        height: 60vh;
        max-width: 500px;
        max-height: 350px;
    }

    .game-info {
        width: 95vw;
        max-width: 500px;
        flex-direction: column;
        gap: 10px;
    }

    .player-info,
    .score-info,
    .game-code-info {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
}

/* Efeitos de partícula para a bola */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

/* Score animation */
@keyframes scorePop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5);
    }

    100% {
        transform: scale(1);
    }
}

.score-pop {
    animation: scorePop 0.3s ease-out;
}


/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Hidden by default */
.modal-overlay.hidden {
    display: none;
}

/* Modal window */
.modal {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    width: 320px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s ease;
}

.modal h2 {
    margin-bottom: 10px;
    font-size: 20px;
    color: #333;
}

.modal input {
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 16px;
}

.modal-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

#modalCancel {
    background: #b0b0b0;
    color: white;
}

#modalConfirm {
    background: #4CAF50;
    color: white;
}

#modalConfirm:hover {
    background: #45a049;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
