:root {
  --primary: #6c5ce7;
  --primary-dark: #5849c4;
  --secondary: #00cec9;
  --accent: #fdcb6e;
  --success: #00b894;
  --danger: #ff7675;
  --bg: #f6f5ff;
  --card-bg: #ffffff;
  --text: #2d2d3a;
  --text-light: #6b6b7b;
  --radius: 18px;
  --shadow: 0 4px 16px rgba(108, 92, 231, 0.12);
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 72px; /* room for bottom nav */
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.mini-card {
  flex: 1 1 100px;
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
  text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-full { display: block; width: 100%; }
.btn-option {
  display: block; width: 100%; text-align: left;
  background: #fff; border: 2px solid #e6e4fa; border-radius: 14px;
  padding: 14px 18px; margin-bottom: 10px; font-size: 1rem; cursor: pointer;
}
.btn-option:hover { border-color: var(--primary); }
.btn-option.selected { border-color: var(--primary); background: #f0eeff; }
.btn-option.correct { border-color: var(--success); background: #e8fbf5; }
.btn-option.incorrect { border-color: var(--danger); background: #ffefef; }

/* ---------- Progress bars ---------- */
.progress-bar {
  width: 100%;
  height: 14px;
  background: #eceaf9;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ---------- Header / top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
}
.streak-badge {
  background: var(--accent); color: #7a4e00; font-weight: 700;
  border-radius: 999px; padding: 6px 14px; font-size: 0.9rem;
}

/* ---------- Adventure map ---------- */
.adventure-map { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.map-node {
  background: #fff; border-radius: 999px; padding: 14px 20px;
  box-shadow: var(--shadow); font-weight: 700; width: 100%; max-width: 320px;
  text-align: center; text-decoration: none; color: var(--text);
  border: 3px solid transparent;
}
.map-node.current { border-color: var(--primary); color: var(--primary); }
.map-node.locked { opacity: 0.45; pointer-events: none; }
.map-arrow { color: var(--text-light); font-size: 1.2rem; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  display: flex; justify-content: space-around; padding: 8px 0;
}
.bottom-nav a {
  text-decoration: none; color: var(--text-light); font-size: 0.75rem;
  text-align: center; flex: 1;
}
.bottom-nav a.active { color: var(--primary); font-weight: 700; }
.bottom-nav .icon { font-size: 1.3rem; display: block; }

/* ---------- Feedback ---------- */
.feedback-correct { background: #e8fbf5; color: #00785e; border-radius: 14px; padding: 16px; }
.feedback-wrong { background: #fff4e5; color: #8a5300; border-radius: 14px; padding: 16px; }

/* ---------- Forms ---------- */
input[type=text], input[type=email], input[type=password], input[type=number] {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 2px solid #e6e4fa;
  font-size: 1rem; margin-bottom: 12px;
}
input:focus { outline: none; border-color: var(--primary); }
label { font-weight: 600; font-size: 0.9rem; color: var(--text-light); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
h1, h2, h3 { line-height: 1.25; }
.xp-pill { background: #eceaf9; color: var(--primary); font-weight: 700; padding: 4px 12px; border-radius: 999px; font-size: 0.85rem; }

@media (min-width: 768px) {
  .bottom-nav { max-width: 720px; left: 50%; transform: translateX(-50%); border-radius: 18px 18px 0 0; }
}
