/* ============================================================================
   GIAO DIỆN SỔ TAY VƯỜN CÂY TRẺ THƠ (THEO ĐẶC TẢ GARDEN-CURRENT-DEMO.MD §4)
   - Nền giấy kem ấm có chấm bi như trang vở (#FFFDF5), chữ nâu đậm (#3E2723)
   - Bảng màu: Lá non (#2E7D32 / #66BB6A), Vàng hướng dương (#FFB300 / #FFF59D),
     Hồng phấn (#EC407A / #FCE4EC), Xanh da trời (#0288D1 / #E1F5FE)
   - Quy tắc tương phản bắt buộc: CHỈ dùng 1 bảng màu sáng với chữ nâu đậm,
     KHÔNG dùng prefers-color-scheme: dark đảo màu.
   ============================================================================ */

:root {
  --bg-cream: #FFFDF5;
  --bg-paper: #FFF9E6;
  --bg-card: #FFFFFF;
  --ink-brown: #3E2723;
  --ink-muted: #6D4C41;
  --border-tan: #E6D2B5;
  --border-dashed: #D7CCC8;
  --green-deep: #1B5E20;
  --green-leaf: #2E7D32;
  --green-soft: #E8F5E9;
  --sun-gold: #FFB300;
  --sun-soft: #FFF8E1;
  --sun-header: #FFE082;
  --pink-petal: #D81B60;
  --pink-soft: #FCE4EC;
  --sky-blue: #0277BD;
  --sky-soft: #E1F5FE;
  --danger-red: #C62828;
  --danger-soft: #FFEBEE;
  --shadow-sticker: 0 4px 0 #D7B889, 0 6px 14px rgba(62, 39, 35, 0.08);
  --shadow-card: 0 6px 18px rgba(62, 39, 35, 0.07);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-cream);
  background-image: radial-gradient(#E5D3B3 1.35px, transparent 1.35px);
  background-size: 22px 22px;
  color: var(--ink-brown);
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color-scheme: light only;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Baloo 2', cursive, sans-serif;
  color: var(--ink-brown);
  margin: 0 0 10px 0;
  letter-spacing: -0.01em;
}

code {
  background: #FFF3C4;
  color: var(--ink-brown);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

a {
  color: var(--green-leaf);
  font-weight: 700;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---------- LAYOUT & SMART COLLAPSIBLE SIDEBAR ---------- */
.layout {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
  position: relative;
}

.sidebar-backdrop {
  display: none;
}

.sidebar {
  width: 262px;
  background: var(--bg-paper);
  border-right: 2.5px dashed var(--border-tan);
  padding: 12px 12px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 4px 0 16px rgba(62, 39, 35, 0.04);
  transition: width 0.22s ease, padding 0.22s ease, transform 0.25s ease;
  z-index: 50;
}

.layout.pc-sidebar-collapsed .sidebar {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right: none;
  overflow: hidden;
  box-shadow: none;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #D7B889 transparent;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 5px;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: #D7B889;
  border-radius: 999px;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #FFF3C4 0%, #E8F5E9 100%);
  border: 2px solid var(--border-tan);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--border-tan);
}

.sidebar .brand-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Baloo 2', cursive;
  font-size: 19px;
  font-weight: 800;
  color: var(--ink-brown);
  text-decoration: none;
}

.nav-group {
  margin-bottom: 6px;
}

button.nav-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 4px 0 3px;
  padding: 5px 10px;
  background: #F5E6C8;
  color: var(--ink-brown);
  border: 1.5px solid #E5D2B2;
  border-radius: 10px;
  font-family: 'Baloo 2', cursive;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  box-shadow: none;
  cursor: pointer;
}

button.nav-title:hover {
  background: #FCE8B2;
  transform: none;
}

button.nav-title.has-active {
  background: #FFE8A3;
  border-color: #F5B041;
}

.nav-chevron {
  font-size: 12px;
  opacity: 0.8;
}

.nav-group.collapsed .nav-items {
  display: none;
}

.sidebar a.nav-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6.5px 11px;
  margin: 3px 0;
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--ink-brown);
  border: 1.5px solid #EFE0C6;
  font-weight: 700;
  font-size: 13.5px;
  box-shadow: 0 2px 0 #E5D2B2;
  transition: transform 0.12s ease, background 0.12s ease;
  text-decoration: none;
}

.sidebar a.nav-link:hover {
  background: var(--sun-soft);
  border-color: var(--sun-gold);
  transform: translateX(2px);
  text-decoration: none;
}

.sidebar a.nav-link.active {
  background: var(--sun-header);
  color: var(--ink-brown);
  border-color: #F57F17;
  box-shadow: 0 3px 0 #F57F17;
  font-weight: 800;
}

.mobile-only {
  display: none !important;
}

.mobile-bottom-nav {
  display: none;
}

/* ---------- MAIN AREA & TOPBAR ---------- */
.main {
  flex: 1;
  padding: 18px 26px 48px;
  width: 100%;
  min-width: 0;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: linear-gradient(90deg, #FFF3C4 0%, #E8F5E9 52%, #E1F5FE 100%);
  color: var(--ink-brown);
  padding: 12px 18px;
  margin-bottom: 20px;
  border: 2.5px solid var(--border-tan);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar strong {
  font-family: 'Baloo 2', cursive;
  font-size: 21px;
  color: var(--ink-brown);
  display: block;
  line-height: 1.2;
}

.icon-btn {
  padding: 7px 12px !important;
  font-size: 14px !important;
}

/* ---------- GRID & FLEX HELPERS ---------- */
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.grid4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 10px;
}

/* ---------- CARDS & WASHI TAPE ---------- */
.card, .washi-card {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--border-tan);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
  color: var(--ink-brown);
}

.card.washi::before,
.washi-tape {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 112px;
  height: 18px;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 193, 7, 0.65),
    rgba(255, 193, 7, 0.65) 8px,
    rgba(255, 248, 225, 0.85) 8px,
    rgba(255, 248, 225, 0.85) 16px
  );
  border: 1px dashed #E0A800;
  border-radius: 4px;
  pointer-events: none;
}

.notebook-box {
  background: var(--bg-paper);
  border: 2px dashed var(--border-tan);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--ink-brown);
}

/* ---------- RULED NOTEBOOK TABLE ---------- */
.table-wrap {
  overflow-x: auto;
  background: #FFFFFF;
  border: 2px solid var(--border-tan);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  margin-top: 8px;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink-brown);
}

th {
  background: var(--sun-header);
  color: var(--ink-brown);
  font-family: 'Baloo 2', cursive;
  font-size: 14.5px;
  font-weight: 800;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid #F5B041;
  white-space: nowrap;
}

td {
  padding: 9px 12px;
  border-bottom: 1.5px dashed var(--border-dashed);
  font-size: 14px;
  color: var(--ink-brown);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #FFFDF2;
}

/* ---------- EMPTY STATE WITH SPROUT ---------- */
.empty-sprout {
  text-align: center;
  padding: 22px 16px;
  background: var(--bg-paper);
  border: 2px dashed var(--border-tan);
  border-radius: 16px;
  color: var(--ink-brown);
  margin: 8px 0;
}
.empty-sprout .sprout-icon {
  font-size: 34px;
  display: block;
  margin-bottom: 4px;
}

/* ---------- FORMS & PILL BUTTONS ---------- */
label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-brown);
}

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  padding: 8px 12px;
  border: 2px solid var(--border-tan);
  border-radius: 12px;
  background: #FFFDF9;
  color: var(--ink-brown);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  min-width: 110px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  max-width: 22px;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--navy-950, #0B2545);
  cursor: pointer;
  vertical-align: middle;
}

label > input:not([type="checkbox"]):not([type="radio"]),
label > select,
label > textarea {
  width: 100%;
}

.row > label {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green-leaf);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.14);
}

button, .btn, .btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border: 2px solid #1B5E20;
  border-radius: 999px;
  background: var(--green-leaf);
  color: #FFFFFF;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 3px 0 #1B5E20;
  transition: transform 0.12s ease, filter 0.12s ease;
  text-decoration: none;
  white-space: nowrap;
}

button:hover, .btn:hover, .btn-pill:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  text-decoration: none;
}

button:active, .btn:active, .btn-pill:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #1B5E20;
}

button.secondary, .btn.secondary, .btn-pill.secondary {
  background: #FFF8E1;
  color: var(--ink-brown);
  border: 2px solid var(--border-tan);
  box-shadow: 0 3px 0 var(--border-tan);
}

button.warn, button.gold, .btn.warn, .btn-pill.gold {
  background: var(--sun-gold);
  color: var(--ink-brown);
  border-color: #E65100;
  box-shadow: 0 3px 0 #E65100;
}

button.danger, .btn.danger, .btn-pill.danger {
  background: var(--danger-soft);
  color: var(--danger-red);
  border-color: #EF9A9A;
  box-shadow: 0 3px 0 #EF9A9A;
}

button.sm, .btn.sm {
  padding: 4px 10px;
  font-size: 12.5px;
}

/* ---------- STICKER BADGES & PILLS ---------- */
.badge, .sticker-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--green-soft);
  color: var(--green-deep);
  border: 1.5px solid #A5D6A7;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12.5px;
  font-weight: 800;
}

.badge.warn, .badge.gold {
  background: var(--sun-soft);
  color: var(--ink-brown);
  border-color: #FFB300;
}

.badge.danger {
  background: var(--danger-soft);
  color: var(--danger-red);
  border-color: #EF9A9A;
}

.muted {
  color: var(--ink-muted);
  font-size: 13.5px;
}

/* ---------- TABS ---------- */
.tabs, .tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-btn {
  background: #FFFFFF;
  color: var(--ink-brown);
  border: 2px solid var(--border-tan);
  box-shadow: 0 3px 0 var(--border-tan);
  padding: 8px 15px;
  border-radius: 999px;
  font-weight: 800;
}

.tab-btn.active {
  background: var(--sun-header);
  color: var(--ink-brown);
  border-color: #F57F17;
  box-shadow: 0 3px 0 #F57F17;
}

/* ---------- GARDEN MODULE SPECIFIC STYLES ---------- */
.garden-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.garden-plot, .garden-plot-card {
  position: relative;
  background: linear-gradient(180deg, #E1F5FE 0%, #FFFDF5 58%, #E8F5E9 100%);
  border: 3px solid #A5D6A7;
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--shadow-sticker);
  color: var(--ink-brown);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.garden-plot:hover, .garden-plot-card:hover {
  transform: translateY(-3px);
}

.garden-plot.selected {
  border-color: #2E7D32;
  box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.2), var(--shadow-sticker);
}

.garden-plot.locked, .garden-plot-card.locked {
  border-color: #FFB74D;
  background: linear-gradient(180deg, #FFF8E1 0%, #FFFDF5 60%, #FFECB3 100%);
}

.tree-avatar, .tree-stage-avatar {
  width: 82px;
  height: 82px;
  margin: 8px auto;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px dashed #81C784;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.12);
  animation: floatTree 3s ease-in-out infinite;
}

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

.xp-bar-wrap, .xp-bar-track {
  width: 100%;
  height: 13px;
  background: #EFEBE9;
  border: 2px solid var(--border-tan);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #66BB6A, #FFB300);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.stat-pill {
  background: var(--bg-paper);
  border: 2px solid var(--border-tan);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-pill b {
  font-family: 'Baloo 2', cursive;
  font-size: 21px;
  color: var(--green-deep);
  line-height: 1.1;
}

.pest-pill {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #FFF8E1;
  border: 2px dashed #FFA000;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 8px;
}

.honor-podium {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
  margin-top: 10px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.podium-card {
  background: #FFF8E1;
  border: 3px solid #FFB300;
  border-radius: 20px;
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-sticker);
}

.podium-card h4 {
  margin: 6px 0 4px;
  font-size: 17px;
  color: var(--ink-brown);
}

/* ---------- SEATING CHART GRID ---------- */
.seating-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(115px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.seat-cell, .seat-desk {
  background: var(--bg-paper);
  border: 2px dashed var(--border-tan);
  border-radius: 14px;
  padding: 10px;
  min-height: 82px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.seat-cell.occupied {
  background: #FFFFFF;
  border: 2px solid #81C784;
  box-shadow: 0 3px 0 #A5D6A7;
}

/* ---------- MODAL & TOAST ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(62, 39, 35, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 110;
  padding: 16px;
}

.modal-box {
  position: relative;
  background: #FFFFFF;
  color: var(--ink-brown);
  border: 3px solid var(--border-tan);
  border-radius: 22px;
  padding: 22px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 14px 40px rgba(62, 39, 35, 0.25);
}

#toast-root, .toast-container {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast, .toast-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  color: var(--ink-brown);
  border: 3px solid var(--green-leaf);
  border-radius: 16px;
  padding: 11px 15px;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(62, 39, 35, 0.16);
  animation: slideInToast 0.2s ease;
  transition: opacity 0.25s ease;
}

.toast.toast-error, .toast-item.error {
  border-color: var(--danger-red);
  background: #FFF8F8;
}

.toast.toast-warn {
  border-color: var(--sun-gold);
  background: #FFFDF2;
}

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

/* ---------- LOGIN MASCOT SCREEN & PUBLIC PAGE ---------- */
.login-wrap, .login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  max-width: 520px;
  width: 100%;
  padding: 28px 26px;
}

.mascot-hero {
  width: 84px;
  height: 84px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--sun-soft);
  border: 3px dashed var(--sun-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.public-page-wrap {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 16px;
}

/* ============================================================================
   HIỆU ỨNG MỜ ĐI & KHÓA BẤM KHI TẮT NHÓM HOẶC MỤC MENU TRÁI Ở SETTINGS
   ============================================================================ */
.nav-group.menu-group-off,
.menu-group.menu-group-off {
  opacity: 0.42;
  filter: grayscale(0.85);
  border-radius: 10px;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.nav-group.menu-group-off button.nav-title {
  background: #EFEBE9;
  border-style: dashed;
  border-color: #BCAAA4;
  color: #795548;
}

.sidebar a.nav-link.menu-item-off,
.menu-item.menu-item-off,
.mob-nav-item.menu-item-off {
  opacity: 0.42;
  filter: grayscale(0.85);
  text-decoration: line-through;
  background: #F5F0EB !important;
  border-style: dashed !important;
  border-color: #BCAAA4 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.off-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #795548;
  background: rgba(121, 85, 72, 0.16);
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 4px;
  text-decoration: none !important;
}

/* ============================================================================
   KHO QUÀ TẶNG: Ô UPLOAD ẢNH (+ ẢNH AUTO .WEBP) & THUMBNAIL QUÀ TẶNG
   ============================================================================ */
.reward-img-picker {
  width: 100%;
  margin: 4px 0;
}

.reward-img-picker-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.reward-upload-box {
  width: 96px !important;
  height: 96px !important;
  padding: 0 !important;
  border-radius: 14px !important;
  border: 2px dashed #42A5F5 !important;
  background: #F8FBFF !important;
  color: #1E88E5 !important;
  box-shadow: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.12s ease;
}

.reward-upload-box:hover {
  border-color: #1565C0 !important;
  background: #E3F2FD !important;
  transform: translateY(-1px);
}

.reward-upload-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reward-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reward-upload-preview .plus-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #1E88E5;
  line-height: 1.25;
}

.reward-upload-preview .plus-text small {
  font-size: 10.5px;
  color: #64B5F6;
  font-weight: 700;
}

.reward-img-inputs {
  flex: 1;
  min-width: 220px;
}

.reward-thumb-img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid #E5D2B2;
  background: #FFFDF7;
  display: block;
}

.reward-thumb-emoji {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 2px dashed #E5D2B2;
  background: #FFF9E6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.settings-group-box {
  border: 2px solid var(--border-tan);
  border-radius: 14px;
  padding: 12px 14px;
  background: #FFFDF7;
  margin-bottom: 12px;
  transition: all 0.18s ease;
}

.settings-group-box.is-off {
  opacity: 0.58;
  filter: grayscale(0.5);
  border-style: dashed;
  background: #F5F0E6;
}

.settings-item-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border-tan);
  background: #FFFFFF;
  font-size: 13.5px;
  font-weight: 700;
}

.settings-item-pill.is-off {
  opacity: 0.52;
  background: #EFEBE9;
  border-style: dashed;
}

/* ============================================================================
   SÂN KHẤU BỐC THĂM NGẪU NHIÊN KỊCH TÍNH GIỮA MÀN HÌNH & Ô NHẬP SỐ LƯỢNG HS
   ============================================================================ */
.random-pick-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFF8E1;
  border: 2px solid #FFB300;
  border-radius: 999px;
  padding: 4px 6px 4px 12px;
  box-shadow: 0 3px 0 #F57F17;
}

.random-count-label {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-brown);
  margin: 0 !important;
  white-space: nowrap;
}

.random-count-input {
  width: 64px !important;
  min-width: 58px !important;
  height: 34px;
  padding: 4px 8px !important;
  text-align: center;
  font-family: 'Baloo 2', cursive;
  font-size: 17px !important;
  font-weight: 800;
  color: #E65100 !important;
  background: #FFFFFF !important;
  border: 2px solid #FFB300 !important;
  border-radius: 10px !important;
}

.random-trigger-btn {
  margin: 0 !important;
  padding: 7px 15px !important;
  font-size: 14.5px !important;
}

.lucky-stage-backdrop {
  background: radial-gradient(circle at center, rgba(255, 179, 0, 0.28) 0%, rgba(42, 24, 16, 0.82) 72%);
  backdrop-filter: blur(5px);
  z-index: 150;
}

.lucky-stage-modal {
  position: relative;
  width: min(820px, 95vw);
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, #FFFDF5 0%, #FFF8E1 52%, #FFF3CD 100%);
  border: 4px solid #FFB300;
  border-radius: 28px;
  padding: 24px 26px;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.45), 0 0 0 6px rgba(255, 193, 7, 0.28);
  text-align: center;
  animation: luckyStagePop 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes luckyStagePop {
  0% { transform: scale(0.76) translateY(24px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.lucky-confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.lucky-confetti-piece {
  position: absolute;
  top: -18px;
  width: 11px;
  height: 18px;
  border-radius: 3px;
  opacity: 0.92;
  animation-name: luckyConfettiFall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}

@keyframes luckyConfettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(580px) rotate(680deg); opacity: 0; }
}

.lucky-stage-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.lucky-stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, #FFB300, #F57F17);
  color: #FFFFFF;
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  box-shadow: 0 3px 0 #E65100;
}

.lucky-stage-body {
  position: relative;
  z-index: 2;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
}

.lucky-rolling-box {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
}

.lucky-dice-orbit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 46px;
  margin-bottom: 8px;
}

.lucky-dice-spin {
  display: inline-block;
  animation: diceSpinBounce 0.48s infinite alternate ease-in-out;
}

.lucky-dice-spin.delay {
  animation-delay: 0.22s;
}

.lucky-bee-fly,
.lucky-cat-fly {
  display: inline-block;
  width: 68px;
  height: 68px;
  object-fit: contain;
  font-size: 54px;
  filter: drop-shadow(0 4px 10px rgba(245, 127, 23, 0.35));
  animation: beeZoomPulse 0.42s infinite alternate ease-in-out;
}

.cat-mascot-inline {
  display: inline-block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  margin-top: -2px;
}

.brand-mascot-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 2px 4px rgba(245, 127, 23, 0.28));
}

.login-mascot-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(245, 127, 23, 0.32));
  animation: beeZoomPulse 1.4s infinite alternate ease-in-out;
}

.lucky-winner-cat-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(245, 127, 23, 0.28));
}

.lucky-hero-cat-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

@keyframes diceSpinBounce {
  0% { transform: translateY(0) rotate(-18deg) scale(0.95); }
  100% { transform: translateY(-10px) rotate(22deg) scale(1.12); }
}

@keyframes beeZoomPulse {
  0% { transform: scale(0.94) translateY(2px); }
  100% { transform: scale(1.16) translateY(-6px); }
}

.lucky-rolling-subtitle {
  font-size: 15px;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.lucky-slot-window {
  background: #FFFFFF;
  border: 3.5px solid #FFB300;
  border-radius: 22px;
  padding: 22px 18px;
  box-shadow: inset 0 4px 14px rgba(255, 179, 0, 0.18), 0 6px 0 #F57F17;
  margin-bottom: 16px;
}

.lucky-slot-name {
  font-family: 'Baloo 2', cursive;
  font-size: 30px;
  font-weight: 800;
  color: var(--ink-brown);
  line-height: 1.2;
}

.lucky-slot-team {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--green-deep);
  margin-top: 6px;
}

.lucky-progress-track {
  width: 100%;
  height: 14px;
  background: #EFEBE9;
  border: 2px solid #D7CCC8;
  border-radius: 999px;
  overflow: hidden;
}

.lucky-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #43A047, #FFB300, #FF7043);
  border-radius: 999px;
  transition: width 0.08s linear;
}

.lucky-reveal-wrap {
  width: 100%;
  animation: winnerRevealZoom 0.38s cubic-bezier(0.18, 1.25, 0.4, 1);
}

@keyframes winnerRevealZoom {
  0% { transform: scale(0.72); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.lucky-crown-banner {
  display: inline-block;
  background: #E8F5E9;
  color: #1B5E20;
  border: 2.5px solid #43A047;
  border-radius: 999px;
  padding: 6px 20px;
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
  box-shadow: 0 3px 0 #81C784;
}

.lucky-winner-hero {
  max-width: 520px;
  margin: 0 auto;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFDE7 100%);
  border: 4px solid #FFB300;
  border-radius: 26px;
  padding: 26px 22px;
  box-shadow: 0 10px 0 #F57F17, 0 16px 38px rgba(245, 127, 23, 0.24);
}

.lucky-hero-avatar {
  width: 88px;
  height: 88px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #FFF8E1;
  border: 3.5px dashed #FFB300;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  animation: beeZoomPulse 0.8s infinite alternate ease-in-out;
}

.lucky-hero-name {
  font-family: 'Baloo 2', cursive;
  font-size: 36px;
  font-weight: 800;
  color: #BF360C;
  line-height: 1.15;
  margin-bottom: 6px;
}

.lucky-hero-nick {
  font-size: 16px;
  color: var(--ink-brown);
  margin-bottom: 12px;
}

.lucky-hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.lucky-winner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  width: 100%;
  max-height: 54vh;
  overflow-y: auto;
  padding: 6px;
}

.lucky-winner-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.lucky-winner-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 680px) {
  .lucky-winner-grid.cols-2,
  .lucky-winner-grid.cols-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.lucky-role-tag {
  margin-top: 8px;
  background: #E8F5E9;
  color: #1B5E20;
  border: 1.5px solid #81C784;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 800;
}

.lucky-winner-card {
  position: relative;
  background: #FFFFFF;
  border: 3px solid #FFB300;
  border-radius: 20px;
  padding: 16px 14px;
  box-shadow: 0 5px 0 #F57F17;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: winnerRevealZoom 0.36s cubic-bezier(0.18, 1.25, 0.4, 1) backwards;
}

.lucky-winner-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #FFB300;
  color: var(--ink-brown);
  font-family: 'Baloo 2', cursive;
  font-size: 13px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
}

.lucky-winner-avatar {
  font-size: 34px;
  margin-bottom: 4px;
}

.lucky-winner-name {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 800;
  color: #BF360C;
  line-height: 1.2;
}

.lucky-winner-meta {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green-deep);
  margin-top: 3px;
}

.lucky-stage-footer {
  position: relative;
  z-index: 2;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 2px dashed #E5D2B2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

/* ============================================================================
   SMARTPHONE & TABLET (< 960px): MENU ẨN THÔNG MINH (OFF-CANVAS DRAWER)
   + THANH ĐIỀU HƯỚNG ĐÁY 5 NÚT (BOTTOM BAR) TIỆN LỢI KHI CẦM ĐIỆN THOẠI
   ============================================================================ */
@media (max-width: 960px) {
  .mobile-only {
    display: inline-flex !important;
  }

  .hide-sm {
    display: none !important;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(62, 39, 35, 0.45);
    backdrop-filter: blur(2px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .layout.mobile-drawer-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 284px;
    max-width: 84vw;
    height: 100dvh;
    z-index: 100;
    transform: translateX(-105%);
    box-shadow: 8px 0 28px rgba(62, 39, 35, 0.25);
  }

  .layout.mobile-drawer-open .sidebar {
    transform: translateX(0);
  }

  .main {
    padding: 12px 12px 86px;
  }

  .topbar {
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 14px;
  }

  .topbar strong {
    font-size: 17.5px;
  }

  .grid2 {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .seating-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #toast-root {
    bottom: 74px;
    right: 12px;
    left: 12px;
    max-width: none;
  }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 62px;
    height: auto;
    background: #FFFFFF;
    border-top: 1px solid #E2E8F0;
    box-shadow: 0 -4px 18px rgba(11, 37, 69, 0.08);
    z-index: 85;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
  }

  .mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #475569 !important;
    padding: 5px 2px !important;
    border-radius: 10px !important;
    font-weight: 700;
    text-decoration: none;
  }

  .mob-nav-item span {
    font-size: 18px;
    line-height: 1;
  }

  .mob-nav-item small {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .mob-nav-item.active {
    background: #0B2545 !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 8px rgba(11, 37, 69, 0.22) !important;
  }

  .mob-nav-item.active span,
  .mob-nav-item.active small {
    color: #FFFFFF !important;
  }
}

@media (max-width: 480px) {
  .hide-xs {
    display: none !important;
  }
  .row > input:not([type="checkbox"]):not([type="radio"]),
  .row > select,
  .row > label {
    flex: 1 1 100%;
  }
}

/* ============================================================================
   KHU VƯỜN 3D CATCLASS (3D ISOMETRIC VALLEY STAGE & FLOATING ISLANDS)
   ============================================================================ */
@keyframes garden3dFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-7px); }
}

@keyframes garden3dWormWiggle {
  0%, 100% { transform: translateX(0px) rotate(-6deg) scale(1); }
  50% { transform: translateX(5px) rotate(8deg) scale(1.06); }
}

@keyframes garden3dCanPour {
  0% { opacity: 0; transform: translate(36px, -34px) rotate(18deg) scale(0.6); }
  35% { opacity: 1; transform: translate(8px, -12px) rotate(-22deg) scale(1.05); }
  75% { opacity: 1; transform: translate(4px, -8px) rotate(-28deg) scale(1); }
  100% { opacity: 0; transform: translate(0px, -22px) rotate(-10deg) scale(0.8); }
}

@keyframes garden3dXpFloat {
  0% { opacity: 0; transform: translateY(10px) scale(0.8); }
  30% { opacity: 1; transform: translateY(-6px) scale(1.08); }
  100% { opacity: 0; transform: translateY(-34px) scale(0.95); }
}

.garden3d-world {
  position: relative;
  border-radius: 24px;
  padding: 18px;
  margin-bottom: 18px;
  background-image:
    linear-gradient(180deg, rgba(6, 40, 61, 0.28) 0%, rgba(15, 118, 110, 0.08) 45%, rgba(6, 78, 59, 0.48) 100%),
    url('/assets/garden3d/valley-bg-3d.webp');
  background-size: cover;
  background-position: center bottom;
  border: 3px solid #34d399;
  box-shadow: 0 18px 42px rgba(6, 78, 59, 0.26), inset 0 2px 0 rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.garden3d-world.cinema-fullscreen {
  position: fixed;
  inset: 12px;
  z-index: 999;
  margin: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.78);
}

.garden3d-sky-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  padding: 12px 16px;
  color: #ffffff;
  margin-bottom: 18px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.garden3d-hud-mascot {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.garden3d-hud-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.4px;
  color: #fef08a;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.garden3d-hud-sub {
  font-size: 12.5px;
  color: #e2e8f0;
  opacity: 0.92;
}

.garden3d-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.14);
  padding: 4px 10px;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.garden3d-filter-pill select {
  background: #ffffff;
  color: #1e293b;
  border-radius: 8px;
  padding: 4px 8px;
  font-weight: 700;
  border: none;
}

.garden3d-islands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 20px;
  padding: 6px 2px 14px;
}

.garden3d-island-card {
  position: relative;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(10px);
  border: 2.5px solid rgba(255, 255, 255, 0.85) !important;
  border-radius: 22px !important;
  padding: 14px 15px !important;
  box-shadow: 0 14px 30px rgba(6, 40, 30, 0.24), 0 4px 0 rgba(16, 185, 129, 0.35) !important;
  animation: none !important;
  transform: none !important;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.garden3d-island-card:hover {
  transform: none !important;
  box-shadow: 0 18px 34px rgba(6, 40, 30, 0.3), 0 0 0 3px #fde047 !important;
}

.garden3d-island-card.selected {
  border-color: #10b981 !important;
  box-shadow: 0 18px 36px rgba(16, 185, 129, 0.34), 0 0 0 4px #34d399 !important;
}

.garden3d-island-card.top-leader {
  background: linear-gradient(180deg, rgba(254, 249, 195, 0.92) 0%, rgba(255, 255, 255, 0.9) 100%) !important;
  border-color: #facc15 !important;
  box-shadow: 0 18px 36px rgba(234, 179, 8, 0.35), 0 0 0 3px #fde047 !important;
}

.garden3d-island-card.locked {
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.92) 0%, rgba(255, 251, 235, 0.9) 100%) !important;
  border-color: #f87171 !important;
}

.garden3d-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.garden3d-team-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.garden3d-team-title strong {
  font-size: 15px;
  color: #14532d;
  display: block;
}

.garden3d-sub {
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}

.garden3d-badge {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.garden3d-badge.healthy {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.garden3d-badge.locked {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.garden3d-crown-pill {
  background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
  color: #422006;
  font-weight: 900;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.4);
}

.garden3d-stage-box {
  position: relative;
  height: 205px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 6px;
}

.garden3d-sun-glow {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253, 224, 71, 0.42) 0%, rgba(74, 222, 128, 0.12) 55%, transparent 72%);
  pointer-events: none;
}

.garden3d-island-img {
  width: 196px;
  height: 196px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 14px 16px rgba(15, 23, 42, 0.28));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.garden3d-island-card:hover .garden3d-island-img {
  transform: none;
}

.garden3d-island-img.is-locked-img {
  filter: saturate(0.78) contrast(0.95) drop-shadow(0 12px 14px rgba(127, 29, 29, 0.28));
}

.garden3d-guardian-cat {
  position: absolute;
  bottom: 8px;
  left: 10px;
  width: 52px;
  height: 52px;
  object-fit: contain;
  z-index: 4;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.32));
}

.garden3d-storm-cloud {
  position: absolute;
  top: 2px;
  right: 18px;
  font-size: 28px;
  z-index: 4;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
}

.garden3d-pest-overlay {
  position: absolute;
  bottom: 6px;
  right: 6px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(220, 38, 38, 0.94);
  color: #ffffff;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(185, 28, 28, 0.45);
  animation: garden3dWormWiggle 1.6s ease-in-out infinite;
}

.garden3d-worm-sprite {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.garden3d-xp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: #1e293b;
  margin-bottom: 5px;
}

.garden3d-xp-num {
  font-weight: 900;
  color: #15803d;
  font-family: monospace;
  font-size: 13px;
}

.garden3d-xp-bar {
  height: 11px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
  margin-bottom: 8px;
}

.garden3d-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #eab308 100%);
  border-radius: 999px;
  transition: width 0.45s ease;
}

.garden3d-xp-fill.locked-fill {
  background: linear-gradient(90deg, #f97316 0%, #ef4444 100%);
}

.garden3d-resource-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(241, 245, 249, 0.85);
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 10px;
}

.garden3d-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.garden3d-water-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%) !important;
  color: #ffffff !important;
  border-color: #0369a1 !important;
  padding: 7px 12px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  border-radius: 12px !important;
}

.garden3d-water-btn:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%) !important;
}

.garden3d-btn-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.garden3d-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
}

.garden3d-pour-anim {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.garden3d-pour-can {
  width: 112px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(2, 132, 199, 0.45));
  animation: garden3dCanPour 0.62s ease-out forwards;
}

.garden3d-xp-float {
  background: #0284c7;
  color: #ffffff;
  font-weight: 900;
  font-size: 15px;
  padding: 4px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.5);
  animation: garden3dXpFloat 0.62s ease-out forwards;
}

.garden3d-evolution-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  border-radius: 16px;
  padding: 10px 16px;
  color: #ffffff;
  margin-top: 6px;
}

.garden3d-evo-label {
  font-size: 12.5px;
  font-weight: 900;
  color: #fde047;
}

.garden3d-evo-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.garden3d-evo-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.13);
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  font-size: 12px;
}

.garden3d-evo-step img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.garden3d-evo-arrow {
  color: #86efac;
  font-weight: 900;
  font-size: 13px;
}

.garden3d-item-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 8px !important;
}

.garden3d-slot-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.16));
}

/* ==========================================================================
   CHIBI CLASS OVERVIEW GRID & STUDENT DETAIL HEXAGON STAGE (CatClass 50 Chibi)
   ========================================================================== */

.chibi-overview-board {
  background: linear-gradient(180deg, #F4EFE6 0%, #EFE9DE 100%) !important;
  border: 2.5px solid #D7CCC8 !important;
  border-radius: 26px !important;
  padding: 20px 22px 26px !important;
  margin-bottom: 18px;
}

.chibi-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.chibi-group-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chibi-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 18px;
}

.chibi-student-card {
  position: relative;
  background: #FFFFFF;
  border-radius: 22px;
  padding: 14px 12px 14px;
  text-align: center;
  cursor: pointer;
  border: 2px solid rgba(215, 204, 200, 0.55);
  box-shadow: 0 8px 20px rgba(62, 39, 35, 0.06);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.chibi-student-card:hover {
  transform: translateY(-6px);
  border-color: #BD3A28;
  box-shadow: 0 14px 28px rgba(189, 58, 40, 0.15);
}

.chibi-hover-mascot {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%) scale(0.6);
  width: 38px;
  height: 38px;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
}

.chibi-student-card:hover .chibi-hover-mascot {
  opacity: 1;
  transform: translateX(-50%) scale(1) rotate(-6deg);
}

.chibi-card-name {
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 800;
  color: #1F2937;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chibi-card-fullname {
  font-size: 11px;
  color: #6B7280;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chibi-avatar-stage {
  position: relative;
  width: 142px;
  height: 162px;
  margin: 4px auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chibi-shield-frame {
  position: relative;
  width: 126px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border-radius: 32px 32px 46px 46px;
  border-top: 2px dashed #BD3A28;
  border-left: 2px solid #FBC02D;
  border-right: 2px solid #FBC02D;
  border-bottom: 3px solid #FBC02D;
  overflow: hidden;
}

.chibi-dashed-halo {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px dashed transparent;
  pointer-events: none;
  transition: border-color 0.2s ease, transform 0.3s ease;
}

.chibi-student-card:hover .chibi-dashed-halo {
  border-color: #BD3A28;
}

.chibi-character-img {
  width: 116px;
  height: 140px;
  object-fit: contain;
  transition: transform 0.22s ease;
}

.chibi-student-card:hover .chibi-character-img {
  transform: scale(1.06);
}

.chibi-score-bubble {
  position: absolute;
  top: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', cursive;
  font-size: 15.5px;
  font-weight: 800;
  color: #FFFFFF;
  z-index: 4;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  border: 2px solid #FFFFFF;
}

.chibi-score-bubble.pos {
  left: -2px;
  background: #BD3A28;
}

.chibi-score-bubble.neg {
  right: -2px;
  background: #2B234A;
}

.chibi-score-bubble.lg {
  width: 48px;
  height: 48px;
  font-size: 20px;
  top: 12px;
}

.chibi-score-bubble.pop {
  animation: scoreBubblePop 0.36s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scoreBubblePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.38); }
  100% { transform: scale(1); }
}

.chibi-card-group {
  font-size: 11.5px;
  font-weight: 700;
  color: #4E342E;
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: 999px;
  padding: 2px 8px;
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   MODAL CHI TIẾT 1 HỌC SINH & BẢNG CHẤM ĐIỂM LỤC GIÁC (Ảnh 2)
   ========================================================================== */

.chibi-detail-backdrop {
  background: rgba(30, 27, 46, 0.56) !important;
  backdrop-filter: blur(4px);
  padding: 18px;
}

.chibi-detail-modal {
  width: min(1020px, 96vw);
  min-height: 540px;
  max-height: 92vh;
  background: #F4EFE6;
  border-radius: 28px;
  padding: 22px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  border: 3px solid #FFFFFF;
  overflow: hidden;
  animation: winnerRevealZoom 0.22s ease-out;
}

@media (max-width: 820px) {
  .chibi-detail-modal {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
  }
}

.chibi-detail-left-card {
  background: #FFFFFF;
  border-radius: 24px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(62, 39, 35, 0.08);
}

.chibi-detail-stu-name {
  font-family: 'Baloo 2', cursive;
  font-size: 24px;
  font-weight: 800;
  color: #1F2937;
  text-align: center;
  line-height: 1.2;
}

.chibi-detail-stu-meta {
  font-size: 12.5px;
  font-weight: 700;
  color: #4B5563;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
}

.chibi-detail-fullname {
  font-size: 13px;
  font-weight: 800;
  color: #374151;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  word-break: break-word;
}

.chibi-detail-meta-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.chibi-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.chibi-meta-pill.team {
  background: #ECFDF5;
  color: #166534;
  border: 1px solid #A7F3D0;
}

.chibi-meta-pill.pts {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.chibi-detail-hero-wrap {
  position: relative;
  width: 230px;
  height: 280px;
  margin: 12px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chibi-detail-hero-wrap.celebrate .chibi-detail-hero-img {
  animation: chibiJumpCelebrate 0.45s ease;
}

@keyframes chibiJumpCelebrate {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-14px) scale(1.06); }
}

.chibi-detail-character-box {
  width: 196px;
  height: 256px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border-radius: 36px;
  border-top: 2.5px dashed #2B234A;
  border-bottom: 3px solid #FBC02D;
}

.chibi-detail-hero-img {
  width: 184px;
  height: 240px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.12));
}

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

.chibi-back-list-btn {
  width: 86%;
  padding: 11px 18px !important;
  border-radius: 999px !important;
  background: #FFFFFF !important;
  color: #BD3A28 !important;
  border: 2px solid #BD3A28 !important;
  font-weight: 800 !important;
  font-size: 15px !important;
  box-shadow: none !important;
  transition: background 0.15s ease, color 0.15s ease;
}

.chibi-back-list-btn:hover {
  background: #BD3A28 !important;
  color: #FFFFFF !important;
}

.chibi-change-avatar-btn {
  width: 86%;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  background: #FFF8E1 !important;
  color: #5D4037 !important;
  border: 1.5px dashed #FFB300 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.chibi-detail-right-panel {
  display: flex;
  flex-direction: column;
  background: #EAE5DC;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(62, 39, 35, 0.08);
}

.chibi-detail-top-bar {
  background: linear-gradient(90deg, #1E40AF 0%, #2563EB 100%);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chibi-detail-pill-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
}

.chibi-pill-sep {
  color: rgba(255, 255, 255, 0.65);
  font-weight: 800;
}

.chibi-pill-tab {
  padding: 10px 24px !important;
  border-radius: 999px !important;
  font-family: 'Baloo 2', cursive !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  border: 2px solid transparent !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18) !important;
  opacity: 0.78;
  transition: transform 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.chibi-pill-tab.reward {
  background: #BD3A28 !important;
  color: #FFFFFF !important;
}

.chibi-pill-tab.penalty {
  background: #2B234A !important;
  color: #FFFFFF !important;
}

.chibi-pill-tab.avatar-tab {
  background: #F59E0B !important;
  color: #FFFFFF !important;
}

.chibi-pill-tab.active {
  opacity: 1;
  transform: scale(1.05);
  border-color: #FFFFFF !important;
}

.chibi-close-circle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50% !important;
  padding: 0 !important;
  background: rgba(255, 255, 255, 0.18) !important;
  color: #FFFFFF !important;
  border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chibi-detail-right-body {
  flex: 1;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  overflow-x: hidden;
}

.chibi-criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
  width: 100%;
  align-items: stretch;
}

.chibi-hex-criterion-btn {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1.5px solid #E5DEC9 !important;
  box-shadow: 0 4px 12px rgba(62, 39, 35, 0.05) !important;
  padding: 14px 10px 12px !important;
  border-radius: 18px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  white-space: normal !important;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.chibi-hex-criterion-btn.penalty {
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF7F7 100%) !important;
  border-color: #FECDD3 !important;
}

.chibi-hex-criterion-btn:hover {
  background: #FFFFFF !important;
  border-color: #F59E0B !important;
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.15) !important;
  transform: translateY(-3px);
}

.chibi-hex-criterion-btn.penalty:hover {
  border-color: #EF4444 !important;
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.16) !important;
}

.chibi-hex-criterion-btn.clicking {
  transform: scale(0.94);
}

.chibi-hex-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.chibi-hex-shape {
  width: 78px;
  height: 78px;
  background: #FFFDF7;
  border: 3px solid #EAB308;
  border-radius: 20px;
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(234, 179, 8, 0.2);
}

.chibi-hex-criterion-btn.penalty .chibi-hex-shape {
  background: #FFFDFB;
  border-color: #EF4444;
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.18);
}

.chibi-hex-emoji {
  transform: rotate(-45deg);
  font-size: 36px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chibi-hex-emoji svg {
  width: 44px;
  height: 44px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.chibi-hex-pts-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  font-weight: 800;
  color: #FFFFFF;
  border: 2px solid #FFFFFF;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.chibi-hex-pts-badge.pos {
  background: #BD3A28;
}

.chibi-hex-pts-badge.neg {
  background: #2B234A;
}

.chibi-hex-title {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #1F2937;
  text-align: center;
  line-height: 1.35;
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: break-word;
  width: 100%;
  max-width: 100%;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Công tắc Điểm Thưởng/Điểm Trừ đột xuất */
.chibi-adhoc-footer {
  border-top: 1.5px dashed #D1C7B7;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.chibi-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
  color: #374151;
  font-size: 14px;
}

.chibi-switch-label input {
  display: none;
}

.chibi-switch-slider {
  width: 44px;
  height: 24px;
  background: #9CA3AF;
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.chibi-switch-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform 0.2s ease;
}

.chibi-switch-label input:checked + .chibi-switch-slider {
  background: #BD3A28;
}

.chibi-switch-label input:checked + .chibi-switch-slider::after {
  transform: translateX(20px);
}

.chibi-adhoc-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: #FFFFFF;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1.5px solid #E5E7EB;
}

.chibi-adhoc-pts-input {
  width: 72px !important;
  text-align: center;
  font-weight: 800;
}

.chibi-adhoc-reason-input {
  flex: 1;
  min-width: 180px;
}

/* Nút Hoàn tác trong 10 giây (Góc trên phải giống Ảnh 2) */
.chibi-undo-toast-slot {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 2000;
}

.chibi-undo-pill {
  background: #FFFFFF;
  color: #1F2937;
  border: 2px solid #E5E7EB;
  border-radius: 16px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  animation: winnerRevealZoom 0.2s ease-out;
}

.chibi-undo-btn {
  background: #FEF2F2 !important;
  color: #BD3A28 !important;
  border: 1.5px solid #FECACA !important;
  border-radius: 999px !important;
  padding: 5px 12px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  box-shadow: none !important;
}

/* Kho 50 Avatar Chibi Picker */
.chibi-picker-field {
  background: #FFFDF9;
  border: 2px dashed #E6D2B5;
  border-radius: 18px;
  padding: 12px;
}

.chibi-picker-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.chibi-picker-preview-wrap {
  width: 72px;
  height: 86px;
  background: #FFFFFF;
  border: 2px solid #FBC02D;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.chibi-picker-preview-img {
  width: 66px;
  height: 80px;
  object-fit: contain;
}

.chibi-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
  padding: 6px;
  background: #FFFFFF;
  border-radius: 14px;
  border: 1px solid #EFEBE9;
}

.chibi-picker-grid.large {
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  max-height: 380px;
  gap: 10px;
}

.chibi-picker-item {
  background: #FFFFFF !important;
  border: 2px solid #E5E7EB !important;
  border-radius: 14px !important;
  padding: 6px 4px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: none !important;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.chibi-picker-item:hover {
  transform: translateY(-2px);
  border-color: #F59E0B !important;
}

.chibi-picker-item.selected {
  border-color: #BD3A28 !important;
  background: #FEF2F2 !important;
  box-shadow: 0 0 0 2px rgba(189, 58, 40, 0.2) !important;
}

.chibi-picker-item img {
  width: 54px;
  height: 66px;
  object-fit: contain;
}

.chibi-picker-item span {
  font-size: 11px;
  font-weight: 800;
  color: #4B5563;
}

.stu-table-chibi-wrap {
  width: 44px;
  height: 52px;
  background: #FFFFFF;
  border: 1.5px solid #FBC02D;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.stu-table-chibi-img {
  width: 40px;
  height: 48px;
  object-fit: contain;
}

.stu-table-chibi-img.sm {
  width: 32px;
  height: 38px;
  border: 1px solid #FBC02D;
  border-radius: 8px;
  background: #FFFFFF;
}

.stu-mini-avatar-preview {
  width: 50px;
  height: 58px;
  background: #FFFFFF;
  border: 2px dashed #BD3A28;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}

.stu-mini-avatar-preview img {
  width: 44px;
  height: 52px;
  object-fit: contain;
}

/* ==========================================================================
   PROPORTIONAL RESPONSIVE UI & TYPOGRAPHY SCALING SYSTEM (--ui-scale)
   Hỗ trợ người dùng mắt kém / trình chiếu máy chiếu (85% -> 135%)
   Cam kết: Phóng to chữ đồng bộ với khung giao diện, tự động co giãn (reflow),
   tuyệt đối không xô đẩy, không tràn ngang (horizontal overflow) hay vỡ khung.
   ========================================================================== */
:root {
  --ui-scale: 1;
}

/* 1. Đồng bộ cỡ chữ toàn hệ thống theo tỷ lệ --ui-scale */
body {
  font-size: calc(15px * var(--ui-scale, 1));
  overflow-x: hidden;
}

h1 {
  font-size: calc(25px * var(--ui-scale, 1));
}

h2 {
  font-size: calc(21px * var(--ui-scale, 1));
}

h3 {
  font-size: calc(19px * var(--ui-scale, 1));
}

h4 {
  font-size: calc(16.5px * var(--ui-scale, 1));
}

.topbar strong {
  font-size: calc(20px * var(--ui-scale, 1));
  line-height: 1.25;
}

.muted {
  font-size: calc(13px * var(--ui-scale, 1));
  line-height: 1.45;
}

label {
  font-size: calc(13.5px * var(--ui-scale, 1));
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea,
button,
.btn {
  font-size: calc(14px * var(--ui-scale, 1));
  padding: calc(8px * var(--ui-scale, 1)) calc(14px * var(--ui-scale, 1));
  max-width: 100%;
}

button.sm,
.btn.sm {
  font-size: calc(12.5px * var(--ui-scale, 1));
  padding: calc(5px * var(--ui-scale, 1)) calc(11px * var(--ui-scale, 1));
}

.badge {
  font-size: calc(12px * var(--ui-scale, 1));
  padding: calc(3px * var(--ui-scale, 1)) calc(10px * var(--ui-scale, 1));
}

th {
  font-size: calc(13px * var(--ui-scale, 1));
  padding: calc(11px * var(--ui-scale, 1)) calc(12px * var(--ui-scale, 1));
}

td {
  font-size: calc(14px * var(--ui-scale, 1));
  padding: calc(11px * var(--ui-scale, 1)) calc(12px * var(--ui-scale, 1));
}

.tab-btn {
  font-size: calc(14px * var(--ui-scale, 1));
  padding: calc(8px * var(--ui-scale, 1)) calc(16px * var(--ui-scale, 1));
}

.stat-pill {
  font-size: calc(14px * var(--ui-scale, 1));
}

/* 2. Menu trái (Sidebar) tự động nới rộng vừa phải & xuống dòng mượt mà */
.sidebar {
  width: calc(262px * clamp(0.92, var(--ui-scale, 1), 1.18));
}

.sidebar .brand-logo {
  font-size: calc(21px * var(--ui-scale, 1));
  flex-wrap: wrap;
}

.sidebar button.nav-title {
  font-size: calc(13px * var(--ui-scale, 1));
  padding: calc(8px * var(--ui-scale, 1)) calc(10px * var(--ui-scale, 1));
  white-space: normal;
  text-align: left;
  line-height: 1.32;
}

.sidebar a.nav-link {
  font-size: calc(14px * var(--ui-scale, 1));
  padding: calc(8px * var(--ui-scale, 1)) calc(11px * var(--ui-scale, 1));
  white-space: normal;
  line-height: 1.35;
  word-break: break-word;
}

/* 3. Khung nội dung chính, Card, Grid & Topbar tự động co giãn (Reflow chống vỡ khung) */
.main {
  min-width: 0;
  overflow-x: hidden;
}

.page-content {
  min-width: 0;
  max-width: 100%;
}

.topbar {
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-left {
  min-width: 0;
  flex: 1 1 260px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.card {
  padding: calc(18px * clamp(0.92, var(--ui-scale, 1), 1.18));
  max-width: 100%;
  overflow-x: visible;
}

.grid2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(320px * var(--ui-scale, 1))), 1fr));
  gap: calc(14px * clamp(0.92, var(--ui-scale, 1), 1.18));
}

.row {
  flex-wrap: wrap;
  max-width: 100%;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.settings-item-pill {
  font-size: calc(13.5px * var(--ui-scale, 1));
  padding: calc(7px * var(--ui-scale, 1)) calc(12px * var(--ui-scale, 1));
}

/* 4. Đồng bộ tỷ lệ Thẻ Học Sinh Chibi & Modal Chi tiết Học sinh */
.chibi-class-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(168px * var(--ui-scale, 1))), 1fr));
  gap: calc(18px * clamp(0.9, var(--ui-scale, 1), 1.15));
}

.chibi-student-card {
  padding: calc(14px * var(--ui-scale, 1)) calc(10px * var(--ui-scale, 1)) calc(12px * var(--ui-scale, 1)) !important;
}

.chibi-shield-frame {
  width: calc(118px * clamp(0.9, var(--ui-scale, 1), 1.2));
  height: calc(134px * clamp(0.9, var(--ui-scale, 1), 1.2));
}

.chibi-character-img {
  width: calc(108px * clamp(0.9, var(--ui-scale, 1), 1.2));
  height: calc(126px * clamp(0.9, var(--ui-scale, 1), 1.2));
}

.chibi-card-name {
  font-size: calc(16.5px * var(--ui-scale, 1));
}

.chibi-card-fullname {
  font-size: calc(12px * var(--ui-scale, 1));
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

.chibi-score-bubble {
  min-width: calc(34px * var(--ui-scale, 1));
  height: calc(34px * var(--ui-scale, 1));
  font-size: calc(15px * var(--ui-scale, 1));
}

.chibi-hex-title {
  font-size: calc(15px * var(--ui-scale, 1));
}

.chibi-detail-modal,
.modal-box {
  width: min(96vw, calc(860px * var(--ui-scale, 1)));
  max-width: 96vw;
  max-height: 92vh;
  overflow-y: auto;
}

/* 5. Giao diện Thanh kéo To - Nhỏ trong Settings & Cụm nút nhanh trên Topbar */
.topbar-scale-widget {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #FFFDF7;
  border: 1.5px solid #E6D2B5;
  border-radius: 999px;
  padding: 2px 4px;
  box-shadow: 0 2px 0 rgba(93, 64, 55, 0.08);
}

.topbar-scale-btn {
  padding: 4px 8px !important;
  font-weight: 800 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #5D4037 !important;
}

.topbar-scale-btn:hover {
  background: #FFF3C4 !important;
}

.topbar-scale-readout {
  padding: 4px 9px !important;
  font-weight: 800 !important;
  border: none !important;
  background: #FFF8E1 !important;
  color: #B45309 !important;
  box-shadow: none !important;
}

.ui-scale-settings-card {
  border: 2.5px solid #F59E0B !important;
  background: linear-gradient(180deg, #FFFDF5 0%, #FFFFFF 100%) !important;
}

.ui-scale-slider-panel {
  background: #FFF9E6;
  border: 2px dashed #FCD34D;
  border-radius: 18px;
  padding: 14px 16px;
  margin-top: 8px;
}

.ui-scale-slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.ui-scale-range-wrap {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ui-scale-ticks {
  display: flex;
  justify-content: space-between;
  font-size: calc(12px * var(--ui-scale, 1));
  font-weight: 800;
  color: #78350F;
  padding: 0 4px;
}

.ui-scale-range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #FDE68A 0%, #F59E0B 55%, #EA580C 100%);
  outline: none;
  padding: 0 !important;
  border: 2px solid #B45309 !important;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
}

.ui-scale-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 4px solid #D97706;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  cursor: grab;
  transition: transform 0.12s ease;
}

.ui-scale-range-input::-webkit-slider-thumb:hover,
.ui-scale-range-input::-webkit-slider-thumb:active {
  transform: scale(1.15);
  cursor: grabbing;
}

.ui-scale-range-input::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 4px solid #D97706;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  cursor: grab;
}

.ui-scale-preset-btn.active-scale-preset {
  background: #F59E0B !important;
  color: #0B2545 !important;
  border-color: #B45309 !important;
  box-shadow: 0 3px 0 #92400E !important;
}

.ui-bold-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1.5px solid #D97706;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 800;
  color: #78350F;
}

.ui-scale-preview-box {
  margin-top: 12px;
  background: #FFFFFF;
  border: 2px solid #E5E7EB;
  border-radius: 16px;
  padding: 12px 16px;
}

/* 6. Chế độ Tăng Độ Đậm & Tương Phản Chữ Cho Người Mắt Kém (.ui-bold-eye-care) */
body.ui-bold-eye-care {
  color: #0B2545;
  font-weight: 700;
  letter-spacing: 0.01em;
}

body.ui-bold-eye-care .muted {
  color: #334155 !important;
  font-weight: 700 !important;
}

body.ui-bold-eye-care td,
body.ui-bold-eye-care label,
body.ui-bold-eye-care input:not([type="checkbox"]):not([type="radio"]),
body.ui-bold-eye-care select,
body.ui-bold-eye-care textarea {
  font-weight: 700 !important;
  color: #0B2545;
}

body.ui-bold-eye-care th {
  font-weight: 800 !important;
  color: #FFFFFF !important;
}

body.ui-bold-eye-care .sidebar a.nav-link {
  font-weight: 700 !important;
  color: #F1F5F9 !important;
}

body.ui-bold-eye-care .sidebar a.nav-link:hover {
  color: #FFFFFF !important;
}

body.ui-bold-eye-care .sidebar a.nav-link.active {
  color: #0B2545 !important;
  font-weight: 800 !important;
}

body.ui-bold-eye-care .portal-hero-banner,
body.ui-bold-eye-care .portal-hero-banner h1,
body.ui-bold-eye-care .portal-hero-banner h2,
body.ui-bold-eye-care .portal-hero-banner p {
  color: #FFFFFF !important;
}

body.ui-bold-eye-care .portal-hero-banner .muted {
  color: #E2E8F0 !important;
}

body.ui-bold-eye-care .rs-class-pill.active,
body.ui-bold-eye-care .rs-class-pill.active .rs-class-pill-title,
body.ui-bold-eye-care .rs-class-pill.active .rs-class-pill-meta,
body.ui-bold-eye-care .tc-toggle-btn,
body.ui-bold-eye-care .mob-nav-item.active,
body.ui-bold-eye-care .mob-nav-item.active span,
body.ui-bold-eye-care .mob-nav-item.active small,
body.ui-bold-eye-care button.navy,
body.ui-bold-eye-care .btn.navy,
body.ui-bold-eye-care .rs-seg-btn.active,
body.ui-bold-eye-care .rp-role-pill.active,
body.ui-bold-eye-care .dub-subtitle-live {
  color: #FFFFFF !important;
  font-weight: 800 !important;
}

body.ui-bold-eye-care input:not([type="checkbox"]):not([type="radio"]),
body.ui-bold-eye-care select,
body.ui-bold-eye-care textarea {
  border-width: 2px !important;
  border-color: #475569 !important;
}

/* ==========================================================================
   7. QUẢN LÝ TỔ (TEAMS/GROUPS), CHIA TỔ & BAN CÁN SỰ LỚP (LỚP TRƯỞNG - TỔ TRƯỞNG)
   Tương thích 100% với biến thu phóng đồng bộ --ui-scale
   ========================================================================== */
.chibi-role-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-bottom: 3px;
}

.chibi-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: calc(11px * var(--ui-scale, 1));
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.25;
  white-space: nowrap;
}

.chibi-role-pill.sm {
  font-size: calc(10.5px * var(--ui-scale, 1));
  padding: 1px 7px;
}

.chibi-role-pill.monitor {
  background: linear-gradient(135deg, #FEF08A 0%, #F59E0B 100%);
  color: #78350F;
  border: 1.5px solid #B45309;
  box-shadow: 0 2px 4px rgba(180, 83, 9, 0.2);
}

.chibi-role-pill.leader {
  background: linear-gradient(135deg, #FFEDD5 0%, #FB923C 100%);
  color: #7C2D12;
  border: 1.5px solid #C2410C;
  box-shadow: 0 2px 4px rgba(194, 65, 12, 0.16);
}

.chibi-student-card.is-monitor-card {
  border-color: #F59E0B !important;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.22), 0 0 0 2px #FDE047 !important;
}

.chibi-student-card.is-leader-card {
  border-color: #FB923C !important;
}

.monitor-spotlight-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 2px solid #F59E0B;
  border-radius: 16px;
  padding: 12px 14px;
  margin-top: 10px;
}

.monitor-avatar-box {
  width: calc(48px * var(--ui-scale, 1));
  height: calc(54px * var(--ui-scale, 1));
  background: #FFFFFF;
  border: 2px solid #D97706;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.swap-students-box {
  margin-top: 12px;
  background: #FFFDF7;
  border: 1.5px dashed #D97706;
  border-radius: 14px;
  padding: 10px 12px;
}

.team-divide-box {
  background: #EFF6FF;
  border: 1.5px dashed #60A5FA;
  border-radius: 14px;
  padding: 12px;
}

.create-team-box {
  background: #F0FDF4;
  border: 1.5px dashed #4ADE80;
  border-radius: 14px;
  padding: 12px;
}

.unassigned-stu-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1.5px solid #FCA5A5;
  border-radius: 12px;
  padding: 6px 10px;
}

.class-teams-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(340px * var(--ui-scale, 1))), 1fr));
  gap: 16px;
}

.team-manage-card {
  background: #FFFDF9;
  border: 2px solid #E6D2B5;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 6px 16px rgba(93, 64, 55, 0.06);
}

.team-manage-card.over-capacity {
  border-color: #EF4444;
  background: #FFFBFB;
}

.team-manage-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.team-manage-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-manage-title strong {
  font-size: calc(17px * var(--ui-scale, 1));
  color: #3E2723;
}

.team-mascot-badge {
  font-size: calc(22px * var(--ui-scale, 1));
  line-height: 1;
}

.team-capacity-bar-track {
  width: 100%;
  height: 8px;
  background: #EFEBE9;
  border-radius: 999px;
  overflow: hidden;
}

.team-capacity-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #34D399 0%, #10B981 100%);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.team-capacity-bar-fill.over {
  background: linear-gradient(90deg, #F97316 0%, #EF4444 100%);
}

.team-leader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: #FFF8E1;
  border: 1.5px solid #FCD34D;
  border-radius: 12px;
  padding: 7px 10px;
  font-size: calc(13px * var(--ui-scale, 1));
}

.team-leader-select {
  width: auto !important;
  min-width: 145px;
  max-width: 100%;
  padding: 4px 8px !important;
  font-size: calc(12.5px * var(--ui-scale, 1)) !important;
  background: #FFFFFF !important;
}

.team-members-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 2px;
}

.team-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: #FFFFFF;
  border: 1.5px solid #EFEBE9;
  border-radius: 12px;
  padding: 7px 10px;
  transition: border-color 0.15s ease;
}

.team-member-row.is-monitor {
  background: #FFFBEB;
  border-color: #F59E0B;
}

.team-member-row.is-leader {
  background: #FFF7ED;
  border-color: #FB923C;
}

.team-member-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 170px;
  min-width: 0;
}

.team-member-idx {
  font-size: calc(11.5px * var(--ui-scale, 1));
  font-weight: 800;
  color: #8D6E63;
  min-width: 22px;
}

.team-member-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.role-icon-btn {
  padding: 4px 7px !important;
  line-height: 1 !important;
}

.move-team-select {
  width: auto !important;
  max-width: 155px;
  padding: 4px 8px !important;
  font-size: calc(12px * var(--ui-scale, 1)) !important;
}

/* ============================================================================
   6 NÂNG CẤP TRỌNG TÂM (BỐ CỤC KHOA HỌC, CÂN ĐỐI, KHÔNG VỠ KHUNG):
   1. Thẻ Học sinh Chibi vừa vặn + chỉ hiện tên ngắn
   2. Bảng Lớp học theo Tổ & Cộng/Trừ điểm Cả Tổ / Toàn Lớp
   3. Vườn cây 3D Tổ rộng rãi + Đa cây (Multi-Tree Grove) cân đối
   4. Chip Sâu/Cỏ/Rác tương tác trực tiếp + Modal Chuộc lỗi 1 chạm
   5. Mốc thưởng 20 điểm thi đua = 1 Vật phẩm tự chọn & 4 nút Chăm cây gọn đẹp
   ============================================================================ */

/* 1. THẺ HỌC SINH CHIBI CÂN ĐỐI & TÊN NGẮN RÕ RÀNG */
.chibi-class-grid,
.chibi-student-grid {
  grid-template-columns: repeat(auto-fill, minmax(calc(144px * var(--ui-scale, 1)), 1fr)) !important;
  gap: calc(12px * var(--ui-scale, 1)) !important;
}

.chibi-student-card {
  padding: 12px 10px 11px !important;
  border-radius: 18px !important;
}

.chibi-avatar-stage {
  height: calc(116px * var(--ui-scale, 1)) !important;
  margin: 2px 0 6px !important;
}

.chibi-shield-frame {
  width: calc(94px * var(--ui-scale, 1)) !important;
  height: calc(102px * var(--ui-scale, 1)) !important;
}

.chibi-character-img {
  width: calc(104px * var(--ui-scale, 1)) !important;
  height: calc(116px * var(--ui-scale, 1)) !important;
  object-fit: contain !important;
}

.chibi-card-name,
.chibi-card-name.short-name-only {
  font-size: calc(15px * var(--ui-scale, 1)) !important;
  font-weight: 800 !important;
  color: #2A160B !important;
  margin-top: 2px !important;
  margin-bottom: 2px !important;
  line-height: 1.25 !important;
}

.chibi-gender-filter.active {
  background: #F59E0B !important;
  color: #0B2545 !important;
  border-color: #D97706 !important;
}

/* 2. BẢNG LỚP HỌC THEO TỔ (TEAM-GROUPED CLASS BOARD) */
.class-teams-board-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.class-team-board-section {
  background: linear-gradient(180deg, #FFFDF8 0%, #FFF8EC 100%);
  border: 2px solid #F3D9A4;
  border-radius: 18px;
  padding: 14px 16px 16px;
  box-shadow: 0 6px 16px rgba(124, 45, 18, 0.05);
}

.class-team-board-section:hover {
  border-color: #F59E0B;
}

.class-team-board-section.unassigned,
.class-team-board-section.unassigned-section {
  background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
  border: 2px dashed #CBD5E1;
}

.class-team-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1.5px dashed rgba(217, 119, 6, 0.22);
}

.class-team-board-title,
.class-team-board-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.class-team-mascot {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border: 1.5px solid #F59E0B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* Modal Cộng/Trừ điểm hàng loạt */
.chibi-batch-avatar-pile {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 8px 0;
  max-height: 150px;
  overflow-y: auto;
}

.chibi-batch-mini-stu {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FFFBEB;
  border: 1.5px solid #FDE68A;
  padding: 3px 9px 3px 4px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  color: #78350F;
}

.chibi-batch-mini-stu img {
  width: 24px !important;
  height: 24px !important;
  object-fit: contain !important;
}

.chibi-batch-more-badge,
.chibi-batch-more-pill {
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: #FDE68A;
  color: #78350F;
}

/* 3. VƯỜN CÂY 3D CỦA MỖI TỔ & ĐA CÂY (MULTI-TREE GROVE CÂN ĐỐI, KHOA HỌC) */
.garden3d-islands-grid.large-islands-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)) !important;
  gap: 18px !important;
}

.garden3d-island-card.large-island {
  padding: 14px 16px 16px !important;
  border-radius: 22px !important;
}

.garden3d-stage-box.large-stage {
  min-height: 168px !important;
  padding: 10px 10px 14px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.garden3d-grove-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  z-index: 3;
  padding: 4px 6px 2px;
}

.garden3d-tree-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: transform 0.2s ease;
}

.garden3d-tree-unit:hover {
  transform: none;
}

.garden3d-grove-wrap .garden3d-island-img,
.garden3d-grove-wrap .garden3d-plant-img {
  width: 124px !important;
  height: 124px !important;
  object-fit: contain !important;
}

.garden3d-grove-wrap.trees-count-2 .garden3d-island-img {
  width: 106px !important;
  height: 106px !important;
}

.garden3d-grove-wrap.trees-count-3 .garden3d-island-img {
  width: 92px !important;
  height: 92px !important;
}

.garden3d-grove-wrap.trees-count-4 .garden3d-island-img,
.garden3d-grove-wrap.trees-count-5 .garden3d-island-img,
.garden3d-grove-wrap.trees-count-6 .garden3d-island-img {
  width: 78px !important;
  height: 78px !important;
}

.garden3d-tree-tag {
  margin-top: -6px;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid #86EFAC;
  color: #14532D;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.garden3d-more-trees-pill {
  font-size: 11px;
  font-weight: 800;
  background: #DCFCE7;
  color: #166534;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #86EFAC;
}

/* 4. CHIP SÂU / CỎ DẠI / RÁC TRỰC TIẾP TRÊN VƯỜN & MODAL CHUỘC LỖI */
.garden3d-pests-live-tray {
  width: 100%;
  margin-top: 8px;
  background: rgba(254, 242, 242, 0.96);
  border: 1.5px solid #FCA5A5;
  border-radius: 14px;
  padding: 8px 10px;
  z-index: 5;
}

.garden3d-pests-tray-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #991B1B;
  margin-bottom: 6px;
}

.garden3d-pests-chips-row,
.garden3d-pests-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.garden3d-pest-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: #FFFFFF !important;
  color: #7F1D1D !important;
  border: 1.5px solid #EF4444 !important;
  border-radius: 12px !important;
  padding: 5px 9px !important;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.14);
  max-width: 100%;
}

.garden3d-pest-chip:hover {
  background: #FEF2F2 !important;
  transform: translateY(-1px);
}

.garden3d-chip-worm-img,
.garden3d-pest-chip-img {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}

.garden3d-pest-chip-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.garden3d-pest-chip-top {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.pest-type-dot {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
}

.pest-stu-short {
  font-size: 12px;
  font-weight: 900;
  color: #7F1D1D;
}

.garden3d-pest-chip-reason {
  font-size: 11px;
  color: #991B1B;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
}

.garden3d-pest-chip-cta {
  font-size: 10.5px;
  font-weight: 800;
  color: #DC2626;
}

.pest-redemption-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
}

.pest-redemption-hero img {
  width: 48px !important;
  height: 48px !important;
  object-fit: contain !important;
  flex-shrink: 0;
}

.redemption-catalog-pick-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 2px;
}

.redemption-pick-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid #E2E8F0;
  background: #FFFFFF;
}

.redemption-pick-card:hover {
  border-color: #86EFAC;
  background: #F0FDF4;
}

.redemption-pick-card.selected {
  border-color: #16A34A;
  background: #DCFCE7;
}

.redemption-pick-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 200px;
}

.redemption-pick-icon {
  font-size: 20px;
  line-height: 1;
}

.redemption-pick-title {
  font-size: 13px;
  font-weight: 800;
  color: #14532D;
}

/* 5. MỐC THƯỞNG 20 ĐIỂM THI ĐUA = 1 VẬT PHẨM TỰ CHỌN & 4 NÚT CHĂM CÂY GỌN ĐẸP */
.garden3d-milestone-box {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1.5px solid #FCD34D;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.garden3d-milestone-box.has-reward {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border-color: #F59E0B;
}

.garden3d-milestone-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #78350F;
}

.garden3d-milestone-pill {
  font-size: 11px;
  font-weight: 800;
  background: #FFFFFF;
  color: #B45309;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #FCD34D;
}

.garden3d-milestone-sub {
  font-size: 11px;
  font-weight: 700;
  color: #92400E;
  margin-top: 2px;
}

.garden3d-milestone-bar,
.garden3d-milestone-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  overflow: hidden;
  border: 1px solid rgba(217, 119, 6, 0.25);
  margin-top: 4px;
}

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

.garden3d-claim-item-btn {
  width: 100%;
  border-radius: 10px !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  cursor: pointer;
}

.garden3d-claim-item-btn.pulse-reward {
  color: #FFFFFF !important;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
  border: none !important;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.3);
}

/* Thanh 4 nút vật phẩm chăm sóc trực tiếp trên Đảo (Gọn gàng 4 cột ngang, icon 30px) */
.garden3d-direct-care-bar {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1.5px dashed rgba(22, 163, 74, 0.22);
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

@media (max-width: 560px) {
  .garden3d-direct-care-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.garden3d-care-item-btn {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  padding: 6px 8px !important;
  border-radius: 12px !important;
  border: 1.5px solid #86EFAC !important;
  background: #F0FDF4 !important;
  color: #14532D !important;
  cursor: pointer;
  text-align: left !important;
  transition: transform 0.15s ease, background 0.15s ease;
  min-width: 0;
}

.garden3d-care-item-btn:hover {
  transform: translateY(-2px);
  background: #DCFCE7 !important;
  border-color: #16A34A !important;
}

.garden3d-care-item-btn img {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

.garden3d-care-item-btn div {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.garden3d-care-item-btn b {
  font-size: 11.5px !important;
  font-weight: 800 !important;
  color: #14532D !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.garden3d-care-item-btn small {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #15803D !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modal Chọn Vật Phẩm Mốc 20 Điểm */
.milestone-summary-banner {
  padding: 10px 14px;
  border-radius: 14px;
  background: #F0FDF4;
  border: 1.5px solid #86EFAC;
}

.milestone-summary-banner.ready {
  background: #FEF3C7;
  border-color: #F59E0B;
}

.milestone-items-pick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.milestone-item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 12px 10px;
  border-radius: 16px;
  border: 2px solid #E2E8F0;
  background: #FFFFFF;
  position: relative;
}

.milestone-item-card:hover {
  border-color: #FCD34D;
  background: #FFFBEB;
}

.milestone-item-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: #FEF3C7;
  color: #B45309;
}

.milestone-item-img,
.milestone-item-card-icon img {
  width: 52px !important;
  height: 52px !important;
  max-width: 52px !important;
  max-height: 52px !important;
  object-fit: contain !important;
  margin: 4px auto !important;
}

.milestone-item-name,
.milestone-item-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #431407;
}

.milestone-item-desc,
.milestone-item-card-desc {
  font-size: 11px;
  color: #78350F;
  line-height: 1.3;
}






