/* ==============================================================================
   HTMLtoPHP Arcade Game Engine Styles (assets/games/game-engine.css)
   ============================================================================== */

/* --- Root Game Container --- */
.game-viewport-card {
    position: relative;
    background: #0f172a; /* Slate 900 */
    border-radius: 1.5rem;
    border: 2px solid #1e293b;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.4), 0 0 40px rgba(99, 102, 241, 0.08);
    width: 100%;
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* --- HUD Header --- */
.game-hud {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    position: relative;
    z-index: 20;
}

.hud-stat-pill {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.875rem;
    padding: 0.35rem 0.85rem;
    min-width: 4.5rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hud-stat-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.hud-stat-val {
    font-size: 1.25rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.hud-stat-pill.score-highlight {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.35) 0%, rgba(99, 102, 241, 0.2) 100%);
    border-color: #6366f1;
}
.hud-stat-pill.score-highlight .hud-stat-val {
    color: #818cf8;
}

.hud-stat-pill.streak-highlight {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(239, 68, 68, 0.2) 100%);
    border-color: #f59e0b;
}
.hud-stat-pill.streak-highlight .hud-stat-val {
    color: #fbbf24;
}

/* --- Sound & Controls Buttons --- */
.game-icon-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.game-icon-btn:hover {
    background: #334155;
    color: #ffffff;
    border-color: #64748b;
    transform: translateY(-1px);
}
.game-icon-btn:active {
    transform: translateY(1px);
}

/* --- Interactive Overlays (Start, Pause, Game Over) --- */
.game-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.game-overlay.hidden-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.overlay-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.overlay-title {
    font-size: 2.25rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #ffffff;
    margin-bottom: 0.75rem;
    line-height: 1.15;
}
@media (min-width: 640px) {
    .overlay-title {
        font-size: 2.75rem;
    }
}

.overlay-desc {
    font-size: 1rem;
    color: #94a3b8;
    max-width: 24rem;
    margin: 0 auto 1.75rem;
    line-height: 1.5;
    font-weight: 500;
}

/* --- Primary Buttons --- */
.game-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.9rem 2.25rem;
    font-size: 1.125rem;
    font-weight: 900;
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #4338ca 100%);
    border: 1px solid rgba(165, 180, 252, 0.3);
    border-radius: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.5), 0 0 20px rgba(99, 102, 241, 0.35);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}
.game-primary-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.6), 0 0 30px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}
.game-primary-btn:active {
    transform: translateY(1px) scale(0.98);
}

.game-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: #cbd5e1;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.game-secondary-btn:hover {
    background: #334155;
    color: #ffffff;
    border-color: #64748b;
    transform: translateY(-1px);
}

/* --- Scoreboard & Performance Breakdown Modal --- */
.game-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
    width: 100%;
    max-width: 20rem;
    margin: 0 auto 1.5rem;
}

.game-stat-box {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid #334155;
    border-radius: 1rem;
    padding: 0.875rem;
    text-align: center;
}
.game-stat-box.highlight-box {
    background: rgba(79, 70, 229, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
}
.game-stat-box .box-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}
.game-stat-box .box-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: #ffffff;
}

/* --- Floating Score Popups (+100, +250) --- */
.score-float-indicator {
    position: absolute;
    pointer-events: none;
    font-size: 1.25rem;
    font-weight: 900;
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
    z-index: 25;
    animation: floatUpFade 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes floatUpFade {
    0% {
        opacity: 0;
        transform: translate(-50%, 0) scale(0.6);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -12px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -35px) scale(0.9);
    }
}

/* --- Shake Animation for Errors / Collisions --- */
.shake-element {
    animation: screenShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes screenShake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(3px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
    40%, 60% { transform: translate3d(5px, 0, 0); }
}

/* --- Safe Ad Placement Zones --- */
.game-ad-zone {
    width: 100%;
    margin: 2rem auto;
    text-align: center;
}
.game-ad-box {
    max-width: 728px;
    min-height: 90px;
    margin: 0 auto;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Reduced Motion Accessibility --- */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .shake-element {
        animation: none !important;
    }
    .score-float-indicator {
        animation: none !important;
    }
}

/* ==============================================================================
   HIGH-END ARCADE GAMING PORTAL STYLES
   ============================================================================== */

/* --- Explicit Dark Arcade Hero Section --- */
.arcade-hero-section {
    background: radial-gradient(ellipse at 50% 0%, #1e1b4b 0%, #0f172a 60%, #090d16 100%) !important;
    color: #ffffff !important;
    border-bottom: 2px solid #1e293b;
    position: relative;
    padding-top: 2rem;
    padding-bottom: 3.5rem;
    margin-top: -2rem;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    overflow: hidden;
}
.arcade-hero-section h1 {
    color: #ffffff !important;
    text-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}
.arcade-hero-section p {
    color: #cbd5e1 !important;
}

/* --- Top Arcade Navigation Strip (Prev / Switcher / Next) --- */
.arcade-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-radius: 1.25rem;
    padding: 0.65rem 0.85rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.12);
    user-select: none;
    -webkit-user-select: none;
}

.arcade-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.95rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.875rem;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 800;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}
.arcade-nav-btn:hover {
    background: #334155;
    border-color: #6366f1;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}
.arcade-nav-btn.prev-btn:hover {
    transform: translateX(-3px);
}
.arcade-nav-btn.next-btn:hover {
    transform: translateX(3px);
}
.arcade-nav-btn .nav-arrow {
    font-size: 1.2rem;
    line-height: 1;
    color: #818cf8;
}
.arcade-nav-btn .nav-btn-icon {
    font-size: 1.2rem;
    line-height: 1;
}
.arcade-nav-btn .nav-btn-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.arcade-nav-btn .nav-btn-text small {
    font-size: 0.65rem;
    color: #94a3b8;
    letter-spacing: 0.08em;
    font-weight: 900;
}
.arcade-nav-btn .nav-btn-text strong {
    font-size: 0.85rem;
    color: #ffffff;
}

.arcade-switcher-pill-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(10, 15, 29, 0.8);
    padding: 0.35rem 0.5rem;
    border-radius: 0.875rem;
    border: 1px solid rgba(51, 65, 85, 0.6);
}

.arcade-hub-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border-radius: 0.65rem;
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 900;
    transition: all 0.2s ease;
}
.arcade-hub-chip:hover {
    background: #4f46e5;
    border-color: #6366f1;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.switcher-divider {
    width: 1px;
    height: 1.6rem;
    background: #334155;
    margin: 0 0.25rem;
}

.arcade-game-icon-chip {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.65rem;
    background: #1e293b;
    border: 1px solid #334155;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.arcade-game-icon-chip .chip-title {
    display: none;
}
.arcade-game-icon-chip:hover {
    background: #334155;
    border-color: #64748b;
    transform: translateY(-2px) scale(1.1);
}
.arcade-game-icon-chip.active-chip {
    background: var(--active-color, #4f46e5) !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 16px var(--active-color, #4f46e5);
    transform: scale(1.15);
}

@media (max-width: 640px) {
    .arcade-nav-btn .nav-btn-text {
        display: none;
    }
    .arcade-nav-btn {
        padding: 0.5rem 0.75rem;
    }
    .arcade-game-icon-chip {
        width: 2rem;
        height: 2rem;
        font-size: 1.05rem;
    }
    .arcade-hub-chip .hub-chip-label {
        display: none;
    }
}

/* --- Theater / Monitor Fullscreen Mode --- */
body.in-theater-mode {
    overflow: hidden !important;
}
body.in-theater-mode .game-viewport-card {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    background: #090d16 !important;
    border: none !important;
}
body.in-theater-mode .theater-exit-btn {
    display: inline-flex !important;
}
.theater-exit-btn {
    display: none;
}

/* --- Visual Animated Gameplay Guides & Tutorial Section --- */
.game-tutorial-section {
    margin-top: 2.75rem;
    margin-bottom: 2rem;
}

.game-tutorial-header {
    margin-bottom: 1.25rem;
}

.game-tutorial-header .tutorial-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.28);
    color: #818cf8;
    font-size: 0.725rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    margin-bottom: 0.6rem;
}

.game-tutorial-header .tutorial-main-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem 0;
    line-height: 1.3;
}
@media (min-width: 640px) {
    .game-tutorial-header .tutorial-main-title {
        font-size: 1.75rem;
    }
}

.game-tutorial-header .tutorial-sub-title {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

/* Bulletproof Self-Contained Tutorial Card (Never Squishes) */
.game-guide-box,
.game-guide-card {
    background: #0f172a !important;
    border: 1px solid #1e293b !important;
    border-radius: 1.5rem !important;
    padding: 1.5rem !important;
    color: #ffffff !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4), 0 0 25px rgba(99, 102, 241, 0.07) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1.75rem !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

@media (min-width: 768px) {
    .game-guide-box,
    .game-guide-card {
        padding: 2rem !important;
        gap: 2.25rem !important;
    }
}

@media (max-width: 767px) {
    .game-guide-box,
    .game-guide-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1.25rem !important;
        padding: 1.25rem !important;
    }
}

/* Fixed-width stage column so demo never steals all width */
.game-guide-stage-col {
    flex: 0 0 240px !important;
    width: 240px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

@media (max-width: 767px) {
    .game-guide-stage-col {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 340px !important;
        margin: 0 auto !important;
    }
}

.demo-stage {
    position: relative !important;
    width: 100% !important;
    height: 160px !important;
    background: radial-gradient(circle at center, #1e293b 0%, #090d16 100%) !important;
    border-radius: 1rem !important;
    border: 1px solid #334155 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* Flexible text column with min-width: 0 so it never squishes */
.game-guide-text-col {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.game-guide-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    background: rgba(99, 102, 241, 0.16) !important;
    border: 1px solid rgba(99, 102, 241, 0.35) !important;
    color: #a5b4fc !important;
    font-size: 0.725rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    padding: 0.3rem 0.75rem !important;
    border-radius: 2rem !important;
    margin-bottom: 0.6rem !important;
    width: fit-content !important;
}

.game-guide-headline {
    font-size: 1.25rem !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    margin: 0 0 0.5rem 0 !important;
    line-height: 1.35 !important;
    letter-spacing: -0.01em !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

.game-guide-explanation {
    font-size: 0.875rem !important;
    color: #94a3b8 !important;
    line-height: 1.6 !important;
    margin: 0 0 0.75rem 0 !important;
    font-weight: 500 !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}
.game-guide-explanation strong {
    color: #f1f5f9 !important;
    font-weight: 800 !important;
}

.game-guide-checklist {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.4rem !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.game-guide-check-item {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-size: 0.8rem !important;
    color: #cbd5e1 !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
}

.game-guide-check-item .item-dot {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 1.15rem !important;
    height: 1.15rem !important;
    border-radius: 50% !important;
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #38bdf8 !important;
    font-size: 0.65rem !important;
    font-weight: 900 !important;
    flex-shrink: 0 !important;
}

/* Demo 1: Tap the Target */
.demo-target-circle {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ef4444, #991b1b);
    border: 3px solid #ffffff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.7);
    animation: demoTargetMove 4s infinite ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}
.demo-target-circle::before {
    content: '';
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: #dc2626;
}
.demo-target-circle::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
}
.demo-target-finger {
    position: absolute;
    font-size: 1.75rem;
    animation: demoFingerTap 4s infinite ease-in-out;
    pointer-events: none;
}
.demo-score-popup {
    position: absolute;
    color: #fbbf24;
    font-weight: 900;
    font-size: 1.1rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    opacity: 0;
    animation: demoScoreFloat 4s infinite ease-out;
}
@keyframes demoTargetMove {
    0%, 100% { top: 30%; left: 30%; transform: scale(1); }
    35% { top: 30%; left: 30%; transform: scale(1.1); }
    40% { top: 30%; left: 30%; transform: scale(0.9); }
    45% { top: 55%; left: 65%; transform: scale(0.9); }
    75% { top: 55%; left: 65%; transform: scale(1.1); }
    80% { top: 55%; left: 65%; transform: scale(0.9); }
    85% { top: 30%; left: 30%; transform: scale(1); }
}
@keyframes demoFingerTap {
    0%, 100% { top: 50%; left: 50%; opacity: 0; }
    20% { top: 35%; left: 33%; opacity: 1; transform: scale(1); }
    35% { top: 30%; left: 30%; transform: scale(0.85); opacity: 1; }
    40% { top: 35%; left: 33%; transform: scale(1); opacity: 1; }
    55% { top: 60%; left: 68%; opacity: 1; transform: scale(1); }
    75% { top: 55%; left: 65%; transform: scale(0.85); opacity: 1; }
    80% { top: 60%; left: 68%; opacity: 1; transform: scale(1); }
    90% { top: 60%; left: 68%; opacity: 0; }
}
@keyframes demoScoreFloat {
    0%, 34% { opacity: 0; transform: translateY(0); }
    36% { opacity: 1; top: 20%; left: 30%; }
    48% { opacity: 0; transform: translateY(-20px); }
    74% { opacity: 0; transform: translateY(0); }
    76% { opacity: 1; top: 45%; left: 65%; }
    88% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 0; }
}

/* Demo 2: Memory Match */
.demo-card-row {
    display: flex;
    gap: 0.75rem;
}
.demo-mini-card {
    width: 48px;
    height: 60px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 900;
    transition: all 0.3s ease;
    border: 2px solid #334155;
    background: #1e293b;
    color: #94a3b8;
}
.demo-card-1 { animation: demoCardFlip1 4s infinite; }
.demo-card-2 { animation: demoCardFlip2 4s infinite; }
@keyframes demoCardFlip1 {
    0%, 15% { background: #1e293b; border-color: #334155; content: '?'; }
    25%, 85% { background: #f0fdf4; border-color: #22c55e; box-shadow: 0 0 12px rgba(34, 197, 94, 0.5); }
    95%, 100% { background: #1e293b; border-color: #334155; }
}
@keyframes demoCardFlip2 {
    0%, 45% { background: #1e293b; border-color: #334155; }
    55%, 85% { background: #f0fdf4; border-color: #22c55e; box-shadow: 0 0 12px rgba(34, 197, 94, 0.5); }
    95%, 100% { background: #1e293b; border-color: #334155; }
}

/* Demo 3: Number Merge */
.demo-tile-grid {
    position: relative;
    width: 140px;
    height: 70px;
    background: #1e293b;
    border-radius: 0.75rem;
    padding: 6px;
    border: 1px solid #334155;
}
.demo-tile-left, .demo-tile-right {
    position: absolute;
    width: 54px;
    height: 56px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.25rem;
    color: #ffffff;
    top: 7px;
}
.demo-tile-left {
    left: 7px;
    background: #475569;
    animation: demoTileMergeLeft 3.5s infinite ease-in-out;
}
.demo-tile-right {
    right: 7px;
    background: #475569;
    animation: demoTileMergeRight 3.5s infinite ease-in-out;
}
@keyframes demoTileMergeLeft {
    0%, 30% { left: 7px; opacity: 1; transform: scale(1); background: #475569; }
    50% { left: 43px; opacity: 0; transform: scale(0.8); }
    90%, 100% { left: 7px; opacity: 1; transform: scale(1); background: #475569; }
}
@keyframes demoTileMergeRight {
    0%, 30% { transform: scale(1); background: #475569; }
    50% { transform: scale(1.2); background: #f59e0b; box-shadow: 0 0 15px rgba(245, 158, 11, 0.6); }
    85% { transform: scale(1); background: #f59e0b; }
    95%, 100% { transform: scale(1); background: #475569; }
}

/* Demo 4: Dodge the Blocks */
.demo-dodge-arena {
    position: relative;
    width: 160px;
    height: 140px;
    background: #090d16;
    border-radius: 0.75rem;
    border: 1px solid #1e293b;
    overflow: hidden;
}
.demo-falling-block-1, .demo-falling-block-2 {
    position: absolute;
    width: 38px;
    height: 16px;
    background: #ef4444;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}
.demo-falling-block-1 {
    left: 15px;
    animation: demoBlockFall1 3s infinite linear;
}
.demo-falling-block-2 {
    right: 20px;
    animation: demoBlockFall2 3s infinite linear 1.5s;
}
.demo-player-ship {
    position: absolute;
    bottom: 12px;
    width: 24px;
    height: 24px;
    background: #06b6d4;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.8);
    animation: demoShipDodge 3s infinite ease-in-out;
}
@keyframes demoBlockFall1 {
    0% { top: -20px; }
    100% { top: 150px; }
}
@keyframes demoBlockFall2 {
    0% { top: -20px; }
    100% { top: 150px; }
}
@keyframes demoShipDodge {
    0%, 100% { left: 25px; }
    35% { left: 95px; }
    70% { left: 35px; }
}

/* Demo 5: Color Match */
.demo-color-box {
    text-align: center;
}
.demo-stroop-text {
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    color: #06b6d4; /* Word is YELLOW but color is CYAN */
    text-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
    margin-bottom: 0.75rem;
}
.demo-color-choices {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}
.demo-color-pill {
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 900;
    border: 2px solid transparent;
}
.demo-pill-correct {
    background: #06b6d4;
    color: #ffffff;
    animation: demoColorTap 3s infinite;
}
.demo-pill-wrong {
    background: #eab308;
    color: #000000;
    opacity: 0.4;
}
@keyframes demoColorTap {
    0%, 40% { transform: scale(1); box-shadow: none; border-color: transparent; }
    55%, 85% { transform: scale(1.15); box-shadow: 0 0 15px rgba(6, 182, 212, 0.8); border-color: #ffffff; }
    95%, 100% { transform: scale(1); box-shadow: none; border-color: transparent; }
}

/* --- Dark Arcade Cards for Games Hub --- */
.game-card-hub-dark {
    background: #0f172a !important;
    border: 1px solid #1e293b !important;
    border-radius: 1.5rem !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3) !important;
}
.game-card-hub-dark:hover {
    transform: translateY(-6px) !important;
    border-color: #475569 !important;
    box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.5), 0 0 25px rgba(99, 102, 241, 0.15) !important;
}

