        /* CSS Variables for new design */
        :root {
            --primary: #667eea;
            --primary-dark: #5a67d8;
            --secondary: #764ba2;
            --accent: #ffd700;
            --bg-dark: #0a0a0f;
            --bg-card: rgba(255, 255, 255, 0.03);
            --bg-card-hover: rgba(255, 255, 255, 0.06);
            --border-subtle: rgba(255, 255, 255, 0.08);
            --border-hover: rgba(102, 126, 234, 0.4);
            --text-primary: #ffffff;
            --text-secondary: #a0aec0;
            --text-muted: #718096;
            --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --gradient-gold: linear-gradient(135deg, #f6e05e 0%, #d69e2e 100%);
            --gradient-campaign: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
            --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
            --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
            --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.2);
            --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.3);
            --radius-sm: 8px;
            --radius-md: 12px;
            --radius-lg: 16px;
            --radius-xl: 24px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
            -webkit-touch-callout: none;
        }

        /* Transiciones específicas con soporte para prefers-reduced-motion */
        @media (prefers-reduced-motion: no-preference) {

            .btn,
            .mode-btn,
            .close-stats,
            .modal,
            .custom-alert,
            #mapImage,
            .next-btn,
            .hint-btn,
            .zoom-btn {
                transition: all 0.2s ease;
            }

            .mode-btn:hover,
            .btn:hover {
                transition: transform 0.2s ease, background 0.2s ease;
            }
        }

        /* Sin animaciones para usuarios que prefieren movimiento reducido */
        @media (prefers-reduced-motion: reduce) {

            *,
            *::before,
            *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
                scroll-behavior: auto !important;
            }
        }

        html {
            background: #1a1a2e;
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: #1a1a2e;
            color: #ffffff;
            overflow: hidden;
            height: 100vh;
            margin: 0;
            padding: 0;
        }

        .game-container {
            height: 100vh;
            display: flex;
            flex-direction: column;
            visibility: hidden;
            padding-bottom: env(safe-area-inset-bottom);
        }

        .game-container.active {
            visibility: visible;
        }

        .header {
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(10px);
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 100;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .logo {
            font-size: 1.3rem;
            font-weight: 700;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            position: relative;
            z-index: 1;
        }

        .header-controls {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            position: relative;
            z-index: 10;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        /* Desktop only - centered question */
        @media (min-width: 769px) {
            .header {
                justify-content: center;
                position: relative;
            }

            .header-controls {
                position: absolute;
                left: 1rem;
                right: 1rem;
                width: auto;
            }
        }

        .audio-toggle {
            display: flex;
            align-items: center;
            gap: 0.2rem;
            background: rgba(255, 255, 255, 0.1);
            padding: 0.3rem 0.5rem;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 1px solid rgba(255, 255, 255, 0.2);
            outline: none;
            -webkit-tap-highlight-color: transparent;
            user-select: none;
        }

        .audio-toggle:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: scale(1.05);
        }

        .audio-toggle:focus {
            outline: none;
            box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.5);
        }

        .audio-toggle:active {
            transform: scale(0.98);
        }

        .audio-toggle.enabled {
            background: rgba(34, 197, 94, 0.3);
            border-color: #22c55e;
        }

        .audio-toggle.disabled {
            background: rgba(239, 68, 68, 0.3);
            border-color: #ef4444;
        }

        .audio-toggle-icon {
            width: 16px;
            height: 16px;
        }

        .audio-toggle-text {
            font-size: 0.75rem;
            font-weight: 500;
        }

        .hint-toggle,
        .menu-btn {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            background: rgba(255, 255, 255, 0.1);
            padding: 0.4rem 0.8rem;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 1px solid rgba(255, 255, 255, 0.2);
            outline: none;
            -webkit-tap-highlight-color: transparent;
            user-select: none;
        }

        .hint-toggle:hover,
        .menu-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: scale(1.05);
        }

        .hint-toggle:focus,
        .menu-btn:focus {
            outline: none;
            box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.5);
        }

        .hint-toggle:active,
        .menu-btn:active {
            transform: scale(0.98);
        }

        .hint-toggle.active {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-color: #667eea;
            box-shadow: 0 0 20px rgba(102, 126, 234, 0.6), 0 0 40px rgba(102, 126, 234, 0.3);
            animation: hintGlow 2s ease-in-out infinite alternate;
        }

        @keyframes hintGlow {
            0% {
                box-shadow: 0 0 20px rgba(102, 126, 234, 0.6), 0 0 40px rgba(102, 126, 234, 0.3);
            }

            100% {
                box-shadow: 0 0 25px rgba(102, 126, 234, 0.8), 0 0 50px rgba(102, 126, 234, 0.4);
            }
        }

        .menu-btn {
            background: rgba(102, 126, 234, 0.2);
            border-color: rgba(102, 126, 234, 0.5);
            margin-left: 0.5rem;
        }

        .menu-btn:hover {
            background: rgba(102, 126, 234, 0.3);
            border-color: #667eea;
            box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
        }

        .hint-toggle-icon,
        .menu-btn-icon {
            width: 16px;
            height: 16px;
        }

        .menu-btn-icon {
            color: #667eea;
        }

        .hint-toggle-text,
        .menu-btn-text {
            font-size: 0.8rem;
            font-weight: 500;
        }

        .menu-btn-text {
            color: #a0b3f0;
        }

        .score-container {
            display: flex;
            gap: 1rem;
            align-items: center;
        }

        .score-item {
            text-align: center;
            line-height: 0.9;
        }

        .score-label {
            font-size: 0.8rem;
            margin-bottom: -6px;
            color: #888;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .score-value {
            font-size: 1.3rem;
            font-weight: bold;
            color: #667eea;
            transition: transform 0.2s ease;
        }

        .score-value.pop {
            animation: scorePop 0.3s ease;
        }

        @keyframes scorePop {
            0% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.3);
            }

            100% {
                transform: scale(1);
            }
        }

        .bonus-indicator {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 3rem;
            font-weight: bold;
            color: #ffd700;
            pointer-events: none;
            opacity: 0;
            animation: bonusFloat 1s ease-out;
        }

        @keyframes bonusFloat {
            0% {
                opacity: 1;
                transform: translate(-50%, -50%) translateY(0);
            }

            100% {
                opacity: 0;
                transform: translate(-50%, -50%) translateY(-50px);
            }
        }

        /* Wrapper per mantenir fons negre visible durant transicions GL (quan #map opacity=0) */
        #mapWrapper {
            flex: 1;
            width: 100%;
            position: relative;
            background: #000;
            display: flex;
        }

        #map {
            flex: 1;
            width: 100%;
            height: 100%;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        #map img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .controls {
            position: fixed;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.9);
            backdrop-filter: blur(20px);
            padding: 0.5rem 1rem 0.25rem 1rem;
            border-radius: 8px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
            z-index: 100;
            width: 80%;
            max-width: 500px;
            animation: slideUp 0.3s ease-out;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateX(-50%) translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateX(-50%) translateY(0);
            }
        }

        .hint-text {
            text-align: center;
            margin-bottom: 0.5rem;
            font-size: 0.85rem;
            color: #ccc;
            min-height: 1em;
            transition: opacity 0.2s ease;
        }

        .hint-text.hidden {
            opacity: 0;
            visibility: hidden;
        }

        .no-hint-message {
            color: #666;
            font-style: italic;
        }

        .bonus-text {
            color: #ffd700;
            font-weight: bold;
        }

        .category-indicator {
            text-align: center;
            font-size: 0.75rem;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.7);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 0.4rem;
            padding: 0.3rem 0.6rem;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 4px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .options-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.5rem;
            margin-bottom: 0;
        }

        .option-btn {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 0.6rem 0.4rem;
            border-radius: 8px;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s ease;
            position: relative;
            overflow: hidden;
        }

        .option-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-2px) scale(1.02);
            box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
        }

        .option-btn:active {
            transform: translateY(0) scale(0.98);
        }

        .option-btn.correct {
            background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
            border-color: #22c55e;
            animation: pulse 0.3s ease;
        }

        .option-btn.incorrect {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            border-color: #dc2626;
            animation: shake 0.3s ease;
        }

        @keyframes pulse {
            0% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.05);
            }

            100% {
                transform: scale(1);
            }
        }

        @keyframes challengePulse {
            0% {
                transform: scale(1);
                box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
            }

            50% {
                transform: scale(1.08);
                box-shadow: 0 6px 25px rgba(102, 126, 234, 0.7), 0 0 30px rgba(102, 126, 234, 0.5);
            }

            100% {
                transform: scale(1);
                box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
            }
        }

        .challenge-highlight {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
            position: relative;
            overflow: visible;
        }


        @keyframes shake {

            0%,
            100% {
                transform: translateX(0);
            }

            25% {
                transform: translateX(-5px);
            }

            75% {
                transform: translateX(5px);
            }
        }

        .next-btn {
            width: 100%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            color: white;
            padding: 0.5rem;
            border-radius: 4px;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s ease;
            display: none;
            margin-top: 0.5rem;
            margin-bottom: 0;
        }

        .next-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
        }

        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #1a1a2e;
            backdrop-filter: blur(20px);
            display: none;
            align-items: flex-start;
            justify-content: center;
            z-index: 1000;
            transition: opacity 0.3s ease;
            overflow-y: auto;
        }

        .modal.welcome {
            z-index: 1000;
            display: flex;
            height: 100vh;
            height: 100dvh;
            padding: 0;
            padding-bottom: env(safe-area-inset-bottom);
            align-items: flex-start !important;
            background: #1a1a2e;
            backdrop-filter: none;
            overflow-y: auto;
        }

        .modal.welcome .modal-content.welcome-content {
            margin-top: 0 !important;
            padding-top: 0 !important;
        }

        .modal.welcome .welcome-header {
            padding: 0.5rem 0 0 0;
            margin-bottom: 0;
        }

        .modal.welcome.hide-on-challenge {
            display: none !important;
        }

        .modal.stats {
            z-index: 1001;
        }

        .modal.confirm {
            z-index: 1002;
        }

        .modal-content {
            text-align: center;
            max-width: 1200px;
            max-height: none;
            padding: 2rem;
            background: none;
            box-shadow: none;
            border-radius: 0;
            width: 90%;
            margin: 0 auto;
            position: relative;
        }

        #infoModal .modal-content {
            max-height: 95vh;
            overflow-y: auto;
            margin: 2.5vh auto;
            background: linear-gradient(180deg, rgba(26, 26, 46, 0.98) 0%, rgba(22, 33, 62, 0.98) 100%);
            border: 1px solid rgba(102, 126, 234, 0.3);
        }

        .info-modal-content {
            padding: 0 1.5rem 1rem;
            text-align: left;
        }

        .info-section {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            padding: 1.25rem;
            margin-bottom: 1rem;
            transition: all 0.3s ease;
        }

        .info-section:hover {
            background: rgba(255, 255, 255, 0.05);
            border-color: rgba(102, 126, 234, 0.3);
        }

        .info-section-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 0.75rem;
        }

        .info-section-icon {
            width: 36px;
            height: 36px;
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
        }

        .info-section-title {
            color: #fff;
            font-size: 1rem;
            font-weight: 600;
            margin: 0;
        }

        .info-section-content {
            color: rgba(255, 255, 255, 0.7);
            font-size: 0.9rem;
            line-height: 1.6;
        }

        .info-section-content ul {
            margin: 0;
            padding-left: 1.25rem;
        }

        .info-section-content li {
            margin-bottom: 0.4rem;
        }

        .info-section-content li:last-child {
            margin-bottom: 0;
        }

        .info-tip-box {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
            border: 1px solid rgba(102, 126, 234, 0.4);
            border-radius: 12px;
            padding: 1.25rem;
            margin-top: 0.5rem;
        }

        .info-tip-box .info-section-header {
            margin-bottom: 0.5rem;
        }

        .info-tip-box .info-section-content {
            color: rgba(255, 255, 255, 0.85);
        }

        .welcome-content {
            background: none;
            border: none;
            padding-top: 0;
            margin-top: 0;
        }

        .welcome-content h1 {
            font-size: 3rem;
            margin-bottom: 1rem;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .welcome-content p {
            font-size: 1.2rem;
            color: #ccc;
            margin-bottom: 1.2rem;
            line-height: 1.6;
        }

        .game-mode-selector {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
            margin-bottom: 1.2rem;
            max-width: 100%;
            margin-left: auto;
            margin-right: auto;
        }

        .mode-btn {
            background: transparent;
            border: none;
            color: white;
            padding: 1rem;
            padding-bottom: 0.75rem;
            border-radius: 0;
            font-size: 0.9rem;
            font-weight: normal;
            cursor: default;
            transition: none;
            pointer-events: none;
            display: flex;
            flex-direction: column;
        }

        .mode-btn>div {
            font-weight: normal;
        }

        /* Classic Mode Cards */
        .classic-mode-card {
            background: rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            overflow: hidden;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            cursor: pointer;
            position: relative;
        }

        .classic-mode-card:hover {
            transform: translateY(-8px);
            border-color: rgba(102, 126, 234, 0.5);
        }

        .classic-mode-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
            opacity: 0;
            transition: opacity 0.4s ease;
            pointer-events: none;
        }

        .classic-mode-card:hover::before {
            opacity: 1;
        }

        .classic-mode-card:hover img {
            transform: scale(1.1);
        }

        .mode-play-btn-card {
            /* iOS Safari fix */
            touch-action: manipulation;
            -webkit-user-select: none;
            user-select: none;
            cursor: pointer;
        }

        .mode-play-btn-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
        }

        .mode-btn-wrapper {
            background: rgba(255, 255, 255, 0.1);
            border: 2px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            overflow: hidden;
            transition: all 0.2s ease;
        }

        .mode-btn-wrapper:hover {
            border-color: rgba(102, 126, 234, 0.5);
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
        }

        .mode-play-btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            border-top: 2px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 0.75rem 1.5rem;
            border-radius: 0;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            width: 100%;
            margin: 0;
        }

        .mode-play-btn:hover {
            background: linear-gradient(135deg, #7c8ef5 0%, #8b5bb8 100%);
        }

        .mode-icon {
            width: 100%;
            height: 140px;
            margin-bottom: 0.5rem;
            overflow: hidden;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .mode-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .btn {
            border: none;
            color: white;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
            font-weight: 500;
            outline: none;
            -webkit-tap-highlight-color: transparent;
            /* iOS Safari fix */
            touch-action: manipulation;
            -webkit-user-select: none;
            user-select: none;
        }

        .btn:focus {
            outline: none;
            box-shadow: none;
        }

        .btn:active {
            outline: none;
            box-shadow: none;
        }

        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            padding: 1rem 3rem;
            font-size: 1.2rem;
        }

        .btn-secondary {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            padding: 0.5rem 1.5rem;
            font-size: 1rem;
            margin-top: 1rem;
            outline: none;
            -webkit-tap-highlight-color: transparent;
        }

        .btn-secondary:focus {
            outline: none;
            box-shadow: none;
        }

        .btn-secondary:active {
            outline: none;
            box-shadow: none;
        }

        .btn:hover:not(:disabled) {
            transform: translateY(-2px);
        }

        .btn-primary:hover:not(:disabled) {
            box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
        }

        .btn-secondary:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .btn-challenge {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            padding: 0.5rem 1.5rem;
            font-size: 1rem;
        }

        .btn-ranking {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            padding: 0.5rem 1.5rem;
            font-size: 1rem;
        }

        .btn-challenge:hover:not(:disabled) {
            background: rgba(255, 255, 255, 0.2);
        }

        .btn-ranking:hover:not(:disabled) {
            background: rgba(255, 255, 255, 0.2);
        }

        .challenge-form {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            margin: 2rem 0;
            max-width: 400px;
            margin-left: auto;
            margin-right: auto;
        }

        .challenge-input {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 0.8rem;
            border-radius: 8px;
            font-size: 1rem;
            text-align: center;
            outline: none;
        }

        .challenge-input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        .challenge-input:focus {
            border-color: #667eea;
            box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
        }

        .challenge-code {
            background: rgba(102, 126, 234, 0.2);
            border: 2px solid #667eea;
            padding: 1rem;
            border-radius: 10px;
            font-family: 'Courier New', monospace;
            font-size: 0.9rem;
            font-weight: bold;
            color: #667eea;
            letter-spacing: 0px;
            margin: 1rem 0;
        }

        .challenge-code #challengeCodeText {
            word-break: break-all;
            display: block;
            margin-bottom: 1rem;
            line-height: 1.5;
        }

        .challenge-code-display {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 1rem;
        }

        .copy-button {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            border: none;
            color: white;
            padding: 0.7rem 1.5rem;
            border-radius: 4px;
            cursor: pointer;
            font-size: 1rem;
            transition: all 0.2s ease;
            width: 100%;
        }

        .copy-button:hover {
            transform: translateY(-1px);
            box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
        }

        .ranking-table {
            max-width: 900px;
            margin: 2rem auto;
            border-collapse: collapse;
            width: 100%;
            min-height: auto;
        }

        .ranking-table th,
        .ranking-table td {
            padding: 1rem;
            text-align: left;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .ranking-table th {
            color: #667eea;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 1px;
            font-size: 0.9rem;
        }

        .ranking-table .rank {
            width: 60px;
            text-align: center;
            font-weight: bold;
        }

        .ranking-table .rank.gold {
            color: #ffd700;
        }

        .ranking-table .rank.silver {
            color: #c0c0c0;
        }

        .ranking-table .rank.bronze {
            color: #cd7f32;
        }

        .ranking-table .score {
            text-align: right;
            font-weight: bold;
            color: #667eea;
        }

        .ranking-table .achievements {
            text-align: center;
            font-size: 1rem;
        }

        .ranking-table .badges {
            text-align: center;
            font-size: 1.2rem;
        }

        /* Save Progress Popup */
        .save-progress-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            z-index: 2100;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.3s ease;
        }

        .save-progress-overlay.active {
            display: flex;
        }

        .save-progress-popup {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            border-radius: 20px;
            padding: 2rem;
            max-width: 380px;
            width: 90%;
            text-align: center;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
            animation: scaleIn 0.3s ease;
        }

        .save-progress-icon {
            font-size: 3.5rem;
            margin-bottom: 1rem;
        }

        .save-progress-title {
            font-size: 1.4rem;
            font-weight: 700;
            margin-bottom: 0.75rem;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .save-progress-text {
            font-size: 0.95rem;
            color: #aaa;
            line-height: 1.5;
            margin-bottom: 1.25rem;
        }

        .save-progress-benefits {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            text-align: left;
            padding: 0 1rem;
        }

        .save-progress-benefits span {
            font-size: 0.9rem;
            color: #48bb78;
        }

        .save-progress-buttons {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .save-progress-btn {
            padding: 0.85rem 1.5rem;
            border-radius: 10px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            border: none;
        }

        .save-progress-google {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            background: #fff;
            color: #333;
        }

        .save-progress-google:hover {
            background: #f5f5f5;
            transform: translateY(-2px);
            box-shadow: 0 5px 20px rgba(255, 255, 255, 0.2);
        }

        .save-progress-later {
            background: transparent;
            color: #888;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .save-progress-later:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }

        @media (max-width: 480px) {
            .save-progress-popup {
                padding: 1.25rem;
                margin: 0.75rem;
                max-width: calc(100% - 1.5rem);
                border-radius: 16px;
            }

            .save-progress-icon {
                font-size: 2.5rem;
                margin-bottom: 0.75rem;
            }

            .save-progress-title {
                font-size: 1.15rem;
                margin-bottom: 0.5rem;
            }

            .save-progress-text {
                font-size: 0.85rem;
                margin-bottom: 1rem;
                line-height: 1.4;
            }

            .save-progress-benefits {
                gap: 0.35rem;
                margin-bottom: 1rem;
                padding: 0 0.5rem;
            }

            .save-progress-benefits span {
                font-size: 0.8rem;
            }

            .save-progress-buttons {
                gap: 0.6rem;
            }

            .save-progress-btn {
                padding: 0.75rem 1rem;
                font-size: 0.9rem;
                border-radius: 8px;
            }

            .save-progress-google svg {
                width: 18px;
                height: 18px;
            }
        }

        /* Extra small screens */
        @media (max-width: 360px) {
            .save-progress-popup {
                padding: 1rem;
            }

            .save-progress-icon {
                font-size: 2rem;
            }

            .save-progress-title {
                font-size: 1.05rem;
            }

            .save-progress-text {
                font-size: 0.8rem;
            }

            .save-progress-benefits span {
                font-size: 0.75rem;
            }

            .save-progress-btn {
                padding: 0.65rem 0.85rem;
                font-size: 0.85rem;
            }
        }

        /* Estilos por columna para desktop */
        #rankingModal table th:first-child,
        #rankingModal table td:first-child {
            text-align: center;
            font-weight: bold;
        }

        #rankingModal table th:nth-child(3),
        #rankingModal table td:nth-child(3) {
            text-align: center;
            font-weight: bold;
            color: #667eea;
        }

        #rankingModal table th:nth-child(4),
        #rankingModal table td:nth-child(4),
        #rankingModal table th:nth-child(5),
        #rankingModal table td:nth-child(5),
        #rankingModal table th:nth-child(6),
        #rankingModal table td:nth-child(6) {
            text-align: center;
        }

        .achievement-tooltip {
            position: relative;
            cursor: help;
            display: inline-block;
        }

        .achievement-tooltip:hover::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: 125%;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.95);
            color: white;
            padding: 0.5rem 0.75rem;
            border-radius: 8px;
            font-size: 0.75rem;
            white-space: nowrap;
            z-index: 1000;
            border: 1px solid rgba(102, 126, 234, 0.5);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
        }

        .achievement-tooltip:hover::before {
            content: '';
            position: absolute;
            bottom: 115%;
            left: 50%;
            transform: translateX(-50%);
            border: 6px solid transparent;
            border-top-color: rgba(0, 0, 0, 0.95);
            z-index: 1000;
        }

        .legend-player {
            background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%) !important;
        }

        .grandmaster-player {
            background: linear-gradient(135deg, rgba(138, 43, 226, 0.1) 0%, rgba(138, 43, 226, 0.05) 100%) !important;
        }

        .name-input-section {
            margin: 2rem 0 0.5rem 0;
            padding: 1.5rem 1.5rem 1rem 1.5rem;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .name-input-section h4 {
            margin-bottom: 1rem;
            color: #ffd700;
        }

        .game-over-content {
            text-align: center;
            padding: 2rem;
            max-width: 520px;
        }

        /* Desktop layout for game over - wider and more compact */
        @media (min-width: 768px) {
            .game-over-content {
                max-width: 650px;
                padding: 1.5rem 2.5rem;
            }

            .game-over-content #dailyChallengeShareSection {
                padding: 1rem 1.5rem;
                margin: 0.75rem 0;
            }

            .game-over-content #dailyChallengeShareSection h3 {
                font-size: 1rem;
                margin-bottom: 0.5rem;
            }

            .game-over-content #dailyNameInputSection p {
                margin-bottom: 0.5rem;
                font-size: 0.85rem;
            }

            .game-over-content #dailyNameInputSection input {
                padding: 0.6rem;
                margin-bottom: 0.5rem;
            }

            .game-over-content #dailyRankSection>div {
                padding: 0.5rem;
                margin-bottom: 0.5rem;
            }

            .game-over-content .score-display-container {
                padding: 1rem;
                margin: 0.75rem 0 1rem 0;
            }

            .game-over-content .final-score {
                font-size: 3.5rem;
            }

            .game-over-content .game-over-stats {
                margin: 1rem 0;
                padding: 0.75rem 0;
            }

            .game-over-content .game-over-actions {
                flex-direction: row;
                justify-content: center;
                margin-top: 1rem;
            }

            .game-over-content .game-over-actions .btn-primary {
                padding: 0.75rem 1.5rem;
                font-size: 1rem;
            }

            .game-over-content .game-over-secondary-actions {
                margin-top: 1rem;
            }
        }

        .game-over-content h2 {
            font-size: 2rem;
            margin-bottom: 0.5rem;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            white-space: nowrap;
        }

        .game-over-subtitle {
            font-size: 0.95rem;
            color: rgba(255, 255, 255, 0.7);
            margin-bottom: 1.5rem;
        }

        .score-display-container {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
            border: 1px solid rgba(102, 126, 234, 0.3);
            border-radius: 20px;
            padding: 1.5rem;
            margin: 1rem 0 1.5rem 0;
        }

        .score-label {
            font-size: 0.85rem;
            color: rgba(255, 255, 255, 0.6);
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-bottom: 0.5rem;
        }

        .score-row {
            display: inline-flex;
            align-items: baseline;
            gap: 0.25rem;
        }

        .final-score {
            font-size: 4rem;
            font-weight: 700;
            background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            line-height: 1;
        }

        .score-max {
            font-size: 1.5rem;
            color: rgba(255, 255, 255, 0.5);
        }

        .game-over-stats {
            display: flex;
            justify-content: center;
            gap: 2rem;
            margin: 1.5rem 0;
            padding: 1rem 0;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .game-over-stat {
            display: flex;
            flex-direction: column;
            text-align: center;
        }

        .game-over-stat-value {
            font-size: 1.5rem;
            font-weight: 600;
            color: #fff;
        }

        .game-over-stat-label {
            font-size: 0.75rem;
            color: rgba(255, 255, 255, 0.5);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .bonus-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
            color: #1a1a2e;
            padding: 0.5rem 1rem;
            border-radius: 25px;
            font-weight: 600;
            font-size: 0.9rem;
            margin: 0.5rem 0;
            animation: pulse-glow 2s ease-in-out infinite;
        }

        @keyframes pulse-glow {

            0%,
            100% {
                box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
            }

            50% {
                box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
            }
        }

        .game-over-actions {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            margin-top: 1.5rem;
        }

        .game-over-actions .btn-primary {
            padding: 1rem 2rem;
            font-size: 1.1rem;
            font-weight: 600;
        }

        .game-over-secondary-actions {
            display: flex;
            gap: 0.75rem;
            margin-top: 2rem;
        }

        .game-over-secondary-actions .btn {
            flex: 1;
            padding: 0.75rem 1rem;
            font-size: 0.9rem;
        }

        .stats-header {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 2rem;
            position: relative;
        }

        .stats-title {
            font-size: 2rem;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .stats-title.with-emoji {
            background: none;
            -webkit-text-fill-color: initial;
            -webkit-background-clip: initial;
            background-clip: initial;
            color: #ffffff;
        }

        .close-stats {
            background: none;
            border: none;
            color: #fff;
            font-size: 1.5rem;
            cursor: pointer;
            transition: transform 0.2s ease;
            position: absolute;
            right: 0;
            top: 0;
        }

        .close-stats:hover {
            transform: scale(1.2);
        }

        .stat-row {
            display: flex;
            justify-content: space-between;
            padding: 1rem 2rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            max-width: 500px;
            margin: 0 auto;
        }

        .stat-label {
            color: #ccc;
            font-weight: bold;
            white-space: nowrap;
        }

        .stat-value {
            font-weight: bold;
            color: #667eea;
        }

        .stats-actions {
            margin-top: 2rem;
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
        }

        .confirm-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.95);
            backdrop-filter: blur(20px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1002;
        }

        .confirm-content {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            padding: 2rem;
            max-width: 500px;
            width: 90%;
            text-align: center;
        }

        .confirm-title {
            font-size: 2.5rem;
            margin-bottom: 1rem;
            color: #667eea;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .confirm-message {
            color: #ccc;
            margin-bottom: 2rem;
            line-height: 1.5;
            font-size: 1.1rem;
        }

        .confirm-buttons {
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
        }

        .confirm-btn {
            padding: 1rem 2rem;
            border-radius: 8px;
            border: none;
            font-size: 1.1rem;
            cursor: pointer;
            transition: all 0.2s ease;
            font-weight: 500;
            min-width: 140px;
        }

        .confirm-btn-yes {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            color: white;
        }

        .confirm-btn-yes:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(239, 68, 68, 0.5);
        }

        .confirm-btn-no {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }

        .confirm-btn-no:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
        }

        .custom-alert {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0, 0, 0, 0.95);
            backdrop-filter: blur(20px);
            border: 2px solid rgba(102, 126, 234, 0.5);
            border-radius: 8px;
            padding: 2rem;
            max-width: 400px;
            width: 90%;
            z-index: 10000;
            display: none;
            text-align: center;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
        }

        .custom-alert.show {
            display: block;
            animation: alertSlideIn 0.3s ease-out;
        }

        @keyframes alertSlideIn {
            from {
                opacity: 0;
                transform: translate(-50%, -50%) scale(0.9);
            }

            to {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1);
            }
        }

        .alert-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 9999;
            display: none;
        }

        .alert-overlay.show {
            display: block;
        }

        .custom-alert-title {
            font-size: 1.5rem;
            margin-bottom: 1rem;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            font-weight: bold;
        }

        .custom-alert-title.with-emoji {
            background: none;
            -webkit-text-fill-color: initial;
            -webkit-background-clip: initial;
            background-clip: initial;
            color: #ffffff;
        }

        .custom-alert-message {
            color: #ccc;
            line-height: 1.6;
            margin-bottom: 1.5rem;
            font-size: 1rem;
        }

        .custom-alert-button {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 0.8rem 2rem;
            border-radius: 8px;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.2s ease;
            font-weight: 500;
        }

        .custom-alert-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
        }

        .custom-alert.error .custom-alert-title {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .custom-alert.success .custom-alert-title {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }



        /* Global Subtitle Style */
        #gameSubtitle {
            font-size: 1rem;
            color: var(--text-secondary);
            margin-bottom: 1.25rem;
            font-weight: 400;
            letter-spacing: 2px;
            text-transform: uppercase;
        }

        /* MOBILE OPTIMIZATIONS */

        @media (max-width: 768px) and (min-width: 400px) {
            .mode-icon {
                height: 120px;
            }

            .mode-btn {
                min-height: 165px;
            }
        }

        @media (max-width: 768px) {
            @keyframes slideUp {
                from {
                    opacity: 0;
                    transform: translateY(20px);
                }

                to {
                    opacity: 1;
                    transform: translateY(0);
                }
            }

            .controls {
                bottom: 0;
                padding: 0.5rem 1rem 0.75rem 1rem;
                display: flex;
                flex-direction: column;
                gap: 0;
                width: 100%;
                max-width: none;
                border-radius: 0;
                left: 0;
                transform: none;
            }

            .hint-text {
                font-size: 0.85rem;
                margin-bottom: 0 !important;
            }

            .options-grid {
                gap: 0.5rem;
                margin-bottom: 0;
            }

            .option-btn {
                padding: 0.75rem 0.5rem;
                font-size: 0.9rem;
                border-radius: 8px;
            }

            .next-btn {
                padding: 0.75rem;
                font-size: 1rem;
                border-radius: 8px;
                margin-top: 0.5rem;
            }

            .header {
                padding: 0.35rem 0.75rem;
                flex-direction: column-reverse;
                gap: 0.3rem;
            }

            .logo {
                font-size: 0.95rem;
                text-align: center;
            }

            .header-controls {
                width: 100%;
                justify-content: space-between;
            }

            .header-left {
                gap: 0.4rem;
            }

            .header-right {
                gap: 0.5rem;
            }

            .hint-toggle,
            .menu-btn {
                padding: 0.35rem 0.7rem;
            }

            .hint-toggle-text {
                font-size: 0.75rem;
            }

            .hint-toggle-icon {
                width: 16px;
                height: 16px;
            }

            .menu-btn {
                margin-left: 0;
            }

            .menu-btn-text {
                display: none;
            }

            .score-container {
                gap: 0.5rem;
            }

            .score-label {
                font-size: 0.6rem;
            }

            .score-value {
                font-size: 0.95rem;
            }

            .audio-toggle {
                padding: 0.25rem;
            }

            .audio-toggle-icon {
                width: 14px;
                height: 14px;
            }

            .hint-toggle,
            .menu-btn {
                padding: 0.25rem 0.5rem;
            }

            .hint-toggle-icon,
            .menu-btn-icon {
                width: 14px;
                height: 14px;
            }

            /* Featured Cards Mobile Optimizations */
            #classicModeBox,
            #dailyChallengeBox,
            .campaign-card,
            #duelModeBox {
                padding: 1rem !important;
            }

            #classicModeBox h3,
            #dailyChallengeBox h3,
            .campaign-card h3,
            #duelModeBox h3 {
                font-size: 1.2rem !important;
            }

            #classicModeBox p,
            #dailyChallengeBox p,
            .campaign-card p,
            #duelModeBox p {
                font-size: 0.8rem !important;
            }



            #classicModesPreview {
                grid-template-columns: repeat(3, 1fr) !important;
                gap: 0.4rem !important;
            }

            .mode-preview-item span {
                font-size: 0.55rem !important;
                padding: 0.4rem 0.1rem 0.25rem !important;
                letter-spacing: 0.2px !important;
                line-height: 1.15 !important;
            }

            #expandClassicModesBtn {
                font-size: 0.9rem !important;
                padding: 0.6rem 1rem !important;
            }

            #classicModesExpanded {
                margin-top: 1rem !important;
            }

            #classicModesExpanded>div:first-child {
                margin-bottom: 1rem !important;
            }

            #collapseClassicModesBtn {
                font-size: 0.85rem !important;
                padding: 0.6rem !important;
            }

            #classicModesExpanded>div:last-child {
                grid-template-columns: 1fr !important;
                gap: 1rem !important;
            }

            .classic-mode-card {
                margin-bottom: 0 !important;
            }

            .classic-mode-card h3 {
                font-size: 1.1rem !important;
            }


            .classic-mode-card>div:first-child {
                height: 140px !important;
            }

            .classic-mode-card>div:last-child {
                padding: 1rem !important;
            }

            .mode-play-btn-card {
                padding: 0.6rem !important;
                font-size: 0.9rem !important;
            }

            .welcome-content h1 {
                font-size: 2rem !important;
                margin-top: -1rem;
            }



            .game-mode-selector {
                grid-template-columns: repeat(2, 1fr);
                gap: 0.5rem;
                margin-bottom: 0.8rem;
            }

            .mode-btn {
                padding: 0.4rem;
                font-size: 0.80rem;
            }

            .mode-icon {
                height: 100px;
                margin-bottom: 0.3rem;
            }

            .btn-primary {
                padding: 0.8rem 2rem;
                font-size: 1.1rem;
            }

            .btn-challenge,
            .btn-ranking {
                padding: 0.7rem 1.5rem;
                font-size: 1rem;
            }

            /* Tabla de rankings compacta en mobile */
            #rankingModal table {
                width: 100%;
                font-size: 0.6rem;
            }

            #rankingModal table th:first-child,
            #rankingModal table td:first-child {
                padding: 0;
                width: 12px;
                text-align: center;
                font-size: 0.55rem;
                line-height: 1;
            }

            #rankingModal table th:nth-child(2),
            #rankingModal table td:nth-child(2) {
                padding: 0.25rem 0.15rem;
                width: auto;
                min-width: 50px;
                max-width: 75px;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            #rankingModal table th:nth-child(3),
            #rankingModal table td:nth-child(3) {
                padding: 0.2rem 0;
                width: 20px;
                text-align: center;
                font-size: 0.6rem;
            }

            #rankingModal table th:nth-child(4),
            #rankingModal table td:nth-child(4) {
                padding: 0.2rem 0;
                width: 15px;
                text-align: center;
            }

            #rankingModal table th:nth-child(5),
            #rankingModal table td:nth-child(5) {
                padding: 0.2rem 0;
                width: 15px;
                text-align: center;
            }

            #rankingModal table th:nth-child(6),
            #rankingModal table td:nth-child(6) {
                padding: 0.2rem 0;
                width: 16px;
                text-align: center;
            }

            /* Botones de modo más pequeños en mobile */
            #rankingModal button[onclick*="switchRankingMode"] {
                padding: 0.35rem 0.6rem !important;
                font-size: 0.75rem !important;
                border-radius: 5px !important;
            }

            /* Leyenda más compacta en mobile */
            .ranking-legend {
                padding: 0.75rem !important;
                font-size: 0.75rem !important;
            }

            .ranking-legend h4 {
                font-size: 0.85rem !important;
                margin-bottom: 0.5rem !important;
            }

            .ranking-legend>div {
                grid-template-columns: 1fr !important;
                gap: 0.5rem !important;
            }

            .legend-item {
                gap: 0.4rem !important;
                font-size: 0.75rem !important;
                align-items: flex-start !important;
                width: 100% !important;
            }

            .legend-item span:first-child {
                font-size: 1rem !important;
                min-width: 1.2rem !important;
                flex-shrink: 0;
            }

            #gameSubtitle {
                font-size: 0.60rem !important;
                letter-spacing: 1px !important;
                margin-bottom: 0.8rem !important;
            }
        }

        @media (max-width: 480px) {
            .modal-content {
                padding: 1rem;
                max-height: 90vh;
                overflow-y: auto;
                width: 98%;
                margin: 1vh auto;
                border-radius: 8px;
            }

            /* Profile modal needs full height, not limited by modal-content */
            .modal-content.profile-modal {
                max-height: none;
                min-height: 100vh;
                min-height: 100dvh;
                margin: 0;
                width: 100%;
                border-radius: 0;
            }

            #infoModal .modal-content {
                max-height: 96vh;
                overflow-y: auto;
                padding: 0.75rem;
                padding-bottom: calc(80px + env(safe-area-inset-bottom));
                margin: 2vh auto;
            }

            #infoModal .stats-header {
                margin-bottom: 0.5rem;
                padding: 0.75rem;
            }

            .info-modal-content {
                padding: 0 0.75rem 0.5rem;
            }

            #rankingModal .modal-content {
                padding-bottom: calc(80px + env(safe-area-inset-bottom));
            }

            #statsModal .modal-content {
                padding-bottom: calc(80px + env(safe-area-inset-bottom));
            }

            .info-section {
                padding: 1rem;
                margin-bottom: 0.75rem;
            }

            .info-section-icon {
                width: 32px;
                height: 32px;
                font-size: 1rem;
            }

            .info-section-title {
                font-size: 0.9rem;
            }

            .info-section-content {
                font-size: 0.85rem;
                line-height: 1.5;
            }

            .info-section-content ul {
                padding-left: 1.1rem;
            }

            .info-tip-box {
                padding: 1rem;
            }

            .stats-header {
                margin-bottom: 1rem;
                flex-direction: column;
                gap: 1rem;
                align-items: center;
            }

            .stats-title {
                font-size: 1.3rem;
            }

            .close-stats {
                font-size: 1.3rem;
                position: absolute;
                top: 1rem;
                right: 1rem;
            }

            .stat-row {
                padding: 0.6rem 0.5rem;
                font-size: 0.8rem;
                text-align: center;
                max-width: 100%;
            }

            .stat-label {
                font-size: 0.75rem;
            }

            .stat-value {
                font-size: 0.75rem;
                white-space: nowrap;
            }

            /* Achievements breakdown in mobile */
            #statsBody>div[style*="padding: 0.5rem 2rem"] {
                padding: 0.5rem 0.5rem !important;
                max-width: 100% !important;
                font-size: 0.75rem !important;
                line-height: 1.6 !important;
            }

            /* Badge status box in mobile */
            #statsBody>div[style*="background: rgba(102, 126, 234, 0.1)"] {
                max-width: 100% !important;
                padding: 0.75rem !important;
                margin-left: 0.5rem !important;
                margin-right: 0.5rem !important;
                font-size: 0.8rem !important;
            }

            .stats-actions {
                margin-top: 0.75rem;
                gap: 0.5rem;
            }

            .stats-actions .btn {
                padding: 0.65rem 1.2rem;
                font-size: 0.9rem;
                max-width: 100%;
            }

            .welcome-content h1 {
                font-size: 1.8rem;
            }

            .welcome-content p {
                font-size: 0.9rem;
            }

            .game-over-content h2 {
                font-size: 1.5rem;
            }

            .game-over-content {
                padding: 1.25rem;
            }

            .game-over-subtitle {
                font-size: 0.85rem;
                margin-bottom: 1rem;
            }

            .score-display-container {
                padding: 1rem;
                margin: 0.75rem 0 1rem 0;
            }

            .score-label {
                font-size: 0.75rem;
            }

            .final-score {
                font-size: 3rem;
            }

            .score-max {
                font-size: 0.85rem;
            }

            .game-over-stats {
                gap: 1rem;
                margin: 1rem 0;
                padding: 0.75rem 0;
            }

            .game-over-stat-value {
                font-size: 1.2rem;
            }

            .game-over-stat-label {
                font-size: 0.65rem;
            }

            .bonus-badge {
                font-size: 0.8rem;
                padding: 0.4rem 0.8rem;
            }

            .game-over-actions {
                margin-top: 1rem;
                gap: 0.5rem;
            }

            .game-over-actions .btn-primary {
                padding: 0.75rem 1.5rem;
                font-size: 1rem;
            }

            .game-over-secondary-actions {
                gap: 0.5rem;
            }

            .game-over-secondary-actions .btn {
                padding: 0.6rem 0.75rem;
                font-size: 0.8rem;
            }

            .challenge-form {
                max-width: 100%;
                gap: 0.8rem;
            }

            .challenge-input {
                padding: 0.6rem;
                font-size: 0.9rem;
            }

            .achievement-tooltip {
                font-size: 0.65rem;
            }

            .confirm-title {
                font-size: 2rem;
            }

            .confirm-message {
                font-size: 1rem;
            }

            .confirm-content {
                padding: 1.5rem;
                width: 95%;
            }

            .controls {
                bottom: 0;
                padding: 0.75rem 0.75rem 0.25rem 0.75rem;
                border-radius: 0;
                width: 100%;
                left: 0;
                transform: none;
            }

            .hint-text {
                font-size: 0.85rem;
                margin-bottom: 0.75rem;
            }

            .options-grid {
                gap: 0.4rem;
            }

            .option-btn {
                padding: 0.6rem 0.4rem;
                font-size: 0.85rem;
                border-radius: 8px;
            }

            .next-btn {
                padding: 0.6rem;
                font-size: 0.95rem;
            }
        }

        @media (max-height: 600px) and (orientation: landscape) {
            .modal-content {
                max-height: 95vh;
                padding: 1rem;
                overflow-y: auto;
            }

            .stats-header {
                margin-bottom: 0.75rem;
            }

            .stats-title {
                font-size: 1.3rem;
            }

            .stat-row {
                padding: 0.5rem;
                font-size: 0.8rem;
            }

            .stats-actions {
                margin-top: 0.5rem;
                gap: 0.5rem;
            }

            .stats-actions .btn {
                padding: 0.5rem 1rem;
                font-size: 0.85rem;
            }

            .header {
                padding: 0.4rem 0.8rem;
            }

            .logo {
                font-size: 0.95rem;
            }

            .hint-text {
                font-size: 0.85rem;
                margin-bottom: 0.5rem;
                width: 100%;
            }

            .options-grid {
                display: flex;
                gap: 0.5rem;
                margin-bottom: 0;
                flex: 1;
            }

            .option-btn {
                padding: 0.5rem;
                font-size: 0.85rem;
                flex: 1;
            }

            .next-btn {
                padding: 0.5rem 1rem;
                font-size: 0.9rem;
                width: auto;
                margin-left: auto;
            }
        }

        @supports (padding-top: env(safe-area-inset-top)) {
            .header {
                padding-top: calc(0.75rem + env(safe-area-inset-top));
            }

            .controls {
                padding-bottom: calc(1rem + env(safe-area-inset-bottom));
            }
        }

        /* Cookie Consent Banner */
        .cookie-banner {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(10, 10, 10, 0.98);
            backdrop-filter: blur(10px);
            padding: 1.5rem;
            box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
            z-index: 10000;
            border-top: 2px solid rgba(102, 126, 234, 0.3);
            display: none;
            animation: slideUp 0.3s ease-out;
        }

        .cookie-banner.show {
            display: block;
        }

        @keyframes slideUp {
            from {
                transform: translateY(100%);
            }

            to {
                transform: translateY(0);
            }
        }

        .cookie-content {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            gap: 2rem;
            flex-wrap: wrap;
        }

        .cookie-text {
            flex: 1;
            min-width: 250px;
        }

        .cookie-text h3 {
            margin: 0 0 0.5rem 0;
            color: #fff;
            font-size: 1.1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .cookie-text p {
            margin: 0;
            color: #ccc;
            font-size: 0.9rem;
            line-height: 1.5;
        }

        .cookie-text a {
            color: #667eea;
            text-decoration: none;
            transition: opacity 0.2s;
        }

        .cookie-text a:hover {
            opacity: 0.7;
        }

        .cookie-buttons {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .cookie-btn {
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: 8px;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }

        .cookie-btn-accept {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }

        .cookie-btn-accept:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        }

        .cookie-btn-reject {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .cookie-btn-reject:hover {
            background: rgba(255, 255, 255, 0.15);
        }

        @media (max-width: 768px) {
            .cookie-banner {
                padding: 1rem;
            }

            .cookie-content {
                gap: 1rem;
            }

            .cookie-buttons {
                width: 100%;
            }

            .cookie-btn {
                flex: 1;
                min-width: 120px;
            }

            /* Language selector smaller on mobile */
            #languageSelector {
                padding: 0.2rem 0.3rem !important;
                font-size: 0.6rem !important;
                max-width: 75px !important;
            }
        }

        /* ========== NEW DESIGN STYLES ========== */

        /* Background Effects */
        .bg-gradient-new {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background:
                radial-gradient(ellipse at 20% 20%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 50%, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
            pointer-events: none;
            z-index: 0;
        }

        .stars-bg {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-image:
                radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
                radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.2), transparent),
                radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.4), transparent),
                radial-gradient(2px 2px at 160px 120px, rgba(255, 255, 255, 0.2), transparent),
                radial-gradient(1px 1px at 230px 80px, rgba(255, 255, 255, 0.3), transparent);
            background-size: 250px 250px;
            animation: twinkle 8s ease-in-out infinite;
            pointer-events: none;
            z-index: 0;
        }

        @keyframes twinkle {

            0%,
            100% {
                opacity: 0.5;
            }

            50% {
                opacity: 1;
            }
        }

        /* Welcome Header */
        .welcome-header {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            padding: 1rem 0;
            margin-bottom: 0;
            position: relative;
            z-index: 10;
        }

        .welcome-header-actions {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .header-btn-new {
            padding: 0.5rem 1rem;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-sm);
            color: var(--text-secondary);
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .header-btn-new:hover {
            border-color: var(--border-hover);
            color: var(--text-primary);
            background: var(--bg-card-hover);
        }

        /* Featured Cards Grid */
        .featured-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        @media (max-width: 1200px) {
            .featured-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 768px) {
            .featured-grid {
                grid-template-columns: 1fr;
            }
        }

        .featured-grid-full {
            display: block;
            margin-bottom: 1.5rem;
        }

        .featured-card {
            background: var(--bg-card);
            border: 2px solid var(--border-subtle);
            border-radius: var(--radius-xl);
            padding: 1.25rem;
            position: relative;
            overflow: hidden;
            transition: all 0.4s ease;
            display: flex;
            flex-direction: column;
        }

        .featured-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: var(--gradient-primary);
        }

        .featured-card:hover {
            transform: translateY(-4px);
            border-color: var(--border-hover);
            box-shadow: var(--shadow-lg);
        }

        /* Campaign Card */
        .campaign-card::before {
            background: var(--gradient-campaign);
        }

        .campaign-card {
            border-color: rgba(72, 187, 120, 0.3);
        }

        .campaign-card:hover {
            border-color: rgba(72, 187, 120, 0.5);
            box-shadow: 0 8px 30px rgba(72, 187, 120, 0.2);
        }

        /* Daily Challenge Card */
        .daily-card::before {
            background: var(--gradient-gold);
        }

        .daily-card {
            border-color: rgba(246, 224, 94, 0.3);
        }

        .daily-card:hover {
            border-color: rgba(246, 224, 94, 0.5);
            box-shadow: 0 8px 30px rgba(246, 224, 94, 0.2);
        }

        /* Duel Mode Card */
        .duel-card::before {
            background: linear-gradient(135deg, #f56565 0%, #ed8936 100%);
        }

        .duel-card {
            border-color: rgba(245, 101, 101, 0.3);
        }

        .duel-card:hover {
            border-color: rgba(245, 101, 101, 0.5);
            box-shadow: 0 8px 30px rgba(245, 101, 101, 0.2);
        }

        .duel-card .featured-card-icon {
            background: rgba(245, 101, 101, 0.15);
        }

        .duel-card .featured-card-btn {
            background: linear-gradient(135deg, #f56565 0%, #ed8936 100%);
            color: white;
            margin-top: 0;
        }

        .duel-card .featured-card-btn:hover {
            box-shadow: 0 8px 25px rgba(245, 101, 101, 0.4);
        }

        .duel-card .featured-card-features {
            margin-top: auto;
        }

        /* TEMPORAL: Remove when vs Bot is no longer a new feature */
        .duel-new-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            padding: 0.3rem 0.65rem;
            background: linear-gradient(135deg, #f56565 0%, #ed8936 100%);
            border-radius: 50px;
            font-size: 0.75rem;
            font-weight: 700;
            color: white;
            cursor: pointer;
            text-decoration: none;
            box-shadow: 0 2px 10px rgba(245, 101, 101, 0.5);
            animation: duelBadgePulse 2.5s ease-in-out infinite;
            z-index: 2;
            white-space: nowrap;
            min-height: 28px;
            -webkit-tap-highlight-color: transparent;
            touch-action: manipulation;
            user-select: none;
            border: none;
            outline: none;
        }

        .duel-new-badge:hover {
            transform: scale(1.08);
            box-shadow: 0 4px 16px rgba(245, 101, 101, 0.7);
        }

        .duel-new-badge-dot {
            width: 6px;
            height: 6px;
            background: white;
            border-radius: 50%;
            flex-shrink: 0;
            animation: duelDotBlink 2.5s ease-in-out infinite;
        }

        @keyframes duelBadgePulse {
            0%, 100% {
                box-shadow: 0 2px 10px rgba(245, 101, 101, 0.5);
            }
            50% {
                box-shadow: 0 4px 20px rgba(245, 101, 101, 0.85), 0 0 0 4px rgba(245, 101, 101, 0.15);
            }
        }

        @keyframes duelDotBlink {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.3; }
        }

        @media (prefers-reduced-motion: reduce) {
            .duel-new-badge,
            .duel-new-badge-dot {
                animation: none !important;
            }
        }

        @media (max-width: 768px) {
            .duel-new-badge {
                top: 8px;
                right: 8px;
                font-size: 0.65rem;
                padding: 0.25rem 0.5rem;
                min-height: 24px;
                gap: 0.25rem;
            }
            .duel-new-badge-dot {
                width: 5px;
                height: 5px;
            }
        }
        /* END TEMPORAL */

        /* Classic Mode Card */
        .classic-card::before {
            background: var(--gradient-primary);
        }

        .classic-card {
            border-color: rgba(102, 126, 234, 0.3);
        }

        .classic-card:hover {
            border-color: rgba(102, 126, 234, 0.5);
            box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
        }

        .featured-card-header {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            margin-bottom: 1rem;
        }

        .featured-card-icon {
            width: 44px;
            height: 44px;
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.4rem;
            flex-shrink: 0;
        }

        .campaign-card .featured-card-icon {
            background: rgba(72, 187, 120, 0.15);
        }

        .daily-card .featured-card-icon {
            background: rgba(246, 224, 94, 0.15);
        }

        .classic-card .featured-card-icon {
            background: rgba(102, 126, 234, 0.15);
        }

        .featured-card-info h3 {
            font-size: 1.15rem;
            font-weight: 700;
            margin-bottom: 0.15rem;
            text-align: left;
        }

        .featured-card-info p {
            color: var(--text-secondary);
            font-size: 0.8rem;
            text-align: left;
        }

        .featured-card-features {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 0.75rem;
        }

        .feature-tag {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.25rem;
            padding: 0.35rem 0.6rem;
            background: rgba(255, 255, 255, 0.05);
            border-radius: var(--radius-sm);
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

        .featured-card-btn {
            width: 100%;
            padding: 0.7rem;
            border: none;
            border-radius: var(--radius-md);
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            margin-top: auto;
        }

        .campaign-card .featured-card-btn {
            background: var(--gradient-campaign);
            color: white;
        }

        .featured-card-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
        }

        .daily-card .featured-card-btn {
            background: var(--gradient-gold);
            color: #1a1a2e;
        }

        .daily-card .featured-card-btn:hover {
            box-shadow: 0 8px 25px rgba(246, 224, 94, 0.4);
        }

        .classic-card .featured-card-btn {
            background: var(--gradient-primary);
        }

        .classic-card .featured-card-btn:hover {
            box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
        }

        /* Daily Timer */
        .daily-timer {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.4rem;
            padding: 0.5rem;
            background: rgba(246, 224, 94, 0.1);
            border-radius: var(--radius-sm);
            margin-bottom: 0.75rem;
            font-size: 0.8rem;
            color: #d69e2e;
        }

        /* Stats Row */
        .stats-row {
            display: flex;
            gap: 0.75rem;
            margin-top: 0.75rem;
            padding-top: 0.75rem;
            border-top: 1px solid var(--border-subtle);
        }

        .stat-item {
            flex: 1;
            text-align: center;
        }

        .stat-value {
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .stat-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .streak-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.35rem 0.75rem;
            background: linear-gradient(135deg, #f56565 0%, #ed8936 100%);
            border-radius: 50px;
            font-size: 0.8rem;
            font-weight: 600;
            color: white;
        }

        /* Mode Cards Grid */
        .modes-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 0.75rem;
        }

        .mode-card-new {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-sm);
            overflow: hidden;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
        }

        .mode-card-new:hover {
            transform: translateY(-3px);
            border-color: var(--border-hover);
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
        }

        .mode-card-new img {
            width: 100%;
            height: 80px;
            object-fit: cover;
            transition: transform 0.4s ease;
        }

        .mode-card-new:hover img {
            transform: scale(1.08);
        }

        .mode-card-new-content {
            padding: 0.75rem;
            text-align: left;
        }

        .mode-card-new-title {
            font-size: 0.85rem;
            font-weight: 600;
            margin-bottom: 0.15rem;
            line-height: 1.2;
            text-align: left;
        }

        .mode-card-new-play {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.8);
            width: 32px;
            height: 32px;
            background: var(--gradient-primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: all 0.3s ease;
            font-size: 0.8rem;
        }

        .mode-card-new:hover .mode-card-new-play {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }

        /* Bottom Actions */
        .bottom-actions {
            display: flex;
            justify-content: center;
            gap: 0.75rem;
            flex-wrap: wrap;
            margin-top: 1.5rem;
        }

        .action-btn-new {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1.25rem;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md);
            color: var(--text-secondary);
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .action-btn-new:hover {
            border-color: var(--border-hover);
            color: var(--text-primary);
            background: var(--bg-card-hover);
            transform: translateY(-2px);
        }

        /* New Footer */
        .footer-new {
            text-align: center;
            padding: 1.5rem 0;
            margin-top: 2rem;
            border-top: 1px solid var(--border-subtle);
        }

        .footer-links-new {
            display: flex;
            justify-content: center;
            gap: 1.5rem;
            margin-bottom: 0.75rem;
            flex-wrap: wrap;
        }

        .footer-link-new {
            color: var(--text-muted);
            text-decoration: none;
            font-size: 0.8rem;
            transition: color 0.2s ease;
        }

        .footer-link-new:hover {
            color: var(--primary);
        }

        .footer-instagram {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
        }

        .footer-instagram:hover {
            color: #e1306c;
        }

        .footer-copyright-new {
            color: var(--text-muted);
            font-size: 0.75rem;
            margin-top: 0.5rem;
        }

        .footer-top-row {
            margin-bottom: 0.5rem;
        }

        .footer-top-row .footer-link-new {
            font-size: 1rem;
        }

        .footer-top-row .footer-instagram svg {
            width: 18px;
            height: 18px;
        }

        .footer-bottom-row {
            margin-bottom: 0.5rem;
            gap: 0.5rem;
        }

        .footer-separator {
            color: var(--text-muted);
            font-size: 0.8rem;
        }

        /* Ranking Tabs Styles */
        #rankingTabs .profile-tab {
            padding: 0.5rem 1rem;
            border-radius: 10px;
            cursor: pointer;
            font-size: 0.85rem;
            transition: all 0.3s ease;
            background: rgba(255, 255, 255, 0.05);
            color: rgba(255, 255, 255, 0.7);
            border: 2px solid transparent;
        }

        #rankingTabs .ranking-tab-classic {
            border-color: rgba(102, 126, 234, 0.4);
        }

        #rankingTabs .ranking-tab-classic:hover,
        #rankingTabs .ranking-tab-classic.active {
            background: rgba(102, 126, 234, 0.15);
            border-color: #667eea;
            color: #667eea;
        }

        #rankingTabs .ranking-tab-campaign {
            border-color: rgba(72, 187, 120, 0.4);
        }

        #rankingTabs .ranking-tab-campaign:hover,
        #rankingTabs .ranking-tab-campaign.active {
            background: rgba(72, 187, 120, 0.15);
            border-color: #48bb78;
            color: #48bb78;
        }

        #rankingTabs .ranking-tab-daily {
            border-color: rgba(246, 224, 94, 0.4);
        }

        #rankingTabs .ranking-tab-daily:hover,
        #rankingTabs .ranking-tab-daily.active {
            background: rgba(246, 224, 94, 0.15);
            border-color: #f6e05e;
            color: #f6e05e;
        }

        /* Profile Tabs Styles */
        #profileTabs .profile-tab {
            padding: 0.4rem 0.7rem;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.8rem;
            transition: all 0.3s ease;
            background: rgba(255, 255, 255, 0.05);
            color: rgba(255, 255, 255, 0.7);
            border: 2px solid transparent;
        }

        #profileTabs .profile-tab-campaign {
            border-color: rgba(72, 187, 120, 0.4);
        }

        #profileTabs .profile-tab-campaign:hover,
        #profileTabs .profile-tab-campaign.active {
            background: rgba(72, 187, 120, 0.15);
            border-color: #48bb78;
            color: #48bb78;
        }

        #profileTabs .profile-tab-classic {
            border-color: rgba(102, 126, 234, 0.4);
        }

        #profileTabs .profile-tab-classic:hover,
        #profileTabs .profile-tab-classic.active {
            background: rgba(102, 126, 234, 0.15);
            border-color: #667eea;
            color: #667eea;
        }

        #profileTabs .profile-tab-daily {
            border-color: rgba(246, 224, 94, 0.4);
        }

        #profileTabs .profile-tab-daily:hover,
        #profileTabs .profile-tab-daily.active {
            background: rgba(246, 224, 94, 0.15);
            border-color: #f6e05e;
            color: #f6e05e;
        }

        #profileTabs .profile-tab-account {
            border-color: rgba(160, 174, 192, 0.4);
        }

        #profileTabs .profile-tab-account:hover,
        #profileTabs .profile-tab-account.active {
            background: rgba(160, 174, 192, 0.15);
            border-color: #a0aec0;
            color: #a0aec0;
        }

        /* Profile Modal */
        .profile-modal {
            max-width: 1300px;
            width: 95%;
            min-height: 100vh;
            min-height: 100dvh;
            background: linear-gradient(145deg, #0d0d14 0%, #12121a 50%, #0a0a0f 100%);
            border-radius: 16px;
            padding: 2rem;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7);
            border: 1px solid rgba(102, 126, 234, 0.15);
        }

        .profile-modal h2 {
            text-align: center;
            margin-bottom: 1rem;
            font-size: 1.5rem;
        }

        .profile-name {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            font-size: 1.25rem;
            font-weight: 600;
        }

        .edit-name-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 1rem;
            opacity: 0.6;
            transition: opacity 0.2s;
        }

        .edit-name-btn:hover {
            opacity: 1;
        }

        /* Profile Tabs */
        .profile-tabs {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            padding-bottom: 0.5rem;
        }

        .profile-tab {
            flex: 1;
            padding: 0.75rem 0.5rem;
            background: transparent;
            border: none;
            border-radius: var(--radius-sm);
            color: var(--text-muted);
            font-size: 0.8rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.25rem;
        }

        .profile-tab:hover {
            color: var(--text-secondary);
            background: rgba(255, 255, 255, 0.05);
        }

        .profile-tab.active {
            color: var(--text-primary);
            background: rgba(102, 126, 234, 0.15);
            border-bottom: 2px solid var(--primary);
        }

        .profile-tab-icon {
            font-size: 1.25rem;
        }

        .profile-tab-content {
            display: none;
        }

        .profile-tab-content.active {
            display: block;
        }

        .profile-stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .profile-stats-grid.five-cols {
            grid-template-columns: repeat(5, 1fr);
        }

        .profile-stats-grid.six-cols {
            grid-template-columns: repeat(6, 1fr);
        }

        .profile-stat-card {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 1.5rem 1.5rem;
            text-align: center;
            transition: all 0.2s ease;
        }

        .profile-stat-card:hover {
            border-color: rgba(102, 126, 234, 0.4);
            transform: translateY(-2px);
        }

        .profile-stat-icon {
            font-size: 2.5rem;
            margin-bottom: 0.5rem;
        }

        .profile-stat-value {
            font-size: 1.75rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 0.25rem;
        }

        .profile-stat-label {
            font-size: 0.85rem;
            color: #888;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .profile-progress-section {
            background: rgba(255, 255, 255, 0.03);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1rem;
        }

        .profile-progress-section h3 {
            font-size: 0.9rem;
            color: #888;
            margin-bottom: 0.75rem;
            font-weight: 500;
        }

        .profile-progress-bar-container {
            margin-bottom: 0.5rem;
        }

        .profile-progress-label {
            display: flex;
            justify-content: space-between;
            font-size: 0.8rem;
            margin-bottom: 0.5rem;
            color: #a0aec0;
        }

        .profile-progress-bar {
            height: 10px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 5px;
            overflow: hidden;
        }

        .profile-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            border-radius: 5px;
            transition: width 0.5s ease;
        }

        .profile-level-section {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: rgba(102, 126, 234, 0.1);
            border: 1px solid rgba(102, 126, 234, 0.3);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1rem;
        }

        .profile-level-badge {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 700;
            font-size: 1.1rem;
        }

        .profile-level-icon {
            font-size: 1.25rem;
        }

        .profile-xp-info {
            font-size: 0.9rem;
            color: #a0aec0;
        }

        /* Google Sign-In Section */
        .profile-account-section {
            margin-top: 1.5rem;
            padding-top: 1.5rem;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            text-align: center;
        }

        .account-status {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            margin-bottom: 1rem;
            color: #888;
            font-size: 0.9rem;
        }

        .account-status.signed-in {
            color: #48bb78;
        }

        .google-signin-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            width: 100%;
            padding: 0.75rem 1rem;
            background: #fff;
            color: #333;
            border: none;
            border-radius: 8px;
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .google-signin-btn:hover {
            background: #f5f5f5;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .google-signin-btn.signed-in {
            background: rgba(239, 68, 68, 0.1);
            color: #ef4444;
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .google-signin-btn.signed-in:hover {
            background: rgba(239, 68, 68, 0.2);
        }

        .account-benefit {
            margin-top: 0.75rem;
            font-size: 0.8rem;
            color: #666;
        }

        /* Mobile Responsive for new design */
        @media (max-width: 768px) {

            .featured-grid {
                grid-template-columns: 1fr;
            }

            .modes-grid {
                grid-template-columns: repeat(4, 1fr);
                gap: 0.35rem;
            }

            .mode-card-new img {
                height: 50px;
            }

            .mode-card-new-content {
                padding: 0.35rem;
            }

            .mode-card-new-title {
                font-size: 0.6rem;
            }

            .featured-card {
                padding: 0.5rem;
                margin-bottom: 0.5rem;
            }

            .featured-card-header {
                gap: 0.5rem;
                margin-bottom: 0.35rem;
            }

            .featured-card-icon {
                width: 28px;
                height: 28px;
                font-size: 0.9rem;
            }

            .featured-card-info h3 {
                font-size: 0.85rem;
                margin-bottom: 0;
            }

            .featured-card-info p {
                font-size: 0.6rem;
                line-height: 1.1;
                margin-top: 0.1rem;
            }

            .featured-card-features {
                gap: 0.25rem;
                margin-bottom: 0.35rem;
            }

            .feature-tag {
                padding: 0.15rem 0.35rem;
                font-size: 0.6rem;
            }

            .featured-card-btn {
                padding: 0.4rem;
                font-size: 0.75rem;
                min-height: 32px;
            }

            .stats-row {
                gap: 0.25rem;
                flex-wrap: wrap;
                margin-top: 0.35rem;
                padding-top: 0.35rem;
            }

            .stat-value {
                font-size: 0.8rem;
            }

            .stat-label {
                font-size: 0.5rem;
                white-space: nowrap;
            }

            .stat-item {
                min-width: 0;
                padding: 0.25rem;
            }

            .classic-card .stat-label {
                font-size: 0.45rem;
            }

            /* Hide original bottom actions on mobile - replaced by fixed nav */
            .bottom-actions {
                display: none;
            }

            /* Hide Profile button from header on mobile - moved to bottom nav */
            #showProfileBtn {
                display: none;
            }

            .welcome-header-actions {
                gap: 0.5rem;
            }

            .header-btn-new {
                padding: 0.4rem 0.75rem;
                font-size: 0.8rem;
            }

            .header-btn-new span:last-child {
                display: none;
            }

            /* Fixed Bottom Navigation Bar - Mobile Only */
            .mobile-bottom-nav {
                display: flex;
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                background: rgba(26, 26, 46, 0.98);
                backdrop-filter: blur(10px);
                border-top: 1px solid var(--border-subtle);
                padding: 0.5rem 0.25rem;
                padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
                z-index: 1000;
                justify-content: space-around;
                align-items: center;
            }

            .mobile-nav-btn {
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 0.2rem;
                padding: 0.4rem 0.75rem;
                background: transparent;
                border: none;
                color: var(--text-secondary);
                font-size: 0.65rem;
                font-weight: 500;
                cursor: pointer;
                transition: all 0.2s ease;
                min-width: 60px;
            }

            .mobile-nav-btn:active {
                transform: scale(0.95);
            }

            .mobile-nav-btn span:first-child {
                font-size: 1.25rem;
            }

            .mobile-nav-btn:hover,
            .mobile-nav-btn:focus {
                color: var(--primary);
            }

            /* Add padding to welcome content to account for fixed bottom nav */
            .welcome-content {
                padding-bottom: 5rem !important;
            }

            /* Profile tabs responsive */
            #profileTabs .profile-tab {
                padding: 0.3rem 0.5rem;
                font-size: 0.7rem;
            }

            /* Profile modal responsive */
            .profile-stats-grid.five-cols,
            .profile-stats-grid.six-cols {
                grid-template-columns: repeat(3, 1fr);
                gap: 0.5rem;
            }

            .profile-stat-card {
                padding: 0.5rem 0.3rem;
            }

            .profile-stat-icon {
                font-size: 1.25rem;
            }

            .profile-stat-value {
                font-size: 0.9rem;
            }

            .profile-stat-label {
                font-size: 0.6rem;
            }

            /* Quick Play button mobile */
            #quickPlayBtn {
                padding: 0.75rem 1.75rem !important;
                font-size: 1rem !important;
            }

            #quickPlayBtn span:first-child {
                font-size: 1rem !important;
            }

            #quickPlayDesc {
                font-size: 0.8rem !important;
                margin-top: 0.5rem !important;
            }

            /* Header mobile */
            .welcome-header h1 {
                font-size: 2rem !important;
            }

            #gameSubtitle {
                font-size: 0.85rem !important;
                letter-spacing: 1.5px !important;
                margin-bottom: 1rem !important;
            }

            /* Featured grid spacing */
            .featured-grid {
                gap: 0.875rem;
                margin-bottom: 0.875rem;
            }

            /* Daily challenge timer */
            .daily-timer {
                font-size: 0.75rem;
                padding: 0.4rem 0.75rem;
                margin-bottom: 0.75rem;
            }
        }

        @media (max-width: 360px) {
            .modes-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .mode-card-new img {
                height: 65px;
            }

            .mode-card-new-title {
                font-size: 0.7rem;
            }

            /* Extra small screens */
            #quickPlayBtn {
                padding: 0.65rem 1.5rem !important;
                font-size: 0.9rem !important;
            }

            .stat-value {
                font-size: 0.8rem;
            }

            .stat-label {
                font-size: 0.5rem;
            }
        }

        /* Mobile container adjustments */
        @media (max-width: 768px) {
            .welcome-content {
                padding: 0 0.75rem 1.5rem !important;
                min-height: 100vh !important;
                min-height: 100dvh !important;
            }
        }

        @media (max-width: 480px) {
            .welcome-content {
                padding: 0 0.5rem 1rem !important;
                min-height: 100vh !important;
                min-height: 100dvh !important;
            }

            .welcome-header {
                padding: 0.75rem 0;
            }
        }

        @media (min-width: 769px) {
            .welcome-content {
                padding: 0 2rem 2rem !important;
            }

            /* Hide mobile bottom nav on desktop */
            .mobile-bottom-nav {
                display: none;
            }
        }

        /* Profile/Stats/Ranking Modal - Mobile full screen */
        @media (max-width: 768px) {

            #statsModal,
            #rankingModal {
                background: #1a1a2e !important;
            }

            #statsModal .profile-modal,
            #rankingModal .profile-modal {
                width: 100% !important;
                min-height: 100vh !important;
                min-height: 100dvh !important;
                max-height: none !important;
                border-radius: 0 !important;
                border: none !important;
                padding: 1rem !important;
                padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
                margin: 0 !important;
                background: #1a1a2e !important;
            }
        }

        /* Welcome Header Styles */
        .welcome-header {
            display: flex;
            justify-content: flex-end;
            padding: 1rem 0;
            margin-bottom: 0.5rem;
        }

        .welcome-header-actions {
            display: flex;
            gap: 0.75rem;
            align-items: center;
        }

        .header-btn-new {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.6rem 1rem;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .header-btn-new:hover {
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(102, 126, 234, 0.5);
            transform: translateY(-1px);
        }

        .header-btn-new span:first-child {
            font-size: 1.1rem;
        }

        /* Mobile: Only show icon for Game Info */
        @media (max-width: 768px) {
            .header-btn-new .header-btn-text {
                display: none;
            }

            .header-btn-new {
                padding: 0.5rem 0.65rem;
                gap: 0;
            }

            .welcome-header-actions {
                width: 100%;
                justify-content: space-between;
            }

            /* Group language selector and profile on the right */
            .welcome-header-actions select,
            .welcome-header-actions button {
                margin-left: auto;
            }
        }

        /* Footer Styles - Explicitly Added for Visibility */
        .footer-new {
            margin-top: 3rem;
            padding: 2rem 1rem;
            text-align: center;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }

        .footer-link-new {
            color: #94a3b8;
            text-decoration: none;
            margin: 0 0.5rem;
            font-size: 0.9rem;
            transition: color 0.2s;
        }

        .footer-link-new:hover {
            color: #fff;
        }

        .footer-separator {
            color: rgba(255, 255, 255, 0.2);
            margin: 0 0.2rem;
        }

        .footer-bottom-row {
            margin-top: 1rem;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .footer-copyright-new {
            margin-top: 1.5rem;
            color: rgba(255, 255, 255, 0.3);
            font-size: 0.8rem;
        }

/* Force Override Style for Mobile Subtitle */
        @media (max-width: 768px) {
            #gameSubtitle {
                font-size: 0.60rem !important;
                line-height: 1.2 !important;
            }
        }
