
:root {
  --primary-coral: #FF5E7E;
  --primary-yellow: #FFD13B;
  --primary-blue: #3AA8F7;
  --primary-green: #38D39F;
  --primary-purple: #9D65FF;
  --primary-orange: #FF9F1C;
  --bg-gradient: linear-gradient(135deg, #FFF5EB 0%, #E8F7FF 50%, #F5F0FF 100%);
  
  --card-bg: rgba(255, 255, 255, 0.95);
  --card-shadow: 0 12px 30px rgba(78, 93, 140, 0.12);
  --clay-shadow: 0 8px 0px rgba(0, 0, 0, 0.1), 0 14px 20px rgba(0, 0, 0, 0.08);
  
  --font-display: 'Quicksand', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Nunito', 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --text-dark: #2B2D42;
  --text-muted: #5A6270;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-weight: 600;
  background: var(--bg-gradient);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  letter-spacing: 0.01em;
}

/* Background floating decorative elements */
.bg-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 50px;
  filter: blur(1px);
  animation: floatCloud 25s linear infinite;
}

.cloud-1 { width: 140px; height: 45px; top: 12%; left: -150px; animation-duration: 32s; }
.cloud-2 { width: 180px; height: 55px; top: 38%; left: -200px; animation-duration: 28s; animation-delay: 5s; }
.cloud-3 { width: 120px; height: 40px; top: 75%; left: -140px; animation-duration: 36s; animation-delay: 12s; }

@keyframes floatCloud {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 300px)); }
}

/* Header & Top Bar */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 3px solid rgba(255, 214, 0, 0.3);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-logo:hover {
  transform: scale(1.04);
}

.logo-badge {
  font-size: 2.2rem;
  animation: wiggle 3s ease-in-out infinite;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  background: linear-gradient(45deg, #FF5E7E, #FF9F1C, #9D65FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}

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

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.star-pill {
  background: #FFF9E6;
  border: 2px solid #FFD13B;
  color: #D48806;
}

.rank-pill {
  background: #EBF8FF;
  border: 2px solid #3AA8F7;
  color: #0066CC;
}

.mobile-sound-toggle-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFF9E6;
  border: 2px solid #FFD13B;
  font-size: 1.15rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-sound-toggle-btn:active {
  transform: scale(0.9);
}

@media (max-width: 768px) {
  .mobile-sound-toggle-btn {
    display: flex;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  background: white;
  border: 2px solid #E2E8F0;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-btn:hover {
  background: #F8FAFC;
  transform: translateY(-2px);
  border-color: var(--primary-coral);
}

.header-btn.active {
  background: #E8F5E9;
  border-color: #4CAF50;
  color: #2E7D32;
}

/* App Main Container */
.app-viewport {
  position: relative;
  z-index: 10;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* View switcher */
.app-view {
  display: none;
}

.app-view.active {
  display: block;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ================= HOME VIEW - COMPACT MASCOT GREETING ================= */
.mascot-hero-section {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px auto 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 8px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  border: 2px solid #FDE68A;
  max-width: 680px;
  transition: all 0.2s ease;
}

.mascot-hero-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.12);
  border-color: #F59E0B;
}

.mascot-container {
  cursor: pointer;
  position: relative;
  text-align: center;
  flex-shrink: 0;
}

.mascot-avatar {
  font-size: 2.2rem;
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.mascot-avatar:hover {
  transform: scale(1.2) rotate(8deg);
}

.mascot-bounce {
  animation: bounceJump 0.6s ease;
}

.mascot-bubble {
  position: relative;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
  flex: 1;
  text-align: left;
}

.mascot-bubble::before {
  display: none;
}

.mascot-bubble h2 {
  font-family: var(--font-display);
  color: #D97706;
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0 0 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mascot-bubble p {
  font-size: 0.86rem;
  color: #475569;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}


/* ================= ADVENTURE MAP SUPER HERO BANNER ================= */
.adventure-hero-banner {
  background: linear-gradient(135deg, #FF9A8B 0%, #FF6A88 40%, #FF99AC 100%);
  border: 4px solid #FFF;
  border-radius: 32px;
  padding: 28px 32px;
  margin: 15px 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(255, 106, 136, 0.35);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s;
}

.adventure-hero-banner:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 22px 46px rgba(255, 106, 136, 0.45);
}

.adventure-banner-content {
  flex: 1;
  z-index: 2;
  color: white;
  text-align: left;
}

.adventure-banner-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  color: #FFF;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 900;
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.adventure-banner-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  margin-bottom: 6px;
}

.adventure-banner-desc {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.4;
  margin-bottom: 16px;
  max-width: 600px;
}

.btn-start-adventure {
  background: #FFF;
  color: #E11D48;
  border: none;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
  padding: 12px 28px;
  border-radius: 26px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-start-adventure:hover {
  transform: scale(1.06);
  background: #FFF1F2;
}

.adventure-banner-art {
  position: relative;
  width: 160px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.adv-art-icon {
  position: absolute;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.15));
}

.adv-main {
  font-size: 6rem;
  z-index: 1;
  animation: floatSlow 3s infinite ease-in-out;
}

.adv-sub-1 {
  font-size: 2.8rem;
  top: 0;
  left: 0;
  animation: bounceSlow 2s infinite;
}

.adv-sub-2 {
  font-size: 2.8rem;
  bottom: 0;
  right: 0;
  animation: bounceSlow 2.4s infinite reverse;
}

.adv-sub-3 {
  font-size: 2.6rem;
  top: 10px;
  right: 10px;
  animation: pulse 1.8s infinite;
}

/* Category Grid / Adventure Cards */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.category-card {
  background: white;
  border-radius: 28px;
  padding: 28px 22px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 4px solid white;
  box-shadow: var(--clay-shadow);
}

.category-card:hover {
  transform: translateY(-10px) scale(1.02);
}

.card-adventure-map {
  background: linear-gradient(180deg, #FEF3C7 0%, #FFFFFF 100%);
  border-color: #F59E0B;
}

.card-adventure-map:hover {
  box-shadow: 0 16px 30px rgba(245, 158, 11, 0.35);
}

.card-math {
  background: linear-gradient(180deg, #FFF3E6 0%, #FFFFFF 100%);
  border-color: #FFB347;
}

.card-math:hover {
  box-shadow: 0 16px 30px rgba(255, 159, 28, 0.3);
}

.card-vietnamese {
  background: linear-gradient(180deg, #FFEBF2 0%, #FFFFFF 100%);
  border-color: #FF70A6;
}

.card-vietnamese:hover {
  box-shadow: 0 16px 30px rgba(255, 94, 126, 0.3);
}

.card-english {
  background: linear-gradient(180deg, #E0F2FE 0%, #FFFFFF 100%);
  border-color: #38BDF8;
}

.card-english:hover {
  box-shadow: 0 16px 30px rgba(56, 189, 248, 0.35);
}

.card-brain {
  background: linear-gradient(180deg, #EBF5FF 0%, #FFFFFF 100%);
  border-color: #4EA8DE;
}

.card-brain:hover {
  box-shadow: 0 16px 30px rgba(58, 168, 247, 0.3);
}

.card-stickers {
  background: linear-gradient(180deg, #F3E8FF 0%, #FFFFFF 100%);
  border-color: #B5838D;
}

.card-stickers:hover {
  box-shadow: 0 16px 30px rgba(157, 101, 255, 0.3);
}

.card-art {
  background: linear-gradient(180deg, #FFF0F9 0%, #FFFFFF 100%);
  border-color: #FF9FF3;
}

.card-art:hover {
  box-shadow: 0 16px 30px rgba(255, 159, 243, 0.4);
}

.cat-icon-wrap {
  width: 90px;
  height: 90px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: white;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.cat-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.card-math .cat-title { color: #E85D04; }
.card-vietnamese .cat-title { color: #D90429; }
.card-brain .cat-title { color: #0077B6; }
.card-art .cat-title { color: #8C14FC; }
.card-stickers .cat-title { color: #7209B7; }

.cat-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 18px;
}

.cat-badge {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 700;
  background: #FFF;
  border: 2px solid currentColor;
}

.card-math .cat-badge { color: #E85D04; }
.card-vietnamese .cat-badge { color: #D90429; }
.card-brain .cat-badge { color: #0077B6; }
.card-art .cat-badge { color: #8C14FC; }
.card-stickers .cat-badge { color: #7209B7; }

/* Sub-views Navigation & Top Bar */
.view-top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background: white;
  padding: 16px 24px;
  border-radius: 24px;
  box-shadow: var(--card-shadow);
}

.btn-back-home {
  background: #FFF0F5;
  color: var(--primary-coral);
  border: 2px solid #FFD1DC;
  padding: 10px 20px;
  border-radius: 25px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-back-home:hover {
  background: var(--primary-coral);
  color: white;
  transform: scale(1.05);
}

.view-heading {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Mode sub-tabs */
.game-tabs-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tab-btn {
  background: white;
  border: 3px solid #E2E8F0;
  padding: 12px 20px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.05rem;
  color: #4A5568;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.tab-btn:hover {
  transform: translateY(-3px);
  border-color: var(--primary-blue);
}

.tab-btn.active {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
  box-shadow: 0 8px 16px rgba(58, 168, 247, 0.35);
}

.vn-mode-btn.active {
  background: var(--primary-coral);
  border-color: var(--primary-coral);
  box-shadow: 0 8px 16px rgba(255, 94, 126, 0.35);
}

.brain-mode-btn.active {
  background: var(--primary-purple);
  border-color: var(--primary-purple);
  box-shadow: 0 8px 16px rgba(157, 101, 255, 0.35);
}

/* Base Modal Styling */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.show {
  display: flex;
  animation: fadeIn 0.25s ease-out;
}

.modal-card {
  background: white;
  border-radius: 30px;
  padding: 35px 30px;
  max-width: 550px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border: 5px solid #FFE74C;
}

.modal-icon-big {
  font-size: 5rem;
  margin-bottom: 10px;
  animation: pulse 1s infinite alternate;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.modal-desc {
  font-size: 1.1rem;
  color: #4A5568;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 25px;
}

.modal-btn-confirm {
  background: linear-gradient(45deg, #38D39F, #20BF6B);
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 25px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(56, 211, 159, 0.4);
  transition: transform 0.2s ease;
}

.modal-btn-confirm:hover {
  transform: scale(1.06);
}

.btn-danger {
  background: #FFF5F5;
  color: #E53E3E;
  border: 2px solid #FEB2B2;
  padding: 10px 22px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s ease;
  display: inline-block;
}

.btn-danger:hover {
  background: #E53E3E;
  color: white;
  border-color: #C53030;
  transform: scale(1.03);
}

.btn-danger.confirm-step {
  background: #E53E3E;
  color: white;
  border-color: #9B2C2C;
  animation: pulse 0.8s infinite alternate;
}

/* Animations */
@keyframes wiggle {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

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

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

/* ================= HỒ SƠ BÉ & AVATAR PROFILE BADGE ================= */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  padding: 6px 14px 6px 8px;
  border-radius: 30px;
  border: 2px solid #E2E8F0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-profile-badge:hover {
  transform: translateY(-2px);
  border-color: #3AA8F7;
  box-shadow: 0 6px 18px rgba(58, 168, 247, 0.2);
}

.profile-avatar-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  border: 3px solid white;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  overflow: hidden;
  object-fit: cover;
}

.profile-avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: #1A202C;
  white-space: nowrap;
}

.profile-age-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #718096;
}

.profile-edit-btn {
  background: #EDF2F7;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  color: #4A5568;
}

.user-profile-badge:hover .profile-edit-btn {
  background: #E2E8F0;
}

/* KHUNG VIỀN STICKER CHO AVATAR */
.profile-avatar-wrapper.frame-glow {
  box-shadow: 0 0 0 3px #FFFFFF, 0 0 12px rgba(58, 168, 247, 0.7);
}

.profile-avatar-wrapper.frame-crown::before {
  content: '👑';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  z-index: 2;
}

.profile-avatar-wrapper.frame-bunny::before {
  content: '🐰';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.25rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  z-index: 2;
}

.profile-avatar-wrapper.frame-cat::before {
  content: '🐱';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  z-index: 2;
}

.profile-avatar-wrapper.frame-rainbow::before {
  content: '🌈';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  z-index: 2;
}

.profile-avatar-wrapper.frame-candy::after {
  content: '🍭';
  position: absolute;
  bottom: -6px;
  right: -8px;
  font-size: 1.15rem;
  z-index: 2;
}

/* ================= MODAL PROFILE ONBOARDING ================= */
.profile-modal-card {
  max-width: 600px;
  padding: 30px 28px;
  max-height: 90vh;
  overflow-y: auto;
  text-align: left;
}

.modal-header-badge {
  display: inline-block;
  background: #FEF3C7;
  color: #B45309;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1.5px solid #FDE68A;
  margin-bottom: 8px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #2D3748;
  margin-bottom: 8px;
}

.form-sublabel {
  font-size: 0.9rem;
  font-weight: 700;
  color: #718096;
  margin: 12px 0 8px;
}

.form-input {
  width: 100%;
  padding: 12px 18px;
  border-radius: 16px;
  border: 2px solid #CBD5E1;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  color: #1A202C;
  outline: none;
  transition: all 0.2s;
  background: #F8FAFC;
}

.form-input:focus {
  border-color: #3AA8F7;
  background: white;
  box-shadow: 0 0 0 4px rgba(58, 168, 247, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.select-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-choice {
  flex: 1;
  padding: 8px 12px;
  border-radius: 14px;
  border: 2px solid #E2E8F0;
  background: white;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  color: #4A5568;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
}

.pill-choice:hover {
  border-color: #CBD5E0;
}

.pill-choice.active {
  background: #EBF8FF;
  border-color: #3182CE;
  color: #2B6CB0;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(49, 130, 206, 0.2);
}

.avatar-creation-section {
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 20px;
}

.avatar-live-preview-box {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
  background: white;
  padding: 12px 18px;
  border-radius: 18px;
  border: 2px dashed #CBD5E1;
}

.avatar-preview-wrapper {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid white;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.avatar-preview-wrapper.frame-glow {
  box-shadow: 0 0 0 4px #FFFFFF, 0 0 16px rgba(58, 168, 247, 0.8);
}

.avatar-preview-wrapper.frame-crown::before {
  content: '👑';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
  z-index: 2;
}

.avatar-preview-wrapper.frame-bunny::before {
  content: '🐰';
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.9rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
  z-index: 2;
}

.avatar-preview-wrapper.frame-cat::before {
  content: '🐱';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
  z-index: 2;
}

.avatar-preview-wrapper.frame-rainbow::before {
  content: '🌈';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  z-index: 2;
}

.avatar-preview-wrapper.frame-candy::after {
  content: '🍭';
  position: absolute;
  bottom: -8px;
  right: -10px;
  font-size: 1.7rem;
  z-index: 2;
}

.preview-avatar-content {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  overflow: hidden;
}

.preview-avatar-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-preview-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-name-tag {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: #1A202C;
}

.btn-upload-avatar {
  background: linear-gradient(135deg, #3AA8F7, #0077B6);
  color: white;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-block;
  width: fit-content;
  box-shadow: 0 3px 8px rgba(0, 119, 182, 0.3);
  transition: transform 0.15s;
}

.btn-upload-avatar:hover {
  transform: scale(1.04);
}

.preset-avatars-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.preset-avatar-btn {
  background: white;
  border: 2px solid #CBD5E1;
  border-radius: 14px;
  font-size: 1.7rem;
  padding: 6px 0;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preset-avatar-btn:hover {
  border-color: #3AA8F7;
  transform: scale(1.1);
}

.preset-avatar-btn.active {
  background: #EBF8FF;
  border-color: #3182CE;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.3);
  transform: scale(1.12);
}

.frame-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.frame-choice-btn {
  background: white;
  border: 2px solid #CBD5E1;
  border-radius: 12px;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: #2D3748;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.frame-choice-btn:hover {
  border-color: #3AA8F7;
}

.frame-choice-btn.active {
  background: #FFFBEB;
  border-color: #F59E0B;
  color: #B45309;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.btn-save-profile {
  width: 100%;
  padding: 16px;
  font-size: 1.25rem;
}

/* ================= MOBILE BOTTOM NAVIGATION BAR ================= */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 2px solid #E2E8F0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  z-index: 100;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.b-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: 16px;
  transition: all 0.15s ease;
}

.b-nav-icon {
  font-size: 1.55rem;
  transition: transform 0.2s;
  line-height: 1;
}

.b-nav-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748B;
  transition: color 0.15s;
}

.b-nav-item:active .b-nav-icon {
  transform: scale(1.2);
}

.b-nav-item.active {
  background: #EFF6FF;
}

.b-nav-item.active .b-nav-icon {
  transform: translateY(-2px) scale(1.1);
  filter: drop-shadow(0 4px 6px rgba(2, 132, 199, 0.25));
}

.b-nav-item.active .b-nav-label {
  color: #0284C7;
  font-weight: 900;
}

/* ================= RESPONSIVE MOBILE TỐI ƯU HÓA (TOUCH-FIRST) ================= */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }

  .app-viewport {
    padding-bottom: 86px;
  }

  .app-header {
    padding: 10px 14px;
  }

  .header-actions #btn-open-stickers,
  .header-actions #btn-open-parent {
    display: none; /* Đã có trên Bottom Nav Bar */
  }

  .adventure-hero-banner {
    flex-direction: column;
    padding: 22px 20px;
    text-align: center;
  }

  .adventure-banner-content {
    text-align: center;
  }

  .adventure-banner-title {
    font-size: 1.65rem;
  }

  .adventure-banner-desc {
    font-size: 0.95rem;
  }

  .adventure-banner-art {
    margin-top: 10px;
  }

  .mascot-hero-section {
    flex-direction: row;
    padding: 8px 16px;
    gap: 12px;
    margin: 6px auto 14px;
    text-align: left;
  }

  .mascot-bubble::before {
    display: none;
  }

  .categories-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .category-card {
    padding: 20px 16px;
  }

  .game-tabs-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    justify-content: flex-start;
    scrollbar-width: thin;
  }

  .tab-btn {
    flex: 0 0 auto;
    font-size: 0.9rem;
    padding: 10px 16px;
    min-height: 48px;
  }

  .game-opt-btn {
    min-height: 54px;
    font-size: 1.15rem;
  }
}


