/* ---------------------------------------------------------
   GLOBAL LAYOUT — CLEAN, CRISP, APPLE-STYLE
--------------------------------------------------------- */

:root {
    --radius: 16px;
    --radius-small: 12px;
  
    --shadow-soft: 0 4px 14px rgba(0,0,0,0.06);
    --shadow-medium: 0 8px 24px rgba(0,0,0,0.10);
  
    --border-glass: rgba(255,255,255,0.35);
    --bg-glass: rgba(255,255,255,0.28);
    --bg-glass-dark: rgba(255,255,255,0.08);
  }
  
  /* Base container */
  .container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px;
  }
  
  /* GRID */
  .grid {
    display: grid;
    gap: 20px;
  }
  
  /* ---------------------------------------------------------
     GLASSMORPHISM 2.0 — CLEAR, BUT NOT BLURRY
  --------------------------------------------------------- */
  
  .glass {
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
  
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
  
    padding: 20px;
    box-shadow: var(--shadow-soft);
  
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  
  /* Dark mode fix */
  .dark .glass {
    background: var(--bg-glass-dark);
    border-color: rgba(255,255,255,0.1);
  }
  
  /* ---------------------------------------------------------
     HERO SECTION — MODERN GRADIENT
  --------------------------------------------------------- */
  
  .hero {
    padding: 50px 40px;
    border-radius: 24px;
    color: white;
  
    background: linear-gradient(
      135deg,
      #7b5eff 0%,
      #4f8cff 40%,
      #27d7ff 100%
    );
    box-shadow: 0 20px 40px rgba(60,80,180,0.25);
  }
  
  /* ---------------------------------------------------------
     BUTTONS — iOS 17 STYLE
  --------------------------------------------------------- */
  
  .btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
  
    padding: 12px 20px;
    border: none;
    border-radius: 14px;
  
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
  
    transition: 
      transform 0.15s cubic-bezier(.2,.8,.2,1),
      box-shadow 0.2s;
  }
  
  .btn.primary {
    background: linear-gradient(135deg, #7b61ff, #3dd4f5);
    color: white;
    box-shadow: var(--shadow-medium);
  }
  
  .btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(80,120,255,0.4);
  }
  
  .btn.ghost {
    background: transparent;
    border: 1px solid rgba(80,80,80,0.15);
    color: var(--text);
  }
  
  .btn.ghost:hover {
    background: rgba(0,0,0,0.05);
  }
  
  /* ---------------------------------------------------------
     CARDS — MINIMAL, CLEAN
  --------------------------------------------------------- */
  
  .card {
    background: white;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s, box-shadow 0.25s;
  }
  
  .dark .card {
    background: rgba(255,255,255,0.08);
    color: white;
  }
  
  .card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
  }
  
  /* ---------------------------------------------------------
     NAVIGATION BAR — CLEAN TOPBAR
  --------------------------------------------------------- */
  
  .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
  
    padding: 18px 24px;
    margin-bottom: 20px;
  
    border-radius: var(--radius);
  }
  
  .topbar a {
    margin-right: 18px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    opacity: 0.85;
  }
  
  .topbar a:hover {
    opacity: 1;
  }
  
  /* ---------------------------------------------------------
     TYPOGRAPHY — iOS STYLE
  --------------------------------------------------------- */
  
  h1 {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 10px;
  }
  
  h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
  }
  
  p {
    opacity: 0.85;
    line-height: 1.5;
  }
  
  /* ---------------------------------------------------------
     SMOOTH ANIMATIONS EVERYWHERE
  --------------------------------------------------------- */
  
  * {
    transition: background 0.2s ease, color 0.2s ease;
  }

  @media (max-width: 900px){
    .container{ padding:16px; }
    .topbar{ flex-direction:column; align-items:flex-start; gap:10px; }
    .grid{ gap:12px; }
    h1{ font-size:32px; }
    h2{ font-size:26px; }
  }

  @media (max-width: 600px){
    .btn{ width:100%; }
  }
/* XP / Level pill */
.level-pill{
  display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:linear-gradient(90deg,#ffffff,rgba(255,255,255,0.9));box-shadow:0 6px 20px rgba(12,20,36,0.06);font-weight:700;
}
.level-pill .lv{font-size:13px}
.progress-row{display:flex;align-items:center;gap:12px}
.progress-small{height:10px;background:rgba(0,0,0,0.06);border-radius:999px;overflow:hidden;width:200px}
.progress-small > span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#7b61ff,#3dd4f5);width:40%}
/* DASHBOARD 2.0 */

.dashboard-header {
  padding: 30px;
  border-radius: 20px;
  margin-bottom: 25px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.dashboard-card {
  padding: 22px;
}

.dash-label {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 8px;
}

.dash-value {
  font-size: 36px;
  font-weight: 700;
}

.small {
  font-size: 13px;
  opacity: 0.7;
}

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

/* XP BAR */
.xp-box {
  width: 60%;
}

.xp-progress {
  height: 10px;
  background: rgba(0,0,0,0.07);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
}

.xp-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7C5CFF, #3DD4F5);
  border-radius: inherit;
  transition: width 0.4s ease;
}

/* PRACTICE GRID */
.practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  padding-top: 10px;
}

.p-item {
  background: rgba(255,255,255,0.5);
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}
/* ---------- DASHBOARD CHART SWITCH ---------- */
.chart-switch {
  display: flex;
  gap: 10px;
}

.chart-btn {
  padding: 6px 16px;
  font-size: 14px;
  border-radius: 10px;
  background: rgba(0,0,0,0.05);
  border: 0;
  cursor: pointer;
  transition: 0.25s;
}

.chart-btn.active {
  background: linear-gradient(90deg,#7C5CFF,#3DD4F5);
  color: #fff;
}

/* Chart wrapper */
.chart-wrapper {
  padding-top: 20px;
  min-height: 220px;
}

/* ---------- TIMELINE ---------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 10px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  background: linear-gradient(90deg,#7C5CFF,#3DD4F5);
  border-radius: 50%;
  margin-top: 4px;
}

.timeline-content {
  font-size: 15px;
}
/* ---------- ACHIEVEMENTS 2.0 ---------- */

.ach-header {
  margin-top: 20px;
  margin-bottom: 16px;
}

.ach-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.ach-tab {
  padding: 8px 20px;
  background: rgba(0,0,0,0.06);
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: 0.25s;
}

.ach-tab.active {
  background: linear-gradient(90deg,#7C5CFF,#3DD4F5);
  color: #fff;
}

.ach-list {
  display: grid;
  gap: 18px;
}

/* Achievement Card */
.ach-card {
  padding: 20px;
  border-radius: 18px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 26px rgba(0,0,0,0.08);
  display: flex;
  gap: 20px;
  align-items: center;
}

.ach-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(90deg,#7C5CFF,#3DD4F5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: white;
}

.ach-content {
  flex: 1;
}

.ach-title {
  font-size: 18px;
  font-weight: 700;
}

.ach-desc {
  font-size: 14px;
  opacity: 0.75;
  margin: 3px 0 8px;
}

.ach-reward {
  font-size: 14px;
  font-weight: 600;
}

/* Progress bar */
.ach-progress {
  height: 8px;
  background: rgba(0,0,0,0.1);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 6px;
}

.ach-progress-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg,#7C5CFF,#3DD4F5);
  transition: width 0.4s ease;
}

/* Completed */
.ach-card.completed {
  background: linear-gradient(90deg,#9D7BFF,#37DAE3);
  color: white;
}

.ach-card.completed .ach-desc,
.ach-card.completed .ach-reward {
  opacity: 1;
}

.ach-card.completed .ach-icon {
  background: rgba(255,255,255,0.25);
}
/* ---------------- ACHIEVEMENTS 2.0 UI ---------------- */

.ach-header {
  margin: 20px 0 16px;
}

.ach-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.ach-tab {
  padding: 8px 18px;
  border: none;
  border-radius: 12px;
  background: rgba(0,0,0,0.06);
  cursor: pointer;
  font-weight: 600;
  transition: 0.25s;
}

.ach-tab.active {
  background: linear-gradient(90deg,#7C5CFF,#3DD4F5);
  color: #fff;
}

.ach-list {
  display: grid;
  gap: 18px;
}


/* Achievement card */
.achievement-card {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transition: 0.25s;
}

.achievement-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 34px rgba(0,0,0,0.12);
}

.achievement-card.unlocked {
  background: linear-gradient(90deg,#9d7bff,#37dbe3);
  color: #fff;
}

.achievement-card.unlocked p,
.achievement-card.unlocked small {
  opacity: 0.9 !important;
}

.achievement-card h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 700;
}

.achievement-card p {
  margin: 4px 0 10px;
  opacity: 0.8;
}

.achievement-card small {
  font-weight: 600;
  opacity: 0.75;
}
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 24px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  border-radius: 14px;
  opacity: 0;
  transition: 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}
/* -------- SETTINGS UI -------- */

.settings-section {
  padding: 22px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.settings-row:last-child {
  border-bottom: none;
}

/* Toggle switch */
.switch {
  position: relative;
  width: 48px;
  height: 24px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  background: rgba(0,0,0,0.25);
  border-radius: 24px;
  inset: 0;
  transition: .3s;
}

.slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: .3s;
}

input:checked + .slider {
  background: linear-gradient(90deg,#7C5CFF,#3DD4F5);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Danger buttons */
.btn.danger {
  background: #ff4b4b;
  color: white;
  width: 100%;
  margin-bottom: 10px;
}
/* -------- SETTINGS UI -------- */

.settings-section {
  padding: 22px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.settings-row:last-child {
  border-bottom: none;
}

/* Toggle switch */
.switch {
  position: relative;
  width: 48px;
  height: 24px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  background: rgba(0,0,0,0.25);
  border-radius: 24px;
  inset: 0;
  transition: .3s;
}

.slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: .3s;
}

input:checked + .slider {
  background: linear-gradient(90deg,#7C5CFF,#3DD4F5);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Danger buttons */
.btn.danger {
  background: #ff4b4b;
  color: white;
  width: 100%;
  margin-bottom: 10px;
}
/* Achievements UI polish */
.ach-list{display:grid;gap:14px}
.ach-card{display:flex;gap:14px;align-items:center;padding:16px;border-radius:14px;background:rgba(255,255,255,0.7);box-shadow:0 8px 24px rgba(0,0,0,0.06)}
.ach-icon{width:56px;height:56px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:26px;background:linear-gradient(90deg,#7C5CFF,#3DD4F5);color:#fff}
.ach-card.unlocked{background:linear-gradient(90deg,#9d7bff,#37dbe3);color:#fff}
.ach-progress-inner{transition:width .5s ease}
  
