/* css/dezamorsarea.css */
.dezamorsarea-body {
    background: radial-gradient(circle at center, #2c3e50 0%, #1a252f 100%);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-theme.dezamorsarea-body {
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
}

.dezamorsarea-wrapper {
    position: relative;
    z-index: 5;
    padding-top: 130px;
}

.dezamorsarea-wrapper .glass-panel {
    background: rgba(13, 21, 29, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

body.dark-theme .dezamorsarea-wrapper .glass-panel {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(255, 0, 0, 0.1);
}

.game-terminal {
    background-color: #0c0c0c !important;
    border: 2px solid #333;
    min-height: 250px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

#game-output {
    color: #00ff00 !important;
    text-shadow: 0 0 5px rgba(0,255,0,0.5);
}

.dezamorsarea-wrapper .text-white {
    color: #f8f9fa !important;
}

.dezamorsarea-wrapper .text-white-50 {
    color: rgba(248, 249, 250, 0.5) !important;
}

/* ── Difficulty Selector ── */
.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.difficulty-selector .btn {
    min-width: 110px;
    font-weight: 700;
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.difficulty-selector .btn:hover {
    transform: scale(1.05);
}

.difficulty-selector .btn.active {
    transform: scale(1.08);
    box-shadow: 0 0 16px rgba(255,255,255,0.25);
}

.btn-easy {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border: none;
    color: #fff;
}

.btn-easy:hover, .btn-easy.active {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
}

.btn-medium {
    background: linear-gradient(135deg, #e67e22, #f39c12);
    border: none;
    color: #fff;
}

.btn-medium:hover, .btn-medium.active {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
}

.btn-hard {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    border: none;
    color: #fff;
}

.btn-hard:hover, .btn-hard.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

/* ── Timer ── */
.timer-display {
    display: none;
    font-family: 'Fira Code', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: #e74c3c;
    text-shadow: 0 0 12px rgba(231, 76, 60, 0.7);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.timer-display.active {
    display: block;
}

.timer-display.timer-pulse {
    animation: timerPulseGong 0.5s ease-out;
}

.timer-display.timer-critical {
    color: #ff0000;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.9);
}

@keyframes timerPulseGong {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; text-shadow: 0 0 25px rgba(231, 76, 60, 1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Game Animations ── */
.bomb-explode {
    animation: explodeShake 0.6s cubic-bezier(.36,.07,.19,.97) both, flashRed 0.6s ease-out forwards;
}

@keyframes explodeShake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-8px, 0, 0); }
    40%, 60% { transform: translate3d(8px, 0, 0); }
}

@keyframes flashRed {
    0% { background: rgba(13, 21, 29, 0.7); }
    20% { background: rgba(255, 0, 0, 0.4); }
    100% { background: rgba(13, 21, 29, 0.9); border-color: #ff0000; box-shadow: 0 0 50px rgba(255, 0, 0, 0.3); }
}

/* ── Mobile Responsive ── */
@media (max-width: 576px) {
    .dezamorsarea-wrapper {
        padding-top: 90px;
    }

    .dezamorsarea-wrapper .glass-panel {
        padding: 1rem !important;
        border-radius: 10px;
    }

    .dezamorsarea-wrapper h1.display-4 {
        font-size: 1.5rem;
    }

    .dezamorsarea-wrapper .lead {
        font-size: 0.85rem;
    }

    .game-terminal {
        padding: 0.75rem !important;
        min-height: 200px;
    }

    #game-output {
        font-size: 0.68rem !important;
        line-height: 1.4 !important;
        white-space: pre-wrap; /* Default for medium mobile */
    }

    /* Ultra Mobile Fix (≤ 360px phones) */
    @media (max-width: 360px) {
        #game-output {
            font-size: 0.58rem !important;
            white-space: pre !important; /* Force single line */
            overflow-x: auto;
        }
    }

    #input-area {
        flex-direction: column;
        align-items: center;
    }

    #input-area .form-control {
        width: 60px !important;
        font-size: 1.2rem !important;
    }

    #input-area .btn {
        width: 100%;
        font-size: 0.95rem;
    }

    .difficulty-selector .btn {
        min-width: 90px;
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }

    .timer-display {
        font-size: 1.4rem;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .dezamorsarea-wrapper {
        padding-top: 110px;
    }

    #game-output {
        font-size: 0.85rem !important;
    }
}

/* ── Modal & Login Refinements ── */
.divider-custom.small {
    margin: 1rem auto !important;
}

.divider-custom.small .divider-custom-line {
    height: 1px !important;
    max-width: 4rem !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.divider-custom.small span {
    font-size: 0.7rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    padding: 0 0.75rem;
    letter-spacing: 1px;
}

#g_id_signin_modal {
    min-height: 40px;
    transition: opacity 0.3s ease;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1) !important;
    color: #ffc107 !important;
    border: 1px solid rgba(255, 193, 7, 0.2) !important;
}
