/* =============================================
   INSTRUCTIONS MODAL
   ============================================= */

.instructions-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2100;
}

.instructions-modal.active {
    display: flex;
}

.instructions-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    padding: 30px;
    border-radius: 0;
    box-shadow: 
        0 0 0 4px #8a2be2,
        0 0 0 8px #00ffff,
        0 0 40px rgba(138, 43, 226, 0.9);
    border: 4px solid #0f0f1e;
    max-width: 500px;
    width: 90%;
}

/* Custom scrollbar for instructions */
.instructions-content::-webkit-scrollbar {
    width: 12px;
}

.instructions-content::-webkit-scrollbar-track {
    background: rgba(15, 15, 30, 0.5);
    border-left: 2px solid #8a2be2;
}

.instructions-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8a2be2, #4b0082);
    border: 2px solid #00ffff;
}

.instructions-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #9d3bff, #5b0099);
}

.instructions-content h3 {
    color: #00ffff;
    margin-bottom: 20px;
    text-align: center;
    font-size: 16px;
    font-weight: normal;
    text-shadow: 
        3px 3px 0px #0066cc,
        0 0 15px rgba(0, 255, 255, 0.8);
    letter-spacing: 2px;
}

.instructions-content h4 {
    color: #ffff00;
    font-size: 12px;
    font-weight: normal;
    text-shadow: 
        2px 2px 0px #999900,
        0 0 10px rgba(255, 255, 0, 0.6);
    letter-spacing: 1px;
    margin: 15px 0 10px 0;
}

.instructions-content p {
    color: #ffffff;
    font-size: 10px;
    line-height: 1.8;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.instructions-content ul {
    color: #ffffff;
    font-size: 10px;
    line-height: 1.8;
    margin: 10px 0;
    padding-left: 20px;
}

.instructions-content li {
    margin-bottom: 6px;
}

.instructions-content strong {
    color: #ffff00;
    text-shadow: 1px 1px 0px #999900;
}

.instructions-content button {
    background: linear-gradient(180deg, #8a2be2 0%, #4b0082 100%) !important;
    border: 4px solid #00ffff !important;
    color: #ffffff !important;
    box-shadow: 0 4px 0 #1a1a2e, 0 0 15px rgba(138, 43, 226, 0.6) !important;
    margin-top: 0;
    width: 100%;
}

.instructions-content .modal-btn-row button {
    font-size: 8px;
    padding: 8px 12px;
}

/* =============================================
   CREDITS MODAL
   ============================================= */

.credits-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2100;
}

.credits-modal.active {
    display: flex;
}

.credits-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    padding: 30px;
    border-radius: 0;
    box-shadow: 
        0 0 0 4px #8a2be2,
        0 0 0 8px #00ffff,
        0 0 40px rgba(138, 43, 226, 0.9);
    border: 4px solid #0f0f1e;
    max-width: 500px;
    width: 90%;
}

.credits-content h3 {
    color: #ff00ff;
    margin-bottom: 20px;
    text-align: center;
    font-size: 16px;
    font-weight: normal;
    text-shadow: 
        3px 3px 0px #990099,
        0 0 15px rgba(255, 0, 255, 0.8);
    letter-spacing: 2px;
}

.credits-content p {
    color: #ffffff;
    font-size: 10px;
    line-height: 1.8;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.credits-content strong {
    color: #00ffff;
    text-shadow: 1px 1px 0px #006699;
}

.credits-content .credits-subtitle {
    color: #00ff00;
    text-align: center;
    margin-top: 20px;
    font-size: 9px;
    text-shadow: 1px 1px 0px #006600;
}

.credits-content button {
    background: linear-gradient(180deg, #8a2be2 0%, #4b0082 100%) !important;
    border: 4px solid #00ffff !important;
    color: #ffffff !important;
    box-shadow: 0 4px 0 #1a1a2e, 0 0 15px rgba(138, 43, 226, 0.6) !important;
    margin-top: 0;
    width: 100%;
}

.credits-content .modal-btn-row button {
    font-size: 8px;
    padding: 8px 12px;
}

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

.game-over {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over.active {
    display: flex;
}

.game-over-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    padding: 40px;
    border-radius: 0;
    text-align: center;
    box-shadow: 
        0 0 0 4px #8a2be2,
        0 0 0 8px #ff0080,
        0 0 40px rgba(138, 43, 226, 0.9);
    border: 4px solid #0f0f1e;
    max-width: 500px;
    width: 90%;
}

.game-over h2 {
    color: #ff0080;
    font-size: 24px;
    font-weight: normal;
    margin-bottom: 20px;
    text-shadow: 
        3px 3px 0px #990050,
        0 0 20px rgba(255, 0, 128, 0.9);
    letter-spacing: 2px;
}

.game-over p {
    color: #00ffff;
    font-size: 14px;
    margin-bottom: 30px;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0px #006699;
}

/* =============================================
   IN-GAME NOTIFICATION
   ============================================= */

/* Overflow, new personal best and Gauntlet promotion all announce themselves
   here. game.js sets display, opacity, transform, transition and background
   inline — the background is what distinguishes the three — so this rule
   supplies only placement and type. */
.game-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    display: none;
    opacity: 0;
    padding: 18px 26px;
    max-width: 90vw;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    line-height: 1.6;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 2px 2px 0px #000000;
    border: 4px solid #0f0f1e;
    box-shadow:
        0 0 0 4px #00ffff,
        0 0 40px rgba(0, 0, 0, 0.85);
    /* Above the modal layer (2100): an overflow that triggers a Gauntlet
       promotion must not end up behind the modal it triggered. */
    z-index: 2200;
    pointer-events: none;
}

@media (max-width: 600px) {
    .game-notification {
        font-size: 9px;
        padding: 14px 18px;
        letter-spacing: 1px;
    }
}
