@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Fredoka:wght@500;700;800&family=Alexandria:wght@400;700;900&family=Orbitron:wght@700;900&display=swap');

:root {
    /* Fairy Garden Magic Color Palette (Same as Math Platform) */
    --primary: #f72585;          /* Vibrant Fuchsia */
    --primary-dark: #b5179e;     /* Deep Fuchsia */
    --primary-light: #ff70a6;    /* Soft Rose */
    --secondary: #7209b7;        /* Deep Royal Purple */
    --secondary-dark: #3c096c;   /* Midnight Purple */
    --accent: #fee440;           /* Stardust Gold */
    --accent-glow: #ffd166;      /* Golden Glow */
    --accent-cyan: #4cc9f0;      /* Glowing Cyan / Fairy Light */
    --dark: #10002b;             /* Dark Magic Night */
    
    --card-bg: rgba(36, 0, 70, 0.88);
    --card-border: rgba(254, 228, 64, 0.4);
    --card-border-hover: #fee440;
    
    --text-main: #ffffff;
    --text-light: #e0aaff;
    --text-muted: #c77dff;
    --white: #ffffff;
    --success: #4cc9f0;
    --warning: #fee440;

    --fairy-glow: 0 0 20px rgba(247, 37, 133, 0.8), 0 0 40px rgba(76, 201, 240, 0.4);
    --gold-glow: 0 0 20px rgba(254, 228, 64, 0.8), 0 0 35px rgba(254, 228, 64, 0.4);
    --shadow: 0 10px 30px rgba(114, 9, 183, 0.4);
    --shadow-hover: 0 15px 45px rgba(247, 37, 133, 0.6);
    --radius: 28px;

    --font-ar: 'Cairo', 'Alexandria', sans-serif;
    --font-en: 'Fredoka', 'Cairo', sans-serif;
    --font-digital: 'Orbitron', 'Courier New', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-ar);
    background-color: var(--dark);
    color: var(--text-main);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(114, 9, 183, 0.6), transparent 600px),
        radial-gradient(circle at 85% 30%, rgba(247, 37, 133, 0.5), transparent 600px),
        url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='1.5' fill='%23fee440' opacity='0.7'/%3E%3Ccircle cx='90' cy='60' r='2' fill='%234cc9f0' opacity='0.5'/%3E%3Ccircle cx='150' cy='130' r='1.5' fill='%23f72585' opacity='0.8'/%3E%3C/svg%3E");
    background-size: auto, auto, 300px 300px;
    background-attachment: fixed;
    animation: breathingBackground 15s ease-in-out infinite alternate;
    min-height: 100vh;
    overflow-x: hidden;
    direction: rtl;
}

@keyframes breathingBackground {
    0% { background-position: 0% 0%, 0% 0%, 0 0; }
    100% { background-position: 5% 5%, -5% 5%, 0 50px; }
}

/* =========================================================
   Fairy Magic Dust & Wand HUD Bar (Header Top)
========================================================= */
.scouter-hud-bar, .fairy-hud-bar {
    width: 95%;
    max-width: 1200px;
    margin: 10px auto 0 auto;
    background: linear-gradient(135deg, rgba(36, 0, 70, 0.9), rgba(16, 0, 43, 0.95));
    border: 2px solid rgba(254, 228, 64, 0.6);
    border-radius: 20px;
    padding: 8px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 0 25px rgba(247, 37, 133, 0.35), inset 0 0 15px rgba(254, 228, 64, 0.15);
    backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
}

.scouter-hud-bar::before, .fairy-hud-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(254, 228, 64, 0.12) 50%, transparent 100%);
    animation: fairyScanLine 3.5s infinite linear;
    pointer-events: none;
}

@keyframes fairyScanLine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.scouter-readout, .fairy-readout {
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: var(--font-digital);
    color: var(--accent);
    font-size: 1rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(254, 228, 64, 0.8);
}

.scouter-power-badge, .fairy-power-badge {
    background: rgba(247, 37, 133, 0.25);
    border: 1.5px solid var(--accent);
    padding: 4px 14px;
    border-radius: 14px;
    color: #ffffff;
    font-weight: 900;
    letter-spacing: 1px;
    animation: fairyPulse 1.8s infinite ease-in-out alternate;
}

@keyframes fairyPulse {
    0% { text-shadow: 0 0 5px var(--accent); border-color: var(--accent); }
    100% { text-shadow: 0 0 18px var(--primary), 0 0 30px var(--accent-cyan); border-color: var(--primary); color: #ffffff; }
}

.scouter-scan-btn, .fairy-scan-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: 1.5px solid var(--accent);
    color: #ffffff !important;
    padding: 6px 18px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 15px rgba(247, 37, 133, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.scouter-scan-btn:hover, .fairy-scan-btn:hover {
    background: linear-gradient(135deg, var(--accent), #ff9e00);
    color: #12002b !important;
    box-shadow: 0 0 25px rgba(254, 228, 64, 0.8);
    transform: translateY(-2px) scale(1.05);
}

/* =========================================================
   Fairy Header (Identical to Math Platform)
========================================================= */
.fairy-header, .app-header {
    background: linear-gradient(135deg, rgba(36, 0, 70, 0.92) 0%, rgba(18, 0, 43, 0.96) 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 35px rgba(247, 37, 133, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(254, 228, 64, 0.45);
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
    width: 100%;
}

/* 1. Student Profile */
.user-profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-glow {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle, #f72585 0%, #3c096c 100%);
    border: 2.5px solid #fee440;
    box-shadow: 0 0 18px rgba(254, 228, 64, 0.7), 0 0 28px rgba(247, 37, 133, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.user-avatar-glow:hover {
    transform: scale(1.08) rotate(4deg);
    box-shadow: 0 0 25px rgba(254, 228, 64, 0.9), 0 0 35px rgba(247, 37, 133, 0.8);
}

.user-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.avatar-fairy-badge {
    position: absolute;
    bottom: -4px;
    left: -4px;
    background: #f72585;
    border: 1.5px solid #fee440;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.user-info-text {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.student-name {
    font-size: 1.25rem;
    font-weight: 900;
    color: #FFFFFF;
    text-shadow: 0 0 10px rgba(247, 37, 133, 0.8);
    margin: 0;
    line-height: 1.2;
}

.student-grade-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fee440;
    background: rgba(114, 9, 183, 0.6);
    border: 1px solid rgba(254, 228, 64, 0.4);
    border-radius: 20px;
    padding: 2px 8px;
    margin-top: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* 2. Center Magical Title */
.fairy-header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.magical-title {
    font-size: clamp(1.25rem, 2.2vw, 1.8rem);
    margin: 0;
    background: linear-gradient(135deg, #ffffff 0%, #ffb3c6 45%, #fee440 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(247, 37, 133, 0.35);
    font-weight: 900;
    line-height: 1.2;
}

.magical-subtitle {
    font-size: 0.8rem;
    color: #e0aaff;
    margin: 3px 0 0 0;
    font-weight: 600;
}

/* 3. Actions / Buttons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-play-fairies, .dragon-game-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #f72585 0%, #7209b7 100%);
    color: #FFFFFF !important;
    text-decoration: none !important;
    border-radius: 50px;
    font-weight: 900;
    font-size: 0.95rem;
    box-shadow: 0 4px 18px rgba(247, 37, 133, 0.6), 0 0 16px rgba(254, 228, 64, 0.4);
    border: 2px solid #fee440;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.btn-play-fairies:hover, .dragon-game-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(247, 37, 133, 0.85), 0 0 25px rgba(254, 228, 64, 0.7);
    background: linear-gradient(135deg, #7209b7 0%, #f72585 100%);
}

.fairy-btn-icon {
    font-size: 1.25rem;
    animation: gentleWiggle 2s infinite ease-in-out;
}

@keyframes gentleWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.fairy-sparkle-star {
    font-size: 0.85rem;
    animation: pulseStar 1.5s infinite alternate;
}

@keyframes pulseStar {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.2); opacity: 1; filter: drop-shadow(0 0 6px #fee440); }
}

.btn-magical-back, .back-to-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF !important;
    text-decoration: none !important;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.95rem;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.btn-magical-back:hover, .back-to-main:hover {
    background: rgba(247, 37, 133, 0.3);
    border-color: #fee440;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(247, 37, 133, 0.4);
}

.home-btn, .back-btn {
    background: linear-gradient(135deg, #f72585, #7209b7);
    color: #FFFFFF !important;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.95rem;
    border: 2px solid #fee440;
    box-shadow: 0 4px 15px rgba(247, 37, 133, 0.4);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.home-btn:hover, .back-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(254, 228, 64, 0.6);
    background: linear-gradient(135deg, #7209b7, #f72585);
}

/* =========================================================
   7-Second Profile Magic Effects & Lighting
========================================================= */
.magic-glow-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    box-shadow: inset 0 0 100px rgba(247, 37, 133, 0.7), inset 0 0 160px rgba(254, 228, 64, 0.5), inset 0 0 200px rgba(76, 201, 240, 0.4);
    animation: magicalAuraPulse 1.2s ease-in-out infinite alternate;
    transition: opacity 0.8s ease;
}

@keyframes magicalAuraPulse {
    0% {
        box-shadow: inset 0 0 90px rgba(247, 37, 133, 0.8), inset 0 0 160px rgba(254, 228, 64, 0.6);
        background: radial-gradient(circle at 50% 10%, rgba(247, 37, 133, 0.18), transparent 70%);
    }
    50% {
        box-shadow: inset 0 0 130px rgba(76, 201, 240, 0.8), inset 0 0 190px rgba(254, 228, 64, 0.7);
        background: radial-gradient(circle at 50% 50%, rgba(76, 201, 240, 0.22), transparent 75%);
    }
    100% {
        box-shadow: inset 0 0 110px rgba(254, 228, 64, 0.8), inset 0 0 170px rgba(247, 37, 133, 0.7);
        background: radial-gradient(circle at 50% 90%, rgba(254, 228, 64, 0.2), transparent 70%);
    }
}

.user-avatar-glow.magic-active {
    animation: royalFairyGlow 1.2s ease-in-out infinite alternate !important;
}

@keyframes royalFairyGlow {
    0% {
        transform: scale(1.18) rotate(0deg);
        box-shadow: 0 0 35px #fee440, 0 0 60px #f72585, 0 0 90px #4cc9f0;
    }
    100% {
        transform: scale(1.26) rotate(6deg);
        box-shadow: 0 0 50px #f72585, 0 0 80px #fee440, 0 0 120px #ff70a6;
    }
}

.magic-platform-dancing {
    animation: cutePlatformDance 1.4s ease-in-out infinite alternate;
}

@keyframes cutePlatformDance {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.008); }
    100% { transform: translateY(4px) scale(1); }
}

.magic-sparkle-card {
    animation: cardMagicSparkle 1.2s ease-in-out infinite alternate !important;
}

@keyframes cardMagicSparkle {
    0% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 25px rgba(247, 37, 133, 0.6);
        transform: translateY(-4px);
    }
    100% {
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 45px rgba(254, 228, 64, 0.85);
        transform: translateY(-10px) scale(1.03);
    }
}

.magic-floating-sprite {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    font-size: 2.2rem;
    filter: drop-shadow(0 0 15px rgba(254, 228, 64, 0.9));
    animation: floatSpriteUp 2.5s ease-out forwards;
}

@keyframes floatSpriteUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.5) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: translateY(0px) scale(1.35) rotate(-15deg);
    }
    80% {
        opacity: 0.9;
        transform: translateY(-90px) scale(1.1) rotate(20deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-160px) scale(0.4) rotate(45deg);
    }
}

/* =========================================================
   Main Containers & Views
========================================================= */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.view {
    display: none;
    animation: fairyFadeIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.view.active {
    display: block;
}

.hidden {
    display: none !important;
}

@keyframes fairyFadeIn {
    from { opacity: 0; transform: translateY(15px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.view-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(60, 9, 108, 0.88), rgba(36, 0, 70, 0.95));
    padding: 16px 26px;
    border-radius: 26px;
    border: 2px solid var(--primary);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    position: relative;
}

.view-header h2 {
    font-size: 1.95rem;
    color: var(--accent);
    text-shadow: 0 0 15px rgba(254, 228, 64, 0.6);
    font-weight: 900;
}

/* Titles */
.main-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 3.2rem);
    color: #ffffff;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #ffb3c6 50%, #fee440 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 25px rgba(247, 37, 133, 0.8), 0 0 45px rgba(254, 228, 64, 0.5);
    font-weight: 900;
    letter-spacing: 1px;
}

.subtitle {
    text-align: center;
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* =========================================================
   Dashboard Book Cards
========================================================= */
.book-selection-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 35px;
    max-width: 950px;
    margin: 0 auto;
}

.book-card {
    background: linear-gradient(135deg, rgba(60, 9, 108, 0.92) 0%, rgba(36, 0, 70, 0.98) 100%);
    border: 3px solid rgba(254, 228, 64, 0.45);
    border-radius: 30px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(247, 37, 133, 0.3);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.book-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 30px;
    box-shadow: inset 0 0 30px rgba(254, 228, 64, 0.35), 0 0 40px rgba(247, 37, 133, 0.6);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.book-card:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: #fee440;
    box-shadow: 0 18px 45px rgba(247, 37, 133, 0.7), 0 0 40px rgba(254, 228, 64, 0.8);
    background: linear-gradient(135deg, rgba(114, 9, 183, 0.95) 0%, rgba(60, 9, 108, 1) 100%);
}

.book-card:hover::after {
    opacity: 1;
}

.book-card h2 {
    font-size: 2.1rem;
    color: var(--accent);
    margin-top: 15px;
    font-weight: 900;
    text-shadow: 0 0 15px rgba(254, 228, 64, 0.7);
}

.book-card p {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-top: 6px;
    font-weight: bold;
}

/* Corner Reticles for Cards */
.scouter-corner-card {
    position: relative;
}

.scouter-corner-card::before,
.scouter-corner-card::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--accent);
    pointer-events: none;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.scouter-corner-card::before {
    top: 10px; right: 10px;
    border-bottom: none; border-left: none;
}

.scouter-corner-card::after {
    bottom: 10px; left: 10px;
    border-top: none; border-right: none;
}

.scouter-corner-card:hover::before,
.scouter-corner-card:hover::after {
    border-color: #ffffff;
    width: 24px; height: 24px;
    opacity: 1;
    filter: drop-shadow(0 0 6px var(--accent));
}

/* =========================================================
   Units & Lessons View
========================================================= */
.units-container,
.lessons-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 28px;
    margin-top: 15px;
}

.unit-card,
.lesson-car-btn {
    background: linear-gradient(135deg, rgba(60, 9, 108, 0.88) 0%, rgba(36, 0, 70, 0.95) 100%);
    border: 2.5px solid rgba(254, 228, 64, 0.4);
    border-radius: 28px;
    padding: 25px 20px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(247, 37, 133, 0.25);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    color: #ffffff;
}

.unit-card:hover,
.lesson-car-btn:hover {
    transform: translateY(-8px) scale(1.05);
    border-color: #fee440;
    box-shadow: 0 15px 35px rgba(247, 37, 133, 0.6), 0 0 30px rgba(254, 228, 64, 0.5);
    background: linear-gradient(135deg, rgba(114, 9, 183, 0.92) 0%, rgba(60, 9, 108, 0.98) 100%);
}

.unit-title {
    font-size: 1.35rem;
    color: #ffffff;
    font-weight: 800;
    margin-top: 10px;
    text-shadow: 0 2px 10px rgba(247, 37, 133, 0.8);
}

/* =========================================================
   Lesson Content & Section Boxes
========================================================= */
.lesson-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.section-box {
    background: linear-gradient(135deg, rgba(46, 0, 85, 0.92) 0%, rgba(24, 0, 52, 0.96) 100%);
    border: 2px solid rgba(254, 228, 64, 0.45);
    border-radius: 28px;
    padding: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.section-title {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 2px dashed rgba(247, 37, 133, 0.5);
    padding-bottom: 14px;
    font-weight: 900;
    text-shadow: 0 0 14px rgba(254, 228, 64, 0.5);
}

.section-description {
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 22px;
    font-weight: bold;
}

.en-text {
    font-family: var(--font-en);
    direction: ltr;
    display: inline-block;
    font-size: 1em;
    color: var(--accent);
    letter-spacing: 0.5px;
}

/* Dialogue & Characters */
.characters-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.char-card {
    background: rgba(36, 0, 70, 0.75);
    border: 2px solid var(--primary);
    border-radius: 22px;
    padding: 22px;
    display: flex;
    gap: 22px;
    align-items: center;
    box-shadow: 0 6px 20px rgba(114, 9, 183, 0.35);
    backdrop-filter: blur(16px);
}

.char-avatar {
    flex-shrink: 0;
}

.char-bubble {
    flex: 1;
    background: rgba(60, 9, 108, 0.85);
    border: 1.5px solid var(--accent);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(254, 228, 64, 0.2);
}

.char-text, .clickable-text {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--accent) !important;
    line-height: 1.65;
    text-shadow: 0 0 8px rgba(254, 228, 64, 0.4);
    font-family: var(--font-en);
    cursor: pointer;
    transition: color 0.2s ease;
}

.char-text:hover, .clickable-text:hover {
    color: var(--primary-light) !important;
    text-shadow: 0 0 12px var(--primary);
}

.inline-ar-trans {
    color: #ffffff !important;
    font-size: 1.18rem !important;
    font-weight: 900 !important;
    margin-top: 10px !important;
    text-shadow: none;
    font-family: var(--font-ar);
}

/* Vocabulary Grid */
.vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 22px;
}

.vocab-card, .vocab-item {
    background: linear-gradient(135deg, rgba(60, 9, 108, 0.85), rgba(36, 0, 70, 0.95));
    border: 2px solid var(--primary);
    border-radius: 22px;
    padding: 20px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 20px rgba(247, 37, 133, 0.25);
    position: relative;
}

.vocab-card:hover, .vocab-item:hover {
    transform: translateY(-5px) scale(1.04);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(254, 228, 64, 0.55);
    background: linear-gradient(135deg, rgba(114, 9, 183, 0.9), rgba(60, 9, 108, 0.98));
}

.vocab-en {
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 6px;
    font-family: var(--font-en);
}

.vocab-ar {
    font-size: 1.15rem;
    color: #ffffff;
    font-weight: bold;
}

/* Grammar Tables */
.grammar-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 22px;
    background: rgba(36, 0, 70, 0.85);
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid var(--primary);
}

.grammar-table th {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    padding: 16px;
    font-weight: 900;
    font-size: 1.2rem;
}

.grammar-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(247, 37, 133, 0.2);
    color: var(--text-light);
    font-size: 1.1rem;
}

.grammar-example {
    background: rgba(60, 9, 108, 0.85);
    border: 1.5px solid var(--accent);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 14px;
    color: #ffffff;
    font-weight: bold;
}

/* Quiz Section */
.quiz-question {
    background: linear-gradient(135deg, rgba(46, 0, 85, 0.9) 0%, rgba(20, 0, 48, 0.95) 100%);
    border: 2px solid var(--primary);
    border-radius: 24px;
    padding: 22px;
    margin-bottom: 22px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.q-text {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 18px;
}

.q-option, .quiz-option-btn {
    background: rgba(60, 9, 108, 0.85);
    border: 2px solid rgba(254, 228, 64, 0.4);
    color: #ffffff !important;
    padding: 15px 22px;
    border-radius: 18px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.25s ease;
    margin: 8px 0;
    width: 100%;
    text-align: right;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.q-option:hover, .quiz-option-btn:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 8px 25px rgba(247, 37, 133, 0.5);
    transform: translateY(-2px);
}

.q-option.correct, .quiz-option-btn.correct {
    background: linear-gradient(135deg, #4cc9f0, #0077b6) !important;
    border-color: #fee440 !important;
    color: #000000 !important;
    font-weight: 900;
}

.q-option.wrong, .quiz-option-btn.wrong {
    background: linear-gradient(135deg, #f72585, #7209b7) !important;
    border-color: #ff5252 !important;
    color: #ffffff !important;
}

/* Play & Learn Big Action Button */
.butterfly-play-learn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 18px 42px;
    background: linear-gradient(135deg, #f72585 0%, #7209b7 50%, #fee440 100%);
    color: #ffffff !important;
    font-size: 1.7rem;
    font-weight: 900;
    font-family: var(--font-ar);
    border: 3px solid #fee440;
    border-radius: 50px;
    box-shadow: 0 10px 35px rgba(247, 37, 133, 0.6), 0 0 25px rgba(254, 228, 64, 0.8);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.butterfly-play-learn-btn:hover {
    transform: translateY(-6px) scale(1.06);
    box-shadow: 0 15px 45px rgba(254, 228, 64, 0.9), 0 0 35px rgba(247, 37, 133, 0.9);
}

/* =========================================================
   Fairy Crystal Ball Translator Bot UI
========================================================= */
#translator-bot-container {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 1000;
}

#translator-fab {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: 3.5px solid var(--accent);
    box-shadow: 0 8px 30px rgba(247, 37, 133, 0.6), 0 0 20px rgba(254, 228, 64, 0.7);
    color: white;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#translator-fab:hover {
    transform: scale(1.15) rotate(12deg);
    box-shadow: 0 12px 40px rgba(254, 228, 64, 0.9), 0 0 30px rgba(76, 201, 240, 0.8);
}

#translator-chat-window {
    position: fixed;
    bottom: 105px;
    left: 25px;
    width: 360px;
    max-width: 90vw;
    height: 500px;
    background: rgba(30, 0, 60, 0.95);
    border: 3px solid var(--accent);
    border-radius: 28px;
    box-shadow: 0 12px 40px rgba(114, 9, 183, 0.6), 0 0 25px rgba(247, 37, 133, 0.5);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    padding: 16px;
    color: white;
    font-weight: 900;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--accent);
}

.chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 85%;
    font-size: 1rem;
    line-height: 1.45;
}

.bot-message {
    background: rgba(60, 9, 108, 0.9);
    border: 1px solid var(--accent);
    color: #ffffff;
    align-self: flex-start;
}

.user-message {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    align-self: flex-end;
    font-weight: bold;
}

.chat-input-area {
    padding: 14px;
    background: rgba(20, 0, 42, 0.95);
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(247, 37, 133, 0.4);
}

.chat-input-area input {
    flex: 1;
    background: rgba(60, 9, 108, 0.9);
    border: 1.5px solid var(--primary);
    border-radius: 14px;
    padding: 12px;
    color: #ffffff;
    outline: none;
    font-size: 1rem;
}

.chat-input-area button {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #000;
    font-weight: bold;
    border-radius: 14px;
    padding: 10px 18px;
    border: none;
    cursor: pointer;
}

/* Toast */
.toast {
    position: fixed;
    top: 105px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 14px 35px;
    border-radius: 30px;
    font-weight: 900;
    font-size: 1.25rem;
    box-shadow: 0 10px 35px rgba(247, 37, 133, 0.6), 0 0 25px rgba(254, 228, 64, 0.8);
    border: 2px solid var(--accent);
    z-index: 2000;
    animation: fairySlideDown 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fairySlideDown {
    from { transform: translate(-50%, -25px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* Story Maker & Challenges */
.story-maker-container {
    background: linear-gradient(135deg, rgba(60, 9, 108, 0.85), rgba(36, 0, 70, 0.95));
    border: 2.5px solid var(--accent);
    border-radius: 28px;
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-top: 22px;
}

.story-toggle-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 900;
    font-size: 1.35rem;
    padding: 16px 32px;
    border-radius: 22px;
    border: 2px solid var(--accent);
    box-shadow: 0 8px 25px rgba(247, 37, 133, 0.4);
    cursor: pointer;
}

.story-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(254, 228, 64, 0.7);
}

.story-output {
    background: rgba(36, 0, 70, 0.95);
    border: 2px solid var(--accent);
    border-radius: 22px;
    padding: 22px;
    margin-top: 22px;
    color: #ffffff;
    font-size: 1.25rem;
    line-height: 1.85;
}

/* =========================================================
   Games Area & Mechanics (Fairy Garden Edition)
========================================================= */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
}

.game-card {
    background: linear-gradient(135deg, rgba(60, 9, 108, 0.88), rgba(36, 0, 70, 0.95));
    border: 2.5px solid rgba(254, 228, 64, 0.4);
    border-radius: 24px;
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.game-card:hover {
    transform: translateY(-7px) scale(1.04);
    border-color: var(--accent);
    box-shadow: 0 12px 35px rgba(254, 228, 64, 0.6), 0 0 25px rgba(247, 37, 133, 0.4);
    background: linear-gradient(135deg, rgba(114, 9, 183, 0.92), rgba(60, 9, 108, 0.98));
}

.game-card .icon {
    font-size: 3.2rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 14px rgba(254, 228, 64, 0.8));
}

.game-area {
    background: linear-gradient(135deg, rgba(46, 0, 85, 0.92), rgba(20, 0, 48, 0.96));
    border: 3px solid var(--accent);
    border-radius: 28px;
    padding: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    margin-top: 15px;
}

.game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 20px;
    background: rgba(36, 0, 70, 0.9);
    border: 2px solid var(--accent);
    border-radius: 22px;
    box-shadow: 0 4px 20px rgba(254, 228, 64, 0.3);
}

.game-hearts {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 10px #ff70a6);
}

.game-diamonds {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 10px #fee440);
}

.game-question {
    font-size: 1.65rem;
    font-weight: 900;
    color: var(--accent);
    text-align: center;
    margin: 16px 0;
    cursor: pointer;
    text-shadow: 0 0 12px rgba(254, 228, 64, 0.5);
    line-height: 1.5;
}

.question-translation {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-top: 8px;
    font-family: var(--font-ar);
    font-weight: bold;
}

.action-btn-go {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #12002b !important;
    border: 2px solid #ffffff;
    border-radius: 28px;
    padding: 15px 38px;
    font-size: 1.35rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(247, 37, 133, 0.5);
    transition: all 0.25s ease;
    margin-top: 15px;
}

.action-btn-go:hover {
    transform: scale(1.07);
    box-shadow: 0 12px 40px rgba(254, 228, 64, 0.8);
    border-color: var(--accent);
}

.timing-bar {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 55px;
    background: rgba(36, 0, 70, 0.9);
    border: 2.5px solid var(--accent);
    border-radius: 25px;
    display: flex;
    overflow: hidden;
    margin: 15px 0;
}

.timing-zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    border-right: 1px dashed rgba(254, 228, 64, 0.4);
}

.timing-needle {
    position: absolute;
    top: 0;
    width: 12px;
    height: 100%;
    background: #fee440;
    box-shadow: 0 0 20px #fee440, 0 0 35px #f72585;
    border-radius: 6px;
}

.striking-game {
    position: relative;
    width: 100%;
    max-width: 500px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.goals-row {
    display: flex;
    justify-content: space-around;
    width: 100%;
    gap: 10px;
}

.strike-goal {
    background: rgba(60, 9, 108, 0.9);
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 16px 20px;
    color: white;
    font-weight: bold;
    font-size: 1.25rem;
    flex: 1;
    text-align: center;
}

.crosshair {
    position: relative;
    font-size: 2.7rem;
    filter: drop-shadow(0 0 15px #fee440);
    margin: 20px 0;
}

.bouncing-game {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(60, 9, 108, 0.95), rgba(20, 0, 48, 0.98));
    border-radius: 24px;
    border: 2.5px solid var(--primary);
}

.bouncing-ball {
    position: absolute;
    bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: 2px solid #ffffff;
    color: #12002b;
    padding: 14px 26px;
    border-radius: 28px;
    font-weight: 900;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(247, 37, 133, 0.5);
    animation: fairyBounce 2.2s infinite ease-in-out alternate;
}

@keyframes fairyBounce {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-130px) scale(1.1); }
    100% { transform: translateY(0) scale(1); }
}

.dodge-game {
    position: relative;
    width: 100%;
    max-width: 520px;
    min-height: 240px;
    background: radial-gradient(circle at center, rgba(60, 9, 108, 0.95), rgba(20, 0, 48, 0.98));
    border: 3px solid var(--accent);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
}

.scrolling-road {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(247, 37, 133, 0.25) 20px, rgba(247, 37, 133, 0.25) 40px);
    animation: fairyRoad 0.8s infinite linear;
    pointer-events: none;
}

@keyframes fairyRoad {
    from { background-position: 0 0; }
    to { background-position: 0 40px; }
}

.enemies-row {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-around;
    width: 100%;
    gap: 12px;
    margin-top: 10px;
}

.enemy-obstacle {
    background: rgba(60, 9, 108, 0.9);
    border: 2.5px solid var(--accent);
    border-radius: 20px;
    padding: 15px 20px;
    color: white;
    font-weight: 900;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(247, 37, 133, 0.3);
    animation: fairyFloat 2s infinite ease-in-out alternate;
    transition: transform 0.2s ease, border-color 0.2s ease;
    text-align: center;
    flex: 1;
}

@keyframes fairyFloat {
    0% { transform: translateY(0px) scale(1); filter: drop-shadow(0 0 8px #f72585); }
    50% { transform: translateY(-30px) scale(1.1); filter: drop-shadow(0 0 20px #fee440); }
    100% { transform: translateY(0px) scale(1); filter: drop-shadow(0 0 8px #f72585); }
}

.enemy-obstacle:hover {
    transform: scale(1.12) !important;
    border-color: #ffffff;
    box-shadow: 0 10px 35px rgba(254, 228, 64, 0.8);
}

.smash-game {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.smash-crate {
    background: rgba(60, 9, 108, 0.9);
    border: 2.5px solid var(--accent);
    border-radius: 22px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease;
    min-width: 135px;
    box-shadow: 0 8px 25px rgba(247, 37, 133, 0.3);
}

.crate-box {
    font-size: 3rem;
    margin-top: 10px;
    filter: drop-shadow(0 0 14px #fee440);
}

.crate-label {
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.drag-drop-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    width: 100%;
}

.drag-items {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.drag-item {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: 2px solid var(--accent);
    color: white;
    padding: 14px 24px;
    border-radius: 22px;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: grab;
    box-shadow: 0 8px 25px rgba(247, 37, 133, 0.4);
}

.drop-zone {
    width: 100%;
    max-width: 480px;
    padding: 32px;
    border: 3px dashed var(--accent);
    border-radius: 28px;
    background: rgba(60, 9, 108, 0.9);
    color: var(--accent);
    font-weight: 900;
    font-size: 1.35rem;
    text-align: center;
    box-shadow: 0 8px 30px rgba(254, 228, 64, 0.35);
}

/* =========================================================
   Responsive Breakpoints
========================================================= */
@media (max-width: 860px) {
    .fairy-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 10px;
    }
    .fairy-header-center {
        order: 3;
        width: 100%;
        margin-top: 4px;
    }
    .user-profile-header {
        order: 1;
    }
    .header-actions {
        order: 2;
    }
    .user-avatar-glow {
        width: 52px;
        height: 52px;
    }
    .student-name {
        font-size: 1.1rem;
    }
    .btn-play-fairies {
        padding: 6px 12px;
        font-size: 0.82rem;
    }
    .btn-magical-back {
        padding: 6px 12px;
        font-size: 0.82rem;
    }
}

/* =========================================================
   Dancing Flowers Magic Particle System & Profile Magic
========================================================= */
.magic-glow-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    box-shadow: inset 0 0 100px rgba(247, 37, 133, 0.7), inset 0 0 160px rgba(254, 228, 64, 0.5), inset 0 0 200px rgba(76, 201, 240, 0.4);
    animation: magicalAuraPulse 1.2s ease-in-out infinite alternate;
    transition: opacity 0.8s ease;
}

@keyframes magicalAuraPulse {
    0% {
        box-shadow: inset 0 0 90px rgba(247, 37, 133, 0.8), inset 0 0 160px rgba(254, 228, 64, 0.6);
        background: radial-gradient(circle at 50% 10%, rgba(247, 37, 133, 0.18), transparent 70%);
    }
    50% {
        box-shadow: inset 0 0 130px rgba(76, 201, 240, 0.8), inset 0 0 190px rgba(254, 228, 64, 0.7);
        background: radial-gradient(circle at 50% 50%, rgba(76, 201, 240, 0.22), transparent 75%);
    }
    100% {
        box-shadow: inset 0 0 110px rgba(254, 228, 64, 0.8), inset 0 0 170px rgba(247, 37, 133, 0.7);
        background: radial-gradient(circle at 50% 90%, rgba(254, 228, 64, 0.2), transparent 70%);
    }
}

/* Avatar Royal Halo during Magic */
.user-avatar-glow.magic-active {
    animation: royalFairyGlow 1.1s ease-in-out infinite alternate !important;
}

@keyframes royalFairyGlow {
    0% {
        transform: scale(1.22) rotate(0deg);
        box-shadow: 0 0 35px #fee440, 0 0 65px #f72585, 0 0 95px #4cc9f0;
    }
    100% {
        transform: scale(1.3) rotate(8deg);
        box-shadow: 0 0 55px #f72585, 0 0 85px #fee440, 0 0 125px #ff70a6;
    }
}

/* Platform Dancing & Bobbing */
.magic-platform-dancing {
    animation: cutePlatformDance 1.4s ease-in-out infinite alternate;
}

@keyframes cutePlatformDance {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.008);
    }
    100% {
        transform: translateY(5px) scale(1);
    }
}

.magic-sparkle-card {
    animation: cardMagicSparkle 1.2s ease-in-out infinite alternate !important;
}

@keyframes cardMagicSparkle {
    0% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 25px rgba(247, 37, 133, 0.6);
        transform: translateY(-4px);
    }
    100% {
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 45px rgba(254, 228, 64, 0.85);
        transform: translateY(-10px) scale(1.03);
    }
}

/* Dancing Flowers & Musical Notes Particle */
.dancing-flower-particle {
    position: fixed;
    pointer-events: none;
    z-index: 10001;
    user-select: none;
    filter: drop-shadow(0 0 12px rgba(255, 112, 166, 0.9)) drop-shadow(0 0 6px rgba(254, 228, 64, 0.8));
    animation: danceFlowerScatter 3.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes danceFlowerScatter {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.3) rotate(0deg);
    }
    15% {
        opacity: 1;
        transform: translate(var(--tx, 0), var(--ty, 0)) scale(var(--scale, 1.3)) rotate(var(--rot, 45deg));
    }
    50% {
        opacity: 0.95;
        transform: translate(calc(var(--tx, 0) + var(--sway, 25px)), calc(var(--ty, 0) + 80px)) scale(var(--scale, 1.1)) rotate(calc(var(--rot, 45deg) + 180deg));
    }
    85% {
        opacity: 0.8;
        transform: translate(calc(var(--tx, 0) - var(--sway, 25px)), calc(var(--ty, 0) + 200px)) scale(calc(var(--scale, 1) * 0.9)) rotate(calc(var(--rot, 45deg) + 360deg));
    }
    100% {
        opacity: 0;
        transform: translate(calc(var(--tx, 0) + 15px), calc(var(--ty, 0) + 360px)) scale(0.35) rotate(calc(var(--rot, 45deg) + 540deg));
    }
}