:root {
            --bg-dark: #090518;
            --bg-card: rgba(23, 15, 48, 0.82);
            --primary-cyan: #00f2fe;
            --primary-blue: #4facfe;
            --secondary-pink: #ff0844;
            --neon-gold: #ffd700;
            --correct-green: #00e676;
            --wrong-red: #ff1744;
        }

        body {
            font-family: 'Prompt', sans-serif;
            background: radial-gradient(circle at 50% 15%, #231247 0%, #080415 85%);
            color: #ffffff;
            min-height: 100vh;
            overflow-x: hidden;
            user-select: none;
            -webkit-user-select: none;
        }

        /* Glassmorphism MUI Card Effect */
        .mui-card {
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.12);
            box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 242, 254, 0.08);
            border-radius: 24px;
        }

        .mui-button-primary {
            background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
            color: #060214;
            font-weight: 800;
            box-shadow: 0 6px 20px rgba(0, 242, 254, 0.35);
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .mui-button-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(0, 242, 254, 0.55);
        }

        .mui-button-primary:active {
            transform: translateY(1px);
            box-shadow: 0 4px 12px rgba(0, 242, 254, 0.25);
        }

        /* Nav Tab Styling */
        .nav-btn {
            color: rgba(255, 255, 255, 0.6);
            transition: all 0.2s ease;
            border-bottom: 3px solid transparent;
        }

        .nav-btn.active {
            color: var(--primary-cyan);
            border-bottom-color: var(--primary-cyan);
            font-weight: 700;
        }

        /* Pill Selectors */
        .pill-option {
            background: rgba(255, 255, 255, 0.06);
            border: 2px solid rgba(255, 255, 255, 0.1);
            transition: all 0.22s ease;
        }

        .pill-option.selected {
            background: linear-gradient(135deg, rgba(0, 242, 254, 0.22), rgba(79, 172, 254, 0.22));
            border-color: var(--primary-cyan);
            box-shadow: 0 0 18px rgba(0, 242, 254, 0.35);
            color: var(--primary-cyan);
        }

        /* Animated Title Neon Effect */
        .neon-text-title {
            text-shadow: 0 0 10px rgba(0, 242, 254, 0.7),
                         0 0 20px rgba(0, 242, 254, 0.5),
                         0 0 40px rgba(255, 8, 68, 0.5);
            animation: titlePulse 2.5s infinite alternate ease-in-out;
        }

        @keyframes titlePulse {
            0% { filter: drop-shadow(0 0 12px rgba(0, 242, 254, 0.6)); transform: scale(1); }
            100% { filter: drop-shadow(0 0 24px rgba(255, 8, 68, 0.8)); transform: scale(1.02); }
        }

        /* Lightning Icon Animation */
        .lightning-icon {
            animation: lightningFlicker 1.5s infinite ease-in-out;
        }

        @keyframes lightningFlicker {
            0%, 100% { opacity: 1; transform: scale(1) rotate(-5deg); }
            50% { opacity: 0.75; transform: scale(1.2) rotate(10deg); filter: drop-shadow(0 0 15px #ffd700); }
        }

        /* Numpad Key Ripple Effect */
        .numpad-btn {
            background: rgba(255, 255, 255, 0.07);
            border: 1px solid rgba(255, 255, 255, 0.12);
            backdrop-filter: blur(8px);
            transition: all 0.12s ease;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        }

        .numpad-btn:hover {
            background: rgba(255, 255, 255, 0.15);
            border-color: rgba(255, 255, 255, 0.3);
        }

        .numpad-btn:active, .numpad-btn.key-pressed {
            transform: scale(0.92);
            background: rgba(0, 242, 254, 0.3);
            border-color: var(--primary-cyan);
            box-shadow: 0 0 15px rgba(0, 242, 254, 0.5);
        }

        /* Screen Shake for Wrong Answer */
        .shake-screen {
            animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
        }

        @keyframes shake {
            10%, 90% { transform: translate3d(-3px, 0, 0); }
            20%, 80% { transform: translate3d(5px, 0, 0); }
            30%, 50%, 70% { transform: translate3d(-7px, 0, 0); }
            40%, 60% { transform: translate3d(7px, 0, 0); }
        }

        /* Floating Score Text Animation */
        .floating-popup {
            position: absolute;
            pointer-events: none;
            animation: floatUpAndFade 0.9s ease-out forwards;
            font-weight: 800;
            z-index: 100;
        }

        @keyframes floatUpAndFade {
            0% { opacity: 1; transform: translateY(0) scale(0.8); }
            50% { opacity: 1; transform: translateY(-30px) scale(1.2); }
            100% { opacity: 0; transform: translateY(-60px) scale(1); }
        }

        /* Combo Pulse Badge */
        .combo-badge-pulse {
            animation: comboPulse 0.5s infinite alternate ease-in-out;
        }

        @keyframes comboPulse {
            0% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
            100% { transform: scale(1.12); box-shadow: 0 0 25px rgba(255, 215, 0, 0.9); }
        }

        /* Question Card Transition */
        .question-card-pop {
            animation: cardPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        @keyframes cardPop {
            0% { opacity: 0; transform: scale(0.88) translateY(10px); }
            100% { opacity: 1; transform: scale(1) translateY(0); }
        }

        /* Custom Scrollbar */
        /* แถบเลื่อน: พื้นโปร่งใส ไม่ทับมุมโค้งของกล่อง */
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }
        ::-webkit-scrollbar-track {
            background: transparent;
        }
        ::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 10px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.35);
        }
        ::-webkit-scrollbar-corner {
            background: transparent;
        }
        /* Firefox เท่านั้น — Chrome 121+ จะไม่ใช้ ::-webkit-scrollbar ถ้าตั้งค่าสองตัวนี้ */
        @supports (-moz-appearance: none) {
            * {
                scrollbar-width: thin;
                scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
            }
        }

        /* ===== Coin Pill ===== */
        .coin-pill {
            background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(255, 140, 0, 0.12));
            border: 1px solid rgba(255, 215, 0, 0.4);
            box-shadow: 0 0 14px rgba(255, 215, 0, 0.18);
        }
        button.coin-pill:hover {
            box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
        }

        /* ===== Shop Cards ===== */
        .shop-card {
            transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
        }
        .shop-card:hover {
            transform: translateY(-2px);
            border-color: rgba(0, 242, 254, 0.35);
            box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
        }
        .buy-btn-secondary {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.18);
            color: #e5e7eb;
            transition: background 0.15s ease;
        }
        .buy-btn-secondary:hover {
            background: rgba(255, 255, 255, 0.16);
        }

        /* ===== In-game Item Slots ===== */
        .item-slot {
            flex: 1 1 0;
            min-width: 0;
            background: rgba(0, 0, 0, 0.35);
            border: 1px solid rgba(255, 255, 255, 0.14);
            transition: all 0.12s ease;
        }
        .item-slot:hover {
            border-color: rgba(255, 215, 0, 0.5);
            background: rgba(255, 215, 0, 0.08);
        }
        .item-slot:active {
            transform: scale(0.92);
        }
        .item-slot-disabled {
            opacity: 0.4;
            filter: grayscale(0.7);
        }

        .effect-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 11px;
            font-weight: 700;
            padding: 2px 10px;
            border-radius: 9999px;
            border-width: 1px;
            background: rgba(0, 0, 0, 0.45);
            animation: comboPulse 0.8s infinite alternate ease-in-out;
        }

        /* ===== Toast ===== */
        .toast-item {
            animation: toastInOut 2.2s ease forwards;
        }
        @keyframes toastInOut {
            0% { opacity: 0; transform: translateY(-12px); }
            12% { opacity: 1; transform: translateY(0); }
            85% { opacity: 1; transform: translateY(0); }
            100% { opacity: 0; transform: translateY(-8px); }
        }

        /* ===================== Coin Top-up ===================== */
        .topup-banner {
            background: linear-gradient(135deg, rgba(255, 196, 0, 0.22), rgba(255, 8, 68, 0.14));
            border: 1px solid rgba(255, 215, 0, 0.4);
            transition: transform 0.18s ease, box-shadow 0.18s ease;
        }
        .topup-banner:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 26px rgba(255, 196, 0, 0.18);
        }

        .pkg-card {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 2px;
            padding: 14px 6px 10px;
            border-radius: 16px;
            background: rgba(255, 255, 255, 0.05);
            border: 2px solid rgba(255, 255, 255, 0.1);
            transition: all 0.18s ease;
            min-height: 112px;
        }
        .pkg-card:hover { border-color: rgba(255, 215, 0, 0.45); }
        .pkg-card.selected {
            background: linear-gradient(160deg, rgba(255, 215, 0, 0.16), rgba(0, 242, 254, 0.08));
            border-color: var(--neon-gold);
            box-shadow: 0 0 18px rgba(255, 215, 0, 0.3);
        }
        .pkg-tag {
            position: absolute;
            top: -9px;
            left: 50%;
            transform: translateX(-50%);
            white-space: nowrap;
            font-size: 9px;
            font-weight: 800;
            padding: 2px 8px;
            border-radius: 9999px;
            background: linear-gradient(90deg, #ff0844, #ff7a00);
            color: #fff;
        }

        .qr-panel {
            background: #ffffff;
            border-radius: 18px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
            align-self: start;
        }
        .qr-panel-head {
            background: #0b3a6e;
            color: #fff;
            font-weight: 800;
            font-size: 13px;
            letter-spacing: 0.12em;
            text-align: center;
            padding: 10px 0;
        }
        #qrBox img, #qrBox canvas { width: 200px; height: 200px; }

        .slip-drop {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            gap: 2px;
            padding: 18px 12px;
            border-radius: 14px;
            border: 2px dashed rgba(0, 242, 254, 0.35);
            background: rgba(0, 242, 254, 0.05);
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .slip-drop:hover, .slip-drop.drag {
            border-color: var(--primary-cyan);
            background: rgba(0, 242, 254, 0.12);
        }

        .verify-spinner {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            border: 4px solid rgba(255, 255, 255, 0.1);
            border-top-color: var(--primary-cyan);
            border-right-color: var(--neon-gold);
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* ----- Stepper ----- */
        .stepper {
            display: flex;
            align-items: flex-start;
            gap: 0;
        }
        .step {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            flex: 0 0 auto;
            width: 58px;
        }
        .step-dot {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 800;
            background: rgba(255, 255, 255, 0.08);
            border: 2px solid rgba(255, 255, 255, 0.15);
            color: #9ca3af;
        }
        .step-label {
            font-size: 10px;
            color: #9ca3af;
            text-align: center;
            line-height: 1.2;
        }
        .step-line {
            flex: 1 1 auto;
            height: 2px;
            margin-top: 11px;
            background: rgba(255, 255, 255, 0.12);
            border-radius: 2px;
        }
        .step-done .step-dot { background: var(--primary-cyan); border-color: var(--primary-cyan); color: #060214; }
        .step-done .step-label { color: #a5f3fc; }
        .step-current .step-dot { border-color: var(--neon-gold); color: var(--neon-gold); box-shadow: 0 0 12px rgba(255, 215, 0, 0.45); }
        .step-current .step-label { color: #fde68a; font-weight: 700; }
        .step-fail .step-dot { background: var(--wrong-red); border-color: var(--wrong-red); color: #fff; }
        .step-fail .step-label { color: #fda4af; font-weight: 700; }

        /* ----- Status badges ----- */
        .st-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            white-space: nowrap;
            font-size: 10px;
            font-weight: 700;
            padding: 3px 8px;
            border-radius: 9999px;
            border: 1px solid;
        }
        .st-wait   { color: #67e8f9; border-color: rgba(103, 232, 249, 0.4); background: rgba(103, 232, 249, 0.1); }
        .st-verify { color: #c4b5fd; border-color: rgba(196, 181, 253, 0.4); background: rgba(196, 181, 253, 0.1); }
        .st-review { color: #fcd34d; border-color: rgba(252, 211, 77, 0.4);  background: rgba(252, 211, 77, 0.1); }
        .st-ok     { color: #6ee7b7; border-color: rgba(110, 231, 183, 0.4); background: rgba(110, 231, 183, 0.1); }
        .st-bad    { color: #fda4af; border-color: rgba(253, 164, 175, 0.4); background: rgba(253, 164, 175, 0.1); }
        .st-info   { color: #7dd3fc; border-color: rgba(125, 211, 252, 0.4); background: rgba(125, 211, 252, 0.1); }
        .st-muted  { color: #9ca3af; border-color: rgba(156, 163, 175, 0.3); background: rgba(156, 163, 175, 0.08); }

        /* ----- Timeline ----- */
        .timeline { position: relative; padding-left: 16px; }
        .timeline::before {
            content: '';
            position: absolute;
            left: 4px;
            top: 4px;
            bottom: 4px;
            width: 2px;
            background: rgba(255, 255, 255, 0.1);
        }
        .timeline li { position: relative; padding-bottom: 10px; }
        .timeline li::before {
            content: '';
            position: absolute;
            left: -16px;
            top: 4px;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            border: 2px solid #090518;
        }
        .timeline li.tl-player::before { background: var(--primary-cyan); }
        .timeline li.tl-system::before { background: #a78bfa; }
        .timeline li.tl-admin::before  { background: var(--neon-gold); }

        /* ----- Form inputs ----- */
        .tf-input {
            width: 100%;
            background: rgba(0, 0, 0, 0.5);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 10px;
            padding: 8px 12px;
            color: #e0f2fe;
            font-family: inherit;
            font-size: 13px;
        }
        .tf-input:focus { outline: none; border-color: var(--primary-cyan); }
        select.tf-input option { background: #170f30; }

        .sheet-panel { animation: sheetUp 0.22s ease-out; }
        @keyframes sheetUp {
            from { opacity: 0; transform: translateY(24px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        @media (max-width: 639px) {
            .sheet-panel { border-radius: 24px 24px 0 0; }
        }

        /* ===================== Nav (5 tabs) ===================== */
        .nav-btn {
            flex: 1 1 0;
            min-width: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 2px;
            padding: 6px 2px;
            font-size: 10px;
            white-space: nowrap;
        }
        .nav-btn i { font-size: 15px; }
        @media (min-width: 640px) {
            .nav-btn { flex-direction: row; gap: 6px; padding: 8px 4px; font-size: 13px; }
            .nav-btn i { font-size: 14px; }
        }

        /* ===================== Rewards ===================== */
        .reward-hero {
            background:
                radial-gradient(circle at 15% 50%, rgba(255, 215, 0, 0.22), transparent 55%),
                linear-gradient(135deg, rgba(120, 72, 0, 0.45), rgba(40, 20, 70, 0.6));
            border: 1px solid rgba(255, 215, 0, 0.35);
        }

        .reward-card {
            position: relative;
            display: flex;
            flex-direction: column;
            border-radius: 18px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
        }
        .reward-card:hover {
            transform: translateY(-3px);
            border-color: rgba(255, 215, 0, 0.45);
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
        }
        .reward-visual {
            height: 104px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 17px 17px 0 0;
            background: radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.08), transparent 70%), rgba(0, 0, 0, 0.3);
            overflow: hidden;
            position: relative;
        }
        .reward-gold .reward-visual,
        .reward-sheet-visual.reward-gold {
            background: radial-gradient(circle at 50% 60%, rgba(255, 200, 40, 0.3), transparent 70%), rgba(60, 35, 0, 0.45);
        }
        .reward-gold { border-color: rgba(255, 215, 0, 0.3); }
        .reward-gold .reward-visual::after,
        .reward-sheet-visual.reward-gold::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
            transform: translateX(-100%);
            animation: goldShine 3.2s ease-in-out infinite;
        }
        @keyframes goldShine {
            0%, 55% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }

        .reward-soldout { opacity: 0.5; filter: grayscale(0.8); }
        .soldout-ribbon {
            position: absolute;
            top: 10px;
            right: -4px;
            z-index: 2;
            font-size: 10px;
            font-weight: 800;
            padding: 2px 10px;
            border-radius: 6px 0 0 6px;
            background: #4b5563;
            color: #fff;
        }
        .reward-card .pkg-tag { z-index: 2; }

        .reward-sheet-visual {
            position: relative;
            overflow: hidden;
            height: 150px;
            border-radius: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.08), transparent 70%), rgba(0, 0, 0, 0.35);
        }

        .mini-visual svg { width: 34px; }
        .mini-visual i { font-size: 18px; }
        .mini-visual-lg svg { width: 56px; }
        .mini-visual-lg i { font-size: 28px; }

        /* ===================== Security / Auth ===================== */
        .auth-label { display: block; font-size: 11px; color: #d1d5db; margin-bottom: 4px; font-weight: 600; }
        .tf-input-lg { padding: 11px 14px; font-size: 15px; border-radius: 12px; }
        .auth-err {
            font-size: 12px;
            color: #fecdd3;
            background: rgba(244, 63, 94, 0.12);
            border: 1px solid rgba(251, 113, 133, 0.35);
            border-radius: 10px;
            padding: 8px 12px;
        }
        .demo-card {
            background: rgba(251, 191, 36, 0.08);
            border: 1px dashed rgba(251, 191, 36, 0.4);
            border-radius: 14px;
            padding: 10px 12px;
        }
        .otp-input {
            width: 100%;
            text-align: center;
            font-size: 30px;
            font-weight: 800;
            letter-spacing: 0.55em;
            padding: 10px 0 10px 0.55em;
            border-radius: 14px;
            background: rgba(0, 0, 0, 0.5);
            border: 2px solid rgba(0, 242, 254, 0.35);
            color: #fde68a;
            font-family: ui-monospace, monospace;
        }
        .otp-input:focus { outline: none; border-color: var(--primary-cyan); box-shadow: 0 0 18px rgba(0, 242, 254, 0.25); }
        .otp-input::placeholder { color: rgba(255, 255, 255, 0.15); }

        /* PIN pad */
        .pin-dots span {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            border: 2px solid rgba(255, 255, 255, 0.35);
            transition: all 0.12s ease;
        }
        .pin-dots span.on {
            background: var(--primary-cyan);
            border-color: var(--primary-cyan);
            box-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
            transform: scale(1.1);
        }
        .pin-key {
            height: 58px;
            border-radius: 18px;
            font-size: 24px;
            font-weight: 700;
            color: #fff;
            background: rgba(255, 255, 255, 0.07);
            border: 1px solid rgba(255, 255, 255, 0.1);
            transition: all 0.1s ease;
        }
        .pin-key:hover { background: rgba(255, 255, 255, 0.13); }
        .pin-key:active { transform: scale(0.93); background: rgba(0, 242, 254, 0.25); }

        /* Lock screen */
        .lock-screen {
            background:
                radial-gradient(circle at 50% 20%, rgba(0, 242, 254, 0.18), transparent 50%),
                radial-gradient(circle at 50% 90%, rgba(255, 8, 68, 0.15), transparent 50%),
                rgba(8, 4, 21, 0.97);
            backdrop-filter: blur(20px);
        }

        /* Phone-style notification banner */
        .phone-banner {
            pointer-events: auto;
            cursor: pointer;
            background: rgba(250, 250, 252, 0.96);
            backdrop-filter: blur(16px);
            border-radius: 18px;
            padding: 10px 12px;
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
            animation: bannerIn 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2);
        }
        .phone-banner-out { animation: bannerOut 0.25s ease forwards; }
        @keyframes bannerIn { from { opacity: 0; transform: translateY(-30px) scale(0.96); } to { opacity: 1; transform: none; } }
        @keyframes bannerOut { to { opacity: 0; transform: translateY(-24px); } }

        /* Toggle switch */
        .tf-switch {
            appearance: none;
            -webkit-appearance: none;
            width: 42px;
            height: 24px;
            border-radius: 9999px;
            background: rgba(255, 255, 255, 0.15);
            position: relative;
            cursor: pointer;
            transition: background 0.2s ease;
            flex-shrink: 0;
        }
        .tf-switch::after {
            content: '';
            position: absolute;
            top: 3px;
            left: 3px;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #fff;
            transition: transform 0.2s ease;
        }
        .tf-switch:checked { background: #10b981; }
        .tf-switch:checked::after { transform: translateX(18px); }

        .sec-quick {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            padding: 14px 8px;
            border-radius: 16px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            font-size: 11px;
            font-weight: 700;
            color: #e5e7eb;
            transition: all 0.15s ease;
        }
        .sec-quick:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
        .sec-quick-danger { border-color: rgba(251, 113, 133, 0.35); background: rgba(244, 63, 94, 0.08); }

        .authenticator {
            background: #ffffff;
            border-radius: 16px;
            padding: 12px 14px;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
        }
        .pin-key[data-k="cancel"] { font-size: 13px; color: #d1d5db; }

        /* ===================== Diamonds ===================== */
        .diamond-pill {
            background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(129, 140, 248, 0.14));
            border: 1px solid rgba(125, 211, 252, 0.45);
            box-shadow: 0 0 14px rgba(56, 189, 248, 0.18);
        }
        .diamond-pill:hover { box-shadow: 0 0 20px rgba(56, 189, 248, 0.4); }
        .wallet-card {
            border-radius: 16px;
            padding: 12px 14px;
            min-width: 0;
        }
        .wallet-coin {
            background: linear-gradient(135deg, rgba(255, 196, 0, 0.18), rgba(120, 72, 0, 0.25));
            border: 1px solid rgba(255, 215, 0, 0.35);
        }
        .wallet-diamond {
            background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(67, 56, 202, 0.25));
            border: 1px solid rgba(125, 211, 252, 0.4);
        }
        .ex-step {
            width: 44px;
            height: 48px;
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.15);
            color: #fff;
            flex-shrink: 0;
        }
        .ex-step:hover { background: rgba(255, 255, 255, 0.15); }
        #exAmount::-webkit-inner-spin-button, #exAmount::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

        /* =====================================================================
           v3 — Progression, Fever, Boss, Duel, Themes
           ===================================================================== */

        /* ---------- Themes (ปรับสีหลักผ่านตัวแปร) ---------- */
        :root { --accent1: #00f2fe; --accent2: #4facfe; --bg1: #231247; --bg2: #080415; }
        body[data-theme="ocean"]  { --accent1: #38bdf8; --accent2: #2563eb; --bg1: #0b2a4a; --bg2: #020b16; --primary-cyan: #38bdf8; }
        body[data-theme="sakura"] { --accent1: #f9a8d4; --accent2: #ec4899; --bg1: #3b0d2c; --bg2: #12030d; --primary-cyan: #f9a8d4; }
        body[data-theme="forest"] { --accent1: #6ee7b7; --accent2: #10b981; --bg1: #06261c; --bg2: #020d09; --primary-cyan: #6ee7b7; }
        body[data-theme="sunset"] { --accent1: #fdba74; --accent2: #f43f5e; --bg1: #3a0f1a; --bg2: #120408; --primary-cyan: #fdba74; }
        body[data-theme="royal"]  { --accent1: #fde68a; --accent2: #d97706; --bg1: #2a1a05; --bg2: #0c0701; --primary-cyan: #fde68a; }
        body { background: radial-gradient(circle at 50% 15%, var(--bg1) 0%, var(--bg2) 85%); background-attachment: fixed; transition: background 0.4s ease; }
        .mui-button-primary { background: linear-gradient(135deg, var(--accent1) 0%, var(--accent2) 100%); }
        .nav-btn.active { color: var(--accent1); border-bottom-color: var(--accent1); }
        .pill-option.selected { border-color: var(--accent1); color: var(--accent1); background: linear-gradient(135deg, color-mix(in srgb, var(--accent1) 22%, transparent), color-mix(in srgb, var(--accent2) 22%, transparent)); box-shadow: 0 0 18px color-mix(in srgb, var(--accent1) 35%, transparent); }

        /* ---------- Home ---------- */
        .home-player { background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 18px; padding: 12px 14px; }
        .home-quest-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 54px; height: 54px; border-radius: 16px; background: linear-gradient(135deg, rgba(251, 146, 60, 0.25), rgba(244, 63, 94, 0.18)); border: 1px solid rgba(251, 146, 60, 0.45); }
        .daily-card { background: linear-gradient(135deg, #6d28d9, #4338ca 60%, #1e1b4b); border: 1px solid rgba(196, 181, 253, 0.45); border-radius: 18px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(109, 40, 217, 0.3); }
        .mode-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 6px; border-radius: 16px; text-align: center; }
        .home-mini { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; border-width: 1px; text-align: left; transition: transform 0.15s ease; }
        .home-mini:hover { transform: translateY(-2px); }
        .lv-chip { display: inline-block; font-size: 10px; font-weight: 900; padding: 1px 7px; border-radius: 9999px; background: linear-gradient(135deg, var(--accent1), var(--accent2)); color: #060214; }
        .xp-bar { height: 7px; border-radius: 9999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
        .xp-bar > div { height: 100%; border-radius: 9999px; background: linear-gradient(90deg, var(--accent1), var(--accent2)); transition: width 0.6s ease; }

        /* ---------- Avatar frames ---------- */
        .avatar { border-radius: 9999px; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--accent1), #ec4899); position: relative; }
        .avatar.frame-bronze { box-shadow: 0 0 0 3px #b45309, 0 0 10px rgba(180, 83, 9, 0.6); }
        .avatar.frame-silver { box-shadow: 0 0 0 3px #cbd5e1, 0 0 12px rgba(203, 213, 225, 0.6); }
        .avatar.frame-gold { box-shadow: 0 0 0 3px #facc15, 0 0 16px rgba(250, 204, 21, 0.7); }
        .avatar.frame-diamond { box-shadow: 0 0 0 3px #7dd3fc, 0 0 0 6px rgba(125, 211, 252, 0.3), 0 0 22px rgba(56, 189, 248, 0.9); animation: diamondGlow 2s ease-in-out infinite alternate; }
        @keyframes diamondGlow { to { box-shadow: 0 0 0 3px #e0f2fe, 0 0 0 6px rgba(125, 211, 252, 0.5), 0 0 30px rgba(56, 189, 248, 1); } }
        .ghost-avatar { background: linear-gradient(135deg, #64748b, #f43f5e); opacity: 0.85; }

        /* ---------- Gameplay ---------- */
        .mode-tag { font-size: 11px; font-weight: 800; color: #e0f2fe; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); padding: 3px 10px; border-radius: 9999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
        .level-badge { font-size: 11px; font-weight: 900; padding: 3px 10px; border-radius: 9999px; background: rgba(56, 189, 248, 0.15); border: 1px solid rgba(56, 189, 248, 0.5); color: #7dd3fc; }
        .level-badge.level-up { animation: lvUp 0.6s ease; }
        .level-badge.level-down { animation: lvDown 0.6s ease; }
        @keyframes lvUp { 0% { transform: scale(1); } 40% { transform: scale(1.35); background: #38bdf8; color: #001; } 100% { transform: scale(1); } }
        @keyframes lvDown { 0% { transform: translateY(0); } 30% { transform: translateY(4px); background: rgba(244, 63, 94, 0.4); color: #fff; } 100% { transform: translateY(0); } }

        .choice-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 22px 6px; border-radius: 18px; font-size: 30px; font-weight: 900; color: #fff; background: rgba(255, 255, 255, 0.08); border: 2px solid rgba(255, 255, 255, 0.18); transition: transform 0.1s ease, background 0.15s ease; }
        .choice-btn:hover { background: rgba(255, 255, 255, 0.15); }
        .choice-btn:active { transform: scale(0.94); }
        .choice-btn.choice-true { background: rgba(16, 185, 129, 0.18); border-color: rgba(52, 211, 153, 0.6); color: #a7f3d0; font-size: 22px; }
        .choice-btn.choice-false { background: rgba(244, 63, 94, 0.18); border-color: rgba(251, 113, 133, 0.6); color: #fecdd3; font-size: 22px; }
        .choice-key { position: absolute; top: 5px; left: 9px; font-size: 10px; color: rgba(255, 255, 255, 0.35); font-weight: 700; }

        /* Fever */
        .fever-bar { display: flex; align-items: center; gap: 8px; }
        .fever-label { font-size: 12px; font-weight: 900; color: #fff; text-shadow: 0 0 10px #ff6a00; animation: feverPulse 0.5s infinite alternate; white-space: nowrap; }
        .fever-track { flex: 1; height: 8px; border-radius: 9999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
        .fever-track > div { height: 100%; background: linear-gradient(90deg, #ffd700, #ff6a00, #ff1744); transition: width 0.1s linear; }
        @keyframes feverPulse { to { transform: scale(1.08); } }
        body.fever-on { background: radial-gradient(circle at 50% 30%, #7c2d12 0%, #1c0505 80%); }
        body.fever-on #gameplayScreen { border-color: rgba(255, 106, 0, 0.7); box-shadow: 0 0 40px rgba(255, 106, 0, 0.45), inset 0 0 30px rgba(255, 106, 0, 0.15); animation: feverBorder 0.8s infinite alternate; }
        body.fever-on #questionCard { border-color: rgba(255, 170, 0, 0.8); background: linear-gradient(135deg, rgba(124, 45, 18, 0.9), rgba(76, 5, 25, 0.9)); }
        @keyframes feverBorder { to { box-shadow: 0 0 60px rgba(255, 23, 68, 0.55), inset 0 0 40px rgba(255, 106, 0, 0.25); } }

        /* Boss */
        .boss-panel { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 18px; background: linear-gradient(135deg, rgba(127, 29, 29, 0.55), rgba(30, 10, 40, 0.7)); border: 1px solid rgba(251, 113, 133, 0.4); }
        .boss-emoji { font-size: 46px; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
        .boss-emoji.boss-hit { animation: bossHit 0.3s ease; }
        .boss-emoji.boss-enter { animation: bossEnter 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); }
        @keyframes bossHit { 0%, 100% { transform: translateX(0); filter: none; } 30% { transform: translateX(-6px) scale(0.92); filter: brightness(3); } 60% { transform: translateX(5px); } }
        @keyframes bossEnter { from { transform: scale(0) rotate(-30deg); opacity: 0; } to { transform: scale(1); opacity: 1; } }
        .boss-hp { position: relative; height: 14px; border-radius: 9999px; background: rgba(0, 0, 0, 0.5); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.15); }
        .boss-hp > div { height: 100%; background: linear-gradient(90deg, #ef4444, #f97316); transition: width 0.25s ease; }
        .boss-hp > span { position: absolute; inset: 0; font-size: 9px; font-weight: 800; color: #fff; display: flex; align-items: center; justify-content: center; }
        .boss-meter { height: 6px; border-radius: 9999px; background: rgba(0, 0, 0, 0.45); overflow: hidden; }
        .boss-meter > div { height: 100%; background: linear-gradient(90deg, #fbbf24, #f97316, #dc2626); }

        /* Ghost duel */
        .ghost-panel { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 16px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(251, 113, 133, 0.35); }
        .ghost-panel.ghost-leading { border-color: rgba(52, 211, 153, 0.5); }
        .ghost-row { display: flex; align-items: center; gap: 8px; }
        .ghost-track { flex: 1; height: 10px; border-radius: 9999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
        .ghost-me { height: 100%; background: linear-gradient(90deg, var(--accent1), var(--accent2)); transition: width 0.15s linear; }
        .ghost-them { height: 100%; background: linear-gradient(90deg, #fb7185, #e11d48); opacity: 0.8; transition: width 0.15s linear; }

        /* ---------- Game over ---------- */
        .go-banner { font-size: 12px; font-weight: 800; padding: 7px 12px; border-radius: 12px; }
        .go-win { background: linear-gradient(90deg, #facc15, #f59e0b); color: #1a1000; }
        .go-lose { background: rgba(244, 63, 94, 0.2); border: 1px solid rgba(251, 113, 133, 0.5); color: #fecdd3; }
        .go-daily { background: rgba(139, 92, 246, 0.25); border: 1px solid rgba(196, 181, 253, 0.5); color: #ede9fe; }
        .go-boss { background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(248, 113, 113, 0.5); color: #fee2e2; }
        .go-muted { background: rgba(255, 255, 255, 0.06); color: #9ca3af; }
        .go-chip { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 9999px; background: rgba(255, 255, 255, 0.08); color: #e5e7eb; }
        .levelup-num { font-size: 88px; font-weight: 900; line-height: 1; background: linear-gradient(135deg, #fff, var(--accent1), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 20px var(--accent1)); animation: lvPop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); }
        @keyframes lvPop { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

        /* ---------- Quests ---------- */
        .quest-section { background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 18px; padding: 12px 14px; }
        .streak-day { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); color: #9ca3af; text-align: center; }
        .streak-day.claimed { background: rgba(16, 185, 129, 0.12); border-color: rgba(52, 211, 153, 0.35); color: #6ee7b7; }
        .streak-day.today { background: linear-gradient(160deg, rgba(251, 146, 60, 0.35), rgba(244, 63, 94, 0.25)); border-color: #fb923c; color: #fff; box-shadow: 0 0 14px rgba(251, 146, 60, 0.5); animation: feverPulse 0.9s infinite alternate; }
        .streak-day.big:not(.claimed) { border-color: rgba(125, 211, 252, 0.6); }
        .mission { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); }
        .claim-btn { padding: 7px 14px; border-radius: 10px; font-size: 12px; font-weight: 900; color: #052e16; background: linear-gradient(135deg, #6ee7b7, #10b981); box-shadow: 0 0 14px rgba(16, 185, 129, 0.45); }
        .chest { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(251, 191, 36, 0.06); border: 1px dashed rgba(251, 191, 36, 0.35); }
        .chest-ready { background: rgba(251, 191, 36, 0.15); border-style: solid; animation: feverPulse 0.8s infinite alternate; }

        /* ---------- Leaderboard ---------- */
        .lb-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.08); }
        .lb-row.lb-me { border-color: color-mix(in srgb, var(--accent1) 60%, transparent); background: color-mix(in srgb, var(--accent1) 8%, rgba(0, 0, 0, 0.35)); }
        .rank-badge { width: 24px; height: 24px; flex-shrink: 0; border-radius: 9999px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; background: rgba(255, 255, 255, 0.1); color: #d1d5db; }
        .rank-badge.rank-1 { background: #facc15; color: #000; box-shadow: 0 0 12px rgba(250, 204, 21, 0.6); }
        .rank-badge.rank-2 { background: #cbd5e1; color: #000; }
        .rank-badge.rank-3 { background: #d97706; color: #fff; }
        .prize-chip { font-size: 10px; font-weight: 900; padding: 2px 7px; border-radius: 9999px; background: rgba(56, 189, 248, 0.15); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.4); white-space: nowrap; }
        .week-card { background: linear-gradient(135deg, rgba(180, 83, 9, 0.55), rgba(76, 29, 149, 0.45)); border: 1px solid rgba(250, 204, 21, 0.45); border-radius: 18px; padding: 12px 14px; }
        .prize-pill { padding: 2px 8px; border-radius: 9999px; background: rgba(0, 0, 0, 0.3); color: #fef3c7; }

        /* ---------- Profile ---------- */
        .profile-hero { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent1) 15%, transparent), rgba(0, 0, 0, 0.35)); border: 1px solid rgba(255, 255, 255, 0.1); }
        .ach-card { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06); }
        .ach-card .ach-icon { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.06); color: #4b5563; }
        .ach-card.unlocked { background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.35); }
        .ach-card.unlocked .ach-icon { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #451a03; }

        .ach-toast { position: fixed; left: 50%; top: 80px; transform: translateX(-50%); z-index: 96; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 18px; background: linear-gradient(135deg, rgba(69, 26, 3, 0.95), rgba(30, 10, 40, 0.95)); border: 1px solid rgba(251, 191, 36, 0.6); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(251, 191, 36, 0.3); animation: bannerIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
        .ach-toast.out { animation: bannerOut 0.4s ease forwards; }
        .ach-toast .ach-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: linear-gradient(135deg, #fde68a, #f59e0b); color: #451a03; }

        /* ---------- Theme shop ---------- */
        .theme-card { border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, 0.04); border: 2px solid rgba(255, 255, 255, 0.08); }
        .theme-card.theme-on { border-color: var(--accent1); box-shadow: 0 0 14px color-mix(in srgb, var(--accent1) 40%, transparent); }
        .theme-swatch { height: 64px; display: flex; align-items: center; justify-content: center; }
        .theme-swatch span { width: 64px; height: 18px; border-radius: 9999px; box-shadow: 0 0 14px rgba(255, 255, 255, 0.25); }

        /* คลาสที่กำหนด display เอง ต้องซ่อนได้ด้วย .hidden เสมอ (ไม่ขึ้นกับลำดับ CSS ของ Tailwind) */
        .boss-panel.hidden, .ghost-panel.hidden, .fever-bar.hidden, .slip-drop.hidden, .home-mini.hidden,
        .mode-card.hidden, .mission.hidden, .chest.hidden, .lb-row.hidden { display: none; }

        /* ---------- Refund policy (60 วัน) ---------- */
        .refund-policy { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(180, 83, 9, 0.18)); border: 2px solid rgba(251, 191, 36, 0.65); box-shadow: 0 0 20px rgba(251, 191, 36, 0.15); }
        .refund-policy-days { width: 72px; height: 72px; flex-shrink: 0; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(135deg, #fde68a, #f59e0b); color: #451a03; box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4); }
        .refund-ack { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.35); border: 1px dashed rgba(251, 191, 36, 0.5); font-size: 12px; color: #e5e7eb; line-height: 1.5; cursor: pointer; }
        .refund-ack-error { border-color: #fb7185; border-style: solid; background: rgba(244, 63, 94, 0.1); }


        /* ===================== Modal scroll (แถบเลื่อนไม่ทะลุมุมโค้ง) ===================== */
        .modal-scroll {
            overflow-y: auto;
            overscroll-behavior: contain;
            scrollbar-gutter: stable;
        }
        .modal-scroll::-webkit-scrollbar { width: 5px; }
        .modal-scroll::-webkit-scrollbar-track {
            background: transparent;
            margin-block: 22px;          /* เว้นระยะเท่ารัศมีมุม แถบเลื่อนจึงอยู่ในกล่องเสมอ */
        }
        .modal-scroll::-webkit-scrollbar-thumb {
            background: color-mix(in srgb, var(--accent1, #00f2fe) 35%, rgba(255, 255, 255, 0.15));
            border-radius: 10px;
            border: 1px solid transparent;
            background-clip: padding-box;
        }
        @media (max-width: 639px) {
            /* มือถือ: Sheet โค้งเฉพาะมุมบน */
            .sheet-panel.modal-scroll::-webkit-scrollbar-track { margin-top: 22px; margin-bottom: 6px; }
        }

        /* ===================== Custom Select ===================== */
        .tf-select { position: relative; width: 100%; }
        .tf-select.tf-select-inline { width: auto; min-width: 120px; }
        .tf-select-native {
            position: absolute !important;
            inset: 0;
            opacity: 0;
            pointer-events: none;
            width: 100% !important;
            height: 100% !important;
        }
        .tf-select-btn {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 9px 12px 9px 14px;
            border-radius: 12px;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.35));
            border: 1px solid rgba(255, 255, 255, 0.18);
            color: #e0f2fe;
            font-family: inherit;
            font-size: 13px;
            font-weight: 600;
            text-align: left;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
            transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
        }
        .tf-select-sm .tf-select-btn { padding: 6px 10px 6px 12px; font-size: 12px; }
        .tf-select-btn:hover { border-color: rgba(255, 255, 255, 0.32); background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.3)); }
        .tf-select-btn:focus-visible, .tf-select.is-open .tf-select-btn {
            outline: none;
            border-color: var(--accent1, #00f2fe);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent1, #00f2fe) 22%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.06);
        }
        .tf-select-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .tf-select-caret {
            flex-shrink: 0;
            width: 22px;
            height: 22px;
            border-radius: 7px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            color: var(--accent1, #00f2fe);
            background: color-mix(in srgb, var(--accent1, #00f2fe) 14%, transparent);
            transition: transform 0.2s ease;
        }
        .tf-select.is-open .tf-select-caret { transform: rotate(180deg); }

        .tf-select-panel {
            position: fixed;
            z-index: 120;
            overflow-y: auto;
            padding: 6px;
            border-radius: 14px;
            background: rgba(20, 12, 44, 0.97);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            border: 1px solid color-mix(in srgb, var(--accent1, #00f2fe) 35%, rgba(255, 255, 255, 0.12));
            box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6), 0 0 24px color-mix(in srgb, var(--accent1, #00f2fe) 12%, transparent);
            animation: tfSelectIn 0.14s ease-out;
            overscroll-behavior: contain;
        }
        .tf-select-panel.is-up { animation-name: tfSelectInUp; }
        .tf-select-panel::-webkit-scrollbar-track { margin-block: 10px; }
        @keyframes tfSelectIn { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
        @keyframes tfSelectInUp { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
        .tf-select-opt {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 9px 12px;
            border-radius: 10px;
            font-size: 13px;
            color: #d1d5db;
            cursor: pointer;
            user-select: none;
        }
        .tf-select-opt i { font-size: 11px; opacity: 0; color: var(--accent1, #00f2fe); }
        .tf-select-opt.is-active { background: rgba(255, 255, 255, 0.08); color: #fff; }
        .tf-select-opt.is-selected { color: var(--accent1, #00f2fe); font-weight: 700; background: color-mix(in srgb, var(--accent1, #00f2fe) 12%, transparent); }
        .tf-select-opt.is-selected i { opacity: 1; }
        .tf-select-opt.is-disabled { opacity: 0.35; cursor: not-allowed; }

        /* แถวปุ่มแท็บที่เลื่อนแนวนอน: ซ่อนแถบเลื่อน (ยังปัด/เลื่อนได้ปกติ) */
        #secTabs, #rewardCats, #adminFilters, #adminSections, #lbTabs, .no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
        #secTabs::-webkit-scrollbar, #rewardCats::-webkit-scrollbar, #adminFilters::-webkit-scrollbar,
        #adminSections::-webkit-scrollbar, #lbTabs::-webkit-scrollbar, .no-scrollbar::-webkit-scrollbar { display: none; }

        /* ===================== คำสั่งโจทย์ + เวลาอ่าน ===================== */
        .q-guide {
            --qc: #22d3ee;
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: 14px;
            background: color-mix(in srgb, var(--qc) 12%, rgba(0, 0, 0, 0.35));
            border: 1px solid color-mix(in srgb, var(--qc) 45%, transparent);
        }
        .q-guide-icon {
            width: 36px; height: 36px; flex-shrink: 0;
            border-radius: 11px;
            display: flex; align-items: center; justify-content: center;
            font-size: 16px;
            color: #0b0620;
            background: var(--qc);
            box-shadow: 0 0 14px color-mix(in srgb, var(--qc) 50%, transparent);
        }
        .q-guide-label { font-size: 10px; font-weight: 900; letter-spacing: 0.08em; color: var(--qc); text-transform: uppercase; }
        .q-guide-how { font-size: 14px; font-weight: 800; color: #fff; line-height: 1.3; }
        .q-guide-input { font-size: 10px; color: rgba(255, 255, 255, 0.6); line-height: 1.3; }
        .q-guide.guide-pop { animation: guidePop 0.45s cubic-bezier(0.2, 1.5, 0.4, 1); }
        @keyframes guidePop { from { transform: scale(0.85); opacity: 0.2; } to { transform: scale(1); opacity: 1; } }
        .new-type-chip {
            font-size: 9px; font-weight: 900;
            padding: 1px 7px; border-radius: 9999px;
            color: #1a0b00; background: linear-gradient(90deg, #fde047, #fb923c);
            animation: feverPulse 0.5s infinite alternate;
        }
        .new-type-chip.hidden { display: none; }

        /* ช่วงอ่าน: แถบนับถอยหลัง + ล็อกปุ่มตอบ */
        .read-zone { display: none; width: 100%; margin-top: 10px; }
        .is-reading .read-zone { display: block; }
        .read-track { height: 5px; border-radius: 9999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
        .read-track > div { height: 100%; background: linear-gradient(90deg, #22d3ee, #a78bfa); transition: width 0.1s linear; }
        .read-hint { font-size: 10px; color: rgba(255, 255, 255, 0.65); margin-top: 6px; }
        .read-hint b { color: #a5f3fc; }
        .is-reading #questionCard { cursor: pointer; }
        .is-reading.reading-new #questionCard { border-color: rgba(253, 224, 71, 0.6); box-shadow: 0 0 24px rgba(251, 191, 36, 0.25); }
        .is-reading #numpad, .is-reading #choicePad, .is-reading #submitBtn {
            opacity: 0.35;
            filter: grayscale(0.6);
            pointer-events: none;
            transition: opacity 0.15s ease;
        }
        .is-reading #inputBox { opacity: 0.4; }
        .is-reading #timerDisplay::after { content: ' ⏸'; font-size: 14px; }

        /* นับถอยหลัง 3-2-1 ตอนเริ่มเกม */
        .start-countdown {
            position: absolute; inset: 0;
            display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
            background: rgba(8, 4, 21, 0.82);
            backdrop-filter: blur(3px);
            border-radius: 16px;
            z-index: 2;
        }
        .start-countdown.hidden { display: none; }
        .start-countdown-num {
            font-size: 64px; font-weight: 900; line-height: 1;
            background: linear-gradient(135deg, #fff, #22d3ee, #a78bfa);
            -webkit-background-clip: text; background-clip: text; color: transparent;
            filter: drop-shadow(0 0 16px rgba(34, 211, 238, 0.7));
        }
        .start-countdown-num.count-pop { animation: lvPop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
        .start-countdown ~ * { position: relative; }
