/* Scam School — one big card per screen, phone-first, large tap targets. */
:root {
  --bg: #EEF3F7; --surface: #FFFFFF; --ink: #13263A; --muted: #4E6274; --line: #D3DEE7;
  --accent: #F2A900; --accent-soft: #FFF3D1; --on-accent: #13263A;
  --safe: #1E7D4F; --safe-soft: #E2F4EA; --scam: #C8312B; --scam-soft: #FBE6E4;
  --phone: #F4F7FA; --bubble: #FFFFFF; --link: #2266CC;
  --display: "Baloo 2", "Mukta", system-ui, sans-serif;
  --body: "Mukta", "Noto Sans", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1B26; --surface: #172634; --ink: #E8F0F6; --muted: #9DB0C0; --line: #2A3D4E;
    --accent: #F5B82E; --accent-soft: #3A3014;
    --safe: #4CC38A; --safe-soft: #153527; --scam: #FF6B61; --scam-soft: #3D1D1B;
    --phone: #1C2E3E; --bubble: #24384A; --link: #7DB3FF;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 19px; line-height: 1.55;
  min-height: 100vh; display: flex; flex-direction: column;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
a { color: inherit; }
button, select, input, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* top bar */
.bar {
  position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line);
  padding-top: max(10px, env(safe-area-inset-top, 0px)); padding-bottom: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.bar-in { max-width: 720px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 22px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand::before { content: ""; width: 26px; height: 26px; border-radius: 8px; background: var(--accent) url("/icons/shield.svg") center / 18px no-repeat; }
.lang-pick select {
  font-weight: 600; font-size: 17px; color: var(--ink); background: var(--bg);
  border: 2px solid var(--line); border-radius: 999px; padding: 6px 12px; min-height: 44px; max-width: 46vw;
}

main {
  flex: 1; width: 100%; max-width: 720px; margin: 0 auto; display: grid; gap: 18px; align-content: start;
  padding-block: 20px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.loading { color: var(--muted); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(38px, 9vw, 56px); font-weight: 800; }
h2 { font-size: 28px; font-weight: 800; }
h3 { font-size: 22px; font-weight: 800; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 16px; }

/* home */
.hero { display: grid; gap: 10px; padding-block: 4px; }
.hero .words { display: flex; flex-wrap: wrap; gap: 0 14px; }
.hero .words span:nth-child(1) { color: var(--scam); }
.hero .words span:nth-child(2) { color: var(--accent); }
.hero .words span:nth-child(3) { color: var(--safe); }
.hero p { font-size: 21px; color: var(--muted); max-width: 34em; }

.levels { display: grid; gap: 12px; }
.lvl {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 14px;
  background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 14px 16px;
  text-decoration: none; min-height: 88px;
}
.lvl:hover { border-color: var(--ink); }
.lvl .ic { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); }
.lvl .t { min-width: 0; }
.lvl .t b { display: block; font-size: 21px; line-height: 1.25; }
.lvl .t small { display: block; color: var(--muted); font-size: 16px; line-height: 1.35; }
.lvl .num { font: 600 14px var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lvl.locked { opacity: .6; border-style: dashed; }
.lvl.locked .ic { background: var(--line); }
.chip { font: 700 14px/1.3 var(--body); border-radius: 12px; padding: 4px 10px; text-align: center; }
.levels > *, main > * { min-width: 0; }
.chip.ok { background: var(--safe-soft); color: var(--safe); }
.chip.lock { background: var(--line); color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: grid; gap: 14px; min-width: 0; }
.card.soft { background: var(--accent-soft); border-color: transparent; }
.helper { display: flex; gap: 12px; align-items: center; background: var(--accent-soft); border-radius: 14px; padding: 14px 16px; font-size: 18px; }
.helper b { font-size: 21px; font-variant-numeric: tabular-nums; }
.note { font-size: 16px; color: var(--muted); border-inline-start: 4px solid var(--accent); padding-block: 4px; padding-inline: 12px 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  font-weight: 700; font-size: 20px; border-radius: 14px; border: 2px solid var(--ink);
  background: var(--ink); color: var(--surface); padding: 10px 22px; min-height: 56px; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.wa { background: #1F8F4E; border-color: #1F8F4E; color: #fff; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 6px 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 17px; text-align: start; }
.row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.stack { display: grid; gap: 10px; }
.listen {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; min-height: 44px;
}
.listen[hidden] { display: none; }

/* lessons */
.step { font: 600 15px var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--ink); }
.dots i.ok { background: var(--safe); }
.dots i.bad { background: var(--scam); }
.lesson-ic { width: 84px; height: 84px; border-radius: 22px; background: var(--accent-soft); display: grid; place-items: center; }
.points { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.points li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; font-size: 20px; }
.points li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); margin-top: 10px; margin-inline-start: 4px; }
.rule { border-radius: 14px; background: var(--ink); color: var(--surface); padding: 16px 18px; font: 800 24px/1.25 var(--display); display: grid; gap: 4px; }
.rule .step { color: inherit; opacity: .75; }

/* phone / message mocks */
.phone { background: var(--phone); border: 2px solid var(--line); border-radius: 22px; padding: 14px; display: grid; gap: 10px; min-width: 0; }
.phone .head { display: flex; align-items: center; gap: 10px; font-weight: 700; min-width: 0; }
.phone .head > div { min-width: 0; overflow-wrap: anywhere; }
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--line); flex: none; }
.kind { font: 600 13px var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bubble { background: var(--bubble); border-radius: 16px; border-start-start-radius: 4px; padding: 12px 14px; font-size: 19px; overflow-wrap: anywhere; white-space: pre-line; }
.lnk { color: var(--link); text-decoration: underline; overflow-wrap: anywhere; }
.ctx { font-size: 18px; color: var(--muted); font-style: italic; }
.mock-ad .bubble { border-radius: 12px; border: 2px dashed var(--line); font-weight: 600; }
.mock-poster .bubble { border-radius: 8px; background: #FFD84D; color: #13263A; font: 800 22px/1.3 var(--display); text-align: center; border: 3px solid #13263A; }
.mock-poster .qrimg { width: 96px; height: 96px; margin: 8px auto 0; display: block; }

/* browser mock */
.browser { border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bubble); min-width: 0; }
.browser .url { background: var(--phone); padding: 8px 12px; font: 600 15px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; display: flex; gap: 8px; align-items: center; }
.browser .url::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; box-shadow: 14px 0 0 var(--line), 28px 0 0 var(--line); margin-inline-end: 30px; }
.browser .page { padding: 16px; white-space: pre-line; font-size: 19px; }
.browser.alarm .page { background: #B3261E; color: #fff; font-weight: 700; }

/* email mock */
.email { border: 2px solid var(--line); border-radius: 14px; background: var(--bubble); overflow: hidden; min-width: 0; }
.email .meta { padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--phone); display: grid; gap: 2px; }
.email .subj { font-weight: 700; font-size: 20px; }
.email .body { padding: 12px 14px; display: grid; gap: 10px; }
.part { display: block; width: 100%; text-align: start; background: transparent; color: inherit; border: 2px dashed transparent; border-radius: 10px; padding: 6px 8px; cursor: pointer; font-size: 18px; overflow-wrap: anywhere; }
.spot .part { border-color: var(--line); }
.spot .part:hover { border-color: var(--ink); }
.part.from { font-size: 16px; }
.part.from b { font-size: 18px; }
.part.btnpart span { display: inline-block; background: #F2A900; color: #13263A; font-weight: 700; border-radius: 8px; padding: 8px 18px; }
.part.filepart span { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-weight: 600; }
.part.hit { border-style: solid; border-color: var(--scam); background: var(--scam-soft); }
.part.picked { border-style: solid; border-color: var(--ink); }
.part.missed { border-style: solid; border-color: var(--safe); }
.part[disabled] { cursor: default; }

/* answers */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font: 800 24px var(--display); border-radius: 18px; padding: 14px 8px; min-height: 104px; cursor: pointer; border: 3px solid; }
.choice.safe { background: var(--safe-soft); border-color: var(--safe); color: var(--safe); }
.choice.scam { background: var(--scam-soft); border-color: var(--scam); color: var(--scam); }
.choice[disabled] { opacity: .45; cursor: default; }
.choice.picked { opacity: 1; box-shadow: 0 0 0 4px var(--ink); }
.opts { display: grid; gap: 10px; }
.opt { text-align: start; background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 19px; min-height: 60px; cursor: pointer; display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; }
.opt:hover:not([disabled]) { border-color: var(--ink); }
.opt .l { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-weight: 700; }
.opt.right { border-color: var(--safe); background: var(--safe-soft); }
.opt.wrongpick { border-color: var(--scam); background: var(--scam-soft); }
.opt[disabled] { cursor: default; }
.safebtn { justify-self: start; }
.fb { border-radius: 16px; padding: 16px 18px; display: grid; gap: 8px; font-size: 19px; }
.fb.ok { background: var(--safe-soft); border: 2px solid var(--safe); }
.fb.bad { background: var(--scam-soft); border: 2px solid var(--scam); }
.fb strong { font: 800 24px var(--display); }
.fb.ok strong { color: var(--safe); }
.fb.bad strong { color: var(--scam); }

/* result */
.cert { border: 4px double var(--accent); border-radius: 20px; padding: 24px 20px; text-align: center; display: grid; gap: 8px; background: var(--surface); }
.cert .score { font: 800 64px var(--display); font-variant-numeric: tabular-nums; line-height: 1; }
.cert .name { font: 800 30px var(--display); overflow-wrap: anywhere; }
.pass { color: var(--safe); }
.fail { color: var(--scam); }
.mist { display: grid; gap: 12px; }
.mist > div { border-inline-start: 4px solid var(--scam); padding-block: 4px; padding-inline: 12px 0; display: grid; gap: 4px; }

.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tipt { display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center; text-decoration: none; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 12px 8px 14px; line-height: 1.3; }
.tipt:hover { border-color: var(--ink); }
.tipt b { font-size: 17px; }
.tipt .muted { font-variant-numeric: tabular-nums; font-weight: 600; }
.art { display: flex; justify-content: center; align-items: center; height: 64px; padding-inline: 8px; background: var(--accent-soft); border-radius: 14px; width: 100%; }
.art svg { width: 52px; height: 52px; flex: none; }
.art svg + svg { margin-inline-start: -12px; }
.art svg:first-child:nth-last-child(3), .art svg:first-child:nth-last-child(3) ~ svg { width: 40px; height: 40px; }
.art svg:first-child:nth-last-child(3) ~ svg { margin-inline-start: -6px; }
.rule-line { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 4px 0; }
label { font-weight: 600; }
textarea { width: 100%; font-size: 19px; line-height: 1.5; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical; }
input[type=text], input[type=tel] { width: 100%; font-size: 20px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); min-height: 54px; }
.num { font: 800 56px var(--display); letter-spacing: .04em; font-variant-numeric: tabular-nums; line-height: 1; }

.foot { border-top: 1px solid var(--line); background: var(--surface); padding-block: 14px calc(14px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); font-size: 15px; color: var(--muted); }
.foot-in { max-width: 720px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; }

@media (max-width: 420px) {
  .choice { font-size: 21px; min-height: 96px; }
  .lvl { grid-template-columns: 48px 1fr; }
  .lvl .ic { width: 48px; height: 48px; }
  .lvl .chip { grid-column: 2; justify-self: start; }
}
@media (prefers-reduced-motion: no-preference) {
  .fb, .cert { animation: pop .25s ease-out; }
  @keyframes pop { from { transform: scale(.97); } to { transform: none; } }
}

/* right-to-left (Arabic) */
[dir="rtl"] .rule, [dir="rtl"] .hero p { text-align: right; }
.lnk, .url, bdi { unicode-bidi: isolate; }
