/* Onlayn test — sayt shisha uslubida. Mavzu detallari: santimetr lenta (progress), tikuv chizig'i (to'g'ri javob), ip (kirish). */
.tst { --t-ok: #00c9a7; --t-xato: #ff5773; --t-lenta: #ffd257; --t-lenta-ink: #4a3a00; --t-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; max-width: 980px; padding-bottom: 40px; }
.tst [hidden] { display: none !important; }
.tst :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 1. Kirish ---------- */
.tst-kirish { position: relative; overflow: hidden; padding: 38px 34px 30px; text-align: center; }
.tst-kirish h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 14px 0 8px; }
.tst-kirish h1 .grad { background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tst-lead { color: var(--text-mute); max-width: 560px; margin: 0 auto 22px; }
.tst-ip { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 120px; pointer-events: none; opacity: .5; }
.tst-ip path { fill: none; stroke: #ff6a88; stroke-width: 2; stroke-dasharray: 10 7; animation: tstIp 18s linear infinite; }
@keyframes tstIp { to { stroke-dashoffset: -340; } }
.tst-hisob { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 auto 24px; max-width: 760px; }
.tst-hisob div { background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-border); border-radius: 14px; padding: 12px 8px; }
.tst-hisob b { display: block; font: 800 1.7rem/1.1 inherit; font-family: inherit; font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 0 18px rgba(255, 106, 136, .55); }
.tst-hisob span { font-size: .8rem; color: var(--text-mute); }
.tst-tanlov { display: grid; gap: 8px; justify-items: center; margin-bottom: 22px; }
.tst-lbl { margin: 6px 0 0; font: 600 .7rem/1 var(--t-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--text-dim); }
.tst-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tst-chip { font: 500 .9rem/1 inherit; font-family: inherit; color: var(--text); background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-border); border-radius: 999px; padding: 9px 14px; cursor: pointer; }
.tst-chip small { color: var(--text-dim); margin-left: 4px; }
.tst-chip:hover { border-color: #ff6a88; }
.tst-chip[aria-checked="true"] { background: var(--grad-primary); border-color: transparent; color: #fff; }
.tst-chip[aria-checked="true"] small { color: rgba(255, 255, 255, .8); }
.tst-bosh { font-size: 1.05rem; padding: 14px 30px; box-shadow: 0 10px 30px rgba(160, 68, 255, .45); animation: tstPuls 2.4s ease-in-out infinite; }
@keyframes tstPuls { 50% { box-shadow: 0 10px 30px rgba(160, 68, 255, .45), 0 0 0 10px rgba(160, 68, 255, .15); } }
.tst-qiyin { margin: 18px auto 0; max-width: 620px; font-size: .85rem; color: var(--text-dim); }

/* ---------- 2. Aralashtirish: kartochkalar dastasi ---------- */
.tst-aralash { display: grid; justify-items: center; gap: 18px; padding: 70px 0; color: var(--text-mute); }
.tst-dasta { position: relative; width: 150px; height: 190px; }
.tst-dasta i { position: absolute; inset: 0; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .25); background: linear-gradient(160deg, rgba(160, 68, 255, .55), rgba(36, 84, 138, .7)); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); animation: tstAralash 1.1s ease-in-out infinite; }
.tst-dasta i::after { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; font: 800 3rem/1 inherit; font-family: inherit; color: rgba(255, 255, 255, .5); }
.tst-dasta i:nth-child(1) { animation-delay: 0s; } .tst-dasta i:nth-child(2) { animation-delay: .12s; } .tst-dasta i:nth-child(3) { animation-delay: .24s; }
.tst-dasta i:nth-child(4) { animation-delay: .36s; } .tst-dasta i:nth-child(5) { animation-delay: .48s; }
@keyframes tstAralash { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-70px, -10px) rotate(-14deg); } 50% { transform: translate(0, -18px) rotate(4deg); z-index: 5; } 75% { transform: translate(70px, -6px) rotate(12deg); } }

/* ---------- 3. Savol ---------- */
.tst-oyna { display: grid; gap: 14px; }
.tst-tepa { display: grid; gap: 8px; }
/* Santimetr lenta: progress */
.tst-lenta { position: relative; height: 26px; border-radius: 6px; background: rgba(255, 210, 87, .18); overflow: hidden; border: 1px solid rgba(255, 210, 87, .35); }
.tst-lenta-ich { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--t-lenta); transition: width .6s cubic-bezier(.2, .8, .2, 1);
  background-image: repeating-linear-gradient(90deg, var(--t-lenta-ink) 0 1px, transparent 1px 10px), repeating-linear-gradient(90deg, var(--t-lenta-ink) 0 1.5px, transparent 1.5px 50px);
  background-size: 100% 7px, 100% 13px; background-repeat: repeat-x; background-position: 0 0, 0 0; }
.tst-lenta-belgi { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; pointer-events: none; font: 700 .7rem/26px var(--t-mono); color: var(--t-lenta-ink); padding-left: 6px; }
.tst-holat { display: flex; align-items: center; gap: 12px; font: 600 .85rem var(--t-mono); color: var(--text-mute); }
.tst-holat #tst-ball { margin-left: auto; color: var(--t-ok); }
.tst-seriya { color: #ffb84d; animation: tstKir .4s backwards; }
.tst-karta { position: relative; padding: 26px 26px 20px; }
.tst-karta.kir { animation: tstKarta .5s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes tstKarta { from { opacity: 0; transform: translateX(40px) rotate(1.5deg); } }
.tst-mavzu { display: inline-block; font: 600 .7rem/1 var(--t-mono); letter-spacing: .06em; text-transform: uppercase; color: #eadcff; background: rgba(160, 68, 255, .3); padding: 5px 9px; border-radius: 6px; }
.tst-karta h2 { font-size: clamp(1.1rem, 2.4vw, 1.4rem); line-height: 1.4; margin: 12px 0 16px; text-wrap: balance; }
.tst-rasm { margin: 0 0 16px; text-align: center; }
.tst-rasm img { max-width: 100%; max-height: 260px; border-radius: 12px; background: #fff; padding: 8px; }
.tst-var { display: grid; gap: 10px; }
.tst-v { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-border); border-radius: 14px; padding: 12px 14px; cursor: pointer; transition: background .2s, border-color .2s, transform .2s;
  animation: tstVar .45s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i) * 90ms + 120ms); }
@keyframes tstVar { from { opacity: 0; transform: translate(var(--dx, 0), 24px) rotate(var(--r, 0)); } }
.tst-v:hover:not([disabled]) { border-color: #ff6a88; transform: translateX(4px); }
.tst-v b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .1); font: 700 .9rem var(--t-mono); }
.tst-v[disabled] { cursor: default; }
.tst-v.tanlangan { border-color: rgba(255, 255, 255, .5); }
.tst-v.ok { background: rgba(0, 201, 167, .16); border-color: transparent; }
.tst-v.ok b { background: var(--t-ok); color: #06231d; }
.tst-v.xato { background: rgba(255, 87, 115, .16); border-color: var(--t-xato); animation: tstSilk .45s; }
.tst-v.xato b { background: var(--t-xato); color: #fff; }
.tst-v.xira { opacity: .45; }
@keyframes tstSilk { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
/* To'g'ri javob atrofida tikuv chizig'i chiziladi */
.tst-tikuv { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); pointer-events: none; overflow: visible; }
.tst-tikuv rect { fill: none; stroke: var(--t-ok); stroke-width: 2.4; stroke-dasharray: 9 6; stroke-linecap: round; animation: tstTik 0.9s linear backwards; }
@keyframes tstTik { from { stroke-dashoffset: 600; stroke-opacity: 0; } 15% { stroke-opacity: 1; } }
.tst-plus { position: absolute; right: 16px; top: 50%; font: 800 1.1rem/1 inherit; font-family: inherit; color: var(--t-ok); pointer-events: none; animation: tstPlus 1s forwards; }
@keyframes tstPlus { from { opacity: 1; transform: translateY(-50%); } to { opacity: 0; transform: translateY(-160%); } }
.tst-pastki { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; min-height: 46px; flex-wrap: wrap; }
.tst-model { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: #d8c8ff; text-decoration: none; border: 1px dashed rgba(216, 200, 255, .5); border-radius: 999px; padding: 8px 13px; animation: tstKir .4s backwards .2s; }
.tst-model svg { width: 16px; height: 16px; }
.tst-model:hover { border-style: solid; color: #fff; }
#tst-keyingi { margin-left: auto; animation: tstKir .35s backwards; }
.tst-maslahat { text-align: center; font-size: .78rem; color: var(--text-dim); margin: 0; }
@keyframes tstKir { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 4. Natija ---------- */
.tst-natija { display: grid; gap: 16px; }
.tst-nat-karta { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: center; padding: 28px; }
.tst-doira { --f: 0; position: relative; width: 200px; aspect-ratio: 1; max-width: 100%; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, #262a5c 79%, transparent 80% 100%), conic-gradient(#ff6a88, #a044ff calc(var(--f) * 1%), rgba(255, 255, 255, .1) 0); }
.tst-doira b { font: 800 2.6rem/1 inherit; font-family: inherit; font-variant-numeric: tabular-nums; }
.tst-doira span { font-size: .85rem; color: var(--text-mute); margin-top: 4px; }
.tst-nat-matn h2 { margin: 0 0 6px; font-size: 1.6rem; }
.tst-nat-matn > p { margin: 0 0 16px; color: var(--text-mute); }
.tst-mavzular { display: grid; gap: 8px; margin-bottom: 18px; }
.tst-mv { display: grid; grid-template-columns: 120px minmax(0, 1fr) 54px; gap: 10px; align-items: center; font-size: .85rem; color: var(--text-mute); }
.tst-mv i { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.tst-mv i b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb84d, var(--t-ok)); transition: width 1.2s cubic-bezier(.2, .8, .2, 1) .3s; }
.tst-mv span { text-align: right; font-family: var(--t-mono); }
.tst-nat-tugma { display: flex; flex-wrap: wrap; gap: 10px; }
.tst-xatolar, .tst-umumiy { padding: 20px 22px; }
.tst-xatolar h3, .tst-umumiy h3 { margin: 0 0 12px; font-size: 1.05rem; }
.tst-x { padding: 12px 0; border-top: 1px solid var(--glass-border); display: grid; gap: 5px; font-size: .92rem; }
.tst-x:first-of-type { border-top: 0; }
.tst-x p { margin: 0; }
.tst-x .siz { color: #ffb3c0; } .tst-x .siz::before { content: "✗ "; }
.tst-x .tog { color: #7ff0d9; } .tst-x .tog::before { content: "✓ "; }
.tst-x img { max-height: 90px; border-radius: 8px; background: #fff; padding: 4px; justify-self: start; }
.tst-x a { font-size: .82rem; color: #d8c8ff; }
.tst-umumiy ul { margin: 0; padding-left: 18px; color: var(--text-mute); display: grid; gap: 6px; font-size: .9rem; }
.tst-konfetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 80; }

@media (max-width: 720px) {
  .tst-kirish { padding: 28px 18px 24px; }
  .tst-hisob { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tst-karta { padding: 20px 16px 16px; }
  .tst-nat-karta { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .tst-nat-tugma { justify-content: center; }
  .tst-mv { grid-template-columns: 90px minmax(0, 1fr) 46px; text-align: left; }
  .tst-maslahat { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tst *, .tst *::before, .tst *::after { animation: none !important; transition: none !important; }
}
