﻿/* ============================================
   STEM Learn - Design System
   Nền tảng học kỹ năng máy tính
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* --- CSS Variables --- */
:root {
  --primary: #4F46E5;
  --primary-light: #818CF8;
  --primary-dark: #3730A3;
  --secondary: #22C55E;
  --secondary-light: #4ADE80;
  --secondary-dark: #16A34A;
  --warning: #F59E0B;
  --warning-light: #FBBF24;
  --danger: #EF4444;
  --danger-light: #F87171;
  --bg: #F4F7FB;
  --card: #FFFFFF;
  --text: #1F2937;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --border: #E5E7EB;
  --shadow-sm: 0 2px 8px rgba(79, 70, 229, 0.08);
  --shadow-md: 0 4px 20px rgba(79, 70, 229, 0.12);
  --shadow-lg: 0 8px 40px rgba(79, 70, 229, 0.16);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: 72px;
  --sidebar-width: 260px;
  --level1-blue: #3B82F6;
  --level1-green: #10B981;
  --level2-orange: #F59E0B;
  --level2-green: #22C55E;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Nunito', sans-serif !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

img {
  max-width: 100%;
  display: block;
}

ul,
ol {
  list-style: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text);
  line-height: 1.25;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 700;
}

h4 {
  font-size: 1.25rem;
  font-weight: 700;
}

p,
li,
span,
td {
  font-weight: 600;
  line-height: 1.65;
}

.subtitle,
.muted,
.text-muted {
  font-weight: 600;
  color: var(--text-muted);
}

.text-primary {
  color: var(--primary);
}

.text-secondary {
  color: var(--secondary);
}

.text-center {
  text-align: center;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 1400px;
}

.page-wrapper {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding-top: var(--header-height);
  min-height: 100vh;
}

.main-content.no-sidebar {
  margin-left: 0;
}

.section {
  padding: 64px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-title h2 {
  margin-bottom: 12px;
}

.section-title p {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

.grid {
  display: grid;
  gap: 24px;
}

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

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

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-sm {
  gap: 8px;
}

.gap-md {
  gap: 16px;
}

.gap-lg {
  gap: 24px;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--card);
  border-bottom: 2px solid var(--border);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.header.with-sidebar {
  left: var(--sidebar-width);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 1.375rem;
  color: #6c5ce7;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.logo .logo-img {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: var(--radius-md);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  text-decoration: underline;
}

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

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: 8px;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--card);
  border-right: 2px solid var(--border);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-profile {
  padding: 24px 20px;
  text-align: center;
  border-bottom: 2px solid var(--border);
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.06) 0%, transparent 100%);
}

.sidebar-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  border: 4px solid var(--card);
  box-shadow: var(--shadow-md);
}

.sidebar-name {
  font-weight: 800;
  font-size: 1.125rem;
  margin-bottom: 12px;
}

.sidebar-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.stat-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 14px;
  background: var(--bg);
  border-radius: var(--radius-md);
}

.stat-badge .value {
  font-weight: 900;
  font-size: 1.125rem;
  color: var(--primary);
}

.stat-badge .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-xp {
  padding: 0 20px 16px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
  transition: all var(--transition);
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active {
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
}

.sidebar-nav-item .icon {
  font-size: 1.25rem;
  width: 28px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  white-space: nowrap;
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.125rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.btn-success {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
  color: #fff;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), var(--warning-light));
  color: #fff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-warning:hover {
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), var(--danger-light));
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  box-shadow: none;
  margin-bottom: 10px;
}

.btn-ghost:hover {
  background: rgba(79, 70, 229, 0.15);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-block {
  width: 100%;
}

/* --- Cards --- */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border);
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-mission {
  position: relative;
  overflow: hidden;
}

.card-mission::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.card-mission .mission-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(79, 70, 229, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 16px;
}

.card-mission .mission-xp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(34, 197, 94, 0.12);
  color: var(--secondary-dark);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.875rem;
  margin-top: 12px;
}

.card-level-intro {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  background: #ffffff;
  text-decoration: none !important;
  height: 100%;
}

.card-level-intro:hover {
  transform: translateY(-8px);
}

/* Top Zone */
.level-card-top {
  position: relative;
  padding: 24px 16px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Curved transition background */
.level-card-top::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -10%;
  width: 120%;
  height: 40px;
  background: #ffffff;
  border-radius: 50%;
  z-index: 1;
}

/* Number badge top-left */
.level-card-num {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  z-index: 2;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Mascot/Icon container */
.level-intro-icon {
  z-index: 2;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  width: 100%;
}

.level-intro-icon img {
  max-height: 100%;
  max-width: 90%;
  object-fit: contain;
}

.level-intro-icon svg {
  width: 80px;
  height: 80px;
}

.level-intro-icon i,
.level-intro-icon span {
  font-size: 4.5rem;
}

.card-level-intro:hover .level-intro-icon {
  transform: scale(1.1) translateY(-5px);
}

/* Bottom Zone */
.level-card-bottom {
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-grow: 1;
  background: #ffffff;
  z-index: 2;
}

.level-card-bottom h4 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.level-card-bottom p.text-muted {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0 0 20px 0;
  line-height: 1.5;
  flex-grow: 1;
}

/* XP Badge */
.level-xp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.card-level-intro:hover .level-xp-badge {
  transform: scale(1.05);
}

/* Level 1: Purple */
.level-card-1 {
  border-color: #dcd6ff !important;
}

.level-card-1 .level-card-top {
  background: #f0eeff;
}

.level-card-1 .level-card-num,
.level-card-1 .level-xp-badge {
  background: #7d5fff;
}

.level-card-1:hover {
  box-shadow: 0 12px 28px rgba(108, 92, 231, 0.2) !important;
  border-color: #7d5fff !important;
}

/* Level 2: Green */
.level-card-2 {
  border-color: #c8f2e9 !important;
}

.level-card-2 .level-card-top {
  background: #e8f8f5;
}

.level-card-2 .level-card-num,
.level-card-2 .level-xp-badge {
  background: #10ac84;
}

.level-card-2:hover {
  box-shadow: 0 12px 28px rgba(0, 184, 148, 0.2) !important;
  border-color: #10ac84 !important;
}

/* Level 3: Orange */
.level-card-3 {
  border-color: #ffe8d6 !important;
}

.level-card-3 .level-card-top {
  background: #fff4eb;
}

.level-card-3 .level-card-num,
.level-card-3 .level-xp-badge {
  background: #ff9f43;
}

.level-card-3:hover {
  box-shadow: 0 12px 28px rgba(253, 150, 68, 0.2) !important;
  border-color: #ff9f43 !important;
}

/* Level 4: Pink */
.level-card-4 {
  border-color: #ffdce8 !important;
}

.level-card-4 .level-card-top {
  background: #fff0f5;
}

.level-card-4 .level-card-num,
.level-card-4 .level-xp-badge {
  background: #ff4d6d;
}

.level-card-4:hover {
  box-shadow: 0 12px 28px rgba(253, 121, 168, 0.2) !important;
  border-color: #ff4d6d !important;
}

/* Level 5: Yellow */
.level-card-5 {
  border-color: #fff2d6 !important;
}

.level-card-5 .level-card-top {
  background: #fef9eb;
}

.level-card-5 .level-card-num,
.level-card-5 .level-xp-badge {
  background: #f1a80a;
}

.level-card-5:hover {
  box-shadow: 0 12px 28px rgba(241, 168, 10, 0.2) !important;
  border-color: #f1a80a !important;
}

/* Level 6: Blue */
.level-card-6 {
  border-color: #d6edff !important;
}

.level-card-6 .level-card-top {
  background: #eef7ff;
}

.level-card-6 .level-card-num,
.level-card-6 .level-xp-badge {
  background: #3867d6;
}

.level-card-6:hover {
  box-shadow: 0 12px 28px rgba(116, 185, 255, 0.2) !important;
  border-color: #3867d6 !important;
}

/* Level 7: Indigo */
.level-card-7 {
  border-color: #e6e1ff !important;
}

.level-card-7 .level-card-top {
  background: #f0efff;
}

.level-card-7 .level-card-num,
.level-card-7 .level-xp-badge {}

.level-card-7:hover {
  box-shadow: 0 12px 28px rgba(162, 155, 254, 0.2) !important;
  border-color: #5758bb !important;
}

.card-achievement {
  text-align: center;
  padding: 28px 20px;
}

.card-achievement .badge-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 4px solid #F59E0B;
  transition: transform var(--transition);
}

.card-achievement:hover .badge-icon {
  transform: scale(1.1) rotate(5deg);
}

.card-achievement.locked .badge-icon {
  background: var(--bg);
  border-color: var(--border);
  filter: grayscale(1);
  opacity: 0.5;
}

.card-gift {
  text-align: center;
  padding: 24px;
}

.card-gift .gift-image {
  width: 100px;
  height: 100px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #FCE7F3, #FBCFE8);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.card-gift .gift-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 900;
  margin-top: 12px;
}

/* --- Progress Bar --- */
.progress {
  width: 100%;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 700;
}

.progress-bar {
  height: 12px;
  background: var(--bg);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 2px solid var(--border);
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.6s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.progress-sm .progress-bar {
  height: 8px;
}

.progress-lg .progress-bar {
  height: 18px;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 55, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition);
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.modal-icon.success {
  background: rgba(34, 197, 94, 0.15);
}

.modal-icon.xp {
  background: rgba(79, 70, 229, 0.15);
}

.modal-icon.warning {
  background: rgba(245, 158, 11, 0.15);
}

.modal h3 {
  margin-bottom: 12px;
}

.modal p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.modal-close:hover {
  background: var(--border);
}

/* --- Forms --- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  transition: all var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-input::placeholder {
  color: var(--text-light);
  font-weight: 600;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 6px;
}

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

/* --- Status Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--secondary-dark);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #B45309;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #B91C1C;
}

.badge-primary {
  background: rgba(79, 70, 229, 0.15);
  color: var(--primary-dark);
}

.badge-muted {
  background: var(--bg);
  color: var(--text-muted);
}

/* --- Hero Section --- */
.hero {
  padding: 120px 0 80px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(34, 197, 94, 0.06) 50%, var(--bg) 100%);
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content h1 {
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-illustration {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-scene {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-robot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 8rem;
  animation: float 3s ease-in-out infinite;
}

.hero-computer {
  position: absolute;
  right: 10%;
  bottom: 15%;
  font-size: 4rem;
  animation: float 3s ease-in-out infinite 0.5s;
}

.hero-student {
  position: absolute;
  left: 10%;
  bottom: 20%;
  font-size: 4rem;
  animation: float 3s ease-in-out infinite 1s;
}

.hero-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-stars span {
  position: absolute;
  font-size: 1.5rem;
  animation: twinkle 2s ease-in-out infinite;
}

.hero-stars span:nth-child(1) {
  top: 10%;
  left: 20%;
  animation-delay: 0s;
}

.hero-stars span:nth-child(2) {
  top: 20%;
  right: 15%;
  animation-delay: 0.5s;
}

.hero-stars span:nth-child(3) {
  bottom: 30%;
  left: 5%;
  animation-delay: 1s;
}

.hero-stars span:nth-child(4) {
  top: 5%;
  right: 30%;
  animation-delay: 1.5s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }

  50% {
    transform: translate(-50%, -50%) translateY(-15px);
  }
}

@keyframes twinkle {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* --- Top Students --- */
.top-students {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 48px;
}

.top-student {
  text-align: center;
  padding: 24px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  min-width: 160px;
  transition: transform var(--transition);
}

.top-student:hover {
  transform: translateY(-4px);
}

.top-student.first {
  order: 2;
  border-color: #F59E0B;
  background: linear-gradient(180deg, #FFFBEB 0%, var(--card) 100%);
  padding-bottom: 40px;
  transform: scale(1.08);
}

.top-student.second {
  order: 1;
}

.top-student.third {
  order: 3;
}

.top-student .rank {
  font-size: 2rem;
  margin-bottom: 8px;
}

.top-student .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
}

.top-student.first .avatar {
  width: 80px;
  height: 80px;
  font-size: 2.5rem;
  border: 4px solid #F59E0B;
}

.top-student .name {
  font-weight: 800;
  margin-bottom: 4px;
}

.top-student .xp {
  color: var(--secondary);
  font-weight: 800;
}

/* --- Leaderboard Table --- */
.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.leaderboard-table th {
  text-align: left;
  padding: 12px 20px;
  font-weight: 800;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
}

.leaderboard-table td {
  padding: 16px 20px;
  background: var(--card);
  border: 2px solid var(--border);
}

.leaderboard-table tr td:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  font-weight: 900;
  color: var(--primary);
}

.leaderboard-table tr td:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.leaderboard-table tr.highlight td {
  background: rgba(79, 70, 229, 0.06);
  border-color: var(--primary-light);
}

.leaderboard-avatar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.leaderboard-avatar .avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
  padding: 20px 24px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  transition: all var(--transition);
}

.timeline-item:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 24px;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border: 4px solid var(--card);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.timeline-time {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.timeline-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.timeline-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(79, 70, 229, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* --- Auth Pages --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.06) 0%, rgba(34, 197, 94, 0.04) 100%);
}

.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 960px;
  width: 100%;
  background: var(--card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border);
}

.auth-form-side {
  padding: 48px 40px;
}

.auth-illustration-side {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: #fff;
  text-align: center;
}

.auth-illustration-side .illus-icon {
  font-size: 6rem;
  margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
}

.auth-illustration-side h3 {
  color: #fff;
  margin-bottom: 12px;
}

.auth-illustration-side p {
  opacity: 0.9;
  font-size: 1.0625rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header .logo {
  justify-content: center;
  margin-bottom: 24px;
}

.auth-header h2 {
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-muted);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 700;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
}

/* --- Dashboard --- */
.dashboard-header {
  padding: 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-xl);
  color: #fff;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.dashboard-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  border: 4px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.dashboard-info h2 {
  color: #fff;
  margin-bottom: 8px;
}

.dashboard-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.dashboard-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  opacity: 0.95;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 2px solid var(--border);
  text-align: center;
}

.stat-card .stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.1), rgba(123, 97, 255, 0.08));
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* --- Mission Map --- */
.mission-map {
  position: relative;
  padding: 48px 24px;
  min-height: 600px;
}

.mission-path {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--level1-blue), var(--level1-green));
  border-radius: var(--radius-full);
  opacity: 0.3;
}

.mission-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 48px;
  z-index: 1;
}

.mission-node:nth-child(even) {
  flex-direction: row-reverse;
  text-align: right;
}

.mission-node:nth-child(even) .mission-node-card {
  margin-left: auto;
}

.mission-node-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 3px solid var(--border);
  max-width: 360px;
  width: 100%;
  transition: all var(--transition);
  cursor: pointer;
}

.mission-node-card:hover {
  transform: scale(1.03);
  border-color: var(--level1-blue);
  box-shadow: var(--shadow-md);
}

.mission-node-card.completed {
  border-color: var(--secondary);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), var(--card));
}

.mission-node-card.active {
  border-color: var(--level1-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.mission-node-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.mission-node-dot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--card);
  border: 4px solid var(--level1-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  box-shadow: var(--shadow-md);
}

.mission-node.completed .mission-node-dot {
  border-color: var(--secondary);
  background: var(--secondary);
}

.mission-node.locked .mission-node-dot {
  border-color: var(--text-light);
  background: var(--bg);
}

/* --- Gift Shop --- */
.gift-shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 24px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border-radius: var(--radius-xl);
  border: 2px solid #F59E0B;
}

.gift-coins {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 1.5rem;
  color: #B45309;
}

/* --- Reward Carousel --- */
.reward-stories {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 8px 0 16px;
  scroll-snap-type: x mandatory;
}

.reward-story {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.reward-story .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.reward-story .story-text {
  font-size: 0.9375rem;
}

.reward-story .story-text strong {
  color: var(--primary);
}

/* --- Guide Page --- */
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.guide-step {
  display: flex;
  gap: 24px;
  padding: 28px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  transition: all var(--transition);
}

.guide-step:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.guide-step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 900;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-step-content h4 {
  margin-bottom: 8px;
}

.guide-step-content p {
  color: var(--text-muted);
}

/* --- Page Content Padding --- */
.page-content {
  padding: 32px;
}

.page-title {
  margin-bottom: 32px;
}

.page-title h1 {
  margin-bottom: 8px;
}

.page-title p {
  color: var(--text-muted);
}

/* --- Footer --- */
.footer {
  background: var(--card);
  border-top: 2px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 64px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand .logo {
  margin-bottom: 16px;
}

.footer-brand p {
  color: var(--text-muted);
  max-width: 300px;
}

.footer-col h4 {
  margin-bottom: 16px;
  font-size: 1rem;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  padding: 6px 0;
  font-weight: 600;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 2px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* --- Utilities --- */
.mt-sm {
  margin-top: 8px;
}

.mt-md {
  margin-top: 16px;
}

.mt-lg {
  margin-top: 24px;
}

.mt-xl {
  margin-top: 32px;
}

.mb-sm {
  margin-bottom: 8px;
}

.mb-md {
  margin-bottom: 16px;
}

.mb-lg {
  margin-bottom: 24px;
}

.mb-xl {
  margin-bottom: 32px;
}

.hidden {
  display: none !important;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .video-layout {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1024px) {
  .menu-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--card);
    flex-direction: column;
    padding: 16px;
    border-bottom: 2px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav-menu.open {
    display: flex;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
  }

  .sidebar.open {
    transform: translateX(0);
    width: 280px;
  }

  .main-content {
    margin-left: 0;
  }

  .header.with-sidebar {
    left: 0;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content p {
    margin: 0 auto 32px;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-illustration {
    height: 280px;
  }

  .hero-robot {
    font-size: 5rem;
  }

  .auth-container {
    grid-template-columns: 1fr;
  }

  .auth-illustration-side {
    display: none;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .top-students {
    flex-direction: column;
    align-items: center;
  }

  .top-student.first {
    order: 1;
    transform: none;
  }

  .top-student.second {
    order: 2;
  }

  .top-student.third {
    order: 3;
  }

  .dashboard-header {
    flex-direction: column;
    text-align: center;
  }

  .dashboard-stats {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .mission-node,
  .mission-node:nth-child(even) {
    flex-direction: column;
    text-align: center;
  }

  .mission-node:nth-child(even) .mission-node-card {
    margin-left: 0;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand .logo {
    justify-content: center;
  }

  .footer-brand p {
    margin: 0 auto;
  }
}

@media (max-width: 480px) {

  /* header-actions hidden on mobile — injected into hamburger menu by JS */
  .header-actions {
    display: none !important;
  }

  .page-content {
    padding: 16px;
  }
}

/* --- Gift Shop --- */
.gift-shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 24px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border-radius: var(--radius-xl);
  border: 2px solid #F59E0B;
}

.gift-coins {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 1.5rem;
  color: #B45309;
}

/* --- Reward Carousel --- */
.reward-stories {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 8px 0 16px;
  scroll-snap-type: x mandatory;
}

.reward-story {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.reward-story .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.reward-story .story-text {
  font-size: 0.9375rem;
}

.reward-story .story-text strong {
  color: var(--primary);
}

/* --- Guide Page --- */
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.guide-step {
  display: flex;
  gap: 24px;
  padding: 28px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  transition: all var(--transition);
}

.guide-step:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.guide-step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 900;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-step-content h4 {
  margin-bottom: 8px;
}

.guide-step-content p {
  color: var(--text-muted);
}

/* --- Page Content Padding --- */
.page-content {
  padding: 32px;
}

.page-title {
  margin-bottom: 32px;
}

.page-title h1 {
  margin-bottom: 8px;
}

.page-title p {
  color: var(--text-muted);
}

/* --- Footer --- */
.footer {
  background: var(--card);
  border-top: 2px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 64px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand .logo {
  margin-bottom: 16px;
}

.footer-brand p {
  color: var(--text-muted);
  max-width: 300px;
}

.footer-col h4 {
  margin-bottom: 16px;
  font-size: 1rem;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  padding: 6px 0;
  font-weight: 600;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 2px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* --- Utilities --- */
.mt-sm {
  margin-top: 8px;
}

.mt-md {
  margin-top: 16px;
}

.mt-lg {
  margin-top: 24px;
}

.mt-xl {
  margin-top: 32px;
}

.mb-sm {
  margin-bottom: 8px;
}

.mb-md {
  margin-bottom: 16px;
}

.mb-lg {
  margin-bottom: 24px;
}

.mb-xl {
  margin-bottom: 32px;
}

.hidden {
  display: none !important;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .video-layout {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
  }

  .sidebar.open {
    transform: translateX(0);
    width: 280px;
  }

  .main-content {
    margin-left: 0;
  }

  .header.with-sidebar {
    left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--card);
    flex-direction: column;
    padding: 16px;
    border-bottom: 2px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav-menu.open {
    display: flex;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content p {
    margin: 0 auto 32px;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-illustration {
    height: 280px;
  }

  .hero-robot {
    font-size: 5rem;
  }

  .auth-container {
    grid-template-columns: 1fr;
  }

  .auth-illustration-side {
    display: none;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .top-students {
    flex-direction: column;
    align-items: center;
  }

  .top-student.first {
    order: 1;
    transform: none;
  }

  .top-student.second {
    order: 2;
  }

  .top-student.third {
    order: 3;
  }

  .dashboard-header {
    flex-direction: column;
    text-align: center;
  }

  .dashboard-stats {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .mission-node,
  .mission-node:nth-child(even) {
    flex-direction: column;
    text-align: center;
  }

  .mission-node:nth-child(even) .mission-node-card {
    margin-left: 0;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand .logo {
    justify-content: center;
  }

  .footer-brand p {
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .header-actions .btn {
    padding: 8px 16px;
    font-size: 0.875rem;
  }

  .page-content {
    padding: 16px;
  }
}

/* --- Level Theme --- */
.level-header {
  background: linear-gradient(135deg, var(--level1-blue), var(--level1-green));
  padding: 32px;
  border-radius: var(--radius-xl);
  color: #fff;
  margin-bottom: 32px;
}

.level-header h2 {
  color: #fff;
  margin-bottom: 8px;
}

.level-header p {
  opacity: 0.9;
}

.level-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 700;
  color: #64748b;
}

.level-breadcrumb a {
  color: #4f46e5;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.level-breadcrumb a:hover {
  opacity: 0.8;
}

.level-header .level-breadcrumb {
  color: rgba(255, 255, 255, 0.85);
}

.level-header .level-breadcrumb a {
  color: #fff;
  opacity: 0.8;
}

.level-header .level-breadcrumb a:hover {
  opacity: 1;
}

/* --- Mission Detail --- */
.mission-detail {
  max-width: 720px;
  margin: 0 auto;
}

.mission-detail-header {
  text-align: center;
  margin-bottom: 32px;
}

.mission-detail-icon {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(16, 185, 129, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  margin: 0 auto 20px;
}

.mission-requirements {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
}

.mission-requirements h4 {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mission-requirements li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.mission-requirements li:last-child {
  border-bottom: none;
}

.mission-requirements li::before {
  content: '✓';
  width: 24px;
  height: 24px;
  background: var(--secondary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* --- Video Page --- */
.video-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
}

.video-player {
  background: #000;
  border-radius: var(--radius-lg);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.video-placeholder {
  text-align: center;
  color: #fff;
}

.video-placeholder .play-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 16px;
  cursor: pointer;
  transition: all var(--transition);
}

.video-placeholder .play-btn:hover {
  background: var(--primary);
  transform: scale(1.1);
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-list-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.video-list-item:hover,
.video-list-item.active {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.04);
}

.video-thumb {
  width: 80px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.video-list-info h5 {
  font-size: 0.9375rem;
  margin-bottom: 4px;
}

.video-list-info span {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* --- Game Page --- */
.game-container {
  max-width: 800px;
  margin: 0 auto;
}

.game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  border: 2px solid var(--border);
  margin-bottom: 24px;
}

.game-hud-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.game-hud-item .hud-icon {
  font-size: 1.5rem;
}

.game-hud-item .hud-value {
  font-size: 1.25rem;
  color: var(--primary);
}

.game-area {
  background: linear-gradient(180deg, #1E3A5F 0%, #0F172A 100%);
  border-radius: var(--radius-xl);
  padding: 32px;
  min-height: 400px;
  position: relative;
  overflow: hidden;
  border: 4px solid var(--primary);
}

.game-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(79, 70, 229, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(34, 197, 94, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

.game-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}

.game-tile {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  transition: all var(--transition);
}

.game-tile:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.game-tile.matched {
  background: rgba(34, 197, 94, 0.4);
  border-color: var(--secondary);
}

.game-tile.selected {
  background: rgba(79, 70, 229, 0.5);
  border-color: var(--primary-light);
  transform: scale(1.08);
}

.game-instructions {
  text-align: center;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.game-instructions h3 {
  color: #fff;
  margin-bottom: 8px;
}

/* --- Quiz Page --- */
.quiz-container {
  max-width: 720px;
  margin: 0 auto;
}

.quiz-progress {
  margin-bottom: 32px;
}

.quiz-question-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 40px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.quiz-question-number {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.quiz-question-text {
  font-size: 1.375rem;
  font-weight: 800;
  margin-bottom: 32px;
  line-height: 1.5;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 700;
}

.quiz-option:hover {
  border-color: var(--primary-light);
  background: rgba(79, 70, 229, 0.04);
}

.quiz-option.selected {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
}

.quiz-option.correct {
  border-color: var(--secondary);
  background: rgba(34, 197, 94, 0.1);
}

.quiz-option.wrong {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.quiz-option-letter {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
}

.quiz-option.selected .quiz-option-letter {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.quiz-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-result {
  text-align: center;
  padding: 48px;
}

.quiz-result-icon {
  font-size: 5rem;
  margin-bottom: 24px;
}

.quiz-result-score {
  font-size: 4rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.quiz-result-xp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--secondary-dark);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 900;
  font-size: 1.25rem;
  margin-bottom: 32px;
}

/* --- Gift Shop --- */
.gift-shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 24px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border-radius: var(--radius-xl);
  border: 2px solid #F59E0B;
}

.gift-coins {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 1.5rem;
  color: #B45309;
}

/* --- Reward Carousel --- */
.reward-stories {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 8px 0 16px;
  scroll-snap-type: x mandatory;
}

.reward-story {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.reward-story .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.reward-story .story-text {
  font-size: 0.9375rem;
}

.reward-story .story-text strong {
  color: var(--primary);
}

/* --- Guide Page --- */
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.guide-step {
  display: flex;
  gap: 24px;
  padding: 28px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  transition: all var(--transition);
}

.guide-step:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.guide-step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 900;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-step-content h4 {
  margin-bottom: 8px;
}

.guide-step-content p {
  color: var(--text-muted);
}

/* --- Page Content Padding --- */
.page-content {
  padding: 32px;
}

.page-title {
  margin-bottom: 32px;
}

.page-title h1 {
  margin-bottom: 8px;
}

.page-title p {
  color: var(--text-muted);
}

/* --- Footer --- */
.footer {
  background: var(--card);
  border-top: 2px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 64px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand .logo {
  margin-bottom: 16px;
}

.footer-brand p {
  color: var(--text-muted);
  max-width: 300px;
}

.footer-col h4 {
  margin-bottom: 16px;
  font-size: 1rem;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  padding: 6px 0;
  font-weight: 600;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 2px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* --- Utilities --- */
.mt-sm {
  margin-top: 8px;
}

.mt-md {
  margin-top: 16px;
}

.mt-lg {
  margin-top: 24px;
}

.mt-xl {
  margin-top: 32px;
}

.mb-sm {
  margin-bottom: 8px;
}

.mb-md {
  margin-bottom: 16px;
}

.mb-lg {
  margin-bottom: 24px;
}

.mb-xl {
  margin-bottom: 32px;
}

.hidden {
  display: none !important;
}

/* --- Level 2 Theme: Học viện siêu thao tác --- */
.level-header.level-2 {
  background: linear-gradient(135deg, var(--level2-orange), var(--level2-green));
}

.mission-map.level-2 .mission-path {
  background: linear-gradient(180deg, var(--level2-orange), var(--level2-green));
}

.mission-map.level-2 .mission-node-card:hover {
  border-color: var(--level2-orange);
}

.mission-map.level-2 .mission-node-card.active {
  border-color: var(--level2-orange);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
}

.mission-map.level-2 .mission-node-dot {
  border-color: var(--level2-orange);
}

.game-area.level-2 {
  border-color: var(--level2-orange);
  background: linear-gradient(180deg, #78350F 0%, #1C1917 100%);
}

.game-area.level-2::before {
  background:
    radial-gradient(circle at 20% 80%, rgba(245, 158, 11, 0.35) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(34, 197, 94, 0.25) 0%, transparent 50%);
}

.game-hud.level-2 .hud-value {
  color: var(--level2-orange);
}

.mode-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.mode-tab {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--card);
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition);
}

.mode-tab:hover,
.mode-tab.active {
  border-color: var(--level2-orange);
  background: rgba(245, 158, 11, 0.1);
  color: #B45309;
}

.mouse-game-arena {
  position: relative;
  z-index: 1;
  min-height: 360px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.mouse-target {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--level2-orange), var(--warning-light));
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  animation: target-pop 0.3s ease;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5);
  user-select: none;
}

.mouse-target.double {
  background: linear-gradient(135deg, #EF4444, #F87171);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.5);
}

.mouse-target.hit {
  animation: target-hit 0.4s ease forwards;
}

@keyframes target-pop {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes target-hit {
  to {
    transform: scale(1.5);
    opacity: 0;
  }
}

.drag-game-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  position: relative;
  z-index: 1;
  min-height: 320px;
}

.drag-source,
.drag-targets {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
}

.drag-source h4,
.drag-targets h4 {
  color: #fff;
  margin-bottom: 16px;
  font-size: 0.9375rem;
}

.drag-items {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.drag-item {
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--level2-orange), var(--warning-light));
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 800;
  cursor: grab;
  border: 2px solid rgba(255, 255, 255, 0.4);
  transition: transform var(--transition);
}

.drag-item:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.drag-item.placed {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.drop-zones {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drop-zone {
  min-height: 56px;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
  transition: all var(--transition);
}

.drop-zone.drag-over {
  border-color: var(--level2-green);
  background: rgba(34, 197, 94, 0.15);
}

.drop-zone.filled {
  border-color: var(--level2-green);
  border-style: solid;
  background: rgba(34, 197, 94, 0.2);
  color: #fff;
}

.keyboard-game-panel {
  max-width: 640px;
  margin: 0 auto;
}

.typing-display {
  text-align: center;
  padding: 32px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.typing-word {
  font-size: 2.5rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 4px;
  margin-bottom: 12px;
}

.typing-word .char-correct {
  color: var(--level2-green);
}

.typing-word .char-wrong {
  color: var(--danger);
}

.typing-word .char-current {
  border-bottom: 4px solid var(--level2-orange);
  color: var(--level2-orange);
}

.typing-input-wrap {
  position: relative;
  z-index: 1;
}

.typing-input {
  width: 100%;
  padding: 18px 24px;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
}

.typing-input:focus {
  outline: none;
  border-color: var(--level2-orange);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
}

.typing-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
  position: relative;
  z-index: 1;
}

.typing-stat {
  text-align: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: #fff;
}

.typing-stat .value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--level2-orange);
}

.typing-stat .label {
  font-size: 0.8125rem;
  opacity: 0.8;
  font-weight: 700;
}

.challenge-track {
  max-width: 800px;
  margin: 0 auto;
}

.challenge-step-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 3px solid var(--border);
  margin-bottom: 24px;
  transition: all var(--transition);
}

.challenge-step-card.active {
  border-color: var(--level2-orange);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

.challenge-step-card.completed {
  border-color: var(--level2-green);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.04), var(--card));
}

.challenge-step-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.challenge-step-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.challenge-step-card.completed .challenge-step-icon {
  background: rgba(34, 197, 94, 0.15);
}

.challenge-mini-arena {
  min-height: 120px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 2px dashed var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.challenge-mini-arena .mouse-target {
  position: relative;
  width: 56px;
  height: 56px;
}

.skill-result {
  text-align: center;
  padding: 48px 32px;
}

.skill-result-badge {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 6px solid var(--level2-orange);
  animation: badge-bounce 0.6s ease;
}

@keyframes badge-bounce {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.skill-result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 560px;
  margin: 32px auto;
}

.skill-stat-box {
  padding: 24px 16px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
}

.skill-stat-box .value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--level2-orange);
}

.skill-stat-box .label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 4px;
}

.skill-result-xp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--secondary-dark);
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-weight: 900;
  font-size: 1.375rem;
  margin-bottom: 32px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .video-layout {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
  }

  .sidebar.open {
    transform: translateX(0);
    width: 280px;
  }

  .main-content {
    margin-left: 0;
  }

  .header.with-sidebar {
    left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--card);
    flex-direction: column;
    padding: 16px;
    border-bottom: 2px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav-menu.open {
    display: flex;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content p {
    margin: 0 auto 32px;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-illustration {
    height: 280px;
  }

  .hero-robot {
    font-size: 5rem;
  }

  .auth-container {
    grid-template-columns: 1fr;
  }

  .auth-illustration-side {
    display: none;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .top-students {
    flex-direction: column;
    align-items: center;
  }

  .top-student.first {
    order: 1;
    transform: none;
  }

  .top-student.second {
    order: 2;
  }

  .top-student.third {
    order: 3;
  }

  .dashboard-header {
    flex-direction: column;
    text-align: center;
  }

  .dashboard-stats {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .mission-node,
  .mission-node:nth-child(even) {
    flex-direction: column;
    text-align: center;
  }

  .mission-node:nth-child(even) .mission-node-card {
    margin-left: 0;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand .logo {
    justify-content: center;
  }

  .footer-brand p {
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .header-actions .btn {
    padding: 8px 16px;
    font-size: 0.875rem;
  }

  .quiz-question-card {
    padding: 24px;
  }

  .game-board {
    grid-template-columns: repeat(3, 1fr);
  }

  .drag-game-layout {
    grid-template-columns: 1fr;
  }

  .typing-stats-row,
  .skill-result-stats {
    grid-template-columns: 1fr;
  }

  .game-hud {
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
  }
}

/* ============================================
   Student app — main-content gọn, sát trên
   ============================================ */
body.student-app .main-content {
  padding-top: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

body.student-app .page-content {
  padding: 10px 18px 24px;
}

body.student-app .main-content h1 {
  font-size: 1.35rem;
  line-height: 1.25;
}

body.student-app .main-content h2 {
  font-size: 1.125rem;
  line-height: 1.3;
}

body.student-app .main-content h3 {
  font-size: 1rem;
}

body.student-app .main-content .card {
  padding: 14px 16px;
}

body.student-app .main-content .btn {
  font-size: 0.875rem;
  padding: 8px 16px;
}

body.student-app .main-content .btn-lg {
  font-size: 0.9375rem;
  padding: 10px 20px;
}

body.student-app .main-content .btn-sm {
  font-size: 0.8125rem;
  padding: 6px 12px;
}

@media (max-width: 768px) {
  body.student-app .page-content {
    padding: 8px 12px 20px;
  }
}

/* ============================================
   Khung trang tài khoản — dùng chung
   ============================================ */
.account-page,
.lp-page {
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.account-page .page-title,
.account-page .page-title-compact {
  margin-bottom: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(59, 130, 246, 0.06) 50%, rgba(34, 197, 94, 0.06) 100%);
  border: 2px solid rgba(79, 70, 229, 0.15);
  border-radius: var(--radius-lg);
}

.account-page .page-title h1,
.account-page .page-title-compact h1 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--primary-dark);
  line-height: 1.25;
}

.account-page .page-title p,
.account-page .page-title-compact p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.account-page .timeline.account-timeline {
  max-width: 100%;
}

/* ============================================
   Lộ trình học tập — /account/levels
   ============================================ */

.lp-header {
  margin-bottom: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(59, 130, 246, 0.06) 50%, rgba(34, 197, 94, 0.06) 100%);
  border: 2px solid rgba(79, 70, 229, 0.15);
  border-radius: var(--radius-lg);
}

.lp-header h1 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--primary-dark);
}

.lp-header p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.lp-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.lp-summary-card {
  padding: 12px 14px !important;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 2px solid var(--border);
  background: var(--card);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.lp-summary-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.lp-summary-card__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.lp-summary-card__value {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--primary-dark);
  line-height: 1.2;
}

.lp-summary-card__sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.lp-progress-bar {
  height: 7px;
  background: #e5e7eb;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 6px;
}

.lp-progress-bar--sm {
  height: 5px;
  margin-top: 4px;
}

.lp-progress-bar--lg {
  height: 10px;
  margin-top: 8px;
}

.lp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
  transition: width 0.35s ease;
}

.lp-levels {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lp-level-card {
  padding: 14px 16px !important;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 8px 16px;
  align-items: start;
  border: 2px solid var(--border);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.lp-level-card:hover {
  box-shadow: var(--shadow-md);
}

.lp-level-card__head {
  grid-column: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.lp-level-card__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(34, 197, 94, 0.1));
  border-radius: var(--radius-md);
  border: 2px solid rgba(79, 70, 229, 0.12);
}

.lp-level-card__order {
  margin: 0 0 2px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.lp-level-card__title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
}

.lp-level-card__desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lp-level-card__progress {
  grid-column: 1;
}

.lp-level-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.lp-level-card__meta strong {
  color: var(--primary);
  font-size: 0.875rem;
}

.lp-level-card__xp {
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--secondary-dark);
}

.lp-level-card__status {
  margin: 4px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.lp-level-card__locked {
  grid-column: 1;
}

.lp-level-card__hint {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.lp-level-card__actions {
  grid-column: 2;
  grid-row: 1 / -1;
  display: flex;
  align-items: center;
  align-self: center;
}

.lp-level-card--active {
  border-color: #93c5fd;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, rgba(255, 255, 255, 1) 60%);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
}

.lp-level-card--active .lp-level-card__icon {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-color: #93c5fd;
}

.lp-level-card--active .lp-level-card__status {
  color: #1d4ed8;
}

.lp-level-card--done {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(255, 255, 255, 1) 60%);
}

.lp-level-card--done .lp-level-card__icon {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border-color: rgba(34, 197, 94, 0.3);
}

.lp-level-card--done .lp-level-card__status {
  color: var(--secondary-dark);
}

.lp-level-card--locked {
  opacity: 0.72;
  background: #f8fafc;
}

.lp-level-card--locked .lp-level-card__icon {
  filter: grayscale(0.6);
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.lp-level-card--locked:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.lp-btn-continue {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff !important;
  border: none;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

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

.lp-btn-detail {
  white-space: nowrap;
}

/* Chi tiết level — dùng chung class lp- */
.lp-detail .lp-breadcrumb {
  margin-bottom: 12px;
  font-size: 0.8125rem;
  font-weight: 700;
}

.lp-detail .lp-breadcrumb a {
  color: var(--primary);
}

.lp-detail .lp-breadcrumb a:hover {
  text-decoration: underline;
}

.lp-complete-banner {
  margin-bottom: 12px;
  padding: 16px !important;
  text-align: center;
  border: 2px solid var(--success);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(255, 255, 255, 1));
}

.lp-complete-banner h2 {
  margin-bottom: 6px;
  font-size: 1.15rem;
}

.lp-complete-banner p {
  margin: 0 0 6px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.lp-detail-header {
  margin-bottom: 16px;
  padding: 16px !important;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px 16px;
  align-items: start;
}

.lp-detail-header__icon {
  font-size: 2rem;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(34, 197, 94, 0.1));
  border-radius: var(--radius-md);
}

.lp-detail-header__body h1 {
  font-size: 1.25rem;
  margin: 0 0 4px;
}

.lp-detail-header__stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.lp-detail-stat span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
}

.lp-detail-stat strong {
  font-size: 0.875rem;
}

.lp-detail-header .lp-progress-bar {
  grid-column: 1 / -1;
}

.lp-detail-header .lp-level-card__meta {
  grid-column: 1 / -1;
  margin-top: 0;
}

.lp-missions__title {
  font-size: 1rem;
  margin-bottom: 12px;
}

.lp-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.lp-timeline-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.lp-timeline-item__marker {
  width: 32px;
  height: 32px;
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 50%;
}

.lp-timeline-item--active .lp-timeline-item__marker {
  border-color: var(--primary-light);
  background: rgba(79, 70, 229, 0.1);
}

.lp-timeline-item--done .lp-timeline-item__marker {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
}

.lp-timeline-item__card {
  padding: 12px 14px !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.lp-timeline-item__main h3 {
  margin: 0 0 2px;
  font-size: 0.9375rem;
}

.lp-mission-link {
  color: var(--text);
  font-weight: 800;
}

.lp-mission-link:hover {
  color: var(--primary);
}

.lp-timeline-item__xp {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--secondary-dark);
}

.lp-timeline-item__score {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.lp-btn-start {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
  color: #fff !important;
  border: none;
  font-weight: 800;
}

.lp-mission-status {
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 900px) {
  .lp-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lp-level-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .lp-level-card__actions {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
    padding-top: 4px;
  }

  .lp-detail-header {
    grid-template-columns: auto 1fr;
  }

  .lp-detail-header__stats {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (max-width: 768px) {
  .lp-header {
    padding: 12px 14px;
  }

  .lp-header h1 {
    font-size: 1.15rem;
  }

  .lp-summary {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .lp-summary-card__value {
    font-size: 1rem;
  }

  .lp-level-card__head {
    gap: 10px;
  }

  .lp-level-card__icon {
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
  }

  .lp-level-card__actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .lp-summary {
    grid-template-columns: 1fr;
  }
}

/* --- Gifts Page (public) --- */
.gifts-page {
  padding-top: 88px;
}

.gifts-page__title h1 {
  margin-bottom: 12px;
}

.gifts-page__actions {
  text-align: center;
  margin-top: 32px;
}

.gifts-empty {
  text-align: center;
  padding: 48px 24px;
  max-width: 640px;
  margin: 0 auto;
}

.gifts-empty__icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.card-gift .gift-image img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
}

.section--card {
  background: var(--card);
}

.section--muted {
  background: linear-gradient(
    125deg,
    rgba(79, 70, 229, 0.11) 0%,
    rgba(129, 140, 248, 0.08) 38%,
    rgba(59, 130, 246, 0.07) 72%,
    rgba(34, 211, 238, 0.05) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(129, 140, 248, 0.12);
  border-bottom: 1px solid rgba(59, 130, 246, 0.10);
}

/* --- Nền trang công khai (CauHinh: HinhNenChinh) --- */
body.site-public.site-has-bg {
  background-color: var(--bg);
}

body.site-public.site-has-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--site-bg-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.site-public.site-has-bg::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(244, 247, 251, 0.78);
  pointer-events: none;
}

body.site-public.site-has-bg .header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

body.site-public.site-has-bg .footer {
  background: rgba(255, 255, 255, 0.94);
}