/* Custom CSS Design System for Anti-Pikun: Senam Otak Seru */

:root {
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, .font-heading {
    font-family: var(--font-heading);
}

/* Glassmorphism & Modern Panels */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

.dark .glass-card {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.glass-panel {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.dark .glass-panel {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Bouncy Interactive Elements */
.btn-bounce {
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease;
}
.btn-bounce:hover {
    transform: translateY(-2px) scale(1.02);
}
.btn-bounce:active {
    transform: translateY(1px) scale(0.98);
}

.card-hover {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 35px -10px rgba(99, 102, 241, 0.18);
}

/* Floating mascot animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(2deg);
    }
}
.animate-float {
    animation: float 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.8);
    }
}
.animate-glow {
    animation: pulse-glow 2s infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}
.animate-wiggle {
    animation: wiggle 0.5s ease-in-out infinite;
}

/* 3D Card Flip */
.flip-card {
    perspective: 1000px;
}
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    cursor: pointer;
}
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.flip-card-back {
    transform: rotateY(180deg);
}

/* Memory Matrix Tiles */
.matrix-tile {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    aspect-ratio: 1 / 1;
}
.matrix-tile:active {
    transform: scale(0.92);
}
.matrix-tile.active-flash {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.9);
    transform: scale(1.05);
}
.matrix-tile.correct {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
    transform: scale(1.03);
}
.matrix-tile.wrong {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
    animation: shake 0.4s ease-in-out;
}

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

/* Simon Sequence Pads */
.simon-pad {
    transition: all 0.15s ease-out;
    opacity: 0.82;
}
.simon-pad:active, .simon-pad.lit {
    opacity: 1;
    transform: scale(1.06);
    filter: brightness(1.35);
    box-shadow: 0 0 35px currentColor;
}

/* Chimp Test Bubbles */
.chimp-bubble {
    transition: all 0.2s ease;
    user-select: none;
}
.chimp-bubble:hover {
    transform: scale(1.08);
}
.chimp-bubble:active {
    transform: scale(0.95);
}

/* Animated Progress Bars */
.progress-striped {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
}
::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.7);
}

/* Mystery Roulette Wheel */
@keyframes spin-roulette {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(1800deg); }
}
.spinning {
    animation: spin-roulette 3s cubic-bezier(0.15, 0.85, 0.35, 1) forwards;
}
