/* ============================================================
   FlashMaster – styles.css
   © 2024 Iheb Soltani · All Rights Reserved
   ============================================================ */

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #18181f;
  --surface: #1c1c26;
  --surface2: #23232f;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);

  --accent: #6c63ff;
  --accent2: #a78bfa;
  --accent3: #38bdf8;
  --gold: #f59e0b;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f97316;

  --text: #f4f4f8;
  --text2: #a0a0b8;
  --text3: #5c5c7a;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-accent: 0 0 40px rgba(108,99,255,0.2);
  --shadow-card: 0 20px 60px rgba(0,0,0,0.7);

  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --nav-h: 68px;
  --mobile-nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 99px; }

/* ─── UTILITY ─── */
.hidden { display: none !important; }
.full-w { width: 100%; }

/* ============================================================
   SPLASH
   ============================================================ */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  animation: splashOut 0.5s ease 2.2s forwards;
}
@keyframes splashOut {
  to { opacity: 0; pointer-events: none; visibility: hidden; }
}
.splash-inner { text-align: center; }
.splash-logo {
  display: flex; align-items: center; gap: 12px;
  justify-content: center; margin-bottom: 40px;
}
.splash-icon {
  font-size: 48px;
  animation: pulse 1s ease infinite alternate;
}
@keyframes pulse { to { transform: scale(1.15); filter: brightness(1.4); } }
.splash-name {
  font-family: var(--font-display);
  font-size: 42px; font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.splash-bar {
  width: 200px; height: 3px;
  background: var(--surface2);
  border-radius: 99px; margin: 0 auto 16px;
  overflow: hidden;
}
.splash-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  animation: fillBar 2s ease forwards;
}
@keyframes fillBar { from { width: 0; } to { width: 100%; } }
.splash-tagline {
  font-size: 13px; color: var(--text3); letter-spacing: 1px;
}

/* ============================================================
   TOP NAV
   ============================================================ */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.topnav-left { display: flex; align-items: center; gap: 10px; }
.logo-mark { font-size: 22px; }
.logo-text {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.pill-nav {
  display: flex; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px; padding: 4px;
}
.pill-btn {
  padding: 8px 18px;
  border-radius: 99px; border: none;
  background: transparent; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  color: var(--text2); transition: all 0.2s;
}
.pill-btn:hover { color: var(--text); }
.pill-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px rgba(108,99,255,0.4);
}
.xp-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 99px; padding: 8px 14px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  color: var(--gold);
}
.xp-icon { font-size: 14px; }

/* ============================================================
   APP / VIEWS
   ============================================================ */
.app {
  padding-top: var(--nav-h);
  padding-bottom: calc(var(--mobile-nav-h) + 20px);
  min-height: 100dvh;
}
.view { display: none; animation: fadeIn 0.35s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   HOME – HERO
   ============================================================ */
.hero-section {
  position: relative;
  padding: 60px 24px 40px;
  overflow: hidden;
  min-height: 420px;
  display: flex; align-items: center;
}
.hero-bg-gfx {
  position: absolute; inset: 0; pointer-events: none;
}
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: 0.3;
}
.orb1 { width: 400px; height: 400px; background: var(--accent); top: -100px; right: -80px; animation: orbFloat 6s ease-in-out infinite; }
.orb2 { width: 300px; height: 300px; background: var(--accent3); bottom: -80px; left: -60px; animation: orbFloat 8s ease-in-out infinite reverse; }
.orb3 { width: 200px; height: 200px; background: var(--gold); top: 50%; left: 40%; animation: orbFloat 5s ease-in-out infinite 1s; }
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}
.hero-content { position: relative; z-index: 1; max-width: 640px; }
.hero-badge-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.3);
  border-radius: 99px; padding: 6px 16px;
  font-size: 13px; font-weight: 500; color: var(--accent2);
  margin-bottom: 20px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800; line-height: 1.05;
  margin-bottom: 16px;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: 16px; color: var(--text2); line-height: 1.6;
  max-width: 480px; margin-bottom: 32px;
}
.hero-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  padding: 14px 28px; border: none; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; cursor: pointer;
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  letter-spacing: 0.3px;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(108,99,255,0.35);
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  pointer-events: none;
}
.btn-primary:hover { background: #7c73ff; transform: translateY(-2px); box-shadow: 0 8px 30px rgba(108,99,255,0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.small { padding: 10px 20px; font-size: 13px; }

.btn-ghost {
  padding: 14px 28px; border: 1px solid var(--border2); border-radius: var(--radius-sm);
  background: transparent; color: var(--text); cursor: pointer;
  font-family: var(--font-display); font-size: 15px; font-weight: 600;
  transition: all 0.2s;
}
.btn-ghost:hover { background: var(--surface); border-color: var(--accent); color: var(--accent2); }
.btn-ghost.danger { color: var(--red); border-color: rgba(239,68,68,0.3); }
.btn-ghost.danger:hover { background: rgba(239,68,68,0.1); }

/* ============================================================
   STATS STRIP
   ============================================================ */
.stats-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; padding: 0 24px 32px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 16px;
  text-align: center; transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-4px); }
.stat-val {
  display: block;
  font-family: var(--font-display); font-size: 28px; font-weight: 800;
  color: var(--text); margin-bottom: 4px;
}
.stat-label { font-size: 12px; color: var(--text3); font-weight: 500; }

/* ============================================================
   SECTION BLOCKS
   ============================================================ */
.section-block { padding: 0 24px 40px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
}
.see-all { background: none; border: none; color: var(--accent2); cursor: pointer; font-size: 14px; font-family: var(--font-body); }

/* ============================================================
   DECK GRID & CARDS
   ============================================================ */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.deck-grid.full { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.deck-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  cursor: pointer; transition: all 0.25s;
  position: relative; overflow: hidden;
}
.deck-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--card-color, var(--accent));
  border-radius: 99px 99px 0 0;
}
.deck-card:hover {
  transform: translateY(-6px);
  border-color: var(--border2);
  box-shadow: var(--shadow-card);
}
.deck-emoji { font-size: 36px; margin-bottom: 14px; display: block; }
.deck-name {
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
  margin-bottom: 6px;
}
.deck-meta { font-size: 13px; color: var(--text3); margin-bottom: 16px; }
.deck-footer { display: flex; align-items: center; justify-content: space-between; }
.deck-tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  background: var(--surface2); border-radius: 99px; padding: 4px 10px;
  color: var(--text2);
}
.deck-start-btn {
  background: var(--accent); border: none; border-radius: 99px;
  color: #fff; font-size: 12px; font-weight: 700;
  padding: 7px 16px; cursor: pointer; transition: all 0.2s;
  font-family: var(--font-display);
}
.deck-start-btn:hover { background: #7c73ff; transform: scale(1.05); }

/* ============================================================
   DAILY CHALLENGE
   ============================================================ */
.daily-challenge-card {
  background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(56,189,248,0.1));
  border: 1px solid rgba(108,99,255,0.3);
  border-radius: var(--radius-xl); padding: 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.dc-tag {
  display: inline-block;
  font-size: 12px; font-weight: 700; color: var(--accent2);
  background: rgba(108,99,255,0.15); border-radius: 99px;
  padding: 4px 12px; margin-bottom: 12px;
}
.dc-title { font-family: var(--font-display); font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.dc-sub { font-size: 14px; color: var(--text2); margin-bottom: 20px; }
.dc-circle {
  width: 110px; height: 110px; border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 30px rgba(108,99,255,0.3);
}
.dc-time { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--accent2); }
.dc-label { font-size: 9px; color: var(--text3); letter-spacing: 2px; }

/* ============================================================
   LIBRARY VIEW
   ============================================================ */
.view-header {
  padding: 24px 24px 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.view-title { font-family: var(--font-display); font-size: 30px; font-weight: 800; }
.search-wrap {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
}
.search-icon { font-size: 16px; color: var(--text3); }
.search-input {
  background: none; border: none; outline: none;
  color: var(--text); font-family: var(--font-body); font-size: 15px;
  width: 100%;
}
.search-input::placeholder { color: var(--text3); }
.filter-chips {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 0 24px 20px;
}
.filter-chip {
  padding: 7px 16px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text2); cursor: pointer;
  font-size: 13px; font-weight: 500; transition: all 0.2s;
}
.filter-chip.active, .filter-chip:hover {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
#library-decks { padding: 0 24px 24px; }

/* ============================================================
   CREATE VIEW
   ============================================================ */
.create-form { padding: 0 24px 40px; max-width: 700px; }
.form-group { margin-bottom: 28px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600; letter-spacing: 0.5px;
  color: var(--text2); text-transform: uppercase; margin-bottom: 12px;
}
.form-input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 18px;
  color: var(--text); font-family: var(--font-body); font-size: 15px; outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); }
.category-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-pill {
  padding: 8px 16px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text2); cursor: pointer; font-size: 13px; transition: all 0.2s;
}
.cat-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.emoji-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.emoji-opt {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: var(--surface); border: 2px solid var(--border);
  cursor: pointer; font-size: 24px; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.emoji-opt.active { border-color: var(--accent); background: rgba(108,99,255,0.15); transform: scale(1.1); }
.cards-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.card-field-row {
  display: grid; grid-template-columns: 1fr 1fr auto;
  gap: 10px; align-items: center;
}
.card-field {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  color: var(--text); font-family: var(--font-body); font-size: 14px; outline: none;
  transition: border-color 0.2s; width: 100%;
}
.card-field:focus { border-color: var(--accent); }
.remove-card {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--surface); color: var(--text3); cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.remove-card:hover { background: rgba(239,68,68,0.15); color: var(--red); }
.add-card-btn {
  background: none; border: 1px dashed var(--border2);
  border-radius: var(--radius-sm); padding: 14px;
  color: var(--accent2); cursor: pointer; width: 100%;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  transition: all 0.2s;
}
.add-card-btn:hover { background: rgba(108,99,255,0.08); border-color: var(--accent); }

/* ============================================================
   PROFILE VIEW
   ============================================================ */
.profile-hero {
  padding: 40px 24px 32px;
  text-align: center;
  background: linear-gradient(180deg, rgba(108,99,255,0.08), transparent);
}
.avatar-ring {
  position: relative; display: inline-block;
  width: 96px; height: 96px; margin-bottom: 16px;
}
.avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  box-shadow: 0 0 30px rgba(108,99,255,0.4);
}
.avatar-level {
  position: absolute; bottom: 0; right: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold); color: #000;
  font-family: var(--font-display); font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.profile-name {
  font-family: var(--font-display); font-size: 28px; font-weight: 800;
  margin-bottom: 20px;
}
.xp-bar-wrap { max-width: 320px; margin: 0 auto; }
.xp-bar-track {
  height: 8px; background: var(--surface);
  border-radius: 99px; overflow: hidden; margin-bottom: 8px;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
  width: 0%;
}
.xp-label { font-size: 13px; color: var(--text3); }

/* ─── BADGES ─── */
.badges-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}
.badge-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 12px;
  text-align: center; transition: all 0.2s;
}
.badge-item.earned {
  border-color: var(--gold);
  background: rgba(245,158,11,0.08);
  box-shadow: 0 0 20px rgba(245,158,11,0.15);
}
.badge-item:hover.earned { transform: translateY(-4px); }
.badge-emoji { font-size: 28px; display: block; margin-bottom: 6px; }
.badge-name { font-size: 11px; font-weight: 600; color: var(--text2); }
.badge-item:not(.earned) { opacity: 0.4; filter: grayscale(1); }

/* ─── STATS TABLE ─── */
.stats-table { display: flex; flex-direction: column; gap: 1px; border-radius: var(--radius); overflow: hidden; }
.stats-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); padding: 16px 20px;
}
.stats-row:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.stats-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.stats-row-label { font-size: 14px; color: var(--text2); }
.stats-row-val {
  font-family: var(--font-mono); font-size: 16px; font-weight: 700;
  color: var(--accent2);
}
.copyright-note { text-align: center; font-size: 12px; color: var(--text3); padding: 12px 0 0; }

/* ============================================================
   MOBILE NAV
   ============================================================ */
.mobile-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--mobile-nav-h);
  display: flex;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.mnav-btn {
  flex: 1; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: all 0.2s; color: var(--text3);
}
.mnav-btn.active { color: var(--accent2); }
.mnav-icon { font-size: 22px; }
.mnav-label { font-size: 11px; font-weight: 500; }

/* ============================================================
   STUDY MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 560px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slideUp {
  from { transform: translateY(40px) scale(0.95); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-close {
  background: var(--surface); border: none; border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer;
  color: var(--text2); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.modal-close:hover { background: var(--surface2); color: var(--text); }
.progress-bar-wrap {
  flex: 1; height: 8px; background: var(--surface);
  border-radius: 99px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px; transition: width 0.4s ease;
}
.card-counter { font-family: var(--font-mono); font-size: 13px; color: var(--text3); flex-shrink: 0; }

.study-stage { padding: 32px 24px; perspective: 1000px; }
.flashcard {
  width: 100%; min-height: 240px;
  cursor: pointer; position: relative;
  transform-style: preserve-3d; transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}
.flashcard.flipped { transform: rotateY(180deg); }
.card-inner { position: relative; width: 100%; height: 100%; }
.card-front, .card-back {
  width: 100%; min-height: 240px;
  border-radius: var(--radius-lg); padding: 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  backface-visibility: hidden;
  position: absolute; top: 0; left: 0;
}
.card-front {
  background: var(--surface);
  border: 1px solid var(--border2);
}
.card-back {
  background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(56,189,248,0.1));
  border: 1px solid rgba(108,99,255,0.3);
  transform: rotateY(180deg);
}
.card-side-label {
  font-size: 10px; letter-spacing: 2px; color: var(--text3); font-weight: 700;
  margin-bottom: 16px;
}
.card-side-label.answer { color: var(--accent2); }
.card-text {
  font-family: var(--font-display); font-size: clamp(18px, 4vw, 28px); font-weight: 700;
  text-align: center; line-height: 1.3;
}
.tap-hint { font-size: 12px; color: var(--text3); margin-top: 20px; }
.study-actions {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; padding: 0 24px 24px;
}
.rate-btn {
  border: none; border-radius: var(--radius-sm); padding: 14px 8px;
  cursor: pointer; font-family: var(--font-display); font-size: 13px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: all 0.2s;
}
.rate-btn span { font-size: 20px; }
.rate-btn.again { background: rgba(239,68,68,0.15); color: var(--red); }
.rate-btn.hard { background: rgba(249,115,22,0.15); color: var(--orange); }
.rate-btn.good { background: rgba(34,197,94,0.15); color: var(--green); }
.rate-btn.easy { background: rgba(56,189,248,0.15); color: var(--accent3); }
.rate-btn:hover { transform: translateY(-3px); filter: brightness(1.2); }

/* ============================================================
   RESULTS MODAL
   ============================================================ */
.results-box { text-align: center; padding: 40px; }
.results-trophy { font-size: 64px; margin-bottom: 16px; animation: bounce 0.6s ease; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}
.results-title { font-family: var(--font-display); font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.results-sub { font-size: 16px; color: var(--text2); margin-bottom: 28px; }
.results-stats {
  display: flex; justify-content: center; gap: 40px; margin-bottom: 28px;
}
.res-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.res-stat span { font-family: var(--font-display); font-size: 36px; font-weight: 800; color: var(--accent2); }
.res-stat small { font-size: 12px; color: var(--text3); font-weight: 500; }
.new-badges { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.new-badge-pill {
  background: rgba(245,158,11,0.15); border: 1px solid var(--gold);
  border-radius: 99px; padding: 8px 16px;
  font-size: 14px; color: var(--gold); font-weight: 600;
}
.results-btns { display: flex; justify-content: center; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: calc(var(--mobile-nav-h) + 16px); left: 50%;
  transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 99px; padding: 12px 24px;
  font-size: 14px; font-weight: 500; color: var(--text);
  box-shadow: var(--shadow);
  z-index: 9998; white-space: nowrap;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .topnav-center { display: none; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .study-actions { grid-template-columns: repeat(2, 1fr); }
  .daily-challenge-card { flex-direction: column; text-align: center; }
  .hero-section { padding: 40px 20px 32px; }
  .section-block { padding: 0 16px 32px; }
  .view-header { padding: 20px 16px 16px; }
  .create-form { padding: 0 16px 40px; }
  .card-field-row { grid-template-columns: 1fr 1fr auto; }
  .results-stats { gap: 24px; }
}

@media (min-width: 1024px) {
  .mobile-nav { display: none; }
  .app { padding-bottom: 40px; }
}

/* ─── LEVEL UP ANIMATION ─── */
@keyframes levelUp {
  0% { transform: scale(1); }
  30% { transform: scale(1.3) rotate(-5deg); }
  60% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1); }
}
.level-up-animate { animation: levelUp 0.6s ease; }
