:root {
  --bg: #12151c;
  --card: #1c2130;
  --card-done: #171b26;
  --text: #e8ebf2;
  --muted: #8b93a7;
  --accent: #4ade80;
  --accent-dim: #22c55e;
  --gold: #fbbf24;
  --radius: 14px;
}

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 90px;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Header stats ---- */
header {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
}

.stat .value { display: block; font-size: 1.6rem; font-weight: 700; }
.stat .label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.bar {
  height: 5px;
  background: #2a3040;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ---- Récompense suivante ---- */
.reward {
  background: var(--card);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.88rem;
}
.reward .remaining { color: var(--muted); }

/* ---- Mission ---- */
.mission {
  background: linear-gradient(135deg, #2a2440, #1c2130);
  border: 1px solid #3b3560;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.mission .bonus { color: var(--gold); font-weight: 700; }
.mission.done { opacity: 0.65; }

/* ---- Tasks ---- */
ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }

li.task {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
}
li.task.done { background: var(--card-done); color: var(--muted); }
li.task.done .name { text-decoration: line-through; }

.task .info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.task .pts { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.task .pts.boosted { color: var(--gold); font-weight: 700; }
.task .hint { font-size: 0.78rem; color: var(--muted); }
.task .streak-line { font-size: 0.78rem; color: #fb923c; }
.task.done .streak-line { color: var(--muted); }

button.uncomplete {
  background: none;
  border: 1px solid #2a3040;
  color: var(--muted);
  font-size: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}

.badge-boss {
  background: #7c3aed;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 6px;
  vertical-align: 2px;
}

button.complete {
  background: var(--accent-dim);
  border: none;
  color: #08120c;
  font-size: 1.2rem;
  font-weight: 700;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s;
}
button.complete:active { transform: scale(0.88); }
button.complete:disabled { opacity: 0.4; }

.check { font-size: 1.3rem; color: var(--accent); width: 46px; text-align: center; flex-shrink: 0; }

.all-done {
  text-align: center;
  color: var(--accent);
  padding: 24px 0 8px;
  font-size: 1.05rem;
}

/* ---- À venir / À découvrir ---- */
#upcoming, #teasers { margin-top: 22px; }
li.teaser { opacity: 0.65; border: 1px dashed #2a3040; background: none; }
#upcoming h2, #teasers h2 {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  padding-left: 4px;
}
li.upcoming-task {
  display: flex;
  justify-content: space-between;
  background: var(--card-done);
  border-radius: var(--radius);
  padding: 9px 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---- Footer ---- */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  font-size: 0.9rem;
  color: var(--muted);
}
footer b { color: var(--text); }

button.undo {
  background: none;
  border: 1px solid #2a3040;
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85rem;
}

.admin-link { text-decoration: none; margin-left: 8px; opacity: 0.55; }

/* ---- Feedback +points ---- */
.float-pts {
  position: fixed;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  pointer-events: none;
  animation: floatUp 1s ease-out forwards;
  z-index: 10;
}
.float-pts.gold { color: var(--gold); }

@keyframes floatUp {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-56px); }
}
