/* ==============================================
   Flash - Memory Speed Styles
============================================== */

.flash-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    user-select: none;
}

/* The Main Display Area */
.flash-display-box {
    width: 100%;
    height: 180px;
    background: #0d1117;
    border: 4px solid #30363d;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

.flash-number {
    font-size: 5rem;
    color: #58a6ff;
    font-family: 'Press Start 2P', cursive;
    text-shadow: 0 0 20px rgba(88, 166, 255, 0.5);
}

/* User Input Field */
.flash-input-preview {
    letter-spacing: 0.5rem;
    color: #c9d1d9;
    font-size: 1.5rem;
    min-height: 2.5rem;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px dashed #30363d;
}

/* Keypad Grid */
.flash-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
}

.f-key {
    background: #161b22;
    border: 2px solid #30363d;
    color: #c9d1d9;
    padding: 20px;
    font-size: 1.2rem;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.f-key:active {
    background: #30363d;
    transform: scale(0.95);
    border-color: #58a6ff;
}

.f-key.special {
    background: #21262d;
    color: #f85149;
    font-size: 0.8rem;
}

.f-key.confirm {
    background: #238636;
    color: #fff;
    font-size: 0.8rem;
    grid-column: span 2;
}

/* UI Feedback */
.flash-status {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: #8b949e;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.level-badge {
    padding: 4px 8px;
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    border: 1px solid #58a6ff;
    border-radius: 4px;
}

/* Modals - Fixed and Overlaying everything */
.q-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Ensure it's above the arcade UI */
}

.q-modal-content {
    background-color: #0d1117;
    border: 3px solid #58a6ff;
    padding: 3rem 2rem;
    max-width: 440px;
    width: 90%;
    text-align: center;
    border-radius: 16px;
    box-shadow: 0 0 50px rgba(88, 166, 255, 0.2);
}

.q-modal-content.game-over {
    border-color: #f85149;
    box-shadow: 0 0 50px rgba(248, 81, 73, 0.2);
}

/* Animations */
@keyframes flash-in {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.animate-flash {
    animation: flash-in 0.1s ease-out;
}

.hidden { display: none !important; }