/* =================================================================
   MISSING DIGITS: GAME BOARD & UI
   Scoped to .missing-digits-page-scope
   ================================================================= */

/* Game content wrapper: flex container to tether mascot + board */
.missing-digits-page-scope .game-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 4rem;
}

/* Missing Digits: Gecko + Board flex wrapper */
.missing-digits-page-scope .md-game-flex-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 1rem;
    margin: 0 auto;
    width: 100%;
}

/* Gecko mascot inside the flex wrapper (handled by JS for specific positioning) */
.missing-digits-page-scope .md-gecko-mascot {
    max-height: 220px;
    width: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

/* Grid Toolbar: Hint (left) and Help (right) under the game grid */
.missing-digits-page-scope .md-grid-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0;
    margin-top: 12px;
}

/* Hint Button — premium glassmorphic style */
.missing-digits-page-scope .md-hint-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    /* Darker slate for light mode visibility */
    background: rgba(0, 0, 0, 0.05);
    /* Subtle dark tint for light mode */
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Dark mode override for hint button */
.dark .missing-digits-page-scope .md-hint-btn {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.missing-digits-page-scope .md-hint-btn:hover:not(:disabled) {
    background: rgba(58, 134, 255, 0.1);
    border-color: rgba(58, 134, 255, 0.4);
    color: #3b82f6;
    /* Accent color on hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 134, 255, 0.15);
}

.dark .missing-digits-page-scope .md-hint-btn:hover:not(:disabled) {
    background: rgba(58, 134, 255, 0.15);
    color: #fff;
}

.missing-digits-page-scope .md-hint-btn:disabled,
.missing-digits-page-scope .md-hint-btn.md-hint-used {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.missing-digits-page-scope .md-hint-icon {
    font-size: 1rem;
    line-height: 1;
}

.missing-digits-page-scope .md-hint-label {
    letter-spacing: 0.02em;
}

/* Help Button — accent circle */
.missing-digits-page-scope .md-help-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent, #3A86FF);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(58, 134, 255, 0.3);
}

.missing-digits-page-scope .md-help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(58, 134, 255, 0.45);
}

/* Mobile: stack vertically, hide mascot handled by Tailwind hidden class */
@media (max-width: 1279px) {
    .missing-digits-page-scope .md-game-flex-wrapper {
        flex-direction: column;
        align-items: center;
    }
}

/* Missing Digits: wider ENTER/DELETE keys on desktop */
@media (min-width: 640px) {
    .missing-digits-page-scope .wide-key {
        width: 6rem !important;
    }
}

/* =================================================================
   MISSING DIGITS: DESKTOP GAME BOARD & KEYBOARD SCALING
   ================================================================= */
@media (min-width: 768px) {

    /* Expand the game board container from max-w-sm (384px) to ~460px */
    .missing-digits-page-scope .md-game-flex-wrapper .flex.flex-col.items-center.w-full.max-w-sm,
    .missing-digits-page-scope .md-game-flex-wrapper>div.flex.flex-col {
        max-width: 420px !important;
    }

    /* Scale up grid cells: larger size + font */
    .missing-digits-page-scope .md-game-flex-wrapper .grid>div {
        font-size: 1.5rem !important;
        min-height: 52px;
    }

    /* Increase grid gap */
    .missing-digits-page-scope .md-game-flex-wrapper .grid {
        gap: 0.375rem !important;
        max-width: 380px !important;
        margin: 0 auto !important;
    }

    /* Scale up keyboard keys */
    .missing-digits-page-scope .md-game-flex-wrapper #keyboard-container .key {
        min-width: 52px !important;
        min-height: 52px !important;
        height: 3.5rem !important;
        font-size: 1.1rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    /* Scale up wide keys (ENTER / Delete) */
    .missing-digits-page-scope .md-game-flex-wrapper #keyboard-container .key.wide-key,
    .missing-digits-page-scope .md-game-flex-wrapper #keyboard-container .key.w-16 {
        min-width: 76px !important;
        width: 6.5rem !important;
        font-size: 0.95rem !important;
    }

    /* Scale keyboard row gaps */
    .missing-digits-page-scope .md-game-flex-wrapper #keyboard-container .flex {
        gap: 0.375rem !important;
    }

    /* Scale up the answer/hint bar */
    .missing-digits-page-scope .md-game-flex-wrapper .max-w-md {
        max-width: 460px !important;
    }

    /* Ensure game area wrapper expands naturally - no clipping */
    .missing-digits-page-scope.relative,
    .missing-digits-page-scope #game-area,
    .missing-digits-page-scope #game-area>* {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }

    .missing-digits-page-scope .game-content-wrapper,
    .missing-digits-page-scope .md-game-flex-wrapper {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }

    .missing-digits-page-scope #game-content-area,
    .missing-digits-page-scope #game-content-area>* {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }

    /* Buffer below keyboard to prevent bottom-row clipping */
    .missing-digits-page-scope #keyboard-container {
        margin-bottom: 3rem !important;
    }
}