:root {
  --bg: #fff8ef;
  --card: #ffffff;
  --ink: #2b2140;
  --muted: #6f6680;
  --brand: #ff6b3d;
  --brand-2: #7b4dff;
  --ok: #19a463;
  --err: #d6334a;
  --line: #eadfce;
  --radius: 18px;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100vh; -webkit-tap-highlight-color: transparent; }
.wrap { max-width: 480px; margin: 0 auto; padding: 16px 16px 40px; }
header.top { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
header.top img { width: 44px; height: 44px; border-radius: 12px; }
header.top h1 { font-size: 22px; margin: 0; line-height: 1.1; }
header.top small { color: var(--muted); display: block; font-size: 13px; font-weight: 600; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: 0 2px 0 var(--line), 0 8px 24px rgba(43,33,64,.06); margin-bottom: 14px; }
h2 { font-size: 19px; margin: 0 0 10px; }
p { line-height: 1.45; margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 14px; }
label { display: block; font-weight: 700; font-size: 14px; margin: 12px 0 6px; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=password] {
  width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 2px solid var(--line);
  border-radius: 12px; background: #fffdf9; color: var(--ink);
}
input:focus { outline: none; border-color: var(--brand-2); }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.row .narrow { flex: 0 0 110px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 14px; margin: 12px 0; }
.check input { width: 22px; height: 22px; margin: 0; flex: 0 0 22px; accent-color: var(--brand-2); }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 800;
  font-size: 17px; border: 0; border-radius: 14px; padding: 14px 18px; background: var(--brand); color: #fff;
  cursor: pointer; text-decoration: none; width: 100%;
}
button.secondary, .btn.secondary { background: #f1e8ff; color: var(--brand-2); }
button.ghost { background: transparent; color: var(--muted); font-weight: 700; font-size: 15px; padding: 8px; }
button.small { width: auto; font-size: 14px; padding: 8px 12px; border-radius: 10px; }
button:disabled { opacity: .5; }
.err { color: var(--err); font-weight: 700; margin-top: 10px; min-height: 1em; }
.hidden { display: none !important; }

/* QR */
.qr-card { text-align: center; }
.qr-box { background: #fff; padding: 14px; border-radius: 16px; display: inline-block; border: 3px solid var(--ink); }
.qr-box svg, .qr-box img { display: block; width: min(68vw, 280px); height: auto; }
.timer { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 12px auto 4px; max-width: 280px; }
.timer > i { display: block; height: 100%; background: var(--brand-2); transition: width 1s linear; }
.kids { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0 0; }
.chip { background: #fff1e6; color: #a2431f; padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 14px; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge.on { background: #e3f7ec; color: var(--ok); }
.badge.off { background: #fdeceb; color: var(--err); }

.links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.links a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 14px;
  background: #f7f2ff; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 14px; }
.links a span { font-size: 26px; }
.links a:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; justify-content: center; }

.install { background: linear-gradient(135deg, #7b4dff, #ff6b3d); color: #fff; }
.install .muted { color: #f4ecff; }
.install ol { margin: 6px 0 0 18px; padding: 0; line-height: 1.6; }
.install button { background: #fff; color: var(--brand-2); margin-top: 8px; }

/* ---- antet + bara de tab-uri ---- */
.pts-pill { margin-left: auto; background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 900; box-shadow: 0 2px 0 var(--line); }
body:has(#tabbar:not(.hidden)) .wrap { padding-bottom: 96px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 10; }
.tabbar button { flex: 1; flex-direction: column; gap: 2px; background: transparent; color: var(--muted); font-size: 12px; padding: 6px 2px; border-radius: 12px; }
.tabbar button span { font-size: 22px; }
.tabbar button.on { color: var(--brand-2); background: #f4efff; }

/* ---- puncte ---- */
.score { text-align: center; }
.big-pts { font-size: 54px; font-weight: 900; color: var(--brand); line-height: 1.1; }
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 260px; margin: 12px auto 6px; }
.stamps i { aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 20px; }
.stamps i.on { border: 2px solid #ffb703; background: #fff7dc; }
.mission { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; background: #f7f2ff; margin-bottom: 8px;
  color: var(--ink); text-decoration: none; font-weight: 700; }
.mission .plus, .mission .done { margin-left: auto; font-weight: 900; white-space: nowrap; }
.mission .plus { color: var(--brand); }
.mission .done { color: var(--ok); }
.mission.is-done { background: #eef9f2; }
.reward { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.reward:last-child { border-bottom: 0; }
.reward .ic { font-size: 30px; }
.reward > div { flex: 1; }
.voucher { justify-content: space-between; background: #fff4ea; color: var(--ink); margin-bottom: 8px; font-size: 15px; text-align: left; }
.voucher span { color: var(--brand); white-space: nowrap; }
.hist > div:not(.day), .hist .day > div { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.hist small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.hist .r { text-align: right; font-weight: 800; }
.hist .neg { color: var(--err); }
.hist .day { margin-bottom: 14px; }
.hist .day > b { display: block; text-transform: capitalize; margin-bottom: 2px; }

/* ---- cont ---- */
.kid-row { display: flex; gap: 6px; margin-bottom: 8px; }
.kid-row input { flex: 1; min-width: 0; }
.kid-row .narrow { flex: 0 0 80px; }
.kid-row button { flex: 0 0 auto; }

/* ---- joc ---- */
.wheel-wrap { position: relative; width: 300px; max-width: 100%; margin: 0 auto; }
.wheel-wrap canvas { width: 100%; height: auto; display: block; }
.wheel-pin { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); font-size: 30px; color: var(--ink); z-index: 2; }

/* ---- modal + toast ---- */
.modal { position: fixed; inset: 0; background: rgba(43,33,64,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal .card { width: 100%; max-width: 400px; text-align: center; }
.modal button { margin-top: 12px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px;
  border-radius: 14px; font-weight: 800; z-index: 30; max-width: 90vw; text-align: center; word-break: break-word; }
