/* Custom Game Stylesheet - Emil Kowalski Interaction Craft & Arcade Cyberpunk UI */

:root {
    --bg-dark: #090D16;
    --card-dark: #121829;
    --primary-indigo: #6366F1;
    --accent-emerald: #10B981;
    --accent-rose: #F43F5E;
    --accent-gold: #F59E0B;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
    background-color: var(--bg-dark);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: #F8FAFC;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* Dyslexia friendly font mode toggle */
body.dyslexic-mode {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Fredoka', cursive, sans-serif !important;
    letter-spacing: 0.05em;
    word-spacing: 0.15em;
}

/* Math notation styling */
.math-expr {
    font-family: 'Outfit', 'Courier New', monospace;
    font-weight: 700;
    color: #38BDF8;
    background: rgba(15, 23, 42, 0.7);
    padding: 0.15rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(56, 189, 248, 0.25);
    display: inline-block;
    letter-spacing: 0.02em;
}

.math-var {
    font-style: italic;
    color: #F43F5E;
    font-weight: 800;
    font-size: 1.15em;
}

/* Emil Kowalski Button Physics: 160ms scale(0.97) ease-out */
.brawler-btn {
    transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out), background-color 160ms var(--ease-out);
    transform-origin: center;
    cursor: pointer;
}

.brawler-btn:active {
    transform: scale(0.97);
}

/* Answer option card */
.choice-card {
    transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), background 160ms var(--ease-out);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.choice-card:active {
    transform: scale(0.97);
}

.choice-card.correct-anim {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: #10B981 !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    animation: pulseCorrect 350ms var(--ease-elastic);
}

.choice-card.wrong-anim {
    background: rgba(244, 63, 94, 0.25) !important;
    border-color: #F43F5E !important;
    animation: shakeWrong 300ms ease-out;
}

/* Entrance animation: No scale(0), enters from scale(0.95) with opacity */
.slide-in-card {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
    animation: enterCard 220ms var(--ease-out) forwards;
}

@keyframes enterCard {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes pulseCorrect {
    0% { transform: scale(0.97); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

@keyframes shakeWrong {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* Screen Shake for Combos and Boss Hits */
.screen-shake {
    animation: screenShake 350ms cubic-bezier(.36,.07,.19,.97) both;
}

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

/* Fire Mode / Streak Glow */
.on-fire {
    animation: fireGlow 1.2s infinite alternate;
}

@keyframes fireGlow {
    from {
        box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
        border-color: #F59E0B;
    }
    to {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.7);
        border-color: #EF4444;
    }
}

/* Floating XP or Damage Numbers */
.floating-num {
    position: absolute;
    animation: floatUp 800ms var(--ease-out) forwards;
    pointer-events: none;
    font-weight: 800;
    font-size: 1.5rem;
    z-index: 50;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.2);
    }
}

/* Prefers-reduced-motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .screen-shake,
    .choice-card.wrong-anim,
    .choice-card.correct-anim,
    .slide-in-card,
    .on-fire {
        animation: none !important;
        transform: none !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #090D16;
}
::-webkit-scrollbar-thumb {
    background: #1E293B;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}
