/* CyberShield — "Dark Cybersecurity + Elegant": qora asos, ko'k/havorang aksent, qizil ogohlantirishlar, jonli fon va animatsiyalar.
   Kompyuterda: chap menyu + kontent. Telefonda: yuqori panel + pastki menyu. */

:root {
  --bg: #05070c;
  --bg-2: #080b13;
  --surface: rgba(12, 17, 27, .88);
  --surface-2: rgba(22, 30, 46, .8);
  --line: rgba(148, 163, 184, .13);
  --line-2: rgba(148, 163, 184, .24);
  --text: #e6edf7;
  --muted: #8b97ab;
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --accent-ink: #ffffff;
  --accent-soft: rgba(59, 130, 246, .14);
  --glow: 0 0 0 1px rgba(59, 130, 246, .35), 0 8px 32px rgba(59, 130, 246, .22);
  --safe: #34d399;
  --safe-soft: rgba(52, 211, 153, .12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .12);
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --radius: 14px;
  --sidebar: 252px;
  --tabbar: 64px;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: rgba(59, 130, 246, .4); }
a { color: var(--accent-2); }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; font-weight: 650; letter-spacing: -.015em; text-wrap: balance; margin: 0; }
p { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.icon { display: inline-flex; width: 20px; height: 20px; flex: none; }
.icon svg { width: 100%; height: 100%; }
.icon-lg { width: 24px; height: 24px; }

/* ---------- Jonli fon: to'r + suzuvchi nurlar ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop::before {
  content: ""; position: absolute; inset: -64px;
  background:
    linear-gradient(rgba(96, 165, 250, .07) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(96, 165, 250, .07) 1px, transparent 1px) 0 0 / 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 20%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 60% 20%, #000 20%, transparent 75%);
  animation: grid-move 24s linear infinite;
}
.backdrop::after {
  content: ""; position: absolute; left: 0; right: 0; height: 30vh; top: -30vh;
  background: linear-gradient(transparent, rgba(34, 211, 238, .05), transparent);
  animation: scan 9s linear infinite;
}
.backdrop i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; animation: drift 22s ease-in-out infinite alternate; }
.backdrop i:nth-child(1) { width: 520px; height: 520px; background: #1d4ed8; top: -180px; right: -120px; }
.backdrop i:nth-child(2) { width: 420px; height: 420px; background: #0e7490; bottom: -200px; left: 10%; opacity: .35; animation-duration: 28s; animation-direction: alternate-reverse; }
.backdrop i:nth-child(3) { width: 300px; height: 300px; background: #3730a3; top: 40%; left: 55%; opacity: .25; animation-duration: 34s; }
@keyframes grid-move { to { transform: translate(48px, 48px); } }
@keyframes scan { to { transform: translateY(160vh); } }
@keyframes drift { 50% { transform: translate(-60px, 50px) scale(1.1); } 100% { transform: translate(40px, -30px) scale(.95); } }

/* ---------- Karkas ---------- */
.app { min-height: 100vh; }
#view { max-width: 1060px; margin: 0 auto; padding: 44px 32px 80px; display: flex; flex-direction: column; gap: 36px; outline: none; }

/* Sahifa bo'laklari ketma-ket ko'tarilib chiqadi */
#view.enter > *, .module-grid > *, .journey > *, .info-grid > *, .badge-grid > *, .stat-row > * { animation: rise .6s var(--ease) backwards; }
#view.enter > :nth-child(2), .module-grid > :nth-child(2), .journey > :nth-child(2), .info-grid > :nth-child(2), .badge-grid > :nth-child(2), .stat-row > :nth-child(2) { animation-delay: .07s; }
#view.enter > :nth-child(3), .module-grid > :nth-child(3), .journey > :nth-child(3), .info-grid > :nth-child(3), .badge-grid > :nth-child(3), .stat-row > :nth-child(3) { animation-delay: .14s; }
#view.enter > :nth-child(4), .module-grid > :nth-child(4), .journey > :nth-child(4), .info-grid > :nth-child(4), .badge-grid > :nth-child(4) { animation-delay: .21s; }
#view.enter > :nth-child(n+5), .module-grid > :nth-child(n+5), .info-grid > :nth-child(n+5), .badge-grid > :nth-child(n+5) { animation-delay: .28s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  padding: calc(22px + var(--st)) 12px 20px calc(12px + var(--sl));
  background: rgba(5, 7, 12, .7); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.08rem; letter-spacing: -.01em; color: var(--text); text-decoration: none; padding-inline: 8px; }
.logo span:not(.logo-mark) { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-mark { width: 22px; height: 24px; background: var(--grad); clip-path: polygon(50% 0, 100% 14%, 100% 52%, 50% 100%, 0 52%, 0 14%); animation: shield-pulse 3s ease-in-out infinite; }
@keyframes shield-pulse { 50% { filter: drop-shadow(0 0 6px var(--accent-2)) brightness(1.25); } }

.level-chip { display: inline-flex; align-items: center; gap: 8px; font: .74rem var(--font-mono); color: var(--muted); padding: 5px 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); white-space: nowrap; }
.sidebar .level-chip { align-self: flex-start; margin-left: 8px; }
.level-dot { width: 12px; height: 12px; border-radius: 50%; background: conic-gradient(var(--accent-2) calc(var(--p) * 1%), var(--line-2) 0); }

#sidenav { display: flex; flex-direction: column; gap: 2px; }
#sidenav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .92rem; transition: color .2s, background .2s, transform .2s var(--ease); }
#sidenav a .icon { width: 18px; height: 18px; }
#sidenav a:hover { color: var(--text); background: var(--surface-2); transform: translateX(2px); }
#sidenav a.is-active { color: var(--text); background: linear-gradient(90deg, var(--accent-soft), transparent); font-weight: 600; }
#sidenav a.is-active::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); box-shadow: 0 0 12px var(--accent); }
#sidenav a.is-active .icon { color: var(--accent-2); }
.nav-section { font: 600 .68rem var(--font-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); opacity: .7; padding: 14px 10px 4px; }
.sidebar-foot { margin-top: auto; font: .76rem var(--font-mono); color: var(--muted); padding-inline: 10px; }
.sidebar-foot::before { content: "> "; color: var(--accent-2); }

.topbar, .tabbar { display: none; }
@media (min-width: 900px) { .app { padding-left: var(--sidebar); } }
@media (max-width: 899px) {
  .sidebar { display: none; }
  .topbar, .tabbar { background: rgba(5, 7, 12, .78); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); z-index: 20; }
  .topbar {
    display: flex; position: sticky; top: 0; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(12px + var(--st)) calc(16px + var(--sr)) 12px calc(12px + var(--sl));
    border-bottom: 1px solid var(--line);
  }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0;
    padding: 6px calc(4px + var(--sr)) calc(6px + var(--sb)) calc(4px + var(--sl));
    border-top: 1px solid var(--line);
  }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; min-height: 48px; color: var(--muted); text-decoration: none; font-size: .7rem; transition: color .2s; }
  .tabbar a.is-active { color: var(--accent-2); font-weight: 600; }
  .tabbar a.is-active::before { content: ""; position: absolute; top: -6px; left: 30%; right: 30%; height: 2px; border-radius: 2px; background: var(--grad); box-shadow: 0 0 12px var(--accent-2); }
  .tabbar a.is-active .icon { transform: translateY(-1px); filter: drop-shadow(0 0 6px rgba(34, 211, 238, .6)); }
  .tabbar .icon { width: 22px; height: 22px; transition: transform .2s var(--ease); }
  #view { padding: 24px calc(16px + var(--sr)) calc(var(--tabbar) + var(--sb) + 32px) calc(16px + var(--sl)); gap: 26px; }
}

/* ---------- Tipografiya ---------- */
.eyebrow { font: 600 .74rem var(--font-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--accent-2); }
.page-head { display: flex; flex-direction: column; gap: 8px; max-width: 700px; }
.page-head h1 { font-size: clamp(1.85rem, 4.2vw, 2.6rem); }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--font-mono); }
.section-title { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--grad); }
.narrow { width: 100%; max-width: 740px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Tugmalar ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: border-color .2s, box-shadow .25s, transform .15s var(--ease), background .2s;
}
.btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: default; box-shadow: none; transform: none; }
.btn .icon { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.btn:hover .icon:last-child { transform: translateX(3px); }
.btn-primary { background: var(--grad); border-color: transparent; color: var(--accent-ink); box-shadow: 0 8px 28px rgba(59, 130, 246, .35); }
.btn-primary:hover { border-color: transparent; box-shadow: 0 10px 36px rgba(34, 211, 238, .4); }
/* Yaltirash effekti */
.btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); animation: shine 3.5s ease-in-out infinite 1s; }
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.btn-safe { color: var(--safe); background: var(--safe-soft); border-color: rgba(52, 211, 153, .35); }
.btn-danger { color: var(--danger); background: var(--danger-soft); border-color: rgba(248, 113, 113, .35); }
.btn-safe:hover:not(:disabled) { border-color: var(--safe); box-shadow: 0 0 0 3px var(--safe-soft), 0 8px 24px rgba(52, 211, 153, .15); }
.btn-danger:hover:not(:disabled) { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft), 0 8px 24px rgba(248, 113, 113, .15); }
.btn-ghost { background: transparent; align-self: flex-start; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row-end { display: flex; justify-content: flex-end; }

/* ---------- Kartalar ---------- */
.card, .module-card, .info, .journey a, .term, .badge, .message, .chat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0;
}
.card { padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 50px rgba(0, 0, 0, .35); }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 500 .72rem var(--font-mono); padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.chip.good { color: var(--safe); background: var(--safe-soft); border-color: rgba(52, 211, 153, .3); }
.chip.warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(251, 191, 36, .3); }
.chip.hot { color: var(--accent-2); background: rgba(34, 211, 238, .1); border-color: rgba(34, 211, 238, .35); animation: pop .4s var(--ease); }
.notice { padding: 12px 16px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 0 10px 10px 0; font-size: .94rem; }

/* ---------- Bosh sahifa ---------- */
.hero { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: center; padding-top: 8px; }
.hero-text { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.display {
  font-size: clamp(2.6rem, 6.6vw, 4.4rem); font-weight: 800; line-height: 1; letter-spacing: -.035em;
  background: linear-gradient(100deg, #fff 20%, #93c5fd 50%, var(--accent-2) 70%, #fff 90%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: title-flow 8s ease-in-out infinite alternate;
}
@keyframes title-flow { to { background-position: 100% 0; } }
.slogan { font-family: var(--font-mono); color: var(--muted); }
.slogan::before { content: "> "; color: var(--accent-2); }
.slogan::after { content: "_"; color: var(--accent-2); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero .lead { margin-bottom: 6px; }
.hero-progress { flex-direction: row; align-items: center; gap: 18px; position: relative; overflow: hidden; }
.hero-progress::before { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent 0 70%, rgba(34, 211, 238, .18), transparent 85%); animation: spin 8s linear infinite; z-index: -1; }
@keyframes spin { to { transform: rotate(1turn); } }
.level { font-size: 1.3rem; font-weight: 650; margin: 2px 0 4px; }
.level.good { color: var(--safe); } .level.warn { color: var(--warn); } .level.bad { color: var(--danger); }

.stats-strip { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 4px; font: .8rem var(--font-mono); color: var(--muted); }
.stats-strip b { color: var(--text); font-size: 1rem; margin-right: 4px; }

.tip-card { flex-direction: row; align-items: flex-start; gap: 16px; border-color: rgba(59, 130, 246, .3); background: linear-gradient(120deg, rgba(59, 130, 246, .12), var(--surface) 60%); }
.tip-card > .icon { width: 42px; height: 42px; padding: 10px; border-radius: 12px; background: var(--grad); color: #fff; box-shadow: 0 6px 20px rgba(59, 130, 246, .35); }
.tip-card > div { display: flex; flex-direction: column; gap: 4px; }

.journey { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; counter-reset: step; }
.journey li { counter-increment: step; }
.journey a { height: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 16px; color: var(--text); text-decoration: none; transition: border-color .2s, transform .2s var(--ease); }
.journey a:hover { border-color: var(--line-2); transform: translateY(-2px); }
.journey a > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.step-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font: .78rem var(--font-mono); color: var(--muted); }
.step-dot:empty::before { content: counter(step); }
.step-dot .icon { width: 14px; height: 14px; }
.journey .is-next a { border-color: rgba(59, 130, 246, .6); box-shadow: var(--glow); }
.journey .is-next .step-dot { background: var(--grad); border-color: transparent; color: #fff; animation: ping 2s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, .55); } 100% { box-shadow: 0 0 0 12px rgba(34, 211, 238, 0); } }
.journey .is-done .step-dot { background: var(--safe); border-color: var(--safe); color: #04120c; }

.module-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.module-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 20px; color: var(--text); text-decoration: none; transition: border-color .25s, transform .25s var(--ease), box-shadow .25s; }
/* Sichqoncha ortidan yuruvchi nur (app.js --mx/--my qo'yadi) */
.module-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, -50%), rgba(59, 130, 246, .18), transparent 60%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.module-card:hover { border-color: rgba(59, 130, 246, .5); transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0, 0, 0, .4); }
.module-card:hover::before { opacity: 1; }
.module-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.module-card-top > .icon { width: 42px; height: 42px; padding: 10px; border-radius: 12px; color: var(--accent-2); background: var(--accent-soft); border: 1px solid rgba(59, 130, 246, .25); transition: transform .3s var(--ease); }
.module-card:hover .module-card-top > .icon { transform: scale(1.08) rotate(-4deg); }
.module-card.is-done .module-card-top > .icon { color: var(--safe); background: var(--safe-soft); border-color: rgba(52, 211, 153, .3); }
.module-card h3 { font-size: 1.03rem; }
.module-card p { font-size: .9rem; }

/* ---------- Progress ---------- */
.ring { position: relative; width: 128px; height: 128px; flex: none; --tone: var(--accent-2); }
.ring.good { --tone: var(--safe); } .ring.warn { --tone: var(--warn); } .ring.bad { --tone: var(--danger); }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track, .ring-bar { fill: none; stroke-width: 8; }
.ring-track { stroke: rgba(148, 163, 184, .12); }
.ring-bar { stroke: var(--tone); stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease); filter: drop-shadow(0 0 6px var(--tone)); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font-size: 2rem; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-label small { font-family: var(--font-mono); color: var(--muted); font-size: .72rem; }
.bar { height: 5px; border-radius: 5px; background: rgba(148, 163, 184, .12); overflow: hidden; }
.bar span { position: relative; display: block; height: 100%; background: var(--grad); border-radius: inherit; transition: width .5s var(--ease); box-shadow: 0 0 10px var(--accent-2); }

/* ---------- Savollar ---------- */
.meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font: .8rem var(--font-mono); color: var(--muted); }
.meta > span:last-child { display: flex; gap: 8px; align-items: center; }
.question { font-size: 1.12rem; font-weight: 600; }
.options { display: flex; flex-direction: column; gap: 8px; }
.option {
  text-align: left; padding: 13px 16px; min-height: 50px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s var(--ease);
  animation: rise .45s var(--ease) backwards;
}
.option:nth-child(2) { animation-delay: .06s; } .option:nth-child(3) { animation-delay: .12s; } .option:nth-child(4) { animation-delay: .18s; }
.option:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); transform: translateX(4px); }
.option:disabled { cursor: default; }
.option.is-picked { border-color: var(--accent); background: var(--accent-soft); }
.option.is-correct { border-color: var(--safe); background: var(--safe-soft); animation: pop .4s var(--ease); }
.option.is-wrong { border-color: var(--danger); background: var(--danger-soft); animation: shake .4s; }
.option:disabled:not(.is-correct):not(.is-wrong) { opacity: .45; }
@keyframes pop { 50% { transform: scale(1.025); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.feedback { padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; animation: rise .45s var(--ease) both; }
.feedback.ok { border-color: rgba(52, 211, 153, .45); background: linear-gradient(135deg, var(--safe-soft), transparent 70%); }
.feedback.bad { border-color: rgba(248, 113, 113, .45); background: linear-gradient(135deg, var(--danger-soft), transparent 70%); }
.feedback-title { display: flex; align-items: center; gap: 8px; font-size: 1.08rem; }
.feedback.ok .feedback-title { color: var(--safe); }
.feedback.bad .feedback-title { color: var(--danger); }
.feedback ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.feedback li { animation: rise .4s var(--ease) both; }
.feedback li:nth-child(2) { animation-delay: .25s; } .feedback li:nth-child(3) { animation-delay: .5s; } .feedback li:nth-child(4) { animation-delay: .75s; }
.lesson { display: flex; gap: 10px; align-items: flex-start; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .94rem; }
.lesson .icon { color: var(--accent-2); margin-top: 2px; }
.result-inline { flex-direction: row; align-items: center; gap: 24px; }
.result-inline > div:last-child { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

/* ---------- Phishing xabari va "belgi ovi" ---------- */
.message { overflow: hidden; background: rgba(8, 11, 19, .85); box-shadow: 0 20px 50px rgba(0, 0, 0, .4); }
.msg-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--accent-soft); color: var(--accent-2); }
.ch-telegram .avatar { background: rgba(42, 171, 238, .16); color: #5ec4f5; }
.ch-instagram .avatar { background: rgba(193, 53, 132, .16); color: #e879b9; }
.ch-sms .avatar { background: var(--safe-soft); color: var(--safe); }
.msg-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.msg-who b, .msg-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-subject { padding: 14px 16px 0; font-weight: 600; }
.msg-body { padding: 10px 16px 16px; font-size: 1.02rem; line-height: 1.8; overflow-wrap: anywhere; }
.hunt-hint { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.hunt-hint .icon { color: var(--accent-2); width: 18px; height: 18px; }
.seg { border-radius: 4px; padding: 1px 2px; transition: background .25s, box-shadow .25s, color .25s; }
.seg.tap { cursor: pointer; box-shadow: inset 0 -1px 0 rgba(148, 163, 184, .25); }
.seg.tap:hover { background: rgba(59, 130, 246, .12); }
.seg.is-marked { background: rgba(59, 130, 246, .22); box-shadow: inset 0 -2px 0 var(--accent-2); }
.seg.is-flagged { background: var(--danger-soft); box-shadow: inset 0 -2px 0 var(--danger); animation: flag-in .6s var(--ease) both; animation-delay: calc(var(--n, 0) * .3s); }
.seg.is-flagged.is-hit { background: rgba(52, 211, 153, .16); box-shadow: inset 0 -2px 0 var(--safe); }
.seg.is-miss { text-decoration: line-through rgba(148, 163, 184, .6); background: none; box-shadow: none; }
@keyframes flag-in { 0% { background: transparent; box-shadow: none; } 40% { background: rgba(248, 113, 113, .4); } }
.seg-num { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 3px; border-radius: 50%; background: var(--danger); color: #fff; font: 600 .66rem var(--font-mono); vertical-align: super; }
.is-hit .seg-num { background: var(--safe); color: #04120c; }
.hunt-score { display: flex; align-items: center; gap: 8px; font: .85rem var(--font-mono); color: var(--accent-2); }
.decide { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .decide { grid-template-columns: 1fr 1fr; } .decide .btn-unsure { grid-column: 1 / -1; min-height: 44px; } }
.btn-unsure { color: var(--warn); background: var(--warn-soft); border-color: rgba(251, 191, 36, .35); }
.btn-unsure:hover:not(:disabled) { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft), 0 8px 24px rgba(251, 191, 36, .15); }
.decide .btn { min-height: 56px; font-size: 1.02rem; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: rgba(8, 11, 19, .85); }
.chat-who { color: var(--muted); margin-bottom: 4px; }
.bubble { align-self: flex-start; max-width: 88%; padding: 10px 14px; border-radius: 4px 16px 16px 16px; background: var(--surface-2); border: 1px solid var(--line); animation: bubble .4s var(--ease) both; }
@keyframes bubble { from { opacity: 0; transform: translateY(8px) scale(.96); transform-origin: left top; } }
.typing { display: inline-flex; gap: 4px; padding: 14px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-4px); background: var(--accent-2); } }
.later { animation: rise .45s var(--ease) both; }

/* ---------- Account Check ---------- */
.account-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .2s, background .2s; }
.check:hover { border-color: var(--line-2); }
.check:has(input:checked) { border-color: rgba(52, 211, 153, .4); background: var(--safe-soft); }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--safe); }
.pts { margin-top: 3px; }
.score-box { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.score-box .ring { width: 150px; height: 150px; }
.tips { text-align: left; color: var(--muted); font-size: .9rem; margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 900px) { .sticky { position: sticky; top: 24px; } }

/* ---------- Ma'lumot kartalari ---------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.info { padding: 20px; display: flex; flex-direction: column; gap: 6px; transition: border-color .2s, transform .2s var(--ease); }
.info:hover { border-color: rgba(59, 130, 246, .4); transform: translateY(-2px); }
.info h3 { font-size: 1.03rem; color: var(--accent-2); }
.info p { font-size: .93rem; color: var(--muted); }
.signs { margin: 6px 0 0; padding-left: 18px; font-size: .88rem; display: flex; flex-direction: column; gap: 3px; }
.signs li::marker, .help-steps li::marker { color: var(--warn); }
.help { border-color: rgba(251, 191, 36, .35); }
.help-head { display: flex; gap: 14px; align-items: flex-start; color: var(--warn); }
.help-head h2 { font-size: 1.15rem; color: var(--text); }
.help-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Kutubxona ---------- */
.library-tools { display: flex; flex-direction: column; gap: 12px; }
.library-list { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { padding: 6px 14px; min-height: 34px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); cursor: pointer; font-size: .88rem; transition: all .2s; }
.chip-btn:hover { color: var(--text); border-color: var(--accent); }
.chip-btn.is-active { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 4px 16px rgba(59, 130, 246, .35); }
.term { transition: border-color .2s; }
.term[open] { border-color: rgba(59, 130, 246, .4); }
.term summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; min-height: 48px; cursor: pointer; list-style: none; }
.term summary::-webkit-details-marker { display: none; }
.term summary b::before { content: "+ "; font-family: var(--font-mono); color: var(--accent-2); }
.term[open] summary b::before { content: "– "; }
.term[open] > :not(summary) { animation: rise .35s var(--ease) both; }
.term.is-read summary b { color: #93c5fd; }
.term > p, .term dl { padding: 0 16px; }
.term > p { margin-bottom: 10px; }
.term dl { margin: 0 0 16px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .92rem; }
.term dt { font: .76rem var(--font-mono); color: var(--muted); padding-top: 2px; }
.term dd { margin: 0; }
.term dd .signs, .term dd .tips { margin: 0; }
.term dd.warn-text { color: var(--danger); }
.term summary .icon { color: var(--accent-2); }
.term > .btn { margin: 0 16px 16px; }

/* ---------- Forma ---------- */
.form-card label { font-weight: 600; font-size: .94rem; margin-bottom: -8px; }
.input { width: 100%; font: 16px var(--font-body); padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(5, 7, 12, .6); color: var(--text); transition: border-color .2s, box-shadow .2s; } /* 16px — iPhone kattalashtirmasligi uchun */
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; font: 13px var(--font-mono); }

/* ---------- Natijalar ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { gap: 4px; }
.stat-value { font-size: 2.2rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat.good .stat-value { color: var(--safe); }
.stat.bad .stat-value { color: var(--danger); }
.legend { display: flex; gap: 16px; font-size: .85rem; color: var(--muted); }
.key::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.key-pre::before, .hbar-fill.pre { background: #475569; }
.key-post::before, .hbar-fill.post { background: var(--grad); }
.bars { display: flex; flex-direction: column; gap: 16px; }
.bar-group { display: flex; flex-direction: column; gap: 6px; }
.bar-label { font-weight: 600; font-size: .94rem; }
.hbar { display: grid; grid-template-columns: 1fr 44px; gap: 10px; align-items: center; }
.hbar-track { height: 10px; border-radius: 6px; background: rgba(148, 163, 184, .1); overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 6px; transform-origin: left; animation: grow 1s var(--ease) both .2s; }
@keyframes grow { from { transform: scaleX(0); } }
.hbar .mono { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.empty { align-items: center; text-align: center; padding: 40px 22px; color: var(--accent-2); }
.empty p { color: var(--muted); }

/* ---------- Profil ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-style: dashed; color: var(--muted); filter: grayscale(1); opacity: .7; }
.badge b { color: var(--muted); }
.badge.is-earned { border-style: solid; border-color: rgba(59, 130, 246, .5); background: linear-gradient(135deg, rgba(59, 130, 246, .16), var(--surface) 70%); color: var(--accent-2); filter: none; opacity: 1; box-shadow: var(--glow); }
.badge.is-earned b { color: var(--text); }
.danger-zone { flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; border-color: rgba(248, 113, 113, .3); }
.about { margin-top: 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--sb)); z-index: 50;
  transform: translate(-50%, 24px) scale(.95); opacity: 0; transition: opacity .3s, transform .4s var(--ease);
  display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 99px;
  background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 12px 40px rgba(59, 130, 246, .45); max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast .icon { animation: spin 1.2s var(--ease); }

/* ---------- Tarmoq foni (js/bg.js) ---------- */
.net { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Variant raqamlari (1–9 tugmalari) ---------- */
.options { counter-reset: opt; }
.option { display: flex; align-items: center; gap: 12px; }
.option::before {
  counter-increment: opt; content: counter(opt);
  flex: none; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
  font: 600 .74rem var(--font-mono); color: var(--muted); border: 1px solid var(--line-2); transition: all .2s;
}
.option:hover:not(:disabled)::before, .option.is-picked::before { color: #fff; background: var(--grad); border-color: transparent; }
.option.is-correct::before { color: #04120c; background: var(--safe); border-color: transparent; }
.option.is-wrong::before { color: #fff; background: var(--danger); border-color: transparent; }

/* ---------- Test ---------- */
.brief-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.brief-stats > div { display: flex; flex-direction: column; align-items: center; padding: 14px 8px; border-radius: 12px; background: rgba(59, 130, 246, .08); border: 1px solid rgba(59, 130, 246, .2); }
.brief-stats b { font-size: 1.8rem; font-weight: 750; line-height: 1.1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brief-stats span { font: .74rem var(--font-mono); color: var(--muted); }
.dots { display: flex; gap: 6px; }
.dots span { flex: 1; height: 5px; border-radius: 5px; background: rgba(148, 163, 184, .14); transition: background .3s; }
.dots .is-done { background: var(--accent); }
.dots .is-now { background: var(--grad); box-shadow: 0 0 10px var(--accent-2); animation: pulse-bar 1.6s ease-in-out infinite; }
@keyframes pulse-bar { 50% { opacity: .55; } }

/* ---------- Ma'lumot kartalari raqami ---------- */
.info-grid { counter-reset: card; }
.info h3::before { counter-increment: card; content: "0" counter(card); display: block; margin-bottom: 6px; font: 600 .72rem var(--font-mono); letter-spacing: .1em; color: var(--muted); }

/* ---------- Kutubxona / profil progressi ---------- */
.read-progress { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
mark { background: rgba(34, 211, 238, .25); color: #fff; border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -2px 0 var(--accent-2); }
.pts-up { color: var(--safe); white-space: nowrap; }

/* ---------- Moslashuvchanlik ---------- */
@media (max-width: 899px) {
  .toast { bottom: calc(var(--tabbar) + var(--sb) + 16px); }
  .hero { grid-template-columns: 1fr; }
  .journey, .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-layout { grid-template-columns: 1fr; }
  .backdrop i { filter: blur(70px); }
}
@media (max-width: 560px) {
  .card { padding: 16px; }
  .hero .btn-primary, .row-end .btn, .narrow > .card .btn-primary { width: 100%; }
  .hero-progress .ring { width: 104px; height: 104px; }
  .journey, .module-grid, .stat-row { grid-template-columns: 1fr; }
  .result-inline { flex-direction: column; align-items: flex-start; }
  .question { font-size: 1.02rem; }
  .term dl { grid-template-columns: 1fr; }
  .tip-card { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
