.game-ui {
    /* PASS4FL Dashboard Color Palette */
    --theme-blue: #193fb6;
    --theme-blue-hover: #143291;
    --theme-blue-light: #e8ecf8;
    --theme-orange: #f5a623;
    --theme-green: #10b981;
    --theme-red: #ef4444;
    --theme-red-light: #fee2e2;
    --theme-purple: #8b5cf6;
    --theme-purple-light: #f3e8ff;
    --theme-bg: #f8f9fa;
    --theme-card-bg: #ffffff;
    --theme-border: #e5e7eb;
    --theme-border-dark: #d1d5db;
    --theme-text-main: #111827;
    --theme-text-muted: #6b7280;
    
    --match-color: #d1fae5;
    --mismatch-color: #fee2e2;
}

 .game-ui {
            --primary-blue: #5b6fb4;
            --light-blue: #a3c2e0;
            --root-yellow: #fcd776;
            --nerve-green: #82c372;
            --text-dark: #2c3e50;
            --bg-offwhite: #fafbfe;
            --wrong-red: #e74c3c;
        }



/* Rely on app-level global styles (styles.css) for body/reset in embedded mode. */

/* Headers */
:where(.game-ui) header { width: 100%; max-width: 800px; margin-bottom: 20px; }
:where(.game-ui) .dashboard-header { max-width: 1100px; margin-bottom: 40px; margin-top: 20px; display: flex; justify-content: space-between; align-items: center; }
:where(.game-ui) .header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; width: 100%; gap: 15px; }
:where(.game-ui) h1 { font-size: 2.2rem; font-weight: 900; letter-spacing: -0.5px; margin-bottom: 0; line-height: 1.2; }
:where(.game-ui) .dashboard-header h1 { font-size: 2.8rem; margin-bottom: 10px; }
:where(.game-ui) .subtitle { font-size: 1.2rem; font-weight: 700; color: var(--theme-text-muted); }

/* Common UI Elements */
:where(.game-ui) .stats-container, :where(.game-ui) .prompt-container, :where(.game-ui) .modal, :where(.game-ui) .study-modal, :where(.game-ui) .mnemonic-box, :where(.game-ui) .nerve-card {
    background-color: var(--theme-card-bg); border: 1px solid var(--theme-border); border-radius: 16px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
:where(.game-ui) .stats-container { display: flex; justify-content: space-between; align-items: center; padding: 15px 25px; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
:where(.game-ui) .stat-box { font-size: 0.9rem; font-weight: 800; color: var(--theme-text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
:where(.game-ui) .stat-value { color: var(--theme-text-main); font-size: 1.4rem; margin-left: 5px; }
:where(.game-ui) .button-group { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* Buttons */
:where(.game-ui) button { background-color: var(--theme-blue); color: white; border: none; padding: 12px 24px; border-radius: 8px; font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 4px 6px rgba(25, 63, 182, 0.2); outline: none; }
:where(.game-ui) button:hover:not(:disabled) { background-color: var(--theme-blue-hover); transform: translateY(-1px); box-shadow: 0 6px 8px rgba(25, 63, 182, 0.3); }
:where(.game-ui) button:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 2px 3px rgba(25, 63, 182, 0.2); }
:where(.game-ui) button.btn-secondary { background-color: white; color: var(--theme-blue); border: 1px solid var(--theme-border-dark); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); }
:where(.game-ui) button.btn-secondary:hover { background-color: var(--theme-bg); border-color: var(--theme-blue); }

/* Study Sheet Button & Modal */
:where(.game-ui) .study-btn {
    background-color: var(--light-blue, var(--theme-blue-light));
    color: var(--text-dark, var(--theme-text-main));
    border: 2px solid var(--primary-blue);
    box-shadow: 0 4px 0 var(--primary-blue, var(--theme-blue));
    margin-bottom: 25px;
    font-size: 1.1em;
    padding: 8px 16px;
}

:where(.game-ui) button.study-btn:hover:not(:disabled) {
    background-color: var(--light-blue, var(--theme-blue-light));
    color: var(--theme-text-main);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--primary-blue, var(--theme-blue));
}

/* Back button variant */
:where(.game-ui) .back-btn {
    background-color: #fde68a;
    color: var(--text-dark, var(--theme-text-main));
    border: 2px solid var(--theme-orange);
    box-shadow: 0 4px 0 #d97706;
    margin-bottom: 25px;
    font-size: 1.1em;
    padding: 8px 16px;
}

:where(.game-ui) button.back-btn:hover:not(:disabled) {
    background-color: #fde68a;
    color: var(--theme-text-main);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #d97706;
}

/* Shared answer-card button style for quiz-like option grids */
:where(.game-ui) .option-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    padding: 15px;
    background-color: #fff;
    color: var(--text-dark, var(--theme-text-main));
    border: 3px solid var(--primary-blue, var(--theme-blue));
    border-radius: 12px;
    box-shadow: 0 4px 0 var(--primary-blue, var(--theme-blue));
    cursor: pointer;
    font-family: "Nunito", sans-serif;
    font-size: 1.1em;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

:where(.game-ui) .option-card-btn:hover:not(:disabled) {
    background-color: var(--bg-offwhite, var(--theme-bg));
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--primary-blue, var(--theme-blue));
}

:where(.game-ui) .option-card-btn:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--primary-blue, var(--theme-blue));
}

:where(.game-ui) .option-card-btn:disabled {
    background-color: #f9f9f9;
    color: #999;
    border-color: #ccc;
    box-shadow: 0 4px 0 #ccc;
    cursor: not-allowed;
}

/* --- DASHBOARD STYLES --- */
:where(.game-ui) .dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; width: 100%; max-width: 1100px; }
:where(.game-ui) .game-card { background-color: var(--theme-card-bg); border: 1px solid var(--theme-border); border-radius: 16px; padding: 30px; display: flex; flex-direction: column; transition: all 0.3s ease; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02); text-decoration: none; position: relative; overflow: hidden; }
:where(.game-ui) .game-card:hover { transform: translateY(-5px); box-shadow: 0 12px 20px rgba(25, 63, 182, 0.08); border-color: var(--theme-blue-light); }
:where(.game-ui) .dashboard-style-card {
    background-color: #ffffff;
    border: 4px solid #e2e8f0;
    border-radius: 2rem;
    box-shadow: 0px 8px 0px #cbd5e1;
    padding: 1.5rem;
}
@media (min-width: 768px) {
    :where(.game-ui) .dashboard-style-card { padding: 2rem; }
}
:where(.game-ui) .no-hover-card:hover {
    transform: none;
    box-shadow: 0px 8px 0px #cbd5e1;
    border-color: #e2e8f0;
}
:where(.game-ui) .dash-card-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
:where(.game-ui) .dash-card-icon { width: 60px; height: 60px; background-color: var(--theme-blue-light); color: var(--theme-blue); border-radius: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
:where(.game-ui) .dash-card-title { font-size: 1.4rem; font-weight: 900; color: var(--theme-text-main); line-height: 1.2; }
:where(.game-ui) .dash-card-badge { display: inline-block; background-color: var(--theme-bg); color: var(--theme-text-muted); padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 15px; border: 1px solid var(--theme-border); align-self: flex-start; }
:where(.game-ui) .dash-card-description { font-size: 1rem; font-weight: 600; color: var(--theme-text-muted); line-height: 1.5; margin-bottom: 30px; flex-grow: 1; }
:where(.game-ui) .btn-play { background-color: var(--theme-blue); color: white; border: none; padding: 14px 24px; border-radius: 8px; font-size: 1.1rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 4px 6px rgba(25, 63, 182, 0.2); text-align: center; display: flex; justify-content: center; align-items: center; gap: 10px; width: 100%; outline: none; }
:where(.game-ui) .game-card:hover .btn-play { background-color: var(--theme-blue-hover); }

/* --- MATCH GAME STYLES --- */
:where(.game-ui) .game-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; width: 100%; max-width: 800px; perspective: 1000px; }
:where(.game-ui) .card {
    perspective: 1000px;
    aspect-ratio: 1 / 1;
    cursor: pointer;
}

:where(.game-ui) .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

:where(.game-ui) .card.flipped .card-inner,
:where(.game-ui) .card.matched-permanently .card-inner {
    transform: rotateY(180deg);
}

:where(.game-ui) .card-front, :where(.game-ui) .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10px;
    border: 3px solid var(--primary-blue);
    font-family: 'Nunito', sans-serif;
}

/* Card Front (Unflipped) */
:where(.game-ui) .card-front {
    background-color: var(--light-blue);
    color: white;
    box-shadow: 0 4px 0 var(--primary-blue);
}

/* Card Back (Flipped) */
:where(.game-ui) .card-back {
    background-color: white;
    color: var(--text-dark);
    transform: rotateY(180deg);
    box-shadow: 0 4px 0 var(--primary-blue);
    font-weight: 800;
    font-size: 1.1em;
}
:where(.game-ui) .card-visuals { display: flex; gap: 8px; justify-content: center; align-items: center; width: 100%; }
:where(.game-ui) .card-icon { display: flex; align-items: center; justify-content: center; width: 50%; aspect-ratio: 1 / 1; min-width: 45px; max-width: 100px; background-color: var(--theme-bg); color: var(--theme-blue); border-radius: 50%; border: 1px solid var(--theme-border); flex-shrink: 1; }
:where(.game-ui) .card-icon svg, :where(.game-ui) .card-icon img { width: 85%; height: 85%; object-fit: contain; }
:where(.game-ui) .badge-group {
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

/* Shared badge language for root labels and cranial nerve number chips */
:where(.game-ui) .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--root-yellow);
    color: #000;
    border: 2px solid #000;
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
    font-weight: 900;
}

:where(.game-ui) .badge-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 0.9em;
    line-height: 1;
}

:where(.game-ui) .badge-pill {
    min-height: 38px;
    padding: 5px 15px;
    border-radius: 20px;
    line-height: 1.1;
}

:where(.game-ui) .badge-uppercase {
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
:where(.game-ui) .card-text-name { font-size: 1.4rem; font-weight: 800; color: var(--theme-text-main); }
:where(.game-ui) .card-text-name {
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.2;
    width: 100%;
}

/* Match & Mismatch States */
:where(.game-ui) .card-back.match {
    background-color: var(--nerve-green);
    color: white;
    border-color: #5a9e49;
    box-shadow: 0 4px 0 #5a9e49;
}
:where(.game-ui) .card-back.match .card-text-name {
    color: white;
}

:where(.game-ui) .card-back.match .badge,
:where(.game-ui) .card-back.mismatch .badge {
    color: #000;
}

:where(.game-ui) .card-back.mismatch {
    background-color: var(--wrong-red);
    color: white;
    border-color: #c0392b;
    box-shadow: 0 4px 0 #c0392b;
    animation: shake-mismatch 0.4s ease;
}
:where(.game-ui) .card-back.mismatch .card-text-name {
    color: white;
}

/* Function Match layout: icon above function text */
:where(.game-ui).icon-text-game .card-back, :where(.game-ui) .icon-text-game .card-back {
    flex-direction: column;
    gap: 10px;
}

/* --- CATEGORIZER STYLES --- */
:where(.game-ui) .prompt-container { width: 100%; max-width: 900px; margin-bottom: 24px; padding: 24px; text-align: left; }
:where(.game-ui) .prompt-badge { display: inline-block; background-color: var(--theme-blue-light); color: var(--theme-blue); padding: 4px 12px; border-radius: 9999px; font-size: 0.75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
:where(.game-ui) .prompt-title { font-size: 1.6rem; font-weight: 900; color: var(--theme-text-main); margin-bottom: 20px; }
:where(.game-ui) .progress-header { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 800; color: var(--theme-text-muted); text-transform: uppercase; margin-bottom: 8px; letter-spacing: 0.5px; }
:where(.game-ui) .progress-track { width: 100%; height: 12px; background-color: var(--theme-border); border-radius: 6px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,0.05); }
:where(.game-ui) .progress-fill { height: 100%; background-color: var(--theme-green); width: 0%; transition: width 0.4s ease, background-color 0.4s ease; border-radius: 6px; }
:where(.game-ui) .categorizer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; width: 100%; max-width: 900px; margin-bottom: 30px; }
:where(.game-ui) .nerve-card-btn { flex-direction: column; gap: 10px; position: relative; width: 100%; }
:where(.game-ui) .nerve-card-btn:hover:not(.completed) { border-color: var(--primary-blue, var(--theme-blue)); }
:where(.game-ui) .nerve-card-btn.selected { border: 2px solid var(--theme-blue); background-color: #d7e2f6; transform: scale(1.02); }
:where(.game-ui) .nerve-card-btn.correct { border: 2px solid var(--theme-green); background-color: #d1fae5; transform: scale(1.04); z-index: 10; }
:where(.game-ui) .nerve-card-btn.incorrect { border: 2px solid var(--theme-red); background-color: var(--theme-red-light); animation: shake 0.4s ease-in-out; }
:where(.game-ui) .nerve-card-btn.completed { opacity: 0.4; filter: grayscale(100%); pointer-events: none; border-color: var(--theme-border); background-color: var(--theme-bg); box-shadow: none; }
:where(.game-ui) .icon-row { display: flex; gap: 8px; align-items: center; justify-content: center; min-height: 42px; }
:where(.game-ui) .icon-row > div { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; color: var(--theme-blue); }
:where(.game-ui) .icon-row svg, :where(.game-ui) .icon-row img { width: 28px; height: 28px; object-fit: contain; }
:where(.game-ui) .card-name { font-size: 0.95rem; font-weight: 800; color: var(--theme-text-main); text-align: center; line-height: 1.2; }
/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

@keyframes shake-mismatch {
    0%, 100% { transform: rotateY(180deg) translateX(0); }
    25% { transform: rotateY(180deg) translateX(-5px); }
    50% { transform: rotateY(180deg) translateX(5px); }
    75% { transform: rotateY(180deg) translateX(-5px); }
}
:where(.game-ui) .submit-btn-container { width: 100%; max-width: 900px; display: flex; justify-content: flex-start; margin-bottom: 40px; }
:where(.game-ui) .btn-submit { background-color: var(--theme-border); color: var(--theme-text-muted); box-shadow: none; padding: 16px 32px; font-size: 1.1rem; pointer-events: none; border-radius: 8px; transition: all 0.3s ease; }
:where(.game-ui) .btn-submit.active { background-color: var(--theme-blue); color: white; pointer-events: all; box-shadow: 0 4px 6px rgba(25, 63, 182, 0.2); }
:where(.game-ui) .btn-submit.active:hover { background-color: var(--theme-blue-hover); }

/* --- MODALS & STUDY SHEET --- */
:where(.game-ui) .overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(17, 24, 39, 0.4); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; visibility: hidden; opacity: 0; transition: opacity 0.3s ease, visibility 0.3s; }
:where(.game-ui) .overlay.active { visibility: visible; opacity: 1; }
:where(.game-ui) .modal { padding: 40px; text-align: center; max-width: 90%; width: 450px; transform: translateY(20px); transition: transform 0.3s ease; }
:where(.game-ui) .overlay.active .modal { transform: translateY(0); }
:where(.game-ui) .modal h2 { color: var(--theme-text-main); margin-bottom: 15px; font-size: 2rem; font-weight: 900; }
:where(.game-ui) .modal p { font-size: 1.1rem; font-weight: 600; color: var(--theme-text-muted); margin-bottom: 25px; line-height: 1.5; }
:where(.game-ui) .modal button.btn-primary { width: 100%; }

:where(.game-ui) .study-modal { width: 800px; max-height: 90vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
:where(.game-ui) .study-header { padding: 20px 30px; border-bottom: 1px solid var(--theme-border); display: flex; justify-content: space-between; align-items: center; background-color: var(--theme-bg); border-radius: 16px 16px 0 0; }
:where(.game-ui) .study-header h2 { margin: 0; color: var(--theme-text-main); font-size: 1.4rem; font-weight: 800; }
:where(.game-ui) .study-content { padding: 30px; overflow-y: auto; text-align: left; }
:where(.game-ui) .mnemonic-box { background-color: var(--theme-blue-light); border: 1px solid rgba(25, 63, 182, 0.2); padding: 20px; margin-bottom: 25px; }
:where(.game-ui) .mnemonic-box h3 { color: var(--theme-blue); margin-bottom: 5px; font-weight: 900; font-size: 1.1rem; }
:where(.game-ui) .mnemonic-box p { color: var(--theme-text-main); font-weight: 700; font-style: italic; }
:where(.game-ui) .nerve-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 15px; }
:where(.game-ui) .nerve-card { padding: 20px; }
:where(.game-ui) .nerve-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
:where(.game-ui) .nerve-title span.roman { color: var(--theme-text-muted); font-weight: 800; margin-right: 8px; font-size: 1.1rem; }
:where(.game-ui) .nerve-title span.name { font-weight: 900; font-size: 1.2rem; color: var(--theme-text-main); }
:where(.game-ui) .nerve-badge { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; border: 1px solid transparent; }
:where(.game-ui) .badge-Sensory { background: var(--theme-blue-light); color: var(--theme-blue); border-color: rgba(25,63,182,0.1); }
:where(.game-ui) .badge-Motor { background: var(--theme-red-light); color: var(--theme-red); border-color: rgba(239,68,68,0.2); }
:where(.game-ui) .badge-Both { background: var(--theme-purple-light); color: var(--theme-purple); border-color: rgba(139,92,246,0.2); }
:where(.game-ui) .nerve-visuals { display: flex; gap: 10px; margin-bottom: 12px; }
:where(.game-ui) .nerve-icon-wrapper { display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; background-color: var(--theme-bg); color: var(--theme-blue); border-radius: 50%; border: 1px solid var(--theme-border); }
:where(.game-ui) .nerve-icon-wrapper svg, :where(.game-ui) .nerve-icon-wrapper img { width: 28px; height: 28px; object-fit: contain; }
:where(.game-ui) .nerve-func { font-weight: 600; color: var(--theme-text-muted); font-size: 0.95rem; line-height: 1.4; }

/* Responsive adjustments */
@media (max-width: 600px) {
    :where(.game-ui) .dashboard-header { flex-direction: column; text-align: center; gap: 15px; }
    :where(.game-ui) .header-left { text-align: center; }
    :where(.game-ui) .header-top { flex-direction: column; text-align: center; }
    :where(.game-ui) h1 { font-size: 1.8rem; }
    :where(.game-ui) .dashboard-header h1 { font-size: 2.2rem; }
    :where(.game-ui) .dashboard-grid { grid-template-columns: 1fr; }
    :where(.game-ui) .game-board { grid-template-columns: repeat(2, 1fr); }
    :where(.game-ui) .categorizer-grid { grid-template-columns: repeat(2, 1fr); }
    :where(.game-ui) .stats-container { justify-content: center; flex-direction: column; gap: 15px; }
    :where(.game-ui) .button-group { width: 100%; flex-direction: column; }
    :where(.game-ui) .game-stats-container .game-header-actions { order: -1; }
    :where(.game-ui) .game-stats-container .game-stats-summary { justify-content: center; }
    :where(.game-ui) .submit-btn-container { justify-content: center; }
    :where(.game-ui) .btn-submit { width: 100%; }
    :where(.game-ui) .card-text-name {
        font-size: 0.9em !important;
    }
    :where(.game-ui) .badge-uppercase {
        font-size: 1.1em !important;
    }
    :where(.game-ui) .card-back {
        padding: 5px !important;
    }

    /* Function Match mobile overflow fixes */
    :where(.game-ui).icon-text-game .game-board, :where(.game-ui) .icon-text-game .game-board { gap: 12px; }
    :where(.game-ui).icon-text-game .card-front, 
    :where(.game-ui) .icon-text-game .card-front, 
    :where(.game-ui).icon-text-game .card-back, 
    :where(.game-ui) .icon-text-game .card-back { padding: 10px; }
    :where(.game-ui).icon-text-game .card-back, :where(.game-ui) .icon-text-game .card-back { gap: 8px; font-size: 0.85rem; line-height: 1.2; overflow: hidden; }
    :where(.game-ui).icon-text-game .card-back > :last-child, :where(.game-ui) .icon-text-game .card-back > :last-child {
        font-size: 0.78rem;
        line-height: 1.2;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
        text-align: center;
    }
    :where(.game-ui).icon-text-game .card-visuals, :where(.game-ui) .icon-text-game .card-visuals { gap: 6px; flex-wrap: wrap; }
    :where(.game-ui).icon-text-game .card-icon, :where(.game-ui) .icon-text-game .card-icon {
        width: 40%;
        max-width: 40%;
        min-width: 0;
        aspect-ratio: 1 / 1;
        flex: 0 0 40%;
    }
    :where(.game-ui).icon-text-game .card-icon svg,
    :where(.game-ui) .icon-text-game .card-icon svg,
    :where(.game-ui).icon-text-game .card-icon img,
    :where(.game-ui) .icon-text-game .card-icon img { width: 90%; height: 90%; }
}




/* Semantic flip-card buttons keep the shared card presentation. */
:where(.game-ui) button.card { display: block; background: transparent; border: 0; box-shadow: none; padding: 0; text-transform: none; letter-spacing: normal; color: inherit; font: inherit; }
:where(.game-ui) button.card:hover:not(:disabled), :where(.game-ui) button.card:active:not(:disabled) { transform: none; background: transparent; box-shadow: none; }
:where(.game-ui) .card-inner { display: block; }
:where(.game-ui) button:focus-visible, :where(.game-ui) [role="button"]:focus-visible { outline: 3px solid var(--theme-orange); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { :where(.game-ui) *, :where(.game-ui) *::before, :where(.game-ui) *::after { animation: none !important; transition: none !important; } }

/* Shared catalog cards remain native buttons for keyboard and touch access. */
:where(.game-ui) .catalog-game-card { text-align:left; width:100%; cursor:pointer; font:inherit; text-transform:none; }
:where(.game-ui) .catalog-game-card .btn-primary { display:flex; background:var(--theme-blue); color:white; min-height:44px; padding:12px 16px; border-radius:12px; font-weight:700; }
:where(.game-ui) .catalog-game-card:focus-visible { outline:3px solid var(--theme-blue); outline-offset:4px; }
:where(.game-ui) .categorizer-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
:where(.game-ui) .nerve-card-btn { min-width:0; width:100%; text-transform:none; overflow-wrap:anywhere; }
:where(.game-ui) .nerve-card-btn:focus-visible { outline:3px solid var(--theme-blue); outline-offset:3px; }
@media(max-width:430px){:where(.game-ui) .nerve-card-btn { padding:12px 6px; }:where(.game-ui) .nerve-card-btn .badge { max-width:100%; }:where(.game-ui) .nerve-card-btn .card-name { font-size:14px; }}
@media(min-width:768px){:where(.game-ui) .categorizer-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }}
