﻿



    /* ===================================================
   FIX DEFINITIV "PÂNZĂ" / BLOCARE SELECȚIE BROWSER
   =================================================== */
* {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    
    /* MAGIA AICI: Oprește browserul din a face "highlight" pe elementele 3D la click */
    outline: none !important; 
    -webkit-tap-highlight-color: transparent !important;
}

html, body {
    /* Împiedicăm absolut orice depășire invizibilă a ecranului */
    overflow: hidden !important;
    width: 100vw !important;
    height: 100vh !important;
}

::selection { background: transparent !important; color: inherit !important; }
::-moz-selection { background: transparent !important; color: inherit !important; }


    

/* Și dacă browserul tot încearcă să selecteze, facem pânza complet invizibilă */
::selection { background: transparent !important; color: inherit !important; }
::-moz-selection { background: transparent !important; color: inherit !important; }
:root {
            /* Theme */
            --bg-color: #0f0c29;
            --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
            
            /* Glassmorphism */
            --glass-bg: rgba(15, 12, 41, 0.95);
            --glass-border: 1px solid rgba(255, 255, 255, 0.1);
            --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

            /* Accents */
            --accent-color: #3b82f6; 
            --accent-green: #10b981;
            --accent-purple: #8b5cf6;
            --text-primary: #ffffff;
            --text-secondary: #94a3b8;
            
            --font-display: 'Montserrat', sans-serif;
            --font-ui: 'Inter', sans-serif;
            
            --card-width: 110px;
            --card-height: 154px;
            
            --panel-width: 320px;
        }

        * { box-sizing: border-box; }

        html, body {
            margin: 0; padding: 0;
            width: 100vw; height: 100vh;
            overflow: hidden;
            font-family: var(--font-ui);
            background: var(--bg-gradient);
            color: var(--text-primary);
            user-select: none; -webkit-user-select: none;
            display: flex;
            flex-direction: row;
        }

        /* --- LAYOUT COLUMNS --- */
        
        /* SIDE PANELS (Common Styles) */
        .side-panel {
            width: var(--panel-width);
            min-width: var(--panel-width);
            height: 100vh;
            background: var(--glass-bg);
            border-right: var(--glass-border);
            border-left: var(--glass-border);
            display: flex;
            flex-direction: column;
            position: relative;
            z-index: 50;
            transition: margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: var(--glass-shadow);
        }


                    #golden-flyer {
            position: fixed; 
            width: 130px; 
            height: 100px;
            cursor: pointer;
            /* SECRETUL: Panourile au z-index 50. O punem la 45, astfel zboarÄƒ PESTE joc, dar SUB meniuri! */
            z-index: 45; 
            display: none; 
            justify-content: center; 
            align-items: center;
            animation: flyer-bob 0.8s infinite alternate ease-in-out;
        }

        #golden-flyer .card-body {
            position: relative;
            width: 50px; 
            height: 70px;
            background: linear-gradient(135deg, #fcd34d, #b45309);
            border: 2px solid #fff;
            border-radius: 6px;
            box-shadow: 0 0 20px #f59e0b;
            display: flex; justify-content: center; align-items: center;
            font-size: 1.8rem;
            z-index: 2; 
        }


	/* Containerele aripilor */
        #golden-flyer [class^="wing-"] {
            position: absolute;
            width: 70px;  /* Aripi mult mai mari È™i impunÄƒtoare */
            height: 70px;
            top: -5px;    /* Ridicate puÈ›in ca sÄƒ pice perfect pe stea */
            z-index: 1;
        }

        /* SetÄƒrile grafice ale modelului SVG */
        .svg-wing {
            width: 100%;
            height: 100%;
            filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.7)); 
        }

        /* PoziÈ›ia aripii stÃ¢ngi */
        #golden-flyer .wing-left {
            left: -5px; 
            transform-origin: 90% 30%; /* Punctul de rotaÈ›ie pe interior */
            animation: flap-left 0.25s infinite alternate ease-in-out; /* AnimaÈ›ie separatÄƒ */
        }
        
        /* PoziÈ›ia aripii drepte */
        #golden-flyer .wing-right {
            right: -5px; 
            transform-origin: 10% 30%; /* Punctul de rotaÈ›ie pe interior */
            animation: flap-right 0.25s infinite alternate ease-in-out; /* AnimaÈ›ie separatÄƒ */
        }
        
        /* Oglindim automat modelul pentru aripa dreaptÄƒ */
        #golden-flyer .wing-right .svg-wing {
            transform: scaleX(-1); 
        }



/* --- BAZA CÄ‚RÈšII DE DIAMANT --- */
        #diamond-flyer {
            position: fixed; width: 130px; height: 100px; cursor: pointer; z-index: 44; display: none; justify-content: center; align-items: center;
            animation: flyer-bob 0.8s infinite alternate ease-in-out;
        }
        #diamond-flyer .card-body {
            position: relative; width: 50px; height: 70px; font-size: 1.8rem; z-index: 2;
            display: flex; justify-content: center; align-items: center;
            background: linear-gradient(135deg, #a5f3fc, #0891b2); 
            border: 2px solid #fff; border-radius: 6px; box-shadow: 0 0 20px #06b6d4; 
        }
        #diamond-flyer [class^="wing-"] { position: absolute; width: 70px; height: 70px; top: -5px; z-index: 1; }
        #diamond-flyer .wing-left { left: -5px; transform-origin: 90% 30%; animation: flap-left 0.2s infinite alternate ease-in-out; }
        #diamond-flyer .wing-right { right: -5px; transform-origin: 10% 30%; animation: flap-right 0.2s infinite alternate ease-in-out; }
        #diamond-flyer .wing-right .svg-wing { transform: scaleX(-1); }




        /* --- DEFINIREA ANIMAÈšIILOR (Keyframes) --- */

        /* Aripa stÃ¢ngÄƒ: unghi pozitiv Ã®nseamnÄƒ SUS, unghi negativ Ã®nseamnÄƒ JOS */
        @keyframes flap-left {
            0% { transform: rotate(35deg); }   
            100% { transform: rotate(-35deg); } 
        }

        /* Aripa dreaptÄƒ: unghi negativ Ã®nseamnÄƒ SUS, unghi pozitiv Ã®nseamnÄƒ JOS */
        @keyframes flap-right {
            0% { transform: rotate(-35deg); }  
            100% { transform: rotate(35deg); }  
        }

        @keyframes flyer-bob {
            0% { transform: translateY(-10px); }
            100% { transform: translateY(10px); }
        }



        /* --- DEFINIREA ANIMAÈšIILOR (Keyframes) --- */

        /* O bÄƒtaie din aripi elegantÄƒ, mult mai relaxatÄƒ */
        @keyframes wing-flap {
            0% { transform: rotate(15deg); }
            100% { transform: rotate(-25deg); } 
        }

        @keyframes flyer-bob {
            0% { transform: translateY(-10px); }
            100% { transform: translateY(10px); }
        }



        #hover-info-panel {
            position: absolute;
            bottom: 150px;
            left: 20px;
            width: 260px;
            background: rgba(15, 23, 42, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.1);
            padding: 15px;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.5);
            pointer-events: none;
            opacity: 0;
            transform: translateY(10px);
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 100;
            backdrop-filter: blur(10px);
        }
        #hover-info-panel.visible {
            opacity: 1;
            transform: translateY(0);
        }
        #info-title { color: #f59e0b; font-weight: 700; font-size: 0.9rem; margin-bottom: 5px; display: flex; align-items: center; gap: 8px; }
        #info-desc { color: #cbd5e1; font-size: 0.8rem; line-height: 1.4; }
        
        /* HUD LAYOUT */
        #top-hud {
            position: absolute;
            top: 0; left: 0; width: 100%;
            padding: 20px;
            display: flex;
            align-items: flex-start;
            gap: 20px;
            pointer-events: none;
            z-index: 50;
            transition: all 0.3s ease;
        }

        #bottom-hud {
            position: absolute;
            bottom: 0; left: 0; width: 100%;
            padding: 5px 20px;
            display: flex;
            align-items: flex-end;
            justify-content: flex-start; /* FIX: Forțează totul pe stânga! */
            gap: 20px;
            pointer-events: none;
            z-index: 50;
            flex-wrap: wrap-reverse;
        }

        #hud-money {
            pointer-events: auto;
            background: var(--glass-bg);
            border: var(--glass-border);
            padding: 10px 20px;
            border-radius: 12px;
            box-shadow: var(--glass-shadow);
            min-width: 140px;
            flex-shrink: 0;
            transition: all 0.3s ease;
        }

        #hud-missions {
            pointer-events: none;
            flex-grow: 1;
            max-width: 500px;
            margin-right: auto; 
            transition: all 0.3s ease;
        }

        #mission-card { pointer-events: auto; }

        #hud-ads {
    pointer-events: auto;
    width: auto;
    position: relative; /* CRUCIAL: ține butonul lipit de panou */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    z-index: 50;
}

#hud-ads.retracted {
    /* Glisează tot panoul în afara ecranului spre stânga (-100%) */
    transform: translateX(-100%);
}

#ads-toggle-btn {
    position: absolute; 
    right: -35px; /* Iese exact 35px în afara panoului, pe dreapta */
    top: 50%; 
    transform: translateY(-50%); 
    width: 35px; 
    height: 65px; 
    background: linear-gradient(135deg, #ef4444, #991b1b); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    border-left: none; 
    border-radius: 0 10px 10px 0; /* Colțuri rotunjite perfect pe dreapta */
    cursor: pointer; 
    color: white;
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-weight: 900; 
    font-size: 1.2rem;
    box-shadow: 4px 0 15px rgba(239, 68, 68, 0.5); 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#ads-toggle-btn:hover {
    width: 45px; right: -45px; background: linear-gradient(135deg, #f87171, #ef4444);
}

#hud-ads.retracted #ads-toggle-btn { 
    background: linear-gradient(135deg, #000000, #363636); 
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5); 
    right: -45px; 
    width: 45px;
}

        #hud-prestige {
            pointer-events: auto;
            width: 320px;
            max-width: 100%;
            background: var(--glass-bg);
            border: var(--glass-border);
            padding: 10px 15px;
            border-radius: 12px;
            box-shadow: var(--glass-shadow);
            display: flex;
            align-items: center;
            justify-content: center; /* FIX: Centrează perfect conținutul */
            margin: 0; /* FIX: Previne aruncarea pe dreapta */
            gap: 12px;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }


        #hud-prestige:hover {
            transform: translateY(-2px);
            background: rgba(30, 41, 59, 0.9);
        }
        .prestige-icon {
            font-size: 1.4rem;
            background: rgba(245, 158, 11, 0.1);
            width: 40px; height: 40px;
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            border: 1px solid rgba(245, 158, 11, 0.3);
            flex-shrink: 0;
        }
        .prestige-content { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; }
        .prestige-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.7rem; margin-bottom: 2px; }
        .prestige-rank { font-weight: 700; color: #f59e0b; }
        .prestige-benefit { color: var(--accent-green); font-weight: 600; font-size: 0.65rem; background: rgba(16, 185, 129, 0.1); padding: 1px 5px; border-radius: 4px; }
        .prestige-label { font-size: 0.6rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; display: flex; justify-content: space-between; }
        .prestige-val { color: #cbd5e1; font-weight: 600; }
        
        /* Easter Egg Card */
        .card.easter-egg .card-pattern {
            background: linear-gradient(135deg, #FFD700, #FFA500, #FF4500, #800080, #0000FF, #008000);
            background-size: 400% 400%;
            animation: rainbow-bg 3s ease infinite;
            border: 2px solid #fff;
            box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
        }
        .card.easter-egg .card-value {
            background: #fff !important;
            color: #d97706 !important;
            font-weight: 900;
        }
        @keyframes rainbow-bg { 
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        /* Responsive HUD */
        @media (max-width: 768px) {
            #top-hud { padding: 10px; gap: 10px; flex-wrap: wrap; }
            #bottom-hud { padding: 10px; gap: 10px; }
            
            #hud-money { padding: 8px 12px; min-width: auto; }
            #cash-display { font-size: 1.5rem; }
            .label-tiny { font-size: 0.6rem; }
            
            #hud-missions { width: 100%; order: 3; margin-top: 5px; } 
            
            #hud-ads { transform: scale(0.85); transform-origin: bottom left; }
            #hud-prestige { transform: scale(0.85); transform-origin: bottom right; width: 240px; }
            
            .sponsor-card { min-width: 60px; padding: 4px 6px; }
            .sponsor-icon { font-size: 1rem; }
            .sponsor-info h4 { font-size: 0.6rem; }
            .sponsor-btn { font-size: 0.6rem; padding: 3px 6px; }
        }
        
        @media (max-height: 600px) {
            #top-hud { padding: 5px; }
            #bottom-hud { padding: 5px; }
            #hud-money { padding: 5px 10px; }
            #cash-display { font-size: 1.2rem; }
            #hud-missions { transform: scale(0.9); transform-origin: top left; }
            #hud-ads { transform: scale(0.75); }
            #hud-prestige { transform: scale(0.75); transform-origin: bottom right; }
        }

        /* RIGHT PANEL */
        #right-panel {
            border-right: none;
            transition: margin-right 0.32s cubic-bezier(0.22, 1, 0.36, 1);
        }
        #right-panel.closed {
            margin-right: calc(var(--panel-width) * -1);
        }

        /* CENTER GAME BOARD */
        #game-board {
            flex-grow: 1;
            position: relative;
            height: 100%;
            overflow: hidden; /* Prevent cards from causing scroll */
            z-index: 1;
        }

        /* --- TOGGLE BUTTONS --- */
        .panel-toggle {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 24px;
            height: 60px;
            background: var(--accent-color);
            border: 1px solid rgba(255,255,255,0.2);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 60;
            font-family: monospace;
            font-weight: bold;
            font-size: 1.2rem;
            border-radius: 0 4px 4px 0;
        }
        .panel-toggle:hover { filter: brightness(1.2); }

        #left-toggle {
            right: -24px; /* Sticks out to the right */
        }
        #right-toggle {
            left: -24px; /* Sticks out to the left */
            border-radius: 4px 0 0 4px;
        }

        /* --- CONTENT STYLING --- */

        .panel-header {
            padding: 20px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            flex-shrink: 0;
        }
        
        .panel-content {
            padding: 15px;
            overflow-y: auto;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        .panel-content::-webkit-scrollbar { display: none; }

        .section-title {
            font-family: var(--font-display);
            font-size: 0.8rem;
            color: var(--accent-color);
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 8px;
            font-weight: 800;
        }

        /* Cash & Mission (HUD) */
        #cash-display {
            font-family: var(--font-display);
            font-size: 2.2rem;
            color: white;
            text-shadow: 0 2px 10px rgba(0,0,0,0.5);
            margin: 0;
        }
        .label-tiny {
            font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px;
        }

        #mission-card {
            background: rgba(255,255,255,0.05);
            padding: 12px;
            border-radius: 8px;
            border: 1px solid rgba(255,255,255,0.05);
        }
        .progress-track { width: 100%; height: 6px; background: rgba(0,0,0,0.4); border-radius: 3px; overflow: hidden; margin-top: 8px; }
        #mission-fill { height: 100%; background: var(--accent-color); width: 0%; transition: width 0.3s; }

        /* Sponsors List (HUD) */
        #sponsors-list { 
            display: flex; 
            flex-direction: row; 
            gap: 10px; 
            background: var(--glass-bg);
            padding: 8px;
            border-radius: 12px;
            border: var(--glass-border);
            box-shadow: var(--glass-shadow);
        }
        .sponsor-card {
            background: rgba(255,255,255,0.03); 
            border-radius: 8px; 
            padding: 6px 8px;
            border: 1px solid rgba(255,255,255,0.05);
            display: flex; 
            flex-direction: column;
            align-items: center;
            text-align: center;
            min-width: 70px;
        }
        .sponsor-info h4 { margin: 0; font-size: 0.7rem; color: white; margin-bottom: 4px; }
        .sponsor-info p { display: none; }
        .sponsor-btn {
            padding: 3px 6px; font-size: 0.6rem; font-weight: 600;
            background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
            border-radius: 4px; color: rgba(255,255,255,0.8); width: 100%;
            display: flex; align-items: center; justify-content: center; gap: 4px;
            transition: all 0.2s;
        }
        .ad-badge {
            background: #fbbf24; color: #000; font-size: 0.5rem; padding: 0 3px; border-radius: 2px; font-weight: 900;
        }
        .sponsor-btn:hover:not(:disabled) { background: var(--accent-color); }
        .btn-quick { border-color: var(--accent-green); color: var(--accent-green); }
        .btn-quick:hover:not(:disabled) { background: var(--accent-green); color: white; }
        .btn-frenzy { border-color: var(--accent-purple); color: var(--accent-purple); }
        .btn-frenzy:hover:not(:disabled) { background: var(--accent-purple); color: white; }

        /* Right Panel (Market) */
        #market-tabs {
            padding: 0 0 15px 0;
            display: flex; gap: 5px; flex-wrap: wrap;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            margin-bottom: 10px;
            flex-shrink: 0;
        }
        .market-tab {
            padding: 6px 10px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; 
            text-transform: uppercase; background: rgba(255,255,255,0.05); color: var(--text-secondary);
            border: 1px solid transparent; flex: 1; text-align: center;
        }
        .market-tab.active { background: var(--accent-color); color: white; }

        #market-scroll-container {
            flex-grow: 1;
            height: 0; /* Crucial for flex scroll */
            min-height: 100%;
            overflow-y: auto;
            padding-bottom: 20px;
        }
        #market-scroll-container::-webkit-scrollbar { 
    display: block !important; 
    width: 6px !important; 
    height: 0px !important; /* FIX: Tăiem grosimea oricărei bare orizontale */
}
#market-scroll-container::-webkit-scrollbar-thumb { 
    background: var(--accent-color) !important; 
    border-radius: 3px !important; 
}#market-scroll-container::-webkit-scrollbar { 
    display: block !important; 
    width: 6px !important; 
    height: 0px !important; /* FIX: Tăiem grosimea oricărei bare orizontale */
}
#market-scroll-container::-webkit-scrollbar-thumb { 
    background: var(--accent-color) !important; 
    border-radius: 3px !important; 
}
        /* Upgrades */
        .upgrade-card {
            background: rgba(255,255,255,0.03); border-radius: 8px; padding: 10px; margin-bottom: 8px;
            display: flex; align-items: center; gap: 12px; 
            border: 1px solid rgba(255,255,255,0.05);
            transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
            position: relative;
            overflow: hidden;
            cursor: pointer;
        }


        /* Permitem animația de hover STRICT pe dispozitive cu mouse (Desktop) */
@media (hover: hover) {
    .upgrade-card:hover:not(.disabled) { 
        background: rgba(255,255,255,0.08); 
        border-color: var(--accent-color); 
        transform: translateY(-2px) scale(1.01);
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }
    
    .shop-item-card:hover { 
        background: rgba(255, 255, 255, 0.05); 
        border-color: #3b82f6; 
        transform: translateY(-3px); 
    }
    
    .relic-card:hover:not(.locked) { 
        transform: translateY(-2px); 
        border-color: var(--accent-color); 
    }
}

/* Forțăm sistemul de operare al telefonului să știe clar că aceste carduri pot fi "scrollate" vertical (pan-y) */
.upgrade-card, .shop-item-card, .relic-card {
    touch-action: pan-y !important;
}

/* Efect discret pentru apăsarea pe mobil (opțional, dar arată bine la click) */
.upgrade-card:active:not(.disabled) {
    transform: scale(0.98);
    background: rgba(255,255,255,0.1);
}

        .upgrade-card.owned {
            border-left: 3px solid var(--accent-color);
            background: linear-gradient(90deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
        }
        .upgrade-card.disabled { opacity: 0.5; filter: grayscale(1); cursor: not-allowed; }
        
        .upgrade-icon { 
            font-size: 1.5rem; 
            width: 42px; height: 42px; 
            display: flex; align-items: center; justify-content: center;
            background: rgba(0,0,0,0.2); border-radius: 8px;
            flex-shrink: 0;
        }
        .upgrade-name { font-size: 0.85rem; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
        .upgrade-desc { font-size: 0.7rem; color: var(--text-secondary); margin: 2px 0 4px 0; line-height: 1.2; }
        .upgrade-cost { font-size: 0.75rem; font-weight: 700; color: var(--accent-color); display: flex; align-items: center; gap: 4px; }
        .upgrade-cap-msg { font-size: 0.65rem; color: #ef4444; font-weight: 700; text-transform: uppercase; }

        #prestige-footer {
            padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.05);
            margin-top: auto; flex-shrink: 0;
        }
        .prestige-bar { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; margin-top: 6px; }
        #prestige-fill { height: 100%; background: linear-gradient(90deg, #f59e0b, #fbbf24); width: 0%; }

        /* Center Controls */
       #game-controls {
            position: absolute; 
            top: 20px; 
            right: calc(var(--panel-width) + 24px); /* la stÃ¢nga Marketplace-ului */
            z-index: 20001;
            display: flex; flex-direction: column; gap: 10px;
            transition: right 0.32s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .icon-btn {
            width: 40px; height: 40px; border-radius: 50%;
            background: rgba(0,0,0,0.4); color: white;
            display: flex; align-items: center; justify-content: center;
            font-size: 1.2rem; border: 1px solid rgba(255,255,255,0.1);
            backdrop-filter: blur(4px);
        }
        .icon-btn:hover { background: rgba(0,0,0,0.6); }


        #settings-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.45);
            z-index: 19998;
            display: none;
            pointer-events: auto;
        }

        #settings-menu {
            position: fixed;
            top: 14px;
            right: 14px;
            width: 240px;
            background: #1e293b; border: 1px solid #334155; border-radius: 12px;
            padding: 10px; display: none; flex-direction: column; gap: 8px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 20002;
            pointer-events: auto;
        }

        #settings-menu.open {
            display: flex;
        }

        .settings-item {
            padding: 8px; background: rgba(255,255,255,0.05); border-radius: 6px;
            font-size: 0.8rem; cursor: pointer; text-align: center;
            pointer-events: auto;
        }

        .settings-item:hover { background: rgba(255,255,255,0.12); }

        #settings-menu.open { display: flex; }
        .settings-item {
            padding: 8px; background: rgba(255,255,255,0.05); border-radius: 6px;
            font-size: 0.8rem; cursor: pointer; text-align: center;
        }
	.settings-item.btn-music {
            background: var(--accent-color);
            color: white;
            font-weight: 700;
            border: 1px solid rgba(255,255,255,0.2);
            transition: all 0.2s;
            display: flex; justify-content: center; align-items: center; gap: 8px;
        }
        .settings-item.btn-music:hover { transform: scale(1.02); filter: brightness(1.1); }
        .settings-item.btn-music.muted { background: #475569; color: #cbd5e1; border-color: transparent; }


        /* Cards */
        #game-layer {
            position: absolute;
            inset: 0;
        }

        .card {
            position: absolute;
            width: var(--card-width); height: var(--card-height);
            cursor: pointer; perspective: 1000px;
            z-index: 10;
            transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
            
            /* Tăiem orice efect grafic (cum e foil-ul) care vrea să iasă din cutia de bază a cărții */
            max-width: var(--card-width) !important;
            max-height: var(--card-height) !important;
            overflow: hidden !important; 
            border-radius: 10px; /* Ca să se îmbine cu inner-ul */
        }
        .card:hover { z-index: 100; box-shadow: 0 0 20px rgba(255,255,255,0.2); }
        .card:active { transform: scale(0.95); }

        .card-inner {
            position: relative; width: 100%; height: 100%; text-align: center;
            transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            transform-style: preserve-3d;
            border-radius: 10px; 
            box-shadow: 0 10px 25px rgba(0,0,0,0.4);
        }
        .card.flipped .card-inner { transform: rotateY(180deg); }

        .card-face {
            position: absolute; width: 100%; height: 100%;
            -webkit-backface-visibility: hidden; backface-visibility: hidden;
            border-radius: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;
            border: 1px solid rgba(255,255,255,0.1);
            overflow: hidden; /* Efectul de foil nu va mai ieși din fața cărții NICIODATĂ */
        }
        .card-pattern { background-color: #1e293b; transform: rotateY(0deg); z-index: 2; }
        .card-value { background-color: #fff; transform: rotateY(180deg); z-index: 1; color: #1a1a2e; }
        .card-value.is-red { color: #ef4444; }
        .card-value.is-black { color: #1a1a2e; }

        /* SKINS (Compact for cleaner code) */
        .skin-blue .card-pattern { background: linear-gradient(135deg, #1e3a8a, #172554); border: 2px solid #3b82f6; }
        .skin-blue .card-value { background: #f8fafc; color: #0f172a; }
        .skin-blue .card-value.is-red { color: #ef4444; }
        .skin-blue .card-value.is-black { color: #0f172a; }
        .skin-red .card-pattern { background: linear-gradient(135deg, #991b1b, #450a0a); border: 2px solid #ef4444; }
        .skin-red .card-value { background: #fff1f2; color: #881337; }
        .skin-red .card-value.is-red { color: #ef4444; }
        .skin-red .card-value.is-black { color: #881337; }
        .skin-vintage .card-pattern { background: #78350f; border: 2px solid #d97706; }
        .skin-vintage .card-value { background: #fef3c7; color: #451a03; font-family: 'Playfair Display', serif; }
        .skin-vintage .card-value.is-red { color: #b91c1c; }
        .skin-vintage .card-value.is-black { color: #451a03; }
        .skin-neon .card-pattern { background: #000; border: 2px solid #06b6d4; box-shadow: 0 0 10px #06b6d4; }
        .skin-neon .card-value { background: #0f172a; color: #06b6d4; border: 1px solid #06b6d4; }
        .skin-neon .card-value.is-red { color: #f43f5e; }
        .skin-neon .card-value.is-black { color: #06b6d4; }
        .skin-gold .card-pattern { background: linear-gradient(135deg, #f59e0b, #b45309); border: 2px solid #fcd34d; }
        .skin-gold .card-value { background: #fffbeb; color: #b45309; }
        .skin-gold .card-value.is-red { color: #ef4444; }
        .skin-gold .card-value.is-black { color: #b45309; }
        .skin-diamond .card-pattern { background: linear-gradient(135deg, #a5f3fc, #0891b2); border: 2px solid #22d3ee; box-shadow: inset 0 0 20px rgba(255,255,255,0.5); }
        .skin-diamond .card-value { background: #f8fafc; color: #0891b2; text-shadow: 0 0 5px rgba(6,182,212,0.3); }
        .skin-diamond .card-value.is-red { color: #06b6d4; }
        .skin-diamond .card-value.is-black { color: #164e63; }

        .card-logo { position: relative; z-index: 10; font-size: 2.5rem; color: rgba(255,255,255,0.9); }
        .val-corner { position: absolute; z-index: 10; font-weight: 800; font-size: 1.2rem; line-height: 1; }
        .val-tl { top: 8px; left: 8px; text-align: left; }
        .val-br { bottom: 8px; right: 8px; transform: rotate(180deg); text-align: left; }
        .suit-large { position: relative; z-index: 10; font-size: 3.5rem; line-height: 1; }

	
	.card-red { color: #ef4444 !important; }
	.card-black { color: #1a1a2e !important; }

	.skin-neon .card-red { color: #ff0055 !important; text-shadow: 0 0 8px #ff0055; }
	.skin-neon .card-black { color: #06b6d4 !important; text-shadow: 0 0 8px #06b6d4; }

	.skin-vintage .card-black { color: #451a03 !important; }

        .float-text {
            position: absolute; font-family: var(--font-display); font-weight: 900;
            font-size: 1.8rem; pointer-events: none; z-index: 1000;
            animation: floatUp 0.8s forwards ease-out;
            color: var(--accent-color); text-shadow: 0 2px 4px rgba(0,0,0,0.5);
        }
        @keyframes floatUp { to { opacity: 0; transform: translateY(-80px); } }

        /* Overlays */

.overlay-screen { 
    position: fixed; 
    inset: 0; 
    background: #0f0c29; 
    z-index: 2000; 
    display: none; /* SchimbÄƒm din flex Ã®n none aici! */
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
}

/* --- FIX SCROLL MARKETPLACE --- */
.panel-content {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important; 
}

#market-scroll-container {
    flex: 1 !important; 
    min-height: 0 !important; 
    height: auto !important;
    overflow-y: auto !important; 
    overflow-x: hidden !important; /* FIX: Interzice complet scroll-ul orizontal */
    -webkit-overflow-scrolling: touch !important; 
    padding-bottom: 15px !important; 
}

/* ===================================================
   REDESIGN SELECTOR DECK-URI (Orizontal / Drag & Scroll)
   =================================================== */
#deck-selection-container {
    width: 95%;
    max-width: 850px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    
    /* Preia dinamic tema activă */
    background: var(--modal-bg, #1e293b) !important;
    border: 1px solid var(--modal-border, #334155) !important;
    
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.deck-header {
    font-family: var(--font-display); 
    font-size: 1.5rem; 
    margin-bottom: 20px; 
    color: white;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    flex-shrink: 0; 
}

/* Carusel orizontal (Flex Row) forțat pe un singur rând */
#deck-list {
    display: flex;
    flex-direction: row;
    gap: 15px;
    overflow-x: auto; /* Scroll orizontal */
    overflow-y: hidden;
    padding-bottom: 15px;
    flex-grow: 1;
    flex-wrap: nowrap; /* FORȚĂM să fie un singur rând, fără grilă */
    
    /* Magia pentru telefoane: glisare fluidă orizontală */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    
    /* Cursorul se transformă în mână pentru tragere pe PC */
    cursor: grab;
}

#deck-list:active {
    cursor: grabbing;
}

/* Stilizare bară de scroll orizontală subțire și aurie */
#deck-list::-webkit-scrollbar { height: 6px; width: 0; }
#deck-list::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 3px; }
#deck-list::-webkit-scrollbar-thumb { background: #f59e0b; border-radius: 3px; }

.close-btn { 
    background: transparent; 
    border: none; 
    color: #94a3b8; 
    font-size: 2rem; 
    cursor: pointer; 
    transition: 0.2s; 
    line-height: 1;
}
.close-btn:hover { color: #ef4444; }

.deck-option {
    background: rgba(255,255,255,0.03); 
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 15px; 
    min-width: 160px;
    max-width: 180px;
    display: flex; 
    flex-direction: column;
    align-items: center; 
    text-align: center;
    gap: 12px; 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    flex-shrink: 0; 
}

.deck-option:hover { 
    background: rgba(255,255,255,0.08); 
    border-color: var(--accent-color); 
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.deck-option.active { 
    border-color: var(--accent-green); 
    background: rgba(16, 185, 129, 0.1); 
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

/* --- CULORILE PACHETELOR (Reparate și Izolate DEFINITIV) --- */
.deck-icon { 
    width: 60px; 
    height: 84px; 
    border-radius: 6px; 
    flex-shrink: 0; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    position: relative; 
    
    /* Aici e cheia care oprește pânza roșie să iasă: */
    overflow: hidden !important; 
    background-color: #1e293b; 
    
    /* Resetăm orice transform sau animație moștenită accidental */
    transform: none !important;
    animation: none !important;
    z-index: 1;
}

/* Izolăm fundalurile DOAR pentru meniu, fără a folosi clasele jocului */
.icon-blue { background: linear-gradient(135deg, #1e3a8a, #172554) !important; border: 2px solid #3b82f6 !important; } 
.icon-red { background: linear-gradient(135deg, #991b1b, #450a0a) !important; border: 2px solid #ef4444 !important; } 
.icon-vintage { background: #78350f !important; border: 2px solid #d97706 !important; } 
.icon-neon { background: #000 !important; border: 2px solid #06b6d4 !important; box-shadow: inset 0 0 10px #06b6d4, 0 4px 10px rgba(0,0,0,0.4) !important; } 
.icon-gold { background: linear-gradient(135deg, #f59e0b, #b45309) !important; border: 2px solid #fcd34d !important; }
.icon-diamond { background: linear-gradient(135deg, #a5f3fc, #0891b2) !important; border: 2px solid #22d3ee !important; box-shadow: inset 0 0 20px rgba(255,255,255,0.5), 0 4px 10px rgba(0,0,0,0.4) !important; }

/* Simbolul de pe spatele cărților din meniu */
.deck-icon-logo {
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.9);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; 
    z-index: 10;
}

.deck-info { 
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.deck-info h3 { 
    margin: 0 0 5px 0; 
    font-size: 1rem; 
    color: white; 
    font-weight: 700; 
    line-height: 1.2;
}
.deck-info p { 
    margin: 0; 
    font-size: 0.75rem; 
    color: var(--text-secondary); 
    line-height: 1.3;
}
.deck-info h3 span {
    display: block; 
    margin: 6px auto 0 auto !important; 
    width: fit-content;
}

.deck-action { 
    width: 100%; 
    font-size: 0.75rem; 
    font-weight: 700; 
    padding: 8px 12px; 
    border-radius: 6px; 
    cursor: pointer; 
    border: none; 
    transition: 0.2s;
}
.btn-select { background: var(--accent-color); color: white; }
.btn-select:hover { filter: brightness(1.2); }

.btn-unlock-ad { 
    background: #f59e0b; 
    color: black; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px; 
}
.btn-unlock-ad:hover { background: #fbbf24; }

.deck-status { 
    font-size: 0.75rem; 
    color: var(--text-secondary); 
    font-style: italic; 
    padding: 8px 0; 
}





        #ad-simulation-overlay { display: none; text-align: center; }
        #ad-countdown { font-family: var(--font-display); font-size: 4rem; color: white; margin-bottom: 20px; }
        #ad-status-text { font-size: 1.2rem; color: var(--text-secondary); margin-bottom: 40px; }
        .ad-progress-container { width: 300px; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; margin-bottom: 40px; }
        #ad-progress-bar { height: 100%; background: var(--accent-color); width: 0%; transition: width 0.1s linear; }
        #ad-close-btn { display: none; width: 200px; }

        .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 5000; display: none; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
        .modal-content { background: #1e293b; padding: 30px; border-radius: 16px; width: 320px; text-align: center; border: 1px solid #334155; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
        .btn-primary { background: var(--accent-color); color: white; border-radius: 6px; padding: 8px 16px; font-weight: 700; font-size: 0.85rem; box-shadow: 0 4px 15px rgba(0,0,0,0.3); text-transform: uppercase; letter-spacing: 0.5px; }

        /* --- TUTORIAL ESTETIC --- */
        #tutorial-tooltip {
            position: fixed;
            background: rgba(15, 23, 42, 0.95);
            color: #fff;
            padding: 20px;
            width: 280px;
            max-width: calc(100vw - 24px); /* pe ecrane înguste nu depășim niciodată ecranul */
            box-sizing: border-box;
            border-radius: 12px;
            border: 2px solid var(--accent-color);
            box-shadow: 0 10px 40px rgba(59, 130, 246, 0.6); 
            z-index: 9999; 
            opacity: 0; 
            visibility: hidden; 
            transition: opacity 0.3s ease, visibility 0.3s, top 0.35s cubic-bezier(0.2, 1, 0.3, 1), left 0.35s cubic-bezier(0.2, 1, 0.3, 1); 
            backdrop-filter: blur(10px);
        }
        #tutorial-tooltip.visible { opacity: 1; visibility: visible; }
        
        /* SÄƒgeata DinamicÄƒ */
        .tut-arrow {
            position: absolute; width: 0; height: 0; 
            border-left: 10px solid transparent; border-right: 10px solid transparent;
        }
        .tut-arrow.up { /* SÄƒgeata sus, cÃ¢nd tooltip-ul e sub element */
            top: -12px; left: 50%; transform: translateX(-50%);
            border-bottom: 10px solid var(--accent-color);
        }
        .tut-arrow.down { /* SÄƒgeata jos, cÃ¢nd tooltip-ul e deasupra */
            bottom: -12px; left: 50%; transform: translateX(-50%);
            border-top: 10px solid var(--accent-color);
        }
        .tut-arrow.left { /* SÄƒgeata pe stÃ¢nga, cÃ¢nd tooltip-ul e ÃŽN DREAPTA cÄƒrÈ›ii */
            left: -12px !important; right: auto;
            border-top: 10px solid transparent; border-bottom: 10px solid transparent;
            border-right: 10px solid var(--accent-color); border-left: none;
        }
        .tut-arrow.right { /* SÄƒgeata pe dreapta, cÃ¢nd tooltip-ul e ÃŽN STÃ‚NGA cÄƒrÈ›ii */
            right: -12px; left: auto !important;
            border-top: 10px solid transparent; border-bottom: 10px solid transparent;
            border-left: 10px solid var(--accent-color); border-right: none;
        }

        .tut-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
        .tut-icon { font-size: 1.5rem; animation: flyer-bob 2s infinite alternate ease-in-out; }
        #tut-title { margin: 0; color: #60a5fa; font-size: 1.1rem; font-family: var(--font-display); }
        #tut-text { font-size: 0.85rem; color: #cbd5e1; line-height: 1.5; margin: 0 0 15px 0; }
        
        .tut-actions { display: flex; justify-content: space-between; align-items: center; }
        .btn-skip { background: transparent; border: none; color: #94a3b8; cursor: pointer; font-size: 0.8rem; padding: 5px; }
        .btn-skip:hover { color: #fff; text-decoration: underline; }

        /* Bara de progres a pașilor interactivi (ex: "Cards flipped: 1 / 3") */
        #tut-progress {
            display: none;
            font-size: 0.8rem; font-weight: 700; text-align: center;
            color: var(--accent-color);
            background: rgba(255,255,255,0.06);
            border: 1px dashed var(--accent-color);
            border-radius: 8px;
            padding: 6px 10px;
            margin: 0 0 15px 0;
        }

        /* Efect de STRÄ‚LUCIRE pe elementul explicat */
        .tut-highlight {
            z-index: 9998 !important;
            border-radius: 8px;
            animation: pulse-highlight 1.5s infinite alternate;
        }
        /* CÄƒrÈ›ile sunt position:absolute â€” nu le mutÄƒm din loc cÃ¢nd le aprindem */
        .tut-highlight:not(.card) { position: relative; }

        /* QA: deget animat "apasÄƒ aici" sub cartea aprinsÄƒ de tutorial.
           Fiind ::after pe card, click-ul pe deget = click pe carte. */
        .card.tut-highlight::after {
            content: '\1F446'; /* emoji deget (encoding-proof) */
            position: absolute;
            left: 50%; top: 100%;
            margin-top: 8px;
            font-size: 2.4rem;
            line-height: 1;
            z-index: 10001;
            text-shadow: 0 4px 12px rgba(0,0,0,0.7);
            animation: tut-tap 0.9s infinite ease-in-out;
            pointer-events: none;
        }
        @keyframes tut-tap {
            0%, 100% { transform: translate(-50%, 10px); }
            50%      { transform: translate(-50%, -4px); }
        }

        /* Pe ecrane mici compactÄƒm fereastra de tutorial ca sÄƒ lase masa vizibilÄƒ */
        @media (max-width: 600px), (max-height: 500px) {
            #tutorial-tooltip { padding: 14px; }
            #tut-title { font-size: 1rem; }
            #tut-text { font-size: 0.78rem; margin-bottom: 10px; }
            #tut-progress { font-size: 0.72rem; padding: 4px 8px; margin-bottom: 10px; }
            .tut-icon { font-size: 1.2rem; }
        }
        @keyframes pulse-highlight {
            from { box-shadow: 0 0 0 2px var(--accent-color), 0 0 10px var(--accent-color); }
            to { box-shadow: 0 0 0 6px var(--accent-color), 0 0 30px var(--accent-color); }
        }



        /* Achievements */
        .achievement-card {
            background: rgba(255,255,255,0.03); border-radius: 8px; padding: 10px; margin-bottom: 8px;
            border: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column; gap: 5px;
            opacity: 0.7; transition: 0.3s;
        }
        .achievement-card.unlocked {
            opacity: 1; background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.02));
            border-color: var(--accent-green);
            box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
        }
        .ach-header { display: flex; justify-content: space-between; align-items: center; }
        .ach-title { font-weight: 700; font-size: 0.8rem; color: white; }
        .ach-desc { font-size: 0.7rem; color: var(--text-secondary); }
        .ach-reward { font-size: 0.7rem; color: var(--accent-color); font-weight: 700; }
        .ach-progress-bar { width: 100%; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; margin-top: 4px; }
        .ach-progress-fill { height: 100%; background: var(--accent-green); width: 0%; transition: width 0.3s; }
        
        .toast-notification {
            position: fixed; top: 80px; left: 50%; transform: translateX(-50%) translateY(calc(-100% - 90px));
            visibility: hidden; opacity: 0; pointer-events: none;
            background: #1e293b; color: white; padding: 12px 24px; border-radius: 12px;
            border: 1px solid var(--accent-green);
            font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 10000;
            transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            display: flex; align-items: center; gap: 12px;
            width: max-content; min-width: min(300px, calc(100vw - 24px));
            max-width: calc(100vw - 24px); box-sizing: border-box; overflow-wrap: anywhere;
        }
        .toast-notification.show { visibility: visible; opacity: 1; transform: translateX(-50%) translateY(0); }
        .toast-notification > div { min-width: 0; }
        .toast-notification .toast-icon { flex-shrink: 0; }
        .toast-icon { font-size: 1.5rem; }

        /* --- MOBILE LANDSCAPE OPTIMIZATION --- */
        @media (max-height: 600px) and (orientation: landscape) {
            :root { --panel-width: 280px; --card-width: 80px; --card-height: 112px; }
            .panel-header { padding: 10px; }
            #cash-display { font-size: 1.6rem; margin-bottom: 10px; }
            .section-title { font-size: 0.7rem; }
            .panel-content { padding: 10px; gap: 10px; }
            .upgrade-card { padding: 8px; }
            .upgrade-icon { font-size: 1.1rem; }
            .upgrade-name { font-size: 0.7rem; }
            .upgrade-desc { font-size: 0.6rem; }
            .sponsor-card { padding: 6px 10px; }
            .sponsor-icon { font-size: 1.1rem; }
            .sponsor-info h4 { font-size: 0.7rem; }
            .panel-toggle { width: 20px; height: 50px; font-size: 1rem; }
            #game-controls { top: 10px; }
        }
        /* Mobile Portrait Tweaks if needed */
        @media (max-width: 1024px) and (orientation: portrait) {
             /* Hide panels by default on small portrait? The prompt focused on landscape 3-column. 
                For strict compliance, we keep the flex layout but maybe reduce width. */
             :root { --panel-width: 260px; }
        }

        @media (max-width: 1024px) and (orientation: landscape) {
            #bottom-hud {
                /* Folosim constantele sistemului de operare pentru margini sigure */
                padding-bottom: env(safe-area-inset-bottom, 20px) !important;
                padding-left: env(safe-area-inset-left, 20px) !important;
                padding-right: env(safe-area-inset-right, 20px) !important;
                bottom: 10px !important;
                flex-direction: row !important;
                justify-content: space-between !important;
                align-items: flex-start !important;
                gap: 12px !important;
            }
            #hud-ads {
                transform: scale(0.85); /* Îl facem mai compact */
                margin: 0 !important;
                width: auto !important;
                max-width: calc(100% - 340px) !important;
                min-width: max-content !important; /* FIX: nu lăsa panoul mai îngust decât cardurile reale, altfel butonul X se poziționează peste ultimul card */
                display: flex !important;
                gap: 10px !important;
            }
            #hud-prestige {
                position: relative !important;
                right: auto !important;
                bottom: auto !important;
                margin: 0 !important;
                transform: none !important;
                width: auto !important;
                max-width: 320px !important;
                z-index: 55 !important;
            }
            #hud-ads .sponsor-card {
                min-width: 90px !important;
                max-width: 120px !important;
            }
        }



/* --- COMBO & RELICS HUD --- */
        #combo-meter {
            font-size: 0.8rem; color: #f59e0b; font-weight: 800; opacity: 0; 
            transition: opacity 0.3s, transform 0.1s; transform: translateY(-5px);
            margin-top: 5px; text-shadow: 0 2px 5px rgba(245, 158, 11, 0.5);
        }
        #combo-meter.active { opacity: 1; transform: translateY(0); }
        
        #relic-tray { display: flex; gap: 6px; margin-top: 8px; display: none; }
        .relic-icon { 
            width: 24px; height: 24px; background: rgba(0,0,0,0.5); border-radius: 4px; 
            display: flex; align-items: center; justify-content: center; font-size: 0.9rem; 
            filter: grayscale(1); opacity: 0.4; border: 1px solid rgba(255,255,255,0.1);
        }
        .relic-icon.owned { filter: grayscale(0); opacity: 1; border-color: #eab308; box-shadow: 0 0 10px rgba(234, 179, 8, 0.4); }

        /* --- THE VIP WHALE --- */
        .whale-active-bg { animation: whale-alert 2s infinite; }
        @keyframes whale-alert { 
            0% { box-shadow: inset 0 0 0px rgba(239,68,68,0); } 
            50% { box-shadow: inset 0 0 80px rgba(239,68,68,0.4); } 
            100% { box-shadow: inset 0 0 0px rgba(239,68,68,0); } 
        }

       /* --- ROATA NOROCULUI --- */
        .wheel-wrapper {
            position: relative; width: 220px; height: 220px; margin: 0 auto 20px auto;
        }

        #wheel-container {
            width: 100%; height: 100%; border-radius: 50%; border: 4px solid #fff; 
            position: absolute; top:0; left:0; overflow: hidden; 
            /* Cele 6 culori perfect tÄƒiate la 60 de grade */
            background: conic-gradient(
                #a855f7 0 60deg,       /* Mov - 1 Hour */
                #3b82f6 60deg 120deg,  /* Albastru - Frenzy */
                #10b981 120deg 180deg, /* Verde - Jackpot */
                #ef4444 180deg 240deg, /* RoÈ™u - Cards */
                #64748b 240deg 300deg, /* Gri - Penny */
                #f59e0b 300deg 360deg  /* Portocaliu - Cash */
            );
            box-shadow: 0 0 20px rgba(255,255,255,0.2);
            transform: rotate(0deg); /* PoziÈ›ia de start fixÄƒ pentru a evita erorile */
        }

        .wheel-pointer {
            position: absolute; top: -15px; left: 50%; transform: translateX(-50%); 
            width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; 
            border-top: 25px solid white; z-index: 20; 
            filter: drop-shadow(0 4px 6px rgba(0,0,0,0.6));
        }

        /* Textul curbat pe roatÄƒ */
        .wheel-segment {
            position: absolute; top: 50%; left: 50%; width: 80px; height: 80px;
            margin-top: -40px; margin-left: -40px; text-align: center;
            font-weight: 900; color: white; font-size: 0.8rem; line-height: 1.2;
            text-shadow: 0 2px 4px rgba(0,0,0,0.8);
            transform: rotate(var(--rot)) translateY(-65px); 
            display: flex; flex-direction: column; justify-content: center; align-items: center;
        }



        /* --- RELIC REVEAL --- */
        .relic-glow { animation: epic-relic 2s forwards; }
        @keyframes epic-relic {
            0% { transform: scale(0.5) rotate(-20deg); opacity: 0; filter: brightness(3); }
            50% { transform: scale(1.2) rotate(10deg); opacity: 1; filter: brightness(2); }
            100% { transform: scale(1) rotate(0deg); opacity: 1; filter: brightness(1); }
        }


/* --- RELICS INVENTORY --- */
        .relic-grid {
            display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); 
            gap: 12px; max-height: 50vh; overflow-y: auto; padding-right: 5px;
        }
        .relic-grid::-webkit-scrollbar { width: 6px; }
        .relic-grid::-webkit-scrollbar-thumb { background: var(--accent-color); border-radius: 3px; }

        .relic-card {
            background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); 
            border-radius: 8px; padding: 10px; text-align: center; position: relative;
            transition: all 0.2s; display: flex; flex-direction: column; gap: 5px;
        }
        .relic-card.locked { filter: grayscale(1); opacity: 0.5; }
        .relic-card.equipped { border-color: #eab308; background: rgba(234, 179, 8, 0.1); box-shadow: 0 0 15px rgba(234, 179, 8, 0.2); }
        .relic-card:hover:not(.locked) { transform: translateY(-2px); border-color: var(--accent-color); }

        .relic-card-icon { font-size: 2rem; margin: 5px 0; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }
        .relic-card-name { font-size: 0.75rem; font-weight: 700; color: white; line-height: 1.1; }
        .relic-card-desc { font-size: 0.65rem; color: var(--text-secondary); flex-grow: 1; }
        .relic-card-rarity { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }
        
        .rarity-common { color: #94a3b8; }
        .rarity-rare { color: #3b82f6; }
        .rarity-epic { color: #a855f7; }
        .rarity-legendary { color: #f59e0b; text-shadow: 0 0 5px #f59e0b; }

        .btn-equip {
            background: var(--accent-color); color: white; border: none; padding: 4px 0; 
            border-radius: 4px; font-size: 0.65rem; font-weight: 700; cursor: pointer; width: 100%;
        }
        .relic-card.equipped .btn-equip { background: #ef4444; }




/* --- REPARARE ECRAN ÃŽNTUNECAT È˜I BUTOANE ALBE --- */

        /* 1. Ascundem definitiv "scutul" care Ã®ntunecÄƒ ecranul È™i blocheazÄƒ click-urile */
        #settings-backdrop {
            display: none !important;
            pointer-events: none !important;
        }

        /* 2. CurÄƒÈ›Äƒm butoanele ca sÄƒ nu mai fie albe/urÃ¢te */
        /* --- MUTARE MENIU SETÄ‚RI ÃŽN STÃ‚NGA BUTONULUI --- */
        #settings-menu {
            position: absolute !important; 
            top: 0 !important;
            right: 65px !important;
            left: auto !important;
            bottom: auto !important;
            transform-origin: top right !important;
            width: 240px !important;
            display: none !important;
            flex-direction: column !important;
            gap: 15px !important;
            padding: 15px !important;
            background: #0f0c29 !important; /* Solid, fÄƒrÄƒ transparenÈ›Äƒ */
            border: 1px solid var(--accent-color) !important;
            border-radius: 12px !important;
            z-index: 30000 !important;
            pointer-events: auto !important;
            box-shadow: 0 10px 40px rgba(0,0,0,0.9) !important;
        }

        #settings-menu.open {
            display: flex !important;
        }

        #settings-menu button.settings-item {
            appearance: none !important;
            -webkit-appearance: none !important;
            background: rgba(255, 255, 255, 0.05) !important;
            border: 1px solid rgba(255, 255, 255, 0.1) !important;
            color: #ffffff !important;
            font-family: inherit !important;
            font-size: 0.85rem !important;
            padding: 10px !important;
            border-radius: 8px !important;
            cursor: pointer !important;
            width: 100% !important;
            text-align: center !important;
            transition: all 0.2s ease !important;
            pointer-events: auto !important;
        }

        #settings-menu button.settings-item:hover {
            background: rgba(255, 255, 255, 0.15) !important;
            transform: translateY(-1px) !important;
        }

        #settings-menu button.btn-music {
            background: var(--accent-color) !important;
            border-color: transparent !important;
        }

        #settings-menu button.btn-music.muted {
            background: #475569 !important;
            color: #cbd5e1 !important;
        }

        #settings-menu button.danger {
            background: rgba(239, 68, 68, 0.1) !important;
            border-color: rgba(239, 68, 68, 0.5) !important;
            color: #fca5a5 !important;
            font-weight: bold !important;
        }

        #settings-menu button.danger:hover {
            background: rgba(239, 68, 68, 0.8) !important;
            color: white !important;
        }

        /* 2. Suportul butoanelor din stÃ¢nga */
        #game-controls {
            z-index: 20000 !important;
            pointer-events: auto !important;
        }

        /* 3. SiguranÈ›Äƒ pentru Click-uri pe Tab-uri È™i Upgrade-uri */
        .market-tab, .upgrade-card, .btn-primary {
            pointer-events: auto !important;
            cursor: pointer !important;
            position: relative;
            z-index: 5000;
        }

       

/* --- COLLECTION STYLES --- */
.collection-modal {
    width: 95% !important;
    max-width: 500px !important;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0c29 100%) !important;
    border: 2px solid #d97706 !important; /* Auriu Egiptean */
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 coloane pe mobil */
    gap: 10px;
    margin: 20px 0;
}

@media (min-width: 600px) {
    .collection-grid { grid-template-columns: repeat(3, 1fr); } /* 3 coloane pe desktop */
}

.collection-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(217, 119, 6, 0.2);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    opacity: 0.5;
    filter: grayscale(1);
}

.collection-item.discovered {
    opacity: 1;
    filter: none;
    border-color: #d97706;
    background: rgba(217, 119, 6, 0.1);
}

.collection-item i { font-size: 2rem; display: block; margin-bottom: 8px; }
.collection-item b { font-size: 0.75rem; display: block; color: #fff; }
.collection-item span { font-size: 0.6rem; color: #94a3b8; }

.album-stats {
    background: rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* AnimaÈ›ie Reveal */
.reveal-card-anim {
    text-align: center;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Fix pentru vizibilitate buton pe mobil */
@media (max-width: 1024px) {
    #game-controls {
        top: 14px !important;
        gap: 8px !important;
    }
}



/* --- PREMIUM BLACK MARKET (CLEAN DESIGN) --- */
.fullscreen-shop-overlay {
    position: fixed !important; inset: 0 !important; 
    background: rgba(15, 23, 42, 0.9) !important; /* Fundal modern, mai puțin negru */
    z-index: 30000 !important; display: none; 
    justify-content: center; align-items: center; 
    backdrop-filter: blur(5px); padding: 20px; 
}

.shop-container {
    width: 100%; max-width: 800px; max-height: 85vh; margin: auto; 
    background: #1e293b; /* Culoare solidă curată */
    border: 1px solid #334155; /* Fără glow portocaliu */
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); /* Umbră naturală */
    display: flex; flex-direction: column; overflow: hidden;
}

.shop-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 25px; background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid #334155;
}

.shop-header h2 { margin: 0; color: #fff; font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 1px; }
.shop-wallet { font-size: 1.1rem; color: #fcd34d; font-weight: bold; background: rgba(255,255,255,0.05); padding: 6px 15px; border-radius: 20px; }
.close-shop-btn { background: transparent; border: none; color: #94a3b8; font-size: 2rem; cursor: pointer; transition: 0.2s; line-height: 1; }
.close-shop-btn:hover { color: #ef4444; }

.shop-subtitle { text-align: center; color: #94a3b8; padding: 15px; margin: 0; font-size: 0.85rem; border-bottom: 1px solid #334155; background: rgba(255,255,255,0.02); }

.premium-shop-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); /* Grid mai compact */
    gap: 15px; padding: 20px; overflow-y: auto;
}

.shop-item-card {
    background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px; padding: 15px 10px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    transition: all 0.2s;
}
.shop-item-card:hover { background: rgba(255, 255, 255, 0.05); border-color: #3b82f6; transform: translateY(-3px); }
.shop-item-card.owned { border-color: #10b981; background: rgba(16, 185, 129, 0.05); }

/* Cartea vizibilă clar */
.preview-card {
    width: 60px; height: 84px; border-radius: 6px;
    background: #fff; color: #1a1a2e;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    font-weight: 800; font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid #cbd5e1; position: relative; overflow: hidden;
}
.preview-card.is-red { color: #ef4444; }

.item-info h3 { margin: 0; color: #fff; font-size: 0.9rem; }
.item-info p { margin: 3px 0 0 0; color: #10b981; font-size: 0.7rem; font-weight: bold; }

/* Butoane corectate */
.btn-buy-foil { width: 100%; padding: 8px; border-radius: 6px; font-weight: bold; font-size: 0.85rem; border: none; cursor: pointer; transition: 0.2s; }


 




.btn-buy-foil.can-buy { background: #3b82f6; color: white; }
.btn-buy-foil.can-buy:hover { background: #2563eb; }
.btn-buy-foil.locked { background: #334155; color: #94a3b8; cursor: not-allowed; }
.btn-buy-foil.owned { background: #10b981; color: #fff; cursor: default; }

/* Animația Foil */
@keyframes foil-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Efectul se va aplica acum PERFECT în interiorul feței cărții */
.foil-effect {
    position: relative;
}

/* Pseudo-elementul care generează sclipirea */
.foil-effect::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px; /* Se mulează perfect pe marginile cărții */
    
    /* Gradientul sclipitor (transparent -> alb semitransparent -> transparent) */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0) 70%
    );
    
    /* Îl facem de două ori mai lat ca să aibă loc să se plimbe de la stânga la dreapta */
    background-size: 200% 100%;
    animation: foil-shimmer 2s infinite linear;
    pointer-events: none; /* Ca să nu blocheze click-urile pe carte */
    z-index: 5; /* Îl ținem sub numere/suit-uri (care au default z-index auto) */
    
    /* Adăugăm blend-mode pentru un efect premium (opțional, dar arată super) */
    mix-blend-mode: overlay;
}

/* Colorăm ușor sclipirea în funcție de pachet, ca să arate scump */
.skin-neon .foil-effect::after { background: linear-gradient(135deg, transparent, rgba(6, 182, 212, 0.5), transparent); }
.skin-gold .foil-effect::after { background: linear-gradient(135deg, transparent, rgba(252, 211, 77, 0.5), transparent); }
.skin-diamond .foil-effect::after { background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.8), transparent); }


/* ========================================================= */
/* === 2. MARKETPLACE MOBIL & LAYOUT RESPONSIV === */
/* ========================================================= */
@media (max-width: 1024px) {
    :root { 
        /* Panoul va ocupa ecranul minus lățimea butonului */
        --mobile-panel-width: min(380px, calc(100vw - 45px)); 
    }
    
    #right-panel {
        position: fixed !important; width: var(--mobile-panel-width) !important; 
        right: 0 !important; height: 100% !important; bottom: 0 !important; top: 0 !important;
        z-index: 2000 !important; background: #0f172a !important; border-left: 2px solid #f59e0b !important;
        
        /* Glisare nativă perfectă */
        transform: translateX(100%) !important; 
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
        margin-right: 0 !important; 
    }
    
    #right-panel:not(.closed) { transform: translateX(0) !important; }

    /* --- MENIUL DE BUTOANE (Stânga Sus) --- */
    #game-controls {
        position: absolute !important;
        left: -55px !important; /* Le scoate fix în stânga panoului */
        top: 15px !important;
        right: auto !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        z-index: 2000 !important;
        transition: opacity 0.2s !important; 
    }
    
    /* Ascunde butoanele când magazinul este deschis */
    #right-panel:not(.closed) #game-controls { 
        opacity: 0 !important; 
        pointer-events: none !important; 
    }

    /* Setările când se deschid să gliseze spre stânga (interiorul ecranului) */
    #settings-menu { right: 60px !important; top: 0 !important; }

    /* --- BUTONUL MARKET (Stânga Jos) --- */
    #right-toggle {
        position: absolute !important; 
        width: 32px !important; 
        height: 60px !important;
        left: -32px !important; 
        top: 50% !important; 
        bottom: auto !important;
        transform: translateY(-50%) !important;
        background: var(--accent-color) !important; 
        border-radius: 6px 0 0 6px !important; 
        border: 1px solid rgba(255,255,255,0.2) !important; 
        border-right: none !important;
        box-shadow: -4px 0 15px rgba(0,0,0,0.3) !important;
        display: flex !important; align-items: center !important; justify-content: center !important;
        font-size: 1.2rem !important; 
        font-family: monospace !important;
        color: white !important;
        cursor: pointer !important; 
        z-index: 2001 !important;
    }
    
    #right-toggle::after {
        content: none !important; /* Curățăm textul vechi "MARKET" sau "CLOSE" */
    }
    
    #right-panel:not(.closed) #right-toggle { 
        background: var(--accent-color) !important; /* Păstrăm culoarea albastră mereu */
    }
}


/* --- ASSET CUSTOM: BLACK MARKET --- */

/* --- ASSET CUSTOM: BLACK MARKET --- */
/* Logo-ul mare din interiorul ferestrei Black Market (Acum trage direct din Sprite!) */
.bm-header-art {
    width: 60px;
    height: 60px;
    background-image: var(--ui-sprite) !important;
    background-size: 500.78125% 500.78125% !important;
    background-position: 0% 0% !important; /* Coordonata fixă pentru icoana Black Market din sprite */
    background-repeat: no-repeat !important;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.6));
}


/* =========================================================
   --- FIX-URI UI MOBIL (Bani, Goal, Butoane, Reclame) --- 
   ========================================================= */
@media (max-width: 1024px) {
    /* 1. TOP HUD (Bani + Goal puse elegant în stânga, sub formă de blocuri compacte) */
    #top-hud {
        display: flex !important;
        flex-direction: column !important; /* Le punem una sub alta */
        flex-wrap: nowrap !important;
        align-items: flex-start !important; /* Le forțăm să stea lipite de stânga, NU întinse pe tot ecranul */
        gap: 6px !important;
        width: 100% !important;
        padding-right: 70px !important;
    }

    #hud-money {
        flex: 0 0 auto !important;
        min-width: 130px !important;
        width: max-content !important; /* Ia exact lățimea textului, niciun pixel în plus */
        margin-bottom: 0 !important;
    }

    #mission-card {
        flex: 0 0 auto !important;
        width: max-content !important; /* NOU: Va fi la fel de subțire ca textul din ea, s-a terminat cu cărămida! */
        max-width: 180px !important; /* Limită de siguranță, să nu se întindă prea mult */
        margin-bottom: 0 !important;
        padding: 6px 10px !important; /* Mai puțin padding, aspect mai minimalist */
        background: rgba(15, 23, 42, 0.9) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        transition: opacity 0.3s ease !important; /* Animație fină de dispariție */
    }

    #mission-title {
        font-size: 0.6rem !important;
        margin-bottom: 4px !important;
        white-space: normal !important; /* NOU: Permite textului să treacă pe rândul 2 dacă e lung! */
        line-height: 1.3 !important;
    }

    

    /* 2. AFIȘAREA BUTOANELOR DE JOC (Setări, Rucsac, Pachete) */
    #game-controls {
        display: flex !important;
        flex-direction: column !important; /* Le așează unul sub altul, fix cum ai desenat! */
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        z-index: 3000 !important; 
        gap: 12px !important;
        transform: scale(0.9) !important;
        transform-origin: top right !important;
    }

    /* 3. REPARARE BUTON "✖" RECLAME (Să poată fi apăsat) */
    #hud-ads {
        z-index: 3500 !important; /* Îl scoatem deasupra tuturor cărților invizibile! */
        pointer-events: auto !important;
    }
    #ads-toggle-btn {
        z-index: 3501 !important;
        pointer-events: auto !important;
    }

    /* 4. COMPRESIE CÂND SE DESCHIDE MARKETPLACE-UL */
    body.market-open #top-hud {
        width: calc(100% - 320px) !important; /* Se strânge în stânga făcând loc magazinului */
    }
    body.market-open #game-controls {
        display: none !important; /* Ascundem butoanele din dreapta ca să nu se suprapună cu magazinul deschis */
    }


    /* 5. GLISARE PERFECTĂ MENIU RECLAME */
    #hud-ads {
        position: relative !important; /* CRUCIAL: Ține butonul de cadou lipit ferm de meniul de reclame */
        transition: translate 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        translate: 0 0;
    }


}


/* ===================================================
   FIX RANK / PRESTIGE HUD (DOAR PENTRU DESKTOP)
   =================================================== */
@media (min-width: 1025px) {
    #hud-prestige {
        position: absolute !important;
        bottom: 0 !important; 
        right: 0 !important; /* Se aliniază perfect la marginea dreaptă a containerului de jos */
        margin: 0 !important;
        /* Folosim transform pentru o glisare extrem de fluidă și precisă la milimetru */
        transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1) !important;
    }
    
    body.market-open #hud-prestige {
        /* Marketplace-ul are lățimea de 320px. 
           Mutăm Rank-ul la stânga fix 310px ca să stea perfect lipit de el.
           Dacă vrei să fie și mai lipit, modifici în -300px. Dacă îl vrei mai departe, pui -320px. */
        transform: translateX(-310px) !important;
    }
}


@media (max-width: 1024px) {
    #hud-ads {
        position: absolute !important;
        left: 0 !important; /* Lipit de stânga ecranului */
        right: auto !important; 
        bottom: 10px !important;
        z-index: 3500 !important;
        transform: scale(0.85) translateX(0) !important; 
        transform-origin: bottom left !important;
        
        /* MAGIA AICI: Aceeași curbă de accelerație și decelerație fină ca la magazin */
        transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    }

    #hud-ads.retracted {
        /* Iese curat și fluid din ecran */
        transform: scale(0.85) translateX(-100%) !important;
    }

    #ads-toggle-btn {
        position: absolute !important;
        left: 100% !important; 
        right: auto !important; 
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 45px !important;
        height: 65px !important;
        border-radius: 0 10px 10px 0 !important;
        border-left: none !important;
        border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
        z-index: 3501 !important;
        /* Asigurăm că și butonul reacționează fluid dacă i se schimbă starea */
        transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    }

    #hud-ads.retracted #ads-toggle-btn {
        width: 55px !important;
    }
}


/* ===================================================
   FIX CUTIUȚĂ BANI & COMBO (Să rămână compactă și nedeformată)
   =================================================== */
body.market-open #top-hud {
    width: 100% !important; /* Lasă magazinul să treacă peste, fără să sugrume HUD-ul */
}

#hud-money {
    width: max-content !important; /* Ia EXACT lățimea textului, niciun milimetru în plus */
    min-width: auto !important; 
    flex: 0 0 auto !important; /* 0 Grow (nu te lăți), 0 Shrink (nu te turti) */
    transition: none !important; 
}


/* ===================================================
   REMEDIUL SUPREM: Butoane Vizibile & Evadarea Ferestrelor
   =================================================== */

/* 1. UCIDEM INVIZIBILITATEA DIN CODUL VECHI */
/* Țintim exact regula ta veche pentru a o anula definitiv! */
#right-panel #game-controls,
#right-panel.closed #game-controls,
#right-panel:not(.closed) #game-controls,
body.market-open #game-controls {
    display: flex !important; 
    opacity: 1 !important;        
    visibility: visible !important;
    pointer-events: auto !important; 
    
    /* Ancorăm butoanele permanent pe exteriorul magazinului (stânga) */
    position: absolute !important;
    top: 20px !important; 
    left: -65px !important; 
    right: auto !important;
    bottom: auto !important;
    z-index: 99999 !important;
    transform: none !important;
    transition: none !important;
}

@media (max-width: 1024px) {
    #right-panel #game-controls,
    #right-panel:not(.closed) #game-controls {
        top: 15px !important;
        left: -52px !important; /* Le strângem elegant pe muchie pentru telefon */
        width: 45px !important;
    }
}

/* 2. REPARARE MENIU SETĂRI (Îl scoatem din interiorul magazinului) */
/* Deoarece e blocat în magazin, îl împingem forțat în afara lui, spre stânga! */
#settings-menu {
    position: absolute !important; 
    top: 0 !important;
    right: 60px !important; /* 60px spre stânga, afară din panou! */
    left: auto !important;
    bottom: auto !important;
    z-index: 999999 !important;
    box-shadow: -10px 10px 40px rgba(0,0,0,0.9) !important;
    background: var(--modal-bg, #0f0c29) !important;
    border: 1px solid var(--modal-border, #3b82f6) !important;
}

/* 3. EVADAREA FERESTRELOR (Whale, Black Market, Relicve) */
/* Le obligăm să ocupe MEREU tot ecranul, acoperind magazinul complet și centrându-se perfect */
.modal-overlay, 
.overlay-screen, 
.fullscreen-shop-overlay,
#relics-menu-modal,
#black-market-modal,
#whale-modal {
    position: fixed !important; 
    top: 0 !important; 
    left: 0 !important; 
    right: 0 !important; 
    bottom: 0 !important; 
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important; /* Cel mai mare z-index posibil. Sunt Regi! */
    justify-content: center !important;
    align-items: center !important;
    margin: 0 !important;
    transform: none !important; /* Curăță orice le-ar trage într-o parte */
}

/* ===================================================
   COMPACTARE FERESTRE (Dietă pentru Telefoane/Ecrane Mici)
   Face ca totul să încapă perfect pe orizontală!
   =================================================== */
@media (max-height: 600px), (max-width: 768px) {
    /* --- 1. BLACK MARKET --- */
    .shop-container { max-height: 95vh !important; width: 95vw !important; }
    .shop-header { padding: 10px 15px !important; }
    .shop-header h2 { font-size: 1rem !important; }
    .bm-header-art { width: 35px !important; height: 35px !important; }
    
    /* Micșorăm textul și eliminăm spațiile inutile */
    .shop-subtitle { font-size: 0.7rem !important; padding: 8px !important; line-height: 1.2 !important; }
    .shop-subtitle button { margin-top: 2px !important; padding: 4px 10px !important; }
    
    /* Înghesuim cardurile ca să încapă mai multe pe un rând */
    .premium-shop-grid { 
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)) !important; 
        gap: 8px !important; 
        padding: 10px !important; 
    }
    .shop-item-card { padding: 8px !important; gap: 5px !important; }
    .preview-card { width: 38px !important; height: 54px !important; font-size: 1rem !important; }
    .item-info h3 { font-size: 0.75rem !important; margin-bottom: 0 !important; }
    .item-info p { font-size: 0.65rem !important; }
    .btn-buy-foil { padding: 5px !important; font-size: 0.7rem !important; }

    /* --- 2. FERESTRE STANDARD (Whale, Prestige, Reset, etc.) --- */
    .modal-content { 
    background: var(--modal-bg, #1e293b); 
    padding: 30px; 
    border-radius: 16px; 
    width: 320px; 
    text-align: center; 
    border: 1px solid var(--modal-border, #334155); 
    box-shadow: 0 20px 50px rgba(0,0,0,0.5); 
}
    .modal-content h2 { font-size: 1.1rem !important; margin-bottom: 8px !important; }
    .modal-content p { font-size: 0.8rem !important; margin-bottom: 12px !important; line-height: 1.3 !important; }

    /* --- 3. RUCSAC RELICVE & DECKS --- */
    #deck-selection-container { max-height: 95vh !important; width: 95vw !important; }
    .deck-header { font-size: 1.1rem !important; margin-bottom: 10px !important; }
    
    .relic-grid { 
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important; 
        gap: 8px !important; 
    }
    .relic-card { padding: 8px !important; }
    .relic-card-icon { font-size: 1.5rem !important; margin: 2px 0 !important; }
    .relic-card-name { font-size: 0.7rem !important; }
}


/* ===================================================
   FIX LUCKY WHEEL (Săgeată + Dietă pentru Mobil)
   =================================================== */

/* 1. Săgeata ancorată mai jos și proporționată corect (Se aplică peste tot) */
.wheel-pointer {
    top: -4px !important; /* O coborâm ca să "muște" puțin din marginea roții */
    border-top: 22px solid white !important; /* O facem mai ascuțită și precisă */
    border-left: 12px solid transparent !important;
    border-right: 12px solid transparent !important;
    z-index: 50 !important;
}

/* 2. Dieta Roții strict pentru ecrane scunde / telefoane */
@media (max-height: 600px), (max-width: 768px) {
    /* Micșorăm diametrul roții de la 220px la 160px */
    .wheel-wrapper {
        width: 160px !important;
        height: 160px !important;
        margin: 5px auto 10px auto !important; /* Tăiem din spațiul mort */
    }
    
    /* Reajustăm textul ca să nu iasă din roata mai mică */
    .wheel-segment {
        font-size: 0.65rem !important;
        /* FIX: eticheta trebuie să se micșoreze ODATĂ cu roata — altfel cutia de
           80x80px (moștenită de la desktop) nu mai încape în felia de 60° și
           etichetele vecine se suprapun. margin trebuie să rămână -width/2. */
        width: 50px !important;
        height: 50px !important;
        margin-top: -25px !important;
        margin-left: -25px !important;
        /* Tragem textul mai aproape de centru (raza e mai mică acum) */
        transform: rotate(var(--rot)) translateY(-48px) !important;
    }

    /* Tăiem din spațiile goale ale cronometrului */
    #wheel-timer-container {
        margin-bottom: 8px !important;
        font-size: 0.75rem !important;
    }
    
    #wheel-countdown {
        font-size: 1.05rem !important;
    }
}

/* ===================================================
   FIX SERTAR: Fără fundal și mutat la stânga (Mobil)
   =================================================== */
/* 1. Ascundem definitiv monedele aurii de pe ecranul principal */
#gold-coin-display { 
    display: none !important; 
}

/* 2. Pe Desktop ascundem butonul hamburger, lăsăm butoanele libere */
#mobile-menu-btn { display: none !important; }

/* 3. Logica sertarului pe Mobil */
@media (max-width: 1024px) {
    #mobile-menu-btn { 
        display: flex !important; 
        background: var(--accent-color);
        z-index: 20001 !important;
        width: 45px !important;
        height: 45px !important;
    }

    #game-controls {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        align-items: center !important; 
        
        /* MUTARE LA STÂNGA: Împingem butoanele la 75px în afara panoului ca să nu atingă absolut deloc săgeata! */
        left: -75px !important; 
    }

    /* Sertar Închis: Ascundem butoanele (lăsăm doar Meniul ☰) */
    #game-controls:not(.drawer-open) > *:not(#mobile-menu-btn):not(#settings-menu) {
        display: none !important;
    }

    /* Sertar Deschis: FĂRĂ FUNDAL, doar butoanele libere */
    #game-controls.drawer-open {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        border-radius: 0 !important; 
        box-shadow: none !important;
        backdrop-filter: none !important;
        width: 45px !important; 
        gap: 12px !important;
        
        /* Le micșorăm o idee ca să încapă toate perfect pe verticală */
        transform: scale(0.9) !important;
        transform-origin: top center !important;
    }
    
    #btn-custom-black-market {
        margin: 0 !important; 
    }
}


/* ===================================================
   MAGIA SPRITE-SHEET (PROCENTE - FĂRĂ BLUR)
   =================================================== */
:root {
    --ui-sprite: url('../ui-sprite.png'); 
}

.sprite-icon {
    --size: 40px; 
    width: var(--size) !important;
    height: var(--size) !important;
    background-image: var(--ui-sprite) !important;
    
    /* 500.78125% este exact 2564 / 512. Se va scala perfect! */
    background-size: 500.78125% 500.78125% !important; 
    background-repeat: no-repeat !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
    
    /* Lăsăm browserul să randeze culorile natural */
    image-rendering: auto !important; 
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)) !important;
}

/* ===================================================
   COORDONATE LA MILIMETRU (Procente)
   =================================================== */
/* Rândul 1 */
.sp-black-market  { background-position: 0% 0% !important; }
.sp-wild-card     { background-position: 25% 0% !important; }
.sp-red-synergy   { background-position: 50% 0% !important; }
.sp-vip-club      { background-position: 75% 0% !important; }
.sp-settings      { background-position: 100% 0% !important; }

/* Rândul 2 */
.sp-lucky-wheel   { background-position: 0% 25% !important; }
.sp-relics-bag    { background-position: 25% 25% !important; }
.sp-black-synergy { background-position: 50% 25% !important; }
.sp-crown         { background-position: 75% 25% !important; }
.sp-music         { background-position: 100% 25% !important; }

/* Rândul 3 */
.sp-table-stakes  { background-position: 0% 50% !important; }
.sp-royal-treasury{ background-position: 25% 50% !important; }
.sp-fast-dealer   { background-position: 50% 50% !important; }
.sp-ad            { background-position: 75% 50% !important; }
.sp-danger        { background-position: 100% 50% !important; }

/* Rândul 4 */
.sp-card-shark    { background-position: 0% 75% !important; }
.sp-table-size    { background-position: 25% 75% !important; }
.sp-hedge-fund    { background-position: 50% 75% !important; }
.sp-money-bag     { background-position: 75% 75% !important; }

/* Rândul 5 */
.sp-vip-whale     { background-position: 0% 100% !important; }
.sp-hot-streak    { background-position: 25% 100% !important; }
.sp-flash-sale    { background-position: 50% 100% !important; }
.sp-ban           { background-position: 75% 100% !important; }


/* ===================================================
   MĂRIRE BUTOANE ȘI CLARITATE DESENE
   =================================================== */
/* Mărim cercurile butoanelor din stânga */
.icon-btn {
    width: 55px !important;
    height: 55px !important;
}

/* Setăm o mărime unitară și mai mare pentru toate desenele */
.sprite-icon {
    --size: 45px !important; 
}

/* Dacă fereastra este mică (mobil), le mai scădem foarte fin ca să încapă, dar păstrăm claritatea */
@media (max-width: 1024px) {
    .icon-btn {
        width: 48px !important;
        height: 48px !important;
    }
    .sprite-icon {
        --size: 38px !important;
    }
}


/* ===================================================
   DISTANȚAREA SUPREMĂ A BUTOANELOR (Fără suprapuneri)
   =================================================== */
#right-panel #game-controls,
#right-panel.closed #game-controls,
#right-panel:not(.closed) #game-controls,
body.market-open #game-controls {
    /* Butonul are 55px, săgeata iese 30px. La -90px rămâne o distanță perfectă! */
    left: -90px !important; 
}

/* Și pe mobil le ținem la aceeași distanță sigură */
@media (max-width: 1024px) {
    #right-panel #game-controls,
    #right-panel:not(.closed) #game-controls {
        left: -90px !important; 
    }
}

/* ===================================================
   SMART SCROLL PENTRU DECK SELECTOR (Momentum pe Mobil)
   =================================================== */
#deck-selection-container {
    display: flex !important;
    flex-direction: column !important;
    max-height: 90vh !important; /* Lăsăm loc să respire pe ecran */
    overflow: hidden !important; /* Ascundem ce iese din fereastra principală */
}

#deck-list {
    overflow-y: auto !important;
    overflow-x: auto !important;
    
    /* MAGIA PENTRU TELEFOANE: Scroll fin "fără să se oprească" (momentum) */
    -webkit-overflow-scrolling: touch !important; 
    overscroll-behavior-y: contain !important; /* Previne scroll-ul accidental al paginii din spate */
    
    flex-grow: 1 !important;
    padding-right: 5px !important; 
    padding-bottom: 15px !important;
}

/* O punem și la panoul de Market ca să fim siguri că și acolo glisează lux! */
#market-scroll-container {
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
}

/* ===================================================
   MULTI-TOUCH SUPREM (Fără delay, zoom sau scroll)
   =================================================== */
#game-layer, .card, .card-inner, .card-face {
    /* Interzicem browserului să intervină cu "gesturi" peste jocul nostru */
    touch-action: none !important; 
    user-select: none !important;
    -webkit-user-select: none !important;
}


/* ===================================================
   FIX UMBRE & FUNDALURI (Container Containment)
   Lărgește cutiile ca să nu mai iasă desenele din ele!
   =================================================== */

/* 1. Mărim fundalul butoanelor rotunde din stânga (Black Market, etc.) */
.icon-btn {
    width: 62px !important;
    height: 62px !important;
}

/* 2. Mărim pătratul întunecat din spatele tuturor Upgrade-urilor */
.upgrade-icon { 
    width: 55px !important; 
    height: 55px !important; 
    border-radius: 12px !important; /* Îl facem un pic mai rotund ca să arate elegant */
}

/* 3. Ajustare automată pentru ecrane de telefon */
@media (max-width: 1024px) {
    .icon-btn {
        width: 54px !important;
        height: 54px !important;
    }
    
    .upgrade-icon {
        width: 48px !important;
        height: 48px !important;
    }
}

/* ===================================================
   MĂRIRE BUTOANE ȘI CLARITATE DESENE
   =================================================== */
/* Mărim cercurile butoanelor din stânga */
.icon-btn {
    width: 62px !important;
    height: 62px !important;
}

/* Setăm o mărime unitară și mai mare pentru toate desenele */
.sprite-icon {
    /* AM ȘTERS !important DE AICI CA SĂ PUTEM FACE ȘI ICONIȚE MICI */
    --size: 45px; 
}

/* Dacă fereastra este mică (mobil), le mai scădem foarte fin */
@media (max-width: 1024px) {
    .icon-btn {
        width: 54px !important;
        height: 54px !important;
    }
    .sprite-icon {
        /* AM ȘTERS !important ȘI DE AICI */
        --size: 38px;
    }
}



/* ===================================================
   UPGRADE FINAL: BUTOANELE "AD" CUSTOM
   Înlocuim textul cu desenul tău peste tot automat!
   =================================================== */
.ad-badge {
    display: inline-block !important;
    width: 24px !important;
    height: 24px !important;
    
    /* Preia direct sprite-ul jocului */
    background-image: var(--ui-sprite) !important;
    background-size: 500.78125% 500.78125% !important;
    background-position: 75% 50% !important; /* Coordonatele pentru sp-ad */
    background-repeat: no-repeat !important;
    background-color: transparent !important;
    image-rendering: auto !important;
    
    /* Ucidem vechiul text "AD" (rămâne invizibil) */
    color: transparent !important;
    font-size: 0 !important; 
    overflow: hidden !important;
    
    vertical-align: middle !important;
    margin-right: 5px !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)) !important;
}

/* ===================================================
   FIX SUPREM: BUTON "X" RECLAME (Aliniere perfectă)
   Folosim left: 100% ca să fie mereu lipit în exterior!
   =================================================== */
#ads-toggle-btn {
    left: 100% !important;
    right: auto !important;
    transform: translateY(-50%) !important;
}

/* Și pe mobil ne asigurăm că respectă aceeași lege fizică */
@media (max-width: 1024px) {
    #ads-toggle-btn {
        left: 100% !important;
        right: auto !important;
        transform: translateY(-50%) !important;
    }
}


/* ===================================================
   CURĂȚENIA GENERALĂ: BUTOANE JOC & RECLAME
   Acest cod suprascrie TOATE erorile din trecut!
   =================================================== */

/* 1. REPARAȚIA PENTRU MENIUL DE RECLAME ȘI BUTONUL "X" */
#bottom-hud #hud-ads {
    width: max-content !important; /* Se mulează EXACT pe lățimea reclamelor, niciun pixel în plus */
    position: absolute !important;
    left: 0 !important;
    bottom: 10px !important;
    z-index: 3500 !important;
    display: flex !important;
    align-items: center !important;
    transform: scale(0.85) !important;
    transform-origin: bottom left !important;
}

#bottom-hud #hud-ads.retracted {
    transform: scale(0.85) translateX(-100%) !important;
}

#bottom-hud #ads-toggle-btn {
    position: absolute !important;
    left: 100% !important; /* O scoate exact în afara containerului, milimetric lângă ele */
    right: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-left: 0px !important; 
    width: 45px !important;
    height: 65px !important;
    border-radius: 0 10px 10px 0 !important;
    border-left: none !important;
    z-index: 3501 !important;
}

/* 2. REPARAȚIA PENTRU BUTOANELE DIN STÂNGA MARKETULUI (Fără spații uriașe!) */
body #game-board ~ #right-panel #game-controls {
    position: absolute !important;
    top: 15px !important;
    left: -90px !important; /* Distanță perfect calculată ca să nu atingă butonul albastru "<" */
    right: auto !important;
    bottom: auto !important;
    
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 10px !important; /* Spațiere constantă și curată între ele */
    
    height: auto !important;
    width: 62px !important; /* Fix lățimea cercurilor tale */
    
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 99999 !important;
}

/* Adaptare perfectă pentru telefoane/tablete */
@media (max-width: 1024px) {
    body #game-board ~ #right-panel #game-controls {
        left: -95px !important; /* Trase un pic mai la stânga ca să nu atingă meniul de mobil */
        width: 54px !important; 
        gap: 8px !important;
    }
}

/* Adaptare pentru telefoane ținute orizontal (foarte scunde) */
@media (max-height: 480px) {
    body #game-board ~ #right-panel #game-controls {
        top: 5px !important;
        left: -85px !important;
        transform: scale(0.85) !important;
        transform-origin: top right !important;
        gap: 4px !important; /* Spații și mai mici ca să încapă Jokerul */
    }
}


/* ===================================================
   BANNER CRAZYGAMES — DIMENSIUNE DE BAZĂ
   Fără o înălțime reală containerul are 0px și SDK-ul
   refuză bannerul (noAvailableSizes / notVisible)!
   =================================================== */

/* Pe mobil și pe ferestre desktop mici: fâșie pe toată lățimea, jos.
   60px încap bannerele 468x60, 320x50 și 320x100 nu — dar cele mici da. */
#banner-wrapper {
    width: 100%;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pe ecrane foarte scunde (telefon în landscape) bannerul ar sufoca masa de joc.
   Îl ascundem — JS-ul detectează asta și curăță bannerul, cum cere documentația. */
@media (max-height: 500px) {
    #banner-wrapper { display: none !important; }
}

/* ===================================================
   FIX DESKTOP: RANK DEASUPRA RECLAMELOR & BANNER VIZIBIL MEREU
   =================================================== */
@media (min-width: 1025px) {
    #bottom-hud {
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-end !important;
        bottom: 15px !important; /* Un mic spațiu de la banner */
        padding-left: 20px !important;
        gap: 15px !important;
    }
    
    #hud-prestige {
        position: relative !important;
        left: auto !important; 
        right: auto !important;
        bottom: auto !important; 
        margin: 0 !important;
        width: 320px !important; /* Lățime fixă, arată perfect stivuit peste reclame */
        transform: none !important;
    }
    
    body.market-open #hud-prestige {
        transform: none !important;
    }
    
    #banner-wrapper {
        position: relative !important; 
        bottom: 0 !important;
        right: auto !important;
        width: 100% !important;
        height: 50px !important; 
        min-height: 50px !important;
        z-index: 2000000 !important; /* FORȚĂM SĂ FIE PESTE MODALE */
        pointer-events: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding-bottom: 5px !important;
    }
}

/* ===================================================
   PERMITEM BANNERULUI SĂ SPARGĂ ECRANUL (PESTE ORICE POP-UP)
   =================================================== */
#game-board {
    z-index: auto !important; /* Anulăm z-index-ul care ținea bannerul blocat sub ferestre */
}
#banner-wrapper {
    z-index: 2000000 !important; /* Se aplică și pe mobil pentru a-l aduce peste roata norocului */
}



/* ===================================================
   FIX DEFINITIV BALENĂ: OPRIREA TĂIERII PE MOBIL
   Oprim centrarea oarbă și ancorăm balena în siguranță!
   =================================================== */

/* Asigurăm spațiul fizic deasupra cutiei oriunde */
.whale-modal-box {
    margin-top: 80px !important; 
}

/* Pe ecrane scunde (telefoane ținute orizontal) aplicăm Forța Brută */
@media (max-height: 500px) {
    #whale-modal {
        align-items: flex-start !important; /* Oprim centrarea matematică! */
        padding-top: 60px !important; /* Forțăm 60px liberi din tavanul browserului */
        overflow-y: auto !important; /* Permitem scroll pe ecranul negru dacă e super mic */
    }
    
    .whale-modal-box {
        margin-top: 30px !important; /* Extra spațiu pentru cutie */
        transform: scale(0.8) !important; /* Micșorăm uniform și balena, și cutia, și textul cu 20% */
        transform-origin: top center !important;
        margin-bottom: 30px !important; /* Să nu atingă nici marginea de jos */
    }
    
    #whale-popout-wrapper {
        top: -45px !important; /* Tragem balena mai aproape de cutie */
    }
    
    #whale-popout-sprite {
        --size: 85px !important; /* O facem mai compactă pe telefoane */
    }
}

/* ===================================================
   FIX SUPREM BALENĂ: MODUL DE SIGURANȚĂ (Fără tăiere)
   Băgăm balena ÎN cutie DOAR pe ecrane scunde (înălțime <=600px), unde n-ar
   avea loc să iasă deasupra fără să fie tăiată de marginea de sus a ecranului.
   (Înainte pragul era 680px + max-width:1024px, ceea ce forța modul mic și pe
   ecrane cu spațiu berechet — ex: 646px înălțime — și balena arăta pitică.)
   =================================================== */

@media (max-height: 600px) {
    .whale-modal-box {
        /* Lăsăm browserul să centreze cutia natural */
        margin-top: auto !important;
    }

    #whale-popout-wrapper {
        /* Nu mai iese din cutie, devine un element normal ÎN cutie! */
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;

        /* O centrăm frumos deasupra textului */
        display: flex !important;
        justify-content: center !important;

        /* O tragem puțin mai jos ca să arate elegant în fereastră */
        margin-top: -10px !important;
        margin-bottom: -5px !important;
    }

    #whale-popout-sprite {
        /* O facem o idee mai mică ca să lase loc butoanelor de jos */
        --size: 85px !important;

        /* Reducem puțin umbra ca să arate natural pe fundalul albastru */
        filter: drop-shadow(0 5px 15px rgba(0,0,0,0.6)) !important;
    }
}

/* ===================================================
   BALENA "MASCOTĂ": IESE PE JUMĂTATE DEASUPRA CUTIEI
   Când există spațiu vertical (înălțime > 600px), balena iese pe jumătate
   deasupra marginii de sus a cutiei (jumate afară, jumate pe cutie) și e mare.
   Sub 600px se aplică modul de siguranță de mai sus (rămâne în cutie).
   =================================================== */
@media (min-height: 601px) {
    .whale-modal-box {
        position: relative !important;   /* ancoră pentru balena absolută */
        overflow: visible !important;    /* lăsăm balena să iasă din cutie */
        margin-top: 20px !important;     /* strivim margin-top:80px de mai sus */
        padding-top: 62px !important;    /* loc înăuntru pt jumătatea de jos a balenei */
    }
    #whale-popout-wrapper {
        position: absolute !important;
        top: 0 !important;               /* marginea de sus a cutiei */
        left: 50% !important;
        transform: translate(-50%, -50%) !important; /* jumate deasupra marginii */
        margin: 0 !important;
        display: block !important;
        z-index: 5 !important;
        pointer-events: none !important;
    }
    #whale-popout-sprite {
        --size: 120px !important;        /* mare și vizibilă */
        filter: drop-shadow(0 10px 22px rgba(0,0,0,0.55)) !important;
    }
    /* h2 are inline margin-top:25px — îl reducem, padding-top-ul cutiei dă spațiul */
    .whale-modal-box h2 { margin-top: 6px !important; }
}

/* ===================================================
   FIX: CLICK PRIN CUTIA CU BANI (Ghost Box)
   Permite apăsarea cărților ascunse sub afișajul banilor
   =================================================== */

#hud-money {
    /* Transformă cutia într-o fantomă pentru click-uri */
    pointer-events: none !important; 
}

/* Reactivăm interacțiunea DOAR pentru iconițele relicvelor, 
   ca să poți ține mouse-ul pe ele și să le vezi numele */
#relic-tray .relic-icon {
    pointer-events: auto !important;
}

/* ===================================================
   FIX: BUTOANE BLACK MARKET (MEREU ACTIVE)
   Permitem click-ul chiar și pe cele blocate pentru a arăta eroarea!
   =================================================== */
.btn-buy-foil {
    pointer-events: auto !important;
    z-index: 50 !important;
    cursor: pointer !important;
}


/* ===================================================
   FIX SUPREM DESKTOP: RANK FORȚAT PE STÂNGA
   =================================================== */
@media (min-width: 1025px) {
    #bottom-hud {
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-end !important;
        bottom: 15px !important;
        padding-left: 20px !important;
        gap: 15px !important;
    }
    
    /* Folosim două ID-uri pentru a strivi orice regulă veche */
    #bottom-hud #hud-prestige {
        position: relative !important;
        left: 0 !important; 
        right: auto !important;
        bottom: auto !important; 
        margin: 0 !important;
        width: 320px !important;
        transform: none !important;
    }
}


/* ===================================================
   FIX SUPREM: PROTEJARE MENIURI ȘI SCROLL DE BANNER
   =================================================== */
/* 1. Ridicăm conținutul adăugând un spațiu mort jos, sub stratul transparent */
.modal-overlay, 
.overlay-screen, 
.fullscreen-shop-overlay {
    padding-bottom: 70px !important; 
    box-sizing: border-box !important;
}

/* 2. Forțăm ferestrele să nu crească sub banner, oprind scroll-ul deasupra lui */
.shop-container, 
#deck-selection-container, 
.modal-content {
    max-height: calc(100vh - 120px) !important; 
}


/* ===================================================
   FIX MARKETPLACE: SPAȚIU MORT PENTRU BANNER
   =================================================== */
#market-scroll-container {
    padding-bottom: 75px !important; /* Împinge ultimele upgrade-uri fix deasupra bannerului */
}


/* ===================================================
   FIX TELEFOANE ÎNGUSTE (<=430px) — Tooltip, Cărți, Black Market
   Pus la finalul fișierului INTENȚIONAT: la regului !important cu aceeași
   specificitate, câștigă cea de mai jos din fișier — vezi precedentul de mai sus
   (.shop-container primește max-height și la 1024px, și din nou aici, la 430px
   ar câștiga tot regula de mai jos indiferent unde ar fi scrisă în alt bloc).
   =================================================== */
@media (max-width: 430px) {
    /* Fix 2b: tooltip-ul de informații (ex: "Table Stakes") nu mai are voie să
       ocupe 260px fixe pe un ecran de ~375-430px — acoperea rândul de reclame. */
    #hover-info-panel {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: calc(100vw - 24px) !important;
    }

    /* Fix 3: cărțile nu se micșorau deloc pe telefon în PORTRAIT (doar în
       landscape exista o reducere) — le dăm mai multă marjă de siguranță față
       de HUD, ca să nu mai apară parțial ascunse sub el la primul spawn. */
    :root {
        --card-width: 90px;
        --card-height: 126px;
    }

    /* Fix 4: Black Market — padding-ul containerului mare (20px pe toate laturile,
       nemodificat până acum de niciun breakpoint) plus width:95vw de la panoul
       mobil lăsau grila să iasă/se înghesuie în marginile ecranului. */
    .fullscreen-shop-overlay {
        /* Longhand ATENȚIE: padding-bottom:70px vine dintr-o regulă separată mai
           sus (linia ~2450), pentru spațiul de deasupra bannerului — un shorthand
           `padding` aici l-ar suprascrie din greșeală. */
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    .shop-container {
        width: 98vw !important;
    }
    .premium-shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
        gap: 6px !important;
        padding: 8px !important;
    }
}


/* =========================================================================
   FIX ECRANE SCUNDE / TELEFON ORIZONTAL (înălțime <=520px, ex: Moto G4 640x360)
   Problema reală din capturi: ferestrele erau MAI ÎNALTE decât ecranul, iar
   butoanele (Spin, Collect, Buy) cădeau sub marginea de jos. Cauza: se rezerva
   70px pentru banner + un plafon de calc(100vh - 120px) => pe 360px rămâneau doar
   ~240px utilizabili. Aici recuperăm spațiul vertical și micșorăm conținutul fix
   (roata, balena) ca butoanele să încapă. Blocul e la FINAL ca să câștige prin
   ordinea din fișier peste plafonul de 120px și padding-ul de 70px de mai sus.
   ========================================================================= */
@media (max-height: 520px) {
    /* 1. Nu mai rezervăm 70px pentru banner: fereastra îl acoperă oricum, iar pe
          un ecran de 360px acei 70px + 60px (whale) însemnau butoane tăiate. */
    .modal-overlay,
    .overlay-screen,
    .fullscreen-shop-overlay {
        padding-top: 8px !important;
        padding-bottom: 10px !important;
        align-items: center !important;
    }
    /* #whale-modal e selector de ID (specificitate mai mare) și avea propriul
       padding-top:60px + align:flex-start — trebuie învins tot cu ID. */
    #whale-modal {
        padding-top: 8px !important;
        padding-bottom: 10px !important;
        align-items: center !important;
    }

    /* 2. Ferestrele pot folosi aproape toată înălțimea; scroll-ul intern (deja
          existent pe grile/liste) se ocupă de restul. Ridicăm plafonul de 120px. */
    .modal-content,
    #deck-selection-container {
        max-height: calc(100vh - 18px) !important;
        overflow-y: auto !important;
    }
    /* .shop-container NU primește overflow-y aici: grila (.premium-shop-grid) are
       deja scroll propriu, iar header-ul + subtitlul rămân fixe deasupra ei. */
    .shop-container {
        max-height: calc(100vh - 18px) !important;
    }

    /* 3. Text/spații de fereastră mai compacte (recâștigăm rânduri). */
    .modal-content { padding: 12px !important; }
    .modal-content h2 { font-size: 1rem !important; margin-bottom: 4px !important; }
    .modal-content p { font-size: 0.75rem !important; margin-bottom: 8px !important; line-height: 1.25 !important; }

    /* 4. LUCKY WHEEL — roată mică de tot ca să încapă cu butoanele Close/Spin. */
    .wheel-wrapper {
        width: 118px !important;
        height: 118px !important;
        margin: 2px auto 8px auto !important;
    }
    .wheel-segment {
        font-size: 0.5rem !important;
        width: 38px !important;
        height: 38px !important;
        margin-top: -19px !important;
        margin-left: -19px !important;
        transform: rotate(var(--rot)) translateY(-35px) !important;
    }
    #wheel-timer-container { margin-bottom: 4px !important; font-size: 0.68rem !important; }
    #wheel-countdown { font-size: 0.95rem !important; }

    /* 5. BLACK MARKET — header/subtitle slabe, ca grila să prindă tot restul. */
    .shop-header { padding: 6px 12px !important; }
    .shop-header h2 { font-size: 0.9rem !important; }
    .shop-subtitle { padding: 5px 8px !important; font-size: 0.62rem !important; line-height: 1.15 !important; }
    .shop-subtitle button { margin-top: 2px !important; padding: 3px 10px !important; }
    /* flex:1 + min-height:0 = grila devine zona de scroll și chiar se micșorează
       sub înălțimea conținutului (fără min-height:0 un flex-item refuză să se
       strângă și overflow-y:auto nu se activează — de-aici butoanele tăiate). */
    .premium-shop-grid {
        padding: 8px !important;
        gap: 6px !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }

    /* 6. BALENĂ VIP — sprite mic + spații mici, ca butoanele Keep It / Double It
          să fie mereu vizibile fără scroll. */
    #whale-popout-sprite { --size: 52px !important; }
    .whale-modal-box {
        margin-top: 6px !important;
        margin-bottom: 6px !important;
        padding: 12px !important;
    }
    .whale-modal-box h2 { margin-top: 6px !important; }
    #whale-earned-text { font-size: 1.6rem !important; margin: 8px 0 !important; }
}

/* Pop in at the final position; layout corrections must never slide cards. */
.card {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s;
}

/* ===================================================
   v1.0.1 — RECHINII DEALERI (Card Sharks)
   =================================================== */
.shark-dealer {
    position: absolute;
    left: 0; top: 0;
    width: 74px; height: 74px;
    z-index: 15;               /* peste cărțile din masă (10), sub cartea întoarsă (1000) */
    pointer-events: none;      /* click-urile trec prin el spre masă */
    will-change: transform;
}

.shark-shadow {
    position: absolute;
    bottom: -8px; left: 50%;
    width: 50px; height: 12px;
    margin-left: -25px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    filter: blur(3px);
    animation: shark-shadow-pulse 1.7s ease-in-out infinite;
}

.shark-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease; /* întoarcerea stânga/dreapta arată ca un viraj */
}

.shark-bob {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: shark-bob 1.7s ease-in-out infinite;
}

.shark-dealer .shark-sprite {
    position: relative;
    width: 74px;
    height: 74px;
    filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.45)) !important;
}

.shark-swim-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    pointer-events: none;
}

.shark-swim-frame.active { opacity: 1; }

@keyframes shark-bob {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-6px) rotate(2deg); }
}

@keyframes shark-shadow-pulse {
    0%, 100% { transform: scaleX(1); opacity: 0.85; }
    50%      { transform: scaleX(0.8); opacity: 0.55; }
}

/* Sosirea unui rechin nou-angajat: se rotește elegant din nimic */
.shark-dealer.arriving .shark-face {
    animation: shark-arrive 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes shark-arrive {
    from { transform: scale(0) rotate(-160deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Concedierea (Prestige): se estompează */
.shark-dealer.leaving {
    opacity: 0;
    transition: opacity 0.35s ease;
}

/* Atacul de flip: ezitare scurtă (se trage înapoi) + lansare peste carte */
.shark-dealer.flipping .shark-bob {
    animation: shark-lunge 0.5s cubic-bezier(0.36, 0, 0.66, 1.4);
}
@keyframes shark-lunge {
    0%   { transform: scale(1) rotate(0deg) translateY(0); }
    30%  { transform: scale(0.82) rotate(-14deg) translateY(5px); }
    60%  { transform: scale(1.28) rotate(9deg) translateY(-12px); }
    100% { transform: scale(1) rotate(0deg) translateY(0); }
}

/* Unda de apă la flip */
.shark-ripple {
    position: absolute;
    width: 60px; height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(96, 165, 250, 0.75);
    pointer-events: none;
    z-index: 14;
    animation: shark-ripple 0.6s ease-out forwards;
}
@keyframes shark-ripple {
    from { transform: scale(0.3); opacity: 1; }
    to   { transform: scale(1.9); opacity: 0; }
}

/* Simbolurile de cărți care sar când rechinul întoarce o carte */
.suit-particle {
    position: absolute;
    font-size: 1.15rem;
    font-weight: 800;
    pointer-events: none;
    z-index: 1001;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    animation: suit-pop 0.8s ease-out forwards;
}
@keyframes suit-pop {
    from { transform: translate(0, 0) scale(0.6) rotate(0deg); opacity: 1; }
    to   { transform: translate(var(--dx), var(--dy)) scale(1.35) rotate(var(--dr)); opacity: 0; }
}

/* ===================================================
   v1.0.1 — CHANGELOG (What's New)
   =================================================== */
.changelog-box {
    width: 400px !important;
    max-width: 94vw !important;
    text-align: left !important;
}

.changelog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.changelog-version-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

#changelog-list {
    max-height: 48vh;
    overflow-y: auto;
    padding-right: 6px;
}

.changelog-entry { margin-bottom: 18px; }
.changelog-entry:last-child { margin-bottom: 0; opacity: 0.55; }

.changelog-entry-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.changelog-entry-version {
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
}

.changelog-entry-date {
    color: #64748b;
    font-size: 0.65rem;
    white-space: nowrap;
}

.changelog-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.changelog-tag {
    flex-shrink: 0;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 2px;
    min-width: 30px;
    text-align: center;
}

.changelog-text {
    color: #cbd5e1;
    font-size: 0.78rem;
    line-height: 1.45;
}

/* Rândul cu versiunea jocului din meniul de Setări */
#settings-version {
    text-align: center;
    font-size: 0.62rem;
    color: #64748b;
    letter-spacing: 0.5px;
    padding-top: 2px;
    user-select: none;
}

/* ===================================================
   v1.0.1 — SCROLL FRUMOS ÎN MODALE (Changelog, Roata Norocului...)
   Aceeași bară subțire cu accent ca în Market / Decks / Relicve,
   în locul barei gri implicite de Windows. Merge și cu rotița
   (vezi whitelist-ul din platform.js) și cu degetul pe mobil.
   =================================================== */
#changelog-list,
.modal-content {
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(255, 255, 255, 0.06);
    /* Scroll lin cu degetul pe mobil (iOS momentum) */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

#changelog-list::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 6px;
    height: 0px; /* fără bară orizontală */
}

#changelog-list::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
}

#changelog-list::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

#changelog-list::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
    filter: brightness(1.25);
}


/* Fix pentru glitch-ul de Full-Screen */
body {
    display: flex;
    flex-direction: row;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#game-board {
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 60%; /* Forțează jocul să păstreze minim 60% din ecran */
}

#right-panel {
    width: 350px; 
    flex-shrink: 0; /* Interzice panoului din dreapta să se lățească sau să se micșoreze */
}

.cg-banner-area {
    width: 100%;
    height: 90px; 
    max-height: 90px;
    flex-shrink: 0;
    overflow: hidden;
}

/* ===================================================
   FIX SUPREM: BLOCARE INJECȚII SDK CRAZYGAMES
   =================================================== */

/* 1. Oprim flexbox-ul de pe body. Orice iframe sau pixel de tracking 
      injectat de SDK va pica la fund, fără să distrugă interfața! */
html, body {
    display: block !important;
}

/* 2. Jocul devine absolut, ancorat ferm în stânga */
#game-board {
    position: absolute !important;
    top: 0; left: 0; bottom: 0;
    width: 100vw !important;
    transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* Pe Desktop, când deschizi magazinul, jocul se strânge ca să-i facă loc */
@media (min-width: 1025px) {
    body.market-open #game-board {
        width: calc(100vw - var(--panel-width)) !important;
    }
}

/* 3. Panoul din dreapta devine absolut, ancorat în dreapta */
#right-panel {
    position: absolute !important;
    top: 0; right: 0; bottom: 0;
    height: 100vh !important;
    margin-right: 0 !important; /* Ucidem vechiul sistem cu margin negativ */
    transform: translateX(100%) !important; /* Ascuns implicit în afara ecranului */
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1) !important;
    z-index: 500 !important;
}

/* Când magazinul e deschis, glisează curat în ecran */
body.market-open #right-panel {
    transform: translateX(0) !important;
}

/* 4. Ascundem gunoiul vizual injectat de SDK (cele 3 iconițe de imagine spartă) */
body > img {
    display: none !important;
}

/* ===================================================
   FIX NOTIFICĂRI: Mereu deasupra tuturor ferestrelor
   =================================================== */
.toast-notification {
    z-index: 9999999 !important; /* Le facem regii absoluți ai ecranului */
}

/* Și textul cu banii care sar (când câștigi la roată) trebuie să fie deasupra */
.float-text {
    z-index: 9999999 !important;
}

/* ===================================================
   FIX SCROLLBARS: Design uniform, subțire și elegant pentru toate ferestrele
   =================================================== */
/* Adunăm toate containerele din joc care necesită scroll */
.premium-shop-grid, 
#market-scroll-container, 
#deck-list, 
.relic-grid, 
.modal-content, 
#changelog-list {
    /* Setări pentru Firefox */
    scrollbar-width: thin !important;
    scrollbar-color: #f59e0b rgba(255, 255, 255, 0.05) !important;
    
    /* Magia pentru telefoane: glisare fluidă și blocarea gesturilor nedorite */
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
}

/* Setări pentru Chrome, Edge, Safari, Opera */
.premium-shop-grid::-webkit-scrollbar, 
#market-scroll-container::-webkit-scrollbar, 
#deck-list::-webkit-scrollbar, 
.relic-grid::-webkit-scrollbar, 
.modal-content::-webkit-scrollbar, 
#changelog-list::-webkit-scrollbar {
    width: 6px !important;
    height: 0px !important; /* Tăiem scroll-ul orizontal dacă apare din greșeală */
}

/* Șanțul pe care glisează bara */
.premium-shop-grid::-webkit-scrollbar-track, 
#market-scroll-container::-webkit-scrollbar-track, 
#deck-list::-webkit-scrollbar-track, 
.relic-grid::-webkit-scrollbar-track, 
.modal-content::-webkit-scrollbar-track, 
#changelog-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 3px !important;
}

/* Bara în sine (Thumb) */
.premium-shop-grid::-webkit-scrollbar-thumb, 
#market-scroll-container::-webkit-scrollbar-thumb, 
#deck-list::-webkit-scrollbar-thumb, 
.relic-grid::-webkit-scrollbar-thumb, 
.modal-content::-webkit-scrollbar-thumb, 
#changelog-list::-webkit-scrollbar-thumb {
    background: #f59e0b !important; /* Auriu/Portocaliu */
    border-radius: 3px !important;
}

/* Efect de strălucire pe PC când ții mouse-ul pe bară */
.premium-shop-grid::-webkit-scrollbar-thumb:hover, 
#market-scroll-container::-webkit-scrollbar-thumb:hover, 
#deck-list::-webkit-scrollbar-thumb:hover, 
.relic-grid::-webkit-scrollbar-thumb:hover, 
.modal-content::-webkit-scrollbar-thumb:hover, 
#changelog-list::-webkit-scrollbar-thumb:hover {
    background: #fbbf24 !important; /* Un auriu mai deschis */
}

/* ===================================================
   CHEST ANIMATIONS & STYLES (Cinematic Unboxing)
   =================================================== */

#chest-modal {
    z-index: 2147483647 !important; 
}

#chest-options {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    gap: 4% !important; 
    margin-bottom: 20px !important;
    min-height: 120px !important; /* Lăsat mai plat pentru telefoane */
    position: relative !important;
}

.chest-wrapper {
    position: relative;
    width: 28%; /* Puțin mai mic ca să nu se înghesuie */
    max-width: 95px; 
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes chest-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.chest-option {
    width: 100%;
    height: auto;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.6));
    animation: chest-float 3s ease-in-out infinite;
    z-index: 10;
}

.chest-option:hover {
    transform: translateY(-8px) scale(1.1);
    filter: drop-shadow(0 10px 20px rgba(255,255,255,0.3));
}

.chest-chosen {
    width: 100%;
    height: auto;
    object-fit: contain;
    animation: none !important; 
    filter: drop-shadow(0 15px 35px rgba(245, 158, 11, 0.6));
    pointer-events: none !important; 
}
.chest-chosen:hover { transform: none !important; }

/* Animație REPARATĂ: Nu se mai urcă pe pereți, sare blând */
@keyframes reward-pop {
    0% { transform: translate(-50%, 10px) scale(0.2); opacity: 0; }
    60% { transform: translate(-50%, -65px) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -45px) scale(1); opacity: 1; }
}

.chest-reward-icon {
    position: absolute;
    top: 50%; 
    left: 50%;
    animation: reward-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.8));
    z-index: 9999 !important; 
    pointer-events: none;
}

/* ===================================================
   DAILY LOGIN STYLES (Premium)
   =================================================== */
.daily-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    width: 85px;
    height: 105px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    opacity: 0.6; 
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.daily-card img {
    width: 48px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
    margin-top: 5px;
}

.day-label {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: absolute;
    top: 8px;
}

.daily-cash-text {
    font-size: 0.8rem;
    color: #10b981;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    margin-top: auto;
    margin-bottom: 10px;
}

/* Ziua care te așteaptă AZI */
.daily-card.active-today {
    opacity: 1;
    border: 2px solid #3b82f6;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.15) 0%, rgba(30, 58, 138, 0.05) 100%);
    transform: scale(1.08);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
    z-index: 10;
}
.daily-card.active-today .day-label { color: #93c5fd; }

/* Zilele pe care le-ai luat DEJA */
.daily-card.claimed-past {
    border-color: rgba(16, 185, 129, 0.3);
}
.daily-card.claimed-past::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 5;
}
.daily-card.claimed-past::after {
    content: "✔";
    position: absolute;
    font-size: 3rem;
    color: #10b981;
    font-weight: bold;
    z-index: 10;
    text-shadow: 0 4px 10px rgba(0,0,0,0.8);
}

/* Ziua 7 (Epic) */
.daily-card.day-7-epic {
    width: 170px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    background: radial-gradient(circle at center, rgba(245, 158, 11, 0.05) 0%, transparent 70%);
}
.daily-card.day-7-epic .day-label { color: #fcd34d; font-size: 0.75rem; }
.daily-card.day-7-epic.active-today {
    border: 2px solid #f59e0b;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.2) 0%, rgba(146, 64, 14, 0.05) 100%);
    box-shadow: 0 10px 30px -5px rgba(245, 158, 11, 0.5);
}

@media (max-width: 600px) {
    .daily-card { width: 70px; height: 95px; }
    .daily-card img { width: 40px; }
    .daily-card.day-7-epic { width: 145px; }
    .daily-cash-text { font-size: 0.7rem; }
}

/* Shared rank theme. Keep this after responsive and legacy window rules. */
:root {
    --modal-bg: radial-gradient(circle at top, #1e293b 0%, #0f172a 100%);
    --modal-border: #334155;
}

/* Important overrides also cover older inline window backgrounds. */
.modal-content,
.collection-modal,
#deck-selection-container,
.shop-container,
#settings-menu,
#hover-info-panel,
#tutorial-tooltip,
.toast-notification {
    background: var(--modal-bg) !important;
    border-color: var(--modal-border) !important;
}

/* Fullscreen decks and the market backdrop must follow the table palette. */
.overlay-screen {
    background: var(--bg-gradient);
}
/* Darken both picker backdrops while keeping the live rank palette. */
#deck-selection-overlay,
#relics-menu-modal {
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), var(--bg-gradient);
}
.fullscreen-shop-overlay {
    background: var(--glass-bg) !important;
}

/* Responsive layouts previously brought back fixed blue panel backgrounds. */
#right-panel,
#mission-card {
    background: var(--glass-bg) !important;
}
.shop-header,
.shop-subtitle {
    border-color: var(--modal-border);
}

/* Decks scroll horizontally, with vertical access on short phone screens. */
#deck-list {
    min-width: 0;
    min-height: 0;
    overscroll-behavior: contain !important;
}
#deck-list,
#deck-list * {
    touch-action: pan-x pan-y pinch-zoom !important;
}
