/* Champ Tracker — playful, kid-friendly, mobile-first */

:root {
  --green: #16a34a;
  --green-dark: #15803d;
  --green-soft: #dcfce7;
  --orange: #f97316;
  --orange-soft: #ffedd5;
  --yellow: #facc15;
  --ink: #1e293b;
  --ink-soft: #64748b;
  --bg: #f0fdf4;
  --card: #ffffff;
  --line: #e2e8f0;
  --radius: 18px;
  --shadow: 0 4px 14px rgba(30, 41, 59, 0.08);
}

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

body {
  font-family: "Nunito", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.hidden { display: none !important; }

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 16px;
}

.header-title { display: flex; align-items: center; gap: 10px; }

.header-ball { font-size: 2rem; animation: bounce 2.4s ease-in-out infinite; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.header h1 { font-size: 1.35rem; font-weight: 900; letter-spacing: -0.02em; }

.greeting { font-size: 0.8rem; color: var(--ink-soft); font-weight: 700; }

.streak-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--orange-soft);
  border: 2px solid var(--orange);
  color: var(--orange);
  font-weight: 900;
  font-size: 1.05rem;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Onboarding ---------- */
.onboarding h2 { margin-bottom: 6px; }
.onboarding p { color: var(--ink-soft); font-weight: 600; margin-bottom: 12px; }
.onboarding-row { display: flex; gap: 8px; margin-bottom: 8px; }
.onboarding-row input { flex: 1; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  background: #e7f6ec;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding: 10px 0;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab.active { background: var(--card); color: var(--green-dark); box-shadow: var(--shadow); }

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

.card h3 { font-size: 1rem; font-weight: 900; margin-bottom: 12px; }

/* ---------- Day banner ---------- */
.day-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.day-label { display: block; font-weight: 900; font-size: 1.05rem; color: var(--green-dark); }
.date-label { font-size: 0.78rem; color: var(--ink-soft); font-weight: 700; }

.sport-toggle { display: flex; background: #e7f6ec; border-radius: 999px; padding: 3px; }

.sport-btn {
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--ink-soft);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.sport-btn.active { background: var(--card); color: var(--green-dark); box-shadow: var(--shadow); }

/* ---------- Drill card ---------- */
.drill-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.drill-emoji { font-size: 2.6rem; }
.drill-head h2 { font-size: 1.3rem; font-weight: 900; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--green-soft);
  color: var(--green-dark);
  padding: 3px 10px;
  border-radius: 999px;
  margin-top: 4px;
}

.badge.outdoor { background: #dbeafe; color: #1d4ed8; }

.drill-why { color: var(--ink-soft); font-weight: 600; font-size: 0.92rem; margin-bottom: 12px; }

.drill-steps { padding-left: 20px; display: grid; gap: 8px; font-size: 0.92rem; font-weight: 600; }

.best-line {
  margin-top: 14px;
  background: #fefce8;
  border: 1.5px dashed var(--yellow);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 700;
}

/* ---------- Timer ---------- */
.timer-card { text-align: center; }

.timer-display {
  font-size: 3.4rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
  margin: 6px 0 12px;
}

.timer-display.running { color: var(--orange); }
.timer-display.finished { color: var(--green); animation: pulse 1s ease infinite; }

@keyframes pulse { 50% { transform: scale(1.06); } }

.timer-controls { display: flex; gap: 10px; justify-content: center; }

.timer-hint { margin-top: 12px; font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; }

/* ---------- Buttons & inputs ---------- */
.btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.btn:active { transform: scale(0.96); }

.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }

.btn-ghost { background: #f1f5f9; color: var(--ink-soft); }

.btn-big {
  width: 100%;
  background: var(--orange);
  color: #fff;
  font-size: 1.1rem;
  padding: 16px;
  margin-top: 16px;
  box-shadow: 0 6px 0 #c2590c;
}

.btn-big:active { transform: translateY(3px); box-shadow: 0 3px 0 #c2590c; }

.btn-link {
  background: none;
  border: none;
  font-family: inherit;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 6px;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink-soft);
  margin: 12px 0 6px;
}

input[type="number"], input[type="text"] {
  width: 100%;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

input:focus { border-color: var(--green); }

/* ---------- Done state ---------- */
.done-card { text-align: center; }

.done-burst { font-size: 3.4rem; animation: pop 0.5s ease; }

@keyframes pop {
  0% { transform: scale(0.3); }
  70% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.done-card h2 { font-size: 1.4rem; font-weight: 900; margin: 8px 0 6px; }
.done-card p { color: var(--ink-soft); font-weight: 600; margin-bottom: 6px; }

.done-streak { font-size: 1.05rem; font-weight: 900; color: var(--orange); }

/* ---------- Tip ---------- */
.tip-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fffbeb;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #78350f;
}

.tip-emoji { font-size: 1.2rem; }

/* ---------- Progress ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-num { font-size: 1.9rem; font-weight: 900; color: var(--green-dark); }
.stat-label { font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); }

.dots-row { display: flex; gap: 6px; flex-wrap: wrap; }

.dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.dot.hit { background: var(--green); }
.dot.today-marker { outline: 2.5px solid var(--orange); outline-offset: 1.5px; }

.bests-list, .history-list { list-style: none; display: grid; gap: 10px; }

.bests-list li, .history-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 12px;
}

.history-list .h-date { color: var(--ink-soft); font-size: 0.78rem; min-width: 62px; }
.history-list .h-score { margin-left: auto; color: var(--green-dark); font-weight: 900; white-space: nowrap; }
.history-list .h-note { display: block; font-size: 0.78rem; color: var(--ink-soft); font-weight: 600; }

.empty-note { color: var(--ink-soft); font-weight: 600; font-size: 0.9rem; }

/* ---------- Plan ---------- */
.plan-intro { color: var(--ink-soft); font-weight: 600; font-size: 0.9rem; margin-bottom: 14px; }

.plan-list { list-style: none; display: grid; gap: 10px; }

.plan-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 12px;
}

.plan-list .p-emoji { font-size: 1.5rem; }
.plan-list .p-name { font-weight: 900; font-size: 0.92rem; }
.plan-list .p-desc { font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; }
.plan-list li.today-plan { background: var(--green-soft); outline: 2px solid var(--green); }

.coach-rules ul { list-style: none; display: grid; gap: 10px; }

.coach-rules li {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  padding-left: 24px;
  position: relative;
}

.coach-rules li::before { content: "✔"; position: absolute; left: 0; color: var(--green); font-weight: 900; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
}

@media (min-width: 520px) {
  .app { padding-top: 32px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
