/* ============================================
   GAME ECONOMY SYSTEM - Styling
   ============================================
   Version: 4.0 - SUNWELL MIDNIGHT ☀️🌙

   Components:
   - Game Profile Card
   - Action Buttons
   - XP Conversion Dialog
   - Transaction History
   - Sunwell/Void Theme (WoW Midnight)
   ============================================ */

/* ===== CSS VARIABLES - SUNWELL MIDNIGHT ===== */
:root {
    /* === VOID BASE COLORS === */
    --void-cosmic: #0D001A;           /* Deepest void */
    --void-deep: #1A0033;             /* Deep purple void */
    --void-indigo: #2E0854;           /* Void indigo */
    --void-purple: #4B0082;           /* Primary void */

    /* === SUNWELL LIGHT === */
    --sunwell-gold: #FFD700;          /* Primary gold */
    --sunwell-amber: #FFAA00;         /* Warm amber */
    --sunwell-light: #FFF8DC;         /* Light cream */
    --sunwell-glow: #FFE4B5;          /* Soft glow */

    /* === SILVERMOON === */
    --silvermoon-gold: #C9A227;       /* Silvermoon gold */
    --silvermoon-bronze: #8B4513;     /* Bronze accent */
    --blood-red: #8B0000;             /* Blood elf red */
    --blood-crimson: #DC143C;         /* Crimson accent */

    /* === BIOLUMINESCENT === */
    --bio-cyan: #00CED1;              /* Glowing cyan */
    --bio-green: #00FF7F;             /* Spring green */
    --bio-teal: #20B2AA;              /* Teal glow */

    /* === VOID MAGIC === */
    --void-pink: #9932CC;             /* Dark orchid */
    --void-blue: #4169E1;             /* Royal blue */

    /* === LEGACY VARIABLES (for compatibility) === */
    --game-card-bg: linear-gradient(135deg,
        rgba(13, 0, 26, 0.95) 0%,      /* Void Cosmic */
        rgba(46, 8, 84, 0.95) 100%);   /* Void Indigo */

    --game-card-border: linear-gradient(135deg,
        #FFD700,  /* Sunwell Gold */
        #9932CC,  /* Void Pink */
        #00CED1,  /* Bio Cyan */
        #FFD700); /* Sunwell Gold */

    --game-button-primary: linear-gradient(135deg,
        #4B0082 0%,   /* Void Purple */
        #9932CC 50%,  /* Void Pink */
        #FFD700 100%); /* Sunwell Gold */

    --game-button-disabled: linear-gradient(135deg,
        #1A0033 0%,   /* Void Deep */
        #333 100%);

    --game-text-light: #FFF8DC;

    --game-text-holo: linear-gradient(135deg,
        #FFD700,  /* Sunwell Gold */
        #9932CC,  /* Void Pink */
        #00CED1); /* Bio Cyan */

    /* === COMPONENT COLORS === */
    --points-color: #FFD700;          /* Sunwell Gold */
    --streak-color: #00CED1;          /* Bio Cyan */
    --xp-color: #9932CC;              /* Void Pink */

    /* === DIALOG === */
    --dialog-overlay: rgba(13, 0, 26, 0.95);
    --dialog-bg: linear-gradient(135deg,
        #0D001A 0%,   /* Void Cosmic */
        #2E0854 100%); /* Void Indigo */
    --dialog-border: linear-gradient(135deg,
        #FFD700,  /* Sunwell Gold */
        #9932CC,  /* Void Pink */
        #00CED1); /* Bio Cyan */

    /* === ADVANCED GRADIENTS === */
    --gradient-enchanted: linear-gradient(135deg,
        #FFD700 0%,   /* Sunwell Gold */
        #9932CC 25%,  /* Void Pink */
        #00CED1 50%,  /* Bio Cyan */
        #4169E1 75%,  /* Void Blue */
        #FFD700 100%); /* Loop back to Gold */

    --gradient-forest-depth: linear-gradient(135deg,
        rgba(75, 0, 130, 0.25) 0%,     /* Void Purple */
        rgba(46, 8, 84, 0.2) 50%,       /* Void Indigo */
        rgba(153, 50, 204, 0.15) 100%); /* Void Pink */

    --glow-firefly: 0 0 20px rgba(255, 215, 0, 0.6),
                    0 0 40px rgba(255, 215, 0, 0.4);

    --glow-moss: 0 0 15px rgba(153, 50, 204, 0.5),
                 0 0 30px rgba(153, 50, 204, 0.3);

    --glow-mystic: 0 0 20px rgba(0, 206, 209, 0.6),
                   0 0 40px rgba(0, 206, 209, 0.4);

    --glow-sunwell: 0 0 20px rgba(255, 215, 0, 0.6),
                    0 0 40px rgba(255, 215, 0, 0.4);

    --glow-void: 0 0 20px rgba(75, 0, 130, 0.6),
                 0 0 40px rgba(153, 50, 204, 0.4);
}

/* ===== COMPACT COIN BADGE - SUNWELL GLOW GLASSMORPHISM ☀️ ===== */
.game-coin-badge {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000;

    /* CRITICAL: Visible by default when rendered (JS handles visibility) */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    /* Glassmorphism design - Void theme */
    width: 80px;
    padding: 10px 8px;
    background: linear-gradient(135deg,
        rgba(13, 0, 26, 0.6),
        rgba(46, 8, 84, 0.5)
    );
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 25px;

    /* Sunwell glow effect */
    box-shadow:
        0 0 30px rgba(255, 215, 0, 0.5),
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 0 20px rgba(255, 215, 0, 0.1);

    /* Click hint */
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;

    /* Floating animation */
    animation:
        gentleFloat 4s ease-in-out infinite,
        sunwellPulse 3s ease-in-out infinite;
}

/* Gentle floating effect */
@keyframes gentleFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Sunwell glow pulse */
@keyframes sunwellPulse {
    0%, 100% {
        box-shadow:
            0 0 25px rgba(255, 215, 0, 0.4),
            0 8px 32px rgba(0, 0, 0, 0.4),
            inset 0 0 15px rgba(255, 215, 0, 0.08);
    }
    50% {
        box-shadow:
            0 0 40px rgba(255, 215, 0, 0.7),
            0 8px 32px rgba(0, 0, 0, 0.4),
            inset 0 0 25px rgba(255, 215, 0, 0.15);
    }
}

.game-coin-badge:hover {
    transform: translateY(-4px) scale(1.05);
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow:
        0 0 45px rgba(255, 215, 0, 0.8),
        0 12px 40px rgba(0, 0, 0, 0.5),
        inset 0 0 30px rgba(255, 215, 0, 0.2);
}

.game-coin-badge:active {
    transform: translateY(0) scale(0.98);
}

/* Claim indicator (pulsing gift) */
.badge-claim-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 24px;
    animation: claimPulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
}

@keyframes claimPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
    }
    50% {
        transform: scale(1.2);
        filter: drop-shadow(0 0 12px rgba(255, 215, 0, 1));
    }
}

/* Has unclaimed - enhanced sunwell glow */
.game-coin-badge.has-unclaimed {
    animation:
        gentleFloat 4s ease-in-out infinite,
        sunwellGlowUnclaimed 2s ease-in-out infinite;
}

@keyframes sunwellGlowUnclaimed {
    0%, 100% {
        box-shadow:
            0 0 35px rgba(255, 215, 0, 0.6),
            0 0 60px rgba(255, 170, 0, 0.4),
            0 8px 32px rgba(0, 0, 0, 0.4),
            inset 0 0 25px rgba(255, 215, 0, 0.15);
        border-color: rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow:
            0 0 50px rgba(255, 215, 0, 0.9),
            0 0 80px rgba(255, 170, 0, 0.6),
            0 8px 32px rgba(0, 0, 0, 0.4),
            inset 0 0 35px rgba(255, 215, 0, 0.25);
        border-color: rgba(255, 215, 0, 0.8);
    }
}

/* ===== TOTEM CRYSTAL FUSION ANIMATIONS ===== */

/* Enchanted text animation - smooth 4-color gradient loop ✨ */
@keyframes enchantedText {
    0% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 50% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    75% {
        background-position: 150% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

/* Legacy holographic text animation (fallback) */
@keyframes holographicText {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Tribal pattern pulse animation */
@keyframes tribalPulse {
    0%, 100% {
        opacity: 0.3;
        transform: rotate(0deg);
    }
    50% {
        opacity: 0.6;
        transform: rotate(5deg);
    }
}

/* Golden Pulse - Firefly magic glow for buttons ✨ */
@keyframes goldenPulse {
    0%, 100% {
        box-shadow:
            0 6px 18px rgba(0, 0, 0, 0.6),
            0 0 25px rgba(255, 179, 0, 0.5),
            0 0 40px rgba(255, 167, 38, 0.3),
            inset 0 2px 6px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow:
            0 8px 24px rgba(0, 0, 0, 0.7),
            0 0 40px rgba(255, 179, 0, 0.8),
            0 0 60px rgba(255, 213, 79, 0.5),
            inset 0 2px 8px rgba(255, 255, 255, 0.3);
    }
}

/* Mystic Glow - Enchanted teal glow for convert buttons 💎 */
@keyframes mysticGlow {
    0%, 100% {
        box-shadow:
            0 6px 18px rgba(0, 0, 0, 0.6),
            0 0 25px rgba(38, 166, 154, 0.5),
            0 0 40px rgba(77, 208, 225, 0.3),
            inset 0 2px 6px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow:
            0 8px 24px rgba(0, 0, 0, 0.7),
            0 0 40px rgba(38, 166, 154, 0.8),
            0 0 60px rgba(77, 208, 225, 0.5),
            inset 0 2px 8px rgba(255, 255, 255, 0.3);
    }
}

/* Legacy crystal glow animation (replaced by goldenPulse) */
@keyframes crystalGlow {
    0%, 100% {
        box-shadow:
            0 6px 18px rgba(0, 0, 0, 0.6),
            0 0 20px rgba(255, 179, 0, 0.3),
            inset 0 2px 6px rgba(255, 255, 255, 0.15);
    }
    50% {
        box-shadow:
            0 8px 24px rgba(0, 0, 0, 0.7),
            0 0 35px rgba(255, 179, 0, 0.6),
            inset 0 2px 8px rgba(255, 255, 255, 0.2);
    }
}

/* Shimmer animation for stat items */
@keyframes shimmer {
    0%, 100% {
        background-position: -200% center;
    }
    50% {
        background-position: 200% center;
    }
}

/* ===== VOID/SUNWELL SPECIAL EFFECTS ===== */

/* Magical particles - floating void/sunwell lights ☀️🌙 */
.firefly {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle,
        var(--sunwell-gold) 0%,
        var(--sunwell-amber) 40%,
        transparent 70%);
    border-radius: 50%;
    filter: blur(3px);
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 0 10px var(--sunwell-gold);
}

/* Individual firefly positions and timing */
.firefly-1 {
    left: 15%;
    top: 20%;
    animation: fireflyFloat1 4s ease-in-out infinite;
}

.firefly-2 {
    left: 75%;
    top: 40%;
    width: 6px;
    height: 6px;
    animation: fireflyFloat2 5s ease-in-out infinite 1s;
}

.firefly-3 {
    left: 30%;
    top: 60%;
    animation: fireflyFloat3 6s ease-in-out infinite 2s;
}

.firefly-4 {
    left: 85%;
    top: 25%;
    width: 7px;
    height: 7px;
    animation: fireflyFloat1 4.5s ease-in-out infinite 1.5s;
}

.firefly-5 {
    left: 50%;
    top: 80%;
    animation: fireflyFloat2 5.5s ease-in-out infinite 3s;
}

.firefly-6 {
    left: 40%;
    top: 35%;
    width: 5px;
    height: 5px;
    animation: fireflyFloat3 5s ease-in-out infinite 4s;
}

/* Firefly float animations with different patterns */
@keyframes fireflyFloat1 {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.4;
    }
    25% {
        opacity: 1;
    }
    50% {
        transform: translateY(-40px) translateX(10px);
        opacity: 0.7;
    }
    75% {
        opacity: 0.9;
    }
}

@keyframes fireflyFloat2 {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.3;
    }
    33% {
        transform: translateY(-25px) translateX(-15px);
        opacity: 1;
    }
    66% {
        transform: translateY(-10px) translateX(5px);
        opacity: 0.6;
    }
}

@keyframes fireflyFloat3 {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.5;
    }
    40% {
        transform: translateY(-30px) translateX(20px);
        opacity: 0.8;
    }
    80% {
        transform: translateY(-15px) translateX(-10px);
        opacity: 1;
    }
}

/* Floating leaves - gentle drift 🍃 */
.floating-leaf {
    position: absolute;
    font-size: 22px;
    opacity: 0;
    pointer-events: none;
    z-index: 4;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

.leaf-1 {
    left: 10%;
    top: -30px;
    animation: leafDrift1 18s linear infinite;
}

.leaf-2 {
    left: 60%;
    top: -30px;
    animation: leafDrift2 22s linear infinite 6s;
}

.leaf-3 {
    left: 90%;
    top: -30px;
    font-size: 18px;
    animation: leafDrift1 20s linear infinite 12s;
}

.leaf-4 {
    left: 35%;
    top: -30px;
    font-size: 20px;
    animation: leafDrift2 19s linear infinite 15s;
}

/* Leaf drift animations with rotation and sway */
@keyframes leafDrift1 {
    0% {
        transform: translateY(-30px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.25;
    }
    50% {
        transform: translateY(50vh) translateX(40px) rotate(180deg);
        opacity: 0.3;
    }
    90% {
        opacity: 0.25;
    }
    100% {
        transform: translateY(100vh) translateX(-30px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes leafDrift2 {
    0% {
        transform: translateY(-30px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    15% {
        opacity: 0.3;
    }
    50% {
        transform: translateY(50vh) translateX(-50px) rotate(-180deg);
        opacity: 0.35;
    }
    85% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(100vh) translateX(40px) rotate(-360deg);
        opacity: 0;
    }
}

/* Points display in badge */
.badge-points {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 4px;
}

.badge-points .badge-icon {
    font-size: 20px;
    filter: drop-shadow(1px 1px 3px rgba(0, 0, 0, 0.8));
}

.badge-points .badge-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--points-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

/* Streak display in badge */
.badge-streak {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding-top: 4px;
    border-top: 1px solid rgba(139, 90, 60, 0.4);
}

.badge-streak .badge-icon {
    font-size: 14px;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.8));
}

.badge-streak .badge-value {
    font-size: 14px;
    font-weight: bold;
    color: var(--streak-color);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}

/* Show badge ONLY in games view - NUCLEAR OVERRIDE */
body[data-view="games"] .game-coin-badge,
body[data-view="games"] div.game-coin-badge,
.game-coin-badge {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ===== FULL GAME PROFILE VIEW (Fullscreen Overlay) ===== */
.game-profile-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg,
        var(--void-cosmic) 0%,
        var(--void-deep) 50%,
        var(--void-indigo) 100%);
    overflow: hidden;
    animation: slideInRight 0.3s ease;
}

/* Sunwell/Void overlay - animated diagonal gradients ☀️🌙 */
.game-profile-fullscreen::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(45deg, transparent 30%, rgba(255, 215, 0, 0.08) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(153, 50, 204, 0.08) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: holographicShift 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   MODERN SWIPE-TO-CLOSE HEADER 🌿
   2025 Gesture-based Design
   ============================================ */

/* Profile header - Sunwell Midnight ☀️🌙 */
.game-profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 16px 10px;
    gap: 6px;
    background: linear-gradient(135deg,
        rgba(13, 0, 26, 0.95) 0%,
        rgba(46, 8, 84, 0.95) 50%,
        rgba(13, 0, 26, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid transparent;
    border-image: var(--game-card-border) 1;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 215, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

.game-profile-header:active {
    cursor: grabbing;
}

/* Subtle sunwell glow decoration on header */
.game-profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 50%, rgba(153, 50, 204, 0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* ===== DRAG HANDLE WRAPPER ===== */
.drag-handle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

/* ===== DRAG HANDLE - Woodland Design ===== */
.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 0;
    animation: dragHandlePulse 3s ease-in-out infinite;
}

/* Handle leaves - Enchanted forest emojis */
.handle-leaf {
    font-size: 18px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    animation: leafSway 4s ease-in-out infinite;
}

.handle-leaf:first-child {
    animation-delay: 0s;
}

.handle-leaf:last-child {
    animation-delay: 0.5s;
    transform: scaleX(-1); /* Mirror the right leaf */
}

/* Handle line - Wooden bar */
.handle-line {
    width: 48px;
    height: 4px;
    border-radius: 3px;
    background: linear-gradient(90deg,
        rgba(255, 179, 0, 0.6) 0%,
        rgba(124, 179, 66, 0.8) 20%,
        rgba(139, 195, 74, 0.9) 50%,
        rgba(124, 179, 66, 0.8) 80%,
        rgba(255, 179, 0, 0.6) 100%);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 0 10px rgba(255, 179, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
    position: relative;
}

/* Firefly glow on handle line */
.handle-line::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -4px;
    right: -4px;
    bottom: -2px;
    background: radial-gradient(ellipse,
        rgba(255, 179, 0, 0.4) 0%,
        transparent 70%);
    border-radius: 4px;
    animation: fireflyGlow 2s ease-in-out infinite;
    pointer-events: none;
}

/* ===== ANIMATIONS ===== */

/* Drag handle pulse - Subtle breathing effect */
@keyframes dragHandlePulse {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(1px);
        opacity: 0.85;
    }
}

/* Leaf sway - Natural movement */
@keyframes leafSway {
    0%, 100% {
        transform: rotate(0deg) translateY(0);
    }
    25% {
        transform: rotate(-3deg) translateY(-1px);
    }
    75% {
        transform: rotate(3deg) translateY(1px);
    }
}

/* Firefly glow on handle */
@keyframes fireflyGlow {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.game-btn-back,
.game-btn-close {
    background: rgba(44, 127, 67, 0.3);
    backdrop-filter: blur(5px);
    border: 2px solid transparent;
    border-image: var(--game-card-border) 1;
    clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
    color: var(--game-text-light);
    font-size: 16px;
    font-weight: bold;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.game-btn-back:hover,
.game-btn-close:hover {
    background: rgba(44, 127, 67, 0.5);
    box-shadow: 0 0 15px rgba(124, 179, 66, 0.6);
    transform: scale(1.05);
}

.game-btn-close {
    padding: 10px 14px;
    font-size: 18px;
}

.profile-header-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    padding: 0;
    background: var(--gradient-enchanted);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: enchantedText 8s ease-in-out infinite;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.9));
    text-align: center;
    line-height: 1.2;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ============================================
   COLLAPSED HEADER - Mini Stats 📊
   ============================================ */

/* Mini stats container - Hidden by default */
.header-mini-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Individual mini stat */
.mini-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Mini stat icon */
.mini-stat-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

/* Mini stat value */
.mini-stat-value {
    font-size: 16px;
    font-weight: bold;
    color: var(--firefly-gold);
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.9),
        0 0 10px rgba(255, 179, 0, 0.4);
    line-height: 1;
}

/* Streak value - different color */
.mini-stat-streak .mini-stat-value {
    color: var(--moss-fresh);
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.9),
        0 0 10px rgba(124, 179, 66, 0.4);
}

/* ===== COLLAPSED STATE ===== */
.game-profile-header.header-collapsed {
    padding: 8px 16px;
    gap: 0;
}

/* Hide drag handle when collapsed */
.game-profile-header.header-collapsed .drag-handle-wrapper {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

/* Hide title when collapsed */
.game-profile-header.header-collapsed .profile-header-title {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

/* Show mini stats when collapsed */
.game-profile-header.header-collapsed .header-mini-stats {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ============================================
   MAGIC EFFECTS - Woodland Particles ✨
   ============================================ */

/* Firefly burst particles - Appear on swipe close */
.magic-firefly-particle {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 179, 0, 1) 0%,
        rgba(255, 167, 38, 0.9) 40%,
        rgba(255, 213, 79, 0.7) 70%,
        transparent 100%);
    box-shadow:
        0 0 10px rgba(255, 179, 0, 0.8),
        0 0 20px rgba(255, 179, 0, 0.5);
    pointer-events: none;
    z-index: 10000;
    animation: fireflyBurstParticle 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Firefly burst animation */
@keyframes fireflyBurstParticle {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(calc(var(--end-x) * 0.7), calc(var(--end-y) * 0.7)) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(var(--end-x), var(--end-y)) scale(0.5);
    }
}

/* Leaf flutter particles - Gentle falling */
.magic-leaf-particle {
    position: fixed;
    font-size: 24px;
    pointer-events: none;
    z-index: 10000;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    animation: leafFlutterParticle 1.5s ease-in-out forwards;
}

/* Leaf flutter animation */
@keyframes leafFlutterParticle {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(100px) rotate(90deg) translateX(-20px);
    }
    50% {
        transform: translateY(200px) rotate(180deg) translateX(10px);
    }
    75% {
        opacity: 0.7;
        transform: translateY(300px) rotate(270deg) translateX(-15px);
    }
    100% {
        opacity: 0;
        transform: translateY(400px) rotate(360deg) translateX(0);
    }
}

/* Opening glow effect - Gentle welcome */
.game-profile-header.opening-glow {
    animation: headerOpeningGlow 0.8s ease-out;
}

@keyframes headerOpeningGlow {
    0% {
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.6),
            0 0 20px rgba(255, 179, 0, 0.15),
            inset 0 1px 2px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.6),
            0 0 40px rgba(255, 179, 0, 0.6),
            0 0 60px rgba(124, 179, 66, 0.4),
            inset 0 1px 2px rgba(255, 255, 255, 0.2);
    }
    100% {
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.6),
            0 0 20px rgba(255, 179, 0, 0.15),
            inset 0 1px 2px rgba(255, 255, 255, 0.1);
    }
}

/* Profile body - scrollable */
.game-profile-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 70px);
    padding: 16px;
    padding-bottom: 100px;
    position: relative;
    z-index: 1;
}

/* Stat cards (points, streak) - Enchanted Woodland 🌲 */
.profile-stat-card {
    position: relative;
    background: linear-gradient(135deg,
        rgba(44, 127, 67, 0.25) 0%,
        rgba(124, 179, 66, 0.2) 50%,
        rgba(52, 87, 26, 0.25) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    border-image: var(--game-card-border) 1;
    clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow:
        0 10px 40px rgba(255, 179, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);

    display: flex;
    align-items: center;
    gap: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* ENCHANTED SPIRIT AURA - Glowing halo around animal icons ✨🌲 */
.profile-stat-card::after {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 90px;
    background: radial-gradient(circle,
        rgba(124, 179, 66, 0.6) 0%,
        rgba(124, 179, 66, 0.4) 30%,
        rgba(139, 195, 74, 0.3) 50%,
        rgba(124, 179, 66, 0.2) 70%,
        transparent 100%);
    border-radius: 50%;
    filter: blur(18px);
    animation: spiritPulse 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 8;
}

/* FIREFLY AURA - Golden magic glow for points card 🪙✨ */
.points-card::after {
    background: radial-gradient(circle,
        rgba(255, 179, 0, 0.8) 0%,      /* Firefly Gold - intense center */
        rgba(255, 167, 38, 0.6) 20%,    /* Firefly Amber */
        rgba(255, 213, 79, 0.5) 40%,    /* Firefly Yellow */
        rgba(255, 249, 196, 0.3) 60%,   /* Firefly Pale */
        rgba(255, 179, 0, 0.2) 80%,     /* Gold fade */
        transparent 100%);
    filter: blur(20px);
    animation: fireflyPulse 4s ease-in-out infinite;
    width: 100px;
    height: 100px;
}

/* MYSTIC AURA - Enchanted teal glow for streak card 🦊💎 */
.streak-card::after {
    background: radial-gradient(circle,
        rgba(38, 166, 154, 0.8) 0%,     /* Mystic Teal - intense center */
        rgba(77, 208, 225, 0.6) 25%,    /* Mystic Cyan */
        rgba(38, 166, 154, 0.5) 50%,    /* Mystic Teal mid */
        rgba(0, 105, 92, 0.3) 70%,      /* Mystic Deep */
        rgba(77, 208, 225, 0.2) 85%,    /* Cyan fade */
        transparent 100%);
    filter: blur(20px);
    animation: mysticPulse 5s ease-in-out infinite;
    width: 100px;
    height: 100px;
}

/* FIREFLY PULSE - Breathing golden glow with gentle rotation ✨ */
@keyframes fireflyPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1) rotate(0deg);
        opacity: 0.7;
        filter: blur(20px);
    }
    33% {
        transform: translateX(-50%) scale(1.3) rotate(120deg);
        opacity: 1;
        filter: blur(25px);
    }
    66% {
        transform: translateX(-50%) scale(1.1) rotate(240deg);
        opacity: 0.85;
        filter: blur(22px);
    }
}

/* MYSTIC PULSE - Enchanted teal glow with slower rotation 💎 */
@keyframes mysticPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1) rotate(0deg);
        opacity: 0.6;
        filter: blur(20px);
    }
    40% {
        transform: translateX(-50%) scale(1.4) rotate(-90deg);
        opacity: 0.95;
        filter: blur(28px);
    }
    80% {
        transform: translateX(-50%) scale(1.2) rotate(-180deg);
        opacity: 0.75;
        filter: blur(24px);
    }
}

/* Fallback simple pulse for default cards */
@keyframes spiritPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translateX(-50%) scale(1.3);
        opacity: 1;
    }
}

/* Enchanted glow animation on hover ✨ */
.profile-stat-card:hover {
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(255, 179, 0, 0.5),
        inset 0 2px 8px rgba(255, 255, 255, 0.2);
    animation: goldenPulse 2s ease-in-out infinite;
}

/* Animal spirit icon decoration - Enchanted glow ✨ */
.profile-stat-card::before {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 30px;
    filter:
        drop-shadow(0 0 10px rgba(255, 179, 0, 0.8))
        drop-shadow(0 0 20px rgba(255, 179, 0, 0.6))
        drop-shadow(0 0 30px rgba(255, 213, 79, 0.4));
    animation: iconFloat 4s ease-in-out infinite;
    z-index: 10;
}

/* Floating animation for icons */
@keyframes iconFloat {
    0%, 100% {
        transform: translateX(-50%) translateY(0px);
    }
    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.points-card::before {
    content: '🦉';
}

.streak-card::before {
    content: '🦊';
}

.profile-stat-card .card-icon {
    font-size: 48px;
    filter: drop-shadow(2px 3px 8px rgba(0, 0, 0, 0.8));
    flex-shrink: 0;
}

.profile-stat-card .card-content {
    flex: 1;
}

.profile-stat-card .card-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    /* Enchanted Woodland gradient text */
    background: linear-gradient(135deg,
        var(--moss-bright) 0%,
        var(--firefly-gold) 50%,
        var(--moss-fresh) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.7));
    animation: enchantedText 8s ease-in-out infinite;
}

.profile-stat-card .card-value {
    font-size: 32px;
    font-weight: bold;
    background: var(--gradient-enchanted);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.9));
    animation: enchantedText 8s ease-in-out infinite;
    line-height: 1;
    margin-bottom: 4px;
}

.profile-stat-card .card-sublabel {
    font-size: 12px;
    font-weight: 500;
    /* Enchanted Woodland gradient text (softer) */
    background: linear-gradient(135deg,
        var(--moss-fresh) 0%,
        var(--mystic-teal) 50%,
        var(--moss-bright) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.6));
    animation: enchantedText 10s ease-in-out infinite;
    opacity: 0.85;
}

/* Points card highlight */
.points-card .card-value {
    color: var(--points-color);
}

/* Streak card highlight */
.streak-card .card-value {
    color: var(--streak-color);
}

/* Profile sections - Enchanted Woodland 🌲 */
.game-profile-section {
    position: relative;
    background: linear-gradient(135deg,
        rgba(44, 127, 67, 0.18) 0%,
        rgba(124, 179, 66, 0.15) 50%,
        rgba(52, 87, 26, 0.18) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    border-image: var(--game-card-border) 1;
    clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow:
        0 10px 40px rgba(255, 179, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

/* Enchanted pattern decoration - Moss & Firefly X ✨🌿 */
.game-profile-section::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background:
        linear-gradient(45deg, transparent 40%, var(--firefly-gold) 40%, var(--firefly-gold) 60%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, var(--moss-fresh) 40%, var(--moss-fresh) 60%, transparent 60%);
    opacity: 0.35;
    animation: tribalPulse 3s ease-in-out infinite;
    pointer-events: none;
}

.game-profile-section:hover {
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.6),
        0 0 25px rgba(124, 179, 66, 0.4),
        inset 0 2px 8px rgba(255, 255, 255, 0.15);
}

.game-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(139, 90, 60, 0.3);
}

.game-section-icon {
    font-size: 24px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.game-section-title {
    font-size: 16px;
    font-weight: bold;
    background: var(--gradient-enchanted);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: enchantedText 8s ease-in-out infinite;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.game-section-content {
    padding: 4px 0;
}

/* Action buttons in profile - CRYSTAL SHAPES (EXACT DEMO MATCH) */
.btn-profile-action {
    position: relative;
    width: 100%;
    padding: 14px;
    border: 2px solid transparent;
    border-image: var(--game-card-border) 1;
    clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    touch-action: manipulation;
}

.btn-claim {
    background: var(--game-button-primary);
    color: white;
    margin-top: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.btn-claim:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 8px 24px rgba(255, 179, 0, 0.7),
        0 0 30px rgba(255, 179, 0, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    animation: goldenPulse 2s ease-in-out infinite;
}

.btn-convert {
    background: linear-gradient(135deg,
        var(--mystic-teal) 0%,
        var(--mystic-cyan) 50%,
        var(--mystic-deep) 100%);
    color: white;
    margin-top: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.btn-convert:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 8px 24px rgba(38, 166, 154, 0.7),
        0 0 30px rgba(77, 208, 225, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    animation: mysticGlow 2s ease-in-out infinite;
}

/* Text in sections */
.reward-text,
.conversion-text {
    color: var(--game-text-light);
    font-size: 14px;
    margin: 8px 0;
    line-height: 1.4;
}

.reward-text.claimed {
    color: #4ade80;
    font-weight: 600;
}

.reward-hint,
.conversion-hint {
    color: var(--game-text-light);
    font-size: 12px;
    opacity: 0.7;
    margin-top: 6px;
}

.conversion-text.disabled {
    color: #999;
}

/* ===== SECRET CODE SECTION - ENCHANTED WOODLAND 🗝️✨ ===== */

/* Secret code section wrapper */
.secret-code-section {
    position: relative;
    overflow: hidden;
}

/* Collapsed trigger button (default state) - MAGICAL SHIMMER ✨ */
.secret-code-trigger {
    position: relative;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg,
        rgba(139, 90, 60, 0.25) 0%,
        rgba(109, 76, 65, 0.22) 50%,
        rgba(93, 64, 55, 0.25) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    border-image: linear-gradient(135deg,
        rgba(139, 90, 60, 0.5),
        rgba(255, 179, 0, 0.4),
        rgba(124, 179, 66, 0.5)) 1;
    clip-path: polygon(8% 0%, 92% 0%, 100% 10%, 100% 90%, 92% 100%, 8% 100%, 0% 90%, 0% 10%);
    font-size: 15px;
    font-weight: 600;
    color: var(--firefly-gold);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.secret-code-trigger:hover {
    background: linear-gradient(135deg,
        rgba(139, 90, 60, 0.35) 0%,
        rgba(109, 76, 65, 0.32) 50%,
        rgba(93, 64, 55, 0.35) 100%);
    box-shadow:
        0 6px 18px rgba(255, 179, 0, 0.4),
        0 0 25px rgba(255, 179, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.secret-code-trigger:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

/* Trigger elements */
.trigger-icon {
    font-size: 20px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.trigger-text {
    font-size: 15px;
    letter-spacing: 0.5px;
}

.trigger-sparkle {
    font-size: 16px;
    animation: sparkleRotate 3s ease-in-out infinite;
}

@keyframes sparkleRotate {
    0%, 100% {
        transform: rotate(0deg) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: rotate(180deg) scale(1.2);
        opacity: 1;
    }
}

/* Expanded input wrapper (hidden by default) */
.secret-code-input-wrapper {
    margin-top: 16px;
    animation: slideDown 0.3s ease;
}

/* Input container - GLASSMORPHIC DESIGN 🌲 */
.secret-code-input-container {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

/* Text input - ENCHANTED WOODLAND STYLE ✨ */
.secret-code-input {
    flex: 1;
    padding: 14px 16px;
    background: linear-gradient(135deg,
        rgba(27, 58, 31, 0.45) 0%,
        rgba(44, 127, 67, 0.4) 100%);
    backdrop-filter: blur(12px);
    border: 2px solid transparent;
    border-image: linear-gradient(135deg,
        rgba(124, 179, 66, 0.6),
        rgba(255, 179, 0, 0.5),
        rgba(38, 166, 154, 0.6)) 1;
    clip-path: polygon(6% 0%, 94% 0%, 100% 8%, 100% 92%, 94% 100%, 6% 100%, 0% 92%, 0% 8%);
    color: var(--game-text-light);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.5),
        inset 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    outline: none;
}

.secret-code-input::placeholder {
    color: rgba(240, 249, 255, 0.4);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: none;
}

.secret-code-input:focus {
    background: linear-gradient(135deg,
        rgba(27, 58, 31, 0.55) 0%,
        rgba(44, 127, 67, 0.5) 100%);
    border-image: linear-gradient(135deg,
        rgba(255, 179, 0, 0.8),
        rgba(124, 179, 66, 0.7),
        rgba(38, 166, 154, 0.8)) 1;
    box-shadow:
        0 6px 18px rgba(255, 179, 0, 0.4),
        0 0 25px rgba(255, 179, 0, 0.3),
        inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Success state - GREEN GLOW 🌿 */
.secret-code-input.success {
    background: linear-gradient(135deg,
        rgba(27, 58, 31, 0.55) 0%,
        rgba(44, 127, 67, 0.6) 100%);
    border-image: linear-gradient(135deg,
        #4ade80,
        #7CB342,
        #8BC34A) 1;
    box-shadow:
        0 6px 18px rgba(74, 222, 128, 0.5),
        0 0 30px rgba(124, 179, 66, 0.6),
        inset 0 2px 8px rgba(0, 0, 0, 0.4);
    animation: successPulse 0.6s ease-out;
}

/* Error state - RED SHAKE ⚠️ */
.secret-code-input.error {
    background: linear-gradient(135deg,
        rgba(127, 29, 29, 0.4) 0%,
        rgba(185, 28, 28, 0.35) 100%);
    border-image: linear-gradient(135deg,
        #ef4444,
        #dc2626,
        #b91c1c) 1;
    box-shadow:
        0 6px 18px rgba(239, 68, 68, 0.5),
        0 0 25px rgba(220, 38, 38, 0.4),
        inset 0 2px 8px rgba(0, 0, 0, 0.5);
    animation: shake 0.5s ease;
}

/* Submit button - CRYSTAL SEARCH ICON 🔍 */
.secret-code-submit {
    padding: 14px 18px;
    background: linear-gradient(135deg,
        #FFB300 0%,
        #FFA726 50%,
        #FFB300 100%);
    border: 2px solid transparent;
    border-image: linear-gradient(135deg,
        #FFB300,
        #FFA726,
        #FFD54F) 1;
    clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 4px 12px rgba(255, 179, 0, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    filter: drop-shadow(2px 2px 6px rgba(0, 0, 0, 0.6));
}

.secret-code-submit:hover {
    background: linear-gradient(135deg,
        #FFA726 0%,
        #FFB300 50%,
        #FFA726 100%);
    box-shadow:
        0 6px 18px rgba(255, 179, 0, 0.7),
        0 0 30px rgba(255, 179, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
    transform: translateY(-2px) scale(1.05);
}

.secret-code-submit:active {
    transform: translateY(0) scale(0.98);
    box-shadow:
        0 2px 8px rgba(255, 179, 0, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.secret-code-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Hint text - SOFT GLOW 💡 */
.secret-code-hint {
    color: rgba(240, 249, 255, 0.7);
    font-size: 13px;
    text-align: center;
    margin: 8px 0;
    opacity: 0.85;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.6));
}

/* Message area - SUCCESS/ERROR FEEDBACK 🎉❌ */
.secret-code-message {
    margin: 12px 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    display: none;
    animation: slideDown 0.3s ease;
    filter: drop-shadow(2px 2px 6px rgba(0, 0, 0, 0.6));
}

.secret-code-message.success {
    background: linear-gradient(135deg,
        rgba(34, 197, 94, 0.3) 0%,
        rgba(74, 222, 128, 0.25) 100%);
    border: 2px solid #4ade80;
    color: #4ade80;
    box-shadow:
        0 4px 12px rgba(74, 222, 128, 0.4),
        0 0 20px rgba(74, 222, 128, 0.3);
}

.secret-code-message.error {
    background: linear-gradient(135deg,
        rgba(185, 28, 28, 0.3) 0%,
        rgba(239, 68, 68, 0.25) 100%);
    border: 2px solid #ef4444;
    color: #ef4444;
    box-shadow:
        0 4px 12px rgba(239, 68, 68, 0.4),
        0 0 20px rgba(239, 68, 68, 0.3);
}

/* Hide button - SUBTLE CLOSE ✕ */
.secret-code-hide {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: rgba(240, 249, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.secret-code-hide:hover {
    background: rgba(0, 0, 0, 0.4);
    color: var(--game-text-light);
    border-color: rgba(255, 255, 255, 0.25);
}

/* ===== ANIMATIONS FOR SECRET CODE ===== */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow:
            0 6px 18px rgba(74, 222, 128, 0.5),
            0 0 30px rgba(124, 179, 66, 0.6);
    }
    50% {
        transform: scale(1.03);
        box-shadow:
            0 8px 24px rgba(74, 222, 128, 0.7),
            0 0 40px rgba(124, 179, 66, 0.8);
    }
    100% {
        transform: scale(1);
        box-shadow:
            0 6px 18px rgba(74, 222, 128, 0.5),
            0 0 30px rgba(124, 179, 66, 0.6);
    }
}

/* Stats grid */
.game-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.game-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: rgba(44, 127, 67, 0.15);
    backdrop-filter: blur(5px);
    border: 2px solid transparent;
    border-image: var(--game-card-border) 1;
    clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
    transition: all 0.3s ease;
}

/* Shimmer effect on hover */
.game-stat-item:hover {
    background: rgba(44, 127, 67, 0.25);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(124, 179, 66, 0.4),
        inset 0 2px 6px rgba(255, 255, 255, 0.1);
    animation: shimmer 1.5s ease-in-out infinite;
}

.game-stat-item .game-stat-icon {
    font-size: 28px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.game-stat-item .game-stat-value {
    font-size: 20px;
    font-weight: bold;
    background: var(--gradient-enchanted);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
    animation: enchantedText 8s ease-in-out infinite;
}

.game-stat-item .game-stat-label {
    font-size: 11px;
    color: var(--game-text-light);
    opacity: 0.8;
    text-align: center;
}

/* ===== CONVERSION DIALOG ===== */
.game-dialog-overlay {
    position: fixed;
    inset: 0;
    background: var(--dialog-overlay);
    z-index: 9998;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 420px;
    background: linear-gradient(135deg,
        rgba(27, 58, 31, 0.95) 0%,
        rgba(44, 127, 67, 0.95) 100%);
    backdrop-filter: blur(15px);
    border: 3px solid transparent;
    border-image: var(--dialog-border) 1;
    clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(255, 179, 0, 0.3),
        inset 0 2px 8px rgba(255, 255, 255, 0.1);
    z-index: 9999;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Dialog Header */
.game-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 2px solid rgba(139, 90, 60, 0.3);
}

.game-dialog-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    background: var(--gradient-enchanted);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: enchantedText 8s ease-in-out infinite;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.9));
}

.game-dialog-close {
    background: rgba(44, 127, 67, 0.3);
    backdrop-filter: blur(5px);
    border: 2px solid transparent;
    border-image: var(--game-card-border) 1;
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
    color: var(--game-text-light);
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-dialog-close:hover {
    background: rgba(44, 127, 67, 0.5);
    box-shadow: 0 0 15px rgba(124, 179, 66, 0.6);
}

/* Dialog Body */
.game-dialog-body {
    padding: 20px;
}

/* Conversion Balance */
.conversion-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: rgba(255, 179, 0, 0.15);
    backdrop-filter: blur(5px);
    border: 2px solid transparent;
    border-image: var(--game-card-border) 1;
    clip-path: polygon(5% 0%, 95% 0%, 100% 5%, 100% 95%, 95% 100%, 5% 100%, 0% 95%, 0% 5%);
    margin-bottom: 16px;
}

.balance-label {
    font-size: 14px;
    color: var(--game-text-light);
    opacity: 0.85;
}

.balance-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--points-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Conversion Input */
.conversion-input-group {
    margin-bottom: 14px;
}

.conversion-label {
    display: block;
    font-size: 13px;
    color: var(--game-text-light);
    margin-bottom: 8px;
    font-weight: 500;
}

.conversion-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(44, 127, 67, 0.2);
    backdrop-filter: blur(5px);
    border: 2px solid transparent;
    border-image: var(--game-card-border) 1;
    clip-path: polygon(5% 0%, 95% 0%, 100% 5%, 100% 95%, 95% 100%, 5% 100%, 0% 95%, 0% 5%);
    color: var(--game-text-light);
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.6);
}

.conversion-input:focus {
    outline: none;
    background: rgba(44, 127, 67, 0.3);
    box-shadow:
        inset 2px 2px 6px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(255, 179, 0, 0.4);
}

/* Quick Select Buttons */
.conversion-quick-select {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.btn-quick-amount {
    flex: 1;
    padding: 10px;
    background: rgba(44, 127, 67, 0.2);
    backdrop-filter: blur(5px);
    border: 2px solid transparent;
    border-image: var(--game-card-border) 1;
    clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
    color: var(--game-text-light);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-quick-amount:hover {
    background: rgba(44, 127, 67, 0.4);
    box-shadow: 0 0 10px rgba(255, 179, 0, 0.4);
    transform: translateY(-2px);
}

.btn-quick-amount.btn-max {
    background: rgba(255, 179, 0, 0.2);
}

/* Conversion Preview */
.conversion-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: rgba(44, 127, 67, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    border-image: var(--game-card-border) 1;
    clip-path: polygon(5% 0%, 95% 0%, 100% 5%, 100% 95%, 95% 100%, 5% 100%, 0% 95%, 0% 5%);
    margin-bottom: 12px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(124, 179, 66, 0.2),
        inset 0 2px 6px rgba(255, 255, 255, 0.1);
}

.conversion-arrow {
    font-size: 24px;
    color: var(--xp-color);
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.conversion-result {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-label {
    font-size: 12px;
    color: var(--game-text-light);
    opacity: 0.85;
}

.result-value {
    font-size: 22px;
    font-weight: bold;
    background: var(--gradient-enchanted);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.9));
    animation: enchantedText 8s ease-in-out infinite;
}

/* Conversion Info/Warning */
.conversion-info,
.conversion-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-bottom: 8px;
}

.conversion-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #a5d4ff;
}

.conversion-warning {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.2);
    color: #ffd4a5;
}

.info-icon,
.warning-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Dialog Footer */
.game-dialog-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 2px solid rgba(139, 90, 60, 0.3);
}

.btn-dialog-cancel,
.btn-dialog-confirm {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.btn-dialog-cancel {
    background: rgba(44, 127, 67, 0.3);
    backdrop-filter: blur(5px);
    border: 2px solid transparent;
    border-image: var(--game-card-border) 1;
    color: var(--game-text-light);
}

.btn-dialog-cancel:hover {
    background: rgba(44, 127, 67, 0.5);
    box-shadow: 0 0 10px rgba(124, 179, 66, 0.4);
}

.btn-dialog-confirm {
    background: var(--game-button-primary);
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.btn-dialog-confirm:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 16px rgba(255, 179, 0, 0.6),
        0 0 20px rgba(255, 179, 0, 0.6),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    animation: goldenPulse 2s ease-in-out infinite;
}

/* ===== TRANSACTION HISTORY ===== */
.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(44, 127, 67, 0.15);
    backdrop-filter: blur(5px);
    border: 2px solid transparent;
    border-image: var(--game-card-border) 1;
    clip-path: polygon(5% 0%, 95% 0%, 100% 5%, 100% 95%, 95% 100%, 5% 100%, 0% 95%, 0% 5%);
    transition: all 0.2s ease;
}

.transaction-item:hover {
    background: rgba(44, 127, 67, 0.25);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(124, 179, 66, 0.3),
        inset 0 2px 6px rgba(255, 255, 255, 0.1);
}

.tx-icon {
    font-size: 28px;
    flex-shrink: 0;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.tx-content {
    flex: 1;
    min-width: 0;
}

.tx-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--game-text-light);
    margin-bottom: 3px;
}

.tx-time {
    font-size: 12px;
    color: var(--game-text-light);
    opacity: 0.6;
}

.tx-amount {
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.tx-amount.positive {
    color: #4ade80;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.tx-amount.negative {
    color: #ef4444;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.no-transactions {
    text-align: center;
    padding: 40px 20px;
    color: var(--game-text-light);
    opacity: 0.6;
    font-size: 14px;
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 640px) {
    /* ===== A) COMPACT BADGE MOBILE FIXES - BULLETPROOF VERSION ===== */
    .game-coin-badge {
        /* Reset ALL complex desktop features */
        clip-path: none !important;
        -webkit-clip-path: none !important;
        border-image: none !important;
        background: linear-gradient(135deg,
            rgba(27, 58, 31, 0.95) 0%,
            rgba(44, 127, 67, 0.95) 100%) !important;
        backdrop-filter: none !important;

        /* Simple solid border */
        border: 3px solid rgba(255, 179, 0, 0.8) !important;
        border-radius: 16px !important;

        /* Size & positioning */
        width: 85px !important;
        padding: 12px 10px !important;
        min-height: 44px !important;

        /* Simple shadow */
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;

        /* Ensure visibility */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;

        /* Clickability */
        pointer-events: auto !important;
        cursor: pointer !important;
    }

    /* Remove problematic pseudo-elements on mobile */
    .game-coin-badge::before,
    .game-coin-badge::after {
        display: none !important;
    }

    /* Increase text sizes */
    .badge-points .badge-value {
        font-size: 18px !important;
        color: #FFB300 !important; /* 🔧 FIX: Direct hex instead of CSS variable */
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9) !important;
    }

    .badge-streak .badge-value {
        font-size: 14px !important;
        color: #7CB342 !important; /* 🔧 FIX: Direct hex instead of CSS variable */
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9) !important;
    }

    /* Increase badge icon sizes for readability */
    .badge-points .badge-icon {
        font-size: 22px !important;
    }

    .badge-streak .badge-icon {
        font-size: 16px !important;
    }

    /* Simplify glow animation for performance */
    .game-coin-badge.has-unclaimed {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6) !important;
        animation: none !important; /* FIX: Removed badgeGlow (doesn't exist) */
    }

    /* Larger claim indicator for visibility */
    .badge-claim-indicator {
        font-size: 28px !important;
        top: -10px !important;
        right: -10px !important;
    }

    /* ===== B) FULL PROFILE MOBILE FIXES ===== */

    /* Reduce blur for performance */
    .game-profile-fullscreen::before {
        background:
            radial-gradient(circle at 20% 30%, rgba(255, 179, 0, 0.1) 0%, transparent 50%);
    }

    /* ===== MODERN DRAG HANDLE MOBILE OPTIMIZATIONS ===== */

    /* Simplify header backdrop blur */
    .game-profile-header {
        backdrop-filter: blur(5px);
        padding: 10px 16px 8px;
        gap: 4px;
    }

    /* Optimize drag handle for mobile */
    .drag-handle {
        padding: 6px 0;
    }

    /* Larger leaves for easier visibility */
    .handle-leaf {
        font-size: 20px;
    }

    /* Slightly wider drag line for better touch target */
    .handle-line {
        width: 56px;
        height: 5px;
    }

    /* Reduce title size on very small screens */
    .profile-header-title {
        font-size: 16px;
    }

    /* Old buttons kept for backward compatibility but not used */
    .game-btn-back,
    .game-btn-close {
        display: none; /* Hidden - using drag handle instead */
    }

    /* Reduce body padding */
    .game-profile-body {
        padding: 12px;
        padding-bottom: 80px;
    }

    /* ===== C) STAT CARDS MOBILE FIXES ===== */

    /* Simplify stat cards */
    .profile-stat-card {
        /* Remove complex clip-path, use simple rounded corners */
        clip-path: none;
        border-radius: 12px;
        border: 2px solid rgba(255, 179, 0, 0.4);
        padding: 16px;

        /* Reduce blur for performance */
        backdrop-filter: blur(5px);

        /* Simplify shadows */
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.5),
            inset 0 1px 4px rgba(255, 255, 255, 0.1);
    }

    /* Hide animal spirit decorations on mobile (too small) */
    .profile-stat-card::after {
        display: none;
    }

    /* Simplify hover effect */
    .profile-stat-card:hover {
        box-shadow:
            0 6px 16px rgba(0, 0, 0, 0.6),
            inset 0 1px 4px rgba(255, 255, 255, 0.15);
        animation: none;
    }

    /* Increase icon size for visibility */
    .profile-stat-card .card-icon {
        font-size: 40px;
    }

    /* Increase label readability */
    .profile-stat-card .card-label {
        font-size: 12px;
    }

    /* Use solid color for values - better readability */
    .profile-stat-card .card-value {
        font-size: 28px;
        color: var(--firefly-gold);
        -webkit-text-fill-color: var(--firefly-gold);
        background: none;
        text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9);
    }

    .streak-card .card-value {
        color: var(--moss-fresh);
        -webkit-text-fill-color: var(--moss-fresh);
    }

    /* Increase sublabel size */
    .profile-stat-card .card-sublabel {
        font-size: 13px;
    }

    /* Simplify profile sections */
    .game-profile-section {
        clip-path: none;
        border-radius: 12px;
        border: 2px solid rgba(124, 179, 66, 0.4);
        backdrop-filter: blur(5px);
        padding: 14px;
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.5),
            inset 0 1px 4px rgba(255, 255, 255, 0.1);
    }

    /* Simplify section decoration */
    .game-profile-section::after {
        opacity: 0.3;
        animation: none;
    }

    /* Increase section title size */
    .game-section-title {
        font-size: 15px;
    }

    /* Simplify stats grid items */
    .game-stat-item {
        clip-path: none;
        border-radius: 8px;
        border: 2px solid rgba(124, 179, 66, 0.4);
        padding: 12px 10px;
        backdrop-filter: blur(3px);
    }

    /* Simplify hover effect */
    .game-stat-item:hover {
        animation: none;
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.5),
            inset 0 1px 4px rgba(255, 255, 255, 0.1);
    }

    .game-stat-item .game-stat-icon {
        font-size: 32px;
    }

    /* Use solid color for stat values - better readability */
    .game-stat-item .game-stat-value {
        font-size: 22px;
        color: var(--firefly-gold);
        -webkit-text-fill-color: var(--firefly-gold);
        background: none;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    }

    /* Increase label size */
    .game-stat-item .game-stat-label {
        font-size: 12px;
    }

    /* ===== D) BUTTONS MOBILE FIXES ===== */

    /* Ensure minimum touch targets */
    .btn-profile-action {
        padding: 16px;
        font-size: 16px;
        min-height: 52px;
        border-radius: 10px;
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.4),
            inset 0 1px 2px rgba(255, 255, 255, 0.2);
    }

    /* Simplify hover effects */
    .btn-claim:hover,
    .btn-convert:hover {
        transform: translateY(-1px);
        box-shadow:
            0 6px 16px rgba(255, 179, 0, 0.5),
            inset 0 1px 2px rgba(255, 255, 255, 0.3);
    }

    /* Increase text readability */
    .reward-text,
    .conversion-text {
        font-size: 15px;
    }

    .reward-hint,
    .conversion-hint {
        font-size: 13px;
    }

    /* ===== E) DIALOG MOBILE FIXES ===== */

    /* Simplify dialog */
    .game-dialog {
        width: 95%;
        max-width: none;
        clip-path: none;
        border-radius: 16px;
        border: 3px solid rgba(255, 179, 0, 0.5);
        backdrop-filter: blur(10px);
        box-shadow:
            0 12px 40px rgba(0, 0, 0, 0.8),
            inset 0 1px 6px rgba(255, 255, 255, 0.1);
    }

    /* Increase dialog title size */
    .game-dialog-title {
        font-size: 18px;
    }

    /* Simplify close button */
    .game-dialog-close {
        clip-path: none;
        border-radius: 8px;
        border: 2px solid rgba(124, 179, 66, 0.4);
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    /* Simplify conversion elements */
    .conversion-balance {
        clip-path: none;
        border-radius: 8px;
        border: 2px solid rgba(255, 179, 0, 0.4);
        backdrop-filter: blur(3px);
    }

    .balance-label {
        font-size: 15px;
    }

    .balance-value {
        font-size: 20px;
    }

    /* Increase input size for better usability */
    .conversion-label {
        font-size: 14px;
    }

    .conversion-input {
        clip-path: none;
        border-radius: 8px;
        border: 2px solid rgba(124, 179, 66, 0.4);
        padding: 14px;
        font-size: 20px;
        min-height: 52px;
    }

    /* Simplify quick select buttons */
    .btn-quick-amount {
        clip-path: none;
        border-radius: 8px;
        border: 2px solid rgba(124, 179, 66, 0.4);
        padding: 12px;
        font-size: 15px;
        min-height: 44px;
    }

    /* Simplify preview */
    .conversion-preview {
        clip-path: none;
        border-radius: 8px;
        border: 2px solid rgba(124, 179, 66, 0.4);
        backdrop-filter: blur(5px);
    }

    /* Use solid color for result value - better readability */
    .result-value {
        font-size: 24px;
        color: var(--firefly-gold);
        -webkit-text-fill-color: var(--firefly-gold);
        background: none;
        text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9);
    }

    /* Increase info/warning text size */
    .conversion-info,
    .conversion-warning {
        font-size: 13px;
        padding: 12px;
    }

    /* Ensure dialog buttons meet touch targets */
    .btn-dialog-cancel,
    .btn-dialog-confirm {
        padding: 16px;
        font-size: 16px;
        min-height: 52px;
        border-radius: 10px;
    }

    .btn-dialog-cancel {
        border: 2px solid rgba(124, 179, 66, 0.5);
    }

    /* ===== TRANSACTION HISTORY MOBILE ===== */
    .transaction-item {
        clip-path: none;
        border-radius: 8px;
        border: 2px solid rgba(124, 179, 66, 0.4);
        padding: 14px;
    }

    .tx-icon {
        font-size: 32px;
    }

    .tx-title {
        font-size: 15px;
    }

    .tx-time {
        font-size: 13px;
    }

    .tx-amount {
        font-size: 20px;
    }

    .no-transactions {
        font-size: 15px;
        padding: 50px 20px;
    }
}

@media (max-width: 380px) {
    /* ===== VERY SMALL SCREENS ===== */

    /* Stack stats grid on tiny screens */
    .game-stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .game-stat-item {
        width: 100%;
    }

    /* Wrap conversion quick select */
    .conversion-quick-select {
        flex-wrap: wrap;
    }

    .btn-quick-amount {
        flex: 1 1 45%;
        min-width: 100px;
    }

    /* Further increase badge size for very small screens */
    .game-coin-badge {
        width: 85px;
        padding: 10px 8px;
    }

    .badge-points .badge-value {
        font-size: 18px;
    }

    .badge-streak .badge-value {
        font-size: 15px;
    }

    /* Reduce stat card padding */
    .profile-stat-card {
        padding: 14px;
    }

    .profile-stat-card .card-icon {
        font-size: 36px;
    }

    .profile-stat-card .card-value {
        font-size: 24px;
    }

    /* Smaller dialog padding */
    .game-dialog-header,
    .game-dialog-footer {
        padding: 14px 16px;
    }

    .game-dialog-body {
        padding: 16px;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Disable expensive effects on low-end devices */
@media (max-width: 640px) {
    /* Reduce firefly count on mobile */
    .firefly-4,
    .firefly-5,
    .firefly-6 {
        display: none;
    }

    /* Reduce leaf count on mobile */
    .leaf-3,
    .leaf-4 {
        display: none;
    }

    /* Simplify animations on mobile for performance */
    .firefly {
        animation-duration: 6s !important;
        filter: blur(2px);
    }

    .floating-leaf {
        animation-duration: 12s !important;
    }

    /* Reduce blur on mobile for performance */
    .game-profile-fullscreen::before {
        animation: none;
    }
}

/* ===== ACCESSIBILITY ===== */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    /* Disable all animations and transitions */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Hide decorative animated elements */
    .firefly,
    .floating-leaf {
        display: none !important;
    }

    /* Disable spirit aura animations */
    .profile-stat-card::after,
    .profile-stat-card::before {
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .game-profile-fullscreen {
        background: #000;
    }

    .profile-stat-card,
    .game-profile-section {
        border: 3px solid var(--firefly-gold);
    }

    .btn-claim,
    .btn-convert,
    .btn-dialog-confirm {
        border: 2px solid #fff;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark theme */
}

/* ============================================
   🚀 AGGRESSIVE MOBILE SCROLL PERFORMANCE
   ============================================
   Final override for buttery smooth scrolling
   Targets the main performance killers:
   - backdrop-filter (GPU killer #1)
   - complex animations
   - box-shadows
   ============================================ */

@media (max-width: 768px) {
    /* 🔥 REMOVE ALL BACKDROP FILTERS - Critical for scroll performance! */
    .game-profile-fullscreen,
    .game-profile-fullscreen *,
    .game-profile-header,
    .profile-stat-card,
    .game-profile-section,
    .game-stat-item,
    .game-dialog,
    .conversion-balance,
    .conversion-preview,
    .mystery-box-container *,
    .free-box-timer,
    .reward-history,
    .box-opening-section,
    .profile-card-3d *,
    .card-layer-content {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* 🔥 OPTIMIZE SCROLL CONTAINER */
    .game-profile-body {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        scroll-behavior: auto !important;
        will-change: scroll-position !important;
        transform: translateZ(0) !important; /* Force GPU layer */
        contain: layout style !important;
    }

    /* 🔥 DISABLE ALL BACKGROUND ANIMATIONS during scroll */
    .game-profile-fullscreen::before {
        animation: none !important;
        background: radial-gradient(circle at 30% 30%, rgba(255, 179, 0, 0.05) 0%, transparent 50%) !important;
    }

    /* 🔥 SIMPLIFY FIREFLIES - Hide on mobile */
    .game-profile-fullscreen .firefly,
    .game-profile-fullscreen .floating-leaf {
        display: none !important;
    }

    /* 🔥 FLATTEN 3D CARD COMPLETELY */
    .profile-card-3d-container {
        perspective: none !important;
    }

    .profile-card-3d {
        transform-style: flat !important;
        transform: none !important;
    }

    .card-layer-background,
    .card-layer-pattern,
    .card-layer-border,
    .card-layer-particles {
        display: none !important; /* Hide decorative layers */
    }

    .card-layer-content {
        position: relative !important;
        transform: none !important;
        filter: none !important;
        background: linear-gradient(135deg,
            #2E0854 0%,
            #4B0082 100%
        ) !important;
        border: 2px solid rgba(153, 50, 204, 0.6) !important;
        border-radius: 16px !important;
    }

    /* 🔥 SIMPLIFY BOX SHADOWS - Less GPU intensive */
    .profile-stat-card,
    .game-profile-section,
    .game-stat-item {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    }

    /* 🔥 DISABLE SPIRIT AURA ANIMATIONS */
    .profile-stat-card::after,
    .profile-stat-card::before,
    .points-card::after,
    .streak-card::after {
        display: none !important;
    }

    /* 🔥 SIMPLIFY DRAG HANDLE ANIMATIONS */
    .drag-handle,
    .handle-leaf,
    .handle-line::before {
        animation: none !important;
    }

    /* 🔥 DISABLE SHIMMER ON USERNAME */
    .card-username-3d {
        animation: none !important;
        background: var(--firefly-gold) !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
    }

    /* 🔥 OPTIMIZE PROGRESS BAR */
    .progress-fill-3d::after {
        display: none !important;
    }

    /* 🔥 SIMPLIFY MYSTERY BOX ANIMATIONS */
    .mystery-box {
        transition: transform 0.15s ease !important;
    }

    .mystery-box::before {
        animation: none !important;
    }

    .box-indicator {
        animation: none !important;
    }

    /* 🔥 SIMPLIFY TIMER ANIMATIONS */
    .timer-icon {
        animation: none !important;
    }

    .timer-ready {
        animation: none !important;
    }

    .claim-free-box-btn.ready {
        animation: none !important;
    }

    /* 🔥 CONTAIN ALL SECTIONS FOR BETTER PAINT */
    .profile-stat-card,
    .game-profile-section,
    .mystery-box-container,
    .free-box-timer,
    .reward-history {
        contain: layout paint !important;
    }

    /* 🔥 ENSURE SMOOTH TOUCH SCROLLING */
    .game-profile-fullscreen {
        touch-action: pan-y !important;
        overscroll-behavior-y: contain !important;
    }
}
