* {
    font-family: 'Inter', sans-serif;
}
.font-serif {
    font-family: 'Playfair Display', serif;
}
.glass-panel {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.gradient-text {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.message-enter {
    animation: slideIn 0.3s ease-out forwards;
}
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.xp-float {
    animation: floatUp 1s ease-out forwards;
}
@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-30px); }
}
.pulse-ring {
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
@keyframes pulse-ring {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}
.option-hover:hover {
    transform: translateX(8px);
    border-color: #818cf8;
}
.correct-answer {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border-color: #34d399 !important;
}
.wrong-answer {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%) !important;
    border-color: #f87171 !important;
}
.progress-bar {
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.chat-scrollbar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}
.chat-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}
.typing-dot {
    animation: typing 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #f0f;
    animation: confetti-fall 3s linear forwards;
}
@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}
.animate-bounce-subtle {
    animation: bounce-subtle 2s infinite ease-in-out;
}
@keyframes bounce-subtle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.chat-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

/* ── TTS Bar ─────────────────────────────────────────────── */
.tts-bar {
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.tts-bar.tts-visible {
    transform: translateY(0);
}
.tts-icon-pulse {
    animation: tts-pulse 1.6s ease-in-out infinite;
}
@keyframes tts-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.5); }
    50%       { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
}
.tts-restore-toast {
    position: absolute;
    top: -44px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(99, 102, 241, 0.9);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 999px;
    white-space: nowrap;
    animation: tts-toast-in 0.3s ease-out, tts-toast-out 0.4s ease-in 3.2s forwards;
    pointer-events: none;
}
@keyframes tts-toast-in  { from { opacity: 0; top: -30px; } to { opacity: 1; top: -44px; } }
@keyframes tts-toast-out { from { opacity: 1; } to { opacity: 0; } }
/* main content shifts up when bar is open */
body.tts-open main { padding-bottom: 5rem; }
