/* uCheckMind — one stylesheet, two themes: body.adult (default) and body.kid */
@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-wght.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #F7F7FB; --surface: #FFFFFF; --ink: #1B1F3B; --muted: #5B6075; --line: #E1E3EC;
  --navy: #1B1F3B; --navy-hover: #2A2F5C;
  --accent: #3D4EDB; --accent-ink: #2A37A8; --accent-soft: #E3E6FB;
  --ok: #1E6B3E; --ok-soft: #DDF3E6; --danger: #B42318; --danger-soft: #FDE8E7;
  --radius: 16px; --font: Vazirmatn, Tahoma, sans-serif;
}
body.kid {
  --bg: #DDF0FF; --surface: #FFFFFF; --ink: #2B2A4A; --muted: #3C4A66; --line: #B9D9F5;
  --accent: #2A37A8; --accent-ink: #1B1F3B; --accent-soft: #E3E6FB; --radius: 26px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.8; min-height: 100vh; overflow-x: hidden; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.5; margin: 0; }
p { margin: 0; }
.wrap { width: 100%; max-width: 520px; margin: 0 auto; padding: 20px 16px 40px; position: relative; z-index: 1; }
.wrap.wide { max-width: 1100px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.ltr { direction: ltr; unicode-bidi: plaintext; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; }
.logo { font-weight: 700; font-size: 18px; text-decoration: none; color: var(--ink); }
.logo span { color: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.dark { background: #1B1F3B; color: #FFFFFF; border-color: #1B1F3B; }
.card.dark .muted { color: #C9CCDA; }
.card.soft { background: var(--accent-soft); border-color: transparent; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 14px; border: 0; background: var(--navy); color: #FFFFFF; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .15s ease, background .2s ease; }
.btn:hover { background: var(--navy-hover); color: #FFFFFF; }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .choice:focus-within, .opt:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.block { width: 100%; }
.btn.icon { min-height: 40px; width: 40px; padding: 0; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent-ink); }
.btn.light { background: #FFFFFF; color: #1B1F3B; }
.btn.light:hover { background: #E3E6FB; color: #1B1F3B; }
body.kid .btn { border-radius: 22px; min-height: 58px; font-size: 18px; box-shadow: 0 5px 0 #0B0E24; }
body.kid .btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #0B0E24; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
input[type=text], input[type=tel], input[type=number], input[type=email], input[type=password], select, textarea {
  width: 100%; min-height: 50px; border-radius: 12px; border: 1px solid #C9CCDA; background: #FFFFFF; padding: 10px 14px; font: inherit; font-size: 16px; color: #1B1F3B;
}
textarea { min-height: 110px; resize: vertical; }
.error { color: var(--danger); font-size: 13px; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; background: var(--ok-soft); color: var(--ok); }
.alert.bad { background: var(--danger-soft); color: var(--danger); }

.pill { display: inline-block; font-size: 12px; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.pill.gray { background: #ECEDF2; color: #3B3F55; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }

/* audience choice cards on the landing page */
.choices { display: grid; gap: 12px; }
.choice { position: relative; display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 18px; background: #FFFFFF; border: 2px solid var(--line); cursor: pointer; transition: border-color .2s, transform .2s; }
.choice:hover { transform: translateY(-2px); }
.choice input { position: absolute; opacity: 0; }
.choice:has(input:checked) { border-color: #1B1F3B; background: #F3F4FE; }
.choice.kidpick:has(input:checked) { border-color: #1B1F3B; background: #FFF6DC; }
.choice .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; }

/* bars */
.bar { height: 10px; border-radius: 6px; background: var(--accent-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--accent); width: 0; animation: grow 1.1s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes grow { to { width: var(--w); } }

/* paid report: per-skill details + weekly plan */
details { border-top: 1px solid var(--line); padding-top: 12px; gap: 10px; }
details > summary { cursor: pointer; font-weight: 700; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: '+'; color: var(--accent); }
details[open] > summary::after { content: '−'; }
.plan { margin: 0; padding-inline-start: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }

.locked { opacity: .5; filter: blur(.4px); user-select: none; }

.paywall { position: relative; overflow: hidden; }
.paywall-preview { filter: blur(6px); user-select: none; pointer-events: none; }
.paywall-lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center; background: linear-gradient(to bottom, transparent, var(--surface) 75%); }
.paywall-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: #FFFFFF; box-shadow: 0 8px 24px rgba(61, 78, 219, .35); animation: lockPulse 2.4s ease-in-out infinite; }
@keyframes lockPulse { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .paywall-icon { animation: none; } }

/* floating background shapes (landing + kid theme) */
.floaters { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.floaters span { position: absolute; opacity: .18; animation: drift 14s ease-in-out infinite; }
@keyframes drift { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-28px) rotate(20deg); } }
.cloud { position: absolute; width: 140px; height: 46px; background: #FFFFFF; border-radius: 40px; opacity: .85; animation: cloud 40s linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #FFFFFF; border-radius: 50%; }
.cloud::before { width: 60px; height: 60px; top: -28px; right: 22px; }
.cloud::after { width: 44px; height: 44px; top: -18px; left: 24px; }
@keyframes cloud { from { transform: translateX(120vw); } to { transform: translateX(-160px); } }

/* entrance animations */
.enter { animation: enter .5s cubic-bezier(.2,.8,.2,1) both; }
.enter.d1 { animation-delay: .08s; } .enter.d2 { animation-delay: .16s; } .enter.d3 { animation-delay: .24s; } .enter.d4 { animation-delay: .32s; }
@keyframes enter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.pop { animation: pop .45s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- game ---------- */
.game { min-height: calc(100vh - 80px); display: flex; flex-direction: column; gap: 16px; }
.hud { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; }
.xp { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; }
.progress4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.progress4 i { height: 6px; border-radius: 3px; background: #C9CCDA; overflow: hidden; position: relative; }
.progress4 i.done { background: var(--accent); }
.progress4 i.now::after { content: ""; position: absolute; inset: 0; width: var(--p, 0%); background: var(--accent); transition: width .4s; }

.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 16px; animation: flip .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes flip { from { opacity: 0; transform: perspective(800px) rotateY(-24deg) translateX(-20px); } to { opacity: 1; transform: none; } }
.qprompt { font-size: 19px; font-weight: 700; line-height: 1.7; }
body.kid .qprompt { font-size: 22px; text-align: center; }
.cells { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; direction: ltr; }
.cells:not(.grid) { flex-wrap: nowrap; }
.cells:not(.grid) .cell { flex: 1 1 0; width: auto; height: auto; max-width: 56px; aspect-ratio: 1; }
.cell svg { width: 82%; height: auto; }
.cells.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 300px; margin: 0 auto; }
.cell { width: 56px; height: 56px; border-radius: 12px; background: #F1F2F8; display: grid; place-items: center; }
.cells.grid .cell { width: auto; aspect-ratio: 1; height: auto; }
body.kid .cell { background: #FFF6DC; border-radius: 16px; }
.cell.q { font-size: 28px; font-weight: 900; color: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }
.bigtext { font-size: 26px; font-weight: 700; text-align: center; letter-spacing: 2px; padding: 8px; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.opts.shapes { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); }
.opt { min-height: 56px; padding: 10px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); font: inherit; font-size: 16px; color: var(--ink); cursor: pointer; display: grid; place-items: center; transition: transform .15s, border-color .2s, background .2s; }
.opt:hover { border-color: var(--accent); transform: translateY(-2px); }
.opt.picked { border-color: var(--accent); background: var(--accent-soft); animation: pop .35s both; }
body.kid .opt { min-height: 88px; border-width: 3px; border-radius: 24px; font-size: 20px; font-weight: 700; }
.opts.yesno .opt { min-height: 64px; font-weight: 700; }

.timer { height: 8px; border-radius: 4px; background: var(--accent-soft); overflow: hidden; direction: ltr; }
.timer > i { display: block; height: 100%; background: var(--accent); transform-origin: left; animation: shrink linear forwards; }
@keyframes shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.target { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--accent-soft); }

.memo-ring { width: 64px; height: 64px; margin: 0 auto; }
.memo-ring circle { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; stroke-dasharray: 176; animation: ring linear forwards; }
@keyframes ring { to { stroke-dashoffset: 176; } }

.float-xp { position: fixed; font-weight: 900; color: var(--accent); pointer-events: none; animation: rise .9s ease-out forwards; z-index: 50; font-size: 20px; }
@keyframes rise { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-70px) scale(1.4); } }

/* stage map */
.map { position: relative; display: flex; flex-direction: column; gap: 22px; padding: 12px 0; }
.map svg.path { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; overflow: visible; }
.map svg.path path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-dasharray: 10 10; opacity: .35; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -40; } }
.node { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); width: 82%; }
.node:nth-child(odd) { align-self: flex-start; } .node:nth-child(even) { align-self: flex-end; }
.node .dot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: #ECEDF2; color: #3B3F55; flex: none; }
.node.done .dot { background: var(--ok-soft); color: var(--ok); }
.node.now { border-color: var(--accent); animation: bob 1.6s ease-in-out infinite; }
.node.now .dot { background: var(--navy); color: #FFFFFF; }
@keyframes bob { 50% { transform: translateY(-6px); } }
body.kid .node { border-radius: 40px 40px 40px 12px; background: #FFF6DC; border-color: #F2D27A; }
body.kid .node.now { border-color: #1B1F3B; }

/* mascot (original blob character, kid theme) */
.mascot { display: flex; align-items: flex-end; gap: 10px; }
.mascot svg { width: 72px; height: 72px; flex: none; animation: hop 1.4s ease-in-out infinite; }
.mascot .eye { animation: blink 4s infinite; transform-origin: center; transform-box: fill-box; }
@keyframes hop { 0%,100% { transform: translateY(0) scaleY(1); } 40% { transform: translateY(-10px) scaleY(1.04); } 60% { transform: translateY(0) scaleY(.94); } }
@keyframes blink { 0%,92%,100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.bubble { background: #FFFFFF; border-radius: 18px 18px 18px 4px; padding: 10px 14px; font-weight: 700; font-size: 15px; animation: pop .4s both; }

.stars { display: flex; justify-content: center; gap: 6px; }
.stars svg { width: 34px; height: 34px; animation: pop .5s cubic-bezier(.3,1.6,.5,1) both; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
#confetti i { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* certificate preview */
.cert-canvas { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #FFFFFF; }

/* ---------- admin ---------- */
body.admin { --radius: 12px; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 16px; background: #1B1F3B; }
.admin-nav a { color: #E3E6FB; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.admin-nav a.on, .admin-nav a:hover { background: #3D4EDB; color: #FFFFFF; }
.admin-nav form { margin-inline-start: auto; }
.admin-nav button { background: transparent; border: 1px solid #5B6075; color: #E3E6FB; border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat b { display: block; font-size: 28px; }
.tablebox { overflow-x: auto; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #F1F2F8; font-weight: 700; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; min-height: 42px; }
.filters .btn { min-height: 42px; }
nav[role=navigation] { margin-top: 12px; font-size: 14px; }
nav[role=navigation] svg { width: 18px; height: 18px; }

@media (min-width: 720px) { .choices { grid-template-columns: 1fr 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .cloud, .floaters { display: none; }
}
.teaser { -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent); mask-image: linear-gradient(to bottom, #000 45%, transparent); }
