#minigame-overlay {
    position: fixed;
    top: 0; inset-inline-start: 0; inset-inline-end: 0; bottom: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: var(--bg);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.mg-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
}

.mg-header h2 { 
    margin: 0; 
    font-size: 1.1rem; 
    text-align: center; 
    flex: 1; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    padding: 0 30px; 
}

.mg-close {
    background: none; border: none; color: var(--text);
    font-size: 1.5rem; cursor: pointer;
    position: absolute;
    inset-inline-end: 20px;
}

.mg-content {
    flex: 1;
    width: 100%;
    padding: 12px 20px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Quiz Boss / Memory Match Styles */
.boss-health-bar {
    width: 100%; max-width: 480px;
    height: 14px; background: rgba(255,255,255,0.08);
    border-radius: 7px; overflow: hidden;
    margin: 0; border: 1px solid var(--border);
}

.boss-health-fill {
    height: 100%; background: var(--danger);
    width: 100%; transition: transform 0.3s; transform-origin: left;
}

.mg-question {
    font-size: 1.05rem; font-weight: bold; text-align: center;
    margin: 0; max-width: 480px;
    line-height: 1.4;
}

.mg-options {
    display: flex; flex-direction: column; gap: 8px;
    width: 100%; max-width: 480px;
}

.mg-option {
    padding: 12px 14px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 10px;
    color: var(--text); font-weight: bold; cursor: pointer;
    transition: all 0.2s; font-size: 0.95rem; line-height: 1.35;
    text-align: center;
}

.mg-option:hover { background: rgba(108, 92, 231, 0.1); border-color: #6c5ce7; }
.mg-option:active { background: rgba(255, 193, 7, 0.15) !important; border-color: #ffc107 !important; color: var(--text) !important; transform: scale(0.98); }
.mg-option.selected { background: rgba(255, 193, 7, 0.15) !important; border-color: #ffc107 !important; color: var(--text) !important; }
.mg-option.correct { background: rgba(34, 197, 94, 0.15) !important; border-color: var(--success) !important; color: var(--text) !important; }
.mg-option.wrong { background: rgba(239, 68, 68, 0.18) !important; border-color: var(--danger) !important; color: var(--text) !important; }

.mg-question .keyword, .mg-question .kw, .mg-question span.keyword {
    color: #ffc107 !important;
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.8) !important;
    font-weight: 900 !important;
    display: inline !important;
    margin: 0 2px !important;
}

.mg-option .answer-keyword, .mg-option .keyword, .mg-option .kw {
    color: inherit !important;
    text-shadow: none !important;
    font-weight: inherit !important;
    text-decoration: none !important;
}

.mg-option.correct .answer-keyword, .mg-option.correct .keyword, .mg-option.correct .kw {
    color: #ffc107 !important;
    text-shadow: 0 0 12px rgba(255, 193, 7, 1) !important;
    font-weight: 900 !important;
    text-decoration: none !important;
}

/* =========================================================
   TOAST NOTIFICATION
   ========================================================= */
.mg-toast {
    position: fixed;
    top: calc(max(env(safe-area-inset-top, 24px), 24px) + 36px);
    inset-inline-start: 50%;
    transform: translate(-50%, -150px);
    background: var(--surface);
    border: 1px solid var(--danger);
    color: #fff;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(255, 107, 107, 0.4);
    z-index: 99999;
    transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
    text-align: center;
    max-width: 90vw;
    pointer-events: none;
}
.mg-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
.mg-toast.success {
    border-color: var(--success);
    box-shadow: 0 12px 32px rgba(0, 210, 160, 0.4);
}

/* =========================================================
   STAGE PREVIEW MODAL (HỒ SƠ ẢI TRƯỚC KHI VÀO TRẬN)
   ========================================================= */
.stage-preview-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    animation: fadeIn 0.25s ease;
}

.stage-preview-card {
    background: var(--surface);
    border: 1px solid var(--border-blue);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 24px;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stage-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-lt);
    color: #a29bfe;
    border: 1px solid var(--border-indigo);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.stage-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 10px 0;
    line-height: 1.35;
}

.stage-desc {
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.5;
    margin: 0 0 20px 0;
}

.stage-stars-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.stage-btn-start {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, #4834d4 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}
.stage-btn-start:active {
    transform: scale(0.97);
}

.stage-btn-close {
    position: absolute;
    top: 14px;
    inset-inline-end: 16px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

/* =========================================================
   1. MEMORY MATCH (LẬT THẺ TRÍ NHỚ)
   ========================================================= */
.memory-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 480px;
    margin-bottom: 18px;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 480px;
    perspective: 1000px;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

@media (min-width: 440px) {
    .memory-grid.grid-8 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.memory-card {
    aspect-ratio: 1 / 1.15;
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.memory-card-inner {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: 12px;
}

.memory-card.flipped .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    text-align: center;
    border: 1px solid var(--border);
}

.card-back {
    background: linear-gradient(145deg, #1f1f38 0%, #151528 100%);
    box-shadow: inset 0 0 10px rgba(108, 92, 231, 0.2);
    color: #a29bfe;
}
.card-back::after {
    content: '★';
    font-size: 1.4rem;
    color: rgba(162, 155, 254, 0.4);
}

.card-front {
    background: var(--surface);
    transform: rotateY(180deg);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-y: auto;
    border-color: var(--border-blue);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.memory-card.matched .card-front {
    background: rgba(0, 210, 160, 0.15) !important;
    border-color: var(--success) !important;
    color: #fff !important;
    box-shadow: 0 0 12px rgba(0, 210, 160, 0.5);
}

.memory-card.matched {
    pointer-events: none;
}

.memory-card.mismatch {
    animation: cardShake 0.4s ease;
}
.memory-card.mismatch .card-front {
    border-color: var(--danger) !important;
}

/* =========================================================
   2. CLOZE FILL (CHẠM ĐIỀN TỪ KHUYẾT)
   ========================================================= */
.cloze-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 480px;
    align-items: center;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.cloze-progress-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--muted);
}

.cloze-passage-card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 18px;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
    text-align: left;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.cloze-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 34px;
    padding: 0 12px;
    border: 2px dashed var(--primary);
    border-radius: 8px;
    background: rgba(108, 92, 231, 0.08);
    margin: 0 4px;
    vertical-align: middle;
    cursor: pointer;
    font-weight: 800;
    color: #ffcc00;
    transition: all 0.2s;
}

.cloze-slot.empty {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
}

.cloze-slot.filled {
    border-style: solid;
    border-color: #a29bfe;
    background: rgba(108, 92, 231, 0.25);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(108, 92, 231, 0.4);
}

.cloze-slot.correct {
    border-color: var(--success) !important;
    background: rgba(0, 210, 160, 0.2) !important;
    color: var(--success) !important;
    box-shadow: 0 0 12px rgba(0, 210, 160, 0.5) !important;
}

.cloze-slot.wrong {
    border-color: var(--danger) !important;
    background: rgba(255, 107, 107, 0.2) !important;
    animation: cardShake 0.3s ease;
}

.cloze-chips-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.cloze-chip {
    padding: 9px 16px;
    background: var(--surface);
    border: 1px solid var(--border-blue);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s, background 0.15s, opacity 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.cloze-chip:active {
    transform: scale(0.92);
}

.cloze-chip.used {
    opacity: 0.25;
    pointer-events: none;
    transform: scale(0.9);
}

.cloze-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 10px;
}

/* =========================================================
   3. SWIPE & SORT (QUẸT THẺ TINDER PHÂN LOẠI)
   ========================================================= */
.swipe-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 440px;
    align-items: center;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    position: relative;
}

.swipe-header-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 8px;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.swipe-label-box {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 0.88rem;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 10px;
}

.label-left {
    color: var(--danger);
    background: var(--danger-lt);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.label-right {
    color: var(--success);
    background: var(--success-lt);
    border: 1px solid rgba(0, 210, 160, 0.3);
}

.swipe-arena {
    position: relative;
    width: 100%;
    height: 270px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 800px;
}

.swipe-card {
    position: absolute;
    width: 92%;
    height: 260px;
    background: linear-gradient(145deg, var(--surface-light), var(--surface));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 28px;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.5;
    color: #fff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    cursor: grab;
    user-select: none;
    /* [QA FIX] Bật Hardware Acceleration để chống lag/bóng mờ khi quẹt thẻ */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    touch-action: none;
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
.swipe-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}
.swipe-card:active {
    cursor: grabbing;
}

.swipe-stamp {
    position: absolute;
    top: 20px;
    padding: 6px 14px;
    border: 3px solid;
    border-radius: 8px;
    font-size: 1.4rem;
    font-weight: 900;
    text-transform: uppercase;
    opacity: 0;
    transform: rotate(-15deg);
    pointer-events: none;
    transition: opacity 0.1s ease;
}
.swipe-stamp.stamp-left {
    inset-inline-end: 20px;
    color: var(--danger);
    border-color: var(--danger);
    transform: rotate(15deg);
}
.swipe-stamp.stamp-right {
    inset-inline-start: 20px;
    color: var(--success);
    border-color: var(--success);
    transform: rotate(-15deg);
}

.swipe-controls {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
    margin-top: 24px;
}

.swipe-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 10px;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: transparent;
}
.swipe-btn:active {
    transform: scale(0.92);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.swipe-btn-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: all 0.2s;
}

.swipe-btn.btn-left .swipe-btn-icon {
    color: #ff6b6b;
    border: 2px solid rgba(255, 107, 107, 0.5);
    background: rgba(255, 107, 107, 0.1);
}
.swipe-btn.btn-left:hover .swipe-btn-icon {
    background: rgba(255, 107, 107, 0.2);
    transform: scale(1.1);
}
.swipe-btn.btn-left .swipe-btn-text {
    color: #ff6b6b;
    font-weight: 800;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.swipe-btn.btn-right .swipe-btn-icon {
    color: #1dd1a1;
    border: 2px solid rgba(29, 209, 161, 0.5);
    background: rgba(29, 209, 161, 0.1);
}
.swipe-btn.btn-right:hover .swipe-btn-icon {
    background: rgba(29, 209, 161, 0.2);
    transform: scale(1.1);
}
.swipe-btn.btn-right .swipe-btn-text {
    color: #1dd1a1;
    font-weight: 800;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================================
   COMMON ANIMATIONS & BADGES
   ========================================================= */
@keyframes cardShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Badge loại game gắn trên Node Cây Kỹ Năng */
.game-type-badge {
    position: absolute;
    bottom: -4px;
    inset-inline-end: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface);
    border: 1.5px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    z-index: 3;
}

/* Node FINAL BOSS ở đỉnh Cây Kỹ Năng */
.skill-node.boss-node {
    width: 72px !important;
    height: 72px !important;
    border: 3px solid #ff4757 !important;
    background: radial-gradient(circle, #381216 0%, #150508 100%) !important;
    box-shadow: 0 0 25px rgba(255, 71, 87, 0.6), inset 0 0 15px rgba(255, 71, 87, 0.3) !important;
    animation: bossPulse 2s infinite alternate !important;
}

.skill-node.boss-node .node-stars {
    top: -36px !important;
}

@keyframes bossPulse {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 71, 87, 0.5); }
    100% { transform: scale(1.06); box-shadow: 0 0 35px rgba(255, 71, 87, 0.85); }
}


/* =========================================================
   GAME 2: DRAG TIMELINE (SẮP XẾP QUY TRÌNH)
   ========================================================= */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 480px;
    align-items: center;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.timeline-step-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.timeline-step-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border-blue);
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    gap: 12px;
    transition: transform 0.2s, border-color 0.2s;
    user-select: none;
}

.timeline-step-card.correct {
    border-color: var(--success) !important;
    background: rgba(0, 210, 160, 0.12) !important;
}

.timeline-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-lt);
    border: 1px solid var(--border-indigo);
    color: #a29bfe;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.timeline-step-text {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
}

.timeline-step-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.btn-step-move {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    width: 28px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: bold;
    transition: background 0.15s;
}
.btn-step-move:active {
    background: var(--primary);
}

/* =========================================================
   GAME 3: CONNECT LINES (NỐI DÂY LOGIC 1-1)
   ========================================================= */
.connect-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 480px;
    align-items: center;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    position: relative;
}

.connect-arena {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
    position: relative;
}

.connect-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    z-index: 2;
}

.connect-item {
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border-md);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
    text-align: center;
    user-select: none;
    transition: all 0.2s;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.connect-item.selected {
    border-color: #a29bfe !important;
    background: rgba(108, 92, 231, 0.25) !important;
    box-shadow: 0 0 12px rgba(108, 92, 231, 0.5);
    transform: scale(1.02);
}

.connect-item.paired {
    border-color: var(--success) !important;
    background: rgba(0, 210, 160, 0.15) !important;
    color: #fff !important;
}

/* =========================================================
   GAME 5: CHAIN DOMINO (MẮT XÍCH LOGIC A -> B -> C)
   ========================================================= */
.domino-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: 480px;
    align-items: center;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.domino-board {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.domino-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border-blue);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
    position: relative;
}

.domino-node.locked-slot {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    justify-content: center;
}

.domino-arrow {
    display: flex;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
    line-height: 1;
}

.domino-tray {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
}

.domino-piece {
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border-indigo);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.domino-piece:active {
    transform: scale(0.95);
}
.domino-piece.used {
    opacity: 0.3;
    pointer-events: none;
}

/* =========================================================
   GAME 6: SCENARIO JUDGE (PHÁN XỬ TÌNH HUỐNG THỰC TẾ)
   ========================================================= */
.case-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 480px;
    align-items: center;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.case-card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-amber-vs);
    border-radius: 16px;
    padding: 18px;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    text-align: left;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.case-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.case-desc {
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text);
    margin: 0;
}

.case-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.case-opt-btn {
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.93rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}
.case-opt-btn:hover {
    background: rgba(255,255,255,0.08);
}
.case-opt-btn.correct {
    border-color: var(--success) !important;
    background: rgba(0, 210, 160, 0.15) !important;
}
.case-opt-btn.wrong {
    border-color: var(--danger) !important;
    background: rgba(255, 107, 107, 0.15) !important;
}

/* =========================================================
   GAME 8: KEYWORD SNIPER (BẮN TỈA TỪ KHÓA + THÁO BOM)
   ========================================================= */
.sniper-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: 480px;
    align-items: center;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    position: relative;
}



.sniper-target-card {
    width: 100%;
    background: rgba(30, 30, 45, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(162, 155, 254, 0.15);
    border-radius: 16px;
    padding: 28px 22px;
    box-sizing: border-box;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    font-size: 1.15rem;
    line-height: 2.1;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    box-shadow: inset 0 2px 20px rgba(162, 155, 254, 0.05), 0 8px 30px rgba(0, 0, 0, 0.4);
    user-select: none;
}

.sniper-word-click {
    cursor: crosshair;
    border-radius: 6px;
    transition: all 0.25s ease;
    /* [QA FIX] Bơm phồng vùng cảm ứng lên 3 lần, bất chấp chữ nhỏ */
    padding: 12px;
    margin: -12px;
    display: inline-block;
    position: relative;
    z-index: 5;
}
/* Highlight sẵn 4 từ khóa để user biết đâu là clickable */
.sniper-word-click.sniper-keyword {
    color: #a29bfe;
    background: transparent;
    border: none;
    box-shadow: none;
    text-decoration: underline solid rgba(162, 155, 254, 0.5);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}
.sniper-word-click:active {
    transform: scale(0.92);
}
.sniper-word-click.hit {
    color: var(--success) !important;
    font-weight: 900 !important;
    transform: scale(1.12);
    text-decoration: none !important;
    background: none !important;
    box-shadow: none !important;
}
.sniper-word-click.miss {
    color: var(--danger) !important;
    text-decoration: line-through !important;
    text-decoration-color: var(--danger) !important;
    background: none !important;
    box-shadow: none !important;
    animation: cardShake 0.3s ease;
}

@keyframes zapPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1.05); }
}

.swipe-header-labels { display: none !important; }

@keyframes bomb-spark-flicker {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    25% { transform: scale(1.3) rotate(15deg); opacity: 0.8; }
    50% { transform: scale(0.8) rotate(-10deg); opacity: 1; }
    75% { transform: scale(1.2) rotate(5deg); opacity: 0.9; }
}

.bomb-spark-anim {
    transform-origin: 19.5px 4.5px;
    animation: bomb-spark-flicker 0.15s infinite;
}
