@font-face {
            font-family: 'Open Sans';
            src: url('fonts/OpenSans-VariableFont_wdth,wght.ttf') format('truetype');
            font-weight: 300 800;
            font-stretch: 75% 100%;
            font-display: swap;
        }
        @font-face {
            font-family: 'Inter';
            src: url('fonts/Inter-VariableFont_opsz,wght.ttf') format('truetype');
            font-weight: 100 900;
            font-display: swap;
        }

        * { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
        body { 
            background: #050b14; 
            display: flex; justify-content: center; align-items: center; 
            height: 100vh; width: 100vw; overflow: hidden; 
            font-family: var(--font); color: var(--text); 
            -webkit-font-smoothing: antialiased;
        }
        
        h1, h2, h3, .brand-title, .landing-title, .quiz-question, button, input, select, textarea {
            font-family: inherit;
        }

        #app-container {
            width: 1080px; height: 1920px;
            background-color: var(--bg);
            background-image: radial-gradient(circle at 50% 0%, rgba(0, 163, 224, 0.15) 0%, transparent 50%), var(--tvbg, url('images/tvbg.png'));
            background-size: cover; background-position: center;
            position: relative; overflow: hidden; transform-origin: center center;
            box-shadow: 0 0 80px rgba(0, 163, 224, 0.1);
        }

        .view { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; flex-direction: column; }
        .view.active { display: flex; animation: fadeIn 0.5s ease-out forwards; }

        @keyframes fadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

        .brand-logo { font-size: 40px; font-weight: 900; letter-spacing: 2px; color: var(--primary); margin-bottom: 20px; text-transform: uppercase; }
        .brand-title { font-size: 100px; font-weight: 900; margin-bottom: 40px; color: #fff; text-shadow: 0 4px 20px rgba(0,0,0,0.5); }
        .brand-subtitle { font-size: 40px; color: #a0aec0; margin-bottom: 60px; font-weight: bold; text-align: center; max-width: 80%; line-height: 1.4; }

        .btn { 
            padding: 40px 80px; font-size: 50px; 
            background: linear-gradient(135deg, var(--btn-grad-from, var(--primary)), var(--btn-grad-to, #0077b5)); 
            color: #fff; border: 1px solid rgba(255,255,255,0.1); 
            border-radius: var(--radius); cursor: pointer; margin: 20px; 
            font-weight: 700; letter-spacing: 1px;
            box-shadow: 0 10px 30px color-mix(in srgb, var(--btn-grad-from, var(--primary)) 40%, transparent), inset 0 2px 0 rgba(255,255,255,0.2); 
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
            text-transform: uppercase; backdrop-filter: blur(5px);
        }
        .btn-secondary {
            background: linear-gradient(135deg, var(--secondary), #06142e);
            box-shadow: 0 10px 30px rgba(0, 45, 90, 0.5), inset 0 2px 0 rgba(255,255,255,0.1);
        }
        .btn:hover { filter: brightness(1.1); transform: translateY(-2px); box-shadow: 0 15px 35px rgba(0, 163, 224, 0.4); }
        .btn:active { transform: translateY(5px) scale(0.98); box-shadow: 0 2px 10px rgba(0, 163, 224, 0.2); }

        #score-hud { 
            position: absolute; top: 44px; left: 60px; right: 60px; 
            display: flex; justify-content: space-between; align-items: center;
            z-index: 10;
        }
        #tv-hud-logo { height: 84px; max-width: 280px; object-fit: contain; filter: drop-shadow(0 8px 22px rgba(0,0,0,0.55)); border-radius: 20px; overflow: hidden; }
        .corner-logo { position: absolute; top: 60px; left: 60px; height: 96px; max-width: 320px; object-fit: contain; filter: drop-shadow(0 10px 28px rgba(0,0,0,0.6)); opacity: 0.96; z-index: 5; border-radius: 20px; overflow: hidden; }
        .hud-panel {
            background: linear-gradient(var(--modal-grad-dir, 160deg), var(--modal-grad-from, rgba(11, 27, 61, 0.75)), var(--modal-grad-to, rgba(4, 11, 24, 0.85))); 
            backdrop-filter: blur(20px);
            border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); border-radius: 34px;
            padding: 14px 44px; font-size: 46px; font-weight: 900; line-height: 1.05;
            box-shadow: 0 15px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1); color: #fff;
        }
        .hud-panel span { color: var(--primary); font-size: 26px; display: block; text-transform: uppercase; letter-spacing: 2px; font-weight: 700; margin-bottom: 2px; }

        #game-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
        
        .glass-overlay {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(4, 11, 24, 0.85); backdrop-filter: blur(24px);
            z-index: 20; display: none; flex-direction: column; 
            justify-content: center; align-items: center; text-align: center; padding: 100px;
        }

        #tv-status-overlay.tv-landing {
            background:
                linear-gradient(
                    180deg,
                    color-mix(in srgb, var(--landing-overlay-from, #021A38) var(--landing-overlay-opacity, 30%), transparent),
                    color-mix(in srgb, var(--landing-overlay-to, #061028) var(--landing-overlay-opacity, 30%), transparent)
                );
            backdrop-filter: blur(1px);
            overflow: hidden;
        }

        #tv-leaderboard-overlay {
            background:
                linear-gradient(
                    180deg,
                    color-mix(in srgb, var(--lb-overlay-from, #040B18) var(--lb-overlay-opacity, 85%), transparent),
                    color-mix(in srgb, var(--lb-overlay-to, #0B1B3D) var(--lb-overlay-opacity, 85%), transparent)
                );
        }

        .tv-neon-border {
            position: absolute;
            top: 50px; left: 50px; right: 50px; bottom: 50px;
            border: 12px solid #ffffff;
            border-radius: 36px;
            --neon: var(--neon-glow-color, #00e5ff);
            box-shadow:
                0 0 15px var(--neon),
                inset 0 0 15px var(--neon),
                0 0 40px color-mix(in srgb, var(--neon) 80%, transparent),
                inset 0 0 40px color-mix(in srgb, var(--neon) 80%, transparent),
                0 0 80px color-mix(in srgb, var(--neon) 50%, transparent),
                inset 0 0 80px color-mix(in srgb, var(--neon) 50%, transparent);
            pointer-events: none;
            z-index: 5;
            display: none;
            animation: neonPulse 2s infinite alternate;
        }

        @keyframes neonPulse {
            0% {
                box-shadow:
                    0 0 10px var(--neon-glow-color, #00e5ff),
                    inset 0 0 10px var(--neon-glow-color, #00e5ff),
                    0 0 30px color-mix(in srgb, var(--neon-glow-color, #00e5ff) 60%, transparent),
                    inset 0 0 30px color-mix(in srgb, var(--neon-glow-color, #00e5ff) 60%, transparent),
                    0 0 60px color-mix(in srgb, var(--neon-glow-color, #00e5ff) 30%, transparent),
                    inset 0 0 60px color-mix(in srgb, var(--neon-glow-color, #00e5ff) 30%, transparent);
                opacity: 0.9;
            }
            100% {
                box-shadow:
                    0 0 20px var(--neon-glow-color, #00e5ff),
                    inset 0 0 20px var(--neon-glow-color, #00e5ff),
                    0 0 50px color-mix(in srgb, var(--neon-glow-color, #00e5ff) 90%, transparent),
                    inset 0 0 50px color-mix(in srgb, var(--neon-glow-color, #00e5ff) 90%, transparent),
                    0 0 90px color-mix(in srgb, var(--neon-glow-color, #00e5ff) 60%, transparent),
                    inset 0 0 90px color-mix(in srgb, var(--neon-glow-color, #00e5ff) 60%, transparent);
                opacity: 1;
            }
        }
        #tv-status-overlay.tv-landing .tv-neon-border {
            display: block;
        }

        .landing-stage { position: relative; display: flex; flex-direction: column; align-items: center; z-index: 6; }
        .landing-glow {
            position: absolute; top: 50%; left: 50%; width: 920px; height: 920px;
            transform: translate(-50%, -56%);
            background: radial-gradient(circle, color-mix(in srgb, var(--neon-glow-color, var(--primary)) 35%, transparent) 0%, color-mix(in srgb, var(--neon-glow-color, var(--primary)) 5%, transparent) 45%, transparent 70%);
            pointer-events: none; animation: landingBreathe 6s ease-in-out infinite;
        }
        @keyframes landingBreathe {
            0%,100% { opacity: 0.65; transform: translate(-50%, -56%) scale(1); }
            50%     { opacity: 1;    transform: translate(-50%, -56%) scale(1.07); }
        }
        .game-logo {
            position: relative; width: 460px; max-width: 66%; height: auto; object-fit: contain;
            filter: drop-shadow(0 20px 60px rgba(0,0,0,0.6));
            animation: landingRise 0.9s cubic-bezier(0.16,1,0.3,1) both, floatLogo 5s 0.9s ease-in-out infinite;
            border-radius: 24px; overflow: hidden;
        }
        @keyframes floatLogo { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
        
        .landing-title {
            position: relative; font-size: 150px; font-weight: 900; letter-spacing: 6px; line-height: 1; margin: 44px 0 0;
            background: linear-gradient(110deg, var(--landing-title-from, #ffffff) 0%, var(--landing-title-mid, #e0f4ff) 25%, var(--landing-title-to, #74cef2) 50%, var(--landing-title-mid, #e0f4ff) 75%, var(--landing-title-from, #ffffff) 100%);
            background-size: 200% auto;
            -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
            filter: drop-shadow(0 16px 44px color-mix(in srgb, var(--landing-title-to, #74cef2) 50%, transparent));
            animation: landingRise 0.9s 0.12s cubic-bezier(0.16,1,0.3,1) both;
        }
        .landing-title.shine-effect {
            animation: landingRise 0.9s 0.12s cubic-bezier(0.16,1,0.3,1) both, shine 3s 0.9s linear infinite;
        }
        @keyframes shine { to { background-position: 200% center; } }
        
        .landing-subtext {
            position: relative; font-size: 35px; font-weight: 900; letter-spacing: 4px; text-transform: uppercase;
            margin: 18px 0 4px; line-height: 1.2;
            background: linear-gradient(180deg, var(--landing-subtext-from, #ffffff) 0%, var(--landing-subtext-to, #74cef2) 100%);
            -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
            filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--landing-subtext-to, #74cef2) 40%, transparent));
            animation: landingRise 0.9s 0.28s cubic-bezier(0.16,1,0.3,1) both;
        }
        .landing-rule {
            position: relative; width: 300px; height: 4px; margin: 42px 0 38px; border-radius: 4px;
            background: linear-gradient(90deg, transparent, var(--neon-glow-color, var(--primary)), transparent);
            box-shadow: 0 0 26px color-mix(in srgb, var(--neon-glow-color, var(--primary)) 75%, transparent);
            animation: landingRuleIn 1s 0.3s cubic-bezier(0.16,1,0.3,1) both;
        }
        @keyframes landingRuleIn { from { opacity:0; transform: scaleX(0.25); } to { opacity:1; transform: scaleX(1); } }
        .landing-tagline {
            position: relative; max-width: 780px; font-size: 50px; font-weight: 600; line-height: 1.35;
            color: #e8f6ff; letter-spacing: 0.5px; text-shadow: 0 6px 24px rgba(0,0,0,0.45);
            animation: landingRise 0.9s 0.42s cubic-bezier(0.16,1,0.3,1) both;
        }
        @keyframes landingRise { from { opacity:0; transform: translateY(34px); } to { opacity:1; transform: translateY(0); } }

        .quiz-card {
            position: relative; width: 86%; max-width: 1500px; padding: 90px 80px;
            background: linear-gradient(var(--modal-grad-dir, 160deg), var(--modal-grad-from, rgba(0,72,130,0.75)), var(--modal-grad-to, rgba(4,11,24,0.95)));
            border: 2px solid color-mix(in srgb, var(--primary) 40%, transparent); border-radius: 40px;
            box-shadow: 0 44px 120px rgba(0,0,0,0.8), 0 0 60px color-mix(in srgb, var(--primary) 15%, transparent), inset 0 2px 0 rgba(255,255,255,0.15);
            backdrop-filter: blur(30px); text-align: center;
            animation: quizPop 0.5s cubic-bezier(0.16,1,0.3,1);
        }
        @keyframes quizPop { from { opacity:0; transform: scale(0.92) translateY(24px); } to { opacity:1; transform: scale(1) translateY(0); } }
        
        .quiz-hint { font-size: 38px; font-weight: 700; color: var(--primary); letter-spacing: 2px; margin-top: 30px; }
        .pulse-text { animation: pulse 2s infinite; }
        @keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }
        .quiz-timer {
            width: 130px; height: 130px; margin: 0 auto 34px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 66px; font-weight: 900; color: #fff;
            background: rgba(0,0,0,0.4); border: 5px solid var(--primary);
            box-shadow: 0 0 44px rgba(0,163,224,0.45), inset 0 0 22px rgba(0,0,0,0.45);
            text-shadow: 0 4px 16px rgba(0,0,0,0.85);
        }
        .quiz-timer.urgent { border-color: #ff4757; color: #ff4757; box-shadow: 0 0 50px rgba(255,71,87,0.55); animation: pulse 1s infinite; }

        /* TV Specific Quiz Formatting */
        #quiz-overlay-tv .quiz-card { padding: 50px 70px; }
        #quiz-overlay-tv .quiz-timer { width: 100px; height: 100px; font-size: 50px; margin: 0 auto 20px; }
        #quiz-overlay-tv .quiz-question { 
            font-size: 45px; font-weight: 900; color: #fff; line-height: 1.3; margin: 0 0 20px; 
            text-shadow: 0 8px 30px rgba(0,0,0,0.6); 
            max-height: 400px; overflow: hidden; white-space: pre-wrap; padding: 0 20px; word-break: normal; overflow-wrap: break-word;
        }
        #tv-quiz-answers { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
        .tv-answer-box {
            width: 100%; padding: 10px 15px;
            background: linear-gradient(150deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)); color: #fff;
            border: 2px solid rgba(0,163,224,0.30); border-radius: 20px;
            text-align: center; font-weight: 800; font-size: var(--quiz-tv-answer-fs, 28px);
            backdrop-filter: blur(15px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
            display: flex; align-items: center; justify-content: center; min-height: 55px;
            word-break: normal; overflow-wrap: break-word; white-space: pre-wrap; line-height: 1.2; overflow: hidden;
        }

        #ipad-controls { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: transparent; z-index: 30; width: 100%; height: 100vh; position: relative; }
        
        #scene-bg { display: none; position: fixed; inset: 0; z-index: 0; background: radial-gradient(circle at 50% 42%, var(--secondary) 0%, #03070f 78%); }
        body.tv-active #scene-bg,
        body.ipad-active #scene-bg { display: block; }
        body.tv-active #app-container,
        body.ipad-active #app-container { background: transparent !important; box-shadow: none; z-index: 1; }
        body.ipad-active #app-container { width: 100vw !important; height: 100vh !important; transform: none !important; }
        
        #view-ipad .btn { border-radius: 40px; padding: 4vh 6vw; font-size: clamp(24px, 5vh, 60px); }
        
        #lang-selector {
            position: relative;
            display: flex;
            justify-content: center;
            gap: 40px;
            margin-top: 8vh;
        }
        .lang-flag {
            cursor: pointer;
            opacity: 0.35;
            filter: grayscale(100%);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border-radius: 50%;
            width: clamp(64px, 9vh, 96px);
            height: clamp(64px, 9vh, 96px);
            flex-shrink: 0;
            background-color: #fff;
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            box-shadow: 0 10px 20px rgba(0,0,0,0.5);
            border: 4px solid rgba(255,255,255,0.9);
            user-select: none;
            -webkit-user-select: none;
            position: relative;
            overflow: hidden;
        }
        .lang-flag.is-active {
            opacity: 1;
            filter: grayscale(0%);
            border-color: var(--primary);
            box-shadow: 0 10px 24px rgba(0,163,224,0.45), 0 0 0 3px rgba(0,163,224,0.35);
        }
        #flag-hu {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Crect width='3' height='0.667' fill='%23ce2939'/%3E%3Crect y='0.667' width='3' height='0.666' fill='%23ffffff'/%3E%3Crect y='1.333' width='3' height='0.667' fill='%23436f4d'/%3E%3C/svg%3E");
        }
        #flag-en {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='c'%3E%3Cpath d='M0,0 v30 h60 v-30 z'/%3E%3C/clipPath%3E%3CclipPath id='t'%3E%3Cpath d='M30,15 h30 v15 z v-15 H0 z M0,0 v15 h30 V0 H0 z'/%3E%3C/clipPath%3E%3Cg clip-path='url(%23c)'%3E%3Cpath d='M0,0 v30 h60 v-30 z' fill='%23012169'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23C8102E' stroke-width='4' clip-path='url(%23t)'/%3E%3Cpath d='M30,0 v30 M0,15 h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30,0 v30 M0,15 h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/g%3E%3C/svg%3E");
        }
        .lang-flag-label {
            position: absolute;
            bottom: 8%;
            left: 50%;
            transform: translateX(-50%);
            font-size: clamp(11px, 1.8vh, 15px);
            font-weight: 900;
            letter-spacing: 0.06em;
            color: #fff;
            text-shadow: 0 1px 4px rgba(0,0,0,0.9);
            line-height: 1;
            pointer-events: none;
        }
        #lang-selector.is-switching .lang-flag { pointer-events: none; opacity: 0.3 !important; filter: grayscale(100%) blur(3px) !important; transform: scale(0.9); }
        #lang-selector.is-switching::after {
            content: 'Language Switch In Progress\A Please Wait';
            white-space: pre-wrap;
            text-align: center;
            line-height: 1.3;
            position: absolute; top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            background: #ffffff;
            color: var(--primary);
            font-size: clamp(14px, 2.2vh, 20px);
            font-weight: 800;
            padding: 15px 30px;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.6);
            z-index: 10;
        }

        #quiz-overlay-ipad { background: transparent; backdrop-filter: none; z-index: 40; }
        #quiz-overlay-ipad .quiz-card { background: none; border: none; box-shadow: none; backdrop-filter: none; padding: 2vh 4vw; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; }
        #quiz-overlay-ipad .quiz-timer { box-shadow: none; text-shadow: none; background: transparent; margin-bottom: 2vh; }
        #ipad-quiz-answers { width: 100%; max-width: 1400px; display: grid; grid-template-columns: 1fr 1fr; gap: 2vh; grid-auto-rows: minmax(15vh, 1fr); padding-bottom: 2vh; align-content: center; margin: auto; }
        .quiz-answer-btn {
            width: 100%; padding: 2vh 2vw; font-size: var(--quiz-ipad-answer-fs, 40px);
            background: linear-gradient(150deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)); color: #fff;
            border: 2px solid rgba(0,163,224,0.30); border-radius: 35px;
            text-align: center; font-weight: 800; cursor: pointer;
            transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s; backdrop-filter: blur(15px);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
            display: flex; align-items: center; justify-content: center; min-height: 12vh;
            word-break: normal; overflow-wrap: break-word; white-space: pre-wrap; line-height: 1.25; overflow: hidden;
        }
        .quiz-answer-btn.letters-only {
            font-weight: 900;
            letter-spacing: 0.04em;
            min-height: 18vh;
        }
        .quiz-answer-btn:hover { background: rgba(255,255,255,0.12); }
        .quiz-answer-btn:active { transform: scale(0.96); background: var(--primary); border-color: var(--primary); box-shadow: 0 6px 18px rgba(0,163,224,0.5); }
        .quiz-answer-btn.selected { background: var(--primary); border-color: var(--primary); color: #04243f; box-shadow: 0 8px 30px rgba(0,163,224,0.6); transform: scale(1.02); }

        .terms-label {
            display: flex; align-items: center; justify-content: center; gap: 10px; font-size: clamp(14px, 2.5vh, 22px); color: #fff; margin-bottom: 2vh; cursor: pointer; flex-wrap: wrap; text-align: center;
        }
        .terms-label.consent-label {
            justify-content: flex-start; text-align: left; line-height: 1.4;
            align-items: flex-start; font-size: clamp(11px, 1.65vh, 15px);
            gap: 8px; margin-bottom: 1vh;
        }
        .terms-label.consent-label-block { width: 85%; max-width: 560px; }
        .terms-label.consent-label .consent-text { flex: 1; min-width: 0; }
        .terms-label.consent-optional { opacity: 0.95; font-size: clamp(10px, 1.5vh, 14px); }
        .terms-label input[type="checkbox"] {
            width: clamp(16px, 2.5vh, 22px); height: clamp(16px, 2.5vh, 22px); cursor: pointer;
            flex-shrink: 0; margin-top: 2px;
        }
        .terms-label.consent-label input[type="checkbox"] {
            width: clamp(16px, 2.5vh, 22px); height: clamp(16px, 2.5vh, 22px);
        }
        .terms-label a, .terms-label .consent-terms-link {
            color: var(--primary); text-decoration: underline; font-weight: bold;
        }
        .terms-popup {
            position: absolute; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.9); z-index: 10020; display: none; flex-direction: column; align-items: center; justify-content: center; padding: 5vh; backdrop-filter: blur(10px);
        }
        .terms-popup-content {
            width: 100%; max-width: 900px; height: 80%; background: #fff; border-radius: 16px; overflow: hidden;
        }
        .terms-popup iframe { width: 100%; height: 100%; border: none; }

        .leaderboard-container {
            width: 100%; max-width: 800px;
            background: linear-gradient(
                180deg,
                color-mix(in srgb, var(--lb-bg-from, #040B18) var(--lb-panel-opacity, 75%), transparent),
                color-mix(in srgb, var(--lb-bg-to, #0B1B3D) var(--lb-panel-opacity, 75%), transparent)
            );
            backdrop-filter: blur(20px); border-radius: 24px;
            border: 1px solid color-mix(in srgb, var(--lb-border-color, var(--primary)) 50%, transparent);
            overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,0.5);
        }
        .lb-header {
            display: flex; font-size: 30px; font-weight: bold;
            background: linear-gradient(90deg, var(--lb-header-from, var(--primary)), var(--lb-header-to, #0077b5));
            padding: 25px; color: #fff; text-transform: uppercase; letter-spacing: 2px;
        }
        .lb-row { display: flex; font-size: 35px; padding: 25px; border-bottom: 1px solid rgba(255,255,255,0.05); color: #fff; transition: background 0.2s;}
        .lb-row:nth-child(even) { background: rgba(255,255,255,0.03); }
        .lb-col-rank { width: 15%; text-align: center; font-weight: bold; color: var(--text); }
        .lb-col-name { width: 55%; text-align: left; }
        .lb-col-score { width: 30%; text-align: right; font-weight: bold;}
        .lb-personal-row {
            background: linear-gradient(var(--modal-grad-dir, 160deg), var(--modal-grad-from, #004882), var(--modal-grad-to, #040B18)) !important;
            border: 2px solid color-mix(in srgb, var(--modal-grad-from, var(--primary)) 70%, #fff) !important;
            border-radius: 12px; margin-top: 15px;
            box-shadow: 0 10px 30px color-mix(in srgb, var(--modal-grad-from, var(--primary)) 35%, transparent);
        }
        
        .name-input { font-size: clamp(30px, 6vh, 60px); padding: 3vh; text-align: center; border-radius: 30px; border: 3px solid rgba(0,163,224,0.5); background: rgba(0,0,0,0.4); color: #fff; text-transform: uppercase; width: 80%; max-width: 800px; outline: none; transition: all 0.3s; box-shadow: inset 0 5px 15px rgba(0,0,0,0.5);}
        .name-input:focus { border-color: var(--primary); box-shadow: 0 0 40px rgba(0, 163, 224, 0.4), inset 0 5px 15px rgba(0,0,0,0.5); background: rgba(0,0,0,0.6); }

        .inline-error {
            color: #fff; background: rgba(255, 71, 87, 0.95); box-shadow: 0 5px 15px rgba(255,71,87,0.4);
            font-size: clamp(14px, 2.5vh, 22px); font-weight: 700; padding: 10px 20px;
            border-radius: 12px; display: none; margin-top: 10px; margin-bottom: 20px; width: 60%; text-align: left;
        }

        #toast-container { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); z-index: 10005; display: flex; flex-direction: column; gap: 15px; pointer-events: none; }
        .toast { background: rgba(4, 11, 24, 0.95); border-left: 5px solid var(--primary); color: #fff; padding: 20px 40px; border-radius: 12px; font-size: 30px; font-weight: bold; box-shadow: 0 15px 40px rgba(0,0,0,0.6); backdrop-filter: blur(15px); animation: slideDown 0.3s ease-out forwards; }
        @keyframes slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

        .confirm-modal { position: absolute; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.85); z-index: 10010; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(10px); }
        .confirm-box { background: #070e1d; border: 2px solid var(--primary); padding: 50px; border-radius: 24px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,0.8); width: 80%; max-width: 600px;}
        .confirm-msg { font-size: 35px; color: #fff; margin-bottom: 40px; font-weight: bold; }

        #hidden-trigger, .admin-corner-trigger {
            position: absolute; top: 0; left: 0; width: 150px; height: 150px;
            z-index: 10050; cursor: crosshair; touch-action: manipulation;
            -webkit-tap-highlight-color: transparent; background: transparent;
            pointer-events: auto;
        }
        #admin-modal { position: absolute; top:0; left:0; width:100%; height:100%; background: #050b14; z-index: 10000; display: none; flex-direction: column; color: #fff; }
        .admin-header { padding: 30px 50px; background: rgba(255,255,255,0.03); font-size: 35px; font-weight: 900; display: flex; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.08); align-items: center;}
        .admin-tabs { display: flex; background: rgba(0,0,0,0.4); border-bottom: 1px solid rgba(255,255,255,0.05); overflow-x: auto; white-space: nowrap; }
        .admin-tab { flex: 1; padding: 25px; text-align: center; font-size: 25px; cursor: pointer; border-bottom: 4px solid transparent; font-weight: 700; color: #a0aec0; transition: all 0.2s;}
        .admin-tab:hover { background: rgba(255,255,255,0.03); color: #fff; }
        .admin-tab.active { border-bottom-color: var(--primary); background: rgba(0, 163, 224, 0.1); color: #fff; }
        .admin-content { flex: 1; padding: 50px; overflow-y: auto; font-size: 30px; display: none;}
        .admin-content.active { display: block; }
        .form-group { margin-bottom: 40px; }
        .form-group label { display: block; margin-bottom: 15px; color: #a0aec0; font-size: 25px; font-weight: bold;}
        .form-group input, .form-group select, .form-group textarea { width: 100%; padding: 20px 25px; font-size: 30px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.15); background: rgba(0,0,0,0.3); color: #fff; outline: none; transition: border-color 0.2s, background 0.2s; font-family: inherit; }
        .form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); background: rgba(0,0,0,0.5); }
        .form-group textarea { resize: vertical; min-height: 150px; line-height: 1.4; }
        
        .stat-card { background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01)); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 30px 25px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.2);}
        .stat-num { font-size: 60px; font-weight: 900; color: var(--primary); line-height: 1.1; word-break: break-word; }
        .stat-lbl { font-size: 22px; color: #a0aec0; margin-top: 12px; text-transform: uppercase; letter-spacing: 1px; font-weight: bold; }
        
        .daily-stats-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 30px; font-size: 24px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); }
        .daily-stats-table th { background: linear-gradient(90deg, var(--primary), #0077b5); padding: 20px; text-align: left; color: #fff; font-size: 22px; font-weight: 900; letter-spacing: 1px;}
        .daily-stats-table td { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.05); background: rgba(0,0,0,0.4); color: #cbd5e0; }
        .daily-stats-table tr:hover td { background: rgba(0,163,224,0.1); color: #fff; }
        .daily-stats-table tr:last-child td { border-bottom: none; }

        .admin-btn { padding: 20px 40px; font-size: 25px; background: var(--primary); color: #fff; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; cursor: pointer; margin-right: 20px; font-weight: bold; transition: all 0.2s; box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
        .admin-btn:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
        .admin-btn:active { transform: translateY(1px); }
        .admin-btn-secondary { background: rgba(255,255,255,0.05); color: #fff; border-color: rgba(255,255,255,0.15); }
        .admin-btn-danger { background: #ff4757; color: #fff; border-color: transparent; }
        .admin-btn-success { background: #2ed573; color: #000; border-color: transparent; }
        
        .admin-action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 40px; }
        .admin-action-grid .admin-btn { margin-right: 0; width: 100%; }

        .grid-assets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 25px; }
        .asset-card { background: rgba(255,255,255,0.03); padding: 25px; border-radius: 16px; text-align: center; border: 1px solid rgba(255,255,255,0.05); }
        .asset-card img { max-width: 100%; height: 120px; object-fit: contain; margin-bottom: 20px; filter: drop-shadow(0 10px 10px rgba(0,0,0,0.5));}

        .custom-file-upload { display: inline-block; padding: 15px 25px; cursor: pointer; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15); color: #fff; font-size: 22px; font-weight: bold; transition: all 0.2s; text-align: center; }
        .custom-file-upload:hover { background: rgba(255,255,255,0.1); border-color: var(--primary); }
        input[type="file"] { display: none; }

        /* Reduced TV Keypad */
        #keypad { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(4, 11, 24, 0.95); padding: 20px; border-radius: 16px; display: none; z-index: 10001; grid-template-columns: repeat(3, 1fr); gap: 5px; box-shadow: 0 20px 60px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.1); border: 1px solid rgba(0,163,224,0.3); backdrop-filter: blur(25px);}
        .kp-btn { padding: 10px; font-size: 24px; background: rgba(255,255,255,0.05); color: #fff; border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; cursor: pointer; font-weight: bold; transition: all 0.1s; box-shadow: 0 4px 10px rgba(0,0,0,0.2);}
        .kp-btn:active { background: var(--primary); transform: scale(0.95); border-color: var(--primary); }
        #kp-display { grid-column: span 3; height: 50px; background: rgba(0,0,0,0.5); color: var(--primary); font-size: 40px; text-align: center; line-height: 50px; margin-bottom: 10px; letter-spacing: 10px; border-radius: 8px; font-weight: 900; box-shadow: inset 0 4px 10px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.05);}
        #keypad-title { grid-column: span 3; text-align: center; color: #fff; font-size: 20px; font-weight: 900; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 2px;}
        
        .ipad-top-btn { position: absolute; bottom: 30px; left: 30px; background: rgba(255,255,255,0.08); padding: 20px 30px; border-radius: 16px; cursor: pointer; font-size: 30px; font-weight: bold; color: #fff; z-index: 50; border: 1px solid rgba(255,255,255,0.15); backdrop-filter: blur(10px); box-shadow: 0 15px 30px rgba(0,0,0,0.4); transition: all 0.2s;}
        .ipad-top-btn:active { transform: scale(0.95); background: rgba(255,255,255,0.15); }

        /* iPad PWA / Add to Home Screen → fullscreen */
        @media all and (display-mode: fullscreen), all and (display-mode: standalone) {
            html, body { width: 100%; height: 100%; overflow: hidden; }
            body.ipad-active #app-container {
                width: 100vw !important; height: 100vh !important; height: 100dvh !important;
                transform: none !important;
            }
        }
        html.ios-standalone, html.ios-standalone body {
            width: 100%; height: 100%; overflow: hidden;
        }
        html.ios-standalone body.ipad-active #app-container {
            width: 100vw !important; height: 100vh !important; height: 100dvh !important;
            transform: none !important;
        }

        .brand-subtabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
        .brand-subtab {
            padding: 14px 22px; border-radius: 12px; cursor: pointer; font-size: 20px; font-weight: 700;
            background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); color: #a0aec0;
        }
        .brand-subtab.active { background: rgba(0,163,224,0.18); border-color: var(--primary); color: #fff; }
        .brand-pane { display: none; }
        .brand-pane.active { display: block; }
        .brand-color-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
        .brand-color-row .form-group { flex: 1; min-width: 180px; margin-bottom: 10px; }
        .brand-color-row input[type="color"] { height: 64px; padding: 5px; cursor: pointer; }
        .brand-hint { color: #718096; font-size: 18px; margin: -8px 0 24px; line-height: 1.4; }