/* =============================================
   STUDYBINDER - Complete Stylesheet
   Matcha Cafe Aesthetic | Glassmorphism UI
   ============================================= */

/* ---- FONTS & RESET ---- */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&family=Quicksand:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---- CSS VARIABLES ---- */
:root {
  /* Palette */
  --matcha:        #6B8F5E;
  --matcha-light:  #8BAF7B;
  --matcha-pale:   #C5D9B8;
  --sage:          #A3B899;
  --sage-light:    #D1E0CB;
  --blush:         #F2B8C6;
  --blush-deep:    #E8889E;
  --cream:         #FDF8F0;
  --cream-dark:    #F4EDE0;
  --warm-white:    #FEFCF8;

  /* UI Tokens */
  --bg:            #F0F4EC;
  --surface:       rgba(255,255,255,0.72);
  --surface-solid: #FFFFFF;
  --surface-hover: rgba(255,255,255,0.88);
  --border:        rgba(107,143,94,0.18);
  --border-solid:  #D8E8D2;
  --text:          #2E3D28;
  --text-muted:    #7A8E72;
  --text-light:    #AAB8A2;
  --shadow-sm:     0 2px 8px rgba(107,143,94,0.10);
  --shadow-md:     0 4px 20px rgba(107,143,94,0.14);
  --shadow-lg:     0 8px 40px rgba(107,143,94,0.18);

  /* Sidebar */
  --sidebar-bg:    #2E3D28;
  --sidebar-text:  #C5D9B8;
  --sidebar-hover: rgba(139,175,123,0.2);
  --sidebar-active:#6B8F5E;

  /* Sizing */
  --sidebar-w:     220px;
  --radius:        16px;
  --radius-sm:     10px;
  --radius-lg:     24px;
  --gap:           20px;
}

/* DARK THEME */
[data-theme="dark"] {
  --bg:            #1A2216;
  --surface:       rgba(36,48,30,0.80);
  --surface-solid: #243020;
  --surface-hover: rgba(50,66,42,0.90);
  --border:        rgba(139,175,123,0.15);
  --border-solid:  #3A4E34;
  --text:          #D8EDD0;
  --text-muted:    #8BAF7B;
  --text-light:    #5A7252;
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.30);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.40);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.50);
  --sidebar-bg:    #111A0E;
  --sidebar-text:  #8BAF7B;
  --sidebar-active:#4A6E40;
  --matcha-pale:   #3A5030;
  --sage-light:    #2A3E24;
  --cream:         #1E2A1A;
  --cream-dark:    #1A241A;
}

/* ---- BASE ---- */
html, body { height: 100%; }
body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ---- SPLASH SCREEN ---- */
#splash-screen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #6B8F5E 0%, #A3B899 50%, #F2B8C6 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease;
}
.splash-logo { text-align: center; color: white; }
.splash-icon { font-size: 72px; margin-bottom: 12px; animation: float 2s ease-in-out infinite; }
.splash-logo h1 { font-size: 42px; font-weight: 900; letter-spacing: -1px; }
.splash-logo p { font-size: 16px; opacity: 0.85; margin: 8px 0 28px; }
.splash-loader { width: 200px; height: 4px; background: rgba(255,255,255,0.3); border-radius: 99px; overflow: hidden; }
.loader-bar { height: 100%; background: white; border-radius: 99px; animation: loadProgress 1.8s ease forwards; }
@keyframes loadProgress { from { width:0% } to { width:100% } }
#splash-screen.fade-out { opacity: 0; pointer-events: none; }

/* ---- HIDDEN ---- */
.hidden { display: none !important; }

/* ---- APP LAYOUT ---- */
#app { display: flex; min-height: 100vh; position: relative; }

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  padding: 24px 0 16px;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.logo-icon { font-size: 26px; }
.logo-text { font-size: 18px; font-weight: 800; color: #E8F4E0; }
.nav-links { list-style: none; flex: 1; padding: 16px 0; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-right: 12px;
  font-weight: 600;
  transition: all 0.2s;
}
.nav-link:hover { background: var(--sidebar-hover); color: #E8F4E0; }
.nav-link.active { background: var(--sidebar-active); color: white; box-shadow: 0 4px 12px rgba(107,143,94,0.4); }
.nav-icon { font-size: 18px; width: 24px; text-align: center; }
.nav-label { font-size: 14px; }
.sidebar-coins {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 20px;
  background: rgba(107,143,94,0.2);
  border-radius: var(--radius-sm);
  margin: 0 12px;
  color: #F2B8C6;
  font-weight: 700; font-size: 15px;
}

/* ---- MOBILE TOP BAR ---- */
.mobile-topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  z-index: 200;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: white;
}
.mobile-logo { font-size: 15px; font-weight: 800; }
.mobile-coins { font-size: 14px; font-weight: 700; color: #F2B8C6; }
.hamburger { background: none; border: none; color: white; font-size: 22px; cursor: pointer; }
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

/* ---- PAGE ---- */
.page { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px) } to { opacity:1; transform:none } }

.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 28px; font-weight: 900; color: var(--text); }
.page-subtitle { color: var(--text-muted); margin-top: 4px; font-size: 14px; }

/* ---- CARDS ---- */
.card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-wide { grid-column: span 2; }

/* ---- DASHBOARD GRID ---- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

/* Welcome Card */
.welcome-card {
  grid-column: span 4;
  display: flex; align-items: center; gap: 24px;
  background: linear-gradient(135deg, rgba(107,143,94,0.15), rgba(242,184,198,0.1));
}
.welcome-art { font-size: 56px; flex-shrink: 0; animation: float 3s ease-in-out infinite; }
.welcome-info { flex: 1; }
.welcome-info h2 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.welcome-info p { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.progress-bar-wrap { background: var(--sage-light); border-radius: 99px; height: 10px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--matcha), var(--matcha-light)); transition: width 0.6s ease; }
.xp-bar { background: linear-gradient(90deg, var(--blush-deep), var(--blush)); }
.progress-text { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* Stat Cards */
.stat-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px;
}
.stat-icon { font-size: 32px; }
.stat-value { display: block; font-size: 26px; font-weight: 900; color: var(--matcha); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }

/* XP Card */
.xp-card { grid-column: span 2; }
.xp-header { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--text-muted); }

/* Quick Start */
.quick-start-card { grid-column: span 2; text-align: center; }
.quick-start-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.quick-start-card p { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }

/* Recent Rewards */
.recent-rewards-card { grid-column: span 4; }
.recent-rewards-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 16px; }
.recent-rewards-list { display: flex; gap: 12px; flex-wrap: wrap; }
.reward-chip {
  background: linear-gradient(135deg, var(--matcha-pale), var(--sage-light));
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 12px; font-weight: 700;
  color: var(--matcha);
  display: flex; align-items: center; gap: 6px;
  animation: popIn 0.3s ease;
}
.empty-state { color: var(--text-muted); font-size: 14px; }

/* ---- BUTTONS ---- */
.btn-primary {
  background: linear-gradient(135deg, var(--matcha), var(--matcha-light));
  color: white;
  border: none;
  border-radius: 99px;
  padding: 12px 28px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px; font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 12px rgba(107,143,94,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(107,143,94,0.45); }
.btn-primary:active { transform: scale(0.97); }
.btn-large { padding: 16px 40px; font-size: 17px; }

.btn-ghost {
  background: transparent;
  border: 2px solid var(--border-solid);
  border-radius: 99px;
  padding: 8px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}
.btn-ghost:hover { background: var(--sage-light); color: var(--matcha); border-color: var(--matcha); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

.btn-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 2px solid var(--border-solid);
  background: var(--surface);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
}
.btn-icon:hover { background: var(--sage-light); border-color: var(--matcha); }

.btn-danger {
  background: linear-gradient(135deg, #E8889E, #D46080);
  color: white; border: none;
  border-radius: 99px;
  padding: 10px 22px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-danger:hover { opacity: 0.85; }

.toggle-btn {
  border: 2px solid var(--matcha);
  background: var(--matcha);
  color: white;
  border-radius: 99px;
  padding: 6px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 56px;
}
.toggle-btn.off { background: transparent; color: var(--text-muted); border-color: var(--border-solid); }

/* ---- STUDY GRID ---- */
.study-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

/* Timer Card */
.timer-card { grid-column: span 2; }
.timer-mode-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 24px; flex-wrap: wrap; }
.mode-tab {
  border: 2px solid var(--border-solid);
  background: transparent;
  border-radius: 99px;
  padding: 8px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}
.mode-tab.active, .mode-tab:hover {
  background: var(--matcha);
  color: white;
  border-color: var(--matcha);
  box-shadow: 0 4px 12px rgba(107,143,94,0.3);
}

.timer-display {
  position: relative;
  width: 220px; height: 220px;
  margin: 0 auto 28px;
  display: flex; align-items: center; justify-content: center;
}
.timer-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--sage-light); stroke-width: 8; }
.ring-progress {
  fill: none;
  stroke: url(#timerGradient);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s linear;
  stroke: var(--matcha);
}
.timer-text { position: relative; z-index: 1; text-align: center; }
#timer-display { display: block; font-size: 52px; font-weight: 900; letter-spacing: -2px; font-family: 'Quicksand', sans-serif; }
.timer-mode-label { display: block; font-size: 13px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }

.timer-controls { display: flex; gap: 16px; justify-content: center; align-items: center; margin-bottom: 20px; }
.btn-timer { padding: 14px 40px; font-size: 16px; }

.session-counter { text-align: center; font-size: 13px; color: var(--text-muted); font-weight: 600; }
.session-dots { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.session-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--sage-light); }
.session-dot.done { background: var(--matcha); }

/* Task Card */
.task-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 14px; }
.task-input-wrap { display: flex; gap: 8px; margin-bottom: 12px; }
.task-input {
  flex: 1;
  border: 2px solid var(--border-solid);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.task-input:focus { border-color: var(--matcha); }
.task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  animation: slideIn 0.2s ease;
}
.task-item.done span { text-decoration: line-through; opacity: 0.5; }
.task-check { cursor: pointer; }

/* Timer Settings */
.timer-settings-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 14px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--text-muted);
}
.setting-row:last-child { border-bottom: none; }
.num-input {
  width: 60px;
  border: 2px solid var(--border-solid);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 700;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  outline: none;
}
.num-input:focus { border-color: var(--matcha); }

/* Quote Card */
.quote-card { text-align: center; }
.quote-icon { font-size: 32px; margin-bottom: 12px; }
.quote-text { font-size: 15px; font-style: italic; line-height: 1.6; color: var(--text); margin-bottom: 8px; }
.quote-author { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 16px; }

/* Tracker */
.tracker-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 16px; }
.tracker-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.tracker-day { aspect-ratio: 1; border-radius: 6px; background: var(--sage-light); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--text-muted); }
.tracker-day.studied { background: var(--matcha); color: white; }
.tracker-day.today { ring: 2px; outline: 2px solid var(--blush-deep); }

/* ---- BINDER PAGE ---- */
.binder-switcher { margin-bottom: 24px; }
.binder-switcher h3 { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.binder-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.binder-tab {
  background: var(--surface);
  border: 2px solid var(--border-solid);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s;
  display: flex; align-items: center; gap: 8px;
}
.binder-tab:hover { border-color: var(--matcha); color: var(--matcha); }
.binder-tab.active { background: var(--matcha); color: white; border-color: var(--matcha); }
.binder-tab.locked { opacity: 0.5; cursor: default; }

.binder-display { display: flex; gap: var(--gap); flex-wrap: wrap; }

/* Binder Cover */
.binder-cover {
  width: 180px;
  flex-shrink: 0;
  perspective: 800px;
}
.binder-cover-inner {
  border-radius: var(--radius-lg);
  min-height: 240px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative;
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s;
  overflow: hidden;
  padding: 20px;
  cursor: pointer;
}
.binder-cover-inner:hover { transform: rotateY(-10deg) scale(1.02); }
.binder-cover-art { font-size: 56px; margin-bottom: 12px; }
.binder-cover-title { font-size: 14px; font-weight: 800; text-align: center; }
.binder-rings {
  position: absolute; right: -10px; top: 0; bottom: 0;
  display: flex; flex-direction: column; justify-content: space-evenly;
  padding: 20px 0;
}
.ring {
  width: 24px; height: 24px;
  border: 4px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}

.binder-pages { flex: 1; min-width: 280px; }
.binder-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.filter-btn {
  border: 2px solid var(--border-solid);
  background: transparent;
  border-radius: 99px;
  padding: 5px 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}
.filter-btn.active, .filter-btn:hover { background: var(--matcha); color: white; border-color: var(--matcha); }
.binder-stats { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 16px; }

/* Card Grid */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.photocard {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  transition: all 0.25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.photocard:hover { transform: translateY(-4px) scale(1.03); box-shadow: var(--shadow-md); }
.photocard.locked { opacity: 0.38; filter: grayscale(1); }
.photocard.locked:hover { transform: none; }
.photocard-art { font-size: 36px; margin-bottom: 8px; }
.photocard-name { font-size: 11px; font-weight: 800; color: var(--text); }
.photocard-rarity {
  font-size: 10px; font-weight: 700;
  border-radius: 99px;
  padding: 2px 8px;
  margin-top: 4px;
  display: inline-block;
}
.rarity-common { background: var(--sage-light); color: var(--matcha); }
.rarity-rare { background: #D0E8FF; color: #3A7BC8; }
.rarity-epic { background: #E8D0FF; color: #7A3AC8; }
.rarity-legendary { background: linear-gradient(135deg, #FFE0A0, #FFD060); color: #8B6000; }
.photocard-new-badge {
  position: absolute; top: 6px; right: 6px;
  background: var(--blush-deep); color: white;
  font-size: 9px; font-weight: 800;
  border-radius: 99px; padding: 2px 6px;
}

/* ---- SHOP ---- */
.shop-balance { margin-bottom: 20px; font-size: 16px; font-weight: 700; color: var(--matcha); }
.shop-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.shop-tab {
  border: 2px solid var(--border-solid);
  background: var(--surface);
  border-radius: 99px;
  padding: 10px 22px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s;
}
.shop-tab.active { background: var(--matcha); color: white; border-color: var(--matcha); }
.shop-section { display: none; }
.shop-section.active { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--gap); }
.shop-item {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}
.shop-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.shop-item-art { font-size: 44px; margin-bottom: 12px; }
.shop-item-name { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.shop-item-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.shop-item-price { font-size: 15px; font-weight: 800; color: var(--matcha); margin-bottom: 14px; }
.shop-item.owned { border-color: var(--matcha); background: rgba(107,143,94,0.07); }
.btn-buy {
  width: 100%;
  background: linear-gradient(135deg, var(--matcha), var(--matcha-light));
  color: white; border: none;
  border-radius: 99px;
  padding: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-buy:hover { opacity: 0.85; }
.btn-buy:disabled { background: var(--sage-light); color: var(--text-muted); cursor: default; }
.btn-buy.owned-btn { background: transparent; border: 2px solid var(--matcha); color: var(--matcha); cursor: default; }

/* ---- ACHIEVEMENTS ---- */
.ach-summary { margin-bottom: 24px; font-size: 15px; font-weight: 700; color: var(--text-muted); }
.achievements-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--gap); }
.ach-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.2s;
}
.ach-card.unlocked { border-color: var(--matcha); background: rgba(107,143,94,0.06); }
.ach-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ach-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ach-icon { font-size: 32px; }
.ach-title { font-size: 14px; font-weight: 800; }
.ach-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.ach-progress-bar { background: var(--sage-light); border-radius: 99px; height: 6px; overflow: hidden; }
.ach-progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--matcha), var(--matcha-light)); transition: width 0.5s; }
.ach-progress-text { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-weight: 700; }
.ach-badge { font-size: 11px; font-weight: 800; color: white; background: var(--matcha); border-radius: 99px; padding: 3px 10px; display: inline-block; margin-top: 8px; }
.ach-badge.locked-badge { background: var(--sage-light); color: var(--text-muted); }

/* ---- PROFILE ---- */
.profile-grid { display: grid; grid-template-columns: 1fr 2fr; gap: var(--gap); }
.profile-hero-card { text-align: center; }
.profile-avatar { font-size: 72px; margin-bottom: 12px; }
.profile-name-wrap { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; }
.profile-name-wrap h2 { font-size: 20px; font-weight: 900; }
.profile-level-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--matcha), var(--matcha-light));
  color: white;
  border-radius: 99px;
  padding: 5px 16px;
  font-size: 13px; font-weight: 800;
  margin-bottom: 16px;
}
.profile-stats-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 16px; }
.profile-stat-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.profile-stat-row:last-child { border-bottom: none; }
.avatar-card { grid-column: span 2; }
.avatar-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 16px; }
.avatar-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.avatar-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 3px solid var(--border-solid);
  background: var(--surface);
  font-size: 28px;
  cursor: pointer;
  transition: all 0.2s;
}
.avatar-btn:hover { transform: scale(1.1); border-color: var(--matcha); }
.avatar-btn.active { border-color: var(--matcha); background: var(--sage-light); box-shadow: 0 0 0 3px var(--matcha-pale); }

/* ---- SETTINGS ---- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.settings-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 16px; }
.theme-btns { display: flex; gap: 8px; }
.theme-btn {
  border: 2px solid var(--border-solid);
  background: transparent;
  border-radius: 99px;
  padding: 7px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s;
}
.theme-btn.active { background: var(--matcha); color: white; border-color: var(--matcha); }

/* ---- REWARD POPUP ---- */
.reward-popup {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.3s ease;
}
.reward-popup-inner {
  background: var(--surface-solid);
  border-radius: 28px;
  padding: 40px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}
.reward-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.confetti-piece {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}
.reward-icon { font-size: 56px; margin-bottom: 12px; position: relative; z-index: 1; }
.reward-title { font-size: 24px; font-weight: 900; margin-bottom: 20px; position: relative; z-index: 1; }
.reward-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; position: relative; z-index: 1; }
.reward-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 15px; font-weight: 800;
}

/* ---- ACHIEVEMENT POPUP ---- */
.achievement-popup {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; align-items: center; gap: 14px;
  background: var(--sidebar-bg);
  color: white;
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  box-shadow: var(--shadow-lg);
  z-index: 900;
  animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-width: 280px;
}
.achievement-badge { font-size: 32px; }
.achievement-text { display: flex; flex-direction: column; }
.ach-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.7; font-weight: 700; }
.ach-name { font-size: 16px; font-weight: 900; color: #F2B8C6; }

/* ---- ANIMATIONS ---- */
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
@keyframes popIn { from { transform: scale(0.7); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px) } to { opacity: 1; transform: none } }
@keyframes slideInRight { from { transform: translateX(120%); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1 }
  100% { transform: translateY(400px) rotate(720deg); opacity: 0 }
}
@keyframes shimmer {
  0% { background-position: -200% 0 }
  100% { background-position: 200% 0 }
}

/* ---- BINDER THEMES ---- */
.binder-theme-starter .binder-cover-inner { background: linear-gradient(135deg, #8BAF7B, #C5D9B8); color: white; }
.binder-theme-matcha .binder-cover-inner { background: linear-gradient(135deg, #4A7C47, #8BAF7B); color: white; }
.binder-theme-sakura .binder-cover-inner { background: linear-gradient(135deg, #F2B8C6, #E8889E); color: white; }
.binder-theme-library .binder-cover-inner { background: linear-gradient(135deg, #8B6B4A, #C4956A); color: white; }
.binder-theme-strawberry .binder-cover-inner { background: linear-gradient(135deg, #FF6B6B, #FFB8C6); color: white; }
.binder-theme-vintage .binder-cover-inner { background: linear-gradient(135deg, #C4956A, #E8D5B7); color: #4A3020; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sage); border-radius: 99px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .mobile-topbar { display: flex; }
  .main-content { margin-left: 0; padding: 80px 16px 24px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .welcome-card, .recent-rewards-card, .xp-card, .quick-start-card { grid-column: span 2; }
  .study-grid { grid-template-columns: 1fr; }
  .timer-card { grid-column: span 1; }
  .card-wide { grid-column: span 1; }
  .profile-grid { grid-template-columns: 1fr; }
  .avatar-card { grid-column: span 1; }
  .binder-display { flex-direction: column; }
  .binder-cover { width: 100%; max-width: 300px; margin: 0 auto; }
}
@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .welcome-card, .stat-card, .xp-card, .quick-start-card, .recent-rewards-card { grid-column: span 1; }
  .timer-display { width: 180px; height: 180px; }
  #timer-display { font-size: 40px; }
}