/* modals.css - Game Dialog Modals */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: linear-gradient(180deg,
        rgba(25, 30, 45, 0.98) 0%,
        rgba(15, 20, 35, 0.99) 100%);
    border: 2px solid rgba(100, 150, 255, 0.4);
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;

    box-shadow:
        0 0 50px rgba(100, 150, 255, 0.2),
        0 25px 50px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg,
        transparent,
        rgba(100, 150, 255, 0.8),
        transparent);
    border-radius: 0 0 3px 3px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #ffffff;
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(100, 180, 255, 0.5);
    text-align: center;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: rgba(200, 210, 230, 0.85);
    text-align: center;
    margin: 0 0 1.25rem 0;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 0.02em;
}

/* Adjust title margin when no subtitle */
.modal-title:last-of-type {
    margin-bottom: 1.5rem;
}

/* Game Over Stats */
.single-player-game-over {
    text-align: center;
}

.single-player-game-over .stats {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(100, 150, 255, 0.2);
    border-radius: 10px;
}

.single-player-game-over .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid rgba(100, 150, 255, 0.1);
    font-family: 'Rajdhani', sans-serif;
}

.single-player-game-over .stat-row:last-child {
    border-bottom: none;
}

.single-player-game-over .stat-label {
    color: rgba(150, 180, 255, 0.7);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.single-player-game-over .stat-value {
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(100, 200, 255, 0.3);
}

/* Dialog Buttons */
.dialog-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal .button {
    flex: 1;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 8px;
    border: 2px solid rgba(100, 150, 255, 0.3);
    background: linear-gradient(180deg,
        rgba(60, 80, 120, 0.8) 0%,
        rgba(40, 60, 100, 0.8) 100%);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal .button:hover {
    border-color: rgba(100, 180, 255, 0.6);
    background: linear-gradient(180deg,
        rgba(80, 100, 140, 0.9) 0%,
        rgba(60, 80, 120, 0.9) 100%);
    box-shadow:
        0 0 20px rgba(100, 150, 255, 0.3),
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.modal .button.cancel {
    background: linear-gradient(180deg,
        rgba(50, 50, 60, 0.8) 0%,
        rgba(35, 35, 45, 0.8) 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

.modal .button.cancel:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: linear-gradient(180deg,
        rgba(60, 60, 70, 0.9) 0%,
        rgba(45, 45, 55, 0.9) 100%);
}

/* ========================================
   GAME OVER MODAL STYLING
   ======================================== */

/* Win title - green/gold */
.modal-title.win-title {
    color: #4dff79;
    text-shadow: 0 0 20px rgba(77, 255, 121, 0.5);
    animation: winPulse 1.5s ease-in-out infinite;
}

/* Lose title - red */
.modal-title.lose-title {
    color: #ff6b6b;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

/* Draw title - orange/amber */
.modal-title.draw-title {
    color: #ffaa4d;
    text-shadow: 0 0 20px rgba(255, 170, 77, 0.5);
}

@keyframes winPulse {
    0%, 100% {
        text-shadow: 0 0 20px rgba(77, 255, 121, 0.5);
    }
    50% {
        text-shadow: 0 0 30px rgba(77, 255, 121, 0.8), 0 0 40px rgba(255, 215, 0, 0.4);
    }
}

/* Winner announcement section */
.winner-announcement {
    text-align: center;
    padding: 1.5rem;
    margin: 1rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.winner-label {
    display: block;
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.winner-name {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(100, 150, 255, 0.5);
}

/* Game Over Prompt - Non-blocking "tap to continue" banner */
.game-over-prompt {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    cursor: pointer;
    animation: game-over-prompt-appear 0.4s ease-out;
}

@keyframes game-over-prompt-appear {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.game-over-prompt-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 32px;
    background: linear-gradient(135deg, rgba(40, 20, 20, 0.95), rgba(60, 25, 25, 0.98));
    border: 2px solid rgba(255, 80, 80, 0.6);
    border-radius: 12px;
    box-shadow:
        0 0 30px rgba(255, 80, 80, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.game-over-prompt-title {
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #ff6b6b;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
}

.game-over-prompt-subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 200, 200, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    animation: prompt-pulse 2s ease-in-out infinite;
}

@keyframes prompt-pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

.game-over-prompt:hover .game-over-prompt-content {
    border-color: rgba(255, 100, 100, 0.8);
    box-shadow:
        0 0 40px rgba(255, 80, 80, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.game-over-prompt:active .game-over-prompt-content {
    transform: scale(0.98);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .game-over-prompt {
        bottom: 100px;
    }

    .game-over-prompt-content {
        padding: 12px 24px;
    }

    .game-over-prompt-title {
        font-size: 1.2rem;
    }

    .game-over-prompt-subtitle {
        font-size: 0.75rem;
    }
}
