/* AbzzyArcade — Design System v2 "Soft Play": light, soft, playful, RTL Hebrew. See DESIGN-SYSTEM.md. */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;700;800&family=Varela+Round&display=swap');

:root {
  /* neutrals */
  --bg: #F5F5FB;
  --surface: #FFFFFF;
  --surface-2: #FBFBFE;
  --ink: #2C2C3A;
  --ink-soft: #6C6C82;
  --ink-faint: #A7A7BD;
  --line: #ECECF4;

  /* pastel ramps: fill + readable ink */
  --coral-bg: #FBD9D3;   --coral-ink: #EE6A5B;
  --mint-bg:  #CDEBD8;   --mint-ink:  #2E9A6B;
  --sky-bg:   #CFE7F6;   --sky-ink:   #3F92C9;
  --peach-bg: #FBE3C2;   --peach-ink: #D98E2E;
  --lav-bg:   #E1DAF5;   --lav-ink:   #7E6BC9;
  --pink-bg:  #F9D6E4;   --pink-ink:  #D96E94;

  /* semantic */
  --primary: #F4796B;  --primary-hover: #EE6A5B;  --primary-ink: #FFFFFF;
  --ok: #2E9A6B;  --warn: #D98E2E;  --danger: #E2655F;

  /* shape + shadow */
  --r-card: 22px;  --r-pill: 999px;  --r-input: 14px;  --r-chip: 16px;
  --shadow-sm: 0 4px 14px rgba(36,37,64,.06);
  --shadow:    0 10px 30px rgba(36,37,64,.08);
  --shadow-lg: 0 16px 40px rgba(36,37,64,.12);

  --font-display: 'Varela Round', 'Heebo', system-ui, sans-serif;
  --font-body: 'Heebo', system-ui, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
/* faint decorative blobs behind everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(420px 320px at 92% -6%, rgba(244,121,107,.10), transparent 70%),
    radial-gradient(380px 300px at 4% 8%, rgba(126,107,201,.10), transparent 70%),
    radial-gradient(420px 360px at 50% 108%, rgba(46,154,107,.08), transparent 70%);
}
.wrap { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 18px; }

h1, h2, h3 { margin: 0 0 12px; line-height: 1.25; }
h1 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
.muted { color: var(--ink-soft); }
.small { font-size: .82rem; }

.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.center { text-align: center; }
.spacer { height: 10px; }
.hidden { display: none !important; }

/* ---------- cards ---------- */
.card {
  position: relative; background: var(--surface); border-radius: var(--r-card);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; border: none;
}
.card.tappable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.card.tappable:hover { box-shadow: var(--shadow-lg); }
.card.tappable:active { transform: scale(.985); }

/* ---------- buttons ---------- */
button, .btn {
  font: inherit; font-weight: 700; border: none; cursor: pointer;
  -webkit-appearance: none; appearance: none; white-space: nowrap;
  border-radius: var(--r-pill); padding: 13px 22px;
  background: var(--primary); color: var(--primary-ink);
  box-shadow: none; transition: filter .12s, transform .08s;
}
button:hover, .btn:hover { filter: brightness(1.03); }
button:active, .btn:active { transform: scale(.97); }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
button.ghost, .btn.ghost { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
button.ok { background: var(--mint-ink); }
button.danger { background: var(--danger); }
button.small { padding: 9px 15px; font-size: .85rem; }
button.full { width: 100%; }
/* soft colored buttons */
.btn.soft.coral { background: var(--coral-bg); color: var(--coral-ink); box-shadow: none; }
.btn.soft.mint  { background: var(--mint-bg);  color: var(--mint-ink);  box-shadow: none; }
.wrap-flex { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- inputs ---------- */
input, select, textarea {
  font: inherit; width: 100%; padding: 13px 14px; border-radius: var(--r-input);
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  margin-bottom: 10px; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--coral-bg); box-shadow: 0 0 0 3px var(--coral-bg);
}
input::placeholder { color: var(--ink-faint); }
label { display: block; font-size: .82rem; color: var(--ink-soft); margin-bottom: 5px; font-weight: 500; }

/* ---------- pills ---------- */
.pill { display: inline-block; padding: 5px 12px; border-radius: var(--r-pill); font-size: .76rem; font-weight: 700; }
.pill.ok     { background: var(--mint-bg);  color: var(--mint-ink); }
.pill.warn   { background: var(--peach-bg); color: var(--peach-ink); }
.pill.muted  { background: #ECECF4;         color: var(--ink-soft); }
.pill.accent { background: var(--lav-bg);   color: var(--lav-ink); }
.pill.points { background: var(--mint-bg);  color: var(--mint-ink); }

/* ---------- numbers ---------- */
.balance { font-family: var(--font-display); font-size: 2.1rem; color: var(--primary); line-height: 1; }
.big-num { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; }

/* ---------- stat chips ---------- */
.chips { display: flex; gap: 10px; }
.chip {
  flex: 1; background: var(--surface); border-radius: var(--r-chip); box-shadow: var(--shadow-sm);
  padding: 12px; text-align: center;
}
.chip .lab { font-size: .74rem; color: var(--ink-soft); font-weight: 500; }
.chip .val { font-family: var(--font-display); font-size: 1.25rem; margin-top: 2px; }

/* ---------- grids ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .grid { grid-template-columns: 1fr; } }

/* ---------- soft colored tile / list-row ---------- */
.tile {
  position: relative; overflow: hidden; border-radius: var(--r-card); padding: 18px;
  margin-bottom: 12px; cursor: pointer; transition: transform .12s; color: var(--ink);
}
.tile:active { transform: scale(.985); }
.tile .tile-ic { font-size: 1.6rem; }
.tile--coral { background: var(--coral-bg); } .tile--coral .tile-t { color: var(--coral-ink); }
.tile--mint  { background: var(--mint-bg);  } .tile--mint  .tile-t { color: var(--mint-ink); }
.tile--sky   { background: var(--sky-bg);   } .tile--sky   .tile-t { color: var(--sky-ink); }
.tile--peach { background: var(--peach-bg); } .tile--peach .tile-t { color: var(--peach-ink); }
.tile--lav   { background: var(--lav-bg);   } .tile--lav   .tile-t { color: var(--lav-ink); }
.tile-t { font-weight: 700; font-size: 1.02rem; }
/* bubble overlay */
.tile::after, .subject-tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(22px 22px at 88% 18%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(46px 46px at 96% 84%, rgba(255,255,255,.38), transparent 62%),
    radial-gradient(14px 14px at 78% 58%, rgba(255,255,255,.45), transparent 60%);
}

/* ---------- subject tiles (kid task picker) ---------- */
.subjects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; grid-auto-rows: 1fr; }
.subject-tile {
  position: relative; overflow: hidden; border-radius: var(--r-card); padding: 18px 14px;
  text-align: center; cursor: pointer; transition: transform .12s, box-shadow .12s; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.subject-tile:hover { box-shadow: var(--shadow); }
.subject-tile:active { transform: scale(.98); }
.subject-tile.coral { background: var(--coral-bg); } .subject-tile.coral .subj-name { color: var(--coral-ink); }
.subject-tile.sky   { background: var(--sky-bg);   } .subject-tile.sky   .subj-name { color: var(--sky-ink); }
.subject-tile.lav   { background: var(--lav-bg);   } .subject-tile.lav   .subj-name { color: var(--lav-ink); }
.subject-tile.mint  { background: var(--mint-bg);  } .subject-tile.mint  .subj-name { color: var(--mint-ink); }
.subject-tile.peach { background: var(--peach-bg); } .subject-tile.peach .subj-name { color: var(--peach-ink); }
.subj-illo { position: relative; z-index: 1; width: auto; max-width: 86px; height: 84px; object-fit: contain;
  margin: 0 0 8px; display: block; }
.subj-icon { font-size: 2.1rem; line-height: 1; }
.subj-name { position: relative; z-index: 1; font-family: var(--font-display); font-size: 1.15rem; }
.subj-sub { position: relative; z-index: 1; color: var(--ink-soft); font-size: .8rem; margin-top: 2px; }
.subj-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 1.3rem; margin: 6px 0 12px; }

.task-card .points { margin-top: 10px; }
.quiz-banner { background: var(--peach-bg); }
.quiz-banner strong { color: var(--peach-ink); }

/* ---------- segmented tabs ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; padding: 5px;
  background: var(--surface-2); border-radius: var(--r-pill); box-shadow: var(--shadow-sm); }
.tabs button { flex: 1; background: transparent; color: var(--ink-soft); box-shadow: none;
  padding: 10px 8px; font-size: .9rem; border-radius: var(--r-pill); white-space: nowrap; }
.tabs button:hover { filter: none; }
.tabs button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
/* wrapping pill tab bar (parent dashboard, many tabs) — all tabs stay readable */
.tabs.scroll { background: transparent; box-shadow: none; padding: 0; gap: 8px; flex-wrap: wrap; }
.tabs.scroll button { flex: 0 0 auto; background: var(--surface); color: var(--ink-soft); box-shadow: var(--shadow-sm); padding: 9px 16px; }
.tabs.scroll button.active { background: var(--primary); color: #fff; }

/* ---------- rewards shop (two device columns) ---------- */
.shop-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.shop-col { display: flex; flex-direction: column; gap: 10px; }
.shop-col-head {
  font-family: var(--font-display); font-size: 1.05rem; text-align: center;
  padding: 12px 8px; border-radius: var(--r-card); display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.shop-col-ic { width: 48px; height: 48px; object-fit: contain; }
.col-computer .shop-col-head { background: var(--sky-bg); color: var(--sky-ink); }
.col-phone .shop-col-head { background: var(--coral-bg); color: var(--coral-ink); }
.reward-card {
  border-radius: var(--r-card); box-shadow: var(--shadow-sm); padding: 14px 12px;
  text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: stretch;
}
.col-computer .reward-card { background: #ECF5FC; }
.col-phone .reward-card { background: #FDEFEC; }
.reward-title { font-weight: 700; font-size: .95rem; line-height: 1.3; }
.reward-price { font-family: var(--font-display); font-size: 1.5rem; color: var(--mint-ink); margin-top: 2px; }
.reward-price-lbl { font-family: var(--font-body); font-size: .8rem; color: var(--ink-soft); font-weight: 500; }
.reward-card .ok { margin-top: 4px; }
/* duration picker buttons (kid buys X minutes of an app) */
.dur-row { display: flex; gap: 6px; margin-top: 8px; }
.dur-btn { flex: 1; display: flex; flex-direction: column; gap: 1px; padding: 8px 2px; background: var(--surface); color: var(--ink); border-radius: var(--r-input); }
.dur-btn:hover { background: var(--mint-bg); }
.dur-btn .dur-min { font-size: .78rem; font-weight: 700; }
.dur-btn .dur-cost { font-size: .7rem; font-weight: 700; color: var(--mint-ink); }
@media (max-width: 420px) { .shop-cols { grid-template-columns: minmax(0, 1fr); } }
/* parent app card actions: 3 buttons that shrink to fit the narrow column */
.app-actions { display: flex; gap: 8px; margin-top: 2px; }
.app-actions button { flex: 1 1 0; min-width: 0; padding: 10px 6px; font-size: .9rem; }

/* ---------- illustrations ---------- */
.illo { display: block; width: 200px; max-width: 60%; margin: 8px auto; }
.illo.sm { width: 130px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--surface); color: var(--ink); padding: 14px 22px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg); z-index: 100; max-width: 90%; text-align: center; font-weight: 500;
  border-right: 6px solid var(--ink-faint);
}
.toast.err  { border-right-color: var(--danger); }
.toast.ok   { border-right-color: var(--ok); }
.toast.warn { border-right-color: var(--warn); }

/* ---------- countdown ---------- */
.countdown { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 1.3rem; color: var(--mint-ink); }
.countdown.warn { color: var(--danger); }

/* ---------- reading / questions ---------- */
.passage { line-height: 1.85; background: var(--surface-2); padding: 16px; border-radius: var(--r-input);
  max-height: 50vh; overflow-y: auto; }
.q-feedback { font-size: .9rem; margin-top: 8px; font-weight: 500; }
.q-feedback.correct { color: var(--ok); }
.q-feedback.partial { color: var(--warn); }
.q-feedback.wrong { color: var(--danger); }
.option { display: block; width: 100%; text-align: right; margin-bottom: 8px;
  background: var(--surface-2); color: var(--ink); box-shadow: none; font-weight: 500; }
.option:hover { filter: none; background: var(--coral-bg); color: var(--coral-ink); }
.option.selected { background: var(--coral-bg); color: var(--coral-ink); box-shadow: 0 0 0 2px var(--primary); }

/* ---------- progress bar ---------- */
.bar { height: 10px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--mint-ink), var(--primary)); border-radius: inherit; }

/* ---------- misc ---------- */
.loading { text-align: center; padding: 48px; color: var(--ink-soft); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.1rem; background: var(--lav-bg); color: var(--lav-ink); flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-weight: 700; }
a { color: var(--primary); }
