/* ==========================================================================
   KHẢO THÍ VIỆT - BEELIO DESIGN SYSTEM ĐỈNH CAO (CSS)
   Phong cách học tập tương tác chuẩn Beelio Web:
   - Con đường uốn lượn SVG (Winding Road) với bóng đổ & sỏi trắng
   - Nút đảo 3D Isometric Bevel cao cấp với hiệu ứng ánh sáng
   - Vòng tròn tiến độ phát sáng (Pulse Ring)
   - Linh vật Ong Vàng và bong bóng hướng dẫn trực quan
   - Bố cục 3 cột cân đối, thanh lịch, chuyên nghiệp
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. COLOR PALETTE & VARIABLES
   -------------------------------------------------------------------------- */
:root {
  --beelio-game-green: #58CC02;
  --beelio-game-green-dark: #46A302;
  --beelio-game-green-shadow: #388E00;
  --beelio-game-green-light: #D7FFB8;
  --beelio-game-green-surface: #F2FDE6;

  --beelio-game-blue: #1CB0F6;
  --beelio-game-blue-dark: #1899D6;
  --beelio-game-blue-shadow: #0C7AB0;
  --beelio-game-blue-light: #DDF4FF;

  --beelio-game-gold: #FFC800;
  --beelio-game-gold-dark: #E5A500;
  --beelio-game-gold-shadow: #C68E00;
  --beelio-game-gold-light: #FFF4D0;

  --beelio-game-orange: #FF9600;
  --beelio-game-orange-dark: #E68600;
  --beelio-game-orange-shadow: #C07000;

  --beelio-game-red: #EA2B2B;
  --beelio-game-red-dark: #C41818;
  --beelio-game-red-shadow: #991313;
  --beelio-game-red-light: #FFDFE0;

  --beelio-game-purple: #CE82FF;
  --beelio-game-purple-dark: #A560E8;
  --beelio-game-purple-shadow: #8A3DD2;

  --beelio-game-gray-border: #E5E5E5;
  --beelio-game-gray-shadow: #CECECE;
  --beelio-game-gray-text: #777777;
  --beelio-game-gray-bg: #F7F7F7;

  --beelio-game-font: 'Nunito', 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --------------------------------------------------------------------------
   2. BEELIO 3D TACTILE BUTTONS
   -------------------------------------------------------------------------- */
.beelio-btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  font-family: var(--beelio-game-font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
  outline: none;
  border: none;
}

.beelio-btn-action:active:not(:disabled) {
  transform: translateY(3px);
}

.beelio-btn-green {
  background-color: var(--beelio-game-green);
  color: #FFFFFF;
  box-shadow: 0 4px 0 var(--beelio-game-green-dark);
}
.beelio-btn-green:hover:not(:disabled) {
  filter: brightness(1.05);
}
.beelio-btn-green:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--beelio-game-green-dark);
}

.beelio-btn-blue {
  background-color: var(--beelio-game-blue);
  color: #FFFFFF;
  box-shadow: 0 4px 0 var(--beelio-game-blue-dark);
}
.beelio-btn-blue:hover:not(:disabled) {
  filter: brightness(1.05);
}
.beelio-btn-blue:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--beelio-game-blue-dark);
}

.beelio-btn-red {
  background-color: var(--beelio-game-red);
  color: #FFFFFF;
  box-shadow: 0 4px 0 var(--beelio-game-red-dark);
}
.beelio-btn-red:hover:not(:disabled) {
  filter: brightness(1.05);
}
.beelio-btn-red:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--beelio-game-red-dark);
}

.beelio-btn-disabled,
.beelio-btn-action:disabled {
  background-color: #E5E5E5 !important;
  color: #AFAFAF !important;
  box-shadow: 0 4px 0 #D0D0D0 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.beelio-btn-huge {
  padding: 15px 32px;
  font-size: 17px;
  border-radius: 18px;
}

.beelio-btn-text {
  background: none;
  border: none;
  color: var(--beelio-game-gray-text);
  font-family: var(--beelio-game-font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 16px;
  text-decoration: underline;
}
.beelio-btn-text:hover {
  color: #1E293B;
}

/* --------------------------------------------------------------------------
   3. BEELIO STICKY STATS BAR (TOP GAMIFICATION)
   -------------------------------------------------------------------------- */
.beelio-stats-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--beelio-game-gray-border);
  padding: 8px 16px;
}

.beelio-stats-container {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.beelio-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--beelio-game-font);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  user-select: none;
}
.beelio-stat-pill:hover {
  transform: translateY(-1px);
}

.streak-pill {
  color: var(--beelio-game-orange);
  background: #FFF7ED;
  border: 1.5px solid #FFEDD5;
}
.streak-pill .flame-icon {
  display: inline-block;
  animation: flame-flicker 1.8s infinite alternate ease-in-out;
}

@keyframes flame-flicker {
  0% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.15) rotate(3deg); }
  100% { transform: scale(1.05) rotate(-3deg); }
}

.gems-pill {
  color: var(--beelio-game-blue);
  background: #EFF6FF;
  border: 1.5px solid #DBEAFE;
}

.flowers-pill {
  color: #EC4899;
  background: #FDF2F8;
  border: 1.5px solid #FCE7F3;
}

.hearts-pill {
  color: var(--beelio-game-red);
  background: #FEF2F2;
  border: 1.5px solid #FEE2E2;
}
.hearts-pill.shake {
  animation: beelio-shake 0.4s ease-in-out;
}

.xp-pill {
  color: var(--beelio-game-gold-dark);
  background: #FFFBEB;
  border: 1.5px solid #FEF3C7;
}

.beelio-switch-catalog-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: #FFFFFF;
  color: #1E3A8A;
  border: 2px solid #BFDBFE;
  box-shadow: 0 2px 0 #93C5FD;
  border-radius: 999px;
  font-family: var(--beelio-game-font);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.12s ease;
}
.beelio-switch-catalog-btn:hover {
  background: #EFF6FF;
  border-color: #3B82F6;
}
.beelio-switch-catalog-btn:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 #93C5FD;
}

/* --------------------------------------------------------------------------
   4. BỐ CỤC CHÍNH BEELIO (MAIN LAYOUT: CENTER PATH + RIGHT SIDEBAR)
   -------------------------------------------------------------------------- */
.beelio-path-page-wrapper {
  background-color: #FAF8F5;
  min-height: 100vh;
  padding-bottom: 70px;
}

.beelio-main-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 36px;
  margin-top: 24px;
  max-width: 1060px;
}

.beelio-path-column {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.beelio-unit-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* BANNER CHƯƠNG CHUẨN BEELIO (UNIT BANNER PRO) */
.beelio-unit-banner-pro {
  width: 100%;
  max-width: 540px;
  background: linear-gradient(135deg, var(--unit-color) 0%, var(--unit-accent) 100%);
  color: #FFFFFF;
  border-radius: 20px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
  margin-bottom: 12px;
}

.banner-pro-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 4px;
}

.banner-pro-title {
  font-family: var(--beelio-game-font);
  font-size: 20px;
  font-weight: 900;
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.banner-pro-desc {
  font-size: 13px;
  margin: 0;
  opacity: 0.95;
  line-height: 1.4;
}

.beelio-btn-guidebook-pro {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 14px;
  font-family: var(--beelio-game-font);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.beelio-btn-guidebook-pro:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   5. CANVAS CON ĐƯỜNG UỐN LƯỢN SVG (WINDING ROAD) & NÚT 3D ISOMETRIC
   -------------------------------------------------------------------------- */
.beelio-winding-road-canvas {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

/* SVG ROAD ĐƯỢC VẼ XUYÊN SUỐT */
.beelio-road-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.road-path-shadow {
  stroke: #CBD5E1;
  stroke-width: 24px;
  stroke-linecap: round;
  fill: none;
  transform: translateY(4px);
}

.road-path-base {
  stroke: #E2E8F0;
  stroke-width: 20px;
  stroke-linecap: round;
  fill: none;
}

.road-path-dashes {
  stroke: #FFFFFF;
  stroke-width: 4px;
  stroke-dasharray: 8 16;
  stroke-linecap: round;
  fill: none;
  opacity: 0.9;
}

/* CÁC YẾU TỐ TRANG TRÍ MÔI TRƯỜNG THẾ GIỚI GAME (DECOR) */
.beelio-decor-element {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  font-size: 26px;
  user-select: none;
  opacity: 0.85;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}
.decor-cloud-1 {
  animation: cloud-sway-1 6s infinite ease-in-out alternate;
}
.decor-cloud-2 {
  animation: cloud-sway-2 7s infinite ease-in-out alternate;
}

@keyframes cloud-sway-1 {
  0% { transform: translateX(0); }
  100% { transform: translateX(12px); }
}
@keyframes cloud-sway-2 {
  0% { transform: translateX(0); }
  100% { transform: translateX(-14px); }
}

/* VỊ TRÍ CỦA TỪNG NODE TRÊN BẢN ĐỒ */
.beelio-node-positioner {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* KHUNG CHỨA NÚT PUCK 3D */
.beelio-puck-anchor {
  position: relative;
  width: 86px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* VÒNG TRÒN TIẾN ĐỘ PHÁT SÁNG CHO BÀI ĐANG HỌC (PROGRESS RING) */
.beelio-puck-progress-ring {
  position: absolute;
  top: -11px;
  left: -11px;
  width: 106px;
  height: 106px;
  pointer-events: none;
  z-index: 2;
}

.ring-bg {
  stroke: #E2E8F0;
  stroke-width: 7;
  fill: none;
}

.ring-pulse {
  stroke: var(--beelio-game-green);
  stroke-width: 7;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 301;
  stroke-dashoffset: 140;
  animation: ring-pulse-glow 2s infinite ease-in-out;
}

@keyframes ring-pulse-glow {
  0%, 100% {
    stroke: var(--beelio-game-green);
    filter: drop-shadow(0 0 2px rgba(88, 204, 2, 0.4));
  }
  50% {
    stroke: #86EFAC;
    filter: drop-shadow(0 0 8px rgba(88, 204, 2, 0.8));
  }
}

/* NÚT ĐẢO BÀI HỌC 3D ISOMETRIC (PUCK BUTTON) */
.beelio-puck-button {
  width: 76px;
  height: 70px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
  outline: none;
  z-index: 3;
}

.beelio-puck-button:active:not([data-is-locked="true"]) {
  transform: translateY(4px);
}

/* ĐƯỜNG PHẢN QUANG ÁNH SÁNG 3D TRÊN MẶT NÚT */
.puck-bevel-highlight {
  position: absolute;
  top: 4px;
  left: 14px;
  right: 14px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.puck-icon-content {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 4;
}

/* NÚT ĐANG HỌC (ACTIVE PUCK) */
.puck-active {
  background-color: var(--beelio-game-green);
  box-shadow: 0 9px 0 var(--beelio-game-green-dark);
}
.puck-active:hover {
  filter: brightness(1.08);
}
.puck-active:active {
  box-shadow: 0 3px 0 var(--beelio-game-green-dark);
}

/* NÚT ĐÃ HOÀN THÀNH (COMPLETED PUCK) */
.puck-completed {
  background-color: var(--beelio-game-gold);
  box-shadow: 0 9px 0 var(--beelio-game-gold-shadow);
}
.puck-completed:hover {
  filter: brightness(1.06);
}
.puck-completed:active {
  box-shadow: 0 3px 0 var(--beelio-game-gold-shadow);
}

/* NÚT ĐANG KHÓA (LOCKED PUCK CHUẨN BEELIO - ĐẦY SỨC HÚT VÀ GỢI MỞ) */
.puck-locked {
  background: linear-gradient(180deg, #F8FAFC 0%, #EDF2F7 100%);
  border: 2px solid #E2E8F0;
  box-shadow: 0 8px 0 #CBD5E1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.puck-locked:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 #CBD5E1;
  border-color: #CBD5E1;
}
.puck-locked:active {
  transform: translateY(3px);
  box-shadow: 0 5px 0 #CBD5E1;
}
.puck-locked .puck-icon-content {
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.puck-locked:hover .puck-icon-content {
  opacity: 1;
  transform: scale(1.08);
}

/* HUY HIỆU Ổ KHÓA MINI 3D VÀNG ĐỒNG Ở GÓC DƯỚI NÚT */
.beelio-puck-lock-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  z-index: 10;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.18));
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.beelio-puck-anchor:hover .beelio-puck-lock-badge {
  transform: scale(1.12) rotate(-6deg);
}

/* NÚT BOSS LEVEL / VƯƠNG MIỆN KHI MỞ KHÓA */
.puck-boss {
  width: 86px;
  height: 80px;
  background: linear-gradient(135deg, #FFC800 0%, #FF9600 100%);
  box-shadow: 0 9px 0 var(--beelio-game-gold-shadow);
}

/* NÚT BOSS LEVEL KHI ĐANG KHÓA (HUYỀN BÍ, LỘNG LẪY VÀ CUỐN HÚT) */
.puck-boss-locked {
  width: 86px;
  height: 80px;
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 60%, #FDE68A 100%);
  border: 2.5px solid #FCD34D;
  box-shadow: 0 9px 0 #F59E0B;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.puck-boss-locked:hover {
  transform: translateY(-2px);
  box-shadow: 0 11px 0 #F59E0B;
}
.puck-boss-locked:active {
  transform: translateY(3px);
  box-shadow: 0 6px 0 #F59E0B;
}
.puck-boss-locked .puck-icon-content {
  opacity: 0.9;
  filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.3));
}

/* TIÊU ĐỀ DƯỚI NÚT */
.beelio-puck-label-text {
  font-family: var(--beelio-game-font);
  font-size: 13px;
  font-weight: 800;
  color: #475569;
  margin-top: 10px;
  text-align: center;
  max-width: 130px;
  line-height: 1.25;
}
.beelio-puck-label-text.label-active {
  color: #15803D;
  font-weight: 900;
}

/* 3 SAO HOÀN THÀNH DƯỚI NÚT ĐÃ HỌC */
.beelio-puck-stars-bar {
  display: flex;
  gap: 3px;
  margin-top: 8px;
  font-size: 16px;
  color: #CBD5E1;
}
.puck-star.filled {
  color: #FFC800;
  filter: drop-shadow(0 1px 2px rgba(245, 158, 11, 0.4));
}

/* --------------------------------------------------------------------------
   6. BONG BÓNG ĐỒNG HÀNH ONG VÀNG (MASCOT GUIDE BEACON)
   -------------------------------------------------------------------------- */
.beelio-mascot-guide-beacon {
  position: absolute;
  left: 92px;
  top: -16px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  z-index: 20;
}

.beacon-speech-bubble {
  background: #FFFFFF;
  border: 2.5px solid var(--beelio-game-green);
  box-shadow: 0 4px 14px rgba(88, 204, 2, 0.25);
  border-radius: 14px;
  padding: 7px 14px;
  color: #166534;
  font-family: var(--beelio-game-font);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
  position: relative;
  white-space: nowrap;
  animation: beacon-bounce 1.5s infinite ease-in-out;
}

.bubble-arrow-left {
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #FFFFFF;
  border-left: 2.5px solid var(--beelio-game-green);
  border-bottom: 2.5px solid var(--beelio-game-green);
}

@keyframes beacon-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.beacon-bee-avatar {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* --------------------------------------------------------------------------
   7. RƯƠNG KHO BÁU BEELIO 3D (CHEST PUCK)
   -------------------------------------------------------------------------- */
.chest-positioner {
  margin: 6px 0;
}

.beelio-chest-puck-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s ease;
  outline: none;
}

.beelio-chest-puck-btn.ready {
  animation: chest-wobble 2s infinite ease-in-out;
}

@keyframes chest-wobble {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.04); }
}

.chest-badge-tag {
  font-family: var(--beelio-game-font);
  font-size: 11px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}

.chest-badge-tag.ready {
  background: #FEF08A;
  color: #854D0E;
  border: 1.5px solid #FACC15;
  box-shadow: 0 2px 0 #EAB308;
}

.chest-badge-tag.opened {
  background: #F1F5F9;
  color: #64748B;
  border: 1.5px solid #CBD5E1;
}

.chest-badge-tag.locked {
  background: linear-gradient(180deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
  border: 1.5px solid #F59E0B;
  box-shadow: 0 2px 0 #D97706;
  letter-spacing: 0.5px;
}

/* --------------------------------------------------------------------------
   8. CỘT PHẢI: TRẠM ĐỒNG HÀNH & NHIỆM VỤ NGÀY (SIDEBAR WIDGETS)
   -------------------------------------------------------------------------- */
.beelio-sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.beelio-pro-widget {
  background: #FFFFFF;
  border: 2px solid var(--beelio-game-gray-border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.companion-hero-widget {
  display: flex;
  gap: 16px;
  align-items: center;
}

.companion-hero-avatar-box {
  flex-shrink: 0;
}

.companion-hero-speech h4 {
  margin: 0 0 4px 0;
  font-family: var(--beelio-game-font);
  font-size: 16px;
  font-weight: 900;
  color: #1E3A8A;
}

.companion-hero-speech p {
  margin: 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
}

.widget-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.widget-pro-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--beelio-game-font);
  font-size: 16px;
  font-weight: 800;
  color: #1E293B;
  margin: 0;
}

.quest-count-badge {
  font-family: var(--beelio-game-font);
  font-size: 12px;
  font-weight: 900;
  color: var(--beelio-game-blue-dark);
  background: var(--beelio-game-blue-light);
  padding: 3px 9px;
  border-radius: 999px;
}

.quest-items-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quest-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quest-icon-box {
  font-size: 22px;
  flex-shrink: 0;
}

.quest-info {
  flex: 1;
}

.quest-text {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.quest-bar-track {
  height: 8px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
}

.quest-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--beelio-game-green) 0%, #10B981 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.quest-reward {
  font-family: var(--beelio-game-font);
  font-size: 12px;
  font-weight: 800;
  color: var(--beelio-game-blue);
  white-space: nowrap;
}

.widget-sub-note {
  font-size: 13px;
  color: #64748B;
  line-height: 1.45;
  margin: 0 0 14px 0;
}

.full-width {
  width: 100%;
}

/* --------------------------------------------------------------------------
   9. BEELIO INTERACTIVE LESSON VIEWPORT (PHÒNG HỌC TỪNG CÂU)
   -------------------------------------------------------------------------- */
.beelio-lesson-viewport {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #FFFFFF;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* HEADER PHÒNG HỌC */
.beelio-lesson-header {
  height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
}

.beelio-header-container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.beelio-btn-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.15s ease;
}
.beelio-btn-close:hover {
  background: #F1F5F9;
  color: #1E293B;
}

/* THANH TIẾN ĐỘ XANH LÁ MƯỢT MÀ */
.beelio-progress-container {
  flex: 1;
  height: 16px;
  background-color: #E5E5E5;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.beelio-progress-fill {
  height: 100%;
  background-color: var(--beelio-game-green);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.beelio-progress-glint {
  position: absolute;
  top: 3px;
  left: 8px;
  right: 8px;
  height: 4px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 999px;
}

.beelio-hearts-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--beelio-game-font);
  font-size: 18px;
  font-weight: 800;
  color: var(--beelio-game-red);
}

/* THÂN BÀI HỌC */
.beelio-lesson-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 120px 20px;
}

.beelio-question-container {
  max-width: 650px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* MASCOT & BONG BÓNG THOẠI TRONG CÂU HỎI */
.beelio-mascot-speech-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.beelio-mascot-frame {
  flex-shrink: 0;
}

.beelio-speech-bubble {
  position: relative;
  background: #FFFFFF;
  border: 2px solid var(--beelio-game-gray-border);
  border-radius: 18px;
  padding: 12px 18px;
  box-shadow: 0 3px 0 var(--beelio-game-gray-border);
}

.beelio-speech-text {
  font-family: var(--beelio-game-font);
  font-size: 15px;
  font-weight: 700;
  color: #334155;
}

.beelio-speech-arrow {
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border-left: 2px solid var(--beelio-game-gray-border);
  border-bottom: 2px solid var(--beelio-game-gray-border);
}

/* ĐỀ BÀI CÂU HỎI */
.beelio-prompt-card {
  background: #FFFFFF;
  border: 2px solid var(--beelio-game-gray-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 0 var(--beelio-game-gray-shadow);
}

.beelio-prompt-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.beelio-q-badge {
  font-size: 12px;
  font-weight: 900;
  color: var(--beelio-game-blue-dark);
  background: var(--beelio-game-blue-light);
  padding: 3px 10px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

.beelio-topic-badge {
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
  background: #F1F5F9;
  padding: 3px 10px;
  border-radius: 8px;
}

.beelio-tts-controls {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.beelio-autoread-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  color: #475569;
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--beelio-game-font);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.16s ease;
}

.beelio-autoread-btn:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
}

.beelio-autoread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94A3B8;
  transition: all 0.16s ease;
}

.beelio-autoread-btn.is-active {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #B45309;
}

.beelio-autoread-btn.is-active .beelio-autoread-dot {
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.beelio-speaker-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  color: #1E40AF;
  border-radius: 999px;
  padding: 4px 12px;
  font-family: var(--beelio-game-font);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.beelio-tts-controls .beelio-speaker-btn {
  margin-left: 0;
}
.beelio-speaker-btn:hover {
  background: #DBEAFE;
}
.beelio-speaker-btn.is-speaking {
  background: #ECFDF5;
  border-color: #34D399;
  color: #047857;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.beelio-soundwave {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}
.beelio-speaker-btn.is-speaking .beelio-soundwave {
  display: inline-flex;
}
.beelio-soundwave i {
  display: block;
  width: 2.5px;
  border-radius: 2px;
  background: currentColor;
  animation: beelioSoundBar 0.55s ease-in-out infinite alternate;
}
.beelio-soundwave i:nth-child(1) { height: 5px; animation-delay: 0s; }
.beelio-soundwave i:nth-child(2) { height: 10px; animation-delay: 0.16s; }
.beelio-soundwave i:nth-child(3) { height: 7px; animation-delay: 0.32s; }

@keyframes beelioSoundBar {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1.1); }
}

.beelio-prompt-content {
  font-family: var(--beelio-game-font);
  font-size: 20px;
  font-weight: 800;
  color: #1E293B;
  line-height: 1.5;
}

/* CÁC THẺ ĐÁP ÁN (CHUNKY TACTILE CARDS) */
.beelio-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.beelio-choice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: #FFFFFF;
  border: 2px solid var(--beelio-game-gray-border);
  box-shadow: 0 4px 0 var(--beelio-game-gray-shadow);
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.1s ease;
  text-align: left;
  font-family: var(--beelio-game-font);
  font-size: 17px;
  font-weight: 700;
  color: #1E293B;
  user-select: none;
  outline: none;
}

.beelio-choice-card:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.beelio-choice-card:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--beelio-game-gray-shadow);
}

.choice-key-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 2px solid var(--beelio-game-gray-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #64748B;
  flex-shrink: 0;
}

.choice-text-content {
  flex: 1;
}

.choice-key-hint {
  font-size: 12px;
  color: #94A3B8;
  font-weight: 600;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 2px 6px;
}

/* KHI ĐƯỢC CHỌN (SELECTED) */
.beelio-choice-card.selected {
  background-color: var(--beelio-game-blue-light) !important;
  border-color: var(--beelio-game-blue) !important;
  box-shadow: 0 4px 0 var(--beelio-game-blue-dark) !important;
  color: #0369A1 !important;
}
.beelio-choice-card.selected .choice-key-badge {
  background: var(--beelio-game-blue);
  color: #FFFFFF;
  border-color: var(--beelio-game-blue-dark);
}

/* ĐÁP ÁN ĐÚNG SAU KHI KIỂM TRA */
.beelio-choice-card.correct-answer {
  background-color: var(--beelio-game-green-light) !important;
  border-color: var(--beelio-game-green) !important;
  box-shadow: 0 4px 0 var(--beelio-game-green-dark) !important;
  color: #166534 !important;
}

/* ĐÁP ÁN SAI */
.beelio-choice-card.wrong-answer {
  background-color: var(--beelio-game-red-light) !important;
  border-color: var(--beelio-game-red) !important;
  box-shadow: 0 4px 0 var(--beelio-game-red-dark) !important;
  color: #991B1B !important;
}

/* THANH DƯỚI ĐÁY CỐ ĐỊNH */
.beelio-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #FFFFFF;
  border-top: 2px solid var(--beelio-game-gray-border);
  padding: 16px 24px;
  z-index: 50;
}

.beelio-bottom-content {
  max-width: 650px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
}

/* TẤM PHẢN HỒI TRƯỢT DƯỚI ĐÁY (SLIDING BOTTOM SHEET) */
.beelio-sheet-feedback {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 24px 28px;
  z-index: 200;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.beelio-sheet-feedback.visible {
  transform: translateY(0);
}

.beelio-sheet-inner {
  max-width: 650px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.beelio-sheet-status-col {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
}

.beelio-sheet-icon {
  font-size: 38px;
  flex-shrink: 0;
}

.beelio-sheet-headline {
  font-family: var(--beelio-game-font);
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 4px;
}

.beelio-sheet-subtext {
  font-size: 14px;
  line-height: 1.45;
}

/* ĐÚNG */
.sheet-correct {
  background-color: var(--beelio-game-green-light);
  border-top: 3px solid var(--beelio-game-green);
  color: #14532D;
}
.sheet-correct .beelio-sheet-icon {
  color: var(--beelio-game-green);
}

/* SAI */
.sheet-wrong {
  background-color: var(--beelio-game-red-light);
  border-top: 3px solid var(--beelio-game-red);
  color: #7F1D1D;
}
.sheet-wrong .beelio-sheet-icon {
  color: var(--beelio-game-red);
}

/* --------------------------------------------------------------------------
   10. MÀN HÌNH CHIẾN THẮNG & HẾT TIM
   -------------------------------------------------------------------------- */
.beelio-victory-view {
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(circle at center, #FFFBEB 0%, #FFFFFF 100%);
}

.beelio-confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1500;
}

.beelio-victory-card {
  max-width: 500px;
  width: 100%;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  z-index: 10;
}

.beelio-v-title {
  font-family: var(--beelio-game-font);
  font-size: 28px;
  font-weight: 900;
  color: var(--beelio-game-gold-dark);
  margin: 0;
}

.beelio-v-subtitle {
  font-size: 16px;
  color: #475569;
  margin: 0;
}

.beelio-stars-row {
  display: flex;
  gap: 12px;
  font-size: 44px;
  margin: 8px 0;
}
.v-star {
  opacity: 0.25;
  transition: transform 0.2s ease;
}
.v-star.active {
  opacity: 1;
  animation: star-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes star-pop {
  0% { transform: scale(0.3) rotate(-30deg); }
  60% { transform: scale(1.3) rotate(15deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.beelio-v-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.beelio-v-stat-card {
  background: #FFFFFF;
  border: 2px solid var(--beelio-game-gray-border);
  box-shadow: 0 3px 0 var(--beelio-game-gray-shadow);
  border-radius: 16px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-icon {
  font-size: 24px;
  margin-bottom: 4px;
}
.stat-val {
  font-family: var(--beelio-game-font);
  font-size: 18px;
  font-weight: 900;
  color: #1E293B;
}
.stat-lbl {
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
}

.beelio-v-streak-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFF7ED;
  border: 2px solid #FED7AA;
  border-radius: 16px;
  padding: 12px 18px;
  width: 100%;
  text-align: left;
}
.streak-flame {
  font-size: 32px;
  animation: flame-flicker 1.8s infinite alternate ease-in-out;
}
.streak-banner-text {
  display: flex;
  flex-direction: column;
  font-family: var(--beelio-game-font);
}
.streak-banner-text strong {
  color: var(--beelio-game-orange-dark);
  font-size: 15px;
}
.streak-banner-text span {
  color: #78350F;
  font-size: 12px;
}

/* OUT OF HEARTS */
.beelio-hearts-restore-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

/* --------------------------------------------------------------------------
   11. MODALS & GUIDEBOOK POPOVERS
   -------------------------------------------------------------------------- */
.beelio-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.beelio-modal-overlay.hidden {
  display: none !important;
}

.beelio-lesson-popover-card,
.beelio-guidebook-card {
  background: #FFFFFF;
  border-radius: 24px;
  padding: 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: pop-in 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.beelio-locked-popover-card {
  background: #FFFFFF;
  border-radius: 28px;
  padding: 32px 28px 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  border: 3px solid #FEF3C7;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: pop-in 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.locked-card-header {
  position: relative;
  margin-bottom: 12px;
}

.locked-bee-avatar {
  filter: drop-shadow(0 6px 12px rgba(245, 158, 11, 0.25));
}

.locked-badge-float {
  position: absolute;
  bottom: 0;
  right: -4px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
  animation: lock-badge-pop 0.4s ease-out;
}

.locked-card-kicker {
  display: inline-block;
  font-family: var(--beelio-game-font);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #D97706;
  background: #FEF3C7;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.locked-modal-title {
  margin: 0 0 10px 0;
  font-family: var(--beelio-game-font);
  font-size: 20px;
  font-weight: 900;
  color: #1E293B;
  line-height: 1.3;
}

.locked-modal-desc {
  margin: 0 0 24px 0;
  font-size: 14px;
  color: #475569;
  line-height: 1.55;
  padding: 0 10px;
}

.locked-card-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.btn-close-popover {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
}
.btn-close-popover:hover {
  background: #F1F5F9;
  color: #1E293B;
}

.popover-icon-circle {
  width: 76px;
  height: 76px;
  background: #FFFBEB;
  border: 3px solid #FDE68A;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.popover-title {
  font-family: var(--beelio-game-font);
  font-size: 20px;
  font-weight: 800;
  color: #1E293B;
  margin: 0 0 6px 0;
}

.popover-desc {
  font-size: 14px;
  color: #64748B;
  margin: 0 0 16px 0;
}

.popover-stats {
  display: flex;
  gap: 16px;
  background: #F8FAFC;
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 20px;
  width: 100%;
  justify-content: space-around;
  font-size: 13px;
}

@keyframes pop-in {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* GUIDEBOOK */
.beelio-guidebook-card {
  max-width: 540px;
  text-align: left;
  align-items: stretch;
}

.guidebook-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--beelio-game-gray-border);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.gb-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1E3A8A;
}

.gb-title-group h3 {
  margin: 0;
  font-family: var(--beelio-game-font);
  font-size: 18px;
  font-weight: 800;
}

.gb-unit-badge {
  font-size: 14px;
  font-weight: 800;
  color: var(--beelio-game-green-dark);
  margin-bottom: 12px;
}

.gb-tips-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gb-tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
  background: #F8FAFC;
  border-radius: 12px;
  padding: 10px 14px;
}
.gb-tips-list li .icon {
  color: var(--beelio-game-green);
  font-size: 20px;
  flex-shrink: 0;
}

.guidebook-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   12. MASCOT BEE SVG ANIMATIONS
   -------------------------------------------------------------------------- */
.beelio-mascot-svg {
  display: block;
}

.bee-hover {
  animation: bee-float 3s infinite ease-in-out;
}

.bee-cheer {
  animation: bee-jump 0.8s infinite ease-in-out alternate;
}

.bee-wing-left {
  transform-origin: 32px 32px;
  animation: bee-wings-l 0.15s infinite alternate ease-in-out;
}

.bee-wing-right {
  transform-origin: 78px 32px;
  animation: bee-wings-r 0.15s infinite alternate ease-in-out;
}

@keyframes bee-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes bee-jump {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-10px) scale(1.04); }
}

@keyframes bee-wings-l {
  0% { transform: rotate(-32deg) scaleY(1); }
  100% { transform: rotate(-16deg) scaleY(0.7); }
}

@keyframes bee-wings-r {
  0% { transform: rotate(32deg) scaleY(1); }
  100% { transform: rotate(16deg) scaleY(0.7); }
}

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

@keyframes lock-badge-pop {
  0% { transform: scale(0.6) rotate(-15deg); opacity: 0; }
  70% { transform: scale(1.15) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* --------------------------------------------------------------------------
   13. RESPONSIVE QUERIES
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .beelio-main-layout {
    grid-template-columns: 1fr;
  }
  .beelio-sidebar-column {
    display: none; /* Ẩn sidebar trên mobile/tablet để tập trung hoàn toàn vào con đường */
  }
  .beelio-mascot-guide-beacon {
    display: none;
  }
}

@media (max-width: 600px) {
  .beelio-stats-sticky-bar {
    padding: 6px 10px;
  }
  .beelio-stat-pill {
    padding: 4px 8px;
    font-size: 13px;
  }
  .beelio-switch-catalog-btn .btn-text {
    display: none;
  }
  .beelio-unit-banner-pro {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }
  .banner-pro-right {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }
  .beelio-puck-button {
    width: 68px;
    height: 64px;
  }
  .beelio-choice-card {
    padding: 14px 16px;
    font-size: 16px;
  }
  .beelio-prompt-content {
    font-size: 18px;
  }
}

/* ==========================================================================
   14. GIAO DIỆN CHUẨN MOCKUP 100% (ADVENTURE WORLD LEARNING MAP)
   ========================================================================== */

.mockup-page-wrapper {
  min-height: 100vh;
  background: linear-gradient(180deg, #E0F2FE 0%, #BAE6FD 30%, #F0FDF4 100%);
  font-family: var(--beelio-game-font);
  display: flex;
  flex-direction: column;
}

/* THEMES THEO TỪNG MÔN HỌC */
.mockup-page-wrapper.subject-math {
  background: linear-gradient(180deg, #E0F2FE 0%, #BAE6FD 30%, #F0FDF4 100%);
}
.mockup-page-wrapper.subject-vietnamese {
  background: linear-gradient(180deg, #FCE7F3 0%, #FBCFE8 30%, #FFF1F2 100%);
}
.mockup-page-wrapper.subject-english {
  background: linear-gradient(180deg, #E0F2FE 0%, #CFFAFE 30%, #ECFEFF 100%);
}
.mockup-page-wrapper.subject-science {
  background: linear-gradient(180deg, #DCFCE7 0%, #BBF7D0 30%, #ECFDF5 100%);
}

/* 1. HEADER TRÊN CÙNG */
.mockup-header-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid #E2E8F0;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

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

.mockup-btn-back {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2.5px solid #FDBA74;
  box-shadow: 0 3px 0 #FB923C;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}
.mockup-btn-back:hover {
  background: #FFF7ED;
  transform: translateY(-1px);
}
.mockup-btn-back:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #FB923C;
}
.mockup-btn-back .back-arrow {
  font-size: 22px;
  font-weight: 900;
  color: #EA580C;
  line-height: 1;
}

.mockup-subject-title {
  font-size: 24px;
  font-weight: 900;
  color: #0F172A;
  margin: 0;
  letter-spacing: 0.5px;
}

/* BỘ CHỌN MÔN HỌC */
.mockup-subject-selector {
  display: flex;
  gap: 6px;
  background: #F1F5F9;
  padding: 4px;
  border-radius: 999px;
  border: 1.5px solid #E2E8F0;
}

.subject-pill-btn {
  background: none;
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--beelio-game-font);
  font-size: 13px;
  font-weight: 800;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}
.subject-pill-btn:hover {
  color: #0F172A;
}
.subject-pill-btn.active {
  background: #FFFFFF;
  color: #0F172A;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.mockup-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mockup-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  box-shadow: 0 2px 0 #CBD5E1;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 900;
  color: #0F172A;
}
.mockup-stat-pill.streak-pill {
  color: #C2410C;
}
.mockup-stat-pill.gems-pill {
  color: #0284C7;
}

/* 2. KHUNG CANVAS CHÍNH */
.mockup-canvas-frame {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 12px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* 3. HERO BANNER BIỂN GỖ 3D & LÂU ĐÀI TRÊN THÁC NƯỚC */
.mockup-hero-banner-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 520px;
  position: relative;
  margin-bottom: 2px;
}

.mockup-wooden-board {
  flex: 1;
  background: linear-gradient(180deg, #F59E0B 0%, #D97706 65%, #B45309 100%);
  border: 4px solid #78350F;
  border-radius: 24px;
  box-shadow: 0 8px 0 #451A03, 0 12px 24px rgba(0,0,0,0.15);
  padding: 14px 18px;
  position: relative;
  margin-right: -30px;
  z-index: 2;
}

.wood-screw {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #FEF08A;
  border: 1.5px solid #78350F;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.4);
}
.screw-tl { top: 6px; left: 6px; }
.screw-tr { top: 6px; right: 6px; }
.screw-bl { bottom: 6px; left: 6px; }
.screw-br { bottom: 6px; right: 6px; }

.wood-chapter-tag {
  background: #FEF3C7;
  border: 1.5px solid #B45309;
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 900;
  color: #92400E;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wood-board-title {
  margin: 3px 0 2px;
  font-size: 26px;
  font-weight: 900;
  color: #FFFBEB;
  text-shadow: 0 3px 0 #78350F, 0 4px 0 #451A03, 0 0 8px rgba(254, 240, 138, 0.4);
  line-height: 1.2;
}

.wood-board-desc {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #0F172A;
}

.mockup-castle-cliff-box {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}

.mockup-btn-bikip {
  position: absolute;
  bottom: 10px;
  right: 6px;
  background: linear-gradient(180deg, #F97316 0%, #EA580C 100%);
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 4px 0 #9A3412, 0 6px 12px rgba(154, 52, 18, 0.35);
  border-radius: 999px;
  padding: 6px 14px;
  color: #FFFFFF;
  font-family: var(--beelio-game-font);
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.mockup-btn-bikip:hover {
  transform: translateY(-1px);
}
.mockup-btn-bikip:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #9A3412;
}

/* 4. THANH TIẾN ĐỘ HÀNH TRÌNH */
.mockup-journey-progress-container {
  width: 100%;
  max-width: 520px;
  background: #FFFFFF;
  border-radius: 999px;
  border: 2px solid #E2E8F0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.04);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.journey-label {
  font-size: 14px;
  font-weight: 900;
  color: #0F172A;
  white-space: nowrap;
}

.journey-track-bar {
  flex: 1;
  height: 10px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
}

.journey-fill-bar {
  height: 100%;
  background: linear-gradient(90deg, #22C55E 0%, #10B981 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.journey-fraction {
  font-size: 13px;
  font-weight: 800;
  color: #475569;
  white-space: nowrap;
}

/* 5. KHUNG BẢN ĐỒ THẾ GIỚI TỰ NHIÊN SỐNG ĐỘNG */
.mockup-world-map-viewport {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 820px;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
  border: 3.5px solid #FFFFFF;
}

.mockup-world-landscape-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.mockup-nodes-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
}

/* TỪNG ĐIỂM CHỐT NODE TRÊN BẢN ĐỒ */
.mockup-node-anchor {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

/* HUY HIỆU SỐ THỨ TỰ TRÒN TRÊN NÚT BÀI HỌC */
.mockup-number-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  z-index: 15;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.mockup-number-badge.badge-active {
  background: #15803D;
  color: #FFFFFF;
}
.mockup-number-badge.badge-stone {
  background: #64748B;
  color: #FFFFFF;
}
.mockup-number-badge.badge-boss {
  background: #D97706;
  color: #FFFFFF;
}

/* NÚT BÀI HỌC TRÒN 3D */
.mockup-puck-wrapper {
  position: relative;
  width: 76px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mockup-stone-puck {
  width: 72px;
  height: 66px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
  outline: none;
}

.puck-active-green {
  background: linear-gradient(180deg, #4ADE80 0%, #22C55E 100%);
  box-shadow: 0 8px 0 #15803D, 0 10px 18px rgba(22, 163, 74, 0.4);
}
.puck-active-green:hover {
  filter: brightness(1.06);
}
.puck-active-green:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #15803D;
}

.puck-locked-stone {
  background: linear-gradient(180deg, #F8FAFC 0%, #E2E8F0 100%);
  border: 2.5px solid #CBD5E1;
  box-shadow: 0 8px 0 #94A3B8, 0 8px 14px rgba(0,0,0,0.06);
}
.puck-locked-stone:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 #94A3B8;
}

.puck-boss-gold {
  width: 84px;
  height: 76px;
  background: linear-gradient(180deg, #FDE047 0%, #F59E0B 100%);
  border: 3px solid #FCD34D;
  box-shadow: 0 9px 0 #B45309, 0 12px 20px rgba(217, 119, 6, 0.35);
}
.puck-boss-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 11px 0 #B45309;
}

.puck-gloss-bevel {
  position: absolute;
  top: 4px;
  left: 12px;
  right: 12px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

.puck-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.mockup-puck-lock-mini {
  position: absolute;
  bottom: -4px;
  right: -4px;
  z-index: 12;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  pointer-events: none;
}

/* NHÃN VIÊN THUỐC TRẮNG DƯỚI NÚT */
.mockup-puck-pill-label {
  margin-top: 6px;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  box-shadow: 0 3px 0 #CBD5E1;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 900;
  color: #1E293B;
  white-space: nowrap;
  pointer-events: none;
}
.mockup-puck-pill-label.label-active {
  color: #15803D;
  border-color: #86EFAC;
}
.mockup-puck-pill-label.label-boss {
  color: #B45309;
  border-color: #FDE047;
}

/* 6. THẺ THÔNG TIN BÀI ĐANG HỌC & CHÚ ONG VÀNG BA LÔ */
.mockup-active-quest-bubble {
  position: absolute;
  left: 92px;
  top: -46px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 25;
  pointer-events: auto;
}

.quest-bubble-card {
  background: #FFFFFF;
  border: 2.5px solid #86EFAC;
  border-radius: 20px;
  padding: 14px 18px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.12);
  width: 215px;
  text-align: left;
}

.quest-card-title {
  font-size: 16px;
  font-weight: 900;
  color: #0F172A;
  margin: 0 0 2px;
}

.quest-card-desc {
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
  margin: 0 0 8px;
  line-height: 1.35;
}

.quest-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  margin-bottom: 10px;
}

.mockup-btn-start-quest {
  width: 100%;
  background: linear-gradient(180deg, #22C55E 0%, #16A34A 100%);
  border: none;
  border-radius: 14px;
  box-shadow: 0 4px 0 #15803D, 0 6px 12px rgba(22, 163, 74, 0.35);
  padding: 8px 14px;
  color: #FFFFFF;
  font-family: var(--beelio-game-font);
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.mockup-btn-start-quest:hover {
  filter: brightness(1.06);
}
.mockup-btn-start-quest:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #15803D;
}

.quest-mascot-companion {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.mockup-bee-speech-bubble {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFFFFF;
  border: 2px solid #FCD34D;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 900;
  color: #B45309;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}
.speech-bubble-tail {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #FFFFFF;
  border-right: 2px solid #FCD34D;
  border-bottom: 2px solid #FCD34D;
}

/* 7. RƯƠNG KHO BÁU VEN ĐƯỜNG */
.mockup-chest-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mockup-chest-badge {
  background: #FFFFFF;
  border: 2px solid #38BDF8;
  box-shadow: 0 3px 0 #0284C7;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 900;
  color: #0284C7;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.mockup-chest-btn {
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
  transition: transform 0.15s ease;
}
.mockup-chest-btn:hover {
  transform: scale(1.06);
}

/* 8. CARD MỤC TIÊU HÔM NAY Ở CHÂN BẢN ĐỒ */
.mockup-today-goal-card {
  width: 100%;
  max-width: 520px;
  background: linear-gradient(180deg, #FEF9C3 0%, #FEF08A 100%);
  border: 2.5px solid #FDE047;
  border-radius: 24px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
  position: relative;
}

.goal-medal-coin {
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgba(202, 138, 4, 0.3));
}

.goal-info-content {
  flex: 1;
}

.goal-title {
  font-size: 16px;
  font-weight: 900;
  color: #0F172A;
  margin: 0 0 2px;
}

.goal-desc {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin: 0;
}

.goal-decor-hills {
  font-size: 20px;
  flex-shrink: 0;
}

/* =========================================================================
   100% PIXEL ACCURATE BEELIO ADVENTURE CANVAS & INTERACTIVE HOTSPOTS
   ========================================================================= */

.mockup-adventure-canvas-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: calc(100dvh - 54px);
  max-height: calc(100dvh - 54px);
  overflow: hidden;
  padding: 6px 12px 10px 12px;
  box-sizing: border-box;
  background: linear-gradient(180deg, #F0F9FF 0%, #E0F2FE 40%, #FEF9C3 100%);
}

/* Floating Subject Switcher Bar */
.mockup-subject-floating-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  border: 1.5px solid rgba(226, 232, 240, 0.8);
  margin-bottom: 16px;
  z-index: 20;
  max-width: 95%;
  overflow-x: auto;
}

/* Đảm bảo dropdown chọn khối lớp không bị clipping bởi overflow */
.mockup-subject-floating-bar:has(.grade-context-dropdown.open),
.g4-subject-tabs:has(.grade-context-dropdown.open),
.adventure-context-bar:has(.grade-context-dropdown.open) {
  overflow: visible !important;
  z-index: 150 !important;
}

.adventure-context-bar .grade-context-dropdown,
.mockup-subject-floating-bar .grade-context-dropdown,
.g4-subject-tabs .grade-context-dropdown {
  position: relative !important;
  flex-shrink: 0 !important;
  z-index: 155 !important;
}

.adventure-context-bar .grade-context-menu,
.mockup-subject-floating-bar .grade-context-menu,
.g4-subject-tabs .grade-context-menu {
  z-index: 200 !important;
}

.mockup-subject-floating-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 14px;
  font-weight: 800;
  color: #64748B;
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mockup-subject-floating-btn:hover {
  color: #1E293B;
  background: rgba(241, 245, 249, 0.8);
  transform: translateY(-1px);
}

.mockup-subject-floating-btn.active {
  background: linear-gradient(180deg, #3B82F6 0%, #2563EB 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-2px);
}

/* Main Canvas Frame: 3:4 Ratio Container Vừa khít 1 màn hình */
.mockup-adventure-canvas {
  position: relative;
  aspect-ratio: 3 / 4;
  height: calc(100dvh - 110px);
  max-height: calc(100dvh - 110px);
  width: auto;
  max-width: min(calc((100dvh - 110px) * (3 / 4)), 96vw, 680px);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.16), 0 0 0 4px #FFFFFF, 0 0 0 7px #E2E8F0;
  background-color: #E2E8F0;
  user-select: none;
  -webkit-user-select: none;
  margin: 6px auto 12px;
  container-type: inline-size;
  flex-shrink: 1;
}

@media (min-width: 768px) {
  .mockup-adventure-canvas {
    border-radius: 28px;
  }
}

/* Background image filling the entire canvas perfectly */
.mockup-canvas-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}

/* Interactive Hotspot Overlay Layer */
.mockup-hotspot {
  position: absolute;
  cursor: pointer;
  z-index: 10;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

/* Visual cues for interactive hotspots on hover / focus */
.mockup-hotspot:hover {
  transform: scale(1.06);
}

.mockup-hotspot:active {
  transform: scale(0.95);
}

/* Pulsing aura on Active Quest button (▶ BẮT ĐẦU) */
.mockup-hotspot.hotspot-start-btn {
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: hotspot-pulse-green 2s infinite;
}

@keyframes hotspot-pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Subtle ring on Active Node 1 puck - Đã tắt theo yêu cầu User */
.mockup-hotspot.hotspot-node-active {
  box-shadow: none !important;
  animation: none !important;
}

@keyframes hotspot-pulse-gold {
  0% {
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.7);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(250, 204, 21, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0);
  }
}

/* Shimmer on Chest */
.mockup-hotspot.hotspot-chest:hover {
  animation: chest-wobble 0.6s ease infinite alternate;
}

@keyframes chest-wobble {
  0% { transform: rotate(-3deg) scale(1.06); }
  100% { transform: rotate(3deg) scale(1.06); }
}

/* Gentle float on Mascot Bee */
.mockup-hotspot.hotspot-mascot:hover {
  animation: mascot-wiggle 0.5s ease;
}

@keyframes mascot-wiggle {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-8px) rotate(-6deg); }
  75% { transform: translateY(-4px) rotate(6deg); }
}

/* Hotspot Tooltip */
.hotspot-tooltip {
  position: absolute;
  bottom: 105%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  z-index: 30;
}

.hotspot-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(15, 23, 42, 0.92);
}

.mockup-hotspot:hover .hotspot-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   GRADE 4 RPG ADVENTURE MAP - 100% QUY CHUẨN THEO ẢNH MẪU (HIGH FIDELITY)
   Tách biệt hoàn toàn tầng đồ họa cảnh quan sắc nét và tầng giao diện tương tác động
   ========================================================================== */

.g4-adventure-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  height: calc(100dvh - 54px);
  max-height: calc(100dvh - 54px);
  overflow: hidden;
  background: linear-gradient(180deg, #F0F9FF 0%, #E0F2FE 40%, #FEF9C3 100%);
  padding: 6px 12px 10px 12px;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

/* Floating Subject Switcher Tabs */
.g4-subject-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  border: 1.5px solid rgba(226, 232, 240, 0.8);
  max-width: 95%;
  overflow-x: auto;
}

.g4-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 14px;
  font-weight: 800;
  color: #64748B;
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.g4-tab-btn:hover {
  color: #1E293B;
  background: rgba(241, 245, 249, 0.8);
  transform: translateY(-1px);
}

.g4-tab-btn.active {
  background: linear-gradient(180deg, #3B82F6 0%, #2563EB 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-2px);
}

/* Canvas Container: Đồng nhất 100% kích thước, bo góc và đổ bóng với Lớp 2 */
.g4-adventure-canvas {
  position: relative;
  aspect-ratio: 3 / 4;
  height: calc(100dvh - 110px);
  max-height: calc(100dvh - 110px);
  width: auto;
  max-width: min(calc((100dvh - 110px) * (3 / 4)), 96vw, 680px);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.16), 0 0 0 4px #FFFFFF, 0 0 0 7px #E2E8F0;
  background-color: #F1F5F9;
  margin: 6px auto 12px;
  container-type: inline-size;
  flex-shrink: 1;
}

@media (min-width: 768px) {
  .g4-adventure-canvas {
    border-radius: 28px;
  }
}

[data-theme="dark"] .g4-adventure-canvas {
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.4), 0 0 0 4px #1E293B, 0 0 0 7px #334155;
  background-color: #0F172A;
}

/* Ngăn chặn hoàn toàn việc cuộn trang trên màn hình Bản đồ Beelio */
body:has(.mockup-adventure-canvas-wrapper),
body:has(.g4-adventure-page) {
  overflow: hidden !important;
  height: 100vh !important;
  max-height: 100vh !important;
}

.main-content-view:has(.mockup-adventure-canvas-wrapper),
.main-content-view:has(.g4-adventure-page) {
  overflow: hidden !important;
  height: calc(100dvh - 54px) !important;
  max-height: calc(100dvh - 54px) !important;
}

/* Layer 1: Clean Landscape Backdrop */
.g4-clean-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  display: block;
  transition: filter 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

/* Hiệu ứng chuyển động mượt mà khi đổi thế giới học tập */
.mockup-canvas-bg-img {
  transition: filter 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

/* ==========================================================================
   DYNAMIC CHAPTER BIOMES & ATMOSPHERE SHADERS
   Biến đổi thế giới học tập theo từng chủ đề môn học chống nhàm chán
   ========================================================================== */

/* 5 Hiệu ứng ánh sáng khí quyển nghệ thuật */
.atmo-day {
  filter: contrast(1.02) saturate(1.06);
}

.atmo-sunset {
  filter: sepia(0.18) saturate(1.35) hue-rotate(-14deg) contrast(1.06);
}

.atmo-twilight {
  filter: brightness(0.92) contrast(1.12) saturate(1.22) hue-rotate(22deg);
}

.atmo-night {
  filter: brightness(0.78) contrast(1.18) saturate(1.12) hue-rotate(185deg);
}

.atmo-dawn {
  filter: brightness(1.04) contrast(1.03) saturate(1.16) hue-rotate(-6deg);
}

/* Tầng phủ khí quyển động (Dynamic Atmospheric Overlay) */
.adventure-atmosphere-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
  transition: opacity 0.6s ease, background 0.6s ease;
}

.atmo-overlay-day {
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
  mix-blend-mode: overlay;
}

.atmo-overlay-sunset {
  background: linear-gradient(135deg, rgba(255, 125, 0, 0.2) 0%, rgba(255, 60, 0, 0.1) 40%, rgba(120, 20, 100, 0.16) 100%);
  mix-blend-mode: color-burn;
}

.atmo-overlay-twilight {
  background: linear-gradient(160deg, rgba(168, 85, 247, 0.22) 0%, rgba(99, 102, 241, 0.15) 50%, rgba(30, 27, 75, 0.22) 100%);
  mix-blend-mode: soft-light;
}

.atmo-overlay-night {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.32) 0%, rgba(30, 58, 138, 0.18) 60%, rgba(2, 6, 23, 0.28) 100%);
  mix-blend-mode: multiply;
}

.atmo-overlay-dawn {
  background: linear-gradient(145deg, rgba(254, 215, 170, 0.22) 0%, rgba(251, 146, 60, 0.12) 45%, rgba(255, 255, 255, 0) 80%);
  mix-blend-mode: screen;
}

/* Huy hiệu Thế Giới Phiêu Lưu (World Theme Badge) trên thanh Header Chủ Đề */
.g4-world-theme-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #F59E0B;
  color: #92400E;
  padding: 1.5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.g4-world-theme-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(245, 158, 11, 0.25);
}

@media (max-width: 480px) {
  .g4-world-theme-badge {
    padding: 1px 5px;
    font-size: 9px;
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Layer 2: Dynamic UI Overlay Layer */
.g4-ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 2.1 HEADER BAR */
.g4-header-bar {
  position: absolute;
  top: 1.6%;
  left: 3.5%;
  width: 93%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: auto;
  z-index: 10;
}

.g4-btn-back {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFFDF5;
  border: 2.5px solid #F59E0B;
  box-shadow: 0 3px 0 #D97706, 0 4px 8px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all 0.12s ease;
}

.g4-btn-back:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.g4-btn-back:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #D97706;
}

.g4-back-arrow {
  color: #EA580C;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.g4-title-pill {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 2px solid #BFDBFE;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 8px 22px;
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 16px;
  font-weight: 900;
  color: #1E3A8A;
  letter-spacing: 0.5px;
}

/* Ẩn các huy hiệu chỉ số trùng lặp trong thanh chủ đề bản đồ vì Kim Cương đã thường trực trên Top Header */
.g4-stats-group,
.g4-stat-badge.streak-badge,
.g4-stat-badge.gem-badge {
  display: none !important;
}

/* 2.1 THANH HEADER ĐIỀU HƯỚNG TÍCH HỢP TOÀN DIỆN (CHỦ ĐỀ + BÍ KÍP + STATS) */
.g4-header-bar.g4-header-integrated {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 96%;
  max-width: 580px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12), 0 2px 4px rgba(0, 0, 0, 0.04);
  z-index: 35;
  box-sizing: border-box;
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
}

.g4-header-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.g4-header-bar.g4-header-integrated .g4-btn-back {
  width: 32px;
  height: 32px;
  border-width: 2px;
}

.g4-header-bar.g4-header-integrated .g4-back-arrow {
  font-size: 16px;
}

.g4-header-ch-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.g4-header-ch-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}

.header-unit-tag {
  font-size: 11px;
  font-weight: 800;
  color: #1D4ED8;
  white-space: nowrap;
}

.header-unit-name {
  font-size: 12px;
  font-weight: 800;
  color: #1E293B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.header-unit-badge {
  font-size: 10px;
  font-weight: 800;
  color: #059669;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.g4-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.g4-header-bar.g4-header-integrated .g4-stat-badge {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  gap: 3px;
}

.g4-header-bar.g4-header-integrated .g4-btn-bikip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(180deg, #3B82F6 0%, #1D4ED8 100%);
  border: 1.5px solid #FFFFFF;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.28);
  height: 28px;
  padding: 0 10px;
  color: #FFFFFF;
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.g4-header-bar.g4-header-integrated .g4-btn-bikip:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.g4-header-bar.g4-header-integrated .g4-btn-bikip:active {
  transform: translateY(1px);
}

.g4-btn-nav {
  position: relative;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  color: #1D4ED8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.12s ease;
  outline: none;
}

.g4-btn-nav::before {
  content: "";
  position: absolute;
  top: -8px;
  bottom: -8px;
  left: -8px;
  right: -8px;
}

.g4-btn-nav:hover:not(:disabled) {
  background: #3B82F6;
  color: #FFFFFF;
}

.g4-btn-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Ẩn hoàn toàn bảng card cũ */
.g4-chapter-nav-card {
  display: none !important;
}

@media (max-width: 480px) {
  .g4-header-bar.g4-header-integrated {
    top: 6px;
    width: 98%;
    padding: 3px 6px;
    gap: 4px;
  }
  .header-unit-name {
    max-width: 85px;
    font-size: 11px;
  }
  .header-unit-tag {
    font-size: 10px;
  }
  .g4-header-bar.g4-header-integrated .g4-btn-back {
    width: 28px;
    height: 28px;
  }
  .g4-header-bar.g4-header-integrated .g4-btn-bikip {
    height: 26px;
    padding: 0 7px;
    font-size: 10px;
  }
  .g4-header-bar.g4-header-integrated .g4-stat-badge {
    padding: 2px 6px;
    font-size: 10px;
  }
}

/* ==========================================================================
   NÚT BẮT ĐẦU BEELIO FLOATING PILL (CHUẨN 3D TACTILE BEELIO ĐỒNG BỘ 100%)
   ========================================================================== */
.g4-floating-start-pill {
  position: absolute;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, #22C55E 0%, #16A34A 100%);
  border: none;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 0 #15803D, 0 8px 20px rgba(22, 163, 74, 0.4);
  animation: start-btn-pulse 2.2s infinite ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px 7px 18px;
  width: auto;
  min-width: 120px;
  height: 38px;
  cursor: pointer;
  z-index: 35;
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 13.5px;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: 0.8px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.g4-floating-start-pill::after {
  display: none !important;
  content: none !important;
}

.g4-floating-start-pill:hover {
  filter: brightness(1.06);
}

.g4-floating-start-pill:active {
  transform: translate(-50%, calc(-50% + 3px)) scale(0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 0 #15803D, 0 3px 8px rgba(22, 163, 74, 0.3);
}

@keyframes start-float-pill {
  0%, 100% { transform: translate(-50%, -100%); }
  50% { transform: translate(-50%, calc(-100% - 4px)); }
}


/* 2.3 WOODEN SIGNPOST */
.g4-start-signpost {
  position: absolute;
  top: 28.5%;
  left: 7.5%;
  pointer-events: auto;
  z-index: 8;
}

.signpost-board {
  background: linear-gradient(180deg, #D97706, #B45309);
  border: 2px solid #78350F;
  border-radius: 8px;
  padding: 5px 10px;
  color: #FEF3C7;
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  transform: rotate(-8deg);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.signpost-post {
  width: 8px;
  height: 24px;
  background: #78350F;
  margin: -4px auto 0 auto;
  border-radius: 0 0 3px 3px;
}

/* 2.4 LESSON NODES & PUCKS */
.g4-node-anchor {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 12;
  outline: none;
}

.g4-node-anchor:hover {
  transform: translate(-50%, -50%) scale(1.08);
}

.g4-node-anchor:active {
  transform: translate(-50%, -50%) scale(0.95);
}

/* ==========================================================================
   KHỐI GỖ SỐ 3D ĐỈNH CAO (WOODEN NUMBER BLOCKS 3D) - THEO YÊU CẦU USER
   Tái hiện 100% hình thái khối gỗ sồi tự nhiên bo góc, chữ số 3D dập nổi rực rỡ
   ========================================================================== */
.g4-wood-cube {
  width: clamp(28px, 6.6cqw, 42px);
  height: clamp(28px, 6.6cqw, 42px);
  border-radius: clamp(6px, 1.6cqw, 10px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  z-index: 2;
}

/* Vân gỗ 3D tự nhiên & bóng sáng bề mặt (Ẩn vì đã có trên ảnh nền gốc) */
.g4-wood-cube::before {
  display: none !important;
}

/* Chân đế phiến đá lót (Ẩn vì ảnh nền đã có phiến đá sỏi tự nhiên) */
.g4-cube-stone-base {
  display: none !important;
}

/* Thanh nhãn tiêu đề nhỏ dưới nốt (Ẩn để con đường thoáng đãng và chuẩn phong cách Lớp 2) */
.g4-puck-title-pill {
  display: none !important;
}

/* Thẻ chân trang mục tiêu (Ẩn để không che khối gỗ 1 và chú Ong Vàng) */
.g4-daily-goal-card {
  display: none !important;
}

/* CHỮ SỐ 3D DẬP NỔI RỰC RỠ Ở GIỮA KHỐI GỖ */
.cube-number {
  font-family: 'Nunito', 'Quicksand', -apple-system, sans-serif;
  font-size: clamp(17px, 4.2cqw, 26px);
  font-weight: 900;
  line-height: 1;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

/* Số 1: Hồng dâu tây 3D chuẩn như Lớp 2 */
.cube-number.num-1 {
  color: #FF2E63;
  text-shadow: 0 3px 0 #B80D38, 0 4px 1px rgba(0, 0, 0, 0.3);
}

/* Số 2: Cam mật ong 3D */
.cube-number.num-2 {
  color: #FF8500;
  text-shadow: 0 3px 0 #BD5900, 0 4px 1px rgba(0, 0, 0, 0.3);
}

/* Số 3: Xanh dương đại dương 3D */
.cube-number.num-3 {
  color: #00A3FF;
  text-shadow: 0 3px 0 #006AB5, 0 4px 1px rgba(0, 0, 0, 0.3);
}

/* Số 4: Xanh lá cây đậm tươi 3D nổi bật trên nền cỏ */
.cube-number.num-4 {
  color: #16A34A;
  text-shadow: 0 3px 0 #15803D, 0 4px 6px rgba(0, 0, 0, 0.35);
}

/* Số 5: Tím mộng mơ 3D */
.cube-number.num-5 {
  color: #CE82FF;
  text-shadow: 0 3px 0 #A855F7, 0 4px 1px rgba(0, 0, 0, 0.3);
}

/* Số 6: San hô hổ phách 3D */
.cube-number.num-6 {
  color: #FF6B4A;
  text-shadow: 0 3px 0 #C93B18, 0 4px 1px rgba(0, 0, 0, 0.3);
}

/* Số 7: Ngọc lam diệu kỳ 3D */
.cube-number.num-7 {
  color: #00CD9C;
  text-shadow: 0 3px 0 #008F6B, 0 4px 1px rgba(0, 0, 0, 0.3);
}

/* Số 8: Hoàng gia vàng óng 3D */
.cube-number.num-8 {
  color: #FFB800;
  text-shadow: 0 3px 0 #C78B00, 0 4px 1px rgba(0, 0, 0, 0.3);
}

/* KHỐI GỖ ĐANG HỌC (ACTIVE BLOCK) */
.g4-wood-cube.cube-active {
  transform: translateY(-2px);
  box-shadow: 
    0 10px 0 #874615, 
    0 18px 26px rgba(80, 35, 10, 0.5), 
    inset 0 2px 4px rgba(255, 255, 255, 0.85);
  border-color: #FDE68A;
}

/* Vầng hào quang hoàng kim hình chữ nhật bo góc ôm trọn chân khối gỗ số 1 - Đã tắt theo yêu cầu User */
.g4-node-anchor.g4-node-active .g4-puck-aura {
  display: none !important;
  border: none !important;
  box-shadow: none !important;
  animation: none !important;
}

/* KHỐI GỖ ĐANG KHÓA (LOCKED BLOCK) */
.g4-wood-cube.cube-locked {
  filter: brightness(0.96) saturate(0.92);
}

/* Ổ KHÓA MINI 3D Ở GÓC TRÊN PHẢI CỦA KHỐI GỖ */
.cube-lock-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: clamp(14px, 3.0cqw, 18px);
  height: clamp(14px, 3.0cqw, 18px);
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

.cube-lock-badge svg {
  width: clamp(9px, 2.0cqw, 12px);
  height: clamp(9px, 2.0cqw, 12px);
}

/* KHỐI GỖ ĐÃ HOÀN THÀNH (COMPLETED BLOCK) */
.g4-wood-cube.cube-completed {
  border-color: #FACC15;
  box-shadow: 
    0 8px 0 #A16207, 
    0 14px 22px rgba(161, 98, 7, 0.45), 
    inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

.cube-star {
  position: absolute;
  top: -9px;
  left: -9px;
  font-size: 16px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  z-index: 5;
}

/* KHỐI GỖ TRÙM CUỐI (BOSS BLOCK) */
.g4-wood-cube.cube-boss {
  border-color: #FDE047;
  background: linear-gradient(145deg, #FDE68A 0%, #F59E0B 50%, #D97706 100%);
  box-shadow: 
    0 9px 0 #854D0E, 
    0 16px 26px rgba(133, 77, 14, 0.5), 
    inset 0 2px 5px rgba(255, 255, 255, 0.85);
}

.cube-crown {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  z-index: 5;
}

.g4-puck-title-pill {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid #E2E8F0;
  border-radius: 999px;
  padding: 3px 10px;
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 11px;
  font-weight: 800;
  color: #1E293B;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  z-index: 4;
}

.g4-puck-title-pill.pill-boss {
  background: linear-gradient(180deg, #FEF08A, #FDE047);
  border: 1.5px solid #CA8A04;
  color: #78350F;
}


/* 2.5 ACTIVE QUEST CARD (POPOVER) */
.g4-active-quest-card {
  position: absolute;
  pointer-events: auto;
  z-index: 20;
  background: #FFFFFF;
  border: 2.5px solid #E2E8F0;
  border-radius: 20px;
  padding: 14px 18px;
  width: 225px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.06);
  transform: translateY(-30%);
}

.g4-active-quest-card.pulse-highlight {
  animation: card-wiggle 0.5s ease;
}

@keyframes card-wiggle {
  0%, 100% { transform: translateY(-30%) scale(1); }
  50% { transform: translateY(-30%) scale(1.04); }
}

.quest-card-title {
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 17px;
  font-weight: 900;
  color: #1E293B;
  margin: 0 0 3px 0;
}

.quest-card-subtitle {
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 12px;
  color: #64748B;
  font-weight: 600;
  margin: 0 0 8px 0;
  line-height: 1.35;
}

.quest-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 12px;
  font-weight: 800;
  color: #0284C7;
  margin-bottom: 12px;
}

.quest-card-meta .meta-xp {
  color: #D97706;
}

.g4-btn-action-start {
  width: 100%;
  background: #58CC02;
  border: none;
  border-radius: 14px;
  color: #FFFFFF;
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 11px 0;
  cursor: pointer;
  box-shadow: 0 4px 0 #15803D, 0 6px 12px rgba(22, 163, 74, 0.3);
  transition: all 0.12s ease;
  outline: none;
}

.g4-btn-action-start:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.g4-btn-action-start:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #15803D;
}

/* 2.6 MASCOT CONTAINER */
.g4-mascot-container {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-30%, -40%);
  animation: beelioFloat 2.6s infinite ease-in-out;
  z-index: 18;
}

.mascot-speech-bubble {
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-radius: 12px;
  padding: 4px 10px;
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 11px;
  font-weight: 900;
  color: #1E293B;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: -4px;
  position: relative;
  z-index: 2;
}

.mascot-speech-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #FFFFFF;
}

/* 2.7 CHEST ANCHOR (Tôn vinh cầu vồng thần kỳ trên nền) */
.g4-chest-anchor {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
  z-index: 25;
  background: transparent !important;
}

.g4-chest-anchor:hover {
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.9));
  transform: translate(-50%, -50%) scale(1.08);
}

.g4-chest-anchor .g4-chest-visual {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.g4-chest-badge {
  display: none; /* Ẩn mặc định để cảnh quan thoáng đãng, đồng nhất 100% với Lớp 2 */
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid #F59E0B;
  border-radius: 999px;
  padding: 3px 12px;
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 11.5px;
  font-weight: 900;
  color: #D97706;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.g4-chest-anchor:hover .g4-chest-badge {
  display: block;
}

/* 2.8 CASTLE GATE HITBOX */
.g4-castle-gate-hitbox {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  pointer-events: auto;
  cursor: pointer;
  border-radius: 24px;
  z-index: 25;
  transition: transform 0.2s ease;
}

.g4-castle-gate-hitbox:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

/* 2.9 DAILY GOAL FOOTER CARD */
.g4-daily-goal-card {
  position: absolute;
  bottom: 2%;
  left: 4%;
  width: 92%;
  pointer-events: auto;
  cursor: pointer;
  background: linear-gradient(180deg, #FFFDF5 0%, #FEF9C3 100%);
  border: 2.5px solid #FDE047;
  border-radius: 20px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), inset 0 1px 3px rgba(255, 255, 255, 0.8);
  transition: transform 0.15s ease;
  z-index: 15;
}

.g4-daily-goal-card:hover {
  transform: translateY(-2px);
}

.goal-medal-coin {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FEF08A, #FACC15 50%, #EAB308 100%);
  border: 2.5px solid #CA8A04;
  box-shadow: 0 4px 0 #A16207, 0 6px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.goal-info {
  display: flex;
  flex-direction: column;
}

.goal-title {
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 15px;
  font-weight: 900;
  color: #1E293B;
  margin: 0 0 2px 0;
}

.goal-subtitle {
  font-family: var(--beelio-game-font, 'Nunito', sans-serif);
  font-size: 12.5px;
  font-weight: 700;
  color: #64748B;
  margin: 0;
}

/* ==========================================================================
   MOBILE RESPONSIVE TỐI ƯU GIAO DIỆN BẢN ĐỒ RPG BEELIO
   ========================================================================== */

@media (max-width: 540px) {
  .g4-adventure-page {
    padding: 6px 6px 70px 6px;
    gap: 8px;
    width: 100%;
    min-height: calc(100dvh - 65px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  /* Bộ chuyển môn học: vuốt trơn tru không tràn lề */
  .g4-subject-tabs {
    padding: 4px;
    gap: 4px;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .g4-subject-tabs::-webkit-scrollbar {
    display: none;
  }
  .g4-tab-btn {
    padding: 6px 12px;
    font-size: 12px;
    flex-shrink: 0;
  }

  /* Khung bản đồ phiêu lưu: lấp đầy chiều cao màn hình di động, triệt tiêu khoảng trắng thừa */
  .g4-adventure-canvas {
    width: 100%;
    height: calc(100dvh - 148px);
    min-height: 480px;
    max-height: 720px;
    aspect-ratio: unset;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    flex: 1 1 auto;
    position: relative;
    overflow: hidden;
  }

  .g4-puck-aura {
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -2px;
    border-width: 2px;
  }

  /* Header trên bản đồ */
  .g4-header-bar {
    top: 1.8%;
    left: 2.5%;
    width: 95%;
    gap: 6px;
    z-index: 25;
  }
  .g4-btn-back {
    width: 34px;
    height: 34px;
    border-width: 2px;
  }
  .g4-back-arrow {
    font-size: 18px;
  }
  .g4-title-pill {
    padding: 5px 12px;
    font-size: 12.5px;
    border-width: 1.5px;
  }
  .g4-stat-badge {
    padding: 3px 8px;
    font-size: 11px;
    gap: 3px;
  }
  .g4-stat-badge .badge-icon {
    font-size: 12px;
  }

  /* Bảng gỗ chương bài học */
  .g4-chapter-banner-card {
    top: 8.5%;
    left: 2.5%;
    width: 95%;
  }
  .g4-wood-board {
    padding: 7px 8px 7px 10px;
    border-radius: 14px;
    border-width: 2.5px;
  }
  .g4-chapter-nav-row {
    top: -10px;
    left: 10px;
    gap: 4px;
  }
  .g4-ribbon-tag {
    padding: 2px 8px;
    font-size: 9px;
    letter-spacing: 0.4px;
  }
  .g4-btn-ch-nav {
    width: 19px;
    height: 19px;
    font-size: 8.5px;
  }
  .g4-chapter-title {
    font-size: clamp(12.5px, 3.6vw, 15px);
    padding-right: 70px;
    margin: 2px 0 1px 0;
  }
  .g4-chapter-subtitle {
    font-size: 9.5px;
    padding-right: 70px;
  }
  .g4-btn-bikip {
    right: 6px;
    padding: 3px 7px;
    font-size: 10px;
    gap: 3px;
    border-radius: 999px;
    border-width: 1.5px;
    box-shadow: 0 2px 0 #92400E, 0 3px 6px rgba(0, 0, 0, 0.2);
  }
  .g4-btn-bikip .bikip-icon {
    font-size: 11px;
  }

  /* Thanh tiến độ chương */
  .g4-progress-strip {
    padding: 3px 8px;
    margin-top: 4px;
  }
  .g4-prog-label {
    font-size: 9.5px;
  }
  .g4-prog-track {
    height: 6px;
    margin: 0 5px;
  }
  .g4-prog-count {
    font-size: 9.5px;
  }

  /* Biển chỉ dẫn xuất phát */
  .g4-start-signpost {
    top: 25%;
    left: 4%;
  }
  .signpost-board {
    font-size: 8.5px;
    padding: 2px 5px;
  }

  /* 5 Nút đảo học tập 3D: kích thước vừa vặn con đường, không bị quá to */
  .g4-puck-body {
    width: 44px;
    height: 44px;
    box-shadow: 0 4px 0 #15803D, 0 6px 10px rgba(21, 128, 61, 0.3);
  }
  .puck-gold-3d {
    box-shadow: 0 4px 0 #A16207, 0 6px 10px rgba(161, 98, 7, 0.3);
  }
  .puck-stone-3d {
    box-shadow: 0 4px 0 #94A3B8, 0 5px 8px rgba(0, 0, 0, 0.1);
  }
  .puck-boss-3d {
    width: 52px;
    height: 52px;
    box-shadow: 0 5px 0 #854D0E, 0 8px 12px rgba(133, 77, 14, 0.35);
  }
  .g4-puck-body svg,
  .g4-puck-body .puck-icon {
    width: 22px;
    height: 22px;
    font-size: 20px;
  }
  .puck-boss-3d svg,
  .puck-boss-3d .puck-icon {
    width: 26px;
    height: 26px;
    font-size: 24px;
  }
  .g4-puck-badge {
    width: 15px;
    height: 15px;
    font-size: 8.5px;
  }
  .g4-puck-lock-badge {
    width: 15px;
    height: 15px;
    font-size: 8.5px;
  }
  .g4-puck-title-pill {
    margin-top: 3px;
    font-size: 8.5px;
    font-weight: 800;
    padding: 1.5px 6px;
    max-width: 76px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border-radius: 999px;
  }

  /* Rương báu */
  .g4-chest-anchor {
    transform: translate(-50%, -50%) scale(0.75);
  }
  .g4-chest-badge {
    font-size: 8.5px;
    padding: 1px 6px;
  }

  /* Popover Quest Card trên di động: thu gọn kích thước không choán bản đồ */
  .g4-active-quest-card {
    top: 24% !important;
    left: 42% !important;
    width: clamp(140px, 42vw, 168px);
    padding: 7px 9px;
    border-radius: 14px;
    border-width: 2px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
    transform: translateY(-10%);
  }
  .quest-card-title {
    font-size: 12px;
    line-height: 1.2;
    margin-bottom: 2px;
    word-break: break-word;
  }
  .quest-card-subtitle {
    font-size: 9px;
    line-height: 1.2;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .quest-card-meta {
    font-size: 9px;
    margin-bottom: 6px;
    gap: 3px;
  }
  .g4-btn-action-start {
    padding: 6px 0;
    font-size: 11.5px;
    border-radius: 8px;
    box-shadow: 0 2.5px 0 #15803D;
  }

  /* Chú Ong Vàng trên di động: neo sát lề phải an toàn không tràn mép */
  .g4-mascot-container {
    left: auto !important;
    right: 2% !important;
    top: 24% !important;
    transform: translateY(-15%) scale(0.75);
    transform-origin: top right;
  }
  .mascot-speech-bubble {
    font-size: 8.5px;
    padding: 2px 5px;
    max-width: 95px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 8px;
  }
  .mascot-bee-avatar {
    width: 44px;
    height: 44px;
  }
  .mascot-bee-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
  }

  /* Cổng thành */
  .g4-castle-gate-hitbox {
    width: 90px;
    height: 115px;
  }

  /* Thẻ mục tiêu hôm nay */
  .g4-daily-goal-card {
    bottom: 10px;
    left: 2.5%;
    width: 95%;
    padding: 6px 10px;
    border-radius: 14px;
    gap: 8px;
  }
  .goal-medal-coin {
    width: 32px;
    height: 32px;
    font-size: 15px;
    flex-shrink: 0;
  }
  .goal-title {
    font-size: 11.5px;
    margin-bottom: 1px;
  }
  .goal-subtitle {
    font-size: 11px;
    line-height: 1.2;
  }
}

@media (max-width: 380px) {
  .g4-chapter-title {
    font-size: 12.5px;
    padding-right: 64px;
  }
  .g4-chapter-subtitle {
    font-size: 9.5px;
    padding-right: 64px;
  }
  .g4-btn-bikip {
    padding: 3px 6px;
    font-size: 10px;
  }
  .g4-active-quest-card {
    width: 155px;
    left: 33% !important;
  }
  .g4-puck-body {
    width: 48px;
    height: 48px;
  }
  .puck-boss-3d {
    width: 58px;
    height: 58px;
  }
  .g4-puck-title-pill {
    max-width: 68px;
    font-size: 8.5px;
  }
}

/* ==========================================================================
   MOBILE NATIVE APP: BẢN ĐỒ PHIÊU LƯU TRÀN VIỀN TỰ SCALE THEO MÀN HÌNH (100% EDGE-TO-EDGE)
   Loại bỏ hoàn toàn khung viền card, bóng mờ và khoảng trống thừa phía dưới
   Hỗ trợ hoàn hảo cho mọi tỉ lệ màn hình: iPhone SE, iPhone 14/15, Android
   ========================================================================== */
@media (max-width: 640px) {
  /* 1. KHỐI LỚP 2: ADVENTURE WRAPPER & CANVAS */
  .grade2-adventure-wrapper,
  .mockup-adventure-canvas-wrapper {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    min-height: unset !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    overflow: hidden !important;
    position: relative !important;
    box-sizing: border-box !important;
  }

  /* Thanh chọn môn học Lớp 2 ghim sát đỉnh dưới App Header như tab native */
  .mockup-subject-floating-bar {
    flex-shrink: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 4px 8px !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: none !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    z-index: 25 !important;
    gap: 6px !important;
  }

  .mockup-subject-floating-bar:has(.grade-context-dropdown.open),
  .grade2-adventure-wrapper .mockup-subject-floating-bar:has(.grade-context-dropdown.open) {
    overflow: visible !important;
    z-index: 150 !important;
  }

  .mockup-subject-floating-btn {
    padding: 6px 14px !important;
    font-size: 12.5px !important;
    flex-shrink: 0 !important;
  }

  /* Canvas Lớp 2: Chiếm trọn 100% không gian còn lại giữa thanh môn học và bottom nav */
  .grade2-adventure-wrapper .mockup-adventure-canvas,
  .mockup-adventure-canvas {
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: unset !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    position: relative !important;
    overflow: hidden !important;
  }

  /* Ảnh nền 3D Lớp 2 tự scale theo màn hình (vừa khít 100% chiều ngang và dọc) */
  .grade2-adventure-wrapper .mockup-canvas-bg-img,
  .mockup-canvas-bg-img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: fill !important;
    display: block !important;
    pointer-events: none !important;
  }

  .mockup-hotspots-layer {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
  }

  .mockup-hotspot {
    pointer-events: auto !important;
  }

  /* 2. KHỐI LỚP 4: ADVENTURE PAGE & CANVAS */
  .g4-adventure-page {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    min-height: unset !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    overflow: hidden !important;
    position: relative !important;
    box-sizing: border-box !important;
  }

  /* Thanh chọn môn học Lớp 4 ghim sát đỉnh dưới App Header */
  .g4-subject-tabs {
    flex-shrink: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 4px 8px !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: none !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    z-index: 25 !important;
    gap: 6px !important;
  }

  .g4-subject-tabs:has(.grade-context-dropdown.open),
  .g4-adventure-page .g4-subject-tabs:has(.grade-context-dropdown.open) {
    overflow: visible !important;
    z-index: 150 !important;
  }

  .g4-tab-btn {
    padding: 6px 14px !important;
    font-size: 12.5px !important;
    flex-shrink: 0 !important;
  }

  /* Canvas Lớp 4: Chiếm trọn 100% chiều cao và chiều rộng */
  .g4-adventure-canvas {
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    position: relative !important;
    overflow: hidden !important;
  }

  .g4-clean-backdrop {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: fill !important;
    object-position: center bottom !important;
    display: block !important;
    pointer-events: none !important;
  }
}

/* Tinh chỉnh cho các màn hình có chiều cao hạn chế (< 700px như iPhone SE) */
@media (max-width: 640px) and (max-height: 700px) {
  .g4-header-card {
    padding: 5px 8px;
    margin-bottom: 4px;
  }
  .g4-chapter-banner {
    padding: 6px 10px;
    border-radius: 12px;
  }
  .g4-chapter-title {
    font-size: 12px;
  }
  .g4-chapter-subtitle {
    display: none;
  }
  .g4-active-quest-card {
    top: 20% !important;
    transform: scale(0.88);
    transform-origin: top left;
  }
  .g4-mascot-container {
    top: 20% !important;
    transform: scale(0.8);
    transform-origin: top right;
  }
  .g4-daily-goal-card {
    bottom: 6px;
    padding: 4px 8px;
    border-radius: 10px;
  }
  .goal-medal-coin {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }
  .goal-title {
    font-size: 10.5px;
  }
  .goal-subtitle {
    font-size: 9.5px;
  }
}

/* Vị trí xuất phát ban đầu của chú Ong Vàng (ở bãi cỏ bên trái, không che khối gỗ 1) */
.grade2-adventure-wrapper .beelio-mascot-entity,
.beelio-mascot-entity {
  z-index: 30;
}
.grade2-adventure-wrapper .beelio-mascot-entity .mascot-speech-bubble,
.g4-ui-overlay .beelio-mascot-entity .mascot-speech-bubble,
.beelio-mascot-entity .mascot-speech-bubble {
  position: relative !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  white-space: normal !important;
  pointer-events: none;
}

/* ==========================================================================
   TỐI ƯU HÓA PHÒNG HỌC BEELIO TRÊN THIẾT BỊ DI ĐỘNG (MOBILE LESSON NATIVE UX)
   Khắc phục triệt để hiện tượng che khuất đáp án C, D và nút Kiểm Tra
   ========================================================================== */
@media (max-width: 640px) {
  .beelio-lesson-viewport {
    height: 100vh !important;
    height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
  }

  .beelio-lesson-header {
    height: 52px !important;
    padding: 0 12px !important;
    flex-shrink: 0 !important;
  }

  .beelio-header-container {
    gap: 12px !important;
  }

  .beelio-lesson-body {
    flex: 1 1 auto !important;
    padding: 10px 14px calc(80px + env(safe-area-inset-bottom, 12px)) 14px !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .beelio-question-container {
    gap: 12px !important;
    margin: 0 auto !important;
    width: 100% !important;
  }

  /* Mascot nhỏ gọn dạng banner khích lệ */
  .beelio-mascot-speech-row {
    gap: 10px !important;
    padding: 2px 4px !important;
  }

  .beelio-mascot-frame {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
  }

  .beelio-mascot-frame .mascot-bee-avatar-3d,
  .beelio-mascot-frame img,
  .beelio-mascot-frame svg {
    width: 44px !important;
    height: 44px !important;
  }

  .beelio-speech-bubble {
    padding: 6px 12px !important;
    border-radius: 14px !important;
  }

  .beelio-speech-text {
    font-size: 12.5px !important;
    line-height: 1.35 !important;
  }

  /* Thẻ câu hỏi gọn gàng */
  .beelio-prompt-card {
    padding: 12px 14px !important;
    border-radius: 16px !important;
    box-shadow: 0 3px 0 var(--beelio-game-gray-shadow) !important;
  }

  .beelio-prompt-header {
    margin-bottom: 8px !important;
  }

  .beelio-prompt-content {
    font-size: 16px !important;
    line-height: 1.4 !important;
  }

  /* Hình minh họa trực quan (SVG) co giãn vừa vặn màn hình */
  .beelio-prompt-card .g2-visual-wrapper {
    margin: 8px 0 4px !important;
    padding: 8px !important;
  }

  .beelio-prompt-card svg {
    max-height: 75px !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Lưới đáp án: tự động 2 cột khi nội dung ngắn, 1 cột khi nội dung dài */
  .beelio-options-grid {
    gap: 8px !important;
  }

  .beelio-options-grid.grid-2col {
    grid-template-columns: 1fr 1fr !important;
  }

  .beelio-choice-card {
    padding: 10px 12px !important;
    border-radius: 14px !important;
    gap: 10px !important;
    font-size: 15px !important;
    min-height: 48px !important;
    box-shadow: 0 3px 0 var(--beelio-game-gray-shadow) !important;
  }

  .choice-key-badge {
    width: 26px !important;
    height: 26px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
  }

  .choice-key-hint {
    display: none !important;
  }

  /* Thanh đáy toàn chiều ngang, nút to dễ bấm ngón cái */
  .beelio-bottom-bar {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)) 16px !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06) !important;
  }

  .beelio-bottom-content {
    width: 100% !important;
    max-width: 100% !important;
  }

  .beelio-btn-action {
    width: 100% !important;
    height: 48px !important;
    font-size: 15.5px !important;
    border-radius: 14px !important;
    justify-content: center !important;
  }

  /* Tấm phản hồi đúng/sai dưới đáy tràn viền */
  .beelio-sheet-feedback {
    padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0px)) 18px !important;
  }

  .beelio-sheet-inner {
    flex-direction: column !important;
    gap: 12px !important;
  }

  .beelio-sheet-status-col {
    width: 100% !important;
  }

  .beelio-sheet-inner .beelio-btn-action {
    width: 100% !important;
  }
}

/* ==========================================================================
   15. CÂU HỎI TỰ LUẬN NGẮN (SHORT ANSWER) & BÀN PHÍM CẢM ỨNG BEELIO
   ========================================================================== */
.beelio-short-answer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 520px;
  margin: 12px auto 0;
  animation: beelio-fade-in 0.25s ease-out;
}

@keyframes beelio-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.beelio-input-card {
  display: flex;
  align-items: center;
  width: 100%;
  background: #FFFFFF;
  border: 2.5px solid var(--beelio-game-gray-border, #E2E8F0);
  border-bottom: 5px solid var(--beelio-game-gray-shadow, #CBD5E1);
  border-radius: 20px;
  padding: 10px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-sizing: border-box;
}

.beelio-input-card:focus-within {
  border-color: #3B82F6 !important;
  border-bottom-color: #1D4ED8 !important;
  background: #F0F7FF !important;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.18) !important;
  transform: translateY(-2px);
}

.beelio-input-card.correct-answer {
  border-color: var(--beelio-game-green, #58CC02) !important;
  border-bottom-color: var(--beelio-game-green-dark, #46A302) !important;
  background: #DCFCE7 !important;
  box-shadow: 0 6px 20px rgba(88, 204, 2, 0.25) !important;
}

.beelio-input-card.wrong-answer {
  border-color: var(--beelio-game-red, #FF4B4B) !important;
  border-bottom-color: var(--beelio-game-red-dark, #EA2B2B) !important;
  background: #FEE2E2 !important;
  box-shadow: 0 6px 20px rgba(255, 75, 75, 0.25) !important;
}

.beelio-input-lead-icon {
  font-size: 24px;
  margin-right: 12px;
  user-select: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.beelio-answer-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--beelio-game-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 24px;
  font-weight: 900;
  color: #1E293B;
  text-align: center;
  padding: 6px 4px;
  letter-spacing: 1.5px;
  width: 100%;
}

.beelio-answer-input::placeholder {
  color: #94A3B8;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: normal;
}

.beelio-btn-clear-input {
  background: #F1F5F9;
  border: none;
  color: #64748B;
  font-size: 14px;
  font-weight: 900;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin-left: 8px;
  flex-shrink: 0;
}

.beelio-btn-clear-input:hover {
  background: #E2E8F0;
  color: #0F172A;
  transform: scale(1.1);
}

.beelio-btn-clear-input:active {
  transform: scale(0.95);
}

/* BÀN PHÍM SỐ CẢM ỨNG (TOUCH NUMPAD) */
.beelio-virtual-numpad {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  padding: 12px;
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: 20px;
  box-sizing: border-box;
}

.beelio-numpad-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.beelio-num-key {
  flex: 1;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-bottom: 4px solid #CBD5E1;
  border-radius: 14px;
  padding: 12px 0;
  font-family: var(--beelio-game-font, inherit);
  font-size: 20px;
  font-weight: 900;
  color: #1E293B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: all 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}

.beelio-num-key:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
  transform: translateY(-1px);
}

.beelio-num-key:active {
  transform: translateY(3px);
  border-bottom-width: 1px;
}

.beelio-num-key-op {
  background: #F8FAFC;
  color: #2563EB;
  border-color: #DBEAFE;
  border-bottom-color: #BFDBFE;
}

.beelio-num-key-del {
  flex: 1.6;
  background: #FEF2F2;
  border-color: #FECACA;
  border-bottom-color: #FCA5A5;
  color: #DC2626;
  font-size: 15px;
  font-weight: 800;
}

.beelio-num-key-del:hover {
  background: #FEE2E2;
}

@media (max-width: 640px) {
  .beelio-short-answer-container {
    gap: 12px;
    margin-top: 8px;
  }
  .beelio-input-card {
    padding: 8px 14px;
    border-radius: 16px;
    border-bottom-width: 4px;
  }
  .beelio-input-lead-icon {
    font-size: 20px;
    margin-right: 8px;
  }
  .beelio-answer-input {
    font-size: 20px;
    padding: 4px 0;
  }
  .beelio-answer-input::placeholder {
    font-size: 14px;
  }
  .beelio-virtual-numpad {
    padding: 8px;
    gap: 6px;
    border-radius: 16px;
  }
  .beelio-numpad-row {
    gap: 6px;
  }
  .beelio-num-key {
    padding: 10px 0;
    font-size: 18px;
    border-radius: 10px;
    border-bottom-width: 3px;
  }
  .beelio-num-key-del {
    font-size: 14px;
  }
}




/* ==========================================================================
   BEELIO ADAPTIVE LESSON STUDIO V2 — PHÒNG HỌC THÍCH ỨNG SƯ PHẠM LỚP 1–5
   Ấm áp, trực quan, đa hình thái theo môn học, nhưng thoáng sạch không rối mắt
   ========================================================================== */

/* 1. NỀN PHÒNG HỌC DỊU ẤM THEO MÔN HỌC (KHẮC PHỤC HIỆU ỨNG TRẮNG CHỒNG TRẮNG) */
.beelio-lesson-viewport.bls-studio-v2 {
  --bls-bg-base: #FAF7F0;
  --bls-bg-glow: rgba(245, 158, 11, 0.09);
  --bls-accent: #F59E0B;
  --bls-accent-soft: #FEF3C7;
  --bls-accent-text: #B45309;
  background-color: var(--bls-bg-base);
  background-image:
    radial-gradient(circle at 18% 8%, var(--bls-bg-glow) 0%, transparent 48%),
    radial-gradient(circle at 84% 90%, rgba(28, 176, 246, 0.06) 0%, transparent 45%),
    radial-gradient(rgba(148, 163, 184, 0.16) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 26px 26px;
}

.beelio-lesson-viewport.bls-studio-v2[data-subject="math"] {
  --bls-bg-base: #FAF8F2;
  --bls-bg-glow: rgba(245, 158, 11, 0.10);
  --bls-accent: #F59E0B;
  --bls-accent-soft: #FEF3C7;
  --bls-accent-text: #B45309;
}

.beelio-lesson-viewport.bls-studio-v2[data-subject="vietnamese"] {
  --bls-bg-base: #FDF8F5;
  --bls-bg-glow: rgba(236, 72, 153, 0.08);
  --bls-accent: #EC4899;
  --bls-accent-soft: #FCE7F3;
  --bls-accent-text: #BE185D;
}

.beelio-lesson-viewport.bls-studio-v2[data-subject="english"] {
  --bls-bg-base: #F3F9FE;
  --bls-bg-glow: rgba(14, 165, 233, 0.09);
  --bls-accent: #0EA5E9;
  --bls-accent-soft: #E0F2FE;
  --bls-accent-text: #0369A1;
}

.beelio-lesson-viewport.bls-studio-v2[data-subject="tnxh"],
.beelio-lesson-viewport.bls-studio-v2[data-subject="science"] {
  --bls-bg-base: #F3FAF6;
  --bls-bg-glow: rgba(16, 185, 129, 0.09);
  --bls-accent: #10B981;
  --bls-accent-soft: #DCFCE7;
  --bls-accent-text: #047857;
}

.beelio-lesson-viewport.bls-studio-v2[data-subject="history_geo"] {
  --bls-bg-base: #FCF8F2;
  --bls-bg-glow: rgba(249, 115, 22, 0.09);
  --bls-accent: #F97316;
  --bls-accent-soft: #FFEDD5;
  --bls-accent-text: #C2410C;
}

.beelio-lesson-viewport.bls-studio-v2[data-subject="informatics"] {
  --bls-bg-base: #F5F7FE;
  --bls-bg-glow: rgba(99, 102, 241, 0.09);
  --bls-accent: #6366F1;
  --bls-accent-soft: #E0E7FF;
  --bls-accent-text: #4338CA;
}

/* 2. HEADER STUDIO V2: MỐC 3 SAO · CHIP BÀI HỌC · COMBO LỬA · TIM NỔI KHỐI */
.bls-studio-v2 .beelio-lesson-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 68px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1.5px solid rgba(226, 232, 240, 0.85);
}

.bls-studio-v2 .beelio-header-container {
  max-width: 1020px;
  gap: 14px;
}

.bls-studio-v2 .beelio-btn-close {
  width: 38px;
  height: 38px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  color: #64748B;
  flex-shrink: 0;
}

.bls-studio-v2 .beelio-btn-close:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #0F172A;
}

.bls-subject-lesson-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bls-accent-soft);
  color: var(--bls-accent-text);
  font-family: var(--beelio-game-font);
  font-size: 12.5px;
  font-weight: 800;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.bls-subject-lesson-chip .bls-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Thanh tiến độ kèm 3 mốc Sao (60% · 85% · 100%) */
.bls-progress-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  padding: 6px 0;
}

.bls-studio-v2 .beelio-progress-container {
  height: 16px;
  background: #E2E8F0;
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.07);
  overflow: visible;
}

.bls-studio-v2 .beelio-progress-fill {
  background: linear-gradient(90deg, #4CC305 0%, #65E00A 100%);
  box-shadow: 0 0 12px rgba(88, 204, 2, 0.35);
}

.bls-milestone-pin {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  color: #94A3B8;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, background 0.2s ease;
  z-index: 3;
  pointer-events: none;
}

.bls-milestone-pin.is-earned {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #D97706;
  transform: translate(-50%, -50%) scale(1.14);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

/* Huy hiệu Combo lửa & Tim trên Header */
.bls-combo-header-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
  border: 1.5px solid #FDBA74;
  color: #C2410C;
  font-family: var(--beelio-game-font);
  font-size: 13px;
  font-weight: 900;
  animation: blsPopIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.bls-studio-v2 .beelio-hearts-badge {
  background: #FFF1F2;
  border: 1.5px solid #FECDD3;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 15.5px;
  box-shadow: 0 2px 0 #FFE4E6;
  flex-shrink: 0;
}

/* 3. BỐ CỤC BÀN HỌC LINH HOẠT (1 CỘT TẬP TRUNG HOẶC 2 CỘT KHI BẬT VỞ NHÁP Ô LI) */
.bls-studio-v2 .beelio-lesson-body {
  padding: 20px 20px 108px 20px;
  align-items: center;
}

.bls-studio-workspace {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  transition: max-width 0.22s ease;
}

@media (min-width: 980px) {
  .bls-studio-workspace.has-scratchpad-open {
    max-width: 1060px;
    grid-template-columns: minmax(0, 620px) 400px;
    gap: 24px;
  }
}

.bls-studio-v2 .beelio-question-container {
  max-width: 100%;
  gap: 16px;
}

/* 4. ONG VÀNG TRỢ LÍ NGỮ CẢNH (CONTEXTUAL COACH) */
.bls-coach-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 18px;
  background: #FFFBEB;
  border: 2px solid #FCD34D;
  box-shadow: 0 3px 0 #FDE68A;
  animation: blsPopIn 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bls-coach-banner.is-combo {
  background: linear-gradient(135deg, #F0FDF4 0%, #FEFCE8 100%);
  border-color: #86EFAC;
  box-shadow: 0 3px 0 #BBF7D0;
}

.bls-coach-banner.is-retry {
  background: #FFF7ED;
  border-color: #FDBA74;
  box-shadow: 0 3px 0 #FED7AA;
}

.bls-coach-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bls-coach-content {
  flex: 1;
  min-width: 0;
}

.bls-coach-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #B45309;
  margin-bottom: 2px;
}

.bls-coach-banner.is-combo .bls-coach-tag {
  color: #15803D;
}

.bls-coach-text {
  font-family: var(--beelio-game-font);
  font-size: 14.5px;
  font-weight: 700;
  color: #1E293B;
  line-height: 1.45;
}

.bls-coach-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.bls-coach-tts-btn,
.bls-coach-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid #FCD34D;
  background: #FFFFFF;
  color: #B45309;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.12s ease;
}

.bls-coach-tts-btn:hover,
.bls-coach-close-btn:hover {
  background: #FEF3C7;
  transform: translateY(-1px);
}

/* Nút Ong Vàng mini gọn trong thanh đầu thẻ đề bài khi chưa bung banner */
.bls-mini-coach-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 5px;
  border-radius: 999px;
  background: #FFFBEB;
  border: 1.5px solid #FDE68A;
  color: #B45309;
  font-family: var(--beelio-game-font);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bls-mini-coach-pill:hover {
  background: #FEF3C7;
  border-color: #F59E0B;
  transform: translateY(-1px);
}

.bls-mini-coach-pill.is-active {
  background: #FEF3C7;
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

/* 5. THẺ CÂU HỎI NỔI KHỐI & ĐA HÌNH THÁI (SMART POLYMORPHIC PROMPT) */
.bls-studio-v2 .beelio-prompt-card {
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-top: 4px solid var(--bls-accent);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow:
    0 4px 0 #CBD5E1,
    0 12px 28px rgba(15, 23, 42, 0.05);
}

.bls-stem-text {
  font-family: var(--beelio-game-font);
  font-size: 20px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.55;
}

.bls-stem-lead {
  font-family: var(--beelio-game-font);
  font-size: 16.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 10px;
}

.bls-question-after-passage {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1.5px dashed #E2E8F0;
}

/* Highlight số liệu Toán học & từ gạch chân */
.bls-math-datum {
  display: inline-block;
  padding: 0 7px;
  margin: 0 1px;
  border-radius: 8px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  color: #92400E;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.bls-focus-token {
  text-decoration: underline;
  text-decoration-thickness: 2.5px;
  text-underline-offset: 4px;
  text-decoration-color: #2563EB;
  color: #1D4ED8;
  background: #EFF6FF;
  padding: 0 5px;
  border-radius: 6px;
  font-weight: 900;
}

/* Ô khuyết tương tác trực tiếp (Live Cloze Slot) */
.bls-cloze-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 1px 12px;
  margin: 0 3px;
  border-radius: 10px;
  background: #F0F9FF;
  border: 2px dashed #38BDF8;
  color: #0284C7;
  font-weight: 900;
  font-size: 0.94em;
  vertical-align: baseline;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bls-cloze-slot.is-filled {
  background: #E0F2FE;
  border-style: solid;
  border-color: #0284C7;
  box-shadow: 0 2px 0 #0369A1;
  color: #0C4A6E;
  transform: translateY(-1px);
}

.bls-static-blank {
  display: inline-block;
  min-width: 44px;
  border-bottom: 2px dashed #94A3B8;
  text-align: center;
  color: #64748B;
  margin: 0 3px;
}

/* Trang sách Đọc hiểu / Khổ thơ (Reading Passage Card) */
.bls-passage-card {
  background: linear-gradient(180deg, #FFFDF8 0%, #FEF9EE 100%);
  border: 1.5px solid #FDE68A;
  border-left: 5px solid #F59E0B;
  border-radius: 16px;
  padding: 14px 16px;
}

.bls-passage-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #B45309;
  margin-bottom: 8px;
}

.bls-passage-body {
  max-height: 190px;
  overflow-y: auto;
  padding-right: 4px;
  font-family: var(--beelio-game-font);
  font-size: 16.5px;
  font-weight: 600;
  color: #1E293B;
  line-height: 1.65;
}

.bls-prose-para {
  margin: 0 0 8px 0;
}
.bls-prose-para:last-child {
  margin-bottom: 0;
}

.bls-passage-card.is-poem .bls-passage-body {
  padding-left: 8px;
}

.bls-poem-line {
  padding: 2px 0;
  font-style: italic;
  font-weight: 700;
  color: #334155;
}

/* Sân khấu Hội thoại 2 nhân vật (Dialogue Stage) */
.bls-dialogue-stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 16px;
  padding: 12px 14px;
}

.bls-chat-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}

.bls-chat-row.is-right {
  flex-direction: row-reverse;
}

.bls-chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #DBEAFE;
  color: #1D4ED8;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bls-chat-row.is-right .bls-chat-avatar {
  background: #DCFCE7;
  color: #15803D;
}

.bls-chat-bubble {
  max-width: 84%;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: 14px 14px 14px 4px;
  padding: 8px 13px;
  box-shadow: 0 2px 0 rgba(203, 213, 225, 0.7);
}

.bls-chat-row.is-right .bls-chat-bubble {
  background: #F0FDF4;
  border-color: #BBF7D0;
  border-radius: 14px 14px 4px 14px;
}

.bls-chat-speaker {
  font-size: 11px;
  font-weight: 800;
  color: #64748B;
  margin-bottom: 2px;
}

.bls-chat-speech {
  font-size: 16.5px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.45;
}

/* Khay thẻ từ xáo trộn (Word Scramble Tray) */
.bls-scramble-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: #F8FAFC;
  border: 1.5px dashed #CBD5E1;
  border-radius: 14px;
}

.bls-word-magnet {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  background: #FFFFFF;
  border: 2px solid #93C5FD;
  box-shadow: 0 3px 0 #60A5FA;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 800;
  color: #1E3A8A;
}

/* Danh sách câu/nhận định (1), (2), (3) */
.bls-statement-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 8px 0;
}

.bls-statement-item {
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 16px;
  font-weight: 700;
  color: #1E293B;
  line-height: 1.45;
}

/* 6. HÌNH MINH HỌA TRỰC QUAN TOÀN CẤP LỚP 1–5 (PLACE-VALUE TILES, PHÂN SỐ, ĐƠN VỊ) */
.bls-visual-card {
  margin-top: 14px;
  padding: 12px 16px 14px;
  background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
  border: 1.5px solid #E2E8F0;
  border-radius: 16px;
}

.bls-visual-caption {
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  margin-bottom: 10px;
  text-align: center;
}

.bls-digit-groups-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bls-digit-class-box {
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px dashed #CBD5E1;
  border-radius: 14px;
  padding: 8px 10px 6px;
}

.bls-digit-tiles {
  display: flex;
  align-items: flex-end;
  gap: 7px;
}

.bls-digit-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bls-digit-pointer {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 900;
  color: #B45309;
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
  animation: blsGentleBounce 1.4s ease-in-out infinite;
}

.bls-digit-pointer-spacer {
  height: 18px;
  display: block;
}

.bls-digit-box {
  width: 42px;
  height: 46px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  box-shadow: 0 3px 0 #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--beelio-game-font);
  font-size: 22px;
  font-weight: 900;
  color: #1E293B;
  font-variant-numeric: tabular-nums;
}

.bls-digit-tile.is-target .bls-digit-box {
  background: #FEF3C7;
  border-color: #F59E0B;
  box-shadow: 0 4px 0 #D97706;
  color: #92400E;
  transform: translateY(-2px);
}

.bls-digit-pos-dot {
  font-size: 10px;
  font-weight: 800;
  color: #94A3B8;
}

.bls-class-divider {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94A3B8;
  opacity: 0.65;
}

/* Thanh phân số trực quan */
.bls-fraction-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto;
}

.bls-frac-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bls-frac-label {
  width: 42px;
  text-align: right;
  font-weight: 900;
  font-size: 14px;
  color: #1E293B;
}

.bls-frac-segments {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--seg-count, 4), 1fr);
  gap: 3px;
  background: #CBD5E1;
  padding: 3px;
  border-radius: 9px;
}

.bls-frac-cell {
  height: 22px;
  background: #FFFFFF;
  border-radius: 5px;
}

.bls-frac-cell.is-shaded-a {
  background: linear-gradient(180deg, #38BDF8 0%, #0284C7 100%);
}

.bls-frac-cell.is-shaded-b {
  background: linear-gradient(180deg, #FBBF24 0%, #D97706 100%);
}

/* Bậc thang đơn vị đo */
.bls-unit-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bls-unit-pill {
  padding: 5px 12px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 2px solid #BFDBFE;
  box-shadow: 0 2px 0 #93C5FD;
  font-size: 14px;
  font-weight: 900;
  color: #1E40AF;
}

.bls-unit-arrow {
  color: #64748B;
  font-weight: 900;
  font-size: 14px;
}

/* 7. LƯỚI ĐÁP ÁN 2×2 TOÀN MÀN HÌNH & SẮC MÀU PASTEL A/B/C/D + LOA MINI 🔊 */
.bls-studio-v2 .beelio-options-grid.grid-2col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.bls-studio-v2 .beelio-choice-card {
  position: relative;
  border-color: #E2E8F0;
  box-shadow:
    0 4px 0 #CBD5E1,
    0 6px 16px rgba(15, 23, 42, 0.03);
  transition: transform 0.12s ease, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.12s ease;
}

.bls-studio-v2 .beelio-choice-card:hover:not(.selected):not(.correct-answer):not(.wrong-answer) {
  background: #FFFFFF;
  border-color: #94A3B8;
  transform: translateY(-1px);
  box-shadow:
    0 5px 0 #CBD5E1,
    0 10px 20px rgba(15, 23, 42, 0.06);
}

/* Màu pastel định danh nhẹ cho huy hiệu A / B / C / D ở trạng thái nghỉ */
.bls-studio-v2 .beelio-choice-card:not(.selected):not(.correct-answer):not(.wrong-answer)[data-index="0"] .choice-key-badge {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}

.bls-studio-v2 .beelio-choice-card:not(.selected):not(.correct-answer):not(.wrong-answer)[data-index="1"] .choice-key-badge {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #B45309;
}

.bls-studio-v2 .beelio-choice-card:not(.selected):not(.correct-answer):not(.wrong-answer)[data-index="2"] .choice-key-badge {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #15803D;
}

.bls-studio-v2 .beelio-choice-card:not(.selected):not(.correct-answer):not(.wrong-answer)[data-index="3"] .choice-key-badge {
  background: #FAF5FF;
  border-color: #E9D5FF;
  color: #7E22CE;
}

/* Nút loa đọc từng đáp án */
.bls-choice-right-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.bls-choice-tts-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  color: #475569;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.14s ease;
}

.bls-choice-tts-btn:hover {
  background: #EFF6FF;
  border-color: #93C5FD;
  color: #1D4ED8;
  transform: scale(1.08);
}

.bls-choice-tts-btn.is-speaking {
  background: #ECFDF5;
  border-color: #34D399;
  color: #047857;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* 8. BẢNG NHÁP VỞ Ô LI TIỂU HỌC (INTERACTIVE SCRATCHPAD) */
.bls-scratchpad-panel {
  background: #FFFFFF;
  border: 2px solid #93C5FD;
  border-radius: 22px;
  box-shadow:
    0 5px 0 #60A5FA,
    0 14px 32px rgba(15, 23, 42, 0.10);
  overflow: hidden;
  animation: blsPopIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bls-scratchpad-panel[hidden] {
  display: none !important;
}

.bls-scratchpad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: #EFF6FF;
  border-bottom: 1.5px solid #BFDBFE;
  flex-wrap: wrap;
}

.bls-scratchpad-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--beelio-game-font);
  font-size: 14px;
  font-weight: 900;
  color: #1E3A8A;
}

.bls-scratchpad-tools {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.bls-ink-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1.5px #CBD5E1;
  background: #FFFFFF;
  padding: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bls-ink-btn.is-active {
  box-shadow: 0 0 0 2.5px #2563EB;
  transform: scale(1.1);
}

.bls-ink-dot {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.bls-tool-btn,
.bls-pad-close-btn {
  border: 1.5px solid #CBD5E1;
  background: #FFFFFF;
  color: #334155;
  border-radius: 9px;
  padding: 3px 8px;
  font-family: var(--beelio-game-font);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}

.bls-tool-btn.is-active {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #B45309;
}

.bls-scratchpad-canvas-wrap {
  position: relative;
  height: 310px;
  background-color: #FFFDF9;
  /* Kẻ ô li Tiểu học Việt Nam chuẩn (ô lớn 24px + đường chia nhỏ mờ) */
  background-image:
    linear-gradient(to right, rgba(59, 130, 246, 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(59, 130, 246, 0.22) 1px, transparent 1px),
    linear-gradient(to right, rgba(147, 197, 253, 0.16) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(147, 197, 253, 0.16) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px, 12px 12px, 12px 12px;
  touch-action: none;
}

.bls-scratchpad-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.bls-scratchpad-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  font-family: var(--beelio-game-font);
  font-size: 13.5px;
  font-weight: 700;
  color: #94A3B8;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* 9. THANH ĐÁY CÂN ĐỐI: BÊN TRÁI (💡 GỢI Ý + ✏️ NHÁP Ô LI) · BÊN PHẢI (KIỂM TRA) */
.bls-studio-v2 .beelio-bottom-bar {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 2px solid #E2E8F0;
  padding: 13px 24px;
}

.bls-studio-v2 .beelio-bottom-content {
  max-width: 1020px;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.bls-bottom-helper-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bls-helper-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 15px;
  border-radius: 14px;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  box-shadow: 0 3px 0 #CBD5E1;
  color: #334155;
  font-family: var(--beelio-game-font);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
}

.bls-helper-btn:hover {
  border-color: #94A3B8;
  background: #F8FAFC;
  transform: translateY(-1px);
}

.bls-helper-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #CBD5E1;
}

.bls-helper-btn.bls-btn-hint.is-active {
  background: #FEF3C7;
  border-color: #F59E0B;
  box-shadow: 0 3px 0 #D97706;
  color: #92400E;
}

.bls-helper-btn.bls-btn-scratch.is-active {
  background: #EFF6FF;
  border-color: #3B82F6;
  box-shadow: 0 3px 0 #1D4ED8;
  color: #1E40AF;
}

/* 10. TẤM PHẢN HỒI ĐÚNG/SAI PHÂN TẦNG 2 GIÂY (STRUCTURED FEEDBACK SHEET) */
.bls-feedback-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
}

.bls-fb-correct-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid #FCA5A5;
  padding: 5px 12px;
  border-radius: 11px;
  width: fit-content;
}

.bls-fb-pill-tag {
  font-size: 12px;
  font-weight: 900;
  color: #15803D;
}

.bls-fb-pill-ans {
  font-size: 14.5px;
  font-weight: 900;
  color: #0F172A;
}

.bls-fb-explain {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.bls-fb-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bls-fb-trap-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  color: #92400E;
  font-size: 12.5px;
  font-weight: 800;
}

.bls-fb-retry-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(185, 28, 28, 0.25);
  color: #991B1B;
  font-size: 12px;
  font-weight: 800;
}

.bls-sheet-tts-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(15, 23, 42, 0.14);
  font-family: var(--beelio-game-font);
  font-size: 12px;
  font-weight: 800;
  color: #1E293B;
  cursor: pointer;
  vertical-align: middle;
}

.bls-sheet-tts-btn:hover {
  background: #FFFFFF;
}

@keyframes blsPopIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes blsGentleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2.5px); }
}

/* 11. TỐI ƯU RESPONSIVE MOBILE & TABLET NHỎ */
@media (max-width: 720px) {
  .bls-subject-lesson-chip {
    display: none;
  }

  .bls-stem-text {
    font-size: 17px !important;
  }

  .bls-digit-box {
    width: 36px;
    height: 40px;
    font-size: 19px;
  }

  .bls-scratchpad-canvas-wrap {
    height: 210px;
  }

  .bls-studio-v2 .beelio-bottom-content {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .bls-bottom-helper-group {
    flex-shrink: 0;
    gap: 6px;
  }

  .bls-helper-btn {
    padding: 9px 11px;
    font-size: 12.5px;
    border-radius: 12px;
  }

  .bls-helper-btn .bls-helper-label-long {
    display: none;
  }

  .bls-studio-v2 #btn-check-action {
    flex: 1;
    width: auto !important;
  }
}
