/* Daily Spark Portal — bright, friendly, kid-approved styling. */
:root {
  --bg1: #fff7e6;
  --bg2: #e8f6ff;
  --ink: #2b2b3a;
  --muted: #7a7a8f;
  --card: #ffffff;
  --accent: #ff9f45;
  --accent2: #4d96ff;
  --good: #35b26f;
  --bad: #e45757;
  --radius: 18px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  min-height: 100vh;
}
.spark-shell { max-width: 760px; margin: 0 auto; padding: 20px 16px 60px; }

/* ---------- header ---------- */
.spark-hero { text-align: center; margin: 8px 0 18px; }
.spark-hero h1 { font-size: 2rem; margin: 0.2em 0; }
.spark-hero p { color: var(--muted); margin: 0.2em 0; }
.streak-pill {
  display: inline-block; margin-top: 8px; padding: 6px 14px;
  background: #fff; border-radius: 999px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.storage-badge {
  display: inline-block; margin-left: 8px; padding: 4px 10px; font-size: .75rem;
  background: #e6f4ff; color: #2b6cb0; border-radius: 999px;
}

/* ---------- progress ---------- */
.progress-wrap { background: #fff; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.progress-track { height: 14px; background: #f0eedd; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #ffd93d, #ff9f45); transition: width .5s ease; }
.progress-text { margin: 8px 0 0; font-weight: 600; }

/* ---------- task cards ---------- */
.task-card {
  background: var(--card); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.06);
  border-top: 6px solid var(--accent);
}
.task-card:nth-of-type(2n) { border-top-color: var(--accent2); }
.task-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.task-num {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ffd93d, #ff9f45); font-weight: 800;
}
.task-head h2 { margin: 0; font-size: 1.15rem; flex: 1; }
.task-check { font-size: 1.4rem; }
.task-card p { margin: 0.5em 0; }

/* word of the day */
.word-big { font-size: 2rem; font-weight: 800; color: #17324b; margin: 6px 0 0; }
.pron { color: var(--muted); font-style: italic; }
.meaning { font-size: 1.1rem; font-weight: 600; }
.sentences { padding-left: 20px; color: #444; }
.sentences li { margin: 4px 0; }

/* quiz */
.quiz-q { font-weight: 600; }
.quiz-opts { display: grid; gap: 8px; margin: 10px 0; }
.quiz-opt {
  text-align: left; padding: 10px 12px; border-radius: 12px; cursor: pointer;
  border: 2px solid #e8e4d8; background: #fffdf7; font-size: 1rem;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--accent2); }
.quiz-opt:disabled { cursor: default; opacity: .85; }
.quiz-opt.right { border-color: var(--good); background: #e9f9f0; }
.quiz-opt.wrong { border-color: var(--bad); background: #fdeeee; }
.quiz-msg { font-weight: 600; min-height: 1.4em; }
.quiz-done { background: #f4f8ff; border-radius: 12px; padding: 10px 12px; }

/* quote */
.quote-text { font-size: 1.25rem; font-style: italic; line-height: 1.5; }
.quote-author { text-align: right; color: var(--muted); font-weight: 600; }

/* mood */
.mood-row { display: flex; gap: 10px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.mood {
  font-size: 2.4rem; background: #fff; border: 3px solid transparent; border-radius: 16px;
  padding: 6px 10px; cursor: pointer; transition: transform .15s;
}
.mood:hover { transform: scale(1.15); }
.mood.picked { border-color: var(--accent); background: #fff7e6; transform: scale(1.15); }
.mood-label { text-align: center; font-weight: 700; min-height: 1.6em; }

/* inputs & buttons */
textarea, input[type="text"] {
  width: 100%; border: 2px solid #e8e4d8; border-radius: 12px; padding: 10px;
  font-size: 1rem; font-family: inherit; background: #fffdf7; resize: vertical;
}
textarea:focus, input:focus { outline: none; border-color: var(--accent2); }
.subject-row { display: block; margin: 10px 0; }
.subject-row span { font-weight: 700; display: block; margin-bottom: 4px; }
.btn {
  display: inline-block; margin-top: 10px; padding: 10px 22px; font-size: 1rem; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, var(--accent2), #7b61ff);
  border: none; border-radius: 999px; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: #fff; color: var(--ink); border: 2px solid #e8e4d8; }
.optional-badge {
  display: inline-block; background: #e9f9f0; color: #1e7a4c; font-weight: 700;
  border-radius: 999px; padding: 4px 12px; font-size: .85rem; margin-left: 8px;
}
.save-msg { color: var(--good); font-weight: 600; min-height: 1.4em; }
.t5-word { font-size: 1.6rem; font-weight: 800; }
.t5-lock { background: #f4f8ff; border-radius: 12px; padding: 12px; }

/* ---------- PIN gate ---------- */
.pin-gate {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2b2b4a, #4d3a7a); padding: 20px;
}
.pin-card {
  background: #fff; border-radius: 24px; padding: 32px 28px; max-width: 380px; width: 100%;
  text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.pin-card h1 { margin: 0 0 6px; font-size: 1.4rem; }
.pin-card .pin-sub { color: var(--muted); margin: 0 0 16px; }
.pin-card input {
  font-size: 2rem; letter-spacing: .6em; text-align: center; width: 100%;
  border: 2px solid #e8e4d8; border-radius: 14px; padding: 10px 10px 10px 16px; margin-bottom: 6px;
}
.pin-hint { color: var(--bad); min-height: 1.4em; font-weight: 600; }
.pin-funny { font-size: 1.15rem; font-weight: 600; margin: 12px 0 18px; line-height: 1.5; }
.pin-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- parent dashboard ---------- */
.kid-tabs { display: flex; gap: 10px; justify-content: center; margin: 14px 0 20px; }
.kid-tab {
  padding: 10px 26px; border-radius: 999px; border: 2px solid #e8e4d8; background: #fff;
  font-size: 1.05rem; font-weight: 700; cursor: pointer;
}
.kid-tab.active { background: linear-gradient(135deg, var(--accent2), #7b61ff); color: #fff; border-color: transparent; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: var(--radius); padding: 14px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.stat .stat-v { font-size: 1.5rem; font-weight: 800; }
.stat .stat-l { color: var(--muted); font-size: .85rem; }
table.week { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
table.week th, table.week td { padding: 10px 8px; text-align: center; border-bottom: 1px solid #f0eee2; font-size: .95rem; }
table.week th { background: #f8f6ec; }
.muted { color: var(--muted); }
.conv-day { background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.conv-day ul { margin: 6px 0 0; padding-left: 18px; }
.conv-day li { margin: 4px 0; }
.grade {
  display: inline-block; width: 64px; height: 64px; line-height: 64px; border-radius: 50%;
  font-size: 1.8rem; font-weight: 800; color: #fff; background: #b9b9c9;
}
.grade-A { background: linear-gradient(135deg, #35b26f, #6bcb77); }
.grade-B { background: linear-gradient(135deg, #4d96ff, #7b61ff); }
.grade-C { background: linear-gradient(135deg, #ff9f45, #ff6b6b); }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--accent2); font-weight: 600; text-decoration: none; }

[hidden] { display: none !important; }
