/* StudyDeck — friendly, big-touch-target UI for a 9- and 12-year-old (and their parents). */

:root {
  --bg: #f5f8fc;
  --card: #ffffff;
  --ink: #1a2433;
  --muted: #5a6b80;
  --brand: #2b6cb0;
  --brand-ink: #ffffff;
  --accent: #38a169;
  --warn: #c53030;
  --gold: #d69e2e;
  --line: #dde6f0;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 12px 16px 64px; }
.loading { text-align: center; color: var(--muted); margin-top: 30vh; }
.hidden { display: none !important; }
.error { color: var(--warn); min-height: 1.2em; }
.mono { font-variant-numeric: tabular-nums; }

/* top bar */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 0 16px; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.who { color: var(--muted); font-size: 0.9rem; }

/* buttons */
.btn {
  display: inline-block; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600;
  padding: 10px 18px; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.big { display: block; width: 100%; padding: 14px; font-size: 1.05rem; margin-top: 16px; }
.btn.small { padding: 4px 10px; font-size: 0.8rem; }
.btn.ghost { background: transparent; }

/* login */
.login { text-align: center; padding-top: 8vh; }
.login h1 { font-size: 2rem; }
.tagline { color: var(--muted); }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.profile-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 8px; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.profile-card .avatar { font-size: 2.2rem; }
.pin-form { display: flex; flex-direction: column; gap: 10px; max-width: 260px; margin: 0 auto; }
.pin-form input {
  font-size: 1.4rem; text-align: center; letter-spacing: 0.4em;
  padding: 10px; border: 1px solid var(--line); border-radius: var(--radius);
}

/* skill cards on home */
h2 { margin: 8px 0 12px; }
.skill-list { display: flex; flex-direction: column; gap: 12px; }
.skill-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink);
}
.skill-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.skill-name { font-weight: 700; }
.badges { display: flex; gap: 6px; flex-shrink: 0; }
.badge {
  font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--bg); color: var(--muted); white-space: nowrap;
}
.badge.streak { background: #fff8e6; color: var(--gold); }
.meter { height: 10px; background: var(--bg); border-radius: 999px; margin: 10px 0 6px; overflow: hidden; }
.meter-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s; }
.skill-sub { font-size: 0.8rem; color: var(--muted); }

/* concept card */
.teks-line { color: var(--muted); font-size: 0.85rem; margin-top: -6px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin: 14px 0;
}
.card h3 { margin: 2px 0 10px; font-size: 1rem; }
.terms div { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 10px; padding: 4px 0; }
.terms dt { font-weight: 700; }
.terms dd { margin: 0; color: var(--muted); }
.bigidea-text { font-size: 1.1rem; font-weight: 800; color: var(--brand); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps .step {
  counter-increment: step; position: relative; padding: 10px 12px 10px 44px;
  border-left: 3px solid var(--brand); background: var(--bg);
  border-radius: 8px; margin-bottom: 8px;
}
.steps .step::before {
  content: counter(step); position: absolute; left: 12px; top: 12px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--brand);
  color: var(--brand-ink); font-size: 0.8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step-do { font-weight: 600; }
.step-because { color: var(--muted); font-size: 0.88rem; }
.step-because::before { content: "why: "; font-style: italic; }
.step.veiled { filter: blur(6px); pointer-events: none; user-select: none; }
.check-line { background: #ecfbf1; border-radius: 8px; padding: 10px 12px; font-weight: 600; }
.parent-only { border-left: 4px solid var(--gold); }

/* practice */
.prompt { font-size: 1.4rem; font-weight: 800; }
.answer-row { display: flex; gap: 8px; }
.answer-row input {
  flex: 1; font-size: 1.2rem; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); min-width: 0;
}
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { text-align: left; }
.choice-right { background: #ecfbf1; border-color: var(--accent); }
.choice-wrong { background: #fdf0f0; border-color: var(--warn); opacity: 0.7; }
.right { color: var(--accent); font-weight: 700; }
.wrong { color: var(--warn); font-weight: 600; }
.actions { display: flex; gap: 10px; margin-top: 12px; }
.hint-steps { margin-top: 10px; }

/* visuals */
.visual { margin: 12px 0; max-width: 100%; }
.fraction-bars .fb-filled { fill: var(--brand); stroke: #fff; }
.fraction-bars .fb-empty { fill: var(--bg); stroke: var(--line); }
.fraction-bars .fb-label { font-size: 14px; font-weight: 700; fill: var(--ink); }
.area-model { border-collapse: collapse; }
.area-model th, .area-model td {
  border: 2px solid var(--brand); padding: 12px 22px; text-align: center;
  font-weight: 700; font-size: 1.05rem;
}
.area-model th { border-color: transparent; color: var(--muted); }
.area-model td { background: var(--bg); }

/* dashboard */
.dash { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.dash th { text-align: left; color: var(--muted); font-size: 0.78rem; padding: 4px 6px; }
.dash td { padding: 6px; border-top: 1px solid var(--line); }
.dash .low { color: var(--warn); font-weight: 700; }
.dash .ok { color: var(--accent); font-weight: 700; }
.planner summary { cursor: pointer; font-weight: 600; color: var(--brand); margin-top: 8px; }
.plan-grid { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.plan-item { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; }
