/* ============================================ */
/* ============ RESET & VARIABLES ============= */
/* ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* Hijau utama */
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-darker: #047857;
  --primary-light: #d1fae5;
  --primary-soft: #ecfdf5;
  --primary-glow: rgba(16, 185, 129, 0.25);

  /* Accent */
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --accent-dark: #d97706;

  /* Status */
  --success: #10b981;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #3b82f6;
  --info-light: #dbeafe;

  /* Background */
  --bg: #f0fdf4;
  --bg-soft: #f3f4f6;
  --bg-gradient-1: rgba(16, 185, 129, 0.08);
  --bg-gradient-2: rgba(5, 150, 105, 0.06);
  --bg-gradient-3: rgba(245, 158, 11, 0.05);

  /* Cards */
  --card: #ffffff;
  --card-glass: rgba(255, 255, 255, 0.75);
  --card-glass-border: rgba(255, 255, 255, 0.6);

  /* Text */
  --text: #111827;
  --text-soft: #374151;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.12);
  --shadow-green: 0 8px 24px rgba(16, 185, 129, 0.28);
  --shadow-green-lg: 0 16px 40px rgba(16, 185, 129, 0.35);

  /* Blur */
  --blur: blur(20px);
  --blur-sm: blur(10px);

  /* Radius */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ DARK MODE ============ */
[data-theme="dark"] {
  --primary: #34d399;
  --primary-dark: #10b981;
  --primary-darker: #059669;
  --primary-light: #064e3b;
  --primary-soft: #022c22;
  --primary-glow: rgba(52, 211, 153, 0.3);

  --accent: #fbbf24;
  --accent-light: #451a03;
  --accent-dark: #f59e0b;

  --success: #34d399;
  --danger: #f87171;
  --danger-light: #450a0a;
  --warning: #fbbf24;
  --warning-light: #451a03;
  --info: #60a5fa;
  --info-light: #1e3a8a;

  --bg: #0a0f1a;
  --bg-soft: #1e293b;
  --bg-gradient-1: rgba(52, 211, 153, 0.12);
  --bg-gradient-2: rgba(16, 185, 129, 0.08);
  --bg-gradient-3: rgba(251, 191, 36, 0.06);

  --card: #131c2e;
  --card-glass: rgba(19, 28, 46, 0.8);
  --card-glass-border: rgba(255, 255, 255, 0.08);

  --text: #f1f5f9;
  --text-soft: #cbd5e1;
  --muted: #94a3b8;
  --border: #1e293b;
  --border-strong: #334155;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.7);
  --shadow-green: 0 8px 24px rgba(52, 211, 153, 0.35);
  --shadow-green-lg: 0 16px 40px rgba(52, 211, 153, 0.45);
}

html, body { height: 100%; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 0% 0%, var(--bg-gradient-1) 0%, transparent 45%),
    radial-gradient(circle at 100% 100%, var(--bg-gradient-2) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, var(--bg-gradient-3) 0%, transparent 60%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s, color 0.4s;
  line-height: 1.5;
}

.hidden { display: none !important; }

/* ============================================ */
/* ============ TOPBAR (MODERN) =============== */
/* ============================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(16, 185, 129, 0.06);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
}
.logo:active { transform: scale(0.96); }

.logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: var(--shadow-green);
  transition: var(--transition);
}
.logo:hover .logo-img {
  transform: rotate(-5deg) scale(1.05);
  box-shadow: var(--shadow-green-lg);
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--primary-darker));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-green);
}

.logo-text {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.logo-text b {
  color: var(--primary);
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--primary-darker));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topbar-right { display: flex; gap: 8px; align-items: center; }

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-soft);
  font-weight: 700;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.icon-btn:active { transform: scale(0.9); }
.icon-btn:hover {
  background: var(--primary-light);
  color: var(--primary-darker);
  transform: translateY(-2px);
  box-shadow: var(--shadow-green);
}
.icon-btn.role-active {
  background: linear-gradient(135deg, var(--primary), var(--primary-darker));
  color: white;
  font-size: 13px;
  width: auto;
  padding: 0 16px;
  box-shadow: var(--shadow-green);
}
.theme-toggle {
  background: linear-gradient(135deg, var(--primary), var(--primary-darker));
  color: white;
  box-shadow: var(--shadow-green);
}
.theme-toggle:hover {
  transform: rotate(20deg) scale(1.05);
  color: white;
  box-shadow: var(--shadow-green-lg);
}

/* ============================================ */
/* ============ PAGE SYSTEM =================== */
/* ============================================ */
.page {
  display: none;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px;
  padding-bottom: 50px;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

@keyframes slideArrow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -20px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ============================================ */
/* ============ HOME (MODERN HIJAU) =========== */
/* ============================================ */
.hero {
  position: relative;
  padding: 40px 20px 32px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg,
    rgba(16, 185, 129, 0.15) 0%,
    rgba(5, 150, 105, 0.10) 40%,
    rgba(245, 158, 11, 0.08) 100%);
  margin-bottom: 24px;
  overflow: hidden;
  text-align: center;
  border: 2px solid rgba(16, 185, 129, 0.15);
  box-shadow: 0 12px 40px rgba(16, 185, 129, 0.12);
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite reverse;
}

.hero-badge {
  display: inline-block;
  background: white;
  color: var(--primary-darker);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 100px;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(16, 185, 129, 0.2);
  letter-spacing: 0.3px;
}

.hero h1 {
  font-size: 38px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 14px;
  color: var(--text);
  position: relative;
  z-index: 1;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  font-weight: 500;
}

/* ============ ROLE CARDS (MODERN) ============ */
.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.role-card {
  border-radius: var(--radius-lg);
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  box-shadow: var(--shadow-md);
}

.role-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  opacity: 0;
  transition: opacity 0.3s;
}

.role-card:active { transform: scale(0.96); }
.role-card:hover { transform: translateY(-6px); }
.role-card:hover::before { opacity: 1; }

.role-card.guru {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #a7f3d0;
}
.role-card.guru::before { background: linear-gradient(90deg, #10b981, #059669); }
.role-card.guru:hover {
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.3);
  border-color: var(--primary);
}

.role-card.siswa {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #bfdbfe;
}
.role-card.siswa::before { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.role-card.siswa:hover {
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
  border-color: #3b82f6;
}

.role-icon {
  font-size: 52px;
  margin-bottom: 14px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}
.role-icon.big { font-size: 72px; margin-bottom: 16px; }

.role-card h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text);
  letter-spacing: -0.3px;
}
.role-card p {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.4;
  font-weight: 500;
}

/* ============ TEMPLATE BANNER (WOW EFFECT) ============ */
.template-banner {
  background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-green-lg);
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.template-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 250px;
  height: 250px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  transition: transform 0.6s;
}

.template-banner::after {
  content: '';
  position: absolute;
  bottom: -60%;
  left: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.template-banner:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 50px rgba(16, 185, 129, 0.5);
}
.template-banner:hover::before {
  transform: scale(1.3);
}
.template-banner:active { transform: scale(0.98); }

.template-banner-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  position: relative;
  z-index: 1;
}

.template-emoji {
  font-size: 42px;
  background: rgba(255, 255, 255, 0.25);
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

.template-banner h3 {
  color: white !important;
  font-size: 17px;
  font-weight: 900;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.template-banner p {
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 12px;
  font-weight: 600;
}

.template-arrow {
  color: white;
  font-size: 22px;
  font-weight: 900;
  position: relative;
  z-index: 1;
  animation: slideArrow 1.5s ease-in-out infinite;
}

/* ============ INFO BANNER ============ */
.info-banner {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.info-item {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.info-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.info-icon {
  font-size: 30px;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.info-item:nth-child(1) .info-icon {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}
.info-item:nth-child(2) .info-icon {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}
.info-item:nth-child(3) .info-icon {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.info-item h4 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 3px;
  color: var(--text);
  letter-spacing: -0.2px;
}
.info-item small {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}

/* ============ HOME ACTIONS ============ */
.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.home-actions button {
  margin-top: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(236, 253, 245, 0.95));
  border: 2px solid var(--primary-light);
  color: var(--primary-darker);
  font-weight: 800;
  padding: 16px;
  font-size: 14px;
}
.home-actions button:hover {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  transform: translateY(-3px);
  box-shadow: var(--shadow-green);
  color: var(--primary-darker);
  border-color: var(--primary);
}

/* ============ FORM CARD (GLASSMORPHISM) ============ */
.form-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  box-shadow: var(--shadow-lg);
  margin-top: 16px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.form-card.glass {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
}
.form-card.center { text-align: center; }
.form-card.wide { padding: 26px; }

.form-card h2 {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -0.6px;
  color: var(--text);
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.5;
  font-weight: 500;
}

.role-icon.big { text-align: center; margin-bottom: 14px; }
.role-icon.guru-bg,
.role-icon.siswa-bg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  border-radius: 26px;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-md);
}
.role-icon.guru-bg {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}
.role-icon.siswa-bg {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin: 18px 0 8px;
  color: var(--text-soft);
  letter-spacing: 0.2px;
}
label:first-of-type { margin-top: 8px; }

input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 15px 18px;
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  transition: var(--transition);
  background: var(--card);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
  transform: translateY(-1px);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  font-weight: 500;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

/* ============================================ */
/* ============ BUTTONS (MODERN) ============== */
/* ============================================ */
.btn-primary,
.btn-secondary {
  width: 100%;
  padding: 16px 22px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 16px;
  transition: var(--transition);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
  color: white;
  box-shadow: var(--shadow-green);
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}
.btn-primary:hover::before { left: 100%; }
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-green-lg);
}
.btn-primary:active { transform: translateY(-1px) scale(0.98); }

.btn-secondary {
  background: var(--bg-soft);
  color: var(--text-soft);
  border: 2px solid var(--border);
}
.btn-secondary:hover {
  background: var(--primary-light);
  color: var(--primary-darker);
  border-color: var(--primary);
  transform: translateY(-3px);
}
.btn-secondary:active { transform: translateY(-1px) scale(0.98); }

.big-btn {
  padding: 20px;
  font-size: 16px;
  border-radius: 16px;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.btn-row button {
  margin-top: 0;
  flex: 1;
  font-size: 13.5px;
  padding: 15px 10px;
}

/* ============================================ */
/* ============ AUTH TABS ===================== */
/* ============================================ */
.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-soft);
  padding: 6px;
  border-radius: 14px;
  margin-bottom: 22px;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--muted);
  transition: var(--transition);
  font-family: inherit;
}

.auth-tab.active {
  background: var(--card);
  color: var(--primary-darker);
  box-shadow: var(--shadow-sm);
}

.note {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 14px;
  text-align: center;
  line-height: 1.5;
  font-weight: 500;
}

/* ============================================ */
/* ============ DASHBOARD HEADER (GURU) ======= */
/* ============================================ */
.dash-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-green-lg);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.dash-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -15%;
  width: 250px;
  height: 250px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.dash-header::after {
  content: '';
  position: absolute;
  bottom: -60%;
  left: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.dash-user {
  display: flex;
  gap: 16px;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.dash-avatar {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dash-header h2 {
  font-size: 18px;
  margin-bottom: 4px;
  font-weight: 900;
  letter-spacing: -0.3px;
}
.dash-header p {
  font-size: 13px;
  opacity: 0.95;
  font-weight: 500;
}

.dash-logout {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}
.dash-logout:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}
.dash-logout:active { transform: scale(0.95); }

/* ============ SISWA HEADER (BIRU-HIJAU) ============ */
.siswa-header {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #10b981 100%) !important;
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.3) !important;
}
.siswa-avatar { background: rgba(255, 255, 255, 0.25); }

/* ============================================ */
/* ============ DASHBOARD STATS =============== */
/* ============================================ */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s;
}

.stat-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-green);
}
.stat-box:hover::before { opacity: 1; }

.stat-icon {
  font-size: 22px;
  margin-bottom: 8px;
  display: block;
}

.stat-box span {
  font-size: 26px;
  font-weight: 900;
  color: var(--primary-darker);
  display: block;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.stat-box small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================ */
/* ============ TAB NAV (MODERN) ============== */
/* ============================================ */
.tab-nav {
  display: flex;
  gap: 6px;
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  padding: 6px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-nav-btn {
  flex: 1;
  min-width: fit-content;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.tab-nav-btn:hover {
  background: var(--primary-light);
  color: var(--primary-darker);
}

.tab-nav-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
  color: white;
  box-shadow: var(--shadow-green);
  transform: translateY(-1px);
}

/* ============================================ */
/* ============ CLASS CARD ==================== */
/* ============================================ */
.class-card {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border-left: 6px solid var(--primary);
  margin-bottom: 14px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.class-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.class-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-green);
  border-left-width: 8px;
}
.class-card:hover::before { opacity: 1; }
.class-card:active { transform: translateY(-2px) scale(0.99); }

.class-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.class-card h4 {
  font-size: 17px;
  font-weight: 900;
  margin-bottom: 5px;
  color: var(--text);
  letter-spacing: -0.4px;
}

.class-card .teacher-name {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 600;
}

.class-card .class-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-soft);
  position: relative;
  z-index: 1;
}

.class-card .class-meta span {
  background: var(--bg-soft);
  padding: 5px 12px;
  border-radius: 10px;
  font-weight: 700;
  border: 1px solid var(--border);
}

.class-code-badge {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
  box-shadow: var(--shadow-green);
  position: relative;
  z-index: 1;
}

/* ============================================ */
/* ============ CLASS DETAIL HEADER =========== */
/* ============================================ */
.class-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px 0;
}

.class-detail-header h2 {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.class-detail-header p {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* ============================================ */
/* ============ CLASS CODE BOX ================ */
/* ============================================ */
.class-code-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
  border-radius: var(--radius-xl);
  padding: 26px;
  margin-bottom: 20px;
  text-align: center;
  color: white;
  box-shadow: var(--shadow-green-lg);
  position: relative;
  overflow: hidden;
}

.class-code-box::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.class-code-box::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.class-code-label {
  font-size: 12px;
  font-weight: 800;
  opacity: 0.95;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
  letter-spacing: 0.3px;
}

.class-code-value {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 8px;
  margin-bottom: 20px;
  font-family: 'Courier New', monospace;
  position: relative;
  z-index: 1;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: pulse 3s infinite;
}

.class-code-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.class-code-actions button {
  margin-top: 0;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  color: white;
  box-shadow: none;
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 13.5px;
}
.class-code-actions button:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================ */
/* ============ MEMBER ITEM =================== */
/* ============================================ */
.member-item {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.member-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--primary);
}

.member-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-light));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  border: 2px solid var(--primary-light);
}

.member-info { flex: 1; min-width: 0; }
.member-info h4 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 3px;
  letter-spacing: -0.2px;
}
.member-info small {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.member-level {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
  color: white;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--shadow-green);
}

/* ============================================ */
/* ============ GAME CARD (STUDENT VIEW) ====== */
/* ============================================ */
.game-card-student {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.game-card-student::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  transition: width 0.3s;
}

.game-card-student:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-green);
  border-color: var(--primary-light);
}
.game-card-student:hover::before { width: 10px; }
.game-card-student:active { transform: translateY(-2px) scale(0.99); }

.game-card-student .game-emoji {
  font-size: 36px;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-light));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--primary-light);
}

.game-card-student .game-info { flex: 1; min-width: 0; }
.game-card-student .game-info h4 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 5px;
  letter-spacing: -0.3px;
  color: var(--text);
}
.game-card-student .game-info small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.game-card-student .game-play-icon {
  font-size: 22px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-darker));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-green);
  transition: var(--transition);
}
.game-card-student:hover .game-play-icon {
  transform: scale(1.1) rotate(5deg);
}

/* ============================================ */
/* ============ GAME CARD (GURU VIEW) ========= */
/* ============================================ */
.game-list { display: grid; gap: 14px; }

.game-card {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border-left: 6px solid var(--primary);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.game-card.draft { border-left-color: var(--warning); }
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-green);
}

.game-card h4 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.game-card .meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.game-card .meta span {
  background: var(--bg-soft);
  padding: 5px 11px;
  border-radius: 9px;
  font-weight: 700;
  border: 1px solid var(--border);
}

.game-card .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.game-card .actions button {
  flex: 1;
  min-width: 72px;
  padding: 11px 10px;
  font-size: 12.5px;
  border-radius: 11px;
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-family: inherit;
  transition: var(--transition-fast);
}
.game-card .actions button:hover {
  transform: translateY(-2px);
}

.btn-mini-primary {
  background: linear-gradient(135deg, var(--primary-light), #a7f3d0);
  color: var(--primary-darker);
}
.btn-mini-primary:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.btn-mini-secondary {
  background: var(--bg-soft);
  color: var(--text-soft);
}
.btn-mini-secondary:hover {
  background: var(--info-light);
  color: var(--info);
}

.btn-mini-danger {
  background: var(--danger-light);
  color: var(--danger);
}
.btn-mini-danger:hover {
  background: var(--danger);
  color: white;
}

.published-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--primary-darker));
  color: white;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 800;
  box-shadow: var(--shadow-green);
}
.draft-badge {
  display: inline-block;
  background: var(--warning-light);
  color: #92400e;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 800;
}

/* ============================================ */
/* ============ GAME TYPE GRID ================ */
/* ============================================ */
.game-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.game-type {
  background: var(--bg-soft);
  padding: 16px 8px;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}
.game-type:hover {
  background: var(--primary-soft);
  transform: translateY(-3px);
}
.game-type:active { transform: translateY(-1px) scale(0.97); }
.game-type.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-light));
  box-shadow: var(--shadow-green);
}

.game-type .gt-icon {
  font-size: 28px;
  margin-bottom: 8px;
  display: block;
  transition: var(--transition);
}
.game-type:hover .gt-icon { transform: scale(1.15); }

.game-type span {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-soft);
  line-height: 1.3;
  display: block;
  letter-spacing: 0.2px;
}
.game-type.selected span { color: var(--primary-darker); }

/* ============================================ */
/* ============ SOAL INPUTS =================== */
/* ============================================ */
.soal-block {
  background: linear-gradient(135deg, var(--bg-soft) 0%, rgba(236, 253, 245, 0.5) 100%);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.soal-block:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}
.soal-block h4 {
  font-size: 12.5px;
  margin-bottom: 12px;
  color: var(--primary-darker);
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.soal-block input,
.soal-block select {
  margin-bottom: 10px;
  background: var(--card);
  font-size: 14px;
  padding: 12px 14px;
}

/* ============================================ */
/* ============ BIG CODE (KODE GAME) ========== */
/* ============================================ */
.big-code {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--primary-darker);
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-light));
  padding: 26px 20px;
  border-radius: var(--radius-lg);
  margin: 24px 0;
  text-align: center;
  border: 3px dashed var(--primary);
  font-family: 'Courier New', monospace;
  animation: pulse 2s infinite;
}

.success-icon {
  font-size: 72px;
  margin-bottom: 12px;
  animation: bounce 0.8s ease;
}

/* ============================================ */
/* ============ PLAY AREA ===================== */
/* ============================================ */
.play-header {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.play-header h3 {
  font-size: 16px;
  margin-bottom: 14px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.play-meta {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-soft);
}
.play-meta .meta-highlight {
  color: var(--primary-darker);
  background: var(--primary-light);
  padding: 3px 12px;
  border-radius: 100px;
}

.play-progress {
  background: var(--bg-soft);
  height: 10px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.play-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  border-radius: 10px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px var(--primary-glow);
}

.question-card {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius-xl);
  padding: 28px 22px;
  box-shadow: var(--shadow-md);
}

.question-card h2 {
  font-size: 17px;
  line-height: 1.5;
  margin-bottom: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
}

/* ============ ANSWER BUTTONS ============ */
.answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-btn {
  background: var(--bg-soft);
  border: 2px solid transparent;
  padding: 18px 18px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  gap: 14px;
  align-items: center;
  transition: var(--transition);
  font-family: inherit;
  color: var(--text-soft);
  position: relative;
  overflow: hidden;
}

.answer-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  transform: scaleY(0);
  transition: transform 0.3s;
}

.answer-btn:hover {
  transform: translateX(4px);
  border-color: var(--primary-light);
  background: var(--primary-soft);
}
.answer-btn:hover::before { transform: scaleY(1); }
.answer-btn:active { transform: translateX(2px) scale(0.99); }

.answer-btn .label {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  color: var(--primary-darker);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.answer-btn.correct {
  background: linear-gradient(135deg, var(--primary-light), #a7f3d0);
  border-color: var(--primary);
  color: var(--primary-darker);
  transform: translateX(4px);
}
.answer-btn.correct .label {
  background: var(--primary);
  color: white;
}

.answer-btn.wrong {
  background: var(--danger-light);
  border-color: var(--danger);
  color: #991b1b;
}
.answer-btn.wrong .label {
  background: var(--danger);
  color: white;
}

.answer-btn.disabled {
  pointer-events: none;
  opacity: 0.6;
}
.answer-btn.disabled.correct,
.answer-btn.disabled.wrong { opacity: 1; }

.feedback-msg {
  text-align: center;
  font-size: 17px;
  font-weight: 900;
  padding: 16px;
  border-radius: var(--radius);
  margin-top: 20px;
  animation: scaleIn 0.3s;
  letter-spacing: -0.3px;
}
.feedback-msg.benar {
  color: var(--primary-darker);
  background: linear-gradient(135deg, var(--primary-light), #a7f3d0);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.feedback-msg.salah {
  color: #991b1b;
  background: var(--danger-light);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* ============================================ */
/* ============ RESULT CARD =================== */
/* ============================================ */
.result-card {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius-xl);
  padding: 40px 26px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin-top: 16px;
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  border-radius: 50%;
}

.result-card h1 {
  font-size: 24px;
  margin-bottom: 8px;
  font-weight: 900;
  letter-spacing: -0.5px;
  position: relative;
  z-index: 1;
}

.score-circle {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 24px auto;
  box-shadow: var(--shadow-green-lg);
  animation: scaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
  border: 6px solid rgba(255, 255, 255, 0.2);
}

.score-value {
  font-size: 64px;
  font-weight: 900;
  color: white;
  line-height: 1;
  letter-spacing: -3px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.score-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 4px;
  margin-top: 8px;
  font-weight: 900;
}

.grade-badge {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 100px;
  font-size: 24px;
  font-weight: 900;
  color: white;
  margin-bottom: 10px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  letter-spacing: 1px;
}
.grade-badge.A { background: linear-gradient(135deg, #10b981, #059669); }
.grade-badge.B { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.grade-badge.C { background: linear-gradient(135deg, #f59e0b, #d97706); }
.grade-badge.D { background: linear-gradient(135deg, #f97316, #ea580c); }
.grade-badge.E { background: linear-gradient(135deg, #ef4444, #dc2626); }

.grade-text {
  color: var(--text-soft);
  font-size: 15px;
  margin-bottom: 26px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.stat-cell {
  background: var(--bg-soft);
  padding: 16px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.stat-cell:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-light);
}

.stat-cell span {
  font-size: 24px;
  font-weight: 900;
  color: var(--primary-darker);
  display: block;
  line-height: 1.1;
  margin-bottom: 4px;
}
.stat-cell small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================ */
/* ============ REVIEW (KOREKSI) ============== */
/* ============================================ */
.review-item {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  border-left: 6px solid var(--primary);
  transition: var(--transition);
}
.review-item.wrong-item { border-left-color: var(--danger); }
.review-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.review-header-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.review-num {
  font-size: 11.5px;
  font-weight: 900;
  color: var(--muted);
  background: var(--bg-soft);
  padding: 6px 14px;
  border-radius: 100px;
  letter-spacing: 0.3px;
}

.review-status {
  font-size: 13.5px;
  font-weight: 900;
}
.review-status.benar { color: var(--primary-darker); }
.review-status.salah { color: var(--danger); }

.review-question {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 14px;
  line-height: 1.5;
  color: var(--text);
  letter-spacing: -0.2px;
}

.review-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.review-answer {
  font-size: 13px;
  padding: 11px 14px;
  border-radius: 11px;
  background: var(--bg-soft);
  color: var(--muted);
  font-weight: 600;
  border: 1px solid var(--border);
}
.review-answer.correct-answer {
  background: linear-gradient(135deg, var(--primary-light), #a7f3d0);
  color: var(--primary-darker);
  font-weight: 800;
  border-color: var(--primary);
}
.review-answer.your-wrong {
  background: var(--danger-light);
  color: #991b1b;
  font-weight: 800;
  border-color: var(--danger);
}

.review-explanation {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--warning-light), #fde68a);
  border-radius: 12px;
  font-size: 13px;
  color: #78350f;
  line-height: 1.6;
  border-left: 4px solid var(--warning);
  font-weight: 500;
}
.review-explanation strong { color: #451a03; }

/* ============================================ */
/* ============ MATCHING GAME ================= */
/* ============================================ */
.match-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.match-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-item {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-soft);
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.match-item:hover {
  transform: translateY(-3px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}
.match-item:active { transform: translateY(-1px) scale(0.98); }

.match-item.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-light));
  color: var(--primary-darker);
  box-shadow: var(--shadow-green);
  transform: translateY(-3px);
}

.match-item.matched {
  background: linear-gradient(135deg, var(--primary-light), #a7f3d0);
  border-color: var(--primary);
  color: var(--primary-darker);
  pointer-events: none;
  font-weight: 900;
  opacity: 0.75;
  box-shadow: var(--shadow-green);
}

.match-item.wrong-flash {
  animation: shake 0.4s;
  border-color: var(--danger);
  background: var(--danger-light);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ============================================ */
/* ============ SCRAMBLE GAME ================= */
/* ============================================ */
.scramble-word {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0;
}

.scramble-letter {
  width: 48px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
  color: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-green);
  user-select: none;
}
.scramble-letter:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--shadow-green-lg);
}
.scramble-letter:active { transform: scale(0.95); }
.scramble-letter.used {
  background: var(--border);
  color: var(--muted);
  pointer-events: none;
  box-shadow: none;
  opacity: 0.5;
}

.scramble-answer {
  min-height: 68px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  border: 2px dashed var(--border);
}

.scramble-slot {
  width: 48px;
  height: 56px;
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
  cursor: pointer;
  color: var(--primary-darker);
  transition: var(--transition-fast);
}
.scramble-slot:hover { border-color: var(--primary-light); }
.scramble-slot.filled {
  border-style: solid;
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: var(--shadow-sm);
}

/* ============================================ */
/* ============ TRUE/FALSE GAME =============== */
/* ============================================ */
.tf-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

.tf-btn {
  padding: 32px 14px;
  border-radius: var(--radius-lg);
  border: none;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
}
.tf-btn .tf-icon { font-size: 44px; }
.tf-btn.tf-true {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
  box-shadow: var(--shadow-green);
}
.tf-btn.tf-false {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 12px 32px rgba(239, 68, 68, 0.35);
}
.tf-btn:hover {
  transform: translateY(-6px) scale(1.02);
}
.tf-btn:active { transform: translateY(-2px) scale(0.98); }

.tf-btn.selected-correct {
  outline: 6px solid var(--primary-light);
  outline-offset: 4px;
}
.tf-btn.selected-wrong {
  outline: 6px solid #fecaca;
  outline-offset: 4px;
}
.tf-btn.disabled {
  pointer-events: none;
  opacity: 0.55;
}
.tf-btn.disabled.selected-correct,
.tf-btn.disabled.selected-wrong { opacity: 1; }

/* ============================================ */
/* ============ SPEED QUIZ ==================== */
/* ============================================ */
.speed-timer {
  height: 12px;
  background: var(--bg-soft);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 12px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}
.speed-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--warning), var(--danger));
  width: 100%;
  transition: width 0.1s linear;
  border-radius: 10px;
}

/* ============================================ */
/* ============ WHEEL GAME ==================== */
/* ============================================ */
.wheel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
}

.wheel-wrap {
  position: relative;
  width: 300px;
  height: 300px;
  margin-bottom: 24px;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: var(--shadow-xl);
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  position: relative;
  overflow: hidden;
  border: 8px solid var(--card);
}

.wheel-slice-label {
  position: absolute;
  top: 50%;
  left: 50%;
  font-weight: 900;
  color: white;
  font-size: 26px;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 3;
}

.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 36px solid var(--danger);
  z-index: 10;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  background: var(--card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: var(--shadow-lg);
  z-index: 5;
  cursor: pointer;
  border: 5px solid var(--primary);
  transition: var(--transition);
}
.wheel-center:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: var(--shadow-green-lg);
}
.wheel-center:active {
  transform: translate(-50%, -50%) scale(0.95);
}

/* ============================================ */
/* ============ PROFILE CARD ================== */
/* ============================================ */
.profile-card {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
  opacity: 0.3;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  margin: 0 auto 16px;
  cursor: pointer;
  transition: var(--transition);
  border: 5px solid var(--primary);
  box-shadow: var(--shadow-green);
  position: relative;
  z-index: 1;
}
.profile-avatar:hover {
  transform: scale(1.08) rotate(5deg);
  box-shadow: var(--shadow-green-lg);
}

.profile-card h3 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  letter-spacing: -0.5px;
}

.profile-bio {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 18px;
  font-style: italic;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.profile-card .btn-secondary {
  margin-top: 0;
  width: auto;
  padding: 10px 24px;
  display: inline-flex;
  font-size: 13.5px;
  position: relative;
  z-index: 1;
}

.profile-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

/* ============================================ */
/* ============ BADGE SECTION ================= */
/* ============================================ */
.badge-section {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.badge-section h3 {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 18px;
  color: var(--primary-darker);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.3px;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.badge-item {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  transition: var(--transition);
  border: 2px solid transparent;
}
.badge-item:hover { transform: translateY(-4px); }

.badge-item.unlocked {
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-light));
  border-color: var(--primary);
  box-shadow: var(--shadow-green);
}
.badge-item.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.badge-icon {
  font-size: 36px;
  margin-bottom: 8px;
  display: block;
}
.badge-item.unlocked .badge-icon {
  animation: bounce 2s infinite;
}

.badge-name {
  font-size: 11px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 3px;
  letter-spacing: 0.2px;
}
.badge-desc {
  font-size: 9.5px;
  color: var(--muted);
  line-height: 1.3;
  font-weight: 600;
}

/* ============================================ */
/* ============ HISTORY ITEM ================== */
/* ============================================ */
.history-item {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border-left: 6px solid var(--primary);
  margin-bottom: 12px;
  transition: var(--transition);
}
.history-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 14px;
}

.history-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  flex: 1;
  line-height: 1.4;
  letter-spacing: -0.2px;
}

.history-score {
  padding: 8px 18px;
  border-radius: 100px;
  font-weight: 900;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}
.history-score.grade-A { background: linear-gradient(135deg, #10b981, #059669); }
.history-score.grade-B { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.history-score.grade-C { background: linear-gradient(135deg, #f59e0b, #d97706); }
.history-score.grade-D { background: linear-gradient(135deg, #f97316, #ea580c); }
.history-score.grade-E { background: linear-gradient(135deg, #ef4444, #dc2626); }

.history-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.history-meta span {
  background: var(--bg-soft);
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
  border: 1px solid var(--border);
}

.history-date {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

/* ============================================ */
/* ============ RANKING ======================= */
/* ============================================ */
.rank-item {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
  transition: var(--transition);
}
.rank-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.rank-item.me {
  border-color: var(--primary);
  border-width: 2px;
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-light));
  box-shadow: var(--shadow-green);
}

.rank-number {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  color: var(--text-soft);
  flex-shrink: 0;
}
.rank-item:nth-child(1) .rank-number {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}
.rank-item:nth-child(2) .rank-number {
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
  color: white;
}
.rank-item:nth-child(3) .rank-number {
  background: linear-gradient(135deg, #d97706, #92400e);
  color: white;
}

.rank-info { flex: 1; min-width: 0; }
.rank-name {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}
.rank-level {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}
.rank-score {
  font-weight: 900;
  font-size: 22px;
  color: var(--primary-darker);
  flex-shrink: 0;
  letter-spacing: -0.5px;
}

/* ============================================ */
/* ============ EMPTY STATE =================== */
/* ============================================ */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
}
.empty-state .empty-emoji {
  font-size: 72px;
  margin-bottom: 14px;
  opacity: 0.7;
  display: block;
}
.empty-state h4 {
  font-size: 17px;
  color: var(--text-soft);
  margin-bottom: 8px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.empty-state p {
  font-size: 13.5px;
  line-height: 1.6;
  font-weight: 500;
}

.mini-empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
  font-size: 14px;
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  font-weight: 600;
}
.mini-empty .emoji {
  font-size: 48px;
  display: block;
  margin-bottom: 10px;
  opacity: 0.6;
}

/* ============================================ */
/* ============ STATISTIK ===================== */
/* ============================================ */
.stats-card {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.stats-card h3 {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 16px;
  color: var(--primary-darker);
  letter-spacing: -0.3px;
}
.stats-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
  font-weight: 600;
}
.stats-row:last-child { border-bottom: none; }
.stats-row .label { color: var(--muted); }
.stats-row .value { font-weight: 900; color: var(--primary-darker); }

.bar-chart {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  height: 130px;
  padding-top: 14px;
}
.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--primary), var(--primary-darker));
  border-radius: 8px 8px 0 0;
  min-height: 4px;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 12px var(--primary-glow);
}
.bar-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}
.bar-value {
  font-size: 12px;
  font-weight: 900;
  color: var(--primary-darker);
}

/* ============================================ */
/* ============ HEADER (CREATE) =============== */
/* ============================================ */
.create-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  margin-top: 10px;
}
.section-header h3 {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.3px;
}
.section-header small {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 700;
}

/* ============================================ */
/* ============ TOAST NOTIFICATION ============ */
/* ============================================ */
.toast-container {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 440px;
}

.toast {
  background: var(--card-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-height: 60px;
}
.toast::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 5px;
}
.toast-success::before { background: linear-gradient(180deg, #10b981, #059669); }
.toast-error::before { background: linear-gradient(180deg, #ef4444, #dc2626); }
.toast-warning::before { background: linear-gradient(180deg, #f59e0b, #d97706); }
.toast-info::before { background: linear-gradient(180deg, #3b82f6, #2563eb); }

.toast-icon {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}
.toast-message {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.toast-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  flex-shrink: 0;
  font-weight: 900;
  transition: var(--transition-fast);
  font-family: inherit;
}
.toast-close:hover {
  background: var(--bg-soft);
  color: var(--text);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.toast-out {
  animation: toastOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-30px) scale(0.9); }
}
.toast-container .toast:nth-child(n+4) { display: none; }

/* ============================================ */
/* ============ MODAL ========================= */
/* ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s;
}

.modal-content {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 32px 26px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: scaleIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 1px solid var(--border);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-soft);
  font-weight: 900;
  font-family: inherit;
  transition: var(--transition-fast);
}
.modal-close:hover {
  background: var(--danger-light);
  color: var(--danger);
  transform: rotate(90deg);
}

.qr-container {
  padding: 22px;
  background: white;
  border-radius: var(--radius);
  margin: 22px auto;
  display: inline-block;
  box-shadow: var(--shadow-lg);
}
.qr-container img,
.qr-container canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.qr-url {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 18px;
  word-break: break-all;
  padding: 12px;
  background: var(--bg-soft);
  border-radius: 10px;
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

/* ============================================ */
/* ============ AVATAR PICKER ================= */
/* ============================================ */
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 12px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.avatar-option {
  aspect-ratio: 1;
  background: var(--card);
  border: 2px solid transparent;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}
.avatar-option:hover {
  transform: scale(1.12);
  border-color: var(--primary-light);
}
.avatar-option.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-light));
  transform: scale(1.08);
  box-shadow: var(--shadow-green);
}

.avatar-modal-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 10px;
}
.avatar-modal-grid .avatar-option { font-size: 30px; }

/* ============================================ */
/* ============ LEVEL UP MODAL ================ */
/* ============================================ */
.levelup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s;
}

.levelup-content {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
  border-radius: var(--radius-xl);
  padding: 48px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  color: white;
  box-shadow: 0 20px 60px rgba(16, 185, 129, 0.5);
  animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.levelup-content::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  animation: rotate 10s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.levelup-emoji {
  font-size: 84px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  animation: bounce 0.8s infinite;
}

.levelup-content h1 {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 3px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.levelup-badge {
  width: 120px;
  height: 120px;
  background: white;
  color: var(--primary-darker);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: 900;
  margin: 0 auto 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  animation: pulse 1.5s infinite;
  border: 6px solid rgba(255, 255, 255, 0.4);
}

.levelup-title {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.levelup-subtitle {
  font-size: 14px;
  opacity: 0.95;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
  font-weight: 600;
  line-height: 1.5;
}

.levelup-content .btn-primary {
  background: white;
  color: var(--primary-darker);
  position: relative;
  z-index: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-weight: 900;
}
.levelup-content .btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  background: white;
  color: var(--primary-darker);
}

/* ============================================ */
/* ============ RESPONSIVE ==================== */
/* ============================================ */
@media (min-width: 600px) {
  .page { padding: 24px; }
  .hero h1 { font-size: 44px; }
  .hero p { font-size: 16px; max-width: 480px; }
  .role-cards { gap: 18px; }
  .role-card { padding: 32px 20px; }
  .role-card h3 { font-size: 18px; }
  .game-type-grid { grid-template-columns: repeat(5, 1fr); }
  .wheel-wrap { width: 340px; height: 340px; }
  .score-circle { width: 210px; height: 210px; }
  .score-value { font-size: 72px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 30px; }
  .hero { padding: 28px 16px 24px; }
  .hero p { font-size: 13.5px; }
  .page { padding: 14px; }
  .form-card { padding: 24px 18px; }
  .form-card h2 { font-size: 22px; }
  .dash-header { padding: 18px; }
  .dash-avatar { width: 48px; height: 48px; font-size: 24px; }
  .dash-header h2 { font-size: 16px; }
  .stat-box span { font-size: 22px; }
  .stat-box small { font-size: 10px; }
  .class-code-value { font-size: 32px; letter-spacing: 4px; }
  .avatar-picker { grid-template-columns: repeat(5, 1fr); }
  .avatar-option { font-size: 20px; }
  .avatar-modal-grid { grid-template-columns: repeat(4, 1fr); }
  .avatar-modal-grid .avatar-option { font-size: 26px; }
  .profile-avatar { width: 100px; height: 100px; font-size: 52px; }
  .levelup-badge { width: 100px; height: 100px; font-size: 52px; }
  .levelup-content h1 { font-size: 28px; }
  .home-actions { grid-template-columns: 1fr; }
  .score-circle { width: 160px; height: 160px; }
  .score-value { font-size: 52px; }
  .grade-badge { font-size: 20px; padding: 10px 26px; }
  .big-code { font-size: 28px; letter-spacing: 4px; padding: 20px 16px; }
  .tf-btn { padding: 24px 10px; font-size: 18px; }
  .tf-btn .tf-icon { font-size: 36px; }
  .game-card-student .game-emoji { width: 54px; height: 54px; font-size: 30px; }
  .game-card-student .game-play-icon { width: 38px; height: 38px; }
  .class-card { padding: 16px; }
  .class-code-badge { font-size: 13px; padding: 6px 12px; letter-spacing: 1.5px; }
  .wheel-wrap { width: 260px; height: 260px; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 26px; }
  .role-cards { grid-template-columns: 1fr; }
  .game-type span { font-size: 10px; }
  .game-type .gt-icon { font-size: 24px; }
  .score-value { font-size: 46px; }
  .score-circle { width: 150px; height: 150px; }
  .class-code-value { font-size: 26px; letter-spacing: 3px; }
  .avatar-picker { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================ */
/* ============ INFO ITEM CLICKABLE =========== */
/* ============================================ */
.info-item {
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-item:hover {
  transform: translateY(-3px) translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.info-item:active {
  transform: translateY(-1px) scale(0.98);
}

.info-arrow {
  color: var(--primary);
  font-size: 22px;
  font-weight: 900;
  opacity: 0.5;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: auto;
  padding-left: 10px;
  flex-shrink: 0;
}

.info-item:hover .info-arrow {
  opacity: 1;
  transform: translateX(8px);
  color: var(--primary-darker);
}

/* ============================================ */
/* ============ HOME ACTIONS (HITAM) ========== */
/* ============================================ */
.home-actions button {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
  color: white !important;
  border: 2px solid #374151 !important;
  font-weight: 800 !important;
  padding: 16px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.home-actions button:hover {
  background: linear-gradient(135deg, #111827 0%, #000000 100%) !important;
  color: white !important;
  border-color: #10b981 !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3) !important;
}

.home-actions button:active {
  transform: translateY(-1px) scale(0.98) !important;
}

/* Dark mode: kontras tetap bagus */
[data-theme="dark"] .home-actions button {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
  border-color: #4b5563 !important;
}
[data-theme="dark"] .home-actions button:hover {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
  border-color: #10b981 !important;
}

/* ============================================ */
/* ============ DARK MODE: ROLE CARDS ========= */
/* ============================================ */
[data-theme="dark"] .role-card.guru {
  background: linear-gradient(135deg, #022c22 0%, #064e3b 100%) !important;
  border-color: #047857 !important;
}
[data-theme="dark"] .role-card.guru:hover {
  background: linear-gradient(135deg, #064e3b 0%, #047857 100%) !important;
  border-color: #10b981 !important;
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.35) !important;
}

[data-theme="dark"] .role-card.siswa {
  background: linear-gradient(135deg, #1e1b4b 0%, #1e3a8a 100%) !important;
  border-color: #2563eb !important;
}
[data-theme="dark"] .role-card.siswa:hover {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.35) !important;
}

/* Teks role card di dark mode */
[data-theme="dark"] .role-card h3 {
  color: #f1f5f9 !important;
}
[data-theme="dark"] .role-card p {
  color: #cbd5e1 !important;
}
[data-theme="dark"] .role-card.guru h3 {
  color: #a7f3d0 !important;
}
[data-theme="dark"] .role-card.siswa h3 {
  color: #bfdbfe !important;
}

/* ============================================ */
/* ============ PAGE FOOTER (COPYRIGHT) ======= */
/* ============================================ */
.page-footer {
  text-align: center;
  padding: 32px 20px 24px;
  margin-top: 32px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.5px;
  position: relative;
  border-top: 1px dashed var(--border);
}

.page-footer::before {
  content: '©';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  padding: 0 12px;
  color: var(--primary);
  font-size: 16px;
  font-weight: 900;
}

.page-footer:hover {
  color: var(--primary);
  transition: color 0.3s;
}

/* Dark mode */
[data-theme="dark"] .page-footer {
  color: var(--text-soft);
  border-top-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .page-footer::before {
  background: var(--bg);
  color: var(--primary);
}
[data-theme="dark"] .page-footer:hover {
  color: var(--primary);
}

/* ============================================ */
/* ============ ONBOARDING MODERN ============= */
/* ============================================ */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboarding-modal {
  background: var(--card);
  border-radius: 32px;
  padding: 44px 28px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 
    0 30px 80px rgba(16, 185, 129, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: onboardingScale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}

.onboarding-modal::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(16, 185, 129, 0.08) 0%,
    transparent 50%
  );
  pointer-events: none;
}

@keyframes onboardingScale {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ============ SLIDES ============ */
.onboarding-slide {
  display: none;
}
.onboarding-slide.active {
  display: block;
  animation: slideSlide 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideSlide {
  0% {
    opacity: 0;
    transform: translateX(30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============ VISUAL (Blob + Icon) ============ */
.onboarding-visual {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-blob {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 50%, #6ee7b7 100%);
  border-radius: 50% 40% 60% 45% / 50% 60% 40% 55%;
  animation: blobMorph 6s ease-in-out infinite;
  box-shadow: 
    0 20px 50px rgba(16, 185, 129, 0.3),
    inset 0 -10px 20px rgba(16, 185, 129, 0.15);
}

.blob-blue {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 50%, #93c5fd 100%);
  box-shadow: 
    0 20px 50px rgba(59, 130, 246, 0.3),
    inset 0 -10px 20px rgba(59, 130, 246, 0.15);
}

.blob-purple {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 50%, #c4b5fd 100%);
  box-shadow: 
    0 20px 50px rgba(139, 92, 246, 0.3),
    inset 0 -10px 20px rgba(139, 92, 246, 0.15);
}

.blob-orange {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fbbf24 100%);
  box-shadow: 
    0 20px 50px rgba(245, 158, 11, 0.3),
    inset 0 -10px 20px rgba(245, 158, 11, 0.15);
}

@keyframes blobMorph {
  0%, 100% {
    border-radius: 50% 40% 60% 45% / 50% 60% 40% 55%;
    transform: rotate(0deg) scale(1);
  }
  50% {
    border-radius: 60% 45% 50% 55% / 45% 50% 60% 40%;
    transform: rotate(180deg) scale(1.05);
  }
}

.onboarding-emoji {
  font-size: 84px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.15));
  animation: emojiFloat 3s ease-in-out infinite;
}

.onboarding-logo {
  width: 90px;
  height: 90px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.15));
  animation: emojiFloat 3s ease-in-out infinite;
}

@keyframes emojiFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ============ TEXT ============ */
.onboarding-slide h2 {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: -0.6px;
  background: linear-gradient(135deg, var(--primary-darker), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}

.onboarding-slide p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 32px;
  font-weight: 500;
  position: relative;
  z-index: 1;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ============ DOTS ============ */
.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.onboarding-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboarding-dots .dot.active {
  width: 32px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), var(--primary-darker));
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* ============ BUTTONS ============ */
.onboarding-buttons {
  display: flex;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.onboarding-buttons button {
  flex: 1;
  margin-top: 0;
  padding: 15px;
  font-size: 14.5px;
  font-weight: 800;
  border-radius: 14px;
}

/* ============ DARK MODE ============ */
[data-theme="dark"] .onboarding-modal {
  background: var(--card);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .onboarding-modal::before {
  background: radial-gradient(
    circle at 50% 0%,
    rgba(52, 211, 153, 0.12) 0%,
    transparent 50%
  );
}

[data-theme="dark"] .onboarding-blob {
  background: linear-gradient(135deg, #064e3b 0%, #047857 50%, #059669 100%);
  box-shadow: 
    0 20px 50px rgba(52, 211, 153, 0.35),
    inset 0 -10px 20px rgba(52, 211, 153, 0.2);
}

[data-theme="dark"] .blob-blue {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
  box-shadow: 
    0 20px 50px rgba(96, 165, 250, 0.35),
    inset 0 -10px 20px rgba(96, 165, 250, 0.2);
}

[data-theme="dark"] .blob-purple {
  background: linear-gradient(135deg, #4c1d95 0%, #5b21b6 50%, #7c3aed 100%);
  box-shadow: 
    0 20px 50px rgba(167, 139, 250, 0.35),
    inset 0 -10px 20px rgba(167, 139, 250, 0.2);
}

[data-theme="dark"] .blob-orange {
  background: linear-gradient(135deg, #78350f 0%, #92400e 50%, #d97706 100%);
  box-shadow: 
    0 20px 50px rgba(251, 191, 36, 0.35),
    inset 0 -10px 20px rgba(251, 191, 36, 0.2);
}

[data-theme="dark"] .onboarding-slide h2 {
  background: linear-gradient(135deg, #34d399, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .onboarding-dots .dot {
  background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .onboarding-dots .dot.active {
  background: linear-gradient(90deg, #34d399, #10b981);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 480px) {
  .onboarding-modal {
    padding: 36px 22px 26px;
    border-radius: 28px;
  }
  .onboarding-visual {
    width: 140px;
    height: 140px;
    margin-bottom: 24px;
  }
  .onboarding-emoji {
    font-size: 72px;
  }
  .onboarding-logo {
    width: 76px;
    height: 76px;
  }
  .onboarding-slide h2 {
    font-size: 22px;
  }
  .onboarding-slide p {
    font-size: 13.5px;
    margin-bottom: 26px;
  }
  .onboarding-buttons button {
    padding: 14px;
    font-size: 14px;
  }
}

@media (max-width: 380px) {
  .onboarding-emoji {
    font-size: 64px;
  }
  .onboarding-logo {
    width: 68px;
    height: 68px;
  }
  .onboarding-slide h2 {
    font-size: 20px;
  }
  .onboarding-slide p {
    font-size: 13px;
  }
  .onboarding-buttons {
    flex-direction: column;
  }
}