        :root {
            --red-primary: #C41E3A;
            --red-dark: #8B0000;
            --red-light: #FF4444;
            --gold-primary: #FFD700;
            --gold-light: #FFEC8B;
            --gold-dark: #DAA520;
            --cream: #FFF8DC;
            --white: #FFFFFF;

        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        html {
            font-size: clamp(14px, 2vw, 16px);
            -webkit-text-size-adjust: 100%;
        }

        body {
            font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
            min-height: 100vh;
            min-height: 100dvh;
            /* Enhanced gradient with spotlight variables */
            background:
                radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
                    rgba(255, 215, 0, 0.15) 0%,
                    transparent 40%),
                linear-gradient(-45deg, #8B0000, #C41E3A, #D32F2F, #a30000);
            background-size: 400% 400%, 400% 400%;
            animation: gradientBG 15s ease infinite;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: clamp(1rem, 4vw, 2rem);
            overflow-x: hidden;
            position: relative;
            color: var(--gold-light);
        }

        /* Custom pattern overlay */
        body::before {
            content: '';
            position: fixed;
            inset: 0;
            /* Dual-layer pattern with different sizes to hide repetition */
            background-image:
                url('../../images/assets/pattern.png'),
                url('../../images/assets/pattern.png');
            background-size: 550px, 350px;
            background-position: 0 0, 100px 100px;
            background-repeat: repeat;
            /* Overlay mode provides better definition against the red gradient */
            mix-blend-mode: overlay;
            opacity: 0.4;
            pointer-events: none;
            z-index: 0;
        }

        @keyframes gradientBG {
            0% {
                background-position: 0% 50%;
            }

            50% {
                background-position: 100% 50%;
            }

            100% {
                background-position: 0% 50%;
            }
        }

        /* Particle System */
        .particles-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            z-index: 0;
            pointer-events: none;
            contain: strict;
        }

        .particle {
            position: absolute;
            pointer-events: none;
            animation: particleFloat linear infinite;
            display: flex;
            align-items: center;
            justify-content: center;
            user-select: none;
            will-change: transform, opacity;
        }

        /* Default circle particle */
        .particle-dot {
            background: radial-gradient(circle, rgba(255, 215, 0, 0.6) 0%, transparent 70%);
            border-radius: 50%;
        }

        /* Image particle styles */
        .particle-img {
            width: var(--p-size);
            height: var(--p-size);
            object-fit: contain;
            filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.2));
        }

        @keyframes particleFloat {
            0% {
                transform: translateY(110vh) translateX(0) rotate(0deg);
                opacity: 0;
            }

            10% {
                opacity: 0.8;
            }

            90% {
                opacity: 0.8;
            }

            100% {
                transform: translateY(-10vh) translateX(var(--drift, 40px)) rotate(var(--rot, 360deg));
                opacity: 0;
            }
        }

        .container {
            position: relative;
            z-index: 1;
            text-align: center;
            width: 100%;
            max-width: min(500px, 95vw);
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-top: 3.5rem;
        }





        /* --- UI COMPONENTS --- */


        .utility-bar {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            padding: 1rem;
            display: flex;
            justify-content: space-between;
            /* Push items to edges */
            align-items: center;
            z-index: 100;
            pointer-events: none;
            /* Let clicks pass through empty space */
        }



        .utility-left {
            display: flex;
            gap: 0.5rem;
            pointer-events: auto;
            /* Re-enable clicks for buttons */
        }



        /* Header */
        .header {
            margin-bottom: clamp(1.25rem, 4vw, 2rem);
            animation: fadeInDown 0.8s ease-out;
        }

        .header h1 {
            font-family: 'Playfair Display', serif;
            font-size: clamp(1.75rem, 7vw, 3.5rem);
            color: var(--gold-primary);
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 215, 0, 0.3);
            margin-bottom: 0.5rem;
            letter-spacing: 1px;
            line-height: 1.2;
        }

        .header p {
            color: var(--cream);
            font-size: clamp(0.9rem, 3vw, 1.1rem);
            opacity: 0.9;
        }

        /* Share Button */
        /* FAB Menu */
        /* FAB Menu - Aligned to Content */
        .fab-wrapper {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 0;
            z-index: 100;
            display: flex;
            justify-content: center;
            pointer-events: none;
            contain: layout style;
        }

        .fab-content-width {
            width: 100%;
            max-width: min(500px, 95vw);
            position: relative;
            height: 0;
        }

        @media (min-width: 768px) {
            .fab-content-width {
                max-width: 550px;
            }
        }

        .fab-container {
            position: absolute;
            bottom: 20px;
            right: 10px;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 10px;
            pointer-events: none;
            will-change: transform;
            transform: translateZ(0);
        }

        .fab-options {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 10px;
            opacity: 0;
            transform: translateY(20px) scale(0.8) translateZ(0);
            pointer-events: none;
            transition: opacity 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            margin-bottom: 5px;
            will-change: transform, opacity;
        }

        .share-btn {
            width: 50px;
            height: 50px;
            background: linear-gradient(135deg, white, #fff8e1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            color: var(--red-primary);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
            cursor: pointer;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            border: 2px solid var(--gold-primary);
            position: relative;
            z-index: 2;
            margin: 0;
            padding: 0;
            will-change: transform;
            transform: translateZ(0);
            pointer-events: auto;
        }

        .share-btn:hover {
            transform: scale(1.1) rotate(0deg);
            box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
        }

        .share-btn.active {
            transform: rotate(0deg);
            box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
        }



        .fab-container.active .fab-options {
            opacity: 1;
            transform: translateY(0) scale(1) translateZ(0);
            pointer-events: auto;
        }

        .fab-option-btn {
            height: 40px;
            padding: 0 15px;
            border-radius: 20px;
            border: none;
            background: white;
            color: var(--red-primary);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 0.95rem;
            font-weight: 500;
            transition: all 0.2s;
            position: relative;
            margin: 0;
            white-space: nowrap;
        }

        .fab-option-btn i {
            font-size: 1.1rem;
        }

        .fab-option-btn:hover {
            transform: scale(1.05);
            background: var(--gold-light);
        }

        /* Share Modal */
        .share-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 2000;
            display: none;
            align-items: center;
            justify-content: center;
        }

        .share-modal {
            background: #fffafa;
            width: 90%;
            max-width: 350px;
            border-radius: 20px;
            padding: 2rem;
            text-align: center;
            position: relative;
            border: 2px solid var(--gold-primary);
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
            animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .qr-container {
            background: white;
            padding: 15px;
            border-radius: 10px;
            box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
            margin: 1.5rem auto;
            display: flex;
            justify-content: center;
            width: fit-content;
        }

        .share-actions {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-top: 1rem;
        }

        .share-action-btn {
            padding: 10px;
            border-radius: 10px;
            border: none;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }

        .btn-copy {
            background: #f0f0f0;
            color: #333;
        }

        .btn-copy:hover {
            background: #e0e0e0;
        }

        .btn-download {
            background: var(--red-primary);
            color: var(--gold-light);
        }

        .btn-download:hover {
            background: var(--red-dark);
        }

        .close-modal {
            position: absolute;
            top: 10px;
            right: 15px;
            font-size: 1.5rem;
            color: #999;
            cursor: pointer;
            width: 30px;
            height: 30px;
            line-height: 30px;
            border-radius: 50%;
            background: #f5f5f5;
        }

        .close-modal:hover {
            background: #eee;
            color: #333;
        }

        .department-badge {
            display: inline-block;
            background: linear-gradient(135deg, var(--medical-blue), #004D40);
            color: var(--white);
            padding: clamp(0.5rem, 1.5vw, 0.7rem) clamp(1.2rem, 3vw, 1.8rem);
            border-radius: 50px;
            font-weight: 600;
            font-size: clamp(0.75rem, 2.5vw, 0.95rem);
            margin-top: 0.75rem;
            box-shadow: 0 4px 15px rgba(0, 128, 128, 0.4);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        /* Envelope */
        /* Envelope */
        .envelope-container {
            perspective: 1200px;
            margin: clamp(5rem, 15vw, 6rem) auto 2rem;
            cursor: pointer;
            -webkit-tap-highlight-color: transparent;
            filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.3));
            position: relative;
            /* Use inline-block to shrink-wrap content for proper absolute positioning */
            display: inline-block;
        }

        .rate-info-btn {
            /* Smaller button next to luck meter */
            position: relative;
            width: 28px;
            height: 28px;
            min-width: 28px;
            min-height: 28px;
            background: var(--red-dark);
            border: 1.5px solid var(--gold-primary);
            border-radius: 50%;
            color: var(--gold-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 10;
            transition: transform 0.2s ease, background 0.2s ease;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
            /* Touch-friendly properties */
            -webkit-tap-highlight-color: transparent;
            touch-action: manipulation;
            user-select: none;
            flex-shrink: 0;
        }

        .rate-info-btn i {
            font-size: 0.85rem;
            color: var(--gold-primary);
            pointer-events: none;
        }

        .rate-info-btn:hover {
            background: var(--red-primary);
            transform: scale(1.1);
        }

        .rate-info-btn:active {
            transform: scale(0.95);
            background: var(--red-primary);
        }


        .envelope {
            width: clamp(220px, 65vw, 260px);
            height: clamp(320px, 95vw, 380px);
            margin: 0 auto;
            position: relative;
            transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            animation: float 4s ease-in-out infinite;
            transform-style: preserve-3d;
            will-change: transform;
        }

        .envelope:hover {
            animation: shake 0.5s ease-in-out infinite;
            cursor: pointer;
        }

        .envelope:active {
            transform: scale(0.96) translateY(5px);
        }

        .envelope.shake-click {
            animation: shake 0.5s ease-in-out infinite;
        }

        @keyframes shake {

            0%,
            100% {
                transform: rotate(0deg);
            }

            25% {
                transform: rotate(-3deg);
            }

            75% {
                transform: rotate(3deg);
            }
        }

        .envelope-body {
            width: 100%;
            height: 100%;
            /* Cute Gradient: Pinkish Red */
            background: radial-gradient(circle at 50% 30%, #FF5252 0%, #D50000 60%, #B71C1C 100%);
            border-radius: 24px;
            /* Rounder corners */
            position: relative;
            box-shadow:
                inset 0 0 30px rgba(0, 0, 0, 0.2),
                0 0 0 4px #FFD700,
                /* Gold border */
                0 0 0 8px #FF8A80;
            /* Soft pink outer border */
            overflow: hidden;
        }

        .envelope-body::before {
            content: '福';
            position: absolute;
            top: 55%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: clamp(4rem, 18vw, 6rem);
            font-family: "Playfair Display", serif;
            font-weight: 800;
            background: linear-gradient(to bottom, #FFF 0%, #FFD700 100%);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            filter: drop-shadow(0 2px 0 #D50000) drop-shadow(0 5px 10px rgba(0, 0, 0, 0.2));
            opacity: 1;
            z-index: 1;
        }

        .envelope-pattern {
            position: absolute;
            inset: 0;
            opacity: 0.15;
            /* Polka dots pattern */
            background-image: radial-gradient(#FFD700 2px, transparent 2px);
            background-size: 20px 20px;
            mix-blend-mode: overlay;
        }

        .envelope-flap {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 32%;
            /* Brighter flap color */
            background: linear-gradient(160deg, #FF5252 0%, #D32F2F 100%);
            clip-path: ellipse(80% 100% at 50% 0%);
            transform-origin: top center;
            transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 2;
            filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
            border-radius: 24px 24px 0 0;
        }

        /* Gold trim accent for flap */
        .envelope-flap::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: radial-gradient(circle at 50% 100%, rgba(255, 235, 59, 0.3) 0%, transparent 60%);
            pointer-events: none;
        }

        .envelope-seal {
            position: absolute;
            top: 26%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: clamp(50px, 15vw, 68px);
            height: clamp(50px, 15vw, 68px);
            /* Heart Shape using clip-path or just a cute circle */
            /* Using a circle with a heart icon inside is safer for layout */
            background: radial-gradient(circle at 35% 35%, #FFD700 0%, #FBC02D 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 3;
            box-shadow:
                0 4px 15px rgba(0, 0, 0, 0.3),
                inset 0 0 0 2px #FFF;
            transition: all 0.4s ease;
            font-size: clamp(1rem, 4vw, 1.4rem);
            font-weight: 800;
            font-family: 'Playfair Display', serif;
            color: #D32F2F;
            border: 2px solid #FFF;
            text-transform: uppercase;
        }



        /* Hide original text if any (it was empty before) */

        /* Gold Skin (Unlocked at 1M) - Update to match cute style */
        .envelope.skin-gold .envelope-body {
            background: radial-gradient(circle at 50% 30%, #FFECB3 0%, #FFD54F 100%);
            box-shadow:
                inset 0 0 20px rgba(255, 255, 255, 0.6),
                0 0 0 4px #FFF,
                0 0 0 8px #FFD700;
        }

        .envelope.skin-gold .envelope-flap {
            background: linear-gradient(160deg, #FFD54F 0%, #FFA000 100%);
        }

        .envelope.skin-gold .envelope-seal {
            background: radial-gradient(circle at 35% 35%, #FFF 0%, #FFECB3 100%);
            color: #FFA000;
        }

        .envelope.opened .envelope-flap {
            transform: rotateX(180deg) !important;
            z-index: 0;
            /* Move behind body when opened so card can come out */
        }

        /* Fix z-index when opening */
        .envelope.opened .envelope-body {
            overflow: visible;
        }

        .envelope.opened .envelope-seal {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0);
        }

        .click-hint {
            color: var(--gold-light);
            font-size: clamp(0.85rem, 3vw, 1rem);
            margin-top: 1rem;
            animation: pulse 2s ease-in-out infinite;
        }

        .click-hint.hidden {
            display: none;
        }

        /* Result Card */
        .result-card {
            background: #FFF9E6;
            /* Soft Cream Background */
            border-radius: 32px;
            /* Very round corners */
            padding: clamp(1.5rem, 6vw, 2.5rem);
            margin-top: clamp(1.5rem, 5vw, 2.5rem);
            /* Cute Default Border */
            border: 4px dashed #FFD700;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            display: none;
            animation: popIn 0.5s ease-out;
            position: relative;
            overflow: visible;
            /* Allow borders to stick out if needed */
            width: 100%;
            max-width: min(450px, 95vw);
            transition: box-shadow 0.3s ease;
            z-index: 10;
        }

        /* Pseudo-element Base Styles */
        .result-card::before,
        .result-card::after {
            content: '';
            position: absolute;
            border-radius: inherit;
            pointer-events: none;
        }

        /* ::before - The Card Background Layer (used for Rare cards to layer above border) */
        .result-card::before {
            inset: 0;
            z-index: 0;
            background: #FFF9E6;
            border-radius: 32px;
            display: none;
            /* Hidden by default, explicit for Rare cards */
        }

        /* ::after - The Gradient Border Layer */
        .result-card::after {
            inset: -5px;
            z-index: -1;
            /* Behind ::before */
            border-radius: 36px;
            /* 32px + 4px border roughly */
            background: conic-gradient(from var(--a, 0deg), transparent 0%, transparent 100%);
            display: none;
            /* Hidden by default */
        }

        @property --a {
            syntax: '<angle>';
            initial-value: 0deg;
            inherits: false;
        }

        @keyframes rotateBorder {
            0% {
                --a: 0deg;
            }

            100% {
                --a: 360deg;
            }
        }

        /* Rarity Styles - AWESOME GLOW Borders */

        /* Shared overrides for all Rare types */
        .result-card[data-rarity="SSR"],
        .result-card[data-rarity="SR"],
        .result-card[data-rarity="R"] {
            background: transparent !important;
            /* Hide main bg, move to ::before */
            border-color: transparent !important;
            /* Keep physical space but invisible */
            background-clip: padding-box;
        }

        .result-card[data-rarity="SSR"]::before,
        .result-card[data-rarity="SR"]::before,
        .result-card[data-rarity="R"]::before {
            display: block;
            /* Show background layer */
        }

        /* SSR - Legendary Gold/Rainbow Spin */
        .result-card[data-rarity="SSR"] {
            box-shadow: 0 0 50px rgba(255, 215, 0, 0.4);
        }

        .result-card[data-rarity="SSR"]::after {
            display: block;
            background: conic-gradient(from var(--a, 0deg),
                    #FFD700,
                    #FFF,
                    #FFA000,
                    #FFECB3,
                    #FFD700);
            animation: rotateBorder 3s linear infinite;
        }

        /* SR - Epic Purple */
        .result-card[data-rarity="SR"] {
            box-shadow: 0 0 40px rgba(186, 104, 200, 0.4);
        }

        .result-card[data-rarity="SR"]::after {
            display: block;
            background: conic-gradient(from var(--a, 0deg),
                    #9C27B0,
                    #E040FB,
                    #FFF,
                    #BA68C8,
                    #9C27B0);
            animation: rotateBorder 4s linear infinite;
        }

        /* R - Rare Blue */
        .result-card[data-rarity="R"] {
            box-shadow: 0 0 40px rgba(3, 169, 244, 0.4);
        }

        .result-card[data-rarity="R"]::after {
            display: block;
            background: conic-gradient(from var(--a, 0deg),
                    #03A9F4,
                    #4FC3F7,
                    #FFF,
                    #29B6F6,
                    #03A9F4);
            animation: rotateBorder 4s linear infinite;
        }

        /* Default/Common - Cute Dashed Stripes */
        .result-card:not([data-rarity="SSR"]):not([data-rarity="SR"]):not([data-rarity="R"]) {
            /* Use specialized dashing or border-image if possible, or just refined dashed */
            border: 4px dashed #FFD700;
            box-shadow: 0 10px 25px rgba(255, 215, 0, 0.15);
            animation: borderPulse 3s infinite alternate;
        }

        @keyframes borderPulse {
            0% {
                border-color: #FFD700;
                box-shadow: 0 10px 25px rgba(255, 215, 0, 0.15);
            }

            100% {
                border-color: #FFA000;
                box-shadow: 0 10px 35px rgba(255, 215, 0, 0.3);
            }
        }

        .result-card.show {
            display: block;
        }

        /* Old shimmer effect removed to prevent conflict with ::before bg */

        .result-card .amount {
            font-family: 'Playfair Display', serif;
            font-size: clamp(2rem, 10vw, 4rem);
            font-weight: 800;
            background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 0.25rem;
            position: relative;
            z-index: 1;
        }

        .result-card .currency {
            font-size: clamp(1rem, 3.5vw, 1.3rem);
            color: var(--red-primary);
            font-weight: 600;
            margin-bottom: 1rem;
            position: relative;
            z-index: 1;
        }

        /* Money Display with Flip Card */
        .money-display {
            margin: 1.5rem 0;
            position: relative;
            z-index: 1;
        }

        .money-stack-container {
            position: relative;
            width: 100%;
            max-width: clamp(260px, 70vw, 340px);
            aspect-ratio: 2.2 / 1;
            margin: 0 auto;
            perspective: 1000px;
        }

        .money-stack-wrapper {
            position: relative;
            width: 100%;
            height: 100%;
            transform-style: preserve-3d;
            transition: transform 0.8s;
        }

        .money-stack-wrapper.flipped {
            transform: rotateY(180deg);
        }

        /* 3D Stack Transform */
        .money-card {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            border-radius: 16px;
            transform-style: preserve-3d;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            transform: var(--stack-transform);
            /* Set by JS */
            transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            cursor: grab;
        }

        .money-card:active {
            transform: var(--stack-transform) scale(0.98);
        }

        .money-card.flipped {
            transform: var(--stack-transform) rotateY(180deg);
        }

        .money-face {
            position: absolute;
            width: 100%;
            height: 100%;
            backface-visibility: hidden;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.2);
        }

        .money-face img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .money-back {
            transform: rotateY(180deg);
        }

        .money-card.holo-active,
        .money-stack-wrapper.holo-active {
            transition: none !important;
        }

        /* Force transition during flip */
        .money-stack-wrapper.is-flipping {
            transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
        }

        .flip-hint {
            font-size: clamp(0.7rem, 2.5vw, 0.85rem);
            color: #888;
            margin-top: 0.75rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            cursor: pointer;
        }

        .flip-icon {
            animation: flipHint 2s ease-in-out infinite;
        }

        /* Bounce Animation */
        @keyframes bounce {
            0% {
                transform: scale(0);
                opacity: 0;
            }

            50% {
                transform: scale(1.2);
            }

            70% {
                transform: scale(0.9);
            }

            100% {
                transform: scale(1);
                opacity: 1;
            }
        }

        /* Holo Animations */
        @keyframes holoShift {

            0%,
            100% {
                background-position: 0% 50%;
            }

            50% {
                background-position: 100% 50%;
            }
        }

        @keyframes holoShineMove {
            0% {
                background-position: 200% 200%;
            }

            100% {
                background-position: -100% -100%;
            }
        }

        /* Wish */
        .result-card .wish {
            font-family: 'Playfair Display', serif;
            font-size: clamp(1.1rem, 4vw, 1.4rem);
            font-style: italic;
            font-size: clamp(1.1rem, 4vw, 1.4rem);
            font-style: italic;
            color: #D84315;
            /* Slightly deeper orange/red for better contrast */
            line-height: 1.6;

            padding: clamp(1.5rem, 5vw, 2rem);
            background-color: #FFF;
            border: 2px dashed #FFD54F;
            /* Dotted/Dashed border */
            border-radius: 16px;
            margin: 1.5rem 0;
            position: relative;
            background-image:
                radial-gradient(var(--gold-light) 1px, transparent 1px),
                linear-gradient(to bottom, transparent, rgba(255, 248, 220, 0.3) 100%);
            background-size: 20px 20px, 100% 100%;
            border: 1px solid var(--gold-light);
            border-radius: 4px;
            margin-bottom: 1.5rem;
            position: relative;
            z-index: 1;
            text-align: center;
            box-shadow:
                inset 0 0 20px rgba(255, 215, 0, 0.05),
                0 5px 15px rgba(0, 0, 0, 0.05);
            animation: wishBreathe 3s ease-in-out infinite;
        }

        @keyframes wishBreathe {

            0%,
            100% {
                box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
                border-color: #FFD54F;
            }

            50% {
                box-shadow: inset 0 0 25px rgba(255, 215, 0, 0.3), 0 5px 20px rgba(0, 0, 0, 0.1);
                border-color: #FFA000;
            }

        }

        .result-card .wish::before {
            content: '❦';
            font-size: 2rem;
            color: var(--gold-primary);
            position: absolute;
            top: 0.5rem;
            left: 50%;
            transform: translateX(-50%);
            opacity: 0.6;
        }

        .result-card .wish::after {
            content: '❦';
            font-size: 2rem;
            color: var(--gold-primary);
            position: absolute;
            bottom: 0.5rem;
            left: 50%;
            transform: translateX(-50%) rotate(180deg);
            opacity: 0.6;
        }

        /* Buttons */
        .buttons {
            display: flex;
            justify-content: center;
            gap: clamp(0.5rem, 2vw, 1rem);
            flex-wrap: wrap;
            margin-top: 1rem;
        }

        .btn {
            border: none;
            border-radius: 50px;
            /* Pill shape */
            padding: 0.8rem 1.5rem;
            font-size: 1rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            position: relative;
            overflow: hidden;
            font-family: 'Be Vietnam Pro', sans-serif;
            flex: 1;
            min-width: 120px;
            max-width: 200px;
        }

        .btn:active {
            transform: scale(0.95);
        }

        .btn-primary {
            /* Yellow Button */
            background: linear-gradient(to bottom, #FFD700, #FBC02D);
            color: #D32F2F;
            /* Red text for contrast */
            box-shadow: 0 4px 0 #F57F17;
            /* 3D effect */
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 0 #F57F17;
        }

        .btn-primary:active {
            transform: translateY(2px);
            box-shadow: 0 0 0 #F57F17;
        }

        .btn-secondary {
            /* White Button with Red Border */
            background: #FFF;
            color: #D32F2F;
            border: 2px solid #D32F2F;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .btn-secondary:hover {
            background: #FFEBEE;
            transform: translateY(-2px);
        }

        .btn-danger {
            /* Red Button (Gamble) */
            background: linear-gradient(to bottom, #D32F2F, #B71C1C);
            color: #FFD700;
            box-shadow: 0 4px 0 #8B0000;
        }

        .btn-danger:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 0 #8B0000;
        }

        .btn-danger:active {
            transform: translateY(2px);
            box-shadow: 0 0 0 #8B0000;
        }

        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none !important;
        }

        /* Footer */
        .footer {
            margin-top: clamp(1.5rem, 5vw, 2.5rem);
            color: var(--cream);
            opacity: 0.7;
            font-size: clamp(0.75rem, 2.5vw, 0.9rem);
        }

        /* Confetti & Particles */
        .confetti-container {
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 1000;
            overflow: hidden;
        }

        .confetti {
            position: absolute;
            width: 10px;
            height: 10px;
            opacity: 0;
        }

        .lucky-particles {
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 0;
        }

        .particle {
            position: absolute;
            width: 6px;
            height: 6px;
            background: var(--gold-primary);
            border-radius: 50%;
            animation: particleFloat 15s linear infinite;
            opacity: 0.3;
        }

        /* Animations */
        @keyframes fadeInDown {
            from {
                opacity: 0;
                transform: translateY(-30px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes float {

            0%,
            100% {
                transform: translate3d(0, 0, 0);
            }

            50% {
                transform: translate3d(0, -10px, 0);
            }
        }

        @keyframes pulse {

            0%,
            100% {
                opacity: 0.7;
            }

            50% {
                opacity: 1;
            }
        }

        @keyframes popIn {
            0% {
                opacity: 0;
                transform: scale(0.8);
            }

            100% {
                opacity: 1;
                transform: scale(1);
            }
        }

        @keyframes shimmer {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        @keyframes confettiFall {
            0% {
                opacity: 1;
                transform: translateY(-100vh) rotate(0deg);
            }

            100% {
                opacity: 0;
                transform: translateY(100vh) rotate(720deg);
            }
        }

        @keyframes particleFloat {
            0% {
                transform: translateY(100vh) rotate(0deg);
                opacity: 0;
            }

            10% {
                opacity: 0.3;
            }

            90% {
                opacity: 0.3;
            }

            100% {
                transform: translateY(-100vh) rotate(360deg);
                opacity: 0;
            }
        }

        @keyframes flipHint {

            0%,
            100% {
                transform: rotateY(0deg);
            }

            50% {
                transform: rotateY(180deg);
            }
        }

        /* Jackpot Effects */
        .jackpot-mode body {
            animation: shake-hard 0.5s ease-in-out;
        }

        .jackpot-mode .container {
            animation: shake-hard 0.5s ease-in-out;
        }

        @keyframes shake-hard {
            0% {
                transform: translate(0, 0) rotate(0deg);
            }

            10% {
                transform: translate(-10px, -10px) rotate(-5deg);
            }

            20% {
                transform: translate(10px, 10px) rotate(5deg);
            }

            30% {
                transform: translate(-10px, 10px) rotate(-5deg);
            }

            40% {
                transform: translate(10px, -10px) rotate(5deg);
            }

            50% {
                transform: translate(-5px, -5px) rotate(-2deg);
            }

            60% {
                transform: translate(5px, 5px) rotate(2deg);
            }

            100% {
                transform: translate(0, 0) rotate(0deg);
            }
        }

        .jackpot-overlay {
            position: fixed;
            inset: 0;
            background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
            z-index: 999;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.5s;
            mix-blend-mode: overlay;
        }

        .jackpot-active .jackpot-overlay {
            opacity: 1;
            animation: pulse-gold 2s infinite;
        }

        @keyframes pulse-gold {

            0%,
            100% {
                opacity: 0.3;
            }

            50% {
                opacity: 0.7;
            }
        }

        @keyframes ecgDraw {
            0% {
                stroke-dashoffset: 1000;
                opacity: 1;
            }

            80% {
                opacity: 1;
            }

            100% {
                stroke-dashoffset: 0;
                opacity: 0;
            }
        }

        /* Wallet styles */
        /* Wallet styles */
        .wallet-container {
            pointer-events: auto;
            position: relative;
            /* Changed from fixed */
            top: auto;
            right: auto;
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid var(--gold-primary);
            border-radius: 50px;
            padding: 0.5rem 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            z-index: 100;
            color: var(--gold-primary);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            font-family: 'Be Vietnam Pro', sans-serif;
            transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            max-width: 60%;
            /* Allow it to take up reasonable space */
        }

        .wallet-container.update {
            transform: scale(1.1);
        }

        .wallet-balance {
            font-weight: 700;
            font-size: 1.1rem;
        }

        .withdraw-btn {
            background: var(--red-primary);
            color: #fff;
            border: none;
            padding: 0.2rem 0.5rem;
            border-radius: 4px;
            font-size: 0.8rem;
            cursor: pointer;
            margin-left: 0.5rem;
            transition: all 0.2s;
        }

        .withdraw-btn:hover {
            transform: scale(1.05);
            background: var(--red-dark);
        }

        .withdraw-btn:active {
            transform: scale(0.95);
        }

        .fake-notification {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%) translateY(-150%);
            opacity: 0;
            width: 95%;
            max-width: 380px;
            background: rgba(240, 240, 240, 0.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            padding: 12px 15px;
            border-radius: 18px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
            display: flex;
            flex-direction: column;
            gap: 8px;
            z-index: 10000;
            border: 1px solid rgba(255, 255, 255, 0.4);
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            color: #000;
            will-change: transform, opacity;
            transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1),
                opacity 0.4s cubic-bezier(0.19, 1, 0.22, 1);
            pointer-events: none;
        }

        .fake-notification.show {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
            pointer-events: auto;
        }

        .fake-notification-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 0.8rem;
            color: #666;
        }

        .fake-notification-header .app-info {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .fake-notification-header .app-icon {
            width: 20px;
            height: 20px;
            border-radius: 5px;
            background: #004D40;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 12px;
            font-weight: bold;
        }

        .fake-notification-header .app-name {
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.75rem;
            letter-spacing: 0.02em;
        }

        .fake-notification-header .time {
            font-size: 0.75rem;
        }

        .fake-notification-content {
            font-size: 0.95rem;
            line-height: 1.3;
            color: #000;
            display: -webkit-box;
            -webkit-line-clamp: 4;
            line-clamp: 4;
            -webkit-box-orient: vertical;
            overflow: hidden;
            font-weight: 400;
        }

        .wallet-currency {
            font-size: 0.8rem;
            opacity: 0.8;
        }

        /* Very small screens - hide decorations */
        @media (max-width: 320px) {

            .result-card .wish::before,
            .result-card .wish::after {
                display: none;
            }

            .result-card .wish {
                padding: 1.5rem 1rem;
            }
        }

        /* Responsive */
        @media (max-width: 360px) {
            .buttons {
                flex-direction: column;
                align-items: center;
            }

            .btn {
                width: 100%;
                max-width: 200px;
            }

            .utility-bar {
                gap: 0.3rem;
            }

            .icon-btn {
                width: 36px;
                height: 36px;
                font-size: 1rem;
            }

            .wallet-container {
                padding: 0.4rem 0.8rem;
                font-size: 0.9rem;
            }

            .wallet-balance {
                font-size: 1rem;
            }

            .header h1 {
                font-size: 1.5rem;
            }

            .department-badge {
                font-size: 0.7rem;
                padding: 0.4rem 1rem;
            }

            .result-card .wish {
                padding: 2.5rem 1rem;
                font-size: 1rem;
            }

            /* Smaller decorations on mobile */
            .result-card .wish::before,
            .result-card .wish::after {
                font-size: 1.2rem;
                opacity: 0.4;
            }
        }

        /* Small phones */
        @media (max-width: 480px) {
            .container {
                margin-top: 4rem;
            }

            .envelope {
                width: clamp(180px, 55vw, 220px);
                height: clamp(270px, 82vw, 330px);
            }

            .money-stack-container {
                max-width: clamp(220px, 65vw, 300px);
            }

            .modal-content {
                width: 98%;
                max-height: 85vh;
            }

            .bank-grid {
                grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
                gap: 8px;
                max-height: 220px;
            }

            .bank-item {
                min-height: 60px;
                padding: 8px 4px;
            }

            .bank-item img {
                height: 24px;
            }

            .bank-item span {
                font-size: 0.6rem;
            }

            .share-btn {
                width: 45px;
                height: 45px;
                font-size: 1.3rem;
            }

            /* Smaller decorations on small phones */
            .result-card .wish::before,
            .result-card .wish::after {
                font-size: 1.4rem;
                opacity: 0.5;
            }

            .result-card .wish {
                padding: 2.5rem 1rem;
            }
        }

        /* Medium screens */
        @media (min-width: 481px) and (max-width: 768px) {
            .container {
                max-width: 480px;
            }

            .result-card {
                max-width: 420px;
            }
        }

        /* Large screens */
        @media (min-width: 768px) {
            .container {
                max-width: 550px;
            }

            .money-card {
                max-width: 380px;
            }

            .modal-content {
                max-width: 520px;
            }

            .bank-grid {
                grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
            }

            .utility-bar {
                top: 1.5rem;
                left: 1.5rem;
                gap: 0.75rem;
            }

            .icon-btn {
                width: 45px;
                height: 45px;
                font-size: 1.3rem;
            }

            .wallet-container {
                top: 1.5rem;
                right: 1.5rem;
            }
        }

        /* Landscape phones */
        @media (max-height: 500px) and (orientation: landscape) {
            .container {
                margin-top: 1rem;
            }

            .envelope {
                width: 140px;
                height: 210px;
            }

            .envelope-container {
                margin: 2rem auto 1rem;
            }

            .header h1 {
                font-size: 1.5rem;
            }

            .header p {
                font-size: 0.85rem;
            }

            .department-badge {
                display: none;
            }

            .result-card {
                padding: 1rem;
            }

            .result-card .amount {
                font-size: 2rem;
            }

            .money-stack-container {
                max-width: 200px;
            }

            .result-card .wish {
                padding: 1.5rem 1rem;
                font-size: 0.95rem;
            }

            /* Hide decorations on landscape - not enough space */
            .result-card .wish::before,
            .result-card .wish::after {
                display: none;
            }
        }

        /* Typewriter Cursor */
        .typing-cursor::after {
            content: '|';
            animation: blink 1s step-end infinite;
            color: var(--red-primary);
        }

        @keyframes blink {
            50% {
                opacity: 0;
            }
        }

        @media (prefers-reduced-motion: reduce) {

            *,
            *::before,
            *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
        }

        /* Safe area for notched phones */
        @supports (padding: max(0px)) {
            body {
                padding-left: max(1rem, env(safe-area-inset-left));
                padding-right: max(1rem, env(safe-area-inset-right));
                padding-bottom: max(1rem, env(safe-area-inset-bottom));
            }
        }

        /* FIX: Improved no-scroll - simply prevent overflow */
        body.no-scroll {
            overflow: hidden;
            height: 100vh;
        }

        /* --- NEW SKINS --- */
        /* Holographic Skin (Pokemon Style) */
        .envelope.skin-holo .envelope-body {
            background: linear-gradient(135deg,
                    #c0c0ff 0%, #ffc0cb 20%, #ffffc0 40%,
                    #c0ffc0 60%, #c0ffff 80%, #c0c0ff 100%);
            background-size: 300% 300%;
            animation: holoShift 4s ease infinite;
            border: 2px solid rgba(255, 255, 255, 0.5);
            box-shadow:
                0 4px 20px rgba(192, 192, 255, 0.4),
                inset 0 0 30px rgba(255, 255, 255, 0.3);
            overflow: hidden;
        }

        .envelope.skin-holo .envelope-body::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(125deg,
                    rgba(255, 255, 255, 0) 0%,
                    rgba(255, 255, 255, 0.4) 45%,
                    rgba(255, 255, 255, 0) 50%,
                    rgba(255, 255, 255, 0) 100%);
            background-size: 200% 200%;
            background-repeat: no-repeat;
            animation: holoShineMove 3s ease infinite;
            pointer-events: none;
            mix-blend-mode: overlay;
        }

        .envelope.skin-holo .envelope-flap {
            background: linear-gradient(135deg, #c0c0ff 0%, #ffc0cb 50%, #ffffc0 100%);
            background-size: 200% 200%;
            animation: holoShift 4s ease infinite;
            border: 2px solid rgba(255, 255, 255, 0.5);
            border-top: none;
        }

        /* Diamond Skin (10M) */
        .envelope.skin-diamond .envelope-body {
            background: linear-gradient(135deg, #e0f7fa 0%, #80deea 100%);
            border: 3px solid #fff;
            box-shadow: 0 0 30px #00e5ff;
        }

        .envelope.skin-diamond .envelope-flap {
            background: linear-gradient(135deg, #b2ebf2 0%, #4dd0e1 100%);
        }

        .icon-btn {
            background: rgba(0, 0, 0, 0.4);
            border: 1px solid var(--gold-primary);
            color: var(--gold-primary);
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .icon-btn:hover {
            background: rgba(0, 0, 0, 0.6);
            transform: scale(1.1);
        }

        .icon-btn i {
            font-size: 1.2rem;
            display: block;
        }

        /* Modal - FIXED */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            z-index: 2000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .modal-overlay.open {
            display: flex;
        }

        .modal-content {
            background: var(--cream);
            width: 95%;
            max-width: 500px;
            border-radius: 1rem;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            border: 2px solid var(--gold-primary);
            animation: popIn 0.3s ease-out;
        }

        .modal-header {
            padding: 1rem;
            background: var(--red-primary);
            color: var(--white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: bold;
            font-size: 1.2rem;
            /* Prevent clicks from bubbling through */
            position: relative;
            z-index: 10;
        }

        .modal-body {
            padding: 1rem;
            overflow-y: auto;
            color: var(--red-dark);
            /* Ensure body doesn't close modal on click */
            position: relative;
        }

        .close-btn {
            background: none;
            border: none;
            color: white;
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.25rem 0.5rem;
            line-height: 1;
        }

        .close-btn:hover {
            opacity: 0.8;
        }

        /* History List */
        .history-list {
            list-style: none;
        }

        .history-item {
            display: flex;
            justify-content: space-between;
            padding: 0.5rem 0;
            border-bottom: 1px solid #eee;
        }

        .history-item.gain {
            color: #008000;
        }

        .history-item.loss {
            color: #cc0000;
        }

        .tier-badge {
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 0.8rem;
            font-weight: bold;
            margin-right: 0.5rem;
        }

        .tier-SSR {
            background: gold;
            color: red;
        }

        .tier-SR {
            background: #9932CC;
            color: white;
        }

        .tier-R {
            background: #00BFFF;
            color: white;
        }

        .tier-N {
            background: #eee;
            color: #555;
        }

        /* Stats Grid */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.75rem;
            margin-bottom: 1rem;
        }

        @media (min-width: 400px) {
            .stats-grid {
                grid-template-columns: repeat(4, 1fr);
            }
        }

        .stat-box {
            background: linear-gradient(135deg, #fff 0%, var(--cream) 100%);
            border: 1px solid var(--gold-light);
            padding: 0.8rem;
            border-radius: 8px;
            text-align: center;
        }

        .stat-val {
            font-size: 1.5rem;
            font-weight: bold;
            color: var(--red-primary);
        }

        .stat-label {
            font-size: 0.8rem;
            color: var(--red-dark);
            opacity: 0.8;
        }

        /* Achievement Toast */
        .achievement-toast {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%) translateY(-120px);
            opacity: 0;
            background: linear-gradient(135deg, #1a1a2e, #16213e);
            color: #fff;
            padding: 1rem 1.25rem;
            border-radius: 16px;
            display: flex;
            align-items: center;
            gap: 1rem;
            z-index: 3000;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
            border: 2px solid var(--gold-primary);
            width: 90%;
            max-width: 360px;
            will-change: transform, opacity;
            transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.4s ease;
            pointer-events: none;
        }

        .achievement-toast.show {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
            pointer-events: auto;
        }

        .achievement-toast .icon {
            font-size: 2rem;
            min-width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 215, 0, 0.15);
            border-radius: 12px;
        }

        .achievement-toast .info {
            flex: 1;
        }

        .achievement-toast .info .title {
            font-weight: bold;
            color: var(--gold-primary);
            font-size: 0.9rem;
        }

        .achievement-toast .info .desc {
            font-size: 0.85rem;
            opacity: 0.9;
        }

        .achievement-toast .skin-unlock {
            font-size: 0.8rem;
            color: #FFD700;
            margin-top: 0.25rem;
            font-weight: bold;
            animation: pulse 1s ease-in-out infinite;
        }

        /* Info Table */
        .info-table {
            width: 100%;
            border-collapse: collapse;
        }

        .info-table th,
        .info-table td {
            padding: 0.5rem;
            text-align: left;
            border-bottom: 1px solid #eee;
        }

        .info-table th {
            color: var(--red-primary);
        }

        /* Zodiac Selector */
        .zodiac-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.5rem;
        }

        .zodiac-btn {
            background: #fff;
            border: 1px solid #ddd;
            padding: 0.5rem;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1.5rem;
            transition: all 0.2s;
        }

        .zodiac-btn:hover {
            background: var(--gold-light);
            transform: scale(1.1);
        }

        .fortune-text {
            font-style: italic;
            color: var(--medical-blue);
            margin-top: 1rem;
            padding: 1rem;
            background: #f0f8ff;
            border-radius: 8px;
        }

        /* Achievement badges */
        .achievement-badge {
            width: 50px;
            height: 50px;
            background: linear-gradient(135deg, #fff, #fff8e1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: help;
            position: relative;
            transition: all 0.2s ease;
            border: 1px solid var(--gold-primary);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        .achievement-badge:hover {
            transform: scale(1.15);
            z-index: 10;
        }

        .achievement-badge .achi-icon {
            font-size: 1.5rem;
        }

        .achievement-badge .skin-indicator {
            position: absolute;
            bottom: -5px;
            right: -5px;
            font-size: 0.8rem;
            background: white;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
        }

        /* Skin-specific achievement styles */
        .achievement-badge.skin-gold {
            background: linear-gradient(135deg, #FFD700, #FDB931);
            border-color: #FFF;
            box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
        }

        .achievement-badge.skin-holo {
            background: linear-gradient(135deg, #c0c0ff, #ffc0cb, #ffffc0, #c0ffc0);
            background-size: 200% 200%;
            animation: holoShift 3s ease infinite;
            border-color: rgba(255, 255, 255, 0.8);
            box-shadow: 0 0 15px rgba(192, 192, 255, 0.5);
        }

        .achievement-badge.skin-diamond {
            background: linear-gradient(135deg, #e0f7fa, #80deea);
            border-color: #FFF;
            box-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
        }

        .achievement-progress {
            width: 100%;
            text-align: center;
            margin-top: 0.5rem;
            color: #666;
        }

        #achievementsList {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            margin-bottom: 1rem;
            align-items: center;
        }

        /* Skin Collection */
        .skin-collection {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.5rem;
            margin-bottom: 1rem;
        }

        .skin-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 0.5rem;
            border-radius: 8px;
            background: #f5f5f5;
            border: 2px solid #ddd;
            transition: all 0.2s;
        }

        .skin-item.unlocked {
            border-color: var(--gold-primary);
            background: rgba(255, 215, 0, 0.1);
        }

        .skin-preview {
            width: 40px;
            height: 50px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            margin-bottom: 0.25rem;
        }

        .default-preview {
            background: linear-gradient(180deg, var(--red-primary), var(--red-dark));
            border: 2px solid var(--gold-primary);
        }

        .gold-preview {
            background: linear-gradient(135deg, #FFD700, #FDB931);
            border: 2px solid #FFF;
            box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
        }

        .holo-preview {
            background: linear-gradient(135deg, #c0c0ff, #ffc0cb, #ffffc0);
            background-size: 200% 200%;
            animation: holoShift 3s ease infinite;
            border: 2px solid rgba(255, 255, 255, 0.8);
        }

        .diamond-preview {
            background: linear-gradient(135deg, #e0f7fa, #80deea);
            border: 2px solid #FFF;
            box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
        }

        .skin-item span {
            font-size: 0.7rem;
            text-align: center;
        }

        .skin-status {
            font-size: 0.65rem !important;
            color: #999;
        }

        .skin-status.unlocked {
            color: #2e7d32;
        }

        .skin-item.locked {
            opacity: 0.6;
        }

        @media (max-width: 400px) {
            .skin-collection {
                grid-template-columns: repeat(2, 1fr);
            }

            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        /* Mute button state */
        .icon-btn.muted {
            opacity: 0.6;
            color: #999;
            border-color: #999;
        }

        /* Reset Link */
        .reset-link {
            color: rgba(255, 255, 255, 0.4);
            font-size: 0.8rem;
            text-decoration: underline;
            cursor: pointer;
            margin-top: 0.5rem;
            display: inline-block;
        }

        .reset-link:hover {
            display: inline-block;
            color: var(--red-primary);
        }

        /* Withdraw Modal Styles - FIXED */
        .withdraw-form {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .form-group {
            text-align: left;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
            color: #333;
        }

        .form-input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 1rem;
            font-family: inherit;
            -webkit-appearance: none;
            appearance: none;
            background: #fff;
        }

        /* Fix Select Arrow for Safari/Others after appearance:none */
        select.form-input {
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 1rem center;
            background-size: 1.25em;
            padding-right: 2.5rem;
            animation: none !important;
            /* Force kill any animation */
            transition: border-color 0.3s, box-shadow 0.3s !important;
            /* Only transition borders */
        }

        select.form-input:focus {
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFD700' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
        }

        .form-input:focus {
            outline: none;
            border-color: var(--gold-primary);
            box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
        }

        /* FIXED: Bank Grid with better scrolling */
        .bank-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
            gap: 10px;
            max-height: 280px;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 8px;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            background: #fafafa;
            /* Smooth scrolling */
            scroll-behavior: smooth;
            -webkit-overflow-scrolling: touch;
        }

        /* Custom scrollbar for bank grid */
        .bank-grid::-webkit-scrollbar {
            width: 6px;
        }

        .bank-grid::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }

        .bank-grid::-webkit-scrollbar-thumb {
            background: var(--gold-primary);
            border-radius: 3px;
        }

        .bank-grid::-webkit-scrollbar-thumb:hover {
            background: var(--gold-dark);
        }

        /* FIXED: Bank item with proper sizing and fallback */
        .bank-item {
            border: 2px solid #e8e8e8;
            border-radius: 10px;
            padding: 10px 6px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            width: 100%;
            min-height: 70px;
            text-align: center;
            background: white;
            /* Prevent text selection on rapid clicks */
            user-select: none;
            -webkit-user-select: none;
        }

        .bank-item:hover {
            border-color: var(--gold-primary);
            background: rgba(255, 215, 0, 0.08);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .bank-item:active {
            transform: translateY(0);
        }

        .bank-item.selected {
            border: 2px solid var(--red-primary);
            background: rgba(196, 30, 58, 0.08);
            box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.2);
        }

        .bank-item img {
            height: 28px;
            width: auto;
            max-width: 60px;
            object-fit: contain;
        }

        .bank-item span {
            font-size: 0.7rem;
            font-weight: 600;
            line-height: 1.2;
            color: #444;
            word-break: break-word;
            max-width: 100%;
        }

        /* Fallback for failed images */
        .bank-item.img-error {
            background: #f5f5f5;
        }

        .bank-item.img-error .bank-fallback {
            width: 28px;
            height: 28px;
            background: var(--red-primary);
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 0.7rem;
        }

        .withdraw-note {
            font-size: 0.8rem;
            color: #666;
            margin-top: 0.5rem;
            font-style: italic;
        }

        /* Loading state for banks */
        .bank-grid.loading {
            min-height: 150px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .bank-grid.loading::after {
            content: 'Đang tải...';
            color: #999;
            font-style: italic;
        }

        /* ==================== TIER-SPECIFIC REVEAL ANIMATIONS ==================== */
        /* Reveal overlay for dramatic effects */
        .reveal-overlay {
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 1500;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .reveal-overlay.active {
            opacity: 1;
        }

        /* SSR: Golden explosion effect */
        .reveal-ssr {
            background: radial-gradient(circle at center,
                    rgba(255, 215, 0, 0.9) 0%,
                    rgba(255, 180, 0, 0.6) 30%,
                    rgba(255, 100, 0, 0.3) 60%,
                    transparent 80%);
            animation: ssrReveal 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        }

        .reveal-ssr::before {
            content: '⭐';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0);
            font-size: 8rem;
            animation: ssrStar 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
            filter: drop-shadow(0 0 30px gold);
        }

        @keyframes ssrReveal {
            0% {
                opacity: 0;
                transform: scale(0.5);
            }

            20% {
                opacity: 1;
                transform: scale(1.2);
            }

            40% {
                opacity: 1;
                transform: scale(1);
            }

            100% {
                opacity: 0;
                transform: scale(1.5);
            }
        }

        @keyframes ssrStar {
            0% {
                transform: translate(-50%, -50%) scale(0) rotate(0deg);
                opacity: 0;
            }

            50% {
                transform: translate(-50%, -50%) scale(1.5) rotate(180deg);
                opacity: 1;
            }

            100% {
                transform: translate(-50%, -50%) scale(0.5) rotate(360deg);
                opacity: 0;
            }
        }

        /* SR: Purple shimmer wave */
        .reveal-sr {
            background: linear-gradient(135deg,
                    rgba(138, 43, 226, 0) 0%,
                    rgba(153, 50, 204, 0.6) 50%,
                    rgba(138, 43, 226, 0) 100%);
            background-size: 300% 300%;
            animation: srShimmer 0.8s ease-out forwards;
        }

        .reveal-sr::after {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at center,
                    rgba(200, 100, 255, 0.4) 0%,
                    transparent 60%);
            animation: srPulse 0.6s ease-out 0.2s forwards;
        }

        @keyframes srShimmer {
            0% {
                background-position: 100% 100%;
                opacity: 0;
            }

            50% {
                opacity: 1;
            }

            100% {
                background-position: 0% 0%;
                opacity: 0;
            }
        }

        @keyframes srPulse {
            0% {
                transform: scale(0.5);
                opacity: 0;
            }

            50% {
                opacity: 1;
            }

            100% {
                transform: scale(2);
                opacity: 0;
            }
        }

        /* R: Blue glow effect */
        .reveal-r {
            background: radial-gradient(circle at center,
                    rgba(0, 191, 255, 0.5) 0%,
                    rgba(0, 150, 255, 0.2) 40%,
                    transparent 70%);
            animation: rGlow 0.5s ease-out forwards;
        }

        @keyframes rGlow {
            0% {
                opacity: 0;
                transform: scale(0.8);
            }

            50% {
                opacity: 1;
            }

            100% {
                opacity: 0;
                transform: scale(1.3);
            }
        }

        /* Result card entrance animations per tier */
        .result-card.reveal-anim-ssr {
            animation: cardRevealSSR 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        }

        .result-card.reveal-anim-sr {
            animation: cardRevealSR 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        }

        .result-card.reveal-anim-r {
            animation: cardRevealR 0.5s ease-out forwards;
        }

        @keyframes cardRevealSSR {
            0% {
                opacity: 0;
                transform: scale(0.3) rotateY(180deg);
            }

            60% {
                transform: scale(1.1) rotateY(0deg);
            }

            100% {
                opacity: 1;
                transform: scale(1) rotateY(0deg);
            }
        }

        @keyframes cardRevealSR {
            0% {
                opacity: 0;
                transform: scale(0.5) translateY(50px);
            }

            100% {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        @keyframes cardRevealR {
            0% {
                opacity: 0;
                transform: scale(0.8);
            }

            100% {
                opacity: 1;
                transform: scale(1);
            }
        }

        /* ==================== LUCK METER (PITY SYSTEM) ==================== */
        .luck-meter-container {
            position: relative;
            width: 100%;
            max-width: 240px;
            margin: 1rem auto 0;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .luck-meter-wrapper {
            flex: 1;
            text-align: center;
        }

        .luck-meter {
            height: 8px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            overflow: hidden;
            border: 1px solid rgba(255, 215, 0, 0.3);
        }

        .luck-meter-fill {
            height: 100%;
            background: linear-gradient(90deg, #FFD700, #FF6B6B, #FF4444);
            border-radius: 4px;
            transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
        }

        .luck-meter-label {
            font-size: 0.75rem;
            color: var(--gold-light);
            margin-top: 0.3rem;
            opacity: 0.9;
        }

        .luck-meter-container.near-pity .luck-meter {
            animation: luckGlow 1s ease-in-out infinite;
        }

        .luck-meter-container.near-pity .luck-meter-label {
            color: #FF6B6B;
            font-weight: bold;
        }

        @keyframes luckGlow {

            0%,
            100% {
                box-shadow: 0 0 5px rgba(255, 100, 100, 0.5);
            }

            50% {
                box-shadow: 0 0 20px rgba(255, 100, 100, 0.8);
            }
        }

        /* ==================== LEADERBOARD ==================== */
        .leaderboard-container {
            background: linear-gradient(135deg, var(--red-dark) 0%, #5e0000 100%);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1rem;
            box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
        }

        .leaderboard-title {
            color: var(--gold-primary);
            font-size: 1rem;
            margin-bottom: 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .leaderboard-list {
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
        }

        .leaderboard-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 0.75rem;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            font-size: 0.85rem;
            color: #fff;
            transition: all 0.2s;
            border: 1px solid rgba(255, 215, 0, 0.1);
        }

        .leaderboard-item:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .leaderboard-item.current-user {
            background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 180, 0, 0.1));
            border: 1px solid var(--gold-primary);
            font-weight: bold;
        }

        .leaderboard-rank {
            min-width: 28px;
            text-align: center;
            font-weight: bold;
        }

        .leaderboard-rank.gold {
            color: #FFD700;
        }

        .leaderboard-rank.silver {
            color: #C0C0C0;
        }

        .leaderboard-rank.bronze {
            color: #CD7F32;
        }

        .leaderboard-name {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .leaderboard-score {
            color: var(--gold-light);
            font-weight: 600;
        }

        /* ==================== HOLOGRAPHIC CARD EFFECT ==================== */
        .money-card.holo-active {
            transform-style: preserve-3d;
            transition: transform 0.1s ease-out;
        }

        .money-card .holo-shine {
            position: absolute;
            inset: 0;
            background: linear-gradient(105deg,
                    transparent 20%,
                    rgba(255, 255, 255, 0.3) 30%,
                    rgba(255, 220, 100, 0.2) 35%,
                    rgba(100, 255, 200, 0.15) 40%,
                    rgba(200, 100, 255, 0.15) 45%,
                    rgba(255, 255, 255, 0.25) 50%,
                    transparent 60%);
            background-size: 250% 250%;
            border-radius: 16px;
            pointer-events: none;
            opacity: 0;
            mix-blend-mode: color-dodge;
            transition: opacity 0.3s;
            z-index: 10;
            transform: translateZ(1px);
            /* Prevent Z-fighting */
        }

        /* Tier Specific Holo Effects */
        .holo-shine.SSR {
            /* Rainbow already default but reinforced */
            background-image: linear-gradient(105deg,
                    transparent 20%,
                    rgba(255, 0, 0, 0.2) 30%,
                    rgba(255, 255, 0, 0.2) 35%,
                    rgba(0, 255, 0, 0.2) 40%,
                    rgba(0, 255, 255, 0.2) 45%,
                    rgba(0, 0, 255, 0.2) 50%,
                    rgba(255, 0, 255, 0.2) 55%,
                    transparent 60%);
        }

        .holo-shine.SR {
            /* Gold/Amber */
            background-image: linear-gradient(105deg,
                    transparent 20%,
                    rgba(255, 223, 0, 0.1) 30%,
                    rgba(255, 215, 0, 0.4) 40%,
                    rgba(255, 223, 0, 0.1) 50%,
                    transparent 60%);
        }

        .holo-shine.R {
            /* Silver/Blue */
            background-image: linear-gradient(105deg,
                    transparent 20%,
                    rgba(255, 255, 255, 0.1) 30%,
                    rgba(200, 230, 255, 0.3) 40%,
                    rgba(255, 255, 255, 0.1) 50%,
                    transparent 60%);
        }

        /* Simple Gloss/White effect for Common */
        .holo-shine.N {
            background-image: linear-gradient(105deg,
                    transparent 20%,
                    rgba(255, 255, 255, 0.2) 30%,
                    rgba(255, 255, 255, 0.4) 40%,
                    rgba(255, 255, 255, 0.2) 50%,
                    transparent 60%);
            mix-blend-mode: screen;
        }

        /* Ensure visibility on dark/light backgrounds */

        .holo-shine {
            /* Rainbow/Oil slick effect */
            background-image: linear-gradient(105deg,
                    transparent 20%,
                    rgba(255, 0, 0, 0.2) 30%,
                    rgba(0, 255, 0, 0.2) 40%,
                    rgba(0, 0, 255, 0.2) 50%,
                    transparent 60%);
            display: block;
            /* Ensure it exists in DOM */
            opacity: 0;
            /* Hidden by default until active */
        }

        /* Specific override to show when active, using ID for higher specificity */
        #moneyStackWrapper.holo-active .holo-shine,
        .money-card.holo-active .holo-shine {
            opacity: 1 !important;
            display: block !important;
        }

        /* Back face holo-shine needs mirrored gradient direction */
        .money-back .holo-shine {
            /* Mirror the gradient angle for the back face (105deg -> 75deg reflected) */
            background-image: linear-gradient(-105deg,
                    transparent 20%,
                    rgba(255, 0, 0, 0.2) 30%,
                    rgba(0, 255, 0, 0.2) 40%,
                    rgba(0, 0, 255, 0.2) 50%,
                    transparent 60%);
        }

        .money-back .holo-shine.SSR {
            background-image: linear-gradient(-105deg,
                    transparent 20%,
                    rgba(255, 0, 0, 0.2) 30%,
                    rgba(255, 255, 0, 0.2) 35%,
                    rgba(0, 255, 0, 0.2) 40%,
                    rgba(0, 255, 255, 0.2) 45%,
                    rgba(0, 0, 255, 0.2) 50%,
                    rgba(255, 0, 255, 0.2) 55%,
                    transparent 60%);
        }

        .money-back .holo-shine.SR {
            background-image: linear-gradient(-105deg,
                    transparent 20%,
                    rgba(255, 223, 0, 0.1) 30%,
                    rgba(255, 215, 0, 0.4) 40%,
                    rgba(255, 223, 0, 0.1) 50%,
                    transparent 60%);
        }

        .money-back .holo-shine.R {
            background-image: linear-gradient(-105deg,
                    transparent 20%,
                    rgba(255, 255, 255, 0.1) 30%,
                    rgba(200, 230, 255, 0.3) 40%,
                    rgba(255, 255, 255, 0.1) 50%,
                    transparent 60%);
        }

        .money-back .holo-shine.N {
            background-image: linear-gradient(-105deg,
                    transparent 20%,
                    rgba(255, 255, 255, 0.2) 30%,
                    rgba(255, 255, 255, 0.4) 40%,
                    rgba(255, 255, 255, 0.2) 50%,
                    transparent 60%);
        }

        /* Desktop Hover Effect Only */
        @media (hover: hover) {
            .money-card:hover .holo-shine {
                opacity: 1 !important;
                display: block !important;
            }

            .money-card:hover {
                transform: var(--stack-transform) scale(1.05) !important;
                z-index: 10 !important;
            }
        }

        /* Enhanced Diamond Skin - Premium Holographic Rainbow */
        .envelope.skin-diamond .envelope-body {
            background: linear-gradient(135deg,
                    #ff6b6b 0%, #feca57 15%, #48dbfb 30%,
                    #ff9ff3 45%, #54a0ff 60%, #5f27cd 75%,
                    #00d2d3 90%, #ff6b6b 100%);
            background-size: 400% 400%;
            animation: diamondShift 6s ease infinite;
            border: 3px solid rgba(255, 255, 255, 0.8);
            box-shadow:
                0 0 40px rgba(255, 100, 255, 0.4),
                0 0 80px rgba(100, 200, 255, 0.2),
                inset 0 0 30px rgba(255, 255, 255, 0.3);
        }



        .envelope.skin-diamond .envelope-flap {
            background: linear-gradient(180deg,
                    #ff9ff3 0%, #54a0ff 50%, #00d2d3 100%);
            background-size: 200% 200%;
            animation: diamondShift 6s ease infinite;
            border: 3px solid rgba(255, 255, 255, 0.8);
            border-top: none;
        }

        .envelope.skin-diamond .envelope-seal {
            background: linear-gradient(135deg, #fff, #f0f0f0, #fff);
            box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
        }

        @keyframes diamondShift {

            0%,
            100% {
                background-position: 0% 50%;
            }

            50% {
                background-position: 100% 50%;
            }
        }

        @keyframes diamondShine {
            0% {
                background-position: 200% 0;
            }

            100% {
                background-position: -200% 0;
            }
        }

        /* Diamond skin preview (stats modal) */
        .diamond-preview {
            background: linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3) !important;
            background-size: 300% 300% !important;
            animation: diamondShift 4s ease infinite !important;
            box-shadow: 0 0 15px rgba(255, 100, 255, 0.5) !important;
        }

        /* Tap Event Styles */
        .tap-event-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.85);
            z-index: 5000;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.3s ease;
            pointer-events: auto;
            /* Changed to auto to capture clicks on mobile */
        }

        .tap-event-overlay.active {
            display: flex;
        }

        .tap-event-content {
            text-align: center;
            color: white;
            pointer-events: none;
            width: 100%;
            max-width: 400px;
            padding: 2rem;
        }

        .tap-title {
            font-size: clamp(2rem, 8vw, 3rem);
            color: #FFD700;
            text-shadow: 0 0 20px #FF4500;
            animation: pulse-gold 0.5s infinite alternate;
            margin-bottom: 0.5rem;
        }

        .tap-subtitle {
            font-size: 1.2rem;
            margin-bottom: 2rem;
            color: #FFF;
        }

        .tap-timer-bar {
            width: 100%;
            height: 10px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 5px;
            overflow: hidden;
            margin-bottom: 1.5rem;
        }

        .tap-timer-fill {
            height: 100%;
            background: linear-gradient(90deg, #FFD700, #FF4500);
            width: 100%;
            transform-origin: left;
        }

        .tap-counter {
            font-size: 2rem;
            font-weight: bold;
            color: #00E676;
        }

        /* Shake Harder Animation */
        @keyframes shake-extreme {

            0%,
            100% {
                transform: translate(0, 0) rotate(0deg);
            }

            10% {
                transform: translate(-15px, -15px) rotate(-10deg);
            }

            30% {
                transform: translate(15px, 15px) rotate(10deg);
            }

            50% {
                transform: translate(-10px, -10px) rotate(-5deg);
            }

            70% {
                transform: translate(10px, 10px) rotate(5deg);
            }
        }

        .envelope.shake-extreme {
            animation: shake-extreme 0.2s ease-in-out infinite;
        }

        #bankSearchInput {
            width: 100%;
            padding: 12px 15px;
            border: 2px solid var(--gold-primary);
            border-radius: 12px;
            margin-bottom: 1rem;
            font-family: inherit;
            font-size: 1rem;
            background: #fffafa;
            color: var(--red-dark);
            outline: none;
            transition: all 0.3s;
        }

        #bankSearchInput:focus {
            box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
            border-color: var(--gold-dark);
        }

        /* Mobile-specific: Disable hover effects on touch devices */
        @media (hover: none) and (pointer: coarse) {
            .envelope:hover {
                animation: float 4s ease-in-out infinite;
            }

            .share-btn:hover {
                transform: translateZ(0);
                box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
            }

            .fab-option-btn:hover {
                transform: none;
                background: white;
            }

            .rate-info-btn:hover {
                transform: none;
                background: var(--red-dark);
            }
        }

        /* --- TOAST & CUSTOM MODAL --- */
        .toast-container {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 3000;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
            width: max-content;
            max-width: 90vw;
        }

        .toast {
            background: rgba(20, 20, 20, 0.9);
            color: white;
            padding: 12px 20px;
            border-radius: 50px;
            font-size: 0.95rem;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            animation: toastSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
            display: flex;
            align-items: center;
            gap: 10px;
            backdrop-filter: blur(5px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            transform-origin: center bottom;
        }

        .toast.error {
            border-left: 4px solid #ff4444;
        }

        .toast.success {
            border-left: 4px solid #00C851;
        }

        .toast.warning {
            border-left: 4px solid #FF8800;
        }

        @keyframes toastSlideUp {
            from {
                opacity: 0;
                transform: translateY(20px) scale(0.9);
            }

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

        @keyframes toastFadeOut {
            to {
                opacity: 0;
                transform: translateY(-10px) scale(0.95);
            }
        }

        /* --- CUSTOM MODAL POLISH --- */
        .url-preview {
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            background-color: #f0f0f0;
            position: relative;
        }

        .url-preview::after {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            border: 1px solid rgba(0, 0, 0, 0.05);
            pointer-events: none;
        }

        .form-group {
            position: relative;
            margin-bottom: 1.25rem;
        }

        .form-group label {
            font-weight: 700;
            color: var(--red-dark);
            margin-bottom: 0.5rem;
            display: block;
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .form-input {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid #e0e0e0;
            border-radius: 12px;
            font-family: inherit;
            font-size: 1rem;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            outline: none;
            background: #f8f9fa;
            color: #333;
        }

        .form-input:hover {
            background: #fff;
            border-color: #d0d0d0;
        }

        .form-input:focus {
            border-color: var(--gold-primary);
            background: #fff;
            box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.2);
            transform: translateY(-1px);
        }

        textarea.form-input {
            resize: vertical;
            min-height: 80px;
            line-height: 1.5;
        }

        /* Premium Button Polish */
        .modal-body .btn {
            position: relative;
            overflow: hidden;
            transition: all 0.3s;
            font-weight: 700;
            letter-spacing: 0.5px;
            box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
        }

        .modal-body .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
            background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
        }

        .modal-body .btn:active {
            transform: translateY(0);
        }

        /* Custom file input look for URLs */
        input[type='url'].form-input {
            padding-left: 40px;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23999" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>');
            background-repeat: no-repeat;
            background-position: 12px center;
        }

        input[type='url'].form-input:focus {
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23FFD700" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>');
        }


        /* --- INLINE PREVIEW (No Layout Shift) --- */
        .input-with-preview {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .input-with-preview .form-input {
            flex: 1;
        }

        .mini-preview {
            width: 0;
            height: 46px;
            /* Match standard input height */
            overflow: hidden;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border-radius: 8px;
            background-size: cover;
            background-position: center;
            background-color: #f0f0f0;
            flex-shrink: 0;
            opacity: 0;
            transform: translateX(10px);
        }

        .mini-preview.active {
            width: 46px;
            /* Square thumbnail */
            opacity: 1;
            transform: translateX(0);
            border: 2px solid var(--gold-primary);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        /* Hover to see larger preview */
        .mini-preview:hover {
            transform: scale(2.5) translateX(-10px);
            /* Zoom in */
            z-index: 100;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        }

        /* Fix Select Arrow Repetition */
        select.form-input {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23FFD700" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="6 9 12 15 18 9"%3E%3C/polyline%3E%3C/svg%3E');
            background-repeat: no-repeat !important;
            background-position: right 10px center !important;
            background-size: 20px !important;
            padding-right: 40px;
            cursor: pointer;
        }