* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            user-select: none; /* Prevents text selection */
            font-family: 'Cinzel', serif;
        }

        /* MEDIEVAL THEME - Dark Fantasy */
        body {
            background: 
                linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.8)),
                repeating-linear-gradient(
                    90deg,
                    #2c2416 0px,
                    #3d2817 2px,
                    #2c2416 4px
                );
            background-attachment: fixed;
            color: #e8d5b5;
            overflow-x: hidden;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
        }
        
        /* Stone Texture Overlay */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: 
                radial-gradient(circle at 20% 50%, transparent 20%, rgba(0,0,0,0.3) 21%, rgba(0,0,0,0.3) 34%, transparent 35%),
                radial-gradient(circle at 80% 80%, transparent 20%, rgba(0,0,0,0.3) 21%, rgba(0,0,0,0.3) 34%, transparent 35%);
            background-size: 100px 100px;
            opacity: 0.3;
            pointer-events: none;
            z-index: 1;
        }

        /* * =========================================
         * BASE LAYOUT AND FONTS
         * =========================================
        */
        html, body {
            height: 100vh;
            width: 100vw;
            overflow: hidden; /* Prevents scrolling of the whole page */
        }

        /* Main game container - now hidden by default */
        .game-wrapper {
            display: none; /* Starts hidden */
            flex-direction: column;
            height: 100vh;
            width: 100vw;
            animation: fadeIn 0.5s ease-out;
        }
        
        .game-wrapper.active {
            display: flex; /* Activated via JS */
        }

        /* * =========================================
         * WELCOME SCREEN
         * =========================================
        */
        .welcome-screen {
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 20px;
            position: relative;
            z-index: 2;
            overflow: hidden;
        }
        
        /* Arcos góticos sutis no fundo */
        .welcome-screen::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-image: 
                radial-gradient(ellipse at 20% 50%, transparent 30%, rgba(61, 40, 23, 0.3) 31%, rgba(61, 40, 23, 0.3) 45%, transparent 46%),
                radial-gradient(ellipse at 80% 50%, transparent 30%, rgba(61, 40, 23, 0.3) 31%, rgba(61, 40, 23, 0.3) 45%, transparent 46%);
            background-size: 100% 100%;
            opacity: 0.4;
            z-index: -1;
            pointer-events: none;
        }
        
        /* Tochas laterais com brilho animado */
        .welcome-screen::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: 
                radial-gradient(circle at 10% 20%, rgba(255, 136, 0, 0.15) 0%, transparent 20%),
                radial-gradient(circle at 90% 20%, rgba(255, 136, 0, 0.15) 0%, transparent 20%);
            animation: torchGlow 4s ease-in-out infinite;
            z-index: -1;
            pointer-events: none;
        }
        
        @keyframes torchGlow {
            0%, 100% {
                opacity: 0.6;
                filter: blur(20px);
            }
            50% {
                opacity: 0.9;
                filter: blur(25px);
            }
        }
        .welcome-screen h1 {
            font-family: 'MedievalSharp', 'Cinzel Decorative', serif;
            font-size: clamp(2.5em, 10vw, 5.5em);
            font-weight: 900;
            margin-bottom: 30px;
            letter-spacing: 0.08em;
            text-align: center;
            line-height: 1.2;
            padding: 0 10px;
            text-transform: uppercase;
            
            /* Efeito 3D de madeira gravada - estilo das imagens */
            color: #d4af37;
            text-shadow: 
                /* Profundidade 3D marrom escuro */
                1px 1px 0 #3d2817,
                2px 2px 0 #3d2817,
                3px 3px 0 #2c2416,
                4px 4px 0 #2c2416,
                5px 5px 0 #1a1410,
                6px 6px 0 #1a1410,
                /* Sombra suave */
                7px 7px 15px rgba(0, 0, 0, 0.8),
                /* Brilho dourado sutil */
                -1px -1px 0 rgba(255, 215, 0, 0.3),
                /* Borda interna escura (entalhe) */
                inset 0px 0px 5px rgba(0, 0, 0, 0.8);
            
            /* Gradiente dourado na cor base */
            background: linear-gradient(180deg, #ffd700 0%, #d4af37 50%, #8b6914 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            
            /* Filtros para realçar o efeito */
            filter: 
                drop-shadow(0 0 20px rgba(212, 175, 55, 0.4))
                drop-shadow(8px 8px 10px rgba(0, 0, 0, 0.6));
            
            animation: titleGlow 3s ease-in-out infinite;
            
            /* Efeito de relevo/entalhe */
            position: relative;
        }
        
        /* Brilho animado mais sutil */
        @keyframes titleGlow {
            0%, 100% { 
                filter: 
                    drop-shadow(0 0 15px rgba(212, 175, 55, 0.3))
                    drop-shadow(8px 8px 10px rgba(0, 0, 0, 0.6));
            }
            50% { 
                filter: 
                    drop-shadow(0 0 25px rgba(255, 215, 0, 0.5))
                    drop-shadow(8px 8px 10px rgba(0, 0, 0, 0.6));
            }
        }

        .welcome-buttons {
            display: flex;
            flex-direction: column;
            gap: 15px;
            animation: slideUp 0.7s ease;
            width: 90%;
            max-width: 350px;
        }

        .welcome-btn {
            padding: 18px 40px;
            font-size: clamp(1.1em, 3vw, 1.3em);
            font-weight: 700;
            font-family: 'Cinzel', serif;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 2px;
            box-shadow: 
                0 4px 0 #5a4a2a,
                0 8px 15px rgba(0, 0, 0, 0.6),
                inset 0 -2px 5px rgba(0, 0, 0, 0.3);
            background: linear-gradient(135deg, #8b7355 0%, #a89078 50%, #8b7355 100%);
            color: #f5e6d3;
            border: 3px solid #d4af37;
            position: relative;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
        }
        
        .welcome-btn::before {
            content: '';
            position: absolute;
            top: 3px;
            left: 3px;
            right: 3px;
            height: 40%;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent);
            border-radius: 2px;
        }

        .welcome-btn:hover {
            transform: translateY(-3px) scale(1.02);
            box-shadow: 
                0 4px 0 #5a4a2a,
                0 12px 25px rgba(212, 175, 55, 0.4),
                inset 0 -2px 5px rgba(0, 0, 0, 0.3);
            border-color: #ffd700;
        }
        
        .welcome-btn:active {
            transform: translateY(2px);
            box-shadow: 
                0 1px 0 #5a4a2a,
                0 4px 10px rgba(0, 0, 0, 0.6);
        }
        
        /* Highlight Button (Unlocks) - GOLD THEME */
        .btn-highlight {
            background: linear-gradient(135deg, #d4af37 0%, #ffd700 50%, #d4af37 100%) !important;
            color: #2c2416 !important;
            border-color: #ffd700 !important;
            box-shadow: 
                0 4px 0 #8b7355,
                0 8px 25px rgba(255, 215, 0, 0.6),
                inset 0 -2px 5px rgba(0, 0, 0, 0.3) !important;
            font-weight: 900 !important;
        }
        .btn-highlight:hover {
            box-shadow: 
                0 4px 0 #8b7355,
                0 12px 35px rgba(255, 215, 0, 0.8),
                inset 0 -2px 5px rgba(0, 0, 0, 0.3) !important;
        }

        /* * =========================================
         * NEW GAME MODAL (NAME + DIFFICULTY)
         * =========================================
        */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            z-index: 1000;
            display: none;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.3s ease;
            padding: 15px;
        }

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

        .modal-content {
            background: 
                linear-gradient(135deg, rgba(0,0,0,0.3), transparent),
                linear-gradient(135deg, #3d2817 0%, #2c2416 50%, #3d2817 100%);
            padding: 35px 45px;
            border-radius: 8px;
            max-width: none;
            width: auto;
            border: 4px solid #d4af37;
            box-shadow: 
                0 0 30px rgba(212, 175, 55, 0.4),
                0 20px 60px rgba(0, 0, 0, 0.9),
                inset 0 0 50px rgba(0, 0, 0, 0.5);
            animation: slideInLeft 0.4s ease;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
        }
        
        /* Ornamental corners for modals */
        .modal-content::before,
        .modal-content::after {
            content: '⚜';
            position: absolute;
            font-size: 2em;
            color: #d4af37;
            opacity: 0.5;
        }
        .modal-content::before {
            top: 10px;
            left: 15px;
        }
        .modal-content::after {
            bottom: 10px;
            right: 15px;
            transform: rotate(180deg);
        }
        
        .modal-content h3 {
            margin-top: 20px;
            margin-bottom: 12px;
            color: #d4af37;
            font-family: 'Cinzel', serif;
            font-weight: 700;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
            letter-spacing: 0.05em;
        }
        
        @keyframes slideInLeft {
            from {
                opacity: 0;
                transform: translateX(-50px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }
        
        /* Modal Headers - Medieval Gold */
        .modal-content h2 {
            font-family: 'Cinzel Decorative', serif;
            color: #ffd700;
            text-shadow: 
                0 0 10px rgba(255, 215, 0, 0.5),
                2px 2px 4px rgba(0, 0, 0, 0.9);
            margin-bottom: 25px;
            text-align: center;
            letter-spacing: 0.1em;
            border-bottom: 2px solid #d4af37;
            padding-bottom: 15px;
        }
        #unlocksModal h2 { color: #ffd700; }
        
        /* Give Up Modal */
        #giveUpModal .modal-content { border-color: #ff6b6b; }
        #giveUpModal h2 { color: #ff6b6b; }
        

        .modal-content h2 {
            font-size: clamp(1.5em, 5vw, 2em);
            margin-bottom: 25px;
            text-align: center;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            font-size: 1.1em;
            margin-bottom: 10px;
            font-weight: bold;
        }

        #playerNameInput {
            width: 100%;
            padding: 12px;
            border-radius: 8px;
            border: 2px solid #667eea;
            background: rgba(0,0,0,0.3);
            color: white;
            font-size: 1.1em;
        }

        .difficulty-selector {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin: 20px 0;
            flex-wrap: wrap;
        }

        .difficulty-btn {
            flex: 1;
            min-width: 140px;
            padding: 15px;
            border: 3px solid #5a4a2a;
            border-radius: 4px;
            background: linear-gradient(135deg, #3d2817 0%, #2c2416 100%);
            color: #e8d5b5;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.95em;
            font-family: 'Cinzel', serif;
            font-weight: 600;
            text-align: center;
            box-shadow: 0 3px 0 #2c2416, 0 5px 10px rgba(0, 0, 0, 0.6);
        }

        .difficulty-btn:hover {
            background: linear-gradient(135deg, #4a3820 0%, #362a18 100%);
            transform: translateY(-2px);
            box-shadow: 0 3px 0 #2c2416, 0 8px 15px rgba(0, 0, 0, 0.7);
        }

        .difficulty-btn.selected {
            border-color: #d4af37;
            box-shadow: 0 3px 0 #2c2416, 0 5px 10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.5);
        }

        .difficulty-btn.easy { border-color: #6b8e6b; }
        .difficulty-btn.easy.selected { border-color: #a0b48d; background: linear-gradient(135deg, #4a6b4a 0%, #3d5a3d 100%); }
        .difficulty-btn.normal { border-color: #d4af37; }
        .difficulty-btn.normal.selected { border-color: #ffd700; background: linear-gradient(135deg, #8b7355 0%, #6b5a3d 100%); }
        .difficulty-btn.hard { border-color: #8b3a3a; }
        .difficulty-btn.hard.selected { border-color: #a0463d; background: linear-gradient(135deg, #6b2a2a 0%, #5a1f1f 100%); }
        .difficulty-btn.endless { border-color: #9b59b6; }
        .difficulty-btn.endless.selected { border-color: #d4af37; background: linear-gradient(135deg, #6b3d8e 0%, #4a2a6b 100%); box-shadow: 0 3px 0 #2c2416, 0 5px 10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(155, 89, 182, 0.6); }

        .difficulty-tab {
            padding: 10px 20px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.1);
            color: white;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.9em;
        }

        .difficulty-tab:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-2px);
        }

        .difficulty-tab.active {
            background: rgba(102, 126, 234, 0.4);
            border-color: #667eea;
            box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
        }

        .modal-controls {
            display: flex;
            gap: 15px;
            margin-top: 25px;
            flex-direction: column;
        }

        .btn {
            padding: 14px 26px;
            font-size: 1em;
            font-weight: 700;
            font-family: 'Cinzel', serif;
            border: 3px solid #5a4a2a;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 2px;
            box-shadow: 0 3px 0 #2c2416, 0 5px 15px rgba(0, 0, 0, 0.7);
            flex: 1;
            position: relative;
        }
        
        /* Standard Buttons - Medieval Style */
        .btn-primary {
            background: linear-gradient(135deg, #8b7355 0%, #a89078 50%, #8b7355 100%);
            color: #f5e6d3;
            border-color: #d4af37;
        }
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 3px 0 #2c2416, 0 8px 25px rgba(212, 175, 55, 0.5);
            border-color: #ffd700;
        }
        
        .btn-secondary {
            background: linear-gradient(135deg, #3d2817 0%, #2c2416 100%);
            color: #a89078;
            border-color: #5a4a2a;
        }
        .btn-secondary:hover {
            background: linear-gradient(135deg, #4a3820 0%, #362a18 100%);
        }

        .btn-success {
            background: linear-gradient(135deg, #6b8e6b 0%, #a0b48d 100%);
            color: #e8f5e8;
            border-color: #4a6b4a;
        }
        .btn-danger {
            background: linear-gradient(135deg, #8b3a3a 0%, #a0463d 100%);
            color: #ffcccc;
            border-color: #5a2a2a;
        }
        .btn-warning {
            background: linear-gradient(135deg, #d4af37 0%, #ffd700 50%, #d4af37 100%);
            color: #2c2416;
            border-color: #ffd700;
            font-weight: 900;
        }
        
        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none !important;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3) !important;
            background: linear-gradient(180deg, #5a4a38 0%, #3a2a18 100%) !important;
            color: #8b7355 !important;
            filter: grayscale(60%) !important;
            border-color: #4a3a28 !important;
        }

        /* * =========================================
         * MAIN GAME LAYOUT (HORIZONTAL)
         * =========================================
        */

        /* TOP BAR (Stats, Gold, Config) - MEDIEVAL */
        .top-bar {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 24px;
            background: linear-gradient(180deg, rgba(61, 40, 23, 0.95) 0%, rgba(44, 36, 22, 0.98) 100%);
            border-bottom: 3px solid #d4af37;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
            flex-shrink: 0;
            gap: 15px;
            position: relative;
        }
        
        /* Micro-tochas decorativas nos cantos */
        .top-bar::before,
        .top-bar::after {
            content: '🔥';
            position: absolute;
            font-size: 14px;
            opacity: 0.6;
            animation: microTorchFlicker 3s ease-in-out infinite;
        }
        .top-bar::before {
            left: 8px;
            top: 50%;
            transform: translateY(-50%);
        }
        .top-bar::after {
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
        }
        
        @keyframes microTorchFlicker {
            0%, 100% { opacity: 0.5; }
            50% { opacity: 0.8; }
        }

        .stats-group {
            display: flex;
            gap: 20px;
            flex-wrap: wrap; /* For smaller screens */
        }

        .stat-display {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: clamp(1em, 2.5vw, 1.2em);
            font-weight: bold;
        }
        .stat-display .stat-value {
            min-width: 30px;
        }
        #top-bar-health .stat-value { color: #ff6b6b; }
        #top-bar-gold .stat-value { color: #ffd700; }
        #top-bar-dungeon .stat-value { color: #4ecdc4; }
        #top-bar-rooms .stat-value { color: #a8edea; }
        /* Score display removed from here */

        /* Achievement Display in Top Bar */
        .achievements-compact {
            display: flex;
            align-items: center;
            gap: 5px;
            padding: 5px 10px;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.3s;
            border: 1px solid rgba(255, 215, 0, 0.3);
        }
        .achievements-compact:hover {
            background: rgba(0, 0, 0, 0.5);
            transform: scale(1.05);
        }
        .achievement-icon {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            transition: all 0.3s;
            position: relative;
        }
        .achievement-icon.bronze { background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%); }
        .achievement-icon.silver { background: linear-gradient(135deg, #c0c0c0 0%, #808080 100%); }
        .achievement-icon.gold { background: linear-gradient(135deg, #ffd700 0%, #daa520 100%); }
        .achievement-icon.platinum { background: linear-gradient(135deg, #e5e4e2 0%, #a8a8a8 100%); box-shadow: 0 0 10px #fff; }
        .achievement-icon.locked {
            filter: grayscale(100%) brightness(0.5);
            opacity: 0.4;
        }
        .achievement-icon.unlocked {
            animation: achievementPop 0.6s ease;
        }
        @keyframes achievementPop {
            0% { transform: scale(0); }
            50% { transform: scale(1.3); }
            100% { transform: scale(1); }
        }
        .achievement-counter {
            font-size: 0.9em;
            font-weight: bold;
            color: #ffd700;
        }

        .settings-group {
            display: flex;
            gap: 10px;
            flex-shrink: 0;
            align-items: center;
        }

        .settings-btn {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 8px 12px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9em;
            transition: all 0.3s ease;
            min-width: 44px;
            min-height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .settings-btn:hover {
            background: rgba(255, 255, 255, 0.2);
        }
        .settings-btn.active {
            background: rgba(107, 207, 127, 0.3);
            border-color: #6bcf7f;
        }
        .settings-btn:disabled {
            opacity: 0.3;
            cursor: not-allowed;
            pointer-events: none;
        }
        
        /* Highlight for Unlocks in top bar */
        .settings-btn.btn-highlight {
            background: linear-gradient(135deg, #ffd700 0%, #f59f00 100%);
            color: #1a1a2e;
            border-color: #ffe066;
            font-weight: bold;
        }
        
        /* Give up button style */
        .settings-btn.btn-danger-style {
            background: rgba(255, 107, 107, 0.3);
            border-color: #ff6b6b;
            color: #ff6b6b;
            font-weight: bold;
        }
        .settings-btn.btn-danger-style:hover {
            background: rgba(255, 107, 107, 0.5);
            color: white;
        }
        
        /* Music Controls */
        .music-controls {
            display: flex;
            align-items: center;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 8px;
            overflow: hidden;
        }
        .music-controls .settings-btn {
            border: none;
            border-radius: 0;
            border-left: 1px solid rgba(255, 255, 255, 0.3);
        }
        .music-controls .settings-btn:first-child {
            border-left: none;
        }
        .music-controls .settings-btn:disabled {
            opacity: 0.3;
            background: rgba(0,0,0,0.2);
            cursor: not-allowed;
        }

        /* CENTER AREA (Relics, Stage, Hold) */
        .center-area {
            display: flex;
            flex: 1; /* Occupies all remaining space */
            overflow: hidden;
            padding: 15px;
            gap: 15px;
        }
        
        /* LEFT PANEL (Relics) */
        .left-sidebar {
            width: 200px;
            flex-shrink: 0;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 15px;
            padding: 15px;
            border: 2px solid rgba(255, 215, 0, 0.3);
            overflow-y: auto;
            display: flex;
            flex-direction: column;
        }
        .left-sidebar h3 {
            color: #ffd700;
            margin-bottom: 15px;
            font-size: 1.2em;
            text-align: center;
            border-bottom: 1px solid rgba(255, 215, 0, 0.3);
            padding-bottom: 10px;
            flex-shrink: 0;
        }
        #relicsList {
            display: flex;
            flex-direction: column;
            gap: 10px;
            flex: 1;
            overflow-y: auto; /* Relic list scrolls */
            margin-bottom: 15px;
        }
        .relic-item {
            background: rgba(255, 255, 255, 0.05);
            padding: 10px;
            border-radius: 8px;
            border-left: 3px solid #ffd700;
        }
        .relic-name {
            color: #ffd700;
            font-weight: bold;
            margin-bottom: 3px;
            font-size: 0.95em;
        }
        .relic-effect {
            color: #ccc;
            font-size: 0.85em;
        }
        .relic-item.used {
            opacity: 0.5;
            text-decoration: line-through;
        }
        
        /* Shop Button */
        .sidebar-action {
            flex-shrink: 0;
            border-top: 1px solid rgba(255, 215, 0, 0.3);
            padding-top: 15px;
        }
        .btn-shop {
            background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
            color: white;
            border: none;
            padding: 12px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: bold;
            transition: all 0.3s;
            width: 100%;
            font-size: 1.1em;
        }
        .btn-shop:hover {
            transform: scale(1.05);
            box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
        }

        /* CENTER STAGE (Weapon, Messages, Controls) */
        .center-stage {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-between; /* Spaces elements */
            gap: 15px;
            position: relative;
            padding: 20px 0;
        }

        #messageArea {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 90%;
            max-width: 600px;
            z-index: 10001; /* Above all modals (modals are 1000-10000) */
        }

        .message {
            text-align: center;
            padding: 15px;
            margin-top: 10px;
            border-radius: 10px;
            font-size: 1.1em;
            font-weight: bold;
            animation: slideDown 0.5s ease;
            box-shadow: 0 5px 20px rgba(0,0,0,0.4);
        }
        .message.info { background: rgba(78, 205, 196, 0.3); border: 2px solid #4ecdc4; }
        .message.warning { background: rgba(255, 217, 61, 0.3); border: 2px solid #ffd93d; }
        .message.danger { background: rgba(255, 107, 107, 0.3); border: 2px solid #ff6b6b; }
        .message.success { background: rgba(107, 207, 127, 0.3); border: 2px solid #6bcf7f; }

        .center-stage-label {
            font-size: 1.1em;
            opacity: 0.8;
            text-transform: uppercase;
            letter-spacing: 2px;
        }

        .cards-row { /* Generic class for card rows */
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
            justify-content: center;
            align-items: center;
        }

        /* NEW SCORE DISPLAY */
        .score-display {
            text-align: center;
            margin-top: auto; /* Pushes up from controls */
            margin-bottom: 20px;
        }
        .score-label {
            font-size: 1.1em;
            opacity: 0.8;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: #ffd700;
        }
        .score-value {
            font-size: clamp(2.5em, 8vw, 4em);
            font-weight: bold;
            color: #ffd700;
            text-shadow: 0 0 20px rgba(255, 217, 61, 0.5);
            line-height: 1;
        }
        
        #center-stage-weapon {
            min-height: 185px; /* Card height + margin */
            display: flex;
            flex-direction: column;
            gap: 10px;
            align-items: center;
            justify-content: center;
            margin-top: 0; /* Removed auto margin */
        }
        
        .controls {
            display: flex;
            gap: 15px;
            justify-content: center;
            align-items: center;
            margin-bottom: auto; /* Pushes up to center */
            margin-top: 20px;
            flex-wrap: wrap;
        }
        .controls .btn {
            padding: 18px 30px;
            font-size: 1.2em;
        }
        
        /* RIGHT PANEL (Held Card, Discard) */
        .right-sidebar {
            width: 170px; /* Width for 1 card + padding */
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 15px;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 15px;
            border: 2px solid rgba(255, 255, 255, 0.2);
            gap: 20px;
        }

        .hold-area {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            gap: 10px;
            flex-shrink: 0;
        }
        
        .sidebar-label {
            font-size: 1.1em;
            opacity: 0.8;
            text-transform: uppercase;
            letter-spacing: 2px;
            font-weight: bold;
            margin-bottom: 5px;
            text-align: center;
            flex-shrink: 0;
        }
        .hold-label { color: #ffd93d; }
        .discard-label { color: #aaa; }

        #discardPilePreview {
            display: flex;
            flex-direction: column;
            gap: 5px;
            justify-content: flex-start;
            align-items: center;
            flex: 1; /* Occupies space */
            width: 100%;
            overflow-y: auto;
            background: rgba(0,0,0,0.2);
            padding: 10px;
            border-radius: 10px;
            min-height: 100px; /* Minimum height */
        }
        
        /* Timer */
        .sidebar-timer {
            flex-shrink: 0;
            font-size: 1.3em;
            font-weight: bold;
            color: #aaa;
            margin-top: auto; /* Pushes to bottom */
            padding-top: 10px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            width: 100%;
            text-align: center;
        }
        
        /* BOTTOM BAR (Room / "Hand") */
        .bottom-bar {
            width: 100%;
            display: flex;
            align-items: center; 
            justify-content: center;
            padding: 20px;
            background: rgba(0, 0, 0, 0.4);
            border-top: 2px solid rgba(255, 255, 255, 0.2);
            flex-shrink: 0;
            gap: 20px;
            min-height: 200px; /* Height for cards */
            flex-wrap: wrap; /* Allows line break on small screens */
        }

        /* * =========================================
         * CARD STYLES AND EFFECTS
         * =========================================
        */
        .card {
            width: 120px;
            height: 170px;
            background: 
                linear-gradient(135deg, rgba(0,0,0,0.2), transparent),
                linear-gradient(135deg, #8b7355 0%, #a89078 50%, #8b7355 100%);
            border-radius: 4px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 3px solid #5a4a2a;
            box-shadow: 
                0 3px 0 #3d2817,
                0 6px 15px rgba(0, 0, 0, 0.7),
                inset 0 -2px 5px rgba(0, 0, 0, 0.4),
                inset 0 2px 3px rgba(255, 255, 255, 0.1);
            position: relative;
            transform-style: preserve-3d;
            animation: cardSlideIn 0.5s ease;
            text-align: center;
            flex-shrink: 0;
            font-family: 'MedievalSharp', serif;
        }
        
        /* Parchment texture overlay on cards */
        .card::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-image: 
                repeating-linear-gradient(
                    0deg,
                    transparent,
                    transparent 2px,
                    rgba(0,0,0,0.03) 2px,
                    rgba(0,0,0,0.03) 4px
                );
            pointer-events: none;
            border-radius: 4px;
        }
        
        /* Cards in bottom bar (hand) */
        .bottom-bar .card:hover {
            transform: translateY(-15px) scale(1.1);
            box-shadow: 
                0 3px 0 #3d2817,
                0 18px 40px rgba(212, 175, 55, 0.6),
                inset 0 -2px 5px rgba(0, 0, 0, 0.4),
                inset 0 2px 3px rgba(255, 255, 255, 0.1);
            border-color: #d4af37;
            z-index: 10;
        }
        
        /* Cards elsewhere (equip, hold) */
        .center-stage .card:hover, .right-sidebar .card:hover {
            transform: scale(1.05);
            box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
        }

        .card-value {
            font-size: 2.8em;
            font-weight: bold;
            margin-bottom: 5px;
        }
        .card-suit {
            font-size: 2.2em;
        }

        .card.monster { 
            background: linear-gradient(135deg, rgba(0,0,0,0.3), transparent), linear-gradient(135deg, #8b3a3a 0%, #a0463d 100%); 
            border-color: #5a2a2a;
            color: #ffcccc;
        }
        .card.weapon { 
            background: linear-gradient(135deg, rgba(0,0,0,0.2), transparent), linear-gradient(135deg, #8b7355 0%, #d4af37 50%, #8b7355 100%); 
            border-color: #d4af37;
            color: #2c2416;
        }
        .card.potion { 
            background: linear-gradient(135deg, rgba(0,0,0,0.2), transparent), linear-gradient(135deg, #6b8e6b 0%, #a0b48d 100%); 
            border-color: #4a6b4a;
            color: #e8f5e8;
        }
        .card.special { 
            background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent), linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%); 
            border-color: #d4af37;
            color: #f5e6ff;
            box-shadow: 
                0 3px 0 #3d2817,
                0 6px 15px rgba(0, 0, 0, 0.7),
                0 0 20px rgba(212, 175, 55, 0.3),
                inset 0 -2px 5px rgba(0, 0, 0, 0.4);
        }
        
        .card.boss {
            background: linear-gradient(135deg, #ff416c 0%, #8b0000 100%) !important;
            border: 3px solid #ff6b6b !important;
            transform: scale(1.1);
        }
        
        @keyframes bossPulse {
            0%, 100% { transform: scale(1.1); box-shadow: 0 0 30px rgba(255, 107, 107, 0.8); }
            50% { transform: scale(1.15); box-shadow: 0 0 50px rgba(255, 107, 107, 1); }
        }

        .card.equipped {
            border-color: #ffd93d;
            box-shadow: 0 0 25px rgba(255, 217, 61, 0.7);
            animation: pulse 2s infinite;
        }
        .card.held {
            border-color: #ffd93d;
            box-shadow: 0 0 20px rgba(255, 217, 61, 0.6);
        }
        
        /* Mini-card for discard */
        .mini-card {
            width: 80px;
            height: 40px; /* More horizontal */
            border-radius: 5px;
            border: 1px solid rgba(255, 255, 255, 0.5);
            font-size: 0.9em;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 5px;
            flex-shrink: 0;
        }
        .mini-card .card-value { font-size: 1.2em; margin: 0; }
        .mini-card .card-suit { font-size: 1em; margin: 0; }
        
        .mini-card.monster { background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%); }
        .mini-card.weapon { background: linear-gradient(135deg, #ffd93d 0%, #f59f00 100%); }
        .mini-card.potion { background: linear-gradient(135deg, #6bcf7f 0%, #37b24d 100%); }
        .mini-card.special { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }

        /* Tooltip */
        .card-tooltip {
            position: absolute;
            bottom: 105%; /* Default for cards in hand */
            left: 50%;
            transform: translateX(-50%) scale(0.9);
            background: rgba(0, 0, 0, 0.95);
            padding: 10px 15px;
            border-radius: 8px;
            font-size: 0.95em;
            white-space: nowrap;
            pointer-events: none;
            opacity: 0;
            transition: all 0.3s ease;
            z-index: 2000;
            border: 2px solid rgba(255, 255, 255, 0.3);
        }
        /* Tooltip for cards not in hand (e.g., equipped) */
        .center-stage .card:hover .card-tooltip,
        .right-sidebar .card:hover .card-tooltip {
            bottom: auto;
            top: 105%;
        }
        
        .card:hover .card-tooltip {
            opacity: 1;
            transform: translateX(-50%) scale(1);
            bottom: 110%; /* Rises higher on hover */
        }
        
        .center-stage .card:hover .card-tooltip,
        .right-sidebar .card:hover .card-tooltip {
            top: 110%;
            bottom: auto;
        }

        .tooltip-positive { color: #6bcf7f; font-weight: bold; }
        .tooltip-negative { color: #ff6b6b; font-weight: bold; }
        .tooltip-neutral { color: #ffd93d; font-weight: bold; }

        /* Preview */
        .card.preview-safe { border-color: #6bcf7f; box-shadow: 0 5px 20px rgba(107, 207, 127, 0.5); }
        .card.preview-danger { border-color: #ff6b6b; box-shadow: 0 5px 20px rgba(255, 107, 107, 0.5); }
        .card.preview-neutral { border-color: #ffd93d; box-shadow: 0 5px 20px rgba(255, 217, 61, 0.5); }

        .empty-slot {
            width: 120px;
            height: 170px;
            border: 3px dashed rgba(255, 255, 255, 0.3);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0.5;
            text-align: center;
            padding: 10px;
            font-size: 0.9em;
            flex-shrink: 0;
        }
        .right-sidebar .empty-slot { /* Hold Slot */
            font-size: 0.8em;
            width: 100%;
            max-width: 120px;
            height: 170px;
        }
        .bottom-bar .empty-slot { /* Empty Room Slot */
             width: 300px;
             font-size: 1.2em;
        }

        /* * =========================================
         * OTHER MODALS (Shop, Event, Unlocks, Leaderboard, Tutorial, Game Over)
         * =========================================
        */

        /* Generic style for closing modal */
        .close-modal-btn {
            background: linear-gradient(135deg, #555 0%, #333 100%);
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 8px;
            cursor: pointer;
            font-family: 'Cinzel', serif;
            transition: all 0.3s ease;
            width: 100%;
            font-size: 1.1em;
        }
        .close-modal-btn:hover { 
            background: linear-gradient(135deg, #666 0%, #444 100%);
        }
        
        /* X button in top right corner of modals */
        .modal-close-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            background: rgba(0, 0, 0, 0.5);
            border: 2px solid #8b7355;
            color: #d4af37;
            width: 35px;
            height: 35px;
            border-radius: 50%;
            font-size: 1.5em;
            line-height: 1;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            font-weight: bold;
            z-index: 10;
        }
        .modal-close-btn:hover {
            background: rgba(255, 107, 107, 0.8);
            border-color: #ff6b6b;
            color: #fff;
            transform: rotate(90deg);
        }

        /* Leaderboard Modal */
        .leaderboard-entry {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 15px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            margin-bottom: 10px;
            border-left: 3px solid #4ecdc4;
        }
        .leaderboard-rank { font-size: 1.2em; font-weight: bold; color: #4ecdc4; min-width: 40px; }
        .leaderboard-name { font-size: 1.1em; font-weight: bold; flex: 1; margin-left: 15px; }
        .leaderboard-score { font-size: 1.2em; font-weight: bold; color: #ffd700; }
        .leaderboard-details { font-size: 0.8em; color: #aaa; margin-top: 3px; }

        /* Tutorial Modal */
        .tutorial-section { margin: 20px 0; padding: 20px; background: rgba(0, 0, 0, 0.2); border-radius: 10px; }
        .tutorial-section h3 { font-size: 1.5em; margin-bottom: 10px; color: #ffd93d; }
        .tutorial-card-demo { display: inline-block; padding: 5px 15px; border-radius: 8px; margin: 5px; font-weight: bold; }
        .tutorial-card-demo.monster { background: #ff6b6b; }
        .tutorial-card-demo.weapon { background: #ffd93d; color: #000; }
        .tutorial-card-demo.potion { background: #6bcf7f; }

        /* Game Over Screen */
        .game-over-content {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            padding: 40px; border-radius: 20px; text-align: center;
            max-width: 600px; width: 90%;
            border: 3px solid #ff6b6b;
            max-height: 90vh;
            overflow-y: auto;
        }
        .game-over-content h2 { font-size: clamp(2em, 6vw, 3em); margin-bottom: 20px; color: #ff6b6b;}
        /* Victory title color */
        .game-over-content.victory h2 { color: #6bcf7f; }
        .game-over-content.victory { border-color: #6bcf7f; }
        
        /* Achievement Toast Animation */
        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(400px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }
        
        .game-over-content p { font-size: 1.2em; margin-bottom: 20px; }
        .game-over-score { font-size: 2.5em; color: #ffd700; margin-bottom: 20px; font-weight: bold; }
        .game-over-stats { text-align: left; margin: 20px 0; font-size: 0.9em; background: rgba(0,0,0,0.2); padding: 15px; border-radius: 10px;}
        .game-over-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
        
        /* Other Modals */
        .shop-item, .unlock-item { background: rgba(255, 255, 255, 0.1); padding: 15px; border-radius: 10px; margin-bottom: 15px; border: 2px solid rgba(255, 215, 0, 0.3); display: flex; justify-content: space-between; align-items: center; }
        .item-info { flex: 1; }
        .item-name { font-weight: bold; color: #ffd700; margin-bottom: 5px; font-size: 1.1em; }
        .item-description { color: #aaa; font-size: 0.9em; margin-bottom: 5px; }
        .item-price { color: #4ecdc4; font-weight: bold; font-size: 1.1em; }
        .buy-btn { background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%); color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: bold; transition: all 0.3s; }
        .buy-btn:hover { transform: scale(1.05); box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4); }
        .buy-btn:disabled { background: #555; cursor: not-allowed; transform: none; }
        .event-choice { background: rgba(255, 255, 255, 0.1); padding: 15px; border-radius: 10px; margin-bottom: 10px; cursor: pointer; border: 2px solid transparent; transition: all 0.3s; }
        .event-choice:hover { border-color: #ffd700; background: rgba(255, 215, 0, 0.2); transform: translateX(10px); }
        .event-text { font-size: 1.1em; line-height: 1.6; color: #ddd; margin-bottom: 20px; }
        .unlock-item.locked { opacity: 0.5; }
        .unlock-item.unlocked { border-color: #6bcf7f; background: rgba(107, 207, 127, 0.1); }
        .unlock-requirement { color: #ff6b6b; font-size: 0.85em; margin-top: 5px; }
        .unlock-item.unlocked .unlock-requirement { color: #6bcf7f; }

        /* * =========================================
         * ANIMATIONS
         * =========================================
        */
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        @keyframes slideUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes cardSlideIn {
            from { opacity: 0; transform: translateY(30px) scale(0.9); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }
        @keyframes pulse {
            0%, 100% { transform: scale(1); box-shadow: 0 0 25px rgba(255, 217, 61, 0.7); }
            50% { transform: scale(1.03); box-shadow: 0 0 35px rgba(255, 217, 61, 1); }
        }
        @keyframes gradient {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        
        /* * =========================================
         * RESPONSIVE DESIGN (MOBILE)
         * =========================================
        */
        
        /* Mobile Portrait - Touch Optimizations */
        @media screen and (max-width: 768px) and (orientation: portrait) {
            /* Settings buttons - touch friendly */
            .settings-btn {
                min-width: 48px;
                min-height: 48px;
                padding: 10px;
                font-size: 1.1em;
            }
            
            .settings-group {
                gap: 12px;
            }
            
            .music-controls {
                gap: 0;
            }
            
            .music-controls .settings-btn {
                min-width: 48px;
                min-height: 48px;
                padding: 10px;
            }
            
            /* Main control buttons */
            .controls .btn {
                padding: 16px 24px;
                font-size: 1.1em;
                min-height: 48px;
                min-width: 140px;
            }
            
            /* Top bar adjustments */
            .top-bar {
                padding: 10px 12px;
                gap: 10px;
            }
            
            .stat-display {
                font-size: 0.95em;
                padding: 8px 12px;
            }
            
            /* Achievement button */
            .achievements-compact {
                padding: 10px 14px;
                min-height: 44px;
            }
            
            /* Welcome buttons - already good but ensure consistency */
            .welcome-btn {
                min-height: 56px;
                padding: 18px 40px;
            }
        }
        
        @media (max-width: 768px) {
            /* Achievement toasts ajustados para mobile */
            .achievement-toast {
                right: 10px !important;
                left: 10px !important;
                min-width: auto !important;
                max-width: calc(100vw - 20px) !important;
            }
            
            .card {
                width: 100px;
                height: 140px;
            }
            .card-value { font-size: 2.2em; }
            .card-suit { font-size: 1.8em; }
            .empty-slot { width: 100px; height: 140px; }
            
            .controls .btn { padding: 15px 20px; font-size: 1em; }
            
            .bottom-bar {
                min-height: 170px;
                padding: 15px;
                gap: 10px;
            }
        }
        
        @media (max-width: 500px) {
            .stats-group {
                gap: 10px;
            }
            .stat-display {
                gap: 5px;
                font-size: 0.9em;
            }
            .settings-btn {
                padding: 6px 8px;
                font-size: 0.8em;
            }
            .top-bar {
                padding: 10px;
                flex-wrap: wrap; /* Allows wrapping */
                justify-content: center;
            }
            
            .card {
                width: 75px;
                height: 110px;
            }
            .card-value { font-size: 1.8em; }
            .card-suit { font-size: 1.5em; }
            .empty-slot { width: 75px; height: 110px; font-size: 0.7em; }
            
            .bottom-bar {
                min-height: 140px;
                padding: 10px;
                gap: 8px;
            }
            .controls .btn { font-size: 0.9em; }
            
            .game-over-content { padding: 20px; }
        }
        
        /* * =========================================
         * ACHIEVEMENTS MODAL
         * =========================================
        */
        .achievements-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 15px;
            padding: 10px;
            max-height: 500px;
            overflow-y: auto;
        }
        .achievement-card {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 10px;
            padding: 15px;
            border-left: 4px solid;
            transition: all 0.3s;
            position: relative;
        }
        .achievement-card.bronze { border-left-color: #cd7f32; }
        .achievement-card.silver { border-left-color: #c0c0c0; }
        .achievement-card.gold { border-left-color: #ffd700; }
        .achievement-card.platinum { border-left-color: #e5e4e2; box-shadow: 0 0 15px rgba(255,255,255,0.3); }
        .achievement-card.locked {
            filter: grayscale(100%);
            opacity: 0.5;
        }
        .achievement-card.secret.locked .achievement-description {
            display: none;
        }
        .achievement-card.secret.locked::after {
            content: "🔒 SECRET";
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 1.5em;
            color: #666;
        }
        .achievement-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
        }
        .achievement-medal {
            font-size: 24px;
        }
        .achievement-title {
            font-weight: bold;
            font-size: 1.1em;
        }
        .achievement-description {
            color: #aaa;
            font-size: 0.9em;
            line-height: 1.4;
        }
        .achievement-requirement {
            margin-top: 8px;
            color: #666;
            font-size: 0.8em;
            font-style: italic;
        }
        .achievement-progress {
            margin-top: 10px;
            background: rgba(0,0,0,0.3);
            height: 6px;
            border-radius: 3px;
            overflow: hidden;
        }
        .achievement-progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #4ecdc4, #44a08d);
            transition: width 0.5s ease;
        }
        
        /* HP CRITICAL WARNING */
        body.hp-critical::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            pointer-events: none;
            z-index: 9998;
            background: transparent;
            border: 8px solid #ff6b6b;
            animation: hpCriticalPulse 1s infinite;
        }
        
        /* ORIENTATION WARNING - Portrait Mode */
        .orientation-warning {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.95);
            z-index: 99999;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 30px;
            text-align: center;
        }
        
        .orientation-warning.active {
            display: flex;
        }
        
        .orientation-warning-icon {
            font-size: 6em;
            margin-bottom: 20px;
            animation: rotatePhone 2s ease-in-out infinite;
        }
        
        @keyframes rotatePhone {
            0%, 100% { transform: rotate(0deg); }
            50% { transform: rotate(90deg); }
        }
        
        .orientation-warning h2 {
            font-family: 'Cinzel Decorative', serif;
            color: #ffd700;
            font-size: 2em;
            margin-bottom: 15px;
        }
        
        .orientation-warning p {
            color: #e8d5b5;
            font-size: 1.2em;
            max-width: 400px;
            line-height: 1.6;
        }
        
        @keyframes hpCriticalPulse {
            0%, 100% { 
                border-color: rgba(255, 107, 107, 0.3);
                box-shadow: inset 0 0 50px rgba(255, 107, 107, 0.2);
            }
            50% { 
                border-color: rgba(255, 107, 107, 0.8);
                box-shadow: inset 0 0 100px rgba(255, 107, 107, 0.4);
            }
        }
        
        /* ============================================
         * MOBILE RESPONSIVENESS
         * ============================================ */
        
        /* ============================================
         * MOBILE PORTRAIT - Layout Vertical Otimizado
         * Stack vertical: Top bar → Center → Cards → Controls
         * ============================================ */
        @media screen and (max-width: 768px) and (orientation: portrait) {
            .welcome-screen h1 {
                font-size: clamp(1.8em, 10vw, 3em);
                line-height: 1.1;
            }
            
            .welcome-buttons {
                width: 95%;
            }
            
            /* Top bar mais compacto */
            .top-bar {
                padding: 8px 10px;
                min-height: 50px;
                flex-wrap: wrap;
                gap: 8px;
                justify-content: space-between;
            }
            
            .stats-group {
                flex: 1;
                min-width: 200px;
                justify-content: flex-start;
            }
            
            .settings-group {
                justify-content: flex-end;
            }
            
            .achievements-compact {
                order: 3;
                width: 100%;
                justify-content: center;
            }
            
            /* Ocultar sidebars em portrait */
            .left-sidebar,
            .right-sidebar {
                display: none;
            }
            
            /* Center area ocupa toda largura */
            .center-area {
                margin: 0;
                padding: 10px;
                width: 100%;
                height: auto;
                min-height: calc(50vh - 100px);
                max-height: calc(50vh - 100px);
            }
            
            .center-stage {
                height: 100%;
                justify-content: flex-start;
                gap: 10px;
            }
            
            /* Score visível no centro */
            .score-display {
                padding: 8px 15px;
            }
            
            .score-value {
                font-size: 2.5em;
            }
            
            /* Weapon visível no centro */
            #center-stage-weapon {
                display: flex;
                margin: 10px 0;
            }
            
            .center-stage-label {
                font-size: 0.85em;
            }
            
            /* Cards GRANDES em portrait também */
            .card {
                width: 85px;
                height: 120px;
            }
            
            .card-value {
                font-size: 2em;
            }
            
            .card-suit {
                font-size: 1.6em;
            }
            
            /* Bottom bar - Cards Room */
            .bottom-bar {
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                padding: 12px;
                gap: 12px;
                min-height: 160px;
                max-height: 160px;
                background: linear-gradient(180deg, rgba(44, 36, 22, 0.95) 0%, rgba(61, 40, 23, 0.98) 100%);
                border-top: 3px solid #d4af37;
                box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
            }
            
            /* Controls acima do bottom bar */
            .controls {
                position: fixed;
                bottom: 165px;
                left: 0;
                right: 0;
                padding: 10px;
                background: rgba(0, 0, 0, 0.3);
                border-top: 2px solid rgba(212, 175, 55, 0.3);
                z-index: 99;
                gap: 10px;
            }
            
            .btn {
                flex: 1;
                min-width: 140px;
                padding: 12px 16px;
                font-size: 0.9em;
            }
            
            /* Message area no topo do center */
            #messageArea {
                position: relative;
                top: 0;
                width: 100%;
                margin-bottom: 10px;
            }
            
            /* Relics, hold, etc no centro quando necessário */
            .relic-item {
                font-size: 0.8em;
                padding: 6px 8px;
            }
        }
        
        /* ============================================
         * MOBILE LANDSCAPE - BALATRO STYLE REDESIGN
         * Cards GRANDES no centro, sidebars compactas mas legíveis
         * ============================================ */
        @media screen and (max-height: 500px) and (orientation: landscape) {
            
            /* LEFT SIDEBAR - Relics, Shop, Timer (estilo Balatro) */
            .left-sidebar {
                position: fixed;
                left: 0;
                top: 45px;
                width: 160px;
                min-width: 160px;
                max-width: 160px;
                height: calc(100vh - 45px);
                padding: 8px;
                overflow-y: auto;
                background: rgba(0, 0, 0, 0.4);
                border-right: 2px solid rgba(212, 175, 55, 0.3);
                display: flex;
                flex-direction: column;
                gap: 10px;
            }
            
            .left-sidebar h3 {
                font-size: 0.75em;
                writing-mode: horizontal-tb;
                text-orientation: initial;
                margin: 0;
                padding: 4px 0;
                text-align: center;
                border-bottom: 1px solid rgba(212, 175, 55, 0.3);
            }
            
            /* RIGHT SIDEBAR - Weapon, Held Card, Score */
            .right-sidebar {
                position: fixed;
                right: 0;
                top: 45px;
                width: 160px;
                min-width: 160px;
                max-width: 160px;
                height: calc(100vh - 45px);
                padding: 8px;
                background: rgba(0, 0, 0, 0.4);
                border-left: 2px solid rgba(212, 175, 55, 0.3);
                display: flex;
                flex-direction: column;
                gap: 10px;
                align-items: center;
            }
            
            .right-sidebar .sidebar-label {
                font-size: 0.75em;
                writing-mode: horizontal-tb;
                text-orientation: initial;
                text-align: center;
            }
            
            /* Center area - espaço entre sidebars (160px cada) */
            .center-area {
                margin: 0 165px;
                padding: 8px 10px;
                height: calc(100vh - 45px - 180px);
                display: flex;
                flex-direction: column;
                justify-content: center;
                gap: 10px;
            }
            
            .center-stage {
                flex: 1;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                gap: 8px;
            }
            
            /* Score compacto mas visível */
            .score-display {
                padding: 6px 12px;
                margin: 0 auto;
            }
            
            .score-label {
                font-size: 0.65em;
                letter-spacing: 1px;
            }
            
            .score-value {
                font-size: 2em;
                line-height: 1;
            }
            
            /* Weapon movido para RIGHT SIDEBAR */
            #center-stage-weapon {
                display: none;
            }
            
            .center-stage-label {
                font-size: 0.7em;
                margin-bottom: 4px;
            }
            
            /* Shop button horizontal normal */
            .btn-shop {
                padding: 8px 12px;
                font-size: 0.75em;
                writing-mode: horizontal-tb;
                width: 100%;
            }
            
            /* Relics display super compacto */
            #relicsList {
                display: flex;
                flex-direction: column;
                gap: 3px;
                max-height: 100%;
                overflow-y: auto;
            }
            
            /* Hold area */
            .hold-area {
                width: 100%;
                margin: auto 0;
            }
            
            #holdAreaContainer {
                padding: 5px;
                width: 100%;
            }
            
            .empty-slot {
                font-size: 0.65em;
                padding: 8px 5px;
                line-height: 1.3;
            }
            
            /* Discard pile oculto */
            #discardPilePreview {
                display: none;
            }
            
            .sidebar-timer {
                font-size: 0.75em;
                padding: 5px;
                margin-top: auto;
            }
            
            /* Top bar COMPACTO mas funcional */
            .top-bar {
                padding: 5px 10px;
                min-height: 40px;
                max-height: 40px;
                background: rgba(0, 0, 0, 0.6);
            }
            
            .stats-group {
                gap: 10px;
            }
            
            .stat-display {
                font-size: 0.85em;
                gap: 4px;
                padding: 4px 8px;
            }
            
            .stat-icon {
                font-size: 1.1em;
            }
            
            .settings-group {
                gap: 6px;
            }
            
            .settings-btn {
                min-width: 36px;
                min-height: 36px;
                width: 36px;
                height: 36px;
                font-size: 0.95em;
                padding: 0;
            }
            
            .music-controls {
                gap: 2px;
            }
            
            .music-controls .settings-btn {
                min-width: 36px;
                min-height: 36px;
            }
            
            .achievements-compact {
                padding: 6px 10px;
                font-size: 0.85em;
            }
            
            .sidebar-label {
                font-size: 0.8em;
                padding: 4px;
                margin-bottom: 5px;
            }
            
            /* ====== CARDS GRANDES (estilo Balatro) ====== */
            .card {
                width: 95px;
                height: 135px;
            }
            
            .card-value {
                font-size: 2.2em;
            }
            
            .card-suit {
                font-size: 1.8em;
            }
            
            .mini-card {
                width: 60px;
                height: 30px;
                font-size: 0.85em;
            }
            
            /* Relic items compactos */
            .relic-item {
                padding: 5px 6px;
                font-size: 0.75em;
            }
            
            .relic-name {
                font-size: 0.85em;
            }
            
            .relic-effect {
                font-size: 0.75em;
            }
            
            /* Bottom bar: CARDS ROOM - Espaço amplo */
            .bottom-bar {
                position: fixed;
                bottom: 0;
                left: 165px;
                right: 165px;
                padding: 10px;
                gap: 12px;
                min-height: 175px;
                max-height: 175px;
                background: linear-gradient(180deg, rgba(44, 36, 22, 0.95) 0%, rgba(61, 40, 23, 0.98) 100%);
                border-top: 3px solid #d4af37;
                display: flex;
                justify-content: center;
                align-items: center;
                flex-wrap: wrap;
                z-index: 100;
                box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
            }
            
            /* Controles NO CENTER-STAGE */
            .controls {
                display: flex;
                gap: 10px;
                justify-content: center;
                margin: 10px auto;
                flex-wrap: wrap;
                z-index: 50;
            }
            
            .btn {
                padding: 10px 20px;
                font-size: 0.85em;
                letter-spacing: 1px;
                white-space: nowrap;
                min-width: 120px;
                min-height: 42px;
                font-weight: 600;
            }
            
            /* Message area */
            #messageArea {
                min-height: 30px;
                font-size: 0.8em;
                padding: 5px;
                margin-bottom: 5px;
            }
            
            /* Game wrapper recalculado */
            .game-wrapper {
                padding-bottom: 0;
            }
            
            /* Main content ajustado para novo layout */
            .main-content {
                height: calc(100vh - 40px);
            }
            
            /* Center area altura ajustada (40px top + 175px bottom) */
            .center-area {
                margin: 0 165px;
                padding: 8px 10px;
                height: calc(100vh - 40px - 175px);
            }
        }
        
        /* Extra Compact Mobile Landscape (height < 420px) */
        @media screen and (max-height: 420px) and (orientation: landscape) {
            .top-bar {
                min-height: 36px;
                max-height: 36px;
                padding: 4px 8px;
            }
            
            .stat-display {
                font-size: 0.75em;
                padding: 3px 6px;
            }
            
            .settings-btn {
                min-width: 32px;
                min-height: 32px;
                width: 32px;
                height: 32px;
                font-size: 0.85em;
            }
            
            .music-controls .settings-btn {
                min-width: 32px;
                min-height: 32px;
            }
            
            /* Sidebars mais estreitas */
            .left-sidebar,
            .right-sidebar {
                top: 36px;
                width: 130px;
                min-width: 130px;
                max-width: 130px;
                height: calc(100vh - 36px);
                padding: 6px;
            }
            
            .center-area {
                margin: 0 135px;
                height: calc(100vh - 36px - 140px);
                padding: 6px 8px;
            }
            
            /* Cards um pouco menores mas ainda legíveis */
            .card {
                width: 80px;
                height: 115px;
            }
            
            .card-value {
                font-size: 1.9em;
            }
            
            .card-suit {
                font-size: 1.5em;
            }
            
            /* Bottom bar menor */
            .bottom-bar {
                left: 135px;
                right: 135px;
                min-height: 140px;
                max-height: 140px;
                padding: 8px;
                gap: 10px;
            }
            
            .btn {
                padding: 8px 16px;
                font-size: 0.75em;
                min-width: 100px;
                min-height: 36px;
            }
            
            .controls {
                gap: 8px;
                margin: 6px auto;
            }
            
            .score-value {
                font-size: 1.6em;
            }
            
            .score-label {
                font-size: 0.6em;
            }
            
            #messageArea {
                min-height: 25px;
                font-size: 0.7em;
            }
            
            .relic-item {
                padding: 4px 5px;
                font-size: 0.7em;
            }
            
            .sidebar-label {
                font-size: 0.75em;
            }
        }

        /* =========================================
         * SPECIAL ANIMATIONS FOR MOTIVATIONAL MODALS
         * ========================================= */
        
        @keyframes gentlePulse {
            0%, 100% {
                box-shadow: 0 0 20px rgba(255, 215, 0, 0.3),
                           0 0 40px rgba(107, 207, 127, 0.2),
                           inset 0 0 20px rgba(255, 215, 0, 0.1);
            }
            50% {
                box-shadow: 0 0 30px rgba(255, 215, 0, 0.5),
                           0 0 60px rgba(107, 207, 127, 0.3),
                           inset 0 0 30px rgba(255, 215, 0, 0.15);
            }
        }
        
        @keyframes goldenGlow {
            0%, 100% {
                box-shadow: 0 0 25px rgba(255, 215, 0, 0.4),
                           0 0 50px rgba(212, 175, 55, 0.3),
                           0 0 75px rgba(78, 205, 196, 0.2),
                           inset 0 0 25px rgba(255, 215, 0, 0.1);
            }
            50% {
                box-shadow: 0 0 40px rgba(255, 215, 0, 0.6),
                           0 0 80px rgba(212, 175, 55, 0.5),
                           0 0 120px rgba(78, 205, 196, 0.3),
                           inset 0 0 40px rgba(255, 215, 0, 0.2);
            }
        }