/* ==========================================================================
   BEElio V3.0 — Rewards, 3D Cosmetics, Hybrid Leaderboard & Parent Vouchers
   100% Offline-First • Pure BEElio Brand Tokens • Light / Sepia / Dark Ready
   ========================================================================== */

@keyframes beelioRwPulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.07); opacity: 1; }
}

@keyframes beelioRwPetFloat {
  0%, 100% { transform: translateY(0px) rotate(-4deg); }
  50% { transform: translateY(-6px) rotate(6deg); }
}

@keyframes beelioRwRainbowSpin {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* --- 3D MASCOT COSMETIC LAYERS (ATTACHED TO .mascot-bee-avatar-3d) --- */
.beelio-rw-mascot-aura {
  animation: beelioRwPulseGlow 2.4s ease-in-out infinite;
}
.beelio-rw-aura-aura_honey {
  background: radial-gradient(circle, rgba(251, 191, 36, 0.55) 0%, rgba(245, 158, 11, 0.22) 55%, transparent 74%);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
}
.beelio-rw-aura-aura_emerald {
  background: radial-gradient(circle, rgba(74, 222, 128, 0.55) 0%, rgba(22, 163, 74, 0.22) 55%, transparent 74%);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.45);
}
.beelio-rw-aura-aura_rainbow {
  background: conic-gradient(from 0deg, rgba(244, 63, 94, 0.42), rgba(251, 191, 36, 0.45), rgba(52, 211, 153, 0.45), rgba(56, 189, 248, 0.45), rgba(168, 85, 247, 0.45), rgba(244, 63, 94, 0.42));
  filter: blur(2px);
  animation: beelioRwRainbowSpin 6s linear infinite;
}
.beelio-rw-aura-aura_phoenix {
  background: radial-gradient(circle, rgba(251, 146, 60, 0.65) 0%, rgba(239, 68, 68, 0.3) 56%, transparent 75%);
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.5);
}

.beelio-rw-mascot-pet {
  animation: beelioRwPetFloat 2.1s ease-in-out infinite;
  filter: drop-shadow(0 3px 5px rgba(15, 23, 42, 0.2));
}

.beelio-rw-mascot-hat {
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.24));
}

.beelio-rw-frame-frame_sprout {
  border-radius: 50%;
  box-shadow: 0 0 0 3px #22C55E, 0 0 0 6px #DCFCE7;
  background: radial-gradient(circle, #F0FDF4 0%, #DCFCE7 100%);
}
.beelio-rw-frame-frame_crystal {
  border-radius: 50%;
  box-shadow: 0 0 0 3px #0EA5E9, 0 0 0 6px #E0F2FE;
  background: radial-gradient(circle, #F0F9FF 0%, #BAE6FD 100%);
}
.beelio-rw-frame-frame_phoenix {
  border-radius: 50%;
  box-shadow: 0 0 0 3px #F97316, 0 0 0 6px #FFEDD5;
  background: radial-gradient(circle, #FFF7ED 0%, #FED7AA 100%);
}
.beelio-rw-frame-frame_royal {
  border-radius: 50%;
  box-shadow: 0 0 0 3.5px #EAB308, 0 0 0 7px #FEF08A, 0 6px 16px rgba(202, 138, 4, 0.35);
  background: radial-gradient(circle, #FFFBEB 0%, #FDE68A 100%);
}

/* --- VICTORY PILLS IN LESSON ENGINE --- */
.beelio-rw-v-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  background: #FEF3C7;
  color: #92400E;
  border: 1.5px solid #FCD34D;
}
.beelio-rw-v-pill.pill-flower {
  background: #FCE7F3;
  color: #9D174D;
  border-color: #F9A8D4;
}
.beelio-rw-v-pill.pill-levelup {
  background: #DCFCE7;
  color: #166534;
  border-color: #86EFAC;
}
.beelio-rw-v-pill.pill-badge {
  background: #EDE9FE;
  color: #5B21B6;
  border-color: #C4B5FD;
}
.beelio-rw-v-pill.pill-replay {
  background: #F1F5F9;
  color: #475569;
  border-color: #CBD5E1;
}

/* --- HEADER CAPSULES (PROFILE SWITCHER V2) & STAGE SKY TOPBAR REWARD PILLS --- */
.header-utilities .util-capsule.gem-capsule,
.header-utilities .util-capsule.flower-capsule {
  display: none !important;
}

.util-capsule.profile-capsule {
  cursor: pointer;
  height: 34px;
  padding: 0 11px 0 9px;
  border-radius: 999px;
  background: #FFFBEB;
  border: 1.5px solid #FDE68A;
  color: #92400E;
  max-width: 210px;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(245, 158, 11, 0.08);
  transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}
.util-capsule.profile-capsule:hover {
  background: #FEF3C7;
  border-color: #FCD34D;
  color: #78350F;
  transform: translateY(-1px);
}
.util-capsule.profile-capsule .capsule-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
  font-size: 12.5px;
}
.util-capsule.profile-capsule .profile-chip-caret {
  font-size: 10px;
  opacity: 0.7;
  margin-left: 1px;
  line-height: 1;
}

/* Đồng bộ 3 viên nang chỉ số (🔥 Chuỗi ngày, 💎 Kim Cương, 🌸 Hoa Điểm 10) dưới thanh mây khung Hành Trình */
.bv3-topbar-stats .bv3-stat-pill.bv3-gem-pill,
.bv3-topbar-stats .bv3-stat-pill.bv3-flower-pill {
  appearance: none;
  font-family: inherit;
  cursor: pointer;
  user-select: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.bv3-topbar-stats .bv3-stat-pill.bv3-gem-pill:hover {
  transform: translateY(-1px);
  border-color: #EAB348;
  background: linear-gradient(180deg, #FFFFFF 0%, #FEF0C7 100%);
}

.bv3-topbar-stats .bv3-stat-pill.bv3-flower-pill {
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF7E2 100%);
  border: 2px solid #F3D999;
  box-shadow: 0 3px 0 #DEC27E, 0 5px 10px rgba(15, 23, 42, 0.08);
  color: #1E293B;
}

.bv3-topbar-stats .bv3-stat-pill.bv3-flower-pill:hover {
  transform: translateY(-1px);
  border-color: #F472B6;
  background: linear-gradient(180deg, #FFFFFF 0%, #FDF2F8 100%);
}

.bv3-topbar-stats .bv3-stat-pill.bv3-gem-pill:active,
.bv3-topbar-stats .bv3-stat-pill.bv3-flower-pill:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #DEC27E;
}

.bv3-topbar-stats .bv3-stat-pill.bv3-gem-pill:focus-visible,
.bv3-topbar-stats .bv3-stat-pill.bv3-flower-pill:focus-visible {
  outline: 2.5px solid #2563EB;
  outline-offset: 2px;
}

.bv3-topbar-stats .bv3-stat-flower {
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 1px rgba(190, 24, 93, 0.18));
}

.bv3-topbar-stats .bv3-gem-val,
.bv3-topbar-stats .bv3-flower-val {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 680px) {
  .bv3-topbar-stats {
    flex-wrap: wrap;
    gap: 6px;
  }

  .bv3-topbar-stats .bv3-stat-pill {
    padding: 4px 9px;
    font-size: 0.78rem;
    gap: 5px;
  }
}

/* --- MAIN REWARD HUB LAYOUT (CALM, CLEAN, SCANNABLE) --- */
.beelio-rw-hub {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 16px 96px;
  font-family: 'Nunito', 'Be Vietnam Pro', system-ui, sans-serif;
  color: #1E293B;
}

.beelio-rw-hero {
  background: #FFFDF7;
  border: 1.5px solid #FDE68A;
  border-radius: 20px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  margin-bottom: 12px;
}

.beelio-rw-hero-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 240px;
}

.beelio-rw-avatar-stage {
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.beelio-rw-profile-meta {
  min-width: 0;
  flex: 1;
}

.beelio-rw-hero-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.beelio-rw-profile-meta h1 {
  margin: 0;
  font-size: 18.5px;
  font-weight: 900;
  color: #0F172A;
  line-height: 1.2;
}

.beelio-rw-grade-pill {
  font-size: 11.5px;
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.beelio-rw-hero-sub {
  font-size: 12.5px;
  font-weight: 700;
  color: #92400E;
  margin-top: 2px;
}

.beelio-rw-xp-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  max-width: 280px;
}

.beelio-rw-xp-bar-track {
  flex: 1;
  height: 8px;
  background: #FEF3C7;
  border-radius: 999px;
  overflow: hidden;
}

.beelio-rw-xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #22C55E, #16A34A);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.beelio-rw-xp-num {
  font-size: 11.5px;
  font-weight: 800;
  color: #64748B;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.beelio-rw-wallet-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.beelio-rw-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 7px 11px;
  font-size: 14px;
  color: #0F172A;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.beelio-rw-stat-chip strong {
  font-weight: 900;
}

.beelio-rw-stat-chip small {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748B;
}

.beelio-rw-switch-profile-btn {
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #334155;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.beelio-rw-switch-profile-btn:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
}

/* --- HUB TABS (CLEAN SEGMENTED BAR) --- */
.beelio-rw-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  margin-bottom: 14px;
}

.beelio-rw-tab-btn {
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.beelio-rw-tab-btn:hover {
  color: #0F172A;
}
.beelio-rw-tab-btn.active {
  background: #FFFFFF;
  border-color: #FDE68A;
  color: #B45309;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07);
}

.beelio-rw-tab-dot {
  background: #EF4444;
  color: #FFFFFF;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.3;
}
.beelio-rw-tab-dot.ok {
  background: #16A34A;
}
.beelio-rw-tab-dot.pink {
  background: #DB2777;
}

/* --- TOAST / FEEDBACK BANNER --- */
.beelio-rw-toast {
  margin-bottom: 14px;
  padding: 11px 16px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.beelio-rw-toast.ok {
  background: #ECFDF5;
  border: 1.5px solid #6EE7B7;
  color: #065F46;
}
.beelio-rw-toast.warn {
  background: #FEF3C7;
  border: 1.5px solid #FCD34D;
  color: #92400E;
}

/* --- CO-OP HONEY POT CARD (INSIDE QUESTS TAB) --- */
.beelio-rw-coop-card {
  background: #FFFDF7;
  border: 1.5px solid #FDE68A;
  border-radius: 20px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.beelio-rw-coop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.beelio-rw-coop-title {
  font-size: 16.5px;
  font-weight: 900;
  color: #92400E;
  margin: 0;
}
.beelio-rw-coop-track {
  height: 12px;
  background: #FEF3C7;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.beelio-rw-coop-fill {
  height: 100%;
  background: linear-gradient(90deg, #FBBF24, #EA580C);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.beelio-rw-coop-contributors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.beelio-rw-contrib-chip {
  background: #FFFFFF;
  border: 1px solid #FDE68A;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 800;
  color: #78350F;
}

/* --- CLEAN LEADERBOARD TOOLBAR --- */
.beelio-lb-card {
  padding: 18px 20px;
}

.beelio-lb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #F1F5F9;
}

.beelio-lb-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.beelio-lb-title-group h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #0F172A;
}

.beelio-lb-league-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #FEF3C7;
  color: #92400E;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.beelio-lb-sync-dot {
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
  white-space: nowrap;
}
.beelio-lb-sync-dot.online {
  color: #15803D;
}

.beelio-lb-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.beelio-lb-sort-seg {
  display: inline-flex;
  align-items: center;
  background: #F1F5F9;
  padding: 3px;
  border-radius: 11px;
  gap: 2px;
}

.beelio-lb-sort-btn {
  padding: 6px 11px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #475569;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.beelio-lb-sort-btn:hover {
  color: #0F172A;
}
.beelio-lb-sort-btn.active {
  background: #FFFFFF;
  color: #B45309;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.beelio-lb-sub-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.beelio-lb-grade-select {
  height: 34px;
  padding: 0 28px 0 11px;
  border-radius: 10px;
  border: 1px solid #CBD5E1;
  background-color: #FFFFFF;
  color: #334155;
  font-weight: 800;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
}

.beelio-lb-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #475569;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: background 0.14s ease, color 0.14s ease;
}
.beelio-lb-icon-btn:hover {
  background: #F8FAFC;
  color: #0F172A;
}

/* --- PODIUM TOP 3 --- */
.beelio-rw-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}
.beelio-rw-podium-card {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 18px;
  padding: 12px 10px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.beelio-rw-podium-card.is-empty {
  opacity: 0.45;
  border-style: dashed;
  min-height: 132px;
  justify-content: center;
}
.beelio-rw-podium-card.rank-1 {
  background: linear-gradient(180deg, #FFFDF5 0%, #FEF3C7 100%);
  border-color: #FBBF24;
  padding-top: 16px;
  padding-bottom: 14px;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.14);
}
.beelio-rw-podium-card.rank-2 {
  background: linear-gradient(180deg, #FFFFFF 0%, #F1F5F9 100%);
  border-color: #CBD5E1;
}
.beelio-rw-podium-card.rank-3 {
  background: linear-gradient(180deg, #FFFBF7 0%, #FFEDD5 100%);
  border-color: #FDBA74;
}
.beelio-rw-podium-card.is-me {
  box-shadow: 0 0 0 2px #10B981, 0 8px 20px rgba(16, 185, 129, 0.14);
}
.beelio-rw-podium-medal {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 4px;
}
.beelio-rw-podium-bee {
  display: flex;
  justify-content: center;
}
.beelio-rw-podium-name {
  font-weight: 900;
  font-size: 14px;
  color: #0F172A;
  margin-top: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.beelio-rw-podium-grade {
  font-size: 11.5px;
  color: #64748B;
  font-weight: 700;
  margin-top: 1px;
}
.beelio-rw-podium-xp {
  font-weight: 900;
  font-size: 14px;
  color: #B45309;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.78);
  padding: 2px 10px;
  border-radius: 999px;
}
.beelio-lb-podium-cheer {
  margin-top: 6px;
  border: 1px solid #E2E8F0;
  background: rgba(255, 255, 255, 0.88);
  color: #64748B;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.beelio-lb-podium-cheer:not(:disabled):hover {
  border-color: #FBBF24;
  color: #B45309;
  background: #FFFFFF;
}
.beelio-lb-podium-cheer.self {
  border-color: #A7F3D0;
  background: #ECFDF5;
  color: #047857;
  cursor: default;
}

/* --- SLIM PERSONAL RANK BAR --- */
.beelio-lb-my-strip {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 9px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.beelio-lb-my-text {
  font-size: 13px;
  color: #334155;
  font-weight: 600;
  line-height: 1.4;
}

.beelio-lb-cta-btn {
  padding: 6px 13px;
  border-radius: 10px;
  border: none;
  background: #16A34A;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease;
}
.beelio-lb-cta-btn:hover {
  background: #15803D;
}

/* --- LEADERBOARD TABLE LIST (#4+) --- */
.beelio-rw-board-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.beelio-rw-board-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 14px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}
.beelio-rw-board-row.is-me {
  background: #F0FDF4;
  border: 1.5px solid #34D399;
}
.beelio-rw-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.beelio-rw-pos-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #F1F5F9;
  color: #475569;
  font-weight: 800;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.beelio-rw-row-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex: 0 0 auto;
}
.beelio-rw-row-info {
  min-width: 0;
}
.beelio-rw-row-name {
  font-weight: 800;
  font-size: 14px;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.beelio-lb-me-tag {
  font-size: 10.5px;
  font-weight: 800;
  background: #10B981;
  color: #FFFFFF;
  padding: 1px 7px;
  border-radius: 999px;
}
.beelio-lb-sib-tag {
  font-size: 10.5px;
  font-weight: 800;
  background: #FEF3C7;
  color: #92400E;
  padding: 1px 7px;
  border-radius: 999px;
}
.beelio-rw-row-sub {
  font-size: 12px;
  color: #64748B;
  font-weight: 600;
}
.beelio-rw-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: right;
  flex: 0 0 auto;
}
.beelio-rw-row-xp {
  font-weight: 800;
  font-size: 14px;
  color: #0369A1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.beelio-lb-cheer-btn {
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #475569;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.beelio-lb-cheer-btn:not(:disabled):not(.self):hover {
  border-color: #FCD34D;
  background: #FFFBEB;
  color: #B45309;
}
.beelio-lb-cheer-btn:disabled {
  opacity: 0.65;
  cursor: default;
}
.beelio-lb-cheer-btn.self {
  border-color: #A7F3D0;
  background: #ECFDF5;
  color: #047857;
}

/* --- QUESTS, SHOP & PARENT CARDS --- */
.beelio-rw-section-card {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 18px;
}
.beelio-rw-section-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 900;
  color: #1E293B;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.beelio-rw-quest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1.5px solid #E2E8F0;
  background: #F8FAFC;
  margin-bottom: 10px;
}
.beelio-rw-quest-item.done {
  background: #F0FDF4;
  border-color: #86EFAC;
}

.beelio-rw-tts-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid #BAE6FD;
  background: #E0F2FE;
  color: #0369A1;
  cursor: pointer;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.beelio-rw-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.beelio-rw-item-card {
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.beelio-rw-item-card:hover {
  transform: translateY(-2px);
  border-color: #FBBF24;
}
.beelio-rw-item-card.equipped {
  border-color: #16A34A;
  background: #F0FDF4;
}
.beelio-rw-item-card.locked-badge {
  opacity: 0.62;
  background: #F8FAFC;
}

.beelio-rw-primary-btn {
  padding: 10px 16px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #58CC02, #16A34A);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 3px 0 #15803D;
}
.beelio-rw-primary-btn:disabled {
  background: #CBD5E1;
  box-shadow: none;
  cursor: not-allowed;
}

.beelio-rw-amber-btn {
  padding: 10px 16px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #F6B91A, #EA580C);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 3px 0 #B45309;
}

/* --- MODAL PROFILE SWITCHER --- */
.beelio-rw-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.beelio-rw-modal-card {
  background: #FFFFFF;
  border-radius: 24px;
  border: 2.5px solid #F59E0B;
  max-width: 480px;
  width: 100%;
  padding: 22px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
}

/* --- DARK & SEPIA THEME ADAPTATION --- */
html[data-theme="dark"] .beelio-rw-hub {
  color: #F1F5F9;
}
html[data-theme="dark"] .beelio-rw-section-card,
html[data-theme="dark"] .beelio-rw-board-row,
html[data-theme="dark"] .beelio-rw-item-card,
html[data-theme="dark"] .beelio-rw-stat-chip,
html[data-theme="dark"] .beelio-rw-switch-profile-btn,
html[data-theme="dark"] .beelio-lb-grade-select,
html[data-theme="dark"] .beelio-lb-icon-btn,
html[data-theme="dark"] .beelio-lb-my-strip,
html[data-theme="dark"] .beelio-rw-modal-card {
  background: #1E293B;
  border-color: #334155;
  color: #F1F5F9;
}
html[data-theme="dark"] .beelio-rw-tabs,
html[data-theme="dark"] .beelio-lb-sort-seg {
  background: #0F172A;
  border-color: #334155;
}
html[data-theme="dark"] .beelio-rw-tab-btn.active,
html[data-theme="dark"] .beelio-lb-sort-btn.active {
  background: #1E293B;
  color: #FBBF24;
  border-color: #B45309;
}
html[data-theme="dark"] .beelio-rw-hero,
html[data-theme="dark"] .beelio-rw-coop-card {
  background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
  border-color: #D97706;
}
html[data-theme="dark"] .beelio-rw-profile-meta h1,
html[data-theme="dark"] .beelio-lb-title-group h3,
html[data-theme="dark"] .beelio-rw-section-title,
html[data-theme="dark"] .beelio-rw-row-name,
html[data-theme="dark"] .beelio-rw-podium-name {
  color: #F8FAFC;
}
html[data-theme="dark"] .beelio-lb-my-text {
  color: #CBD5E1;
}
html[data-theme="dark"] .beelio-rw-quest-item {
  background: #0F172A;
  border-color: #334155;
}

/* --- MOBILE RESPONSIVENESS --- */
.beelio-rw-podium-xp {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .beelio-rw-hub {
    padding: 10px 10px 92px;
  }

  .beelio-rw-hero {
    padding: 12px;
    border-radius: 16px;
    gap: 10px;
  }

  .beelio-rw-hero-left {
    min-width: 0;
    width: 100%;
    gap: 10px;
  }

  .beelio-rw-avatar-stage {
    width: 56px;
    height: 56px;
  }

  .beelio-rw-avatar-stage .mascot-bee-avatar-3d {
    transform: scale(0.84);
    transform-origin: center;
  }

  .beelio-rw-profile-meta h1 {
    font-size: 16.5px;
  }

  .beelio-rw-xp-inline {
    max-width: 100%;
  }

  .beelio-rw-wallet-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .beelio-rw-stat-chip {
    justify-content: center;
    padding: 6px 4px;
    font-size: 12.5px;
    gap: 3px;
  }

  .beelio-rw-stat-chip small {
    display: none;
  }

  .beelio-rw-switch-profile-btn {
    grid-column: 1 / -1;
    width: 100%;
    text-align: center;
    padding: 7px 10px;
  }

  .beelio-rw-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 12px;
  }

  .beelio-rw-tab-btn {
    padding: 8px 6px;
    font-size: 12.5px;
    gap: 5px;
    white-space: nowrap;
  }

  .beelio-lb-toolbar {
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .beelio-lb-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .beelio-lb-sort-seg {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .beelio-lb-sort-btn {
    padding: 6px 4px;
    font-size: 11.5px;
    text-align: center;
  }

  .beelio-lb-sub-actions {
    width: 100%;
  }

  .beelio-lb-grade-select {
    flex: 1;
    min-width: 0;
  }

  .beelio-rw-section-card,
  .beelio-rw-coop-card {
    padding: 14px 12px;
    border-radius: 18px;
    margin-bottom: 14px;
  }

  .beelio-rw-section-title,
  .beelio-rw-coop-title {
    font-size: 16px;
  }
}

@media (max-width: 600px) {
  /* Bục vinh quang Top 3 trên màn hình hẹp (320px-600px): Cân đối 3 cột gọn gàng, không vỡ chữ XP */
  .beelio-rw-podium {
    gap: 6px;
    margin-bottom: 14px;
  }

  .beelio-rw-podium-card {
    padding: 10px 4px;
    border-radius: 16px;
    min-width: 0;
    overflow: hidden;
  }

  .beelio-rw-podium-card.rank-1 {
    padding-top: 13px;
  }

  .beelio-rw-podium-medal {
    font-size: 20px;
    margin-bottom: 2px;
  }

  .beelio-rw-podium-card .mascot-bee-avatar-3d {
    transform: scale(0.76);
    transform-origin: center;
    margin: -6px 0;
  }

  .beelio-rw-podium-name {
    font-size: 11.5px;
    margin-top: 2px;
    padding: 0 2px;
  }

  .beelio-rw-podium-card > div:nth-child(4) {
    font-size: 10px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .beelio-rw-podium-xp {
    font-size: 12px;
    margin-top: 3px;
    white-space: nowrap;
  }

  /* Hàng xếp hạng Bảng Vàng & Phiếu quà Phụ huynh: Bố cục 2 tầng rộng rãi trên điện thoại */
  .beelio-rw-board-row {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 11px 12px;
  }

  .beelio-rw-row-left {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    gap: 10px;
    align-items: flex-start;
  }

  .beelio-rw-row-info {
    flex: 1 1 0%;
    min-width: 0;
  }

  .beelio-rw-row-name {
    font-size: 14px;
    gap: 5px;
  }

  .beelio-rw-row-sub {
    font-size: 12px;
    line-height: 1.4;
    margin-top: 2px;
  }

  .beelio-rw-board-row > .beelio-rw-row-right,
  .beelio-rw-board-row > div:nth-child(2) {
    flex: 1 1 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 7px;
    padding-left: 40px;
    border-top: 1px dashed #E2E8F0;
    text-align: left;
    box-sizing: border-box;
  }

  /* Với hàng Phiếu quà Phụ huynh có 2 nút Duyệt / Hoàn Hoa: Canh đều toàn chiều ngang */
  .beelio-rw-board-row > div:nth-child(2):not(.beelio-rw-row-right) {
    padding-left: 0;
  }

  .beelio-rw-board-row > div:nth-child(2):not(.beelio-rw-row-right) > button {
    flex: 1 1 0%;
    white-space: nowrap;
    text-align: center;
  }

  html[data-theme="dark"] .beelio-rw-board-row > .beelio-rw-row-right,
  html[data-theme="dark"] .beelio-rw-board-row > div:nth-child(2) {
    border-top-color: #334155;
  }

  /* Hàng Nhiệm vụ hằng ngày: Tách thành 2 tầng để tên nhiệm vụ & thanh tiến độ rộng tối đa */
  .beelio-rw-quest-item {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }

  .beelio-rw-quest-item > div:first-child {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    align-items: flex-start !important;
  }

  .beelio-rw-quest-item > div:last-child {
    flex: 1 1 100% !important;
    width: 100% !important;
    justify-content: space-between !important;
    padding-left: 40px;
    box-sizing: border-box;
  }

  /* Kệ vật phẩm, Huy hiệu & Quà gia đình: 1 cột thoáng mắt trên điện thoại */
  .beelio-rw-grid-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Biểu mẫu Phụ huynh & Hộp thoại Hồ sơ Học sinh trên màn hình hẹp */
  #form-add-custom-reward input[name="title"] {
    min-width: 0 !important;
    flex: 1 1 100% !important;
  }

  #form-add-custom-reward button[type="submit"],
  #form-setup-parent-pin button[type="submit"],
  #form-unlock-parent-pin button[type="submit"],
  #btn-lb-jump-learn,
  #btn-parent-jump-exams,
  #btn-claim-daily-chest {
    width: 100%;
    text-align: center;
  }

  .beelio-rw-modal-backdrop {
    padding: 10px;
  }

  .beelio-rw-modal-card {
    padding: 16px 14px;
    border-radius: 20px;
  }

  #form-create-prof button[type="submit"],
  #form-edit-active-prof button[type="submit"] {
    flex: 1 1 100% !important;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .beelio-rw-tab-btn {
    padding: 9px 4px;
    font-size: 11.5px;
    gap: 4px;
  }

  .bls-bottom-helper-group .bls-helper-btn {
    white-space: nowrap;
    padding: 0 9px;
    font-size: 12px;
    gap: 4px;
  }
}
