:root {
            --bg-color: #0f172a;
            --panel-bg: rgba(30, 41, 59, 0.7);
            --primary-color: #10b981;
            --primary-glow: rgba(16, 185, 129, 0.4);
            --text-color: #f1f5f9;
            --accent-color: #f59e0b;
            --font-main: 'Nunito', sans-serif;
            --font-game: 'Nunito', sans-serif;
        }

        
        /* ========== DAILY QUEST SYSTEM ========== */
        .dq-header { display:flex; align-items:center; justify-content:space-between; }
        .dq-reset-badge { font-size:10px; background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.1); border-radius:20px; padding:2px 8px; color:rgba(255,255,255,0.4); font-weight:700; }
        .dq-card { background:rgba(15,23,42,0.6); border:1.5px solid rgba(255,255,255,0.07); border-radius:14px; padding:10px 12px; display:flex; flex-direction:column; gap:6px; transition:border-color .3s, background .3s; }
        .dq-card.done    { border-color:rgba(34,197,94,0.35);  background:rgba(34,197,94,0.07); }
        .dq-card.claimed { border-color:rgba(255,255,255,0.05); opacity:0.5; }
        .dq-card.failed  { border-color:rgba(239,68,68,0.3);    background:rgba(239,68,68,0.05); }
        .dq-top   { display:flex; align-items:flex-start; gap:8px; }
        .dq-icon  { font-size:18px; flex-shrink:0; line-height:1; margin-top:1px; }
        .dq-info  { flex:1; min-width:0; }
        .dq-title { font-size:12px; font-weight:800; color:rgba(255,255,255,0.9); line-height:1.3; }
        .dq-desc  { font-size:10px; color:rgba(255,255,255,0.45); margin-top:1px; line-height:1.4; }
        .dq-badge { flex-shrink:0; font-size:9px; font-weight:900; padding:2px 7px; border-radius:20px; text-transform:uppercase; letter-spacing:.5px; }
        .dq-badge.easy   { background:rgba(34,197,94,0.15);  color:#4ade80; border:1px solid rgba(34,197,94,0.3); }
        .dq-badge.medium { background:rgba(251,191,36,0.15); color:#fbbf24; border:1px solid rgba(251,191,36,0.3); }
        .dq-badge.hard   { background:rgba(239,68,68,0.15);  color:#f87171; border:1px solid rgba(239,68,68,0.3); }
        .dq-prog-wrap { display:flex; align-items:center; gap:8px; }
        .dq-bar-outer { flex:1; height:5px; background:rgba(255,255,255,0.08); border-radius:10px; overflow:hidden; }
        .dq-bar-inner { height:100%; border-radius:10px; background:linear-gradient(90deg, var(--primary-color), var(--primary-glow)); transition:width .4s cubic-bezier(.25,1,.5,1); }
        .dq-card.done .dq-bar-inner { background:linear-gradient(90deg,#22c55e,#4ade80); }
        .dq-count { font-size:10px; font-weight:800; color:rgba(255,255,255,0.5); white-space:nowrap; }
        .dq-card.done .dq-count { color:#4ade80; }
        .dq-footer { display:flex; align-items:center; justify-content:space-between; margin-top:2px; }
        .dq-reward { font-size:10px; color:rgba(255,255,255,0.4); display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
        .dq-reward-tag { background:rgba(255,255,255,0.07); border-radius:8px; padding:2px 6px; font-weight:700; }
        .dq-claim-btn { font-size:10px; font-weight:900; padding:4px 12px; border-radius:20px; border:none; cursor:pointer; background:linear-gradient(135deg,#22c55e,#4ade80); color:#052e16; animation:dqPulse 1.5s ease-in-out infinite; letter-spacing:.5px; }
        .dq-claimed-tag { font-size:10px; color:rgba(255,255,255,0.3); font-weight:700; }
        .dq-failed-tag  { font-size:10px; color:rgba(239,68,68,0.6); font-weight:700; }
        @keyframes dqPulse { 0%,100%{box-shadow:0 0 0 0 rgba(34,197,94,.4);} 50%{box-shadow:0 0 0 7px rgba(34,197,94,0);} }
        /* ========================================= */

.theme-eco {
            --bg-color: #062f1d;
            --panel-bg: rgba(15, 46, 32, 0.85);
            --primary-color: #10b981;
            --primary-glow: rgba(16, 185, 129, 0.4);
            --text-color: #ecfdf5;
            --accent-color: #fbbf24;
        }

        .theme-cyber {
            --bg-color: #0c1a30;
            --panel-bg: rgba(13, 31, 61, 0.85);
            --primary-color: #06b6d4;
            --primary-glow: rgba(6, 182, 212, 0.4);
            --text-color: #ecfeff;
            --accent-color: #a855f7;
        }

        .theme-magic {
            --bg-color: #1e112c;
            --panel-bg: rgba(43, 21, 61, 0.85);
            --primary-color: #d946ef;
            --primary-glow: rgba(217, 70, 239, 0.4);
            --text-color: #fdf4ff;
            --accent-color: #f43f5e;
        }

        /* THIẾT LẬP CHUNG */
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            user-select: none;
        }

        body {
            background: var(--bg-color);
            color: var(--text-color);
            font-family: var(--font-main);
            height: 100vh;
            width: 100vw;
            margin: 0;
            padding: 0;
            overflow: hidden;
            transition: background-color 0.8s ease;
            touch-action: manipulation;
            -webkit-user-select: none;
            user-select: none;
        }

        #game-container {
            width: 100vw;
            height: 100vh;
            background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
            position: relative;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        /* MÀN HÌNH CHỜ / LỰA CHỌN */
        .screen {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            padding: 30px;
            transition: opacity 0.5s ease, transform 0.5s ease;
            z-index: 10;
            /* Full screen responsive */
            width: 100%;
            height: 100%;
        }

        .screen-hidden {
            opacity: 0;
            pointer-events: none;
            transform: scale(0.95);
            z-index: 1;
        }

        #screen-welcome {
            justify-content: space-between;
            align-items: center;
            background: radial-gradient(circle at center, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
        }

        .logo-area {
            text-align: center;
            margin-top: 20px;
        }

        .logo-title {
            font-family: var(--font-game);
            font-weight: 900;
            font-size: 56px;
            letter-spacing: -1px;
            background: linear-gradient(to right, #22c55e, #10b981, #06b6d4);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            filter: drop-shadow(0 4px 12px rgba(16,185,129,0.3));
        }

        .logo-tagline {
            font-size: 16px;
            opacity: 0.8;
            margin-top: 5px;
            letter-spacing: 2px;
            text-transform: uppercase;
        }

        .setup-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            width: 100%;
            max-width: 850px;
            margin: 20px 0;
        }

        .setup-card {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 24px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 15px;
            box-shadow: inset 0 4px 10px rgba(255,255,255,0.02);
        }

        .setup-card h3 {
            font-family: var(--font-game);
            font-size: 18px;
            display: flex;
            align-items: center;
            gap: 10px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            padding-bottom: 10px;
        }

        .btn-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }

        .btn-select {
            background: rgba(255,255,255,0.05);
            border: 1.5px solid rgba(255,255,255,0.1);
            color: var(--text-color);
            padding: 12px;
            border-radius: 16px;
            font-family: var(--font-main);
            font-weight: 700;
            font-size: 15px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn-select:hover {
            background: rgba(255,255,255,0.1);
            transform: translateY(-2px);
        }

        .btn-select:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }

        .btn-select.active {
            background: var(--primary-color);
            border-color: var(--primary-color);
            color: #000;
            box-shadow: 0 0 20px var(--primary-glow);
        }

        /* Nút mua trong cửa hàng — xanh khi đủ tiền, xám khi không đủ */
        .btn-shop-buy {
            width: 100%;
            padding: 8px 12px;
            border-radius: 10px;
            border: none;
            font-family: var(--font-main);
            font-weight: 700;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            background: linear-gradient(135deg, #10b981, #059669);
            color: #fff;
            box-shadow: 0 3px 10px rgba(16,185,129,0.35);
        }

        .btn-shop-buy:hover:not(:disabled) {
            background: linear-gradient(135deg, #34d399, #10b981);
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(16,185,129,0.5);
        }

        .btn-shop-buy:active:not(:disabled) {
            transform: translateY(1px);
        }

        .btn-shop-buy:disabled {
            background: rgba(100,116,139,0.25);
            color: rgba(255,255,255,0.3);
            cursor: not-allowed;
            box-shadow: none;
        }

        /* Nút bán (màu vàng) */
        .btn-shop-sell {
            width: 100%;
            padding: 8px 12px;
            border-radius: 10px;
            border: none;
            font-family: var(--font-main);
            font-weight: 700;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s ease;
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: #fff;
            box-shadow: 0 3px 10px rgba(245,158,11,0.35);
        }

        .btn-shop-sell:hover:not(:disabled) {
            background: linear-gradient(135deg, #fbbf24, #f59e0b);
            transform: translateY(-2px);
        }

        .btn-shop-sell:disabled {
            background: rgba(100,116,139,0.25);
            color: rgba(255,255,255,0.3);
            cursor: not-allowed;
            box-shadow: none;
        }

        .btn-world-eco.active { background-color: #10b981; color: #fff; border-color: #10b981; box-shadow: 0 0 20px rgba(16,185,129,0.5); }
        .btn-world-cyber.active { background-color: #06b6d4; color: #fff; border-color: #06b6d4; box-shadow: 0 0 20px rgba(6,182,212,0.5); }
        .btn-world-magic.active { background-color: #d946ef; color: #fff; border-color: #d946ef; box-shadow: 0 0 20px rgba(217,70,239,0.5); }

        .btn-start {
            background: #fff;
            color: #000;
            font-family: var(--font-game);
            font-weight: 900;
            font-size: 18px;
            padding: 16px 60px;
            border-radius: 50px;
            border: none;
            cursor: pointer;
            box-shadow: 0 10px 25px rgba(255,255,255,0.1);
            transition: all 0.3s ease;
            letter-spacing: 1px;
            margin-bottom: 20px;
        }

        .btn-start:disabled {
            opacity: 0.3;
            cursor: not-allowed;
            transform: none !important;
            box-shadow: none !important;
        }

        .btn-start:hover:not(:disabled) {
            transform: scale(1.05);
            box-shadow: 0 10px 30px var(--primary-glow);
            background: var(--primary-color);
            color: #fff;
        }

        /* GIAO DIỆN CHƠI GAME CHÍNH */
        #screen-game {
            background: linear-gradient(180deg, rgba(15,23,42,0.2) 0%, rgba(15,23,42,0.8) 100%);
            display: flex;
            flex-direction: column;
            padding: 0;
            min-height: 0;
        }

        .game-header {
            background: rgba(0, 0, 0, 0.4);
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(10px);
            padding: 15px 30px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .btn-home {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            width: 42px;
            height: 42px;
            border-radius: 12px;
            color: var(--text-color);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            transition: all 0.2s;
        }

        .btn-home:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: scale(1.05);
        }

        .current-config {
            display: flex;
            flex-direction: column;
        }

        .current-config h2 {
            font-family: var(--font-game);
            font-size: 20px;
            font-weight: 900;
        }

        .current-config span {
            font-size: 12px;
            opacity: 0.6;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .header-stats {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .stat-badge {
            background: rgba(0, 0, 0, 0.3);
            border: 1.5px solid rgba(255, 255, 255, 0.08);
            border-radius: 16px;
            padding: 8px 18px;
            display: flex;
            align-items: center;
            gap: 10px;
            font-family: var(--font-game);
            font-weight: 900;
            font-size: 16px;
        }

        .currency-coin-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1.25em;
            height: 1.25em;
            flex: 0 0 1.25em;
            border: 2px solid #fef08a;
            border-radius: 50%;
            background: linear-gradient(145deg, #fde047, #f59e0b);
            box-shadow: 0 0 10px rgba(250, 204, 21, 0.45), inset 0 0 0 2px rgba(180, 83, 9, 0.22);
            color: #78350f;
            font-family: Arial, sans-serif;
            font-size: 0.9em;
            font-weight: 900;
            line-height: 1;
        }
        .stat-badge.level i { color: #38bdf8; text-shadow: 0 0 10px rgba(56,189,248,0.4); }
        .stat-badge.weather-badge { color: #a5f3fc; }

        /* KHU VỰC CHÍNH */
        .game-workspace {
            display: flex;
            flex-direction: row;
            flex: 1;
            min-height: 0;
            overflow: hidden;
        }

        /* WORKSPACE TRÁI */
        .workspace-left-container {
            flex: 1;
            min-width: 0;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            padding: 20px;
            position: relative;
        }

        /* NÔNG TRẠI (BÊN TRÁI) */
        .farm-area {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            position: relative;
            width: 100%;
            flex: 1;
        }

        .farm-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 14px;
            width: 100%;
            max-width: 900px;
            position: relative;
            z-index: 2;
        }

        /* Ô ĐẤT */
        .plot-wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .plot-card {
            width: 100%;
            aspect-ratio: 1.25;
            background: rgba(255,255,255,0.02);
            border: 2px dashed rgba(255, 255, 255, 0.1);
            border-radius: 24px;
            position: relative;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: visible;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .plot-card:hover {
            border-color: var(--primary-color);
            background: rgba(255, 255, 255, 0.04);
            transform: translateY(-4px);
        }

        .plot-card.locked {
            border-style: solid;
            background: rgba(15, 23, 42, 0.6);
            border-color: rgba(255, 255, 255, 0.05);
        }

        .plot-card.locked:hover {
            border-color: #ef4444;
        }

        /* Biểu tượng trạng thái nằm trên ô đất */
        .plot-status-overlay {
            position: absolute;
            top: -12px;
            display: flex;
            gap: 6px;
            z-index: 5;
        }

        .status-bubble {
            width: 32px;
            height: 32px;
            background: rgba(15, 23, 42, 0.9);
            border: 2px solid #38bdf8;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            box-shadow: 0 4px 10px rgba(0,0,0,0.4);
        }

        .status-bubble.water {
            border-color: #38bdf8;
            color: #38bdf8;
            animation: bounce 1.5s infinite alternate;
        }

        .status-bubble.pest {
            border-color: #ef4444;
            color: #ef4444;
            animation: shake 0.5s infinite;
        }

        .status-bubble.harvest {
            border-color: #facc15;
            color: #facc15;
            font-size: 16px;
            animation: pulsescale 1s infinite alternate;
        }

        /* SVG Cây trồng */
        .plot-svg {
            width: 85%;
            height: 85%;
            transition: transform 0.3s;
        }

        /* Tầng thông số hiển thị bên ngoài ô đất */
        .plot-info-panel {
            width: 90%;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .plot-bar-outer {
            width: 100%;
            height: 6px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            overflow: hidden;
            position: relative;
        }

        .plot-bar-inner {
            height: 100%;
            background: linear-gradient(to right, var(--primary-color), #34d399);
            width: 0%;
            border-radius: 10px;
            transition: width 0.4s ease;
        }

        .plot-label {
            display: flex;
            justify-content: space-between;
            font-size: 11px;
            font-weight: 700;
            opacity: 0.8;
            text-transform: uppercase;
        }

        /* ĐỒ TRANG TRÍ HIỂN THỊ TRỰC QUAN */
        .decoration-layer {
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 1;
        }

        .sidebar {
            width: clamp(220px, 22vw, 300px);
            flex-shrink: 0;
            background: var(--panel-bg);
            border-left: 1.5px solid rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(15px);
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 16px;
            overflow-y: auto;
        }

        .sidebar-section {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .sidebar-title {
            font-family: var(--font-game);
            font-size: 13px;
            font-weight: 900;
            letter-spacing: 1.5px;
            opacity: 0.5;
            text-transform: uppercase;
            border-bottom: 1.5px solid rgba(255,255,255,0.06);
            padding-bottom: 6px;
        }

        /* TAB CHỢ & CỬA HÀNG (EDU-MARKET) */
        .market-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 20px;
            width: 100%;
        }

        .market-chart-container {
            background: rgba(15, 23, 42, 0.6);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 20px;
            padding: 20px;
        }

        .chart-bars-wrapper {
            display: flex;
            justify-content: space-around;
            align-items: flex-end;
            height: 180px;
            border-bottom: 2px solid rgba(255,255,255,0.1);
            margin-top: 15px;
            padding-bottom: 10px;
            overflow-x: auto !important;
            gap: 10px;
        }
        .chart-bars-wrapper::-webkit-scrollbar {
            height: 6px;
        }
        .chart-bars-wrapper::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 3px;
        }

        .chart-bar-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 80px;
            flex-shrink: 0 !important;
        }

        .chart-bar-pillar {
            width: 44px;
            border-radius: 12px 12px 6px 6px;
            transition: height 0.5s cubic-bezier(0.25, 1, 0.5, 1);
            position: relative;
            box-shadow: 0 4px 10px rgba(0,0,0,0.25);
            border: 2px solid rgba(255,255,255,0.15);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .chart-bar-pillar::after {
            display: none;
        }

        .shop-items-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
        }

        .shop-item-card {
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 16px;
            padding: 15px;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .shop-item-card:hover {
            border-color: var(--primary-color);
            background: rgba(255,255,255,0.06);
        }

        /* TAB THÚ CƯNG (PET COMPANIONS) */
        .pet-incubator {
            background: rgba(15, 23, 42, 0.6);
            border: 1.5px solid rgba(255,255,255,0.08);
            border-radius: 24px;
            padding: 20px;
            display: flex;
            align-items: center;
            gap: 20px;
            margin-bottom: 20px;
        }

        .egg-wrapper {
            position: relative;
            width: 90px;
            height: 110px;
        }

        .egg-svg {
            width: 100%;
            height: 100%;
            animation: bounce 2s infinite alternate;
        }

        .pets-list-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
        }

        .pet-item-card {
            background: rgba(255,255,255,0.03);
            border: 1.5px solid rgba(255,255,255,0.08);
            border-radius: 16px;
            padding: 15px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }

        .pet-item-card.locked {
            opacity: 0.5;
        }

        .pet-item-card.active {
            border-color: var(--primary-color);
            background: rgba(16, 185, 129, 0.15);
        }

        .pet-active-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            font-size: 11px;
            background: var(--primary-color);
            color: #000;
            padding: 2px 6px;
            border-radius: 8px;
            font-weight: 900;
        }

        /* TAB ĐẤU TRƯỜNG BOSS (BOSS ARENA) */
        .arena-intro-card {
            background: linear-gradient(135deg, rgba(244, 63, 94, 0.15) 0%, rgba(14, 116, 144, 0.15) 100%);
            border: 2px solid rgba(244, 63, 94, 0.4);
            border-radius: 24px;
            padding: 30px;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 15px;
        }

        .boss-icon-lg {
            font-size: 64px;
            color: #f43f5e;
            text-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
            animation: shake 1s infinite alternate;
        }

        /* Giao Diện Đấu Trường Boss (Boss Mode trong modal-task) */
        .modal-overlay.boss-mode .modal-card {
            background: linear-gradient(135deg, rgba(136, 19, 55, 0.95), rgba(76, 5, 25, 0.95));
            border-color: rgba(225, 29, 72, 0.6);
            box-shadow: 0 10px 40px rgba(225, 29, 72, 0.4);
        }
        
        .modal-overlay.boss-mode .modal-title {
            color: #fb7185;
        }

        .boss-damage-shake {
            animation: shake 0.3s;
        }

        .boss-hp-bar-outer {
            width: 100%;
            height: 16px;
            background: rgba(255,255,255,0.1);
            border-radius: 10px;
            overflow: hidden;
            border: 1px solid rgba(255,255,255,0.2);
            position: relative;
        }

        .boss-hp-bar-inner {
            height: 100%;
            background: linear-gradient(to right, #ef4444, #f43f5e);
            width: 100%;
            transition: width 0.3s ease;
        }

        .boss-avatar-floating {
            font-size: 48px;
            animation: bounce 1s infinite alternate;
        }

        .inventory-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }

        .inv-card {
            background: rgba(255, 255, 255, 0.03);
            border: 1.5px solid rgba(255, 255, 255, 0.08);
            border-radius: 16px;
            padding: 12px;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .inv-card:hover {
            border-color: var(--primary-color);
            background: rgba(255, 255, 255, 0.06);
            transform: translateY(-2px);
        }

        .inv-card.active {
            border-color: var(--primary-color);
            background: rgba(16, 185, 129, 0.15);
            box-shadow: 0 0 15px rgba(16,185,129,0.15);
        }

        .inv-icon {
            font-size: 24px;
            margin-bottom: 6px;
        }

        .inv-qty {
            position: absolute;
            top: 8px;
            right: 10px;
            background: #1e293b;
            color: #fff;
            font-size: 11px;
            font-weight: 900;
            padding: 2px 7px;
            border-radius: 10px;
            border: 1px solid rgba(255,255,255,0.1);
        }

        .inv-name {
            font-size: 12px;
            font-weight: 700;
            opacity: 0.9;
        }

        /* Danh Sách Bài Tập Kiếm Đồ */
        .task-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .task-btn {
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 16px;
            padding: 12px 15px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            text-align: left;
            color: var(--text-color);
            transition: all 0.2s;
        }

        .task-btn:hover {
            border-color: var(--primary-color);
            background: rgba(255,255,255,0.08);
            transform: translateX(4px);
        }

        .task-meta h4 {
            font-size: 14px;
            font-weight: 700;
        }

        .task-meta span {
            font-size: 11px;
            opacity: 0.6;
        }

        .task-reward {
            background: rgba(16, 185, 129, 0.15);
            color: var(--primary-color);
            border: 1px dashed var(--primary-color);
            font-size: 11px;
            font-weight: 900;
            padding: 4px 8px;
            border-radius: 8px;
        }

        /* FALLBACKS FOR UTILITIES */
        .hidden {
            display: none !important;
        }

        /* HỘP THOẠI MODAL */
        .modal-overlay {
            position: absolute;
            inset: 0;
            background: rgba(15, 23, 42, 0.85);
            backdrop-filter: blur(8px);
            z-index: 100;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }

        .modal-overlay.active {
            opacity: 1;
            pointer-events: auto;
        }

        .modal-card {
            background: #1e293b;
            border: 2px solid rgba(255, 255, 255, 0.1);
            border-radius: 32px;
            width: 96%;
            max-width: 720px;
            padding: 24px 28px;
            position: relative;
            transform: scale(0.9);
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
            display: flex;
            flex-direction: column;
            gap: 14px;
            max-height: 92vh;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(99,179,237,0.3) transparent;
        }

        .modal-card::-webkit-scrollbar {
            width: 5px;
        }
        .modal-card::-webkit-scrollbar-thumb {
            background: rgba(99,179,237,0.3);
            border-radius: 10px;
        }

        .modal-overlay.active .modal-card {
            transform: scale(1);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-title {
            font-family: var(--font-game);
            font-size: 20px;
            font-weight: 900;
            color: var(--primary-color);
        }

        .modal-close {
            background: none;
            border: none;
            color: var(--text-color);
            font-size: 20px;
            cursor: pointer;
            opacity: 0.5;
            transition: opacity 0.2s;
        }

        .modal-close:hover {
            opacity: 1;
        }

        /* Layout 2 cột: Main (câu hỏi) + Sidebar (gợi ý / giải thích) */
        .quest-layout {
            display: flex;
            gap: 14px;
            align-items: flex-start;
        }

        .quest-main {
            flex: 1 1 0;
            min-width: 0;
        }

        .quest-sidebar {
            display: flex;
            flex-direction: column;
            gap: 10px;
            width: auto;
            max-width: 300px;
        }

        /* Khi có nội dung bên trong sidebar được hiển thị, nó sẽ mở rộng */
        .quest-sidebar > div[style*="display: block"],
        .quest-sidebar > div[style*="display: flex"] {
            width: 260px;
        }

        @media (max-width: 600px) {
            .quest-layout {
                flex-direction: column;
            }
            .quest-sidebar {
                max-width: 100%;
            }
            .quest-sidebar > div[style*="display: block"],
            .quest-sidebar > div[style*="display: flex"] {
                width: 100%;
            }
        }

        .quest-container {
            background: #0f172a;
            border-radius: 20px;
            padding: 20px;
            border: 1px solid rgba(255,255,255,0.05);
            text-align: center;
        }

        .quest-prompt {
            font-size: 16px;
            opacity: 0.7;
            margin-bottom: 10px;
            text-transform: uppercase;
            letter-spacing: 1px;
            font-weight: 700;
        }

        .quest-question {
            font-family: var(--font-game);
            font-size: 24px;
            font-weight: 900;
            color: #fff;
            margin-bottom: 15px;
            line-height: 1.4;
        }

        /* Phân loại các dạng bài tập */
        .math-input-wrapper {
            display: flex;
            gap: 10px;
        }

        .math-input {
            flex-grow: 1;
            background: #1e293b;
            border: 2px solid rgba(255, 255, 255, 0.1);
            color: #fff;
            border-radius: 14px;
            padding: 12px;
            font-size: 20px;
            font-weight: 700;
            text-align: center;
            outline: none;
            transition: all 0.2s;
        }

        .math-input:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 10px var(--primary-glow);
        }

        .btn-submit {
            background: var(--primary-color);
            border: none;
            color: #000;
            font-family: var(--font-game);
            font-weight: 900;
            font-size: 16px;
            padding: 12px 25px;
            border-radius: 14px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-submit:hover {
            transform: scale(1.03);
            opacity: 0.9;
        }

        /* Luyện gõ */
        .typing-target-box {
            background: rgba(255, 255, 255, 0.02);
            border: 1.5px solid rgba(255, 255, 255, 0.05);
            border-radius: 12px;
            padding: 12px;
            font-family: monospace;
            font-size: 18px;
            letter-spacing: 1px;
            margin-bottom: 12px;
            color: rgba(255,255,255,0.4);
        }

        .typed-correct { color: #10b981; font-weight: bold; }
        .typed-incorrect { color: #f43f5e; font-weight: bold; text-decoration: underline; }

        /* Keyboard ảo phục vụ lớp 2 */
        .virtual-keyboard {
            display: grid;
            grid-template-columns: repeat(10, 1fr);
            gap: 5px;
            margin-top: 15px;
        }

        .kb-key {
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.1);
            color: #fff;
            padding: 8px 0;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 700;
            text-align: center;
            text-transform: uppercase;
        }

        .kb-key.highlight {
            background: var(--primary-color);
            color: #000;
            transform: scale(1.1);
            box-shadow: 0 0 10px var(--primary-glow);
        }

        /* Lựa chọn nhiều đáp án */
        .multiple-choices {
            display: grid;
            grid-template-columns: 1fr;
            gap: 10px;
        }

        .choice-btn {
            background: rgba(255,255,255,0.04);
            border: 1.5px solid rgba(255,255,255,0.08);
            color: #fff;
            border-radius: 12px;
            padding: 12px 20px;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            text-align: left;
            transition: all 0.2s;
        }

        .choice-btn:hover {
            border-color: var(--primary-color);
            background: rgba(255,255,255,0.08);
        }

        /* Trạng thái sinh mệnh bài tập */
        .quest-hearts {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-size: 20px;
            color: #ef4444;
        }

        /* Khung Xác Nhận Custom */
        .confirm-actions {
            display: flex;
            justify-content: flex-end;
            gap: 15px;
        }

        .btn-confirm-yes {
            background: #ef4444;
            color: #fff;
            border: none;
            border-radius: 14px;
            padding: 12px 25px;
            font-weight: 700;
            cursor: pointer;
        }

        .btn-confirm-no {
            background: rgba(255,255,255,0.1);
            color: #fff;
            border: none;
            border-radius: 14px;
            padding: 12px 25px;
            font-weight: 700;
            cursor: pointer;
        }

        /* ANIMATIONS */
        @keyframes bounce {
            0% { transform: translateY(0); }
            100% { transform: translateY(-8px); }
        }

        @keyframes shake {
            0%, 100% { transform: rotate(0deg); }
            20% { transform: rotate(-8deg); }
            40% { transform: rotate(8deg); }
            60% { transform: rotate(-5deg); }
            80% { transform: rotate(5deg); }
        }

        @keyframes pulsescale {
            0% { transform: scale(1); filter: drop-shadow(0 0 2px var(--accent-color)); }
            100% { transform: scale(1.15); filter: drop-shadow(0 0 10px var(--accent-color)); }
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(5px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Scrollbar mượt mà cho sidebar */
        .sidebar::-webkit-scrollbar {
            width: 6px;
        }
        .sidebar::-webkit-scrollbar-track {
            background: transparent;
        }
        .sidebar::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 10px;
        }

        /* HƯỚNG DẪN TRỢ LÝ TỐI ƯU */
        @keyframes float-slow {
            0% { transform: translateY(0px) rotate(0deg); }
            50% { transform: translateY(-6px) rotate(2deg); }
            100% { transform: translateY(0px) rotate(0deg); }
        }
        .animate-float {
            animation: float-slow 3s ease-in-out infinite;
        }

        #guide-pointer {
            position: absolute;
            font-size: 24px;
            z-index: 60;
            pointer-events: none;
            transition: top 0.6s cubic-bezier(0.25, 1, 0.5, 1), left 0.6s cubic-bezier(0.25, 1, 0.5, 1);
            filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
        }
        .pointer-bounce-vertical {
            animation: pointer-bounce-v-anim 0.6s infinite alternate;
        }
        .pointer-bounce-horizontal-left {
            animation: pointer-bounce-hl-anim 0.6s infinite alternate;
        }
        .pointer-bounce-horizontal-right {
            animation: pointer-bounce-hr-anim 0.6s infinite alternate;
        }
        @keyframes pointer-bounce-v-anim {
            0% { transform: translateY(0); }
            100% { transform: translateY(-8px); }
        }
        @keyframes pointer-bounce-hl-anim {
            0% { transform: translateX(0); }
            100% { transform: translateX(8px); }
        }
        @keyframes pointer-bounce-hr-anim {
            0% { transform: translateX(0); }
            100% { transform: translateX(-8px); }
        }
        @keyframes spin-slow {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .guide-highlight {
            position: relative;
        }
        .guide-highlight::after {
            content: '';
            position: absolute;
            inset: -4px;
            border: 3px solid #fbbf24;
            border-radius: inherit;
            animation: guide-pulse 1.2s infinite;
            pointer-events: none;
            z-index: 40;
        }
        @keyframes guide-pulse {
            0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0px rgba(251, 191, 36, 0.7); }
            100% { transform: scale(1.05); opacity: 0; box-shadow: 0 0 0 8px rgba(251, 191, 36, 0); }
        }

        /* Styles cho các dạng bài tập tương tác mới */
        .qwerty-keyboard {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-top: 15px;
            width: 100%;
            max-width: 600px;
            align-self: center;
        }
        .kb-row {
            display: flex;
            justify-content: center;
            gap: 6px;
        }
        .kb-key {
            background: rgba(30, 41, 59, 0.9);
            border: 1px solid rgba(71, 85, 105, 0.5);
            border-bottom: 3px solid rgba(15, 23, 42, 0.8);
            color: #f1f5f9;
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 800;
            cursor: pointer;
            min-width: 32px;
            text-align: center;
            user-select: none;
            transition: all 0.1s ease;
        }
        .kb-key:active {
            transform: translateY(2px);
            border-bottom-width: 1px;
        }
        .kb-key-space {
            min-width: 180px;
        }
        .kb-key.highlight {
            background: #a855f7 !important;
            border-color: #c084fc !important;
            border-bottom-color: #7e22ce !important;
            box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
            color: white;
            animation: key-pulse 1s infinite alternate;
        }
        @keyframes key-pulse {
            0% { transform: scale(1); }
            100% { transform: scale(1.05); }
        }

        /* Điền vào chỗ trống */
        .blank-sentence {
            font-size: 1.3em;
            margin-bottom: 20px;
            color: #f8fafc;
            line-height: 1.6;
        }
        .blank-slot {
            display: inline-block;
            border-bottom: 3px dashed #3b82f6;
            min-width: 90px;
            text-align: center;
            color: #60a5fa;
            font-weight: 850;
            padding: 0 8px;
            margin: 0 4px;
            transition: all 0.2s ease;
        }
        .blank-slot.filled {
            border-bottom-style: solid;
            color: #38bdf8;
        }
        .word-chips-container {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 12px;
            margin: 15px 0;
        }
        .word-chip {
            background: rgba(30, 41, 59, 0.7);
            border: 2px solid rgba(71, 85, 105, 0.5);
            border-bottom: 4px solid rgba(15, 23, 42, 0.8);
            color: #f1f5f9;
            padding: 8px 20px;
            border-radius: 16px;
            font-size: 15px;
            font-weight: 800;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .word-chip:hover:not(:disabled) {
            background: rgba(51, 65, 85, 0.8);
            border-color: #64748b;
        }
        .word-chip:active:not(:disabled) {
            transform: translateY(2px);
            border-bottom-width: 2px;
        }
        .word-chip.selected {
            background: #1e3a8a !important;
            border-color: #3b82f6 !important;
            opacity: 0.5;
            cursor: default;
        }

        /* Nối Cặp Matching */
        .matching-grid {
            display: grid !important;
            grid-template-columns: 1fr 1fr !important;
            gap: 16px !important;
            width: 100%;
            max-width: 500px;
            margin: 10px auto;
        }
        .matching-column {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .matching-column-header {
            text-align: center;
            font-size: 11px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 1px;
            padding: 6px 12px;
            border-radius: 20px;
            margin-bottom: 6px;
            user-select: none;
        }
        #left-col .matching-column-header {
            color: #38bdf8;
            background: rgba(56, 189, 248, 0.08);
            border: 1.5px solid rgba(56, 189, 248, 0.25);
        }
        #right-col .matching-column-header {
            color: #a78bfa;
            background: rgba(167, 139, 250, 0.08);
            border: 1.5px solid rgba(167, 139, 250, 0.25);
        }
        #left-col .matching-card:not(.selected):not(.correct):not(.incorrect) {
            border-color: rgba(56, 189, 248, 0.35);
        }
        #right-col .matching-card:not(.selected):not(.correct):not(.incorrect) {
            border-color: rgba(167, 139, 250, 0.35);
        }
        .matching-card {
            background: rgba(15, 23, 42, 0.7);
            border: 2px solid rgba(51, 65, 85, 0.5);
            padding: 12px;
            border-radius: 14px;
            text-align: center;
            font-size: 14px;
            font-weight: 800;
            color: #e2e8f0;
            cursor: pointer;
            transition: all 0.2s ease;
            user-select: none;
        }
        .matching-card:hover:not(.correct) {
            background: rgba(30, 41, 59, 0.8);
            border-color: #475569;
        }
        .matching-card.selected {
            background: rgba(59, 130, 246, 0.2);
            border-color: #3b82f6;
            box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
        }
        .matching-card.correct {
            cursor: default;
        }
        #game-container .matching-card.match-color-0 { background: rgba(59, 130, 246, 0.25) !important; border-color: #3b82f6 !important; color: #60a5fa !important; } /* Blue */
        #game-container .matching-card.match-color-1 { background: rgba(245, 158, 11, 0.25) !important; border-color: #f59e0b !important; color: #fbbf24 !important; } /* Amber */
        #game-container .matching-card.match-color-2 { background: rgba(236, 72, 153, 0.25) !important; border-color: #ec4899 !important; color: #f472b6 !important; } /* Pink */
        #game-container .matching-card.match-color-3 { background: rgba(139, 92, 246, 0.25) !important; border-color: #8b5cf6 !important; color: #a78bfa !important; } /* Violet */
        #game-container .matching-card.match-color-4 { background: rgba(20, 184, 166, 0.25) !important; border-color: #14b8a6 !important; color: #2dd4bf !important; } /* Teal */
        #game-container .matching-card.match-color-5 { background: rgba(16, 185, 129, 0.25) !important; border-color: #10b981 !important; color: #34d399 !important; } /* Emerald */
        .matching-card.incorrect {
            background: rgba(239, 68, 68, 0.2) !important;
            border-color: #ef4444 !important;
            color: #fca5a5 !important;
            animation: card-shake 0.3s ease;
        }
        @keyframes card-shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-6px); }
            75% { transform: translateX(6px); }
        }

        /* Highlight cột đang active trong bài ghép cặp */
        .matching-column.step-active {
            border-radius: 16px;
            animation: column-pulse 1.4s ease-in-out infinite;
        }
        @keyframes column-pulse {
            0%, 100% { box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.15); }
            50% { box-shadow: 0 0 0 4px rgba(99, 179, 237, 0.45); }
        }

        .shortcut-status {
            font-size: 1.2em;
            font-weight: 800;
            color: #f8fafc;
            margin-bottom: 12px;
            text-align: center;
        }
        .shortcut-target {
            color: #f43f5e;
            background: rgba(244, 63, 94, 0.1);
            padding: 2px 8px;
            border-radius: 6px;
            border: 1px solid rgba(244, 63, 94, 0.2);
        }

        /* ================= CẢI TIẾN GIAO DIỆN HOẠT HÌNH CUTE (HAY DAY / DUOLINGO / AVATAR) ================= */

        /* Hỗ trợ hiển thị Background gradient trên Body */
        body {
            background: var(--bg-color) !important;
        }

        /* Nâng cấp hiệu ứng 3D push nút bấm phong cách Duolingo */
        .btn-select, .btn-tab, .btn-start, .btn-submit, .btn-action, .btn-home, .tool-btn {
            border-radius: 16px !important;
            border: none !important;
            border-bottom: 4px solid rgba(0, 0, 0, 0.25) !important;
            box-shadow: 0 4px 6px rgba(0,0,0,0.15) !important;
            transition: transform 0.1s ease, border-bottom-width 0.1s ease !important;
            outline: none !important;
        }
        .btn-select:active, .btn-tab:active, .btn-start:active, .btn-submit:active, .btn-action:active, .btn-home:active, .tool-btn:active {
            transform: translateY(2px) !important;
            border-bottom-width: 1px !important;
        }

        /* --- THẾ GIỚI 1: ĐẢO SINH THÁI (Phong cách Nông trại Hay Day gỗ ấm áp) --- */
        .theme-eco {
            --bg-color: linear-gradient(180deg, #7dd3fc 0%, #a3e635 45%, #15803d 100%) !important;
            --panel-bg: #854d0e !important;
        }
        .theme-eco #game-container {
            background: linear-gradient(to bottom, rgba(255,255,255,0.05), rgba(0,0,0,0.1)) !important;
            border: 4px solid #b45309 !important;
            box-shadow: 0 20px 40px rgba(0,0,0,0.4) !important;
        }
        .theme-eco .sidebar, 
        .theme-eco .modal-card, 
        .theme-eco .setup-card, 
        .theme-eco .quest-container,
        .theme-eco .inventory-card,
        .theme-eco #assistant-bubble {
            background: #78350f !important;
            border: 3.5px solid #d97706 !important;
            border-radius: 24px !important;
            box-shadow: 0 8px 0 #451a03, 0 16px 20px rgba(0,0,0,0.3) !important;
            color: #fef08a !important;
        }
        .theme-eco #assistant-name {
            color: #fbbf24 !important;
        }
        .theme-eco #assistant-speech {
            color: #ffffff !important;
        }
        .theme-eco #assistant-bubble > div {
            border-top-color: #78350f !important;
        }
        .theme-eco .game-header,
        .theme-eco .tab-menu-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
    border-bottom: 2px solid rgba(16, 185, 129, 0.3);
    align-items: center;
    justify-content: center;
}
.tab-menu-bar::-webkit-scrollbar { display: none; }
        .theme-eco .btn-tab,
        .theme-eco .btn-select {
            background: #d97706 !important;
            border-bottom: 4px solid #92400e !important;
            color: #fef08a !important;
        }
        .theme-eco .btn-tab.active,
        .theme-eco .btn-select.active,
        .theme-eco .btn-start,
        .theme-eco .btn-submit,
        .theme-eco .btn-action {
            background: #fbbf24 !important;
            border-bottom: 4px solid #b45309 !important;
            color: #78350f !important;
        }
        .theme-eco .current-config h2,
        .theme-eco .modal-title,
        .theme-eco .sidebar-title {
            color: #fef08a !important;
        }
        /* Phối màu tương phản cao cho phần làm bài tập của Đảo Sinh Thái */
        .theme-eco .word-chip,
        .theme-eco .matching-card {
            background: #fef3c7 !important;
            color: #78350f !important;
            border: 2px solid #d97706 !important;
        }
        .theme-eco .word-chip:hover:not(:disabled),
        .theme-eco .matching-card:hover:not(.correct) {
            background: #fde68a !important;
            border-color: #b45309 !important;
        }
        .theme-eco .word-chip.selected,
        .theme-eco .matching-card.selected {
            background: #fbbf24 !important;
            border-color: #b45309 !important;
            color: #78350f !important;
            opacity: 0.95;
        }
        .theme-eco #left-col .matching-column-header {
            color: #38bdf8 !important;
            background: rgba(56, 189, 248, 0.15) !important;
            border: 2px solid rgba(56, 189, 248, 0.4) !important;
        }
        .theme-eco #right-col .matching-column-header {
            color: #c084fc !important;
            background: rgba(192, 132, 252, 0.15) !important;
            border: 2px solid rgba(192, 132, 252, 0.4) !important;
        }
        .theme-eco .blank-sentence,
        .theme-eco .shortcut-status {
            color: #fef08a !important;
        }
        .theme-eco .choice-btn {
            background: #b45309 !important;
            border: 2px solid #d97706 !important;
            border-bottom: 4px solid #78350f !important;
            color: #fef08a !important;
        }
        .theme-eco .choice-btn:hover {
            background: #d97706 !important;
            color: #ffffff !important;
        }
        .theme-eco .kb-key {
            background: #854d0e !important;
            border: 1px solid #a16207 !important;
            border-bottom: 3px solid #451a03 !important;
            color: #fef08a !important;
        }
        .theme-eco .kb-key.highlight {
            background: #fbbf24 !important;
            color: #78350f !important;
        }
        .theme-eco .blank-slot {
            color: #fbbf24 !important;
            border-bottom-color: #fbbf24 !important;
        }
        .theme-eco .shop-item-card,
        .theme-eco .pet-incubator {
            background: #854d0e !important;
            border: 1.5px solid #a16207 !important;
            color: #fef08a !important;
        }

        /* ============ PHASE 2: ÔI ĐẤT TRỒNG TRỌT THEO THẾ GIỚI ============ */

        /* --- ĐẢO SINH THÁI: Ô đất nâu đỏ phong cách Hay Day --- */
        .theme-eco .farm-area {
            background:
                radial-gradient(ellipse at 50% 80%, rgba(101, 60, 20, 0.25) 0%, transparent 70%),
                url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Crect width='80' height='80' fill='%23166534' opacity='0.05'/%3E%3Ccircle cx='40' cy='40' r='30' fill='none' stroke='%2322c55e' stroke-width='0.3' opacity='0.1'/%3E%3C/svg%3E") !important;
        }
        .theme-eco .plot-card {
            background: 
                linear-gradient(145deg, #6b3a0f 0%, #92400e 40%, #7c3810 100%) !important;
            border: 3px solid #a16207 !important;
            border-bottom: 5px solid #451a03 !important;
            border-radius: 18px !important;
            box-shadow: 0 6px 0 #451a03, inset 0 1px 0 rgba(255,200,100,0.15) !important;
            position: relative;
            overflow: visible;
        }
        .theme-eco .plot-card::before {
            content: '';
            position: absolute;
            inset: 0;
            background: repeating-linear-gradient(
                45deg,
                transparent,
                transparent 8px,
                rgba(0,0,0,0.06) 8px,
                rgba(0,0,0,0.06) 9px
            );
            border-radius: inherit;
            pointer-events: none;
        }
        .theme-eco .plot-card:hover:not(.locked) {
            transform: translateY(-6px) !important;
            box-shadow: 0 10px 0 #451a03, 0 14px 20px rgba(0,0,0,0.35) !important;
            border-color: #d97706 !important;
        }
        .theme-eco .plot-card.locked {
            background: linear-gradient(145deg, #3a1a06 0%, #4a200a 100%) !important;
            border-color: #78350f !important;
            border-bottom: 5px solid #1c0a01 !important;
            box-shadow: 0 4px 0 #1c0a01 !important;
            opacity: 0.7;
        }

        /* --- TRẠM CÔNG NGHỆ: Ô đất metallic circuit board --- */
        .theme-cyber .farm-area {
            background:
                radial-gradient(ellipse at 50% 80%, rgba(2, 132, 199, 0.15) 0%, transparent 70%) !important;
        }
        .theme-cyber .plot-card {
            background:
                linear-gradient(135deg, #1e3a5f 0%, #0f2a4a 50%, #1a3355 100%) !important;
            border: 2px solid #0ea5e9 !important;
            border-bottom: 4px solid #075985 !important;
            border-radius: 16px !important;
            box-shadow: 0 4px 0 #075985, 0 0 12px rgba(14, 165, 233, 0.2), inset 0 1px 0 rgba(56,189,248,0.15) !important;
            position: relative;
            overflow: visible;
        }
        .theme-cyber .plot-card::before {
            content: '';
            position: absolute;
            inset: 0;
            background: 
                linear-gradient(0deg, transparent 49%, rgba(6, 182, 212, 0.06) 50%, transparent 51%),
                linear-gradient(90deg, transparent 49%, rgba(6, 182, 212, 0.06) 50%, transparent 51%);
            background-size: 20px 20px;
            border-radius: inherit;
            pointer-events: none;
        }
        .theme-cyber .plot-card::after {
            content: '';
            position: absolute;
            top: 6px; right: 8px;
            width: 8px; height: 8px;
            border-radius: 50%;
            background: #22d3ee;
            box-shadow: 0 0 8px #22d3ee;
            animation: cyber-blink 2s ease-in-out infinite;
            pointer-events: none;
        }
        @keyframes cyber-blink {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.2; }
        }
        .theme-cyber .plot-card:hover:not(.locked) {
            transform: translateY(-5px) !important;
            border-color: #38bdf8 !important;
            box-shadow: 0 8px 0 #075985, 0 0 20px rgba(56,189,248,0.4) !important;
        }
        .theme-cyber .plot-card.locked {
            background: linear-gradient(135deg, #0c1929 0%, #0f1e30 100%) !important;
            border-color: #1e3a5f !important;
            border-bottom-color: #0a1520 !important;
            box-shadow: 0 3px 0 #0a1520 !important;
            opacity: 0.6;
        }

        /* --- KHU RỪNG PHÉP THUẬT: Ô đất đá pha lê tím huyền bí --- */
        .theme-magic .farm-area {
            background:
                radial-gradient(ellipse at 50% 80%, rgba(168, 85, 247, 0.12) 0%, transparent 70%) !important;
        }
        .theme-magic .plot-card {
            background:
                linear-gradient(145deg, #3b1a5e 0%, #2d1252 50%, #4a1a72 100%) !important;
            border: 2px solid #a855f7 !important;
            border-bottom: 4px solid #581c87 !important;
            border-radius: 20px !important;
            box-shadow: 0 4px 0 #581c87, 0 0 15px rgba(168, 85, 247, 0.2), inset 0 1px 0 rgba(216,180,254,0.1) !important;
            position: relative;
            overflow: visible;
        }
        .theme-magic .plot-card::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(ellipse at 30% 30%, rgba(216,180,254,0.08) 0%, transparent 60%),
                         radial-gradient(ellipse at 70% 70%, rgba(168,85,247,0.06) 0%, transparent 50%);
            border-radius: inherit;
            pointer-events: none;
        }
        .theme-magic .plot-card::after {
            content: '✦';
            position: absolute;
            top: 4px; right: 7px;
            font-size: 10px;
            color: #e879f9;
            opacity: 0.7;
            animation: magic-sparkle 3s ease-in-out infinite;
            pointer-events: none;
        }
        @keyframes magic-sparkle {
            0%, 100% { opacity: 0.7; transform: scale(1) rotate(0deg); }
            50% { opacity: 0.3; transform: scale(0.8) rotate(180deg); }
        }
        .theme-magic .plot-card:hover:not(.locked) {
            transform: translateY(-6px) !important;
            border-color: #d946ef !important;
            box-shadow: 0 8px 0 #581c87, 0 0 25px rgba(217, 70, 239, 0.4) !important;
        }
        .theme-magic .plot-card.locked {
            background: linear-gradient(145deg, #1c0a2e 0%, #200e35 100%) !important;
            border-color: #4a1a72 !important;
            border-bottom-color: #2d0a55 !important;
            box-shadow: 0 3px 0 #2d0a55 !important;
            opacity: 0.6;
        }
        /* ============================================================= */

        /* --- THẾ GIỚI 2: TRẠM CÔNG NGHỆ (Phong cách Duolingo trong sáng, bo viền xanh/trắng) --- */
        .theme-cyber {
            --bg-color: radial-gradient(circle at center, #0284c7 0%, #0f172a 100%) !important;
            --panel-bg: #ffffff !important;
        }
        .theme-cyber #game-container {
            background: rgba(15, 23, 42, 0.4) !important;
            border: 4px solid #0284c7 !important;
        }
        .theme-cyber .sidebar, 
        .theme-cyber .modal-card, 
        .theme-cyber .setup-card, 
        .theme-cyber .quest-container,
        .theme-cyber .inventory-card,
        .theme-cyber #assistant-bubble {
            background: #ffffff !important;
            border: 3.5px solid #0284c7 !important;
            border-radius: 24px !important;
            box-shadow: 0 8px 0 #0284c7, 0 16px 20px rgba(0,0,0,0.15) !important;
            color: #1e293b !important;
        }
        .theme-cyber #assistant-name {
            color: #0284c7 !important;
        }
        .theme-cyber #assistant-speech {
            color: #0f172a !important;
        }
        .theme-cyber #assistant-bubble > div {
            border-top-color: #ffffff !important;
        }
        .theme-cyber .game-header,
        .theme-cyber .tab-menu-bar {
            display: flex !important;
            flex-wrap: wrap !important;
            gap: 8px !important;
            padding: 10px !important;
            background: #0284c7 !important;
            border-bottom: 3.5px solid #0369a1 !important;
            align-items: center !important;
            justify-content: center !important;
        }
        .theme-cyber .btn-tab,
        .theme-cyber .btn-select {
            background: #f1f5f9 !important;
            border-bottom: 4px solid #cbd5e1 !important;
            color: #475569 !important;
        }
        .theme-cyber .btn-tab.active,
        .theme-cyber .btn-select.active,
        .theme-cyber .btn-start,
        .theme-cyber .btn-submit,
        .theme-cyber .btn-action {
            background: #06b6d4 !important;
            border-bottom: 4px solid #0891b2 !important;
            color: #ffffff !important;
        }
        .theme-cyber .current-config h2 {
            color: #ffffff !important;
        }
        .theme-cyber .modal-title,
        .theme-cyber .sidebar-title,
        .theme-cyber .sidebar h1,
        .theme-cyber .sidebar h2,
        .theme-cyber .sidebar h3,
        .theme-cyber .sidebar h4,
        .theme-cyber .sidebar p,
        .theme-cyber .sidebar span,
        .theme-cyber .sidebar label,
        .theme-cyber .modal-card h1,
        .theme-cyber .modal-card h2,
        .theme-cyber .modal-card h3,
        .theme-cyber .modal-card h4,
        .theme-cyber .modal-card p,
        .theme-cyber .modal-card span,
        .theme-cyber .setup-card h2,
        .theme-cyber .setup-card p,
        .theme-cyber .setup-card label,
        .theme-cyber .quest-container .quest-question,
        .theme-cyber .quest-container p,
        .theme-cyber .quest-container span,
        .theme-cyber .inventory-card h3,
        .theme-cyber .inventory-card p {
            color: #0f172a !important;
        }
        /* Phối màu tương phản cao cho phần làm bài tập của Trạm Công Nghệ */
        .theme-cyber .word-chip,
        .theme-cyber .matching-card {
            background: #f8fafc !important;
            color: #0f172a !important;
            border: 2px solid #cbd5e1 !important;
        }
        .theme-cyber .word-chip:hover:not(:disabled),
        .theme-cyber .matching-card:hover:not(.correct) {
            background: #f1f5f9 !important;
            border-color: #0ea5e9 !important;
        }
        .theme-cyber .word-chip.selected,
        .theme-cyber .matching-card.selected {
            background: #0ea5e9 !important;
            border-color: #0284c7 !important;
            color: #ffffff !important;
            opacity: 0.95;
        }
        .theme-cyber #left-col .matching-column-header {
            color: #0369a1 !important;
            background: #e0f2fe !important;
            border: 2px solid #bae6fd !important;
        }
        .theme-cyber #right-col .matching-column-header {
            color: #7e22ce !important;
            background: #f3e8ff !important;
            border: 2px solid #e9d5ff !important;
        }
        .theme-cyber .blank-sentence,
        .theme-cyber .shortcut-status {
            color: #0f172a !important;
        }
        .theme-cyber .choice-btn {
            background: #ffffff !important;
            border: 2px solid #cbd5e1 !important;
            border-bottom: 4px solid #cbd5e1 !important;
            color: #0f172a !important;
        }
        .theme-cyber .choice-btn:hover {
            background: #f1f5f9 !important;
            border-color: #94a3b8 !important;
        }
        .theme-cyber .choice-btn.selected {
            background: #0ea5e9 !important;
            border-color: #0284c7 !important;
            color: #ffffff !important;
        }
        .theme-cyber .kb-key {
            background: #e2e8f0 !important;
            border: 1px solid #cbd5e1 !important;
            border-bottom: 3px solid #94a3b8 !important;
            color: #0f172a !important;
        }
        .theme-cyber .kb-key.highlight {
            background: #06b6d4 !important;
            color: #ffffff !important;
        }
        .theme-cyber .blank-slot {
            color: #0284c7 !important;
            border-bottom-color: #0284c7 !important;
        }
        .theme-cyber .market-chart-container,
        .theme-cyber .pet-incubator {
            background: #ffffff !important;
            border: 3.5px solid #0284c7 !important;
            color: #0f172a !important;
        }
        .theme-cyber .market-chart-container h3,
        .theme-cyber .pet-incubator h3 {
            color: #0284c7 !important;
        }
        .theme-cyber .market-chart-container p,
        .theme-cyber .pet-incubator p,
        .theme-cyber .market-chart-container span,
        .theme-cyber .pet-incubator span {
            color: #0f172a !important;
            opacity: 0.95 !important;
        }
        .theme-cyber .market-grid .bg-white\/5 {
            background: #f1f5f9 !important;
            border: 2px solid #cbd5e1 !important;
            color: #0f172a !important;
        }
        .theme-cyber .market-grid .bg-white\/5 span {
            color: #0f172a !important;
        }
        .theme-cyber .market-grid .bg-white\/5 span.text-emerald-400 {
            color: #0284c7 !important;
        }
        .theme-cyber .shop-item-card {
            background: #f8fafc !important;
            border: 2px solid #cbd5e1 !important;
            color: #0f172a !important;
        }
        .theme-cyber .shop-item-card span.text-yellow-400 {
            color: #b45309 !important;
        }
        .theme-cyber .chart-bar-item span {
            color: #0f172a !important;
        }
        .theme-cyber .chart-bar-item .text-yellow-400 {
            color: #b45309 !important;
        }

        /* --- THẾ GIỚI 3: KHU RỪNG PHÉP THUẬT (Phong cách Avatar lung linh tinh thể hồng tím) --- */
        .theme-magic {
            --bg-color: linear-gradient(135deg, #4c1d95 0%, #c084fc 50%, #fbcfe8 100%) !important;
            --panel-bg: #fae8ff !important;
        }
        .theme-magic #game-container {
            background: rgba(30, 10, 40, 0.4) !important;
            border: 4px solid #c084fc !important;
        }
        .theme-magic .sidebar, 
        .theme-magic .modal-card, 
        .theme-magic .setup-card, 
        .theme-magic .quest-container,
        .theme-magic .inventory-card,
        .theme-magic #assistant-bubble {
            background: #fdf4ff !important;
            border: 3.5px solid #c084fc !important;
            border-radius: 24px !important;
            box-shadow: 0 8px 0 #a855f7, 0 16px 20px rgba(0,0,0,0.2) !important;
            color: #4a044e !important;
        }
        .theme-magic #assistant-name {
            color: #c084fc !important;
        }
        .theme-magic #assistant-speech {
            color: #4a044e !important;
        }
        .theme-magic #assistant-bubble > div {
            border-top-color: #fdf4ff !important;
        }
        .theme-magic .game-header,
        .theme-magic .tab-menu-bar {
            display: flex !important;
            flex-wrap: wrap !important;
            gap: 8px !important;
            padding: 10px !important;
            background: #8b5cf6 !important;
            border-bottom: 3.5px solid #6d28d9 !important;
            align-items: center !important;
            justify-content: center !important;
        }
        .theme-magic .btn-tab,
        .theme-magic .btn-select {
            background: #f3e8ff !important;
            border-bottom: 4px solid #d8b4fe !important;
            color: #6b21a8 !important;
        }
        .theme-magic .btn-tab.active,
        .theme-magic .btn-select.active,
        .theme-magic .btn-start,
        .theme-magic .btn-submit,
        .theme-magic .btn-action {
            background: #d946ef !important;
            border-bottom: 4px solid #a21caf !important;
            color: #ffffff !important;
        }
        .theme-magic .current-config h2 {
            color: #ffffff !important;
        }
        .theme-magic .modal-title,
        .theme-magic .sidebar-title,
        .theme-magic .sidebar h1,
        .theme-magic .sidebar h2,
        .theme-magic .sidebar h3,
        .theme-magic .sidebar h4,
        .theme-magic .sidebar p,
        .theme-magic .sidebar span,
        .theme-magic .sidebar label,
        .theme-magic .modal-card h1,
        .theme-magic .modal-card h2,
        .theme-magic .modal-card h3,
        .theme-magic .modal-card h4,
        .theme-magic .modal-card p,
        .theme-magic .modal-card span,
        .theme-magic .setup-card h2,
        .theme-magic .setup-card p,
        .theme-magic .setup-card label,
        .theme-magic .quest-container .quest-question,
        .theme-magic .quest-container p,
        .theme-magic .quest-container span,
        .theme-magic .inventory-card h3,
        .theme-magic .inventory-card p {
            color: #4a044e !important;
        }
        /* Phối màu tương phản cao cho phần làm bài tập của Rừng Phép Thuật */
        .theme-magic .word-chip,
        .theme-magic .matching-card {
            background: #fdf4ff !important;
            color: #4a044e !important;
            border: 2px solid #e9d5ff !important;
        }
        .theme-magic .word-chip:hover:not(:disabled),
        .theme-magic .matching-card:hover:not(.correct) {
            background: #fae8ff !important;
            border-color: #d946ef !important;
        }
        .theme-magic .word-chip.selected,
        .theme-magic .matching-card.selected {
            background: #d946ef !important;
            border-color: #c084fc !important;
            color: #ffffff !important;
            opacity: 0.95;
        }
        .theme-magic #left-col .matching-column-header {
            color: #0369a1 !important;
            background: #e0f2fe !important;
            border: 2px solid #bae6fd !important;
        }
        .theme-magic #right-col .matching-column-header {
            color: #be123c !important;
            background: #ffe4e6 !important;
            border: 2px solid #fecdd3 !important;
        }
        .theme-magic .blank-sentence,
        .theme-magic .shortcut-status {
            color: #4a044e !important;
        }
        .theme-magic .choice-btn {
            background: #fdf4ff !important;
            border: 2px solid #e9d5ff !important;
            border-bottom: 4px solid #d8b4fe !important;
            color: #4a044e !important;
        }
        .theme-magic .choice-btn:hover {
            background: #fae8ff !important;
            border-color: #c084fc !important;
        }
        .theme-magic .choice-btn.selected {
            background: #d946ef !important;
            border-color: #c084fc !important;
            color: #ffffff !important;
        }
        .theme-magic .kb-key {
            background: #f3e8ff !important;
            border: 1px solid #e9d5ff !important;
            border-bottom: 3px solid #c084fc !important;
            color: #4a044e !important;
        }
        .theme-magic .kb-key.highlight {
            background: #d946ef !important;
            color: #ffffff !important;
        }
        .theme-magic .blank-slot {
            color: #d946ef !important;
            border-bottom-color: #d946ef !important;
        }
        .theme-magic .market-chart-container,
        .theme-magic .pet-incubator {
            background: #fdf4ff !important;
            border: 3.5px solid #c084fc !important;
            color: #4a044e !important;
        }
        .theme-magic .market-chart-container h3,
        .theme-magic .pet-incubator h3 {
            color: #c084fc !important;
        }
        .theme-magic .market-chart-container p,
        .theme-magic .pet-incubator p,
        .theme-magic .market-chart-container span,
        .theme-magic .pet-incubator span {
            color: #4a044e !important;
            opacity: 0.95 !important;
        }
        .theme-magic .market-grid .bg-white\/5 {
            background: #fae8ff !important;
            border: 2px solid #e9d5ff !important;
            color: #4a044e !important;
        }
        .theme-magic .market-grid .bg-white\/5 span {
            color: #4a044e !important;
        }
        .theme-magic .market-grid .bg-white\/5 span.text-emerald-400 {
            color: #d946ef !important;
        }
        .theme-magic .shop-item-card {
            background: #fdf4ff !important;
            border: 2px solid #e9d5ff !important;
            color: #4a044e !important;
        }
        .theme-magic .shop-item-card span.text-yellow-400 {
            color: #a21caf !important;
        }
        .theme-magic .chart-bar-item span {
            color: #4a044e !important;
        }
        .theme-magic .chart-bar-item .text-yellow-400 {
            color: #a21caf !important;
        }
.btn-tab {
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    cursor: pointer;
}

/* Gợi ý ngón tay gõ phím & Chế độ Luyện gõ phím cao cấp */
.typing-target-box {
    background: rgba(15, 23, 42, 0.85) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 14px !important;
    padding: 14px 18px !important;
    font-family: monospace !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    letter-spacing: 2px !important;
    margin-bottom: 15px !important;
    text-align: center !important;
    color: #94a3b8 !important;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4) !important;
}

.typing-target-box .typed-untyped {
    color: #94a3b8 !important;
    opacity: 0.85 !important;
}

.typed-correct {
    color: #10b981 !important;
    font-weight: 900 !important;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.5) !important;
}

.typed-incorrect {
    color: #ffffff !important;
    background: #ef4444 !important;
    font-weight: 900 !important;
    border-radius: 4px !important;
    padding: 1px 4px !important;
    text-decoration: underline !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6) !important;
}

/* SVG Bàn tay hướng dẫn gõ phím */
.hand-palm-path {
    fill: rgba(255, 255, 255, 0.08);
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1.5px;
}

.finger-path {
    fill: rgba(255, 255, 255, 0.14);
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 1.5px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hand-label {
    fill: #cbd5e1;
    font-weight: 900;
    font-size: 10px;
    letter-spacing: 0.5px;
    text-anchor: middle;
}

.finger-path.highlight-finger {
    fill: #10b981 !important;
    stroke: #34d399 !important;
    stroke-width: 2px !important;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.9)) !important;
    animation: finger-pulse 1.2s infinite ease-in-out;
}

@keyframes finger-pulse {
    0%, 100% {
        opacity: 0.75;
    }
    50% {
        opacity: 1;
    }
}

/* --- ĐIỀU CHỈNH ĐỘ TƯƠNG PHẢN CHUẨN THEO TỪNG CHẾ ĐỘ THEME --- */

/* Theme Eco (Nông trại xanh) */
.theme-eco .typing-target-box {
    background: #f0fdf4 !important;
    border: 2px solid #86efac !important;
    color: #166534 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}
.theme-eco .typing-target-box .typed-untyped {
    color: #166534 !important;
    opacity: 0.8 !important;
}
.theme-eco .typed-correct {
    color: #15803d !important;
    font-weight: 900 !important;
    text-shadow: none !important;
}
.theme-eco .hand-palm-path {
    fill: rgba(22, 101, 52, 0.08) !important;
    stroke: rgba(22, 101, 52, 0.35) !important;
}
.theme-eco .finger-path {
    fill: rgba(22, 101, 52, 0.15) !important;
    stroke: rgba(22, 101, 52, 0.45) !important;
}
.theme-eco .hand-label {
    fill: #14532d !important;
    font-weight: 900 !important;
}
.theme-eco .finger-path.highlight-finger {
    fill: #16a34a !important;
    stroke: #15803d !important;
    filter: drop-shadow(0 0 8px rgba(22, 163, 74, 0.8)) !important;
}
.theme-eco #typing-input {
    background: #ffffff !important;
    border: 2px solid #4ade80 !important;
    color: #14532d !important;
}

/* Theme Cyber (Công nghệ tương lai) */
.theme-cyber .typing-target-box {
    background: #f8fafc !important;
    border: 2px solid #94a3b8 !important;
    color: #0f172a !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}
.theme-cyber .typing-target-box .typed-untyped {
    color: #334155 !important;
    opacity: 0.85 !important;
}
.theme-cyber .typed-correct {
    color: #0284c7 !important;
    font-weight: 900 !important;
    text-shadow: none !important;
}
.theme-cyber .hand-palm-path {
    fill: rgba(15, 23, 42, 0.08) !important;
    stroke: rgba(15, 23, 42, 0.35) !important;
}
.theme-cyber .finger-path {
    fill: rgba(15, 23, 42, 0.15) !important;
    stroke: rgba(15, 23, 42, 0.45) !important;
}
.theme-cyber .hand-label {
    fill: #0f172a !important;
    font-weight: 900 !important;
}
.theme-cyber .finger-path.highlight-finger {
    fill: #0284c7 !important;
    stroke: #0369a1 !important;
    filter: drop-shadow(0 0 8px rgba(2, 132, 199, 0.8)) !important;
}
.theme-cyber #typing-input {
    background: #ffffff !important;
    border: 2px solid #38bdf8 !important;
    color: #0f172a !important;
}

/* Theme Magic (Kỳ diệu thần thoại) */
.theme-magic .typing-target-box {
    background: #fdf4ff !important;
    border: 2px solid #f0abfc !important;
    color: #701a75 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}
.theme-magic .typing-target-box .typed-untyped {
    color: #701a75 !important;
    opacity: 0.85 !important;
}
.theme-magic .typed-correct {
    color: #c026d3 !important;
    font-weight: 900 !important;
    text-shadow: none !important;
}
.theme-magic .hand-palm-path {
    fill: rgba(112, 26, 117, 0.08) !important;
    stroke: rgba(112, 26, 117, 0.35) !important;
}
.theme-magic .finger-path {
    fill: rgba(112, 26, 117, 0.15) !important;
    stroke: rgba(112, 26, 117, 0.45) !important;
}
.theme-magic .hand-label {
    fill: #4a044e !important;
    font-weight: 900 !important;
}
.theme-magic .finger-path.highlight-finger {
    fill: #c026d3 !important;
    stroke: #a21caf !important;
    filter: drop-shadow(0 0 8px rgba(192, 38, 211, 0.8)) !important;
}
.theme-magic #typing-input {
    background: #ffffff !important;
    border: 2px solid #e879f9 !important;
    color: #4a044e !important;
}

/* ============================================================
   QUEST CONTEXT NPC — Animations & Styles
   ============================================================ */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes npcEntrance {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

#quest-npc-banner {
    animation: npcEntrance 0.3s ease forwards;
}

#quest-npc-success {
    animation: fadeInUp 0.3s ease forwards;
}

#npc-icon-wrap {
    transition: transform 0.3s ease;
}
#quest-npc-banner:hover #npc-icon-wrap {
    transform: scale(1.1);
}

/* Boss Arena Styles */
@keyframes bossFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes bossHitAnim {
    0% { transform: scale(1) translateX(0); filter: drop-shadow(0 0 20px rgba(225,29,72,0.6)); }
    20% { transform: scale(0.9) translateX(-10px); filter: brightness(2) drop-shadow(0 0 40px red); }
    40% { transform: scale(1.1) translateX(10px); filter: brightness(2) drop-shadow(0 0 40px red); }
    60% { transform: scale(0.9) translateX(-10px); filter: brightness(2) drop-shadow(0 0 40px red); }
    80% { transform: scale(1.1) translateX(10px); filter: brightness(2) drop-shadow(0 0 40px red); }
    100% { transform: scale(1) translateX(0); filter: drop-shadow(0 0 20px rgba(225,29,72,0.6)); }
}

@keyframes damageFloat {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-50px) scale(1.5); }
}

@keyframes timerPenaltyAnim {
    0% { transform: scale(1); filter: none; }
    50% { transform: scale(1.2); filter: drop-shadow(0 0 10px red) brightness(2); color: white; background: red; }
    100% { transform: scale(1); filter: none; }
}

.boss-sprite-large {
    animation: bossFloat 3s ease-in-out infinite;
}

.boss-sprite-large.boss-hit-anim {
    animation: bossHitAnim 0.5s ease-out forwards;
}

.damage-popup {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: 900;
    color: #ef4444;
    text-shadow: 0px 4px 10px rgba(0,0,0,0.8), 0 0 5px #fff;
    pointer-events: none;
    z-index: 100;
    animation: damageFloat 1s ease-out forwards;
}

.timer-penalty-anim {
    animation: timerPenaltyAnim 0.5s ease-out forwards;
}

/* ================== TAB BẢN ĐỒ ================== */
.map-area {
    background: var(--bg-color);
}

.map-path-container {
    width: 100%;
    min-height: 550px;
    background: 
        radial-gradient(circle at 20% 50%, rgba(56, 189, 248, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(245, 158, 11, 0.06) 0%, transparent 50%),
        radial-gradient(circle at center, #1e3a5f 0%, #0b1526 100%);
    border-radius: 1.5rem;
    border: 4px solid #38bdf8;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.8), 0 10px 30px rgba(0,0,0,0.5), 0 0 0 1px rgba(56,189,248,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding: 3rem 1.5rem;
    flex-wrap: nowrap;
    position: relative;
    overflow: hidden;
}

/* Starfield decorative dots */
.map-path-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 30% 70%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 30%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 60%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 10%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 85%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(2px 2px at 70% 15%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 55%, rgba(255,255,255,0.3) 0%, transparent 100%);
    pointer-events: none;
}

/* Đường nối đứt quãng cũ (đã xóa .map-path-line, thay bằng pseudo element trên node) */
.map-path-line {
    display: none;
}

.map-node {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    border: 4px solid rgba(255,255,255,0.15);
    background: #1e293b;
    color: #94a3b8;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.map-node:hover {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

.map-node i {
    font-size: 2.2rem;
    margin-bottom: 0.25rem;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
}

.map-node .node-title {
    font-size: 0.65rem;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
}

.map-node.node-locked {
    opacity: 0.75;
    cursor: not-allowed;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-color: #475569;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}
.map-node.node-locked:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.map-node.node-completed {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(5, 150, 105, 0.6));
    color: #a7f3d0;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5), inset 0 0 10px rgba(255,255,255,0.2);
}

.map-node.node-current {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.4), rgba(217, 119, 6, 0.6));
    color: #fef3c7;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.7), inset 0 0 15px rgba(255,255,255,0.4);
    animation: nodePulse 2s infinite;
}

.map-node.node-boss {
    width: 110px;
    height: 110px;
    border-color: #e11d48;
    color: #fecdd3;
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.5), rgba(159, 18, 57, 0.7));
    box-shadow: 0 0 30px rgba(225, 29, 72, 0.6), inset 0 0 15px rgba(255,255,255,0.2);
}

/* ── Rương Kho Báu ── */
.map-node.node-treasure {
    width: 115px;
    height: 115px;
    border-color: #f59e0b;
    color: #fef3c7;
    background: linear-gradient(135deg, rgba(245,158,11,0.55), rgba(180,83,9,0.75));
    box-shadow: 0 0 35px rgba(245,158,11,0.7), 0 0 60px rgba(245,158,11,0.25), inset 0 0 18px rgba(255,255,255,0.25);
    animation: treasurePulse 2.2s ease-in-out infinite;
}
.map-node.node-treasure .node-title {
    color: #fde68a;
    font-size: 0.6rem;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.map-node.node-treasure:hover {
    transform: scale(1.18) translateY(-6px) rotate(2deg);
    box-shadow: 0 0 50px rgba(245,158,11,0.9), 0 12px 30px rgba(0,0,0,0.5);
}

@keyframes treasurePulse {
    0%   { box-shadow: 0 0 20px rgba(245,158,11,0.7), 0 0 40px rgba(245,158,11,0.2), inset 0 0 18px rgba(255,255,255,0.25); }
    50%  { box-shadow: 0 0 40px rgba(245,158,11,0.9), 0 0 80px rgba(245,158,11,0.45), inset 0 0 22px rgba(255,255,255,0.4); }
    100% { box-shadow: 0 0 20px rgba(245,158,11,0.7), 0 0 40px rgba(245,158,11,0.2), inset 0 0 18px rgba(255,255,255,0.25); }
}


@keyframes nodePulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7), inset 0 0 15px rgba(255,255,255,0.4); }
    70% { box-shadow: 0 0 0 20px rgba(245, 158, 11, 0), inset 0 0 15px rgba(255,255,255,0.4); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0), inset 0 0 15px rgba(255,255,255,0.4); }
}

.avatar-indicator {
    position: absolute;
    top: -30px;
    font-size: 1.5rem;
    animation: bounce 1s infinite;
    color: #fde047;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}



/* ================== B�I T?P TR?C NGHI?M MAP ================== */
.mc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
}

.btn-mc-option {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: 2px solid #60a5fa;
    border-radius: 12px;
    padding: 12px;
    font-size: 1.2rem;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.btn-mc-option:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 15px rgba(37,99,235,0.5);
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.btn-mc-option:active {
    transform: translateY(2px) scale(0.98);
}

.btn-mc-option.correct {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border-color: #34d399 !important;
    box-shadow: 0 0 20px rgba(16,185,129,0.7) !important;
    animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-mc-option.wrong {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border-color: #f87171 !important;
    animation: shake 0.5s;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* ================== MAP ZIGZAG ================== */
#tab-map {
    background: radial-gradient(circle at center, #1e293b, #0f172a);
    border-radius: 16px;
}
.map-node:nth-of-type(odd) {
    transform: translateY(-30px);
}
.map-node:nth-of-type(even) {
    transform: translateY(30px);
}
.map-node:nth-of-type(odd):hover {
    transform: scale(1.15) translateY(-35px);
}
.map-node:nth-of-type(even):hover {
    transform: scale(1.15) translateY(25px);
}

/* Đường kẻ nối zigzag */
.map-node:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 70px; /* Bằng với gap (60px) + một chút bù đắp chéo */
    height: 4px;
    background: transparent;
    border-top: 4px dashed rgba(255, 255, 255, 0.4);
    z-index: -1;
}
.map-node:nth-of-type(odd):not(:last-child)::after {
    transform: rotate(45deg);
    transform-origin: left center;
}
.map-node:nth-of-type(even):not(:last-child)::after {
    transform: rotate(-45deg);
    transform-origin: left center;
}

/* ================== RARE SEED GLOW ================== */
.glow-rare-seed {
    box-shadow: 0 0 15px 5px rgba(217, 70, 239, 0.6) !important;
    border: 2px solid #d946ef !important;
    animation: rareSeedGlow 1.5s infinite alternate;
}
@keyframes rareSeedGlow {
    from { box-shadow: 0 0 10px rgba(217, 70, 239, 0.4); }
    to { box-shadow: 0 0 25px rgba(217, 70, 239, 0.8); }
}

/* ================== MAP LOCK OVERLAY ================== */
.map-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    z-index: 150;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 1.5rem;
    padding: 2rem;
}


/* ==========================================================================
   TOWN AREA (THỊ TRẤN)
   ========================================================================== */
.town-area {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(251, 191, 36, 0.2);
    box-shadow: inset 0 0 40px rgba(251, 191, 36, 0.05);
}

.town-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px dashed rgba(251, 191, 36, 0.3);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.town-buildings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding-bottom: 30px;
}

.building-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.building-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.6);
}

.building-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    opacity: 0.8;
}

.building-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.building-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(251, 191, 36, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
    box-shadow: inset 0 0 15px rgba(251, 191, 36, 0.2);
}

.building-info h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fcd34d;
    margin: 0 0 4px 0;
    letter-spacing: 0.5px;
}

.building-level {
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    background: rgba(245, 158, 11, 0.8);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.building-buff {
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #60a5fa;
}

.building-buff strong {
    color: #93c5fd;
}

.building-next-buff {
    font-size: 0.8rem;
    color: #a7f3d0;
    margin-top: 8px;
    font-style: italic;
}

.building-upgrade-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(to right, #10b981, #059669);
    color: white;
    font-weight: bold;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.building-upgrade-btn:hover:not(:disabled) {
    background: linear-gradient(to right, #34d399, #10b981);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
}

.building-upgrade-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.building-upgrade-btn:disabled {
    background: #475569;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.building-upgrade-btn .cost {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.building-maxed {
    text-align: center;
    color: #fbbf24;
    font-weight: bold;
    padding: 12px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 10px;
    font-size: 0.95rem;
}

/* ======================================================
   RESPONSIVE — ĐA THIẾT BỊ (iPad & Mobile)
   ====================================================== */

/* iPad ngang & dọc (768px – 1024px) */
@media screen and (max-width: 1024px) {
    .modal-card {
        width: 94%;
        max-width: 680px;
        padding: 20px;
        border-radius: 24px;
        max-height: 90vh;
    }
    .btn-mc-option {
        font-size: 1.05rem;
        padding: 10px 8px;
    }
    .mc-grid {
        gap: 10px;
    }
}

/* Mobile lớn (481px – 767px) */
@media screen and (max-width: 767px) {
    .modal-card {
        width: 97%;
        max-width: 100%;
        padding: 16px 14px;
        border-radius: 18px;
        max-height: 88vh;
    }
    .mc-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 10px;
    }
    .btn-mc-option {
        font-size: 0.95rem;
        padding: 9px 6px;
        border-radius: 10px;
    }
    .virtual-keyboard-wrapper {
        max-width: 100% !important;
        padding: 6px !important;
    }
}

/* Mobile nhỏ (≤ 480px) */
@media screen and (max-width: 480px) {
    .modal-card {
        width: 99%;
        padding: 12px 10px;
        border-radius: 14px;
        max-height: 86vh;
        gap: 10px;
    }
    .mc-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-top: 8px;
    }
    .btn-mc-option {
        font-size: 0.88rem;
        padding: 8px 4px;
        border-radius: 8px;
    }
}

/* ======================================================
   RESPONSIVE CHO SIDEBAR & INVENTORY
   ====================================================== */
@media screen and (max-width: 1024px) {
    .sidebar {
        width: clamp(170px, 20vw, 240px);
        padding: 12px;
        gap: 12px;
    }
    .inventory-grid {
        gap: 7px;
    }
    .inv-card {
        padding: 8px 6px;
        border-radius: 12px;
    }
    .inv-icon { font-size: 20px; margin-bottom: 4px; }
    .inv-name { font-size: 10px; }
    .inv-qty  { font-size: 10px; padding: 1px 5px; top: 5px; right: 6px; }
    .sidebar-title { font-size: 11px; }
    .farm-grid { max-width: 100%; gap: 10px; grid-template-columns: repeat(4, 1fr); }
}

@media screen and (max-width: 767px) {
    .sidebar {
        width: clamp(140px, 28vw, 200px);
        padding: 8px;
        gap: 8px;
    }
    .inventory-grid { gap: 5px; }
    .inv-card   { padding: 6px 4px; border-radius: 10px; }
    .inv-icon   { font-size: 18px; margin-bottom: 3px; }
    .inv-name   { font-size: 9px; }
    .inv-qty    { font-size: 9px; padding: 1px 4px; top: 4px; right: 4px; }
    .sidebar-title { font-size: 10px; letter-spacing: 1px; }
    .farm-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        max-width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .sidebar { width: clamp(120px, 32vw, 180px); padding: 6px; }
    .inventory-grid { gap: 4px; }
    .inv-card { padding: 5px 3px; }
    .inv-icon { font-size: 16px; }
    .inv-name { font-size: 8px; }
    .farm-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}

/* ======================================================
   RESPONSIVE CHO TAB MENU BAR
   ====================================================== */
@media screen and (max-width: 1024px) {
    .tab-menu-bar {
        gap: 6px !important;
        padding: 8px !important;
    }
    .btn-tab {
        padding: 7px 12px !important;
        font-size: 12px !important;
        gap: 5px !important;
    }
}

@media screen and (max-width: 767px) {
    .tab-menu-bar {
        gap: 5px !important;
        padding: 7px 6px !important;
    }
    .btn-tab {
        padding: 6px 9px !important;
        font-size: 11px !important;
        gap: 4px !important;
    }
    .btn-tab i { font-size: 11px; }
}

@media screen and (max-width: 480px) {
    .tab-menu-bar {
        gap: 4px !important;
        padding: 5px 4px !important;
    }
    .btn-tab {
        padding: 5px 7px !important;
        font-size: 10px !important;
        gap: 3px !important;
    }
    .btn-tab i { font-size: 10px; }
}

/* Assistant box ở góc dưới phải khi Trợ Lý TẮT — không che nội dung chính */
#assistant-box.assistant-tucked {
    left: auto !important;
    right: 12px !important;
    bottom: 12px !important;
    top: auto !important;
    opacity: 0.75;
    transform: scale(0.85);
    pointer-events: auto;
}

/* ======================================================
   RESPONSIVE CHO MÀN HÌNH CHỌN LỚP & THẾ GIỚI
   Đồng bộ với cách scale của màn hình chơi game chính
   ====================================================== */

/* Tablet (769px – 1024px) */
@media screen and (max-width: 1024px) {
    .logo-title { font-size: 44px; }
    .logo-tagline { font-size: 14px; }

    .setup-grid {
        gap: 20px;
        max-width: 700px;
        margin: 14px 0;
    }

    .setup-card {
        padding: 16px;
        gap: 12px;
        border-radius: 20px;
    }

    .setup-card h3 { font-size: 16px; }

    .btn-select {
        padding: 10px 8px;
        font-size: 14px;
        border-radius: 14px;
    }

    .btn-start {
        font-size: 16px;
        padding: 14px 50px;
        margin-bottom: 16px;
    }
}

/* Mobile lớn (481px – 767px) */
@media screen and (max-width: 767px) {
    #screen-welcome { padding: 20px 16px; }

    .logo-title { font-size: 36px; }
    .logo-tagline { font-size: 12px; letter-spacing: 1.5px; }
    .logo-area { margin-top: 10px; }

    .setup-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
        max-width: 100%;
        margin: 12px 0;
    }

    .setup-card {
        padding: 14px 12px;
        gap: 10px;
        border-radius: 16px;
    }

    .setup-card h3 {
        font-size: 14px;
        gap: 7px;
        padding-bottom: 8px;
    }

    .btn-grid { gap: 8px; }

    .btn-select {
        padding: 9px 6px;
        font-size: 13px;
        border-radius: 12px;
        gap: 6px;
    }

    .btn-start {
        font-size: 15px;
        padding: 12px 40px;
        margin-bottom: 12px;
    }
}

/* Mobile nhỏ (≤ 480px) */
@media screen and (max-width: 480px) {
    #screen-welcome { padding: 14px 10px; }

    .logo-title { font-size: 28px; }
    .logo-tagline { font-size: 10px; letter-spacing: 1px; }
    .logo-area { margin-top: 6px; }

    .setup-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 10px 0;
    }

    .setup-card {
        padding: 12px 10px;
        gap: 8px;
        border-radius: 14px;
    }

    .setup-card h3 {
        font-size: 13px;
        gap: 6px;
        padding-bottom: 7px;
    }

    .btn-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px;
    }

    .btn-select {
        padding: 8px 5px;
        font-size: 12px;
        border-radius: 10px;
        gap: 5px;
    }

    .btn-start {
        font-size: 14px;
        padding: 11px 30px;
        margin-bottom: 10px;
    }
}

/* ===== NEW EXERCISE TYPES STYLES ===== */

/* True / False */
.tf-btn {
    flex: 1;
    padding: 16px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s, filter 0.1s;
    color: white;
}
.btn-true { background-color: #10b981; }
.btn-false { background-color: #ef4444; }
.tf-btn:active { transform: scale(0.95); filter: brightness(0.9); }

/* Find Error */
.fe-word {
    padding: 10px 18px;
    font-size: 19px;
    font-weight: 800;
    color: #0f172a !important;
    background: #ffffff !important;
    border: 2.5px solid #cbd5e1;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-shadow: none !important;
}
.fe-word:hover {
    background: #fef08a !important;
    color: #854d0e !important;
    border-color: #f59e0b !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 18px rgba(245, 158, 11, 0.4);
}
.fe-word:active { transform: scale(0.95); }

/* Categorize */
.cat-item-to-sort {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 20px;
    padding: 14px 24px;
    background: #ffffff !important;
    border-radius: 16px;
    display: inline-block;
    color: #0f172a !important;
    border: 3px dashed #64748b;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    text-shadow: none !important;
}
.cat-bucket {
    flex: 1;
    padding: 18px;
    border: 3px dashed #94a3b8;
    border-radius: 18px;
    background: #ffffff !important;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.cat-bucket:hover {
    border-color: #8b5cf6 !important;
    background: #f5f3ff !important;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}
.cat-bucket:active { transform: scale(0.95); }
.cat-bucket-icon { font-size: 34px; margin-bottom: 8px; }
.cat-bucket-name { font-weight: 800; font-size: 16px; color: #1e293b !important; text-shadow: none !important; }
