/**
 * MINDS - Public Games Multiplayer Stylesheet
 */

.pg-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100060;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 24px 12px;
    box-sizing: border-box;
}

.pg-modal-box {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    width: 100%;
    max-width: 500px;
    margin: auto 0;
    max-height: none;
    overflow: visible;
    padding: 1.5rem 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
    animation: pgPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    color: #f8fafc;
    position: relative;
    box-sizing: border-box;
}

@keyframes pgPopIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.pg-role-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.pg-role-option {
    background: rgba(15, 23, 42, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.pg-role-option.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

.pg-avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.pg-avatar-choice {
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-size: 1.8rem;
    padding: 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pg-avatar-choice:hover {
    transform: scale(1.1);
    border-color: #818cf8;
}

.pg-avatar-choice.active {
    background: rgba(99, 102, 241, 0.25);
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.5);
    transform: scale(1.05);
}

/* Lobby View */
.pg-lobby-view {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background: rgba(11, 15, 25, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 999990;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 20px 12px;
    box-sizing: border-box;
}

.pg-lobby-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    width: 100%;
    max-width: 680px;
    margin: auto 0;
    max-height: none;
    overflow: visible;
    padding: 1.75rem 1.25rem;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.85);
    box-sizing: border-box;
}

.pg-code-banner {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
    border: 2px dashed rgba(99, 102, 241, 0.4);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
}

.pg-big-code {
    font-family: 'Space Grotesk', monospace;
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #f59e0b;
    text-shadow: 0 0 25px rgba(245, 158, 11, 0.35);
}

.pg-participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.25rem;
}

.pg-player-chip {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.6rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.pg-player-chip.me {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.15);
}

.pg-player-avatar {
    font-size: 1.4rem;
}

.pg-player-name {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* In-game HUD */
.pg-game-hud {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 100060 !important;
    max-width: 250px;
    width: 100%;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pg-game-hud.minimized {
    max-width: fit-content !important;
    width: auto !important;
}

.pg-hud-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: rgba(15, 23, 42, 0.94);
    border: 1.5px solid rgba(245, 158, 11, 0.6);
    border-radius: 9999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    font-size: 0.78rem;
    font-weight: 700;
    color: #ffffff;
    user-select: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pg-hud-pill:hover {
    transform: translateY(-1px) scale(1.04);
    border-color: #f59e0b;
    box-shadow: 0 6px 22px rgba(245, 158, 11, 0.3);
}

.pg-hud-pill:active {
    transform: scale(0.97);
}

.pg-hud-pill-icon {
    font-size: 0.92rem;
}

.pg-hud-pill-code {
    color: #fbbf24;
    letter-spacing: 0.5px;
    font-weight: 800;
}

.pg-hud-pill-badge {
    background: rgba(239, 68, 68, 0.88);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.2px;
}

@media (max-width: 768px) {
    .pg-game-hud {
        position: fixed;
        top: 8px;
        right: 8px;
        max-width: 175px;
        z-index: 100060 !important;
    }
    .pg-hud-panel {
        padding: 0.5rem;
        border-radius: 12px;
    }
    .pg-hud-leaderboard {
        max-height: 120px;
    }
    .pg-hud-row {
        font-size: 0.7rem;
        padding: 0.2rem 0.35rem;
    }
    .pg-hud-pill {
        padding: 4px 10px;
        font-size: 0.72rem;
        gap: 5px;
    }
}

.pg-hud-panel {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.pg-hud-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 180px;
    overflow-y: auto;
}

.pg-hud-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.78rem;
    color: #f8fafc;
}

.pg-hud-row.current-user {
    background: rgba(99, 102, 241, 0.25);
    border: 1px solid rgba(99, 102, 241, 0.5);
}

.pg-hud-row.eliminated {
    opacity: 0.4;
    text-decoration: line-through;
}

.pg-hud-rank {
    font-weight: 800;
    color: #f59e0b;
    font-size: 0.72rem;
    min-width: 18px;
}

.pg-hud-avatar {
    font-size: 1rem;
}

.pg-hud-nick {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.pg-hud-score {
    font-weight: 800;
    color: #38bdf8;
}

/* Spectator View */
.pg-spectator-view {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #0b0f19;
    z-index: 999995;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 0.75rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pg-spectator-card {
    width: 100%;
    max-width: 1100px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.8);
}

.pg-spec-ranking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    max-height: 480px;
    overflow-y: auto;
}

.pg-spec-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s;
}

.pg-spec-card.alive {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(34, 197, 94, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.pg-spec-card.eliminated {
    opacity: 0.45;
    filter: grayscale(0.8);
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.2);
}

.pg-spec-rank {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f59e0b;
    min-width: 32px;
}

.pg-spec-card-avatar {
    font-size: 2.2rem;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.pg-spec-pin-pill {
    background: rgba(245, 158, 11, 0.12);
    border: 1.5px dashed #f59e0b;
    border-radius: 999px;
    padding: 4px 16px;
    display: inline-flex;
    align-items: center;
}

.pg-live-beacon {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pgPulseLive 1.8s infinite;
    vertical-align: middle;
}

@keyframes pgPulseLive {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.pg-metric-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.pg-metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 158, 11, 0.3) !important;
}

.pg-spec-podium-wrap {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 1.5rem 1rem 0 1rem;
}

.pg-podium-avatar-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 6px;
    position: relative;
    box-shadow: 0 8px 18px rgba(0,0,0,0.5);
    animation: pgFloatBubble 3s ease-in-out infinite;
}

.pg-podium-avatar-bubble.gold {
    width: 76px;
    height: 76px;
    font-size: 2.2rem;
    background: linear-gradient(135deg, #f59e0b, #b45309);
    border: 3px solid #fde68a;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.5);
}

.pg-podium-avatar-bubble.silver {
    background: linear-gradient(135deg, #94a3b8, #475569);
    border: 2.5px solid #e2e8f0;
    box-shadow: 0 0 15px rgba(148, 163, 184, 0.4);
    animation-delay: 0.5s;
}

.pg-podium-avatar-bubble.bronze {
    background: linear-gradient(135deg, #b45309, #78350f);
    border: 2px solid #fdba74;
    box-shadow: 0 0 15px rgba(180, 83, 9, 0.3);
    animation-delay: 1s;
}

@keyframes pgFloatBubble {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.pg-flame-streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, #ea580c, #dc2626);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(234, 88, 12, 0.6);
    animation: pgBurnFlame 1.2s infinite alternate;
}

@keyframes pgBurnFlame {
    0% { transform: scale(1); filter: drop-shadow(0 0 4px #f97316); }
    100% { transform: scale(1.06); filter: drop-shadow(0 0 8px #ef4444); }
}

/* Victory Podium */
.pg-podium-step {
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #ffffff;
}

.pg-podium-step.step-1 {
    height: 120px;
    background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
    font-size: 1.3rem;
}

.pg-podium-step.step-2 {
    height: 85px;
    background: linear-gradient(180deg, #94a3b8 0%, #475569 100%);
    font-size: 1.1rem;
}

.pg-podium-step.step-3 {
    height: 60px;
    background: linear-gradient(180deg, #b45309 0%, #78350f 100%);
    font-size: 1rem;
}

/* ==========================================================
   KAHOOT / QUIZIZZ STYLE 3D TACTILE ARCADE BUTTONS FOR PLAYERS
   Choices 2x2 Grid Container
   ========================================================== */
.game-choices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    max-width: 650px;
    margin: 0 auto;
    width: 100%;
    justify-content: center;
    /* Altura reservada: cuando los botones se reemplazan por un mensaje de
       acierto/fallo, la tarjeta NO cambia de tamaño (el juego no se mueve). */
    align-content: start;
    min-height: 130px;
}
@media (max-width: 480px) {
    .game-choices-grid {
        gap: 0.5rem;
    }
}
@media (max-width: 360px) {
    .game-choices-grid {
        grid-template-columns: 1fr;
        gap: 0.45rem;
        min-height: 210px; /* 4 botones apilados en móvil angosto */
    }
}

/* Juego centrado y estable: mobile_fixes aplica márgenes negativos a .row
   que desbordan la tarjeta y desplazan el juego en el dispositivo. */
.game-section-card,
.verb-game-card {
    overflow-x: hidden;
}
@media (max-width: 767.98px) {
    .game-section-card .row,
    .verb-game-card .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .game-section-card .row > [class*="col-"],
    .verb-game-card .row > [class*="col-"] {
        padding-left: 6px !important;
        padding-right: 6px !important;
        margin-bottom: 8px !important;
    }
}

.game-choice-btn {
    position: relative;
    width: 100%;
    min-height: 68px;
    border-radius: 16px;
    border: none;
    color: #ffffff !important;
    font-weight: 800;
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    letter-spacing: -0.2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 16px;
    gap: 12px;
    transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.12s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.game-choice-btn::after {
    display: none !important;
    content: none !important;
}

.game-choice-btn .choice-shape-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    font-size: 1.2rem;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.game-choice-btn .choice-text-label {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    white-space: normal !important;
    line-height: 1.25;
    padding-right: 36px;
}

/* Choice 0: Red Triangle ▲ */
.game-choice-btn.choice-red {
    background: linear-gradient(180deg, #f87171 0%, #ef4444 50%, #dc2626 100%);
    box-shadow: 0 6px 0 #991b1b, 0 10px 20px rgba(239, 68, 68, 0.4);
}
.game-choice-btn.choice-red:hover {
    filter: brightness(1.06);
}
.game-choice-btn.choice-red:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0 #991b1b, 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Choice 1: Blue Diamond ◆ */
.game-choice-btn.choice-blue {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    box-shadow: 0 6px 0 #1d4ed8, 0 10px 20px rgba(59, 130, 246, 0.4);
}
.game-choice-btn.choice-blue:hover {
    filter: brightness(1.06);
}
.game-choice-btn.choice-blue:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0 #1d4ed8, 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Choice 2: Amber Circle ● */
.game-choice-btn.choice-amber {
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    box-shadow: 0 6px 0 #b45309, 0 10px 20px rgba(245, 158, 11, 0.4);
}
.game-choice-btn.choice-amber:hover {
    filter: brightness(1.06);
}
.game-choice-btn.choice-amber:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0 #b45309, 0 4px 8px rgba(245, 158, 11, 0.3);
}

/* Choice 3: Emerald Square ■ */
.game-choice-btn.choice-green {
    background: linear-gradient(180deg, #34d399 0%, #10b981 50%, #059669 100%);
    box-shadow: 0 6px 0 #047857, 0 10px 20px rgba(16, 185, 129, 0.4);
}
.game-choice-btn.choice-green:hover {
    filter: brightness(1.06);
}
.game-choice-btn.choice-green:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0 #047857, 0 4px 8px rgba(16, 185, 129, 0.3);
}

/* Player Combo Banner */
.pg-combo-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.95), rgba(220, 38, 38, 0.95));
    border: 1.5px solid #fde047;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.88rem;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
    animation: pgBurnFlame 1.2s infinite alternate;
}

@media (max-width: 768px) {
    .pg-spectator-view {
        padding: 0.75rem;
    }
    .pg-spectator-card {
        padding: 1.25rem 0.85rem;
        border-radius: 20px;
    }
    .pg-spec-ranking-grid {
        grid-template-columns: 1fr;
        max-height: 380px;
    }
    .pg-spec-podium-wrap {
        padding: 1rem 0.5rem 0 0.5rem;
    }
    .pg-podium-step.step-1 { height: 95px; font-size: 1.1rem; }
    .pg-podium-step.step-2 { height: 70px; font-size: 0.95rem; }
    .pg-podium-step.step-3 { height: 50px; font-size: 0.85rem; }
    .pg-podium-avatar-bubble.gold { width: 62px; height: 62px; font-size: 1.8rem; }
    .pg-podium-avatar-bubble.silver { width: 50px; height: 50px; font-size: 1.4rem; }
    .pg-podium-avatar-bubble.bronze { width: 44px; height: 44px; font-size: 1.2rem; }
}

@media (max-width: 576px) {
    /* Modal & Dialog Mobile Adaptability */
    .pg-modal-overlay {
        padding: 8px 4px !important;
        align-items: center !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .pg-modal-box {
        padding: 1rem 0.75rem !important;
        border-radius: 16px !important;
        max-height: 94vh !important;
        overflow-y: auto !important;
        width: calc(100% - 8px) !important;
        max-width: 500px !important;
        margin: auto !important;
        box-sizing: border-box !important;
    }
    .pg-modal-box .btn-group {
        display: flex !important;
        width: 100% !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
    }
    .pg-modal-box .btn-group .btn {
        flex: 1 1 calc(50% - 4px) !important;
        padding: 8px 6px !important;
        font-size: 0.78rem !important;
        white-space: normal !important;
        word-break: normal !important;
        border-radius: 10px !important;
        letter-spacing: -0.2px !important;
    }
    .pg-modal-box h4 {
        font-size: 1.15rem !important;
    }
    .pg-modal-box h5 {
        font-size: 1.05rem !important;
    }
    .pg-modal-box p, .pg-modal-box .small {
        font-size: 0.82rem !important;
        line-height: 1.35 !important;
    }
    .pg-role-grid {
        grid-template-columns: 1fr !important;
        gap: 0.45rem !important;
    }
    .pg-role-option {
        padding: 0.65rem 0.85rem !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        text-align: left !important;
        border-radius: 12px !important;
    }
    .pg-role-option div:first-child {
        font-size: 1.4rem !important;
        margin-bottom: 0 !important;
    }
    .pg-avatar-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.4rem !important;
    }
    .pg-avatar-choice {
        font-size: 1.5rem !important;
        padding: 0.4rem 0.2rem !important;
        border-radius: 10px !important;
        min-height: 44px !important;
    }
    .pg-lobby-view {
        padding: 14px 10px !important;
        align-items: flex-start !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .pg-lobby-card {
        padding: 1.2rem 1rem !important;
        border-radius: 18px !important;
        max-height: none !important;
        overflow: visible !important;
        width: 100% !important;
        margin: auto 0 !important;
        box-sizing: border-box !important;
    }
    .pg-code-banner {
        padding: 0.85rem 0.5rem !important;
        border-radius: 14px !important;
    }
    .pg-big-code {
        font-size: clamp(1.8rem, 8vw, 2.5rem) !important;
        letter-spacing: 0.08em !important;
    }
    .pg-participants-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.4rem !important;
        max-height: 180px !important;
    }
    .pg-player-chip {
        padding: 0.4rem 0.5rem !important;
        gap: 0.4rem !important;
        border-radius: 9px !important;
    }
    .pg-player-avatar {
        font-size: 1.1rem !important;
    }
    .pg-player-name {
        font-size: 0.78rem !important;
    }
    .pg-spectator-view {
        padding: 0.35rem !important;
    }
    .pg-spectator-card {
        padding: 0.85rem 0.65rem !important;
        border-radius: 16px !important;
    }
    .pg-spec-ranking-grid {
        grid-template-columns: 1fr !important;
        max-height: 280px !important;
    }
    .pg-podium-step.step-1 { height: 85px !important; font-size: 1.1rem !important; }
    .pg-podium-step.step-2 { height: 65px !important; font-size: 0.95rem !important; }
    .pg-podium-step.step-3 { height: 48px !important; font-size: 0.85rem !important; }
    .pg-podium-avatar-bubble { width: 44px !important; height: 44px !important; font-size: 1.3rem !important; }
    .pg-podium-avatar-bubble.gold { width: 56px !important; height: 56px !important; font-size: 1.6rem !important; }

    /* Button Adaptability */
    .game-choice-btn {
        min-height: 48px !important;
        padding: 8px 10px !important;
        font-size: clamp(0.92rem, 3.8vw, 1.1rem) !important;
        gap: 6px !important;
        border-radius: 12px !important;
        justify-content: space-between !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    .game-choice-btn .choice-shape-badge {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.9rem !important;
        border-radius: 7px !important;
    }
    .game-choice-btn::after {
        display: none !important;
        content: none !important;
    }
    .game-choice-btn .choice-text-label {
        font-size: clamp(0.92rem, 3.8vw, 1.1rem) !important;
        text-align: center !important;
        padding-right: 28px !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
    }
    .game-choice-btn:active {
        transform: translateY(3px) !important;
    }
}

/* Fullscreen Projector Enhancements */
:fullscreen .pg-spectator-card,
:-webkit-full-screen .pg-spectator-card {
    max-width: 1400px;
    padding: 3rem 2.5rem;
}

:fullscreen .pg-spec-ranking-grid,
:-webkit-full-screen .pg-spec-ranking-grid {
    max-height: 580px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* High contrast anti white-on-white rules for public games and modals */
.pg-modal-box .btn-outline-light,
.pg-lobby-card .btn-outline-light,
.game-standalone-header .btn-outline-light,
.verb-game-card .btn-outline-light,
.game-section-card .btn-outline-light {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    transition: all 0.2s ease;
}
.pg-modal-box .btn-outline-light:hover,
.pg-lobby-card .btn-outline-light:hover,
.game-standalone-header .btn-outline-light:hover,
.verb-game-card .btn-outline-light:hover,
.game-section-card .btn-outline-light:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: #ffffff !important;
}

/* Ensure centering of game section cards on all viewports */
.game-section-card,
.verb-game-card {
    max-width: 680px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Universal Dark Arcade Hub & Game Viewport Themes */
body:has(.arcade-container),
body:has(.resource-container),
body:has(.game-standalone-header),
body:has(.verb-game-card),
body:has(.game-section-card),
.main-content:has(.arcade-container),
.main-content:has(.resource-container),
.main-content:has(.game-standalone-header),
.main-content:has(.verb-game-card),
.main-content:has(.game-section-card),
.arcade-page-wrapper,
.arcade-container,
.resource-container {
    background: #090d16 !important;
    color: #f8fafc !important;
}

body:has(.arcade-container) #studentPageContent,
body:has(.resource-container) #studentPageContent,
body:has(.verb-game-card) #studentPageContent,
body:has(.game-section-card) #studentPageContent,
.main-content:has(.arcade-container) > div,
.main-content:has(.resource-container) > div,
.main-content:has(.verb-game-card) > div,
.main-content:has(.game-section-card) > div {
    background: transparent !important;
}

/* Universal Card Dark Theme for Educational Games & Resources */
.resource-container .card,
.arcade-container .card,
body:has(.resource-container) .card,
body:has(.arcade-container) .card,
.main-content:has(.resource-container) .card,
.main-content:has(.arcade-container) .card {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
}

/* Retain gradient hero cards in games */
.resource-container .card[style*="gradient"],
.arcade-container .card[style*="gradient"],
.resource-container .card[style*="linear-gradient"],
.arcade-container .card[style*="linear-gradient"] {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    color: #ffffff !important;
}

.resource-container .card-body,
.resource-container .card-header,
.resource-container .card-footer,
.arcade-container .card-body,
.arcade-container .card-header,
.arcade-container .card-footer {
    background: transparent !important;
    color: #f8fafc !important;
}

/* High Contrast Buttons on Game Cards */
.resource-container .btn-outline-light,
.arcade-container .btn-outline-light {
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.28) !important;
    background: rgba(30, 41, 59, 0.85) !important;
    font-weight: 600 !important;
}
.resource-container .btn-outline-light:hover,
.arcade-container .btn-outline-light:hover {
    color: #ffffff !important;
    background: #4f46e5 !important;
    border-color: #818cf8 !important;
    transform: translateY(-1px);
}

.resource-container .btn-light,
.arcade-container .btn-light {
    color: #0f172a !important;
    background: #f8fafc !important;
    border-color: #f8fafc !important;
    font-weight: 700 !important;
}

/* Interactive Option / Answer Buttons */
.resource-container .btn-outline-primary,
.resource-container .btn-outline-secondary,
.resource-container .game-option-btn,
.resource-container .btn-option,
.resource-container [class*="option-btn"] {
    background: #1e293b !important;
    border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
    color: #f8fafc !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
}
.resource-container .btn-outline-primary:hover,
.resource-container .btn-outline-secondary:hover,
.resource-container .game-option-btn:hover,
.resource-container .btn-option:hover,
.resource-container [class*="option-btn"]:hover {
    background: #4f46e5 !important;
    border-color: #818cf8 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4) !important;
}

/* Tables in Resources */
.resource-container table,
.resource-container .table {
    color: #e2e8f0 !important;
    background: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}
.resource-container table th,
.resource-container .table th {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15) !important;
}
.resource-container table td,
.resource-container .table td {
    background: transparent !important;
    color: #cbd5e1 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* ==========================================================
   MINDS UNIVERSAL COGNITIVE POWERS DOCK & BUTTONS
   Single sleek horizontal toolbar, anti-vertical-wrap, mobile-optimized
   ========================================================== */
#gamePowersDock,
.pg-powers-dock-container {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    margin: 6px auto 12px auto !important;
    padding: 0 !important;
}

.pg-powers-dock {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 6px 12px !important;
    background: rgba(15, 23, 42, 0.92) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 9999px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
}
.pg-powers-dock::-webkit-scrollbar {
    display: none !important;
}

.pg-powers-dock-title {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #e2e8f0 !important;
    padding: 0 4px 0 2px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.pg-power-btn {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    background: #1e293b !important;
    border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 9999px !important;
    color: #f8fafc !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    padding: 4px 10px !important;
    cursor: pointer !important;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    line-height: 1.2 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35) !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    touch-action: manipulation !important;
}

.pg-power-btn:hover:not(:disabled) {
    background: #334155 !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45) !important;
}

.pg-power-btn:active:not(:disabled) {
    transform: translateY(1px) !important;
}

.pg-power-btn:disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    filter: grayscale(80%) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.pg-power-icon {
    font-size: 1rem !important;
    line-height: 1 !important;
    display: inline-block !important;
}

.pg-power-name {
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.2px !important;
}

.pg-power-count {
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    background: rgba(0, 0, 0, 0.4) !important;
    padding: 2px 6px !important;
    border-radius: 8px !important;
    color: #fde047 !important;
    border: 1px solid rgba(253, 224, 71, 0.25) !important;
}

.pg-power-key {
    font-size: 0.65rem !important;
    opacity: 0.6 !important;
    margin-left: 2px !important;
}

/* Specific glows for powers */
.pg-power-btn[data-power="clarity"]:hover:not(:disabled) {
    border-color: #c084fc !important;
    box-shadow: 0 0 14px rgba(192, 132, 252, 0.55) !important;
}
.pg-power-btn[data-power="freeze"]:hover:not(:disabled) {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.55) !important;
}
.pg-power-btn[data-power="shield"]:hover:not(:disabled) {
    border-color: #34d399 !important;
    box-shadow: 0 0 14px rgba(52, 211, 153, 0.55) !important;
}
.pg-power-btn[data-power="insight"]:hover:not(:disabled) {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.55) !important;
}
.pg-power-btn[data-power="wisdom"]:hover:not(:disabled) {
    border-color: #f472b6 !important;
    box-shadow: 0 0 14px rgba(244, 114, 182, 0.55) !important;
}

/* Active Shield State */
.pg-power-btn.border-warning,
.pg-power-btn.active-power {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(5, 150, 105, 0.65)) !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.7) !important;
    color: #ffffff !important;
    animation: pgShieldPulse 1.4s ease-in-out infinite alternate !important;
}

@keyframes pgShieldPulse {
    0% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
    100% { box-shadow: 0 0 18px rgba(16, 185, 129, 0.9), 0 0 24px rgba(16, 185, 129, 0.4); }
}

/* Toast Notifications for Powers */
.pg-power-toast {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 100000 !important;
    min-width: 290px !important;
    max-width: 380px !important;
    background: #0f172a !important;
    border: 1.5px solid #f59e0b !important;
    border-radius: 14px !important;
    padding: 12px 16px !important;
    color: #ffffff !important;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.65), 0 0 22px rgba(245, 158, 11, 0.4) !important;
    animation: pgSlideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
}

@keyframes pgSlideUpFade {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Visual Auras for Game Cards */
.pg-aura-clarity {
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.8), inset 0 0 20px rgba(168, 85, 247, 0.35) !important;
    border-color: #a855f7 !important;
    transition: all 0.4s ease !important;
}
.pg-aura-freeze {
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.85), inset 0 0 25px rgba(56, 189, 248, 0.4) !important;
    border-color: #38bdf8 !important;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.5)) !important;
    transition: all 0.4s ease !important;
}
.pg-aura-shield {
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.85), inset 0 0 20px rgba(16, 185, 129, 0.4) !important;
    border-color: #10b981 !important;
    transition: all 0.4s ease !important;
}

/* Fallback support for generic powers bars */
.powers-bar-container,
.game-powers-row,
[id*="powerBar"],
[id*="powersContainer"],
[id*="tacticalPowers"] {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    justify-content: center !important;
    align-items: center !important;
}

/* ==========================================================
   MOBILE SCREEN COMPACT OPTIMIZATION (< 576px)
   ========================================================== */
@media (max-width: 576px) {
    /* Powers dock: always 1 single horizontal row, NEVER vertical! */
    .pg-powers-dock {
        width: 100% !important;
        justify-content: space-between !important;
        padding: 4px 6px !important;
        gap: 4px !important;
        margin: 4px auto 10px auto !important;
    }
    .pg-powers-dock-title {
        display: none !important; /* Hide "Poderes:" label to fit all 5 powers in 1 row */
    }
    .pg-power-btn {
        padding: 5px 6px !important;
        font-size: 0.72rem !important;
        gap: 3px !important;
        flex: 1 1 0 !important; /* Distribute all 5 powers evenly */
        min-width: 0 !important;
        justify-content: center !important;
        border-radius: 12px !important;
    }
    .pg-power-icon {
        font-size: 0.95rem !important;
    }
    .pg-power-count {
        font-size: 0.65rem !important;
        padding: 1px 4px !important;
    }
    .pg-power-toast {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 72px) !important;
        right: 12px !important;
        left: 12px !important;
        min-width: 0 !important;
        max-width: none !important;
        font-size: 0.8rem !important;
        padding: 10px 12px !important;
    }

    /* Compact Header and Navigation Buttons in Games (Mobile) */
    .resource-container .btn-sm,
    .arcade-container .btn-sm,
    .verb-game-card .btn-sm,
    .game-section-card .btn-sm {
        font-size: 0.82rem !important;
        padding: 6px 12px !important;
        white-space: normal !important;
        word-break: normal !important;
    }

    /* Compact HUD Pills */
    .arcade-hud-pill {
        padding: 3px 8px !important;
        font-size: 0.72rem !important;
        gap: 4px !important;
    }

    /* Choice Buttons: prevent ugly vertical text stacking or overflow */
    .game-choice-btn {
        min-height: 52px !important;
        padding: 8px 10px !important;
        border-radius: 12px !important;
    }
    .game-choice-btn .choice-shape-badge {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.85rem !important;
        border-radius: 6px !important;
    }
    .game-choice-btn .choice-text-label {
        font-size: 0.95rem !important;
        padding-right: 0 !important;
        line-height: 1.2 !important;
    }
}

/* ==========================================================
   UNIVERSAL ARCADE & EDUCATIONAL RESOURCE THEME (HIGH CONTRAST & MOBILE-PERFECT)
   ========================================================== */
.resource-container,
.arcade-container,
.verbs-interactive-wrapper,
[class*="resource-container"] {
    background: #090d16 !important;
    color: #f8fafc !important;
    box-sizing: border-box !important;
}

/* Force dark, premium cards for all educational resources */
.resource-container .card,
.arcade-container .card,
.verbs-interactive-wrapper .card,
.verb-table-card,
.verb-study-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.94) 0%, rgba(30, 27, 75, 0.88) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f8fafc !important;
    border-radius: 20px !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

/* ANTI-WHITE-ON-WHITE & HEADING CONTRAST SYSTEM (Full Bootstrap Specificity Override) */
body .resource-container h1,
body .resource-container h2,
body .resource-container h3,
body .resource-container h4,
body .resource-container h5,
body .resource-container h6,
body .verbs-interactive-wrapper h1,
body .verbs-interactive-wrapper h2,
body .verbs-interactive-wrapper h3,
body .verbs-interactive-wrapper h4,
body .verbs-interactive-wrapper h5,
body .verbs-interactive-wrapper h6,
.resource-container h1,
.resource-container h2,
.resource-container h3,
.resource-container h4,
.resource-container h5,
.resource-container h6,
.resource-container .card h1,
.resource-container .card h2,
.resource-container .card h3,
.resource-container .card h4,
.resource-container .card h5,
.resource-container .card h6,
.resource-container .card-title,
.verbs-interactive-wrapper h1,
.verbs-interactive-wrapper h2,
.verbs-interactive-wrapper h3,
.verbs-interactive-wrapper h4,
.verbs-interactive-wrapper h5,
.verbs-interactive-wrapper h6 {
    color: #ffffff !important;
    --bs-heading-color: #ffffff !important;
    --bs-card-title-color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
}

/* Educational Card Subsections & Code Blocks */
.resource-container .card .bg-light,
.resource-container .bg-light,
.verbs-interactive-wrapper .bg-light {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
}

.resource-container .card .text-dark,
.resource-container .text-dark,
.verbs-interactive-wrapper .text-dark {
    color: #f8fafc !important;
}

.resource-container .card .text-muted,
.resource-container .text-muted,
.verbs-interactive-wrapper .text-muted {
    color: #94a3b8 !important;
}

.resource-container .card .badge.bg-light,
.resource-container .badge.bg-light,
.verbs-interactive-wrapper .badge.bg-light {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #f8fafc !important;
}

.resource-container .card code,
.verbs-interactive-wrapper code {
    background: rgba(99, 102, 241, 0.25) !important;
    color: #c7d2fe !important;
    padding: 2px 7px !important;
    border-radius: 6px !important;
    border: 1px solid rgba(99, 102, 241, 0.35) !important;
    font-size: 0.88em !important;
    font-family: 'JetBrains Mono', Consolas, Monaco, monospace !important;
}

/* Alerts inside educational resources */
.resource-container .alert,
.verbs-interactive-wrapper .alert {
    background: rgba(15, 23, 42, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f8fafc !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}
.resource-container .alert h1,
.resource-container .alert h2,
.resource-container .alert h3,
.resource-container .alert h4,
.resource-container .alert h5,
.resource-container .alert h6,
.resource-container .alert p,
.resource-container .alert span,
.verbs-interactive-wrapper .alert * {
    color: #f8fafc !important;
}

/* IPA tiles, tables and cards */
.resource-container .ipa-tile {
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f8fafc !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}
.resource-container .ipa-tile:hover {
    background: rgba(30, 27, 75, 0.95) !important;
    border-color: #818cf8 !important;
    transform: translateY(-2px) !important;
}
.resource-container .ipa-sym {
    color: #38bdf8 !important;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.3) !important;
}
.resource-container .ipa-word {
    color: #ffffff !important;
}

/* Universal Button Flex & No Clipping */
.resource-container .d-flex.flex-wrap.gap-2,
.hero-banner .d-flex.flex-wrap.gap-2,
.card-body .d-flex.flex-wrap.gap-2 {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.resource-container .btn,
.arcade-container .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: normal !important;
    word-break: normal !important;
    min-height: 40px !important;
    line-height: 1.25 !important;
}

/* Game Arena Choice Buttons - High Contrast, Large Tap Targets */
.game-choice-btn,
#condChoiceGrid .btn,
#gameChoiceGrid .btn,
#timeChoiceGrid .btn,
#passChoiceGrid .btn,
#repChoiceGrid .btn,
#collChoiceGrid .btn,
#ffChoiceGrid .btn,
#oxChoiceGrid .btn,
#bizChoiceGrid .btn,
#idiomChoiceGrid .btn,
#survChoiceGrid .btn,
#es6ChoiceGrid .btn,
#regexChoiceGrid .btn,
#htmlChoiceGrid .btn,
#sqlChoiceGrid .btn,
#httpChoiceGrid .btn,
#jwtChoiceGrid .btn,
#sortChoiceGrid .btn,
#bigoChoiceGrid .btn,
#dsChoiceGrid .btn,
#gitChoiceGrid .btn,
#termChoiceGrid .btn,
#cfgChoiceGrid .btn,
[id*="ChoiceGrid"] .btn {
    background: rgba(15, 23, 42, 0.92) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    font-size: clamp(0.95rem, 3.2vw, 1.15rem) !important;
    font-weight: 700 !important;
    min-height: 52px !important;
    padding: 12px 16px !important;
    border-radius: 14px !important;
    text-align: left !important;
    justify-content: flex-start !important;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
}

.game-choice-btn:hover,
[id*="ChoiceGrid"] .btn:hover {
    background: rgba(99, 102, 241, 0.25) !important;
    border-color: #818cf8 !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3) !important;
}

.game-choice-btn:active,
[id*="ChoiceGrid"] .btn:active {
    transform: scale(0.98) !important;
}

/* Choice Buttons Correct / Wrong States */
.game-choice-btn.is-correct,
[id*="ChoiceGrid"] .btn.is-correct,
.btn-choice-correct {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5) !important;
}

.game-choice-btn.is-wrong,
[id*="ChoiceGrid"] .btn.is-wrong,
.btn-choice-wrong {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%) !important;
    border-color: #f87171 !important;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5) !important;
}

/* Question Prompt High Contrast Box */
[id*="Question"],
[id*="Prompt"],
[id*="Clause"],
.game-question-highlight {
    color: #f59e0b !important;
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.3) !important;
    font-weight: 800 !important;
}

/* Universal Top Navbar & Segmented Mode Switcher (Solo vs Sala) across all Arcade Games */
.arcade-top-navbar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 16px !important;
    padding: 0.5rem 0.85rem !important;
    gap: 0.5rem !important;
}

.minds-mode-segmented-control {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 999px !important;
    padding: 2px !important;
    gap: 2px !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

.minds-mode-segmented-control .btn-mode-tab {
    border: none !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 4px 12px !important;
    border-radius: 999px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
}

.minds-mode-segmented-control .btn-mode-tab:hover {
    color: #ffffff !important;
}

.minds-mode-segmented-control .btn-mode-tab.active {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #000 !important;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.45) !important;
}

.minds-mode-segmented-control .btn-mode-tab.active-individual {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.45) !important;
}

.game-icon-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    flex: 0 0 32px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    transition: all 0.2s ease !important;
}
.game-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: #ffffff !important;
}

.pg-solo-actions-toolbar {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.btn-universal-config {
    border-color: rgba(245, 158, 11, 0.45) !important;
    background: rgba(245, 158, 11, 0.1) !important;
    color: #f59e0b !important;
    transition: all 0.2s ease !important;
}
.btn-universal-config:hover {
    background: rgba(245, 158, 11, 0.25) !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
}

/* Mobile Adjustments for Touch & Low-End Devices */
@media (max-width: 600px) {
    .resource-container,
    .arcade-container,
    .verbs-interactive-wrapper,
    #verbsAppContainer {
        padding: 0.35rem 2px 2.5rem 2px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    .resource-container .container-fluid,
    .arcade-container .container-fluid,
    .verbs-interactive-wrapper .container-fluid,
    #verbsAppContainer .container-fluid {
        padding-left: 2px !important;
        padding-right: 2px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .resource-container .card,
    .verbs-interactive-wrapper .card {
        padding: 1.15rem 0.9rem !important;
        border-radius: 16px !important;
        margin-bottom: 1rem !important;
    }
    .hero-banner,
    .card.bg-gradient,
    .verb-hero-banner {
        padding: 1.25rem 1rem !important;
        border-radius: 16px !important;
    }
    /* Toolbars and headers remain horizontal and compact on mobile */
    .game-standalone-header,
    .arcade-top-navbar,
    .verb-game-card > .d-flex:first-child,
    .resource-container .card-body > .d-flex:first-child,
    .resource-container .hero-banner .d-flex.flex-wrap.gap-2,
    .resource-container .card-body .d-flex.flex-wrap.gap-2,
    .resource-container .card-body .d-flex.gap-2,
    .verb-hero-banner .d-flex.flex-wrap.gap-2,
    #verbsHeroHeader .d-flex.flex-wrap.gap-2 {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 6px !important;
    }

    /* Horizontal Chip Bar on Mobile: Smooth scrolling, never stacking into columns of letters */
    .resource-container .auto-chip-row,
    .arcade-container .auto-chip-row,
    .auto-chip-row {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        gap: 6px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 4px !important;
        box-sizing: border-box !important;
    }
    .auto-chip-row::-webkit-scrollbar,
    .resource-container .auto-chip-row::-webkit-scrollbar,
    .arcade-container .auto-chip-row::-webkit-scrollbar {
        display: none !important;
    }
    .auto-chip-row > *,
    .resource-container .auto-chip-row > *,
    .arcade-container .auto-chip-row > * {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }

    /* Anti-letter-stacking on tables & code grids across public guides */
    .resource-container .table-responsive,
    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin-bottom: 1rem !important;
        border-radius: 12px !important;
    }
    .resource-container table,
    .resource-container .table,
    .resource-container .verb-table,
    .resource-container .phr-table,
    table.verb-table {
        display: block !important;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .pg-power-toast {
        left: 10px !important;
        right: 10px !important;
        min-width: 0 !important;
        max-width: calc(100% - 20px) !important;
    }
    .resource-container th,
    .resource-container td,
    .resource-container .badge,
    .resource-container code,
    .resource-container .word-chip,
    .resource-container .word-btn {
        word-break: normal !important;
        overflow-wrap: normal !important;
    }
    .resource-container th,
    .resource-container .badge,
    .resource-container .btn-sm {
        white-space: nowrap !important;
    }

    /* Badges, chips and HUD elements anti-letter-stacking */
    .badge,
    .reg-badge,
    .hud-badge,
    .level-badge,
    .category-badge,
    .pill,
    .chip,
    .stat-badge,
    .pg-timer-text,
    .pg-score-text,
    .pg-streak-text,
    .game-pill,
    .badge-pill-header {
        white-space: nowrap !important;
        word-break: keep-all !important;
        display: inline-flex !important;
        align-items: center !important;
    }

    .arcade-top-navbar,
    .game-standalone-header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 6px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
        box-sizing: border-box !important;
    }
    @media (max-width: 768px) {
        .arcade-top-navbar,
        .game-standalone-header {
            padding-left: 44px !important; /* Avoid overlap with fixed #mobile-sidebar-toggle */
        }
    }
    .arcade-top-navbar::-webkit-scrollbar,
    .game-standalone-header::-webkit-scrollbar {
        display: none !important;
    }

    /* Buttons inside game headers & toolbars MUST remain inline-flex side-by-side, NOT full-width columns */
    .game-standalone-header .btn,
    .arcade-top-navbar .btn,
    .arcade-top-navbar a,
    .arcade-top-navbar button,
    .arcade-navbar-actions .btn,
    .arcade-navbar-actions button,
    .pg-sala-actions-toolbar .btn,
    .pg-sala-actions-toolbar button,
    .pg-solo-actions-toolbar .btn,
    .pg-solo-actions-toolbar button,
    .btn-universal-config,
    .verb-game-card > .d-flex .btn,
    .resource-container .card-body .d-flex.gap-2 > .btn,
    .resource-container .card-body .d-flex.flex-wrap.gap-2 > .btn,
    .resource-container .hero-banner .d-flex.flex-wrap.gap-2 > .btn,
    .resource-container .auto-chip-row > .btn,
    .arcade-container .auto-chip-row > .btn,
    .verb-hero-banner .d-flex.flex-wrap.gap-2 > .btn,
    #verbsHeroHeader .d-flex.flex-wrap.gap-2 > .btn {
        display: inline-flex !important;
        flex-direction: row !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 4px 10px !important;
        font-size: 0.76rem !important;
        min-height: 32px !important;
        box-sizing: border-box !important;
    }

    /* Icon-only buttons (mute, fullscreen, options) stay compact circles/squares */
    .game-icon-btn,
    #btnMuteToggle,
    #btnFullscreenStandalone,
    .game-standalone-header .game-icon-btn,
    .arcade-top-navbar .game-icon-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        padding: 0 !important;
        flex: 0 0 32px !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Segmented Mode Switcher (Individual vs Sala) */
    .minds-mode-segmented-control {
        display: inline-flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        flex-shrink: 0 !important;
        width: auto !important;
        min-width: max-content !important;
        max-width: none !important;
        background: rgba(15, 23, 42, 0.85) !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        border-radius: 999px !important;
        padding: 2px !important;
        gap: 2px !important;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4) !important;
        box-sizing: border-box !important;
    }
    .minds-mode-segmented-control .btn-mode-tab,
    .btn-mode-tab {
        border: none !important;
        background: transparent !important;
        color: rgba(255, 255, 255, 0.7) !important;
        padding: 3px 10px !important;
        border-radius: 999px !important;
        font-size: 0.74rem !important;
        font-weight: 700 !important;
        cursor: pointer !important;
        transition: all 0.18s ease !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        min-height: 28px !important;
        line-height: 1.2 !important;
        box-sizing: border-box !important;
    }
    .minds-mode-segmented-control .btn-mode-tab.active {
        background: linear-gradient(135deg, #f59e0b, #d97706) !important;
        color: #000 !important;
        box-shadow: 0 2px 6px rgba(245, 158, 11, 0.45) !important;
    }
    .minds-mode-segmented-control .btn-mode-tab.active-individual {
        background: linear-gradient(135deg, #10b981, #059669) !important;
        color: #fff !important;
        box-shadow: 0 2px 6px rgba(16, 185, 129, 0.45) !important;
    }
    /* Choice buttons full width */
    [id*="ChoiceGrid"] .col-12,
    [id*="ChoiceGrid"] .col-md-6,
    [id*="ChoiceGrid"] > div {
        width: 100% !important;
    }
}

/* Hardware Acceleration & Paint Containment for Low-End Mobile GPU */
.game-choice-btn,
[id*="ChoiceGrid"] .btn,
.game-timer-bar,
.pg-hud-panel,
.card,
.verb-game-card,
.game-section-card {
    transform: translateZ(0);
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    touch-action: manipulation !important;
}

@media (max-width: 768px) {
    /* Disable expensive blur compositing on low-end phone GPUs for silky 60fps */
    .resource-container .card,
    .arcade-container .card,
    .verbs-interactive-wrapper .card,
    .arcade-hero-card,
    .game-card-item,
    .verb-game-card,
    .game-section-card,
    .pg-modal-box {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .verb-game-card,
    .game-section-card,
    .pg-modal-box {
        background: #0f172a !important;
    }

    /* Isolate choice buttons and timer bar so updates never trigger full-page reflow */
    .game-choice-btn,
    [id*="ChoiceGrid"] .btn,
    .game-timer-bar {
        contain: layout paint !important;
    }
}

/* ==========================================================
   UNIVERSAL ARENA & PROMPT CENTERING (ALL 33 GAMES)
   Mobile First, Anti-Cramping & Auto-Centered Layout
   ========================================================== */
[id^="sectionGame"],
.game-section-card,
.verb-game-card,
.space-dock-arena,
#screenQuestion,
.placement-wrapper {
    max-width: 820px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
}

.max-w-700 {
    max-width: 700px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

.max-w-600 {
    max-width: 600px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

.max-w-800 {
    max-width: 800px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    [id^="sectionGame"],
    .game-section-card,
    .verb-game-card,
    .space-dock-arena,
    #screenQuestion,
    .placement-wrapper {
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 1.15rem 0.85rem !important;
        border-radius: 20px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    [id^="sectionGame"] .row,
    [id^="sectionGame"] [id$="ChoiceGrid"],
    [id^="sectionGame"] [id$="Grid"],
    .game-choices-grid,
    #gameChoicesGrid {
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }

    /* Option buttons on mobile: comfortable tap targets, centered text, clean padding */
    [id^="sectionGame"] button.btn,
    .game-choice-btn,
    #gameChoicesGrid button {
        padding: 0.75rem 0.85rem !important;
        font-size: 0.92rem !important;
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        line-height: 1.35 !important;
        border-radius: 14px !important;
        word-break: break-word !important;
        white-space: normal !important;
    }

    /* Challenge Prompts Centered on Mobile */
    #condIfClause, #sentenceExercise, #pmCardWord, #sortArrayPrompt, #sortQuestionPrompt,
    #pipelineSourceCode, #jwtCasePrompt, #codeSnippetPrompt, #structPromptTitle,
    #gitPromptScenario, #badHtmlPrompt, #httpScenarioText, #idiomSituationPrompt,
    #gameQuestionText, #letterTilesContainer, #gamePromptText, #oxfordDefPrompt,
    #promptSentenceText, #questionPrompt, #regexGoalPrompt, #reportedDirectQuote,
    #sqlCaseDescription, #survivalDialogText, #survivalNpcEmoji, #termPromptIncident,
    #timeSentencePrompt, #gamePromptSpanish, #activeSentencePrompt, #codeSnippetBox,
    #spaceMissionTitle, .game-prompt-container, .game-challenge-arena {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* ==============================================================================
   MODERN 2-COLUMN BENTO GRID FOR PUBLIC & GAME GUIDES
   ============================================================================== */
.game-bento-grid {
    display: grid !important;
    grid-template-columns: repeat(12, 1fr) !important;
    gap: 1.25rem !important;
    margin-bottom: 1.5rem !important;
}

.game-bento-main {
    grid-column: span 8 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
}

.game-bento-sidebar {
    grid-column: span 4 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
}

@media (max-width: 991.98px) {
    .game-bento-main,
    .game-bento-sidebar {
        grid-column: span 12 !important;
    }
}

/* ==============================================================================
   ADN DASHBOARD LIGHT BENTO HARMONIZATION FOR PUBLIC & LIBRARY GUIDES
   Preserves multi-color Hero banners & colored left borders while unifying cards
   ============================================================================== */
.resource-container,
.arcade-container,
.verbs-interactive-wrapper,
#verbsAppContainer {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-radius: 20px;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.game-quick-launch-card {
    background: linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%) !important;
    border: 1.5px solid #ddd6fe !important;
    border-radius: 20px !important;
    padding: 1.5rem !important;
    text-align: center !important;
    box-shadow: 0 8px 24px -4px rgba(124, 58, 237, 0.10) !important;
    position: sticky !important;
    top: 1rem !important;
    color: #0f172a !important;
}

.game-quick-launch-card h4,
.game-quick-launch-card h5,
.game-quick-launch-card .text-white:not(.badge):not(.btn) {
    color: #0f172a !important;
    font-weight: 800 !important;
}

.game-quick-launch-card .text-white-50,
.game-quick-launch-card p {
    color: #475569 !important;
}

.game-quick-launch-card .btn-outline-light {
    background: #ffffff !important;
    color: #334155 !important;
    border: 1.5px solid #cbd5e1 !important;
    text-shadow: none !important;
}

.game-quick-launch-card .btn-outline-light:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

.game-cheat-sheet-card {
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 18px !important;
    padding: 1.25rem !important;
    color: #0f172a !important;
    box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.05) !important;
}

/* Bento content cards inside resource views: clean white Dashboard Bento surface
   while preserving colorful Hero banner gradients and colored border-left accents */
.game-bento-main .card,
.game-bento-main .speech-card,
.game-bento-main .ipa-interactive-card,
.game-bento-main .silent-rule-card,
.game-bento-main .pair-card,
.game-bento-main .particle-card,
.game-bento-main .modal-card,
.game-bento-main .formula-card,
.resource-container .card:not([style*="linear-gradient"]),
.game-guide-view .card:not([style*="linear-gradient"]) {
    background: #ffffff !important;
    border-top: 1.5px solid #e2e8f0 !important;
    border-right: 1.5px solid #e2e8f0 !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
    border-left: 1.5px solid #e2e8f0;
    border-radius: 18px !important;
    color: #0f172a !important;
    box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.05) !important;
}

.game-bento-main .card-body,
.resource-container .card:not([style*="linear-gradient"]) .card-body,
.game-guide-view .card:not([style*="linear-gradient"]) .card-body {
    color: #0f172a !important;
}

/* Typography & inner example boxes inside Bento guide cards */
.game-bento-main h2,
.game-bento-main h3,
.game-bento-main h4,
.game-bento-main h5,
.game-bento-main h6,
.game-bento-main .text-white:not(.badge):not(.btn),
.game-cheat-sheet-card .text-white:not(.badge):not(.btn) {
    color: #0f172a !important;
}

.game-bento-main .text-white-50,
.game-bento-main .text-muted,
.game-bento-main .text-white.text-opacity-75,
.game-bento-main .text-white.text-opacity-80,
.game-bento-main .text-white.text-opacity-90,
.game-cheat-sheet-card .text-white-50,
.game-cheat-sheet-card .text-muted {
    color: #475569 !important;
}

.game-bento-main div[style*="rgba(15,23,42"],
.game-bento-main div[style*="rgba(15, 23, 42"],
.game-bento-main div[style*="rgba(30,41,59"],
.game-bento-main div[style*="rgba(30, 41, 59"],
.game-bento-main div[style*="rgba(255,255,255,0.0"],
.game-bento-main div[style*="rgba(0,0,0,0."],
.game-quick-launch-card div[style*="rgba(15,23,42"],
.game-quick-launch-card div[style*="rgba(15, 23, 42"],
.game-bento-main .speech-item,
.game-bento-main .ipa-word-example,
.game-bento-main .word-chip-interactive,
.game-bento-main .word-btn,
.game-bento-main .example-box,
.game-bento-main .example-box-p,
.game-bento-main .formula-box,
.game-bento-main .phr-table tr,
.game-bento-main .bg-light,
.game-bento-sidebar .bg-light {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
}

.game-bento-main code,
.game-quick-launch-card code {
    background: #f1f5f9 !important;
    color: #4338ca !important;
    padding: 0.12rem 0.4rem !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
}

/* ==============================================================================
   MINDS COGNITIVE GYM (NEUROBOOST) — 3D PROCEDURAL BIOMES & GAME MODELS
   ============================================================================== */

/* Base Game Area */
#neuroUnifiedGameArea {
    position: relative;
    overflow: hidden;
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    border-radius: 18px !important;
}

/* 1. Cyber Matrix Biome (Cyan / Violet neon digital grid) */
.neuro-biome-matrix {
    background: radial-gradient(circle at 50% 30%, #1e1b4b 0%, #0f172a 70%, #030712 100%) !important;
    border: 2px solid rgba(99, 102, 241, 0.4) !important;
    box-shadow: inset 0 0 40px rgba(99, 102, 241, 0.15), 0 8px 32px rgba(15, 23, 42, 0.5) !important;
}
.neuro-biome-matrix::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

/* 2. Runic Sanctuary Biome (Celestial indigo with mystical glyph glow) */
.neuro-biome-runic {
    background: radial-gradient(circle at 50% 20%, #2e1065 0%, #0f172a 70%, #020617 100%) !important;
    border: 2px solid rgba(168, 85, 247, 0.45) !important;
    box-shadow: inset 0 0 45px rgba(168, 85, 247, 0.2), 0 8px 32px rgba(15, 23, 42, 0.5) !important;
}
.neuro-biome-runic::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(216, 180, 254, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(192, 132, 252, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* 3. Alchemist Forge Biome (Amber / Brass / Golden heat) */
.neuro-biome-alchemist {
    background: radial-gradient(circle at 50% 30%, #451a03 0%, #1c1917 70%, #09090b 100%) !important;
    border: 2px solid rgba(245, 158, 11, 0.45) !important;
    box-shadow: inset 0 0 40px rgba(245, 158, 11, 0.18), 0 8px 32px rgba(15, 23, 42, 0.5) !important;
}
.neuro-biome-alchemist::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 100%, rgba(251, 191, 36, 0.12) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* 4. Sacred Scrolls Biome (Royal sapphire & ancient library gold) */
.neuro-biome-scrolls {
    background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0f172a 70%, #020617 100%) !important;
    border: 2px solid rgba(56, 189, 248, 0.35) !important;
    box-shadow: inset 0 0 35px rgba(56, 189, 248, 0.12), 0 8px 32px rgba(15, 23, 42, 0.5) !important;
}

/* 5. Ink Prism Biome (Multi-chromatic refraction spectrum) */
.neuro-biome-prism {
    background: radial-gradient(circle at 50% 30%, #1e1b4b 0%, #0f172a 75%, #030712 100%) !important;
    border: 2px solid rgba(236, 72, 153, 0.4) !important;
    box-shadow: inset 0 0 40px rgba(236, 72, 153, 0.15), 0 8px 32px rgba(15, 23, 42, 0.5) !important;
}

/* 6. Chrono Accelerator Biome (Warp time rings) */
.neuro-biome-chrono {
    background: radial-gradient(circle at 50% 30%, #064e3b 0%, #0f172a 75%, #020617 100%) !important;
    border: 2px solid rgba(16, 185, 129, 0.4) !important;
    box-shadow: inset 0 0 40px rgba(16, 185, 129, 0.16), 0 8px 32px rgba(15, 23, 42, 0.5) !important;
}

/* Children in biomes must sit above background pseudo-elements */
#neuroUnifiedGameArea > * {
    position: relative;
    z-index: 1;
}

/* 3D Model Animations */
@keyframes sunburst-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes minds-heart-beat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.22); }
    30% { transform: scale(1.05); }
    45% { transform: scale(1.18); }
}

.minds-model-heart.heart-alive {
    animation: minds-heart-beat 2.8s ease-in-out infinite;
}

.minds-orb-spin-ring {
    transform-origin: center center;
    animation: sunburst-spin 12s linear infinite;
}

.minds-orb-spin-ring-reverse {
    transform-origin: center center;
    animation: sunburst-spin 8s linear infinite reverse;
}

.draco-wing-left {
    transform-origin: 28px 46px;
    animation: draco-wing-flap 1.8s ease-in-out infinite;
}

.draco-wing-right {
    transform-origin: 72px 46px;
    animation: draco-wing-flap 1.8s ease-in-out infinite reverse;
}

/* 3D Runic Flip Card */
.neuro-flip-card {
    perspective: 1000px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.neuro-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}

.neuro-flip-card.flipped .neuro-flip-inner {
    transform: rotateY(180deg);
}

.neuro-flip-front,
.neuro-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.neuro-flip-front {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border: 1.5px solid rgba(129, 140, 248, 0.5);
    color: #a5b4fc;
}

.neuro-flip-back {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 2px solid #fbbf24;
    transform: rotateY(180deg);
}

.neuro-flip-card.matched .neuro-flip-back {
    border-color: #10b981;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.6);
}







