/* ==========================================================
   حُرّاس السايبر — الهوية البصرية
   ألوان مستوحاة من Codinger + نقشة مشربية رقمية
   ========================================================== */
:root {
  --navy: #17235A;
  --navy-2: #24317A;
  --ink: #1B2140;
  --muted: #5B6386;
  --bg: #F4F6FD;
  --card: #FFFFFF;
  --line: #E3E7F5;
  --purple: #7C4DFF;
  --teal: #22C3D6;
  --green: #5DBB2F;
  --yellow: #FFD23F;
  --pink: #E0457B;
  --red: #E5484D;
  --ok: #18A058;
  --no: #E5484D;
  --warn: #F59E0B;
  --accent: var(--purple);
  --radius: 18px;
  --shadow: 0 10px 30px -12px rgba(23, 35, 90, .25);
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --display: 'Readex Pro', 'IBM Plex Sans Arabic', sans-serif;
  --mono: 'JetBrains Mono', Consolas, monospace;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%237C4DFF' stroke-opacity='.09' stroke-width='1.2'%3E%3Cpath d='M28 4 52 28 28 52 4 28z'/%3E%3Cpath d='M28 16 40 28 28 40 16 28z'/%3E%3Ccircle cx='28' cy='28' r='3'/%3E%3Cpath d='M0 0 8 8M56 0 48 8M0 56 8 48M56 56 48 48'/%3E%3C/g%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.75; font-size: 17px; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.35; margin: 0 0 .5em; color: var(--navy); }
a { color: var(--purple); }
img { max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.en, code { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
mark { background: #FFF1B8; padding: 0 .2em; border-radius: 4px; }
code { background: #EEF0FA; padding: .1em .4em; border-radius: 6px; font-size: .9em; }
.ok { color: var(--ok); } .no { color: var(--no); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; border: 0; cursor: pointer; font: 600 1rem var(--display); color: #fff; background: linear-gradient(135deg, var(--purple), #5B3BF0); padding: .7em 1.4em; border-radius: 999px; text-decoration: none; box-shadow: 0 6px 18px -6px rgba(124, 77, 255, .7); transition: transform .15s, box-shadow .15s, opacity .15s; }
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--line); }
.btn-sm { padding: .45em 1em; font-size: .9rem; }
.btn-lg { padding: .9em 2em; font-size: 1.1rem; }
.btn-block { width: 100%; }
.session-theme .btn:not(.btn-ghost) { background: var(--accent); box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 80%, transparent); }

/* ---------- topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt b { font: 700 1.25rem var(--display); color: var(--navy); }
.brand-txt small { font: 600 .7rem var(--mono); letter-spacing: .12em; color: var(--purple); text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { text-decoration: none; color: var(--ink); padding: .4em .8em; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.nav a.on, .nav a:hover { background: #EFEAFF; color: var(--purple); }
.nav .logout { color: var(--muted); }
.nav-guest .btn { color: #fff; }
.xp-chip { background: linear-gradient(135deg, #FFF4CC, #FFE38A); color: #7A5200; padding: .3em .8em; border-radius: 999px; font-weight: 700; font-size: .9rem; transition: transform .3s; }
.xp-chip.bump { transform: scale(1.25); }
.user-chip { color: var(--muted); font-size: .9rem; padding: 0 .4em; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--navy); }

/* ---------- flash / toast ---------- */
.flash { margin: 16px 0 0; padding: .8em 1.1em; border-radius: 12px; font-weight: 600; }
.flash-success { background: #E3F8EA; color: #0E6B38; }
.flash-error { background: #FDE8E8; color: #9B1C1C; }
.flash-info { background: #E6F4FF; color: #0B4F8A; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 120px); background: var(--navy); color: #fff; padding: .8em 1.4em; border-radius: 999px; font-weight: 700; z-index: 100; transition: transform .35s cubic-bezier(.2, 1.4, .4, 1); box-shadow: var(--shadow); }
.toast.show { transform: translate(-50%, 0); }
.toast-err { background: var(--red); }
.toast-info { background: #3D7BFF; }
.confetti { position: fixed; top: -12px; width: 10px; height: 14px; border-radius: 3px; z-index: 99; animation: fall 2.4s ease-in forwards; pointer-events: none; }
@keyframes fall { to { top: 105vh; transform: rotate(720deg) translateX(40px); opacity: .6; } }

/* ---------- footer ---------- */
.footer { margin-top: 60px; background: var(--navy); color: #C9D0F0; padding: 36px 0; background-image: var(--pattern); }
.footer-in { text-align: center; }
.footer b { color: #fff; }
.footer .muted { color: #95A0D0; }
.partners { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 14px; }
.logo-chip { background: #fff; border-radius: 14px; padding: 8px 14px; display: inline-flex; align-items: center; height: 58px; }
.logo-chip img { max-height: 40px; width: auto; }
.partners .x { color: var(--yellow); font-size: 1.4rem; font-weight: 700; }

/* ---------- landing ---------- */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 85% -10%, #E7DEFF 0, transparent 60%), radial-gradient(900px 400px at 0% 110%, #D8F6FA 0, transparent 60%), var(--bg); }
.hero::before { content: ''; position: absolute; inset: 0; background-image: var(--pattern); opacity: .9; pointer-events: none; }
.hero-in { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 70px 20px 60px; }
.eyebrow { display: inline-block; font: 700 .8rem var(--display); color: var(--purple); background: #EFEAFF; padding: .3em .9em; border-radius: 999px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: .3em; }
.hero h1 .grad { background: linear-gradient(90deg, var(--purple), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 560px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 18px; }
.partner-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.partner-line .logo-chip { height: 46px; padding: 6px 12px; box-shadow: var(--shadow); }
.partner-line .logo-chip img { max-height: 32px; }
.shield-art { position: relative; aspect-ratio: 1; width: 100%; max-width: 420px; margin: 0 auto; }
.shield-art .orbit { position: absolute; inset: 0; border: 2px dashed rgba(124, 77, 255, .25); border-radius: 50%; animation: spin 40s linear infinite; }
.shield-art .orbit span { position: absolute; font-size: 1.8rem; background: #fff; border-radius: 50%; width: 56px; height: 56px; display: grid; place-items: center; box-shadow: var(--shadow); animation: spin 40s linear infinite reverse; }
.shield-art svg { position: absolute; inset: 18%; width: 64%; height: 64%; filter: drop-shadow(0 20px 30px rgba(23, 35, 90, .3)); }
@keyframes spin { to { transform: rotate(360deg); } }
.section { padding: 56px 0; }
.section h2 { font-size: 2rem; text-align: center; }
.section > .wrap > p.center { max-width: 640px; margin: 0 auto 30px; color: var(--muted); }
.journey { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.j-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border-top: 5px solid var(--c); position: relative; }
.j-card .n { position: absolute; top: 12px; left: 16px; font: 700 2rem var(--display); color: var(--c); opacity: .25; }
.j-card .ic { font-size: 2rem; }
.j-card h3 { font-size: 1.05rem; margin: .4em 0 .2em; }
.j-card p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { background: var(--card); border-radius: var(--radius); padding: 22px; text-align: center; box-shadow: var(--shadow); }
.feature i { font-style: normal; font-size: 2.2rem; display: block; }
.feature h3 { font-size: 1.05rem; margin: .5em 0 .2em; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }
.ctf-teaser { background: #0B1026; color: #D6E2FF; border-radius: 28px; padding: 40px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background-image: radial-gradient(600px 200px at 10% 0, rgba(34, 195, 214, .25), transparent), var(--pattern); }
.ctf-teaser h2 { color: #fff; text-align: right; }
.ctf-teaser code { background: rgba(255, 255, 255, .1); color: #7CFFB2; }

/* ---------- auth ---------- */
.auth { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; padding-top: 50px; padding-bottom: 30px; }
.auth-side h1 { font-size: 2.6rem; }
.auth-side p { color: var(--muted); font-size: 1.1rem; }
.card { background: var(--card); border-radius: 24px; padding: 30px; box-shadow: var(--shadow); }
.auth-card h2 { font-size: 1.5rem; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; color: var(--navy); }
.field input, .inp { width: 100%; font: inherit; padding: .75em 1em; border: 2px solid var(--line); border-radius: 12px; background: #FBFCFF; transition: border-color .15s; color: var(--ink); }
.field input:focus, .inp:focus { outline: none; border-color: var(--purple); background: #fff; }
.field em { display: block; color: var(--red); font-style: normal; font-size: .85rem; margin-top: 3px; }
.field.has-err input { border-color: var(--red); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-meter { height: 8px; background: var(--line); border-radius: 99px; position: relative; margin: -4px 0 26px; }
.mini-meter i { position: absolute; inset: 0 0 0 auto; width: 0; border-radius: 99px; transition: width .3s, background .3s; }
.mini-meter span { position: absolute; top: 10px; right: 0; font-size: .8rem; color: var(--muted); }
.ticks { list-style: none; padding: 0; }
.ticks li { padding-right: 2em; position: relative; margin-bottom: .45em; }
.ticks li::before { content: '✔'; position: absolute; right: 0; top: .1em; width: 1.4em; height: 1.4em; border-radius: 50%; background: #E3F8EA; color: var(--ok); display: grid; place-items: center; font-size: .8em; }
.tip-box { background: #FFF8DB; border-radius: 14px; padding: 14px 18px; border-right: 5px solid var(--yellow); }

/* ---------- dashboard ---------- */
.dash-hero { background: linear-gradient(135deg, var(--navy), #3B2B9E); color: #fff; padding: 36px 0 90px; background-image: var(--pattern), linear-gradient(135deg, var(--navy), #3B2B9E); }
.dash-hero h1 { color: #fff; font-size: 2rem; }
.dash-hero p { color: #C9D0F0; margin: 0; }
.dash-top { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.rank-card { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 20px; padding: 16px 20px; min-width: 300px; }
.rank-card .r { display: flex; align-items: center; gap: 12px; }
.rank-card .r i { font-style: normal; font-size: 2.4rem; }
.rank-card b { font: 700 1.2rem var(--display); }
.bar { height: 10px; background: rgba(255, 255, 255, .18); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), #FF9F43); border-radius: 99px; }
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -60px; }
.dstat { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; }
.dstat i { font-style: normal; font-size: 2rem; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: #F1EDFF; }
.dstat b { font: 700 1.6rem var(--display); color: var(--navy); display: block; line-height: 1.1; }
.dstat span { color: var(--muted); font-size: .88rem; }
.sessions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.s-card { --c: var(--purple); background: var(--card); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: transform .2s; }
.s-card:hover { transform: translateY(-5px); }
.s-card-top { background: var(--c); color: #fff; padding: 18px; position: relative; background-image: var(--pattern), linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 70%, #000)); min-height: 110px; }
.s-card-top .num { font: 700 .8rem var(--display); background: rgba(255, 255, 255, .22); padding: .2em .7em; border-radius: 99px; }
.s-card-top .ic { position: absolute; left: 16px; bottom: 6px; font-size: 3rem; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .2)); }
.s-card-top .done { position: absolute; left: 14px; top: 14px; background: #fff; color: var(--ok); border-radius: 99px; font-size: .78rem; font-weight: 700; padding: .1em .6em; }
.s-card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.s-card-body h3 { font-size: 1.08rem; margin-bottom: .2em; }
.s-card-body p { color: var(--muted); font-size: .88rem; margin: 0 0 12px; line-height: 1.55; flex: 1; }
.s-meta { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); }
.pbar { height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.pbar i { display: block; height: 100%; background: var(--c); }
.ctf-card { margin-top: 26px; display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; background: #0B1026; color: #CFE0FF; border-radius: 24px; padding: 26px 30px; text-decoration: none; background-image: var(--pattern); }
.ctf-card .big { font-size: 3.4rem; }
.ctf-card h3 { color: #fff; margin: 0; }
.ctf-card p { margin: .2em 0 0; }
.badges { display: flex; flex-wrap: wrap; gap: 12px; }
.bdg { background: var(--card); border-radius: 16px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); font-weight: 600; font-size: .92rem; }
.bdg i { font-style: normal; font-size: 1.8rem; }
.bdg.locked { opacity: .4; filter: grayscale(1); }
.h-row { display: flex; justify-content: space-between; align-items: end; margin: 40px 0 16px; gap: 10px; flex-wrap: wrap; }
.h-row h2 { margin: 0; font-size: 1.5rem; }

/* ---------- session ---------- */
.s-hero { background: color-mix(in srgb, var(--accent) 12%, #fff); border-bottom: 1px solid var(--line); background-image: var(--pattern); }
.s-hero-in { display: grid; grid-template-columns: 1fr 300px; gap: 30px; padding: 30px 20px 36px; align-items: center; }
.s-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.s-hero .eyebrow { background: #fff; color: var(--accent); }
.s-hero .lead { font-size: 1.2rem; font-weight: 600; color: var(--navy); margin: 0 0 .4em; }
.s-ic { display: inline-block; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-weight: 600; color: var(--muted); }
.s-hero-card { background: #fff; border-radius: 24px; padding: 20px; box-shadow: var(--shadow); display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); display: grid; place-items: center; position: relative; text-align: center; line-height: 1.1; }
.ring::before { content: ''; position: absolute; inset: 9px; background: #fff; border-radius: 50%; }
.ring b, .ring small { position: relative; display: block; }
.ring b { font: 700 1.6rem var(--display); color: var(--navy); }
.ring small { font-size: .7rem; color: var(--muted); }
.badge-preview { text-align: center; filter: grayscale(1); opacity: .55; }
.badge-preview.earned { filter: none; opacity: 1; }
.badge-preview span { font-size: 2.6rem; display: block; line-height: 1; }
.badge-preview small { display: block; color: var(--muted); font-size: .75rem; }
.badge-preview b { font-family: var(--display); color: var(--navy); font-size: .95rem; }
.s-layout { display: grid; grid-template-columns: 250px 1fr; gap: 30px; margin-top: 30px; align-items: start; }
.s-side { position: sticky; top: 90px; }
.toc { background: #fff; border-radius: 18px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: calc(100vh - 120px); overflow: auto; }
.toc b { font-family: var(--display); margin-bottom: 6px; color: var(--navy); }
.toc a { text-decoration: none; color: var(--ink); font-size: .9rem; padding: .35em .6em; border-radius: 10px; border-right: 3px solid transparent; }
.toc a:hover, .toc a.on { background: color-mix(in srgb, var(--accent) 12%, #fff); border-right-color: var(--accent); color: var(--navy); font-weight: 600; }
.s-main { min-width: 0; }
.s-sec { background: #fff; border-radius: 26px; padding: 30px; margin-bottom: 26px; box-shadow: var(--shadow); }
.s-sec > h2 { font-size: 1.55rem; display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 2px dashed var(--line); margin-bottom: 20px; }
.sec-n { width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.goals li { font-size: 1.05rem; }

/* ---------- blocks ---------- */
.blk { margin: 0 0 26px; }
.blk:last-child { margin-bottom: 0; }
.blk-title { font-size: 1.2rem; margin-bottom: .3em; }
.blk-intro { color: var(--muted); margin: 0 0 14px; }
.blk-text p { margin: 0 0 .8em; }
.blk-text ul, .blk-text ol { padding-right: 1.3em; }
.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: 16px; border-right: 6px solid; }
.callout-ic { font-size: 1.6rem; line-height: 1.2; }
.callout b { font-family: var(--display); color: var(--navy); }
.callout p { margin: .2em 0; }
.callout-tip { background: #FFF8DB; border-color: var(--yellow); }
.callout-warn { background: #FFF1E2; border-color: #F59E0B; }
.callout-danger { background: #FDECEC; border-color: var(--red); }
.callout-info { background: #E9F2FF; border-color: #3D7BFF; }
.callout-fact { background: #F1EDFF; border-color: var(--purple); }
.cards { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: repeat(3, 1fr); } .cols-4 { grid-template-columns: repeat(4, 1fr); }
.icard { background: #F8F9FE; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.icard-ic { font-size: 1.9rem; display: block; line-height: 1.2; }
.icard h4 { font-size: 1rem; margin: .3em 0 .2em; }
.icard p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.tone-good { background: #EAF8EF; border-color: #BDE8CD; }
.tone-bad { background: #FDEEEE; border-color: #F5C2C2; }
.tone-warn { background: #FFF5E5; border-color: #FBD9A4; }
.tone-info { background: #EAF2FF; border-color: #C3D9FF; }
.flips { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.flip { perspective: 900px; background: none; border: 0; padding: 0; height: 170px; cursor: pointer; font: inherit; }
.flip-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .6s; transform-style: preserve-3d; }
.flip.flipped .flip-in { transform: rotateY(180deg); }
.flip-front, .flip-back { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px; text-align: center; }
.flip-front { background: color-mix(in srgb, var(--accent) 12%, #fff); border: 2px solid color-mix(in srgb, var(--accent) 30%, #fff); }
.flip-front i { font-style: normal; font-size: 2.2rem; }
.flip-front b { font-family: var(--display); color: var(--navy); }
.flip-front small { color: var(--muted); font-size: .72rem; }
.flip-back { background: var(--navy); color: #fff; transform: rotateY(180deg); font-size: .9rem; line-height: 1.55; }
.reveals { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.reveal { font: inherit; text-align: right; border: 2px dashed var(--line); background: #FBFCFF; border-radius: 16px; padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: .2s; color: var(--ink); }
.reveal:hover { border-color: var(--accent); }
.reveal-ic { font-size: 1.8rem; }
.reveal b { font-family: var(--display); color: var(--navy); }
.reveal-hint { color: var(--accent); font-size: .85rem; font-weight: 600; }
.reveal-back { display: none; font-size: .92rem; line-height: 1.6; }
.reveal.open { border-style: solid; cursor: default; }
.reveal.open .reveal-hint { display: none; }
.reveal.open .reveal-back { display: block; animation: pop .35s; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--navy); color: #fff; border-radius: 18px; padding: 18px; text-align: center; background-image: var(--pattern); }
.stat b { display: block; font: 700 1.8rem var(--display); color: var(--yellow); direction: ltr; }
.stat span { font-size: .88rem; color: #D2D8F5; line-height: 1.5; display: block; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: auto auto 1fr; gap: 12px; align-items: start; background: #F8F9FE; border-radius: 16px; padding: 14px 16px; }
.step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.step-ic { font-size: 1.5rem; line-height: 1.3; }
.steps b { font-family: var(--display); color: var(--navy); }
.steps p { margin: 0; color: var(--muted); font-size: .93rem; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cmp { border-radius: 18px; padding: 18px; background: #F8F9FE; border: 1px solid var(--line); }
.cmp h4 { font-size: 1.02rem; }
.cmp ul { margin: 0; padding-right: 1.2em; }
.cmp li { margin-bottom: .3em; }
.discuss { background: linear-gradient(135deg, #EAF2FF, #F1EDFF); border-radius: 18px; padding: 20px; }
.discuss ul { margin: 0; padding-right: 1.2em; }
.discuss li { margin-bottom: .4em; font-weight: 500; }
.phone { max-width: 420px; margin: 0 auto; border-radius: 26px; overflow: hidden; border: 8px solid #1B2140; background: #ECE5DD; }
.phone-bar { background: #075E54; color: #fff; padding: 10px 16px; font-weight: 700; }
.phone-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; background-image: var(--pattern); }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 14px; font-size: .95rem; line-height: 1.55; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); }
.msg small { display: block; font-weight: 700; color: #128C7E; font-size: .78rem; }
.msg-in { background: #fff; align-self: flex-start; border-top-right-radius: 4px; }
.msg-out { background: #DCF8C6; align-self: flex-end; border-top-left-radius: 4px; }
.story { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, #fff), #fff); border: 2px solid color-mix(in srgb, var(--accent) 25%, #fff); border-radius: 22px; padding: 22px; }
.scene { display: none; animation: pop .35s; }
.scene.on { display: block; }
.scene-head { display: flex; align-items: center; gap: 10px; }
.avatar { font-size: 2.6rem; width: 64px; height: 64px; display: grid; place-items: center; background: #fff; border-radius: 50%; box-shadow: var(--shadow); }
.scene-head b { font-family: var(--display); font-size: 1.1rem; color: var(--navy); }
.scene-n { margin-right: auto; color: var(--muted); font-size: .85rem; }
.bubble { background: #fff; border-radius: 18px; padding: 16px 18px; margin: 14px 0; position: relative; box-shadow: 0 2px 10px rgba(23, 35, 90, .08); font-size: 1.05rem; }
.bubble::before { content: ''; position: absolute; top: -10px; right: 30px; border: 10px solid transparent; border-bottom-color: #fff; border-top: 0; }
.scene-q { background: #fff; border-radius: 16px; padding: 14px; }
.choices { display: grid; gap: 8px; margin-top: 8px; }
.choice { font: inherit; text-align: right; background: #F8F9FE; border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer; color: var(--ink); }
.choice:hover { border-color: var(--accent); }
.choice.ok { border-color: var(--ok); background: #EAF8EF; }
.choice.no { border-color: var(--no); background: #FDEEEE; }
.choice-fb { margin: 8px 0 0; font-weight: 600; }
.story-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--accent); }

/* ---------- games ---------- */
.game { border-radius: 22px; padding: 20px; background: #FBFAFF; border: 2px solid color-mix(in srgb, var(--accent) 25%, #fff); position: relative; }
.game.was-done { border-color: #BDE8CD; }
.game-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.game-head .blk-title { margin: 0; flex: 1; }
.game-tag { background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; padding: .2em .7em; border-radius: 99px; }
.game-xp { background: #FFF4CC; color: #7A5200; font-weight: 700; font-size: .8rem; padding: .2em .7em; border-radius: 99px; }
.was-done .game-xp { background: #E3F8EA; color: var(--ok); }
.game-fb { margin: 12px 0 0; min-height: 1.5em; }
.game-fb .btn { margin-right: 10px; }
.game-done { margin-top: 16px; border-radius: 16px; padding: 14px 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; animation: pop .4s; }
.game-done b { font-family: var(--display); }
.game-done p { margin: 0; flex: 1; }
.game-done.win { background: #E3F8EA; color: #0E5A31; }
.game-done.try { background: #FFF1E2; color: #7A4300; }
.chip { font: inherit; font-size: .95rem; border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: .5em .9em; cursor: pointer; color: var(--ink); transition: .15s; text-align: right; }
.chip:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); }
.chip.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.chip.used { opacity: .35; }
.chip.placed { cursor: default; font-size: .88rem; padding: .35em .7em; }
.chip.placed.ok { border-color: #9AD8B1; background: #EAF8EF; }
.chip.placed.no { border-color: #F2B2B2; background: #FDEEEE; }
.sort-pool, .order-pool { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; min-height: 20px; }
.sort-bins { display: grid; gap: 12px; }
.sort-bins.cols-2 { grid-template-columns: 1fr 1fr; } .sort-bins.cols-3 { grid-template-columns: repeat(3, 1fr); } .sort-bins.cols-4 { grid-template-columns: repeat(4, 1fr); }
.sort-bin { border: 2px dashed color-mix(in srgb, var(--accent) 40%, #fff); border-radius: 16px; padding: 10px; min-height: 130px; cursor: pointer; background: #fff; transition: .15s; }
.sort-bin.over, .sort-bin:hover { background: color-mix(in srgb, var(--accent) 8%, #fff); }
.bin-head { font: 700 1rem var(--display); text-align: center; color: var(--navy); margin-bottom: 8px; }
.bin-items { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-top { display: flex; justify-content: space-between; color: var(--muted); font-size: .88rem; font-weight: 600; }
.timer { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--red), var(--yellow), var(--green)); transition: width .1s linear; }
.quick-q { font: 600 1.15rem var(--display); color: var(--navy); margin: 12px 0; }
.quick-opts { display: grid; gap: 8px; }
.opt-btn { font: inherit; text-align: right; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); transition: .15s; }
.opt-btn:hover:not(:disabled) { border-color: var(--accent); }
.opt-btn.ok { border-color: var(--ok); background: #EAF8EF; font-weight: 700; }
.opt-btn.no { border-color: var(--no); background: #FDEEEE; }
.tf-card { background: #fff; border-radius: 18px; padding: 24px; font: 600 1.15rem var(--display); text-align: center; color: var(--navy); margin: 10px 0; border: 2px solid var(--line); transition: .2s; }
.tf-card.ok { border-color: var(--ok); background: #EAF8EF; }
.tf-card.no { border-color: var(--no); background: #FDEEEE; }
.tf-btns { display: flex; gap: 12px; justify-content: center; }
.tf-btns button { font: 700 1.05rem var(--display); border: 0; border-radius: 14px; padding: .7em 2em; cursor: pointer; color: #fff; }
.tf-yes { background: var(--ok); } .tf-no { background: var(--no); }
.tf-btns button:disabled { opacity: .4; }
.order-seq { padding-right: 1.4em; margin: 0 0 10px; }
.order-seq li { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px 12px; margin-bottom: 6px; }
.order-seq li.ok { border-color: var(--ok); background: #EAF8EF; }
.order-seq li.no { border-color: var(--no); background: #FDEEEE; }
.order-answer { margin: 6px 0 0; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.match-col { display: flex; flex-direction: column; gap: 8px; }
.chip.matched { border-color: var(--m); background: color-mix(in srgb, var(--m) 14%, #fff); cursor: default; }
.chip-b { background: #F8F9FE; }
.shake { animation: shake .4s; border-color: var(--no) !important; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pick-prompt { font-weight: 700; color: var(--navy); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pick { font: inherit; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--ink); transition: .15s; position: relative; }
.pick i { font-style: normal; font-size: 1.8rem; }
.pick span { font-size: .92rem; overflow-wrap: anywhere; }
.pick.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.pick.sel::after { content: '✓'; position: absolute; top: 6px; left: 8px; color: var(--accent); font-weight: 700; }
.checked .pick { cursor: default; }
.checked .pick.right { border-color: var(--ok); }
.checked .pick.wrong { border-color: var(--no); background: #FDEEEE; }
.checked .pick.is-bad.right { background: #EAF8EF; }
.pick-notes { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.pick-notes li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.rf { background: #fff; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; margin: 10px 0; }
.rf-bar { background: var(--navy); color: #fff; padding: 8px 14px; font-weight: 700; font-size: .9rem; }
.rf-meta { padding: 6px 14px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.rf-body { padding: 14px; line-height: 2.1; }
.rf-sms .rf-body, .rf-chat .rf-body { background: #F1F3FA; }
.rf-seg { cursor: pointer; border-radius: 6px; padding: 2px 4px; transition: .15s; border-bottom: 2px dotted transparent; }
.rf-seg:hover { background: #FFF6CC; border-bottom-color: var(--warn); }
.rf-seg.flag { background: #FDE2E2; color: #8B1A1A; border-bottom: 2px solid var(--red); }
.rf-seg.flag.shown { background: #FFEFD6; }
.rf-seg.fine { background: #E9F7EE; }
.rf-why { display: block; font-style: normal; font-size: .82rem; color: var(--red); font-weight: 600; line-height: 1.5; margin: 2px 0 4px; }
.rf-count { font-weight: 700; color: var(--navy); margin: 0; }
.checklist { display: grid; gap: 8px; margin-bottom: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 4px; flex: none; }
.check:has(input:checked) { border-color: var(--ok); background: #EAF8EF; }
.caesar { background: #fff; border-radius: 16px; padding: 16px; border: 1px solid var(--line); }
.caesar label { display: block; font-weight: 600; }
.caesar .row, .caesar-ch .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.caesar input[type=range] { vertical-align: middle; accent-color: var(--accent); width: 180px; }
.wheel { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; direction: ltr; font: 600 .78rem var(--mono); margin: 8px 0; }
.wheel span { background: #F1EDFF; border-radius: 6px; text-align: center; padding: 2px 0; line-height: 1.3; color: var(--accent); }
.wheel b { display: block; color: var(--navy); }
.out { display: block; min-height: 2.4em; background: #0B1026; color: #7CFFB2; font: 700 1.1rem var(--mono); border-radius: 12px; padding: 10px 14px; letter-spacing: .08em; }
.caesar-ch { margin-top: 14px; background: #fff; border-radius: 16px; padding: 16px; border: 2px dashed var(--accent); }
.cipher { display: block; font-size: 1.3rem; letter-spacing: .12em; margin: 8px 0; padding: 10px; text-align: center; }
.caesar-ch .inp { flex: 1; min-width: 200px; }
.tool { background: #F8F9FE; border-radius: 22px; padding: 20px; border: 1px solid var(--line); }
.meter { height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 12px 0 6px; }
.meter i { display: block; height: 100%; width: 0; transition: .3s; }
.pw-label { margin: 0; font-weight: 600; }
.pw-checks { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pw-checks li { background: #fff; border: 2px solid var(--line); border-radius: 99px; padding: .2em .8em; font-size: .85rem; color: var(--muted); }
.pw-checks li.on { border-color: var(--ok); color: var(--ok); font-weight: 700; }
.pw-checks li.on::before { content: '✓ '; }
.pw-time { font-size: 1.02rem; }
.bf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bf { background: #fff; border-radius: 16px; padding: 16px; text-align: center; border: 2px solid var(--line); }
.bf.weak { border-color: #F5C2C2; } .bf.strong { border-color: #BDE8CD; }
.bf-screen { background: #0B1026; color: #7CFFB2; font: 700 1.1rem var(--mono); padding: 12px; border-radius: 10px; margin: 10px 0; letter-spacing: .1em; overflow: hidden; white-space: nowrap; }
.bf-screen.cracked { color: #FF6B6B; }
.bf-screen.safe { color: var(--yellow); }

/* ---------- quiz ---------- */
.qq { border: 2px solid var(--line); border-radius: 18px; padding: 16px 18px; margin: 0 0 14px; }
.qq legend { font: 600 1.05rem var(--display); color: var(--navy); padding: 0 6px; }
.qn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .85rem; margin-left: 6px; }
.opt { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; cursor: pointer; margin-top: 6px; border: 2px solid transparent; }
.opt:hover { background: #F6F4FF; }
.opt input { accent-color: var(--accent); width: 18px; height: 18px; }
.opt span { font-weight: 700; color: var(--accent); }
.opt:has(input:checked) { background: color-mix(in srgb, var(--accent) 10%, #fff); border-color: color-mix(in srgb, var(--accent) 40%, #fff); }
.qq.ok { border-color: #9AD8B1; background: #F4FBF6; }
.qq.no { border-color: #F2B2B2; background: #FFF7F7; }
.opt.right { border-color: var(--ok); background: #EAF8EF; }
.q-explain { margin: 8px 0 0; font-weight: 600; font-size: .95rem; }
.quiz-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.quiz-result { margin-top: 20px; border-radius: 22px; padding: 24px; text-align: center; animation: pop .4s; }
.quiz-result.win { background: linear-gradient(135deg, #E3F8EA, #FFF8DB); }
.quiz-result.try { background: #FFF1E2; }
.big-badge { font-size: 4rem; animation: bounce 1s infinite alternate; }
@keyframes bounce { to { transform: translateY(-8px) scale(1.05); } }
.vocab { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.term { background: #F8F9FE; border-radius: 14px; padding: 12px 14px; border-right: 4px solid var(--accent); }
.term b { font-family: var(--display); color: var(--navy); }
.term .en { color: var(--accent); font-size: .82rem; }
.term p { margin: .2em 0 0; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.next-teaser { margin: 18px 0; padding: 16px 20px; border-radius: 16px; background: var(--navy); color: #fff; font-weight: 600; background-image: var(--pattern); }
.s-pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }
.wrapup .callout { margin-top: 16px; }

/* ---------- tables (leaderboard/admin) ---------- */
.table-wrap { overflow-x: auto; background: #fff; border-radius: 20px; box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th, .tbl td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { background: #F4F6FD; font-family: var(--display); color: var(--navy); font-size: .88rem; }
.tbl tr.me td { background: #FFF8DB; font-weight: 700; }
.medal { font-size: 1.3rem; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { text-decoration: none; padding: .45em 1.1em; border-radius: 99px; background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.tabs a.on { background: var(--purple); color: #fff; }
.page-head { padding: 34px 0 10px; }
.page-head h1 { font-size: 2rem; margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .journey, .features, .sessions-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .s-layout { grid-template-columns: 1fr; }
  .s-side { display: none; }
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .sort-bins.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero-in, .auth, .s-hero-in, .dash-top, .ctf-teaser, .ctf-card { grid-template-columns: 1fr; }
  .shield-art { max-width: 280px; }
  .nav-toggle { display: block; }
  .nav:not(.nav-guest) { display: none; position: absolute; top: 70px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 12px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav-open .nav { display: flex; }
  .brand-txt small { display: none; }
  .journey, .features, .sessions-grid, .cols-2, .cols-3, .cols-4, .compare, .grid-2, .bf-grid, .match, .sort-bins.cols-2, .sort-bins.cols-3, .sort-bins.cols-4 { grid-template-columns: 1fr; }
  .s-sec { padding: 20px 16px; border-radius: 20px; }
  .game { padding: 14px; }
  .wheel { grid-template-columns: repeat(9, 1fr); }
  .rank-card { min-width: 0; }
}

@media print {
  .topbar, .footer, .no-print { display: none !important; }
  body { background: #fff; }
}
