/* ==========================================================================
   5eedu — 3–4-sinf o'quvchilari uchun.
   Yo'nalish: stiker albomi — to'liq bo'yalgan rangli bloklar, qalin qora
   chegara, qattiq (xira emas) soya. Fon: rangli osmon va suzuvchi shakllar.
   ========================================================================== */

:root {
  --ink:   #16302C;   /* chuqur qarag'ay-siyoh — chegara va matn */
  --sky:   #DDE5D9;   /* mayin adir yashili — sahifa foni */
  --paper: #F8FAF6;   /* oq elementlar: nishon, tugma matni */
  --soft:  #4E5D55;   /* ikkinchi darajali matn */
  --c:     #B4D4E2;   /* kartaning rangi (inline o'rnatiladi) */

  --wrap: 1240px;
  --edge: 2px;                    /* chegara qalinligi */
  --drop: 4px;                    /* soya siljishi */
  /* Qattiq siyoh soyalar `var(--pop, ...)` orqali yozilgan: portal va dars
     sahifalari (`portal.css`) uni yumshoq soyaga almashtiradi, "Sirli
     sayyora" esa o'z ko'rinishida qoladi. */
  --round: 16px;

  /* Butun sayt bitta shriftda (portal bilan bir xil) — `base.html` ga qarang. */
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, b { font-family: var(--display); font-weight: 600; margin: 0; }

a { color: inherit; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* Kartalarning paydo bo'lishi */
@keyframes pop-in {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to   { opacity: 1; transform: none; }
}

/* --- Yuqori panel --------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 20px 24px;
}

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }

.logo-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  font-size: 24px;
  background: #F0D3A4;
  border: var(--edge) solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
  transition: transform .18s ease;
}

.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }

.logo-name { font-family: var(--display); font-weight: 700; font-size: 27px; letter-spacing: -.5px; }

.topbar-nav { display: flex; gap: 10px; }

.topbar-nav a {
  padding: 9px 16px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
  color: var(--soft);
  transition: border-color .15s, color .15s, background-color .15s;
}

.topbar-nav a:hover { border-color: var(--ink); color: var(--ink); background: var(--paper); }

/* --- Salomlashuv ---------------------------------------------------------- */

.welcome { max-width: var(--wrap); margin: 0 auto; padding: 34px 24px 46px; }

.welcome h1 {
  max-width: 16ch;
  font-size: clamp(38px, 6.5vw, 68px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -1.5px;
  animation: pop-in .6s cubic-bezier(.2, .8, .3, 1) backwards;
}

.welcome p {
  max-width: 44ch;
  margin: 18px 0 0;
  font-size: 19px;
  line-height: 1.55;
  color: var(--soft);
  animation: pop-in .6s cubic-bezier(.2, .8, .3, 1) .1s backwards;
}

/* --- Qator sarlavhasi ----------------------------------------------------- */

.row-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  max-width: var(--wrap);
  margin: 0 auto 22px;
  padding: 0 24px;
  font-size: 28px;
  letter-spacing: -.6px;
}

.row-title span {
  padding: 4px 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 13px;
}

/* --- Kartochkalar: 4 × 2 -------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.card {
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 310px;
  padding: 24px 22px 22px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
  text-decoration: none;
  color: var(--ink);
  transition: transform .16s ease, box-shadow .16s ease;
  animation: pop-in .55s cubic-bezier(.2, .8, .3, 1) backwards;
}

/* Kartalar birin-ketin chiqadi */
.cards .card:nth-child(1) { animation-delay: .15s; }
.cards .card:nth-child(2) { animation-delay: .21s; }
.cards .card:nth-child(3) { animation-delay: .27s; }
.cards .card:nth-child(4) { animation-delay: .33s; }
.cards .card:nth-child(5) { animation-delay: .39s; }
.cards .card:nth-child(6) { animation-delay: .45s; }
.cards .card:nth-child(7) { animation-delay: .51s; }
.cards .card:nth-child(8) { animation-delay: .57s; }

/* Qulflangan kartalar biroz so'nikroq — lekin baribir rangli */
.card--locked { filter: saturate(.82); }

a.card:hover {
  transform: translate(-4px, -4px);
  box-shadow: var(--pop, 11px 11px 0 var(--ink));
}

a.card:active { transform: translate(2px, 2px); box-shadow: var(--pop, 3px 3px 0 var(--ink)); }

.card-no {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
}

.card-emoji {
  font-size: 62px;
  line-height: 1;
  margin-bottom: 16px;
  transition: transform .2s ease;
}

a.card:hover .card-emoji { transform: rotate(-8deg) scale(1.1); }

.card-title { font-size: 23px; line-height: 1.15; letter-spacing: -.4px; }

.card-text { margin: 8px 0 0; font-size: 15px; line-height: 1.45; }

.card-btn,
.card-lock {
  align-self: flex-start;
  margin-top: auto;
  padding: 11px 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
}

.card-btn { background: var(--ink); color: var(--paper); }

.card-lock { background: var(--paper); font-size: 14px; }

.cards-empty {
  grid-column: 1 / -1;
  padding: 46px 24px;
  background: var(--paper);
  border: var(--edge) dashed var(--ink);
  border-radius: var(--round);
  text-align: center;
}

.cards-empty code { font-family: ui-monospace, monospace; font-size: 15px; }

/* --- 5 qadam -------------------------------------------------------------- */

.how { padding: 78px 0 20px; }

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  list-style: none;
}

.steps li { text-align: center; }

.step-no {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  transition: transform .18s ease;
}

.steps li:hover .step-no { transform: translateY(-5px) rotate(-8deg); }

.steps b { display: block; font-size: 18px; }
.steps i { display: block; margin-top: 4px; font-style: normal; font-size: 14px; color: var(--soft); }

/* --- Dars sahifasi -------------------------------------------------------- */

.lesson { max-width: 1100px; margin: 0 auto; padding: 10px 24px 80px; }

.back {
  display: inline-block;
  margin-bottom: 26px;
  padding: 9px 18px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
}

.back:hover { background: var(--ink); color: var(--paper); }

/* Emoji chapda, matn o'ngda — keng ekranda kartochka bo'sh qolmaydi.
   `.card-no` absolyut, shuning uchun katak taqsimotiga tushmaydi. */
.lesson-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  column-gap: 30px;
  padding: 34px 30px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
  animation: pop-in .55s cubic-bezier(.2, .8, .3, 1) backwards;
}

.lesson-emoji {
  grid-row: 1 / 3;
  align-self: center;
  font-size: 96px;
  line-height: 1;
}

.lesson-card h1 { align-self: end; font-size: clamp(32px, 5vw, 46px); line-height: 1.05; letter-spacing: -1px; }
.lesson-card p { align-self: start; margin: 12px 0 0; max-width: 52ch; line-height: 1.5; }

.facts { display: flex; gap: 16px; flex-wrap: wrap; margin: 30px 0; }

.fact {
  min-width: 108px;
  padding: 16px 22px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
  text-align: center;
}

.fact b { display: block; font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.1; }
.fact span { font-size: 14px; color: var(--soft); }

/* --- 5E papkalari --------------------------------------------------------
   Har bir bosqich — qog'oz papka: tepasida raqamli quloqcha, ichida oq varaq.
   Quloqcha `.folder` ning farzandi, shuning uchun papkaning yuqori chegarasini
   yopib o'tadi va ular yaxlit bir shakl bo'lib ko'rinadi.
   ------------------------------------------------------------------------- */

.stages-title {
  margin: 44px 0 0;
  font-size: 25px;
  letter-spacing: -.5px;
}

.folders {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 34px;
  padding: 0;
  list-style: none;
}

/* Papkalar turli balandlikda bo'lmasin — katak kengaytiriladi. */
.folder-slot { display: flex; }

.folder {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-top: 46px;
  padding: 18px 15px 16px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: 4px 20px 20px 20px;
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
  animation: pop-in .5s cubic-bezier(.2, .8, .3, 1) backwards;
}

.folders .folder-slot:nth-child(1) .folder { animation-delay: .10s; }
.folders .folder-slot:nth-child(2) .folder { animation-delay: .16s; }
.folders .folder-slot:nth-child(3) .folder { animation-delay: .22s; }
.folders .folder-slot:nth-child(4) .folder { animation-delay: .28s; }
.folders .folder-slot:nth-child(5) .folder { animation-delay: .34s; }

/* Faqat ochiladigan papka ko'tariladi — yopig'i qimirlamaydi. */
.folder--open:hover,
.folder--open:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: var(--pop, 9px 9px 0 var(--ink));
}

.folder--soon { filter: saturate(.7); }

/* Qulflangan bosqich — mazmuni tayyor, lekin navbati kelmagan. Rangi
   so'nadi, lekin butunlay o'chib ketmaydi: bola oldinda nima turganini
   ko'rib tursin. */
.folder--shut { filter: saturate(.45) brightness(1.04); }

/* Tugatilgan bosqichning quloqchasida raqam emas, belgi turadi. */
.folder--done .folder-tab { background: var(--paper); }

.folder-go {
  display: block;
  margin-top: auto;
  padding-top: 12px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
}

.folder-go--soon { opacity: .75; }
.folder-go--shut { opacity: .8; font-size: 13px; }

/* Quloqcha: pastki chegarasi yo'q — papka bilan qo'shilib ketadi. */
.folder-tab {
  position: absolute;
  left: calc(var(--edge) * -1);
  top: -27px;
  display: grid;
  place-items: center;
  width: 56%;
  min-width: 58px;
  height: 30px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-bottom: 0;
  border-radius: 9px 18px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
}

.folder-emoji { display: block; font-size: 38px; line-height: 1; }

.folder-name {
  display: block;
  margin-top: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .5px;
}

/* Papka ichidagi oq varaq */
.folder-sheet {
  display: block;
  margin-top: 12px;
  padding: 11px 12px 13px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
}

.folder-sheet b { display: block; font-size: 16px; }
.folder-sheet span { display: block; margin-top: 4px; font-size: 13px; line-height: 1.35; color: var(--soft); }

.soon-note {
  margin: 0;
  padding: 18px 22px;
  background: #F0D3A4;
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  font-weight: 700;
}

/* ==========================================================================
   Bosqich oqimi — muqova, topshiriqlar, yakun
   ========================================================================== */

/* --- Xabarchalar (ekran tepasida suzadi) ---------------------------------- */

.toasts {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 50;
  display: grid;
  gap: 8px;
  margin: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 11px 22px 11px 12px;
  background: #CFE5B4;
  border: var(--edge) solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  animation: toast-in .4s cubic-bezier(.2, .8, .3, 1),
             toast-out .6s ease 4.4s forwards;
}

.toast-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--ink);
  border-radius: 50%;
  color: #CFE5B4;
  font-size: 14px;
}

@keyframes toast-in  { from { opacity: 0; transform: translateY(-18px) scale(.94); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(-12px); visibility: hidden; } }

/* --- Umumiy: tugmalar va kiritish maydonlari ------------------------------ */

.btn {
  display: inline-block;
  padding: 14px 26px;
  background: var(--ink);
  border: var(--edge) solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 rgba(27, 27, 35, .28);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(27, 27, 35, .28); }
.btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 rgba(27, 27, 35, .28); }

.btn--ghost { background: var(--paper); color: var(--ink); }

.field { display: block; margin-bottom: 18px; }

.field > label {
  display: block;
  margin-bottom: 7px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
}

.input {
  display: block;
  width: 100%;
  padding: 13px 15px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 14px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
}

.input::placeholder { color: #9A9AA6; }

/* Fokus halqasi qora — bosqich rangi bo'lsa, ENGAGE'da qizil chiqib
   xato holatidan farq qilmay qoladi. */
.input:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(27, 27, 35, .16);
}

.field--bad .input { border-color: #D6263F; background: #FFF3F4; }
.field--bad .input:focus { box-shadow: 0 0 0 4px rgba(214, 38, 63, .22); }

.field-error {
  display: block;
  margin-top: 6px;
  color: #B01B31;
  font-size: 14px;
  font-weight: 700;
}

/* --- Bosqich muqovasi ----------------------------------------------------- */

/* --- Bosqich muqovasi: to'liq ekran, ikki ustun -----------------------------
   Yakun sahifasi bilan bir xil maket — o'quvchi bosqich boshida ham,
   oxirida ham bir xil tuzilishni ko'radi.
   ------------------------------------------------------------------------- */

.cover-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  grid-template-rows: minmax(0, 1fr);
  flex: 1;
  gap: 18px;
  min-height: 0;
}

.cover {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 30px 30px 28px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
  text-align: center;
  overflow-y: auto;
  animation: pop-in .5s cubic-bezier(.2, .8, .3, 1) backwards;
}

/* Yo'lakcha tepada, eslatma pastda, qolgani o'rtada — shunda muqovaning
   uch qismi ham bor va ustun bo'sh qolmaydi. */
.cover-mid { margin: auto 0; }

/* --- 5E yo'lakchasi -------------------------------------------------------
   Beshta bosqich: bajarilganida ✓, joriysida kattaroq nishon, mazmuni hali
   tayyor bo'lmaganida xiraroq. Orasidagi chiziq — ular bitta yo'l ekanini
   ko'rsatadi.
   ------------------------------------------------------------------------- */

.rail5 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail5-item { position: relative; display: flex; }

/* Nishonlar orasidagi bog'lovchi chiziq. */
.rail5-item + .rail5-item::before {
  content: "";
  width: 18px;
  height: 4px;
  align-self: center;
  background: rgba(27, 27, 35, .3);
}

.rail5-item a { display: flex; text-decoration: none; }

.rail5-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  transition: transform .15s ease, box-shadow .15s ease;
}

.rail5-item a:hover .rail5-mark { transform: translateY(-2px); box-shadow: 0 3px 0 var(--ink); }

.rail5-item.is-done .rail5-mark {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
}

/* Joriy bosqich — kattaroq va soyali, ko'z birinchi shunga tushadi. */
.rail5-item.is-current .rail5-mark {
  width: 48px;
  height: 48px;
  font-size: 22px;
  box-shadow: var(--pop, 3px 3px 0 var(--ink));
}

.rail5-item.is-soon .rail5-mark { border-style: dashed; opacity: .55; }

/* Bosqich belgisi — medalyon. Katta tekis fonda yolg'iz emoji yo'qolib
   ketardi, doira unga og'irlik beradi. */
.cover-emoji {
  display: grid;
  place-items: center;
  width: clamp(94px, 14vh, 132px);
  height: clamp(94px, 14vh, 132px);
  margin: 0 auto;
  background: rgba(255, 253, 248, .5);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  box-shadow: var(--pop, 5px 5px 0 var(--ink));
  font-size: clamp(46px, 7.5vh, 68px);
  line-height: 1;
}

.cover-eyebrow {
  margin: 12px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
}

.cover h1 { margin: 5px 0 0; font-size: clamp(26px, 3vw, 40px); line-height: 1.1; letter-spacing: -1px; }
.cover-lead { margin: 10px auto 0; max-width: 40ch; line-height: 1.5; }

.cover-facts {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.cover-facts li {
  min-width: 112px;
  padding: 12px 16px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
}

.cover-facts b { display: block; font-family: var(--display); font-weight: 700; font-size: 25px; line-height: 1.1; }
.cover-facts span { font-size: 12px; color: var(--soft); }

/* Ish boshlangach raqamlar o'rniga to'lib boruvchi chiziq turadi — bola
   qancha qolganini bir qarashda ko'radi. */
.cover-progress {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(280px, 100%);
  margin: 26px auto 0;
  padding: 16px 20px 14px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
}

.cover-progress .meter { width: 100%; flex: none; height: 16px; }

/* Muqova foni bosqich rangida — to'ldiruvchi ham shu rangda bo'lsa
   ko'rinmay qoladi, shuning uchun qora. */
.meter--cover .meter-fill { background: var(--ink); }

.cover-progress b { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1; }
.cover-progress i { font-style: normal; font-size: 12px; color: var(--soft); }

.cover-note {
  align-self: center;
  margin: 18px 0 0;
  padding: 9px 18px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
}

/* O'ng panel */
.cover-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 10px 22px 24px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
  animation: pop-in .5s cubic-bezier(.2, .8, .3, 1) .1s backwards;
}

.cover-head { flex: none; margin: 0 0 14px; font-size: 21px; letter-spacing: -.4px; }

/* Ro'yxat va harakat kartochkasi birga panelning o'rtasida turadi.
   Bosqichda 2–4 ta topshiriq bo'ladi, ya'ni ro'yxat panelni to'ldirmaydi —
   ortiqcha joy tepa va pastga teng bo'linsa, u chetlik bo'lib ko'rinadi,
   maketning o'rtasidagi teshik bo'lib emas. */
.cover-scroll {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  overflow-y: auto;
  padding-right: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--ink) transparent;
}

.cover-scroll::-webkit-scrollbar { width: 10px; }
.cover-scroll::-webkit-scrollbar-track { background: transparent; }
.cover-scroll::-webkit-scrollbar-thumb {
  background: var(--ink);
  border: 3px solid var(--paper);
  border-radius: 999px;
}

.preview { flex: none; margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 11px; }

.preview-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px 18px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 16px;
  transition: transform .15s ease, box-shadow .15s ease;
}

/* Bajarilgan qadam ko'zga tashlanib tursin — ro'yxatda qayergacha
   yetganini sanamasdan ko'radi. */
.preview-item.is-done { background: #F3FBF1; }

/* Ish boshlangan bo'lsa qator havolaga aylanadi. Manfiy chet bilan bosiladigan
   maydon butun qatorni qoplaydi — faqat matnni emas. */
.preview-item > a {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 15px;
  margin: -16px -18px;
  padding: 16px 18px;
  text-decoration: none;
}

.preview-item:has(a):hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
}

.preview-no {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
}

.preview-item.is-done .preview-no { background: var(--c); }

.preview-text b { display: block; font-size: 16px; }
.preview-text > span { display: block; font-size: 14px; color: var(--soft); line-height: 1.35; }

.preview-go {
  margin-left: auto;
  padding-left: 12px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: var(--soft);
}

.preview-item:has(a):hover .preview-go { color: var(--ink); }

.start-nav { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* Panel ichidagi kartochka — tashqi kartochkalardan yengilroq. */
.start-card {
  flex: none;
  padding: 20px 22px 22px;
  background: #F7F8FC;
  border: 2px solid var(--ink);
  border-radius: 16px;
}

/* Bosqich tugagandagi kartochka — bayram rangida. */
.start-card--done { background: #E9FBE6; border-color: var(--ink); }

.start-card h2 { font-size: 20px; }
.start-note { margin: 8px 0 16px; line-height: 1.5; color: var(--soft); }

/* --- Topshiriq ekrani: to'liq oyna ----------------------------------------
   Topshiriq sahifasida yuqori menyu va pastki qator yashiriladi, ekranni
   faqat topshiriq egallaydi. `100dvh` — mobil brauzer paneli hisobga olinadi;
   `min-height` bo'lgani uchun matn ko'payib ketsa sahifa cho'ziladi, kesilmaydi.
   ------------------------------------------------------------------------- */

/* Topshiriq ekranidagi xabarcha: ekran pastida, o'rtada suzadi va uch
   soniyadan keyin o'zi so'nadi. Joy egallamaydi — sarlavha ham, qadamlar
   chizig'i ham o'z o'rnida qoladi. Bosishga xalaqit bermasin uchun
   `pointer-events` o'chirilgan. */
.snacks {
  position: fixed;
  bottom: 18px;
  left: 50%;
  z-index: 60;
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

.snack {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 9px 20px 9px 9px;
  background: #CFE5B4;
  border: var(--edge) solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 rgba(27, 27, 35, .3);
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  animation: snack-in .4s cubic-bezier(.2, .8, .3, 1),
             snack-out .5s ease 3.2s forwards;
}

/* Ko'rib chiqish rejimidagi eslatma — sariq, chunki u tabrik emas.
   Belgisi halqasiz: 👁 emojisining o'z rangi bor, qora doira ichida
   ko'rinmay qoladi. Topshiriq tepasidagi eslatma ham aynan shunday. */
.snack--info { background: #F0D3A4; padding-left: 16px; }
.snack--info .snack-mark { width: auto; background: none; font-size: 17px; }

.snack-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  background: var(--ink);
  border-radius: 50%;
  color: #CFE5B4;
  font-size: 13px;
  line-height: 1;
}

@keyframes snack-in  { from { opacity: 0; transform: translateY(18px) scale(.94); } }
@keyframes snack-out { to   { opacity: 0; transform: translateY(10px); visibility: hidden; } }

/* Telefonda "Saqlash" tugmasi ekran pastini to'la egallaydi — xabarcha
   uning ustiga tushmasligi uchun biroz yuqoriroq turadi. */
@media (max-width: 640px) {
  .snacks { bottom: auto; top: 66px; width: calc(100% - 28px); }
  .snack {
    justify-content: center;
    font-size: 14px;
    white-space: normal;
    animation-name: snack-in-top, snack-out-top;
  }
  @keyframes snack-in-top  { from { opacity: 0; transform: translateY(-18px) scale(.94); } }
  @keyframes snack-out-top { to   { opacity: 0; transform: translateY(-10px); visibility: hidden; } }
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100dvh;
  max-width: 1500px;
  margin: 0 auto;
  padding: 14px 26px 22px;
}

/* Aniq balandlik — `min-height` bo'lsa idish mazmun bilan cho'ziladi va
   ichkaridagi panel aylantirila olmaydi. Yakun sahifasi shuni talab qiladi. */
.screen--fixed { height: 100dvh; }

.stage-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.back--tight { margin-bottom: 0; }

.stage-chip,
.stage-who {
  padding: 8px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.stage-chip { background: var(--c); }

/* Kim kirgani — har doim qatorning o'ng chetida. Qadamlar chizig'i yo'q
   sahifada (bosqich muqovasi) usiz bosqich yorlig'iga yopishib qolardi. */
.stage-who { margin-left: auto; background: var(--paper); }

/* Qadamlar chizig'i endi yuqori qatorning o'rtasida turadi. */
.rail {
  display: flex;
  flex: 1;
  justify-content: center;
  max-width: 460px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.rail-step {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}

.rail-step::before {
  content: "";
  position: absolute;
  top: 17px;
  right: 50%;
  left: -50%;
  height: 3px;
  background: var(--ink);
  opacity: .2;
}

.rail-step:first-child::before { display: none; }
.rail-step.is-done::before,
.rail-step.is-current::before { opacity: 1; }

.rail-dot {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
}

.rail-step.is-done .rail-dot { background: var(--c); }

.rail-step.is-current .rail-dot {
  background: var(--c);
  box-shadow: 0 0 0 5px rgba(27, 27, 35, .12);
  transform: scale(1.1);
}

.rail-label { font-size: 12px; line-height: 1.2; color: var(--soft); }
.rail-step.is-current .rail-label { color: var(--ink); font-weight: 700; }

/* --- Topshiriq kartochkasi: qolgan bo'sh joyni to'la egallaydi ------------- */

.task {
  display: flex;
  flex: 1;
  flex-direction: column;
  /* `.stack` dagi kabi: usiz karta mazmunidan kichrayolmaydi va aniq
     balandlikdagi ekranda (`.screen--fixed`) pastdan chiqib ketadi. */
  min-height: 0;
  padding: 26px 30px 28px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
  animation: pop-in .45s cubic-bezier(.2, .8, .3, 1) backwards;
}

.task-head { flex: none; }

.task-eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 14px;
  background: var(--c);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
}

.task-title { font-size: clamp(23px, 2.6vw, 34px); line-height: 1.12; letter-spacing: -.6px; }
.task-lead { margin: 10px 0 0; max-width: 78ch; line-height: 1.5; color: var(--soft); }

/* Tor ekran uchun yozilgan yo'riqnoma. Kengda yashirin turadi, torda esa
   o'zi ko'rinib, asosiysining o'rnini egallaydi (almashtirish 780px dagi
   media-blokda). */
.task-lead--narrow { display: none; }

.task-saved {
  margin: 14px 0 0;
  padding: 10px 16px;
  background: #FFF3C4;
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
}

/* Ikki ustunli maket: chapda rasm/shakl, o'ngda savollar. */
/* Chap ustun rasm kengligiga teng bo'ladi (`auto`) — aks holda rasm
   1fr katak ichida markazlashib, yonida bo'sh joy qolardi. */
.split {
  display: grid;
  /* Savol ustuniga kafolatlangan eni beriladi: keng (yotiq) surat bo'lsa
     ham u maydonlarni siqib, tugmalarni ikki qatorga bo'lib yubormaydi —
     o'shanda torayadigan tomon suratning o'zi bo'ladi. */
  grid-template-columns: minmax(0, auto) minmax(410px, 1fr);
  flex: 1;
  gap: 34px;
  align-items: center;
  margin-top: 18px;
}

/* `container-type` — pastdagi qator shu ustunning eniga qarab tuzilishini
   o'zgartira olsin (oyna eniga emas: yonidagi surat qanchalik keng
   ekaniga ham bog'liq). */
.split-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  container-type: inline-size;
}

/* Ustun torayganda izoh ikkita tugma orasiga sig'maydi va ingichka
   ustunga aylanadi. O'shanda u pastga tushadi, tugmalar bir satrda qoladi. */
@container (max-width: 440px) {
  .split-form .task-nav { flex-wrap: wrap; }
  .split-form .task-hint { order: 3; flex: 1 0 100%; margin-top: 2px; }
}

/* Ustma-ust maket: tepada rasmlar, ostida savol.
   `min-height: 0` shart: usiz flex bola mazmunidan kichrayolmaydi va
   ichkaridagi aylantirish sohalari (jadval, test) ishlamay qoladi. */
.stack { display: flex; flex: 1; flex-direction: column; min-height: 0; margin-top: 20px; }

/* Katta surat — bo'sh joyning balandligiga moslashadi. */
/* `align-items: center` shart: usiz suratning ramkasi ustunning butun
   balandligiga cho'ziladi va yotiq rasmda tepa-pastda oq yo'l qoladi. */
.photo {
  display: flex;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.photo img {
  width: auto;
  max-width: 100%;
  height: auto;
  /* Oyna balandligidan sarlavha va tugmalar uchun ~330px ayiramiz — shunda
     rasm har qanday ekranda bor joyni to'la egallaydi, lekin chiqib ketmaydi. */
  max-height: min(calc(100dvh - 330px), 780px);
  object-fit: contain;
  border: var(--edge) solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--pop, 6px 6px 0 var(--ink));
}

/* To'rtta kundalik ish surati */
.shots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  flex: 1;
  gap: 16px;
  align-content: center;
  margin-bottom: 22px;
}

.shot { display: flex; flex-direction: column; margin: 0; }

.shot img {
  display: block;
  width: 100%;
  height: clamp(128px, calc(100dvh - 668px), 340px);
  object-fit: cover;
  border: var(--edge) solid var(--ink);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
}

.shot figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: 0 0 18px 18px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
}

.shot figcaption span { font-size: 20px; }

/* Galereyada javob maydoni qolgan bo'sh joyni to'la egallaydi, shunda
   "Saqlash" tugmasi doim ekranda ko'rinib turadi. */
.task--gallery form { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.task--gallery form .field { display: flex; flex: 1; flex-direction: column; min-height: 0; margin-bottom: 0; }
.task--gallery form .input { flex: 1; min-height: 72px; }
.task--gallery form .task-nav { flex: none; }

/* --- Muammoli savol: olti burchak va rangli a'zo kartochkalari ------------- */

.split--problem { align-items: center; }

/* Namuna va qisqa maydonlarsiz variant: yagona javob maydoni butun
   balandlikni egallaydi, olti burchak yonida markazda turadi.

   Ustunga aniq kenglik beriladi: `auto` ustunda olti burchakning
   `min(215px, 100%)` kengligi o'z idishidan hisoblanib, kichrayib ketardi. */
.split--plain { align-items: stretch; }
.split--plain .hex-side { justify-content: center; width: 280px; }

/* Rasmli variantda ustun kengroq — surat kichrayib qolmasin. Rasm ustunning
   o'rtasida emas, tepasida turadi: yonidagi javob maydoni ham tepadan
   boshlanadi, ikkalasi bir chiziqda tursin. */
/* Rasmli variantda ustun kengroq — surat kichrayib qolmasin. Rasm ustunning
   o'rtasida emas, tepasida boshlanadi: yonidagi javob maydoni ham tepadan
   boshlanadi, ikkalasi bir chiziqda tursin. */
.split--plain .hex-side--pic {
  width: min(400px, 36vw);
  align-items: stretch;
  justify-content: flex-start;
  padding-top: 34px;
}

/* Surat ustunning bo'sh joyini egallaydi — pastda ochiq joy qolmasin.
   `cover` kadrni kesadi, cho'zmaydi. */
.qpic { flex: 1; min-height: 0; max-height: 560px; margin: 0; }

.qpic img {
  display: block;
  width: 100%;
  height: 100%;
  border: var(--edge) solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
  object-fit: cover;
}

/* Ustunlar ustma-ust tushganda rasm butun kenglikni oladi — `36vw` tor
   ekranda uni pochta markasidek kichraytirib yuborardi. */
@media (max-width: 1080px) {
  .split--plain .hex-side--pic {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding-top: 0;
  }

  .qpic { flex: none; max-height: none; }
  .qpic img { height: auto; aspect-ratio: 4 / 3; }
}

/* --- Muammoli savolning "isbotlari" ---------------------------------------
   Slaydda sanab o'tilgan misollar: harakat qiladi — lekin jonlimi?
   -------------------------------------------------------------------------- */

.clues { display: grid; gap: 10px; width: 100%; margin: 4px 0 0; padding: 0; list-style: none; }

.clue {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
}

/* Zanjir varianti: kartochkalar orasida strelka — bitta o'zgarish
   ikkinchisini tortib kelishini ko'rsatadi. */
.clues--chain { gap: 26px; }

.clues--chain .clue + .clue::before {
  content: "↓";
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1;
  color: rgba(27, 27, 35, .5);
}

.clue-emoji {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  overflow: hidden;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 21px;
  line-height: 1;
}

/* Rasm nishonchani to'la egallaydi. Suratlar kichik kesmalar (105–140px),
   shuning uchun ular kichraytiriladi — kattalashtirilsa xiralashardi. */
.clue-emoji img { width: 84%; height: 84%; object-fit: contain; }

.clue-text { line-height: 1.2; text-align: left; }
.clue-text b { display: block; font-size: 16px; }
.clue-text i { font-style: normal; font-size: 13.5px; opacity: .75; }

/* Har bir kartochkaning oxiridagi savol belgisi — javob hali noma'lum. */
.clue-ask {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  margin-left: auto;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
}
.split--plain .field { display: flex; flex: 1; flex-direction: column; margin-bottom: 0; }
.split--plain textarea.input { flex: 1; min-height: 150px; }

.hex-side { display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* Ikki qavat: tashqisi qora (chegara vazifasini bajaradi), ichkisi rangli.
   clip-path chegarani kesib tashlaydi, shuning uchun shunday qilingan. */
.hex {
  width: min(215px, 100%);
  padding: 4px;
  background: var(--ink);
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.hex-in {
  display: grid;
  place-items: center;
  gap: 2px;
  /* Matn qiyshiq chetlarga tegib ketmasin */
  padding: 0 20%;
  overflow: hidden;
  aspect-ratio: 1.15;
  background: var(--c);
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  font-family: var(--display);
  text-align: center;
}

.hex-mark { font-size: 42px; font-weight: 700; line-height: 1; }
.hex-in b { font-size: 15px; }

/* --- A'zolar halqasi -------------------------------------------------------
   Markazda savol, atrofida sakkizta a'zo. Har biri markazga chiziq bilan
   bog'langan — topshiriqning javobi shu rasmda: hech bir a'zo yolg'iz emas.

   Nishonchalar burchak bo'yicha joylashadi: idish markazidan `--a` gradusga
   burilib, `--r` masofaga suriladi, so'ng nishonchaning o'zi teskari buriladi
   (aks holda emoji yonboshlab qolardi). Shu yo'l bilan hech qanday hisob-kitob
   yoki JS talab qilinmaydi — faqat sakkizta burchak.
   -------------------------------------------------------------------------- */

/* O'lchov aniq beriladi: bu ustun `auto` kengligida turadi, foizga
   tayansak idish o'z mazmunidan hisoblanib halqa markazdan siljib ketadi. */
.orbit {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 286px;
  height: 286px;
  --r: 118px;
}

/* Ichkaridagi xira halqa — nishonchalar bir aylanada turgani bilinsin. */
.orbit-ring {
  position: absolute;
  inset: 50% auto auto 50%;
  width: calc(var(--r) * 2);
  height: calc(var(--r) * 2);
  transform: translate(-50%, -50%);
  border: 3px dashed rgba(27, 27, 35, .16);
  border-radius: 50%;
}

/* Halqa ichidagi olti burchak kichikroq — yozuvi ham shunga yarasha. */
.orbit .hex { width: 124px; }
.orbit .hex-in { padding: 0 15%; gap: 1px; }
.orbit .hex-mark { font-size: 33px; }
.orbit .hex-in b { font-size: 12.5px; line-height: 1.15; }

.orbit-list { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }

.orbit-slot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: rotate(var(--a)) translateX(var(--r));
}

/* Markazga qarab ketgan chiziq. Idish bilan birga burilgani uchun har doim
   aynan markazga qaraydi — alohida hisoblash shart emas. */
.orbit-slot::before {
  content: "";
  position: absolute;
  top: -3px;
  right: 22px;
  width: 30px;
  height: 6px;
  background: rgba(27, 27, 35, .16);
  border-radius: 3px;
  transition: background-color .3s ease;
}

.orbit-chip {
  position: absolute;
  top: -23px;
  left: -23px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  box-shadow: 3px 3px 0 rgba(27, 27, 35, .22);
  font-family: var(--display);
  font-weight: 700;
  font-size: 23px;
  transform: rotate(calc(-1 * var(--a)));
  transition: background-color .3s ease, box-shadow .3s ease;
}

/* Emojisi yo'q a'zo (jigar) — chizilgan belgi emoji o'lchamida turadi. */
.orbit-chip img { display: block; width: 28px; height: 28px; }

/* Javob berilgan a'zo — o'z rangida yonadi va chizig'i to'qlashadi. */
.orbit-slot.is-on .orbit-chip {
  background: var(--c);
  box-shadow: var(--pop, 3px 3px 0 var(--ink));
  animation: orbit-pop .45s cubic-bezier(.2, .8, .3, 1);
}

.orbit-slot.is-on::before { background: var(--ink); }

/* Hamma a'zo to'ldirilganda halqa yopiladi: uzuq chiziq to'liq chiziqqa
   aylanadi. Topshiriq tugagani shundan bilinadi — alohida yozuv kerak emas. */
.is-tally-full .orbit-ring {
  border-style: solid;
  border-color: var(--ink);
  animation: orbit-close .5s cubic-bezier(.2, .8, .3, 1);
}

@keyframes orbit-close { from { transform: translate(-50%, -50%) scale(.88); } }

@keyframes orbit-pop {
  40% { transform: rotate(calc(-1 * var(--a))) scale(1.22); }
}

/* Sakkizta o'rin — soat 12 dan boshlab. */
.orbit-slot:nth-child(1) { --a: -90deg; }
.orbit-slot:nth-child(2) { --a: -45deg; }
.orbit-slot:nth-child(3) { --a: 0deg; }
.orbit-slot:nth-child(4) { --a: 45deg; }
.orbit-slot:nth-child(5) { --a: 90deg; }
.orbit-slot:nth-child(6) { --a: 135deg; }
.orbit-slot:nth-child(7) { --a: 180deg; }
.orbit-slot:nth-child(8) { --a: -135deg; }

/* --- Namuna javoblar ------------------------------------------------------ */

.examples-title { margin: 16px 0 8px; font-weight: 700; font-size: 14px; color: var(--soft); }

.examples { display: flex; gap: 10px; flex-wrap: wrap; }

.example {
  padding: 9px 16px;
  background: var(--c);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 15px;
}

/* --- A'zo kartochkalari ---------------------------------------------------- */

.organs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 10px;
}

.organs-title { margin: 0; font-family: var(--display); font-weight: 600; font-size: 17px; }

.organs-bar .tally { align-self: auto; margin: 0; }

.organs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* Kartochka: chapda katta nishon, o'ngda nomi, ostida javob maydoni.
   Nishon o'zi oq doira — rangli fonda ham aniq ko'rinadi. */
.organ {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 11px;
  padding: 12px 14px 14px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
  transition: transform .18s ease, box-shadow .18s ease;
}

.organ:focus-within { transform: translate(-2px, -2px); box-shadow: var(--pop, 6px 6px 0 var(--ink)); }

.organ-badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 27px;
  line-height: 1;
}

.organ-badge img { display: block; width: 34px; height: 34px; }

.organ-text { align-self: center; line-height: 1.15; }
.organ-text b { display: block; font-size: 19px; letter-spacing: -.3px; }
.organ-text i { font-style: normal; font-size: 13.5px; opacity: .72; }

/* Javob maydoni ikkala ustun ostidan o'tadi. */
.organ .input {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding: 9px 13px;
  border-width: 2px;
  border-radius: 12px;
  font-size: 15px;
}

.organ .field-error { grid-column: 1 / -1; }

/* To'ldirilgan kartochkaning burchagida muhr paydo bo'ladi. */
.organ-tick {
  position: absolute;
  top: -11px;
  right: -9px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--ink);
  border-radius: 50%;
  color: #CFE5B4;
  font-size: 15px;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .2s ease, transform .25s cubic-bezier(.2, .8, .3, 1);
}

.organ.is-answered .organ-tick { opacity: 1; transform: scale(1); }

.organ--bad { border-color: #D6263F; box-shadow: 4px 4px 0 #D6263F; }

/* Past ekranda (noutbuk) halqa va kartochkalar zichlashadi — maqsad o'sha:
   "Saqlash" tugmasi aylantirmasdan ko'rinsin. Chegara loyihadagi boshqa
   zichlashtirish qoidalari bilan bir xil. */
@media (max-height: 900px) {
  .orbit { width: 250px; height: 250px; --r: 103px; }
  .orbit .hex { width: 108px; }
  .orbit .hex-mark { font-size: 29px; }
  .orbit .hex-in b { font-size: 11.5px; }
  .orbit-chip { width: 42px; height: 42px; top: -21px; left: -21px; font-size: 20px; }
  .orbit-chip img { width: 25px; height: 25px; }
  .orbit-slot::before { right: 20px; width: 24px; }

  .examples-title { margin: 12px 0 6px; }
  .example { padding: 7px 14px; font-size: 14px; }

  .organs-bar { margin: 12px 0 8px; }
  .organ { padding: 10px 12px 12px; gap: 3px 9px; }
  .organ-badge { width: 46px; height: 46px; font-size: 24px; }
  .organ-badge img { width: 30px; height: 30px; }
  .organ-text b { font-size: 17px; }
  .organ .input { padding: 8px 12px; }
}

/* Tor ekranda halqa uch ustunga sig'maydi — kartochkalar bittadan tushadi. */
@media (max-width: 860px) {
  .organs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .organs { grid-template-columns: minmax(0, 1fr); }
  .organs-bar { justify-content: flex-start; }
}

/* --- Tajriba: taymer va sanoq ---------------------------------------------
   Chapda katta siferblat, o'ngda bosqichlar. Tajriba tugagach chap qism
   yopiladi va savollar butun ekranni egallaydi — slayddagi "Ekranga savol
   chiqadi" shu.
   ------------------------------------------------------------------------- */

.exp { display: flex; flex: 1; flex-direction: column; min-height: 0; }

/* --- Qadamlar yo'lakchasi -------------------------------------------------- */

/* Kenglik mazmuni bo'yicha — aks holda bog'lovchi chiziq butun kartochkani
   kesib o'tadi. */
.exp-dots {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  width: max-content;
  max-width: 100%;
  margin: 14px auto 4px;
  padding: 0;
  list-style: none;
}

/* Bog'lovchi chiziq — bitta yo'l bo'lib butun qator ortidan o'tadi. */
.exp-dots::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 24px;
  right: 24px;
  height: 4px;
  margin-top: -2px;
  background: rgba(27, 27, 35, .22);
}

.exp-dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  opacity: .5;
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
}

.exp-dot.is-done { opacity: 1; background: var(--c); }

.exp-dot.is-current {
  opacity: 1;
  background: var(--c);
  transform: scale(1.18);
  box-shadow: var(--pop, 3px 3px 0 var(--ink));
}

/* --- Bitta qadam ekrani ---------------------------------------------------- */

.exp-screen {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  flex: 1;
  gap: 36px;
  align-items: center;
  min-height: 0;
  margin-top: 10px;
  animation: pop-in .4s cubic-bezier(.2, .8, .3, 1) backwards;
}

.exp-screen[hidden] { display: none; }

/* Xulosa ekrani — bitta ustun, o'rtada. */
.exp-screen--wrap { grid-template-columns: minmax(0, 1fr); }
.exp-wrap { display: flex; flex-direction: column; min-height: 0; width: min(760px, 100%); margin: 0 auto; }

/* Tajribasiz o'tilganda hamma ekran birdan ochiladi: sanoq endi keraksiz,
   savollar esa oddiy forma bo'lib ustma-ust turadi. */
.exp.is-open .exp-screen { grid-template-columns: minmax(0, 1fr); flex: none; animation: none; }
.exp.is-open .exp-dial,
.exp.is-open .exp-controls,
.exp.is-open [data-exp-next] { display: none; }

/* Siferblat */
.exp-dial {
  position: relative;
  display: grid;
  place-items: center;
  width: min(clamp(190px, 36vh, 330px), 100%);
  aspect-ratio: 1;
}

.exp-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.dial-plate { fill: var(--paper); stroke: var(--ink); stroke-width: 3; }
.dial-track { fill: none; stroke: rgba(27, 27, 35, .12); stroke-width: 10; }

.dial-ring {
  fill: none;
  stroke: var(--c);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset .3s linear;
}

.dial-face { position: absolute; display: grid; place-items: center; text-align: center; }
.dial-face b { font-family: var(--display); font-weight: 700; font-size: clamp(48px, 11vh, 92px); line-height: 1; }
.dial-face i { font-style: normal; font-size: 14px; color: var(--soft); }

/* Sanayotgan paytda siferblat sekin nafas oladi */
.is-running .exp-dial { animation: dial-beat 1s ease-in-out infinite; }
@keyframes dial-beat { 50% { transform: scale(1.035); } }

/* --- Qadamning o'ng ustuni ------------------------------------------------- */

.exp-side { display: flex; flex-direction: column; min-height: 0; }

.exp-step {
  display: inline-block;
  align-self: flex-start;
  margin: 0 0 10px;
  padding: 6px 14px;
  background: var(--c);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
}

.exp-label { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -.4px; }
.exp-hint { margin: 8px 0 0; max-width: 46ch; line-height: 1.45; color: var(--soft); }

.exp-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  box-shadow: var(--pop, 3px 3px 0 var(--ink));
  font-size: 20px;
  cursor: pointer;
}

.icon-btn:active { transform: translate(2px, 2px); box-shadow: var(--pop, 1px 1px 0 var(--ink)); }

/* --- Sanoq davomida o'qiladigan matn --------------------------------------- *
   Ko'z tajribasida bola shu matnni o'qiydi. Shuning uchun bezak emas, o'qish
   qulayligi birinchi o'rinda: harf yirik, qatorlar bo'sh, kenglik esa
   ~44 belgidan oshmaydi — ko'z qatorning boshini yo'qotmasin.
   -------------------------------------------------------------------------- */

.exp-read {
  margin-top: 18px;
  padding: 18px 24px 22px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--pop, 5px 5px 0 var(--ink));
}

/* Nishoncha qadam raqamining nishonchasi bilan bir xil — ikkalasi ham
   "bu yerdan boshla" degan belgi. */
.exp-read-head {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 13px;
  background: var(--c);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
}

.exp-read-text {
  margin: 0;
  max-width: 62ch;
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.75;
}

/* --- Sanoqdan keyingi savol ------------------------------------------------ */

/* JS bor — savol sanoq tugaguncha yopiq turadi. JS yo'q bo'lsa (`js` sinfi
   qo'yilmagan) savol boshidanoq ochiq, forma oddiy holda ishlaydi.
   Tajribasiz o'tilganda (`is-open`) hamma savol darrov ochiladi. */
.js .exp:not(.is-open) .exp-screen:not(.is-asking) .exp-ask { display: none; }

.exp-ask {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 3px dashed rgba(27, 27, 35, .2);
  animation: pop-in .4s cubic-bezier(.2, .8, .3, 1) backwards;
}

.exp-ask-head {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  color: var(--soft);
}

.exp.is-open .exp-ask { border-top: 0; padding-top: 0; margin-top: 14px; }

/* Saqlash tugmasi faqat oxirgi ekranda: o'rtada bosilsa forma yarim to'ldirilgan
   holda ketib, bola xato ro'yxatiga duch kelardi. "Orqaga" havolasi esa
   qoladi — oqimning ichida ham chiqish yo'li bo'lsin. */
.js .exp:not(.is-final):not(.is-open) .task-nav button[type="submit"],
.js .exp:not(.is-final):not(.is-open) .task-hint { visibility: hidden; }

/* Rangli quti — qisqa javoblar shunda turadi. */
.exp-box {
  margin-bottom: 12px;
  padding: 13px 15px 15px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
}

.exp-box .field { margin-bottom: 0; }
.exp-box .input { border-width: 2px; }

/* Xulosadagi uzun javob bo'sh joyni to'la egallaydi — "Saqlash" tugmasi
   kartochka tubida tursin, o'rtada osilib qolmasin. */
.exp-wrap > .field:last-of-type { display: flex; flex: 1; flex-direction: column; min-height: 0; margin-bottom: 0; }
.exp-wrap > .field:last-of-type .input { flex: 1; min-height: 96px; }

/* Xulosadagi eslatma: oldingi qadamlarda yozilgan javoblar. Bolaning
   xulosasi aynan shu raqamlarni taqqoslashga tayanadi — ular ko'rinmasa,
   u oldingi ekranga qaytishga majbur bo'lardi. */
.exp-recap {
  margin: 0 0 14px;
  padding: 12px 16px;
  background: #F7F8FC;
  border: 2px dashed var(--ink);
  border-radius: 14px;
}

.exp-recap[hidden] { display: none; }

.exp-recap-row { margin: 0; font-size: 15px; line-height: 1.5; color: var(--soft); }
.exp-recap-row + .exp-recap-row { margin-top: 4px; }
.exp-recap-row b { font-family: var(--display); font-size: 17px; color: var(--ink); }

.exp-again {
  align-self: flex-start;
  margin-top: 14px;
  padding: 7px 15px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

/* --- Video ---------------------------------------------------------------- */

/* Ikkala ustun ham to'liq balandlikda: daftar videoning yoniga tenglashadi,
   o'rtada osilib qolmaydi. */
.split--watch { align-items: stretch; }
.split-form--watch { justify-content: stretch; gap: 0; }

.vid { display: flex; align-items: center; justify-content: center; margin: 0; }

.vid video,
.vid img {
  width: 100%;
  max-height: min(calc(100dvh - 330px), 620px);
  background: var(--ink);
  border: var(--edge) solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--pop, 6px 6px 0 var(--ink));
}

.vid video { display: block; }

/* --- Bir nechta video --------------------------------------------------------
   Ikkita animatsiya slayddagidek yonma-yon turadi — ular taqqoslash uchun
   qo'yilgan, demak bir vaqtning o'zida ko'rinib turishi kerak. Ustma-ust
   qo'yilsa bittasi ekrandan chiqib ketardi va taqqoslash yo'qolardi.
   -------------------------------------------------------------------------- */

.vids {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: center;
  align-items: start;
  min-height: 0;
}

.vid--stacked { flex-direction: column; align-items: stretch; gap: 8px; min-height: 0; }

/* Nisbat oldindan qat'iy — pleyer o'z o'lchamini video yuklanguncha bilmaydi
   va ikkita quti har xil balandlikda paydo bo'lardi (muqovasi borida bir xil,
   yo'qida boshqacha), keyin yuklangach sakrab qayta joylashardi. */
.vid--stacked video {
  aspect-ratio: 16 / 9;
  max-height: min(calc(100dvh - 360px), 460px);
  object-fit: cover;
}

.vid-name {
  align-self: flex-start;
  padding: 4px 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
}

/* Video chiqarilmagan bo'lsa o'sha uyaning o'zida eslatma turadi —
   ro'yxatda teshik qolib, ikkinchisi yolg'iz siljib ketmasin. */
.vid-gap {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 180px;
  margin: 0;
  padding: 14px 20px;
  background: #FFF3C4;
  border: var(--edge) solid var(--ink);
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.vid-gap code {
  padding: 2px 7px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}

/* Tor ekranda yonma-yon sig'maydi — ustma-ust tushadi. */
@media (max-width: 860px) {
  .vids { grid-template-columns: minmax(0, 1fr); }
  .vid--stacked video { max-height: 34vh; }
}

/* --- Qadamli ko'rish (bir nechta video) --------------------------------------
   Maket tajriba ekrani bilan bir xil: chapda katta narsa (u yerda siferblat,
   bu yerda pleyer), o'ngda yozuv va tugma. Shuning uchun `exp-` sinflari
   qayta ishlatiladi va bu yerda faqat pleyerning o'lchami aniqlanadi.
   -------------------------------------------------------------------------- */

.watch-screen { gap: 28px; }

.watch-vid { width: min(58vw, 720px); }

.watch-vid video {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(calc(100dvh - 300px), 560px);
  object-fit: cover;
}

@media (max-width: 860px) {
  .watch-screen { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .watch-vid { width: 100%; }
}

/* Video fayli yo'q bo'lgan holat */
.vid--missing { flex-direction: column; align-items: center; gap: 14px; }
.vid--missing img { max-height: min(38vh, 320px); width: auto; }

.vid--missing figcaption {
  padding: 14px 20px;
  background: #FFF3C4;
  border: 2px solid var(--ink);
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.vid--missing code {
  padding: 2px 7px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 14px;
}

/* --- Daftar: video yonidagi yozuv kartochkasi ------------------------------ */

.notes {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 20px 22px 18px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
}

.notes-head {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 3px dashed rgba(27, 27, 35, .2);
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
}

/* Yozuv maydoni kartochkaning qolgan joyini to'la egallaydi. */
.notes .field { display: flex; flex: 1; flex-direction: column; min-height: 0; margin-bottom: 0; }
.notes .input { flex: 1; min-height: 120px; }

.notes-tip {
  margin: 12px 0 0;
  padding: 10px 14px;
  background: #FFF8DC;
  border: 2px solid var(--ink);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}

/* --- To'rtta savol: 2 × 2 ------------------------------------------------- */

.quad {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  flex: 1;
  gap: 14px;
  min-height: 0;
  margin-top: 6px;
}

.quad-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 16px 16px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
  transition: transform .18s ease, box-shadow .18s ease;
}

.quad-card:focus-within { transform: translate(-2px, -2px); box-shadow: var(--pop, 6px 6px 0 var(--ink)); }

/* Savol qatori: chapda a'zoning nishoni, yonida savolning o'zi. */
.quad-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }

.quad-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 50px;
  height: 50px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}

.quad-ask { font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.2; }

.quad-card .input { flex: 1; min-height: 62px; border-width: 2px; }

/* Javob yozilgan kartochkaning burchagida muhr paydo bo'ladi. */
.quad-tick {
  position: absolute;
  top: -11px;
  right: -9px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--ink);
  border-radius: 50%;
  color: #CFE5B4;
  font-size: 15px;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .2s ease, transform .25s cubic-bezier(.2, .8, .3, 1);
}

.quad-card.is-answered .quad-tick { opacity: 1; transform: scale(1); }

.quad-card--bad { border-color: #D6263F; box-shadow: 4px 4px 0 #D6263F; }

/* --- To'g'ri javoblar: varaqlanadigan infografikalar ----------------------- */

.split--reveal { align-items: stretch; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }

.reveal-side { display: flex; flex-direction: column; min-height: 0; }

/* Radio tugmalar ko'rinmaydi, lekin fokus oladi — klaviatura o'qlari ishlaydi */
.reveal-radio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.reveal-tabs { display: flex; gap: 8px; flex-wrap: wrap; flex: none; margin-bottom: 12px; }

.reveal-tab {
  padding: 8px 15px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}

.reveal-tab:hover { transform: translateY(-2px); }

.reveal-panels { flex: none; min-height: 0; }

.reveal-panel { display: none; margin: 0; }

/* Balandlik oynadan hisoblanadi: sarlavha, varaqlar va tugmalar uchun
   ~365px ayiriladi, shunda infografika kesilmasdan sig'adi. */
.reveal-panel img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(calc(100dvh - 365px), 780px);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--pop, 5px 5px 0 var(--ink));
  background: var(--paper);
}

/* Tanlangan varaq: yorliq bo'yaladi, mos panel ochiladi. Kalitlar CSS'ga
   yozilmasin deb tartib raqami bilan bog'langan. */
.reveal-radio:nth-of-type(1):checked ~ .reveal-tabs .reveal-tab:nth-child(1),
.reveal-radio:nth-of-type(2):checked ~ .reveal-tabs .reveal-tab:nth-child(2),
.reveal-radio:nth-of-type(3):checked ~ .reveal-tabs .reveal-tab:nth-child(3),
.reveal-radio:nth-of-type(4):checked ~ .reveal-tabs .reveal-tab:nth-child(4) {
  background: var(--c);
  box-shadow: var(--pop, 3px 3px 0 var(--ink));
}

.reveal-radio:nth-of-type(1):checked ~ .reveal-panels .reveal-panel:nth-child(1),
.reveal-radio:nth-of-type(2):checked ~ .reveal-panels .reveal-panel:nth-child(2),
.reveal-radio:nth-of-type(3):checked ~ .reveal-panels .reveal-panel:nth-child(3),
.reveal-radio:nth-of-type(4):checked ~ .reveal-panels .reveal-panel:nth-child(4) {
  display: block;
}

.reveal-radio:nth-of-type(1):focus-visible ~ .reveal-tabs .reveal-tab:nth-child(1),
.reveal-radio:nth-of-type(2):focus-visible ~ .reveal-tabs .reveal-tab:nth-child(2),
.reveal-radio:nth-of-type(3):focus-visible ~ .reveal-tabs .reveal-tab:nth-child(3),
.reveal-radio:nth-of-type(4):focus-visible ~ .reveal-tabs .reveal-tab:nth-child(4) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* --- A'zoni top: raqamli sxema va tanlovlar ------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.split--slots { grid-template-columns: auto minmax(0, 1fr); align-items: center; }

.scheme { display: flex; justify-content: center; margin: 0; }

.scheme img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(calc(100dvh - 305px), 820px);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--pop, 5px 5px 0 var(--ink));
  background: var(--paper);
}

.slots-form { display: flex; flex-direction: column; justify-content: center; }

.slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.slot { display: flex; align-items: center; gap: 10px; }

.slot-no {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  background: #F2C879;
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
}

.input--select {
  padding: 10px 12px;
  font-family: var(--body);
  cursor: pointer;
}

.slot--bad .input--select { border-color: #D6263F; background: #FFF3F4; }

/* --- Ochiladigan ro'yxat --------------------------------------------------
   Tizim chizadigan kulrang `select` oynasi o'rniga o'zimizniki. Haqiqiy
   `select` sahifada qoladi (`.drop-native`) va formani u yuboradi — bu
   yerdagi hamma narsa uning ustidagi bezak. JS bo'lmasa bular umuman
   yaratilmaydi va oddiy `select` ko'rinadi.
   -------------------------------------------------------------------------- */

.drop { position: relative; flex: 1; min-width: 0; }

.drop-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px 9px 14px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 14px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.drop-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.drop-btn.is-empty .drop-text { color: #9A9AA6; }

/* Sariq doira — raqam nishonlari bilan bir oilada. */
.drop-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 27px;
  height: 27px;
  background: #F2C879;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 12px;
  transition: transform .18s ease;
}

.drop.is-open .drop-btn { box-shadow: 0 0 0 4px rgba(27, 27, 35, .16); }
.drop.is-open .drop-arrow { transform: rotate(180deg); }

.drop-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 9px);
  right: 0;
  left: 0;
  /* To'qqizta variant to'liq sig'sin — bola oxirgisini qidirib aylantirmasin.
     Past ekranda `vh` cheklaydi va ro'yxat aylantiriladigan bo'lib qoladi. */
  max-height: min(400px, 52vh);
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--pop, 5px 5px 0 var(--ink));
  animation: drop-in .16s ease-out;
}

.drop-list[hidden] { display: none; }

/* Pastda joy qolmasa JS `drop--up` qo'shadi — ro'yxat tepaga ochiladi. */
.drop--up .drop-list { top: auto; bottom: calc(100% + 9px); }

@keyframes drop-in {
  from { opacity: 0; transform: translateY(-7px); }
}

.drop-opt {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 16px;
  line-height: 1.35;
  cursor: pointer;
}

/* Chapdagi doiracha: tanlangani to'ldiriladi. Rang yolg'iz qolmasin —
   sichqoncha yo'q, klaviatura bilan yurgan bola ham qayerdaligini bilsin. */
.drop-opt::before {
  content: "";
  flex: none;
  width: 17px;
  height: 17px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.drop-opt[aria-selected="true"] { font-weight: 700; }

.drop-opt[aria-selected="true"]::before {
  background: var(--ink);
  box-shadow: inset 0 0 0 3px var(--paper);
}

.drop-opt.is-active { background: #F2C879; }

/* Tekshiruv belgilari endi tugmaga tushadi — `select` ko'rinmaydi. */
.slot--bad .drop-btn { border-color: #D6263F; background: #FFF3F4; }

/* --- Javoblarni tekshirish ------------------------------------------------
   Topshiriq ostidagi qator: tugma va natija. Belgilash uch xil bo'ladi —
   yashil ✓ to'g'ri, qizil ✗ xato, sariq 💡 esa "javob ko'rsatildi" degani
   (uch urinishdan keyin o'zi qo'yiladi). Rang yolg'iz qolmaydi: yonida
   har doim belgi turadi, shunda rang ajratmaydigan bola ham tushunadi.
   -------------------------------------------------------------------------- */

.check {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 10px 16px 10px 10px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 rgba(27, 27, 35, .18);
}

.check[hidden] { display: none; }

.btn--check {
  flex: none;
  padding: 11px 20px;
  background: #F2C879;
  color: var(--ink);
  font-size: 16px;
  white-space: nowrap;
}

.btn--check:disabled {
  background: #E4E4EA;
  color: var(--soft);
  cursor: default;
  transform: none;
  box-shadow: 4px 4px 0 rgba(27, 27, 35, .28);
}

.check-score { margin: 0; font-size: 15px; line-height: 1.35; }

.check.is-good  { background: #E8FBEA; }
.check.is-bad   { background: #FFF3F4; }
.check.is-shown { background: #FFF6D6; }

.slot-mark {
  flex: none;
  width: 24px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.slot.is-right .input--select,
.slot.is-right .drop-btn { border-color: #2E9E4B; background: #E8FBEA; }

.slot.is-wrong .input--select,
.slot.is-wrong .drop-btn { border-color: #D6263F; background: #FFF3F4; }

.slot.is-shown .input--select,
.slot.is-shown .drop-btn { border-color: #C79A08; background: #FFF6D6; }

.slot.is-right .slot-mark { color: #2E9E4B; }
.slot.is-wrong .slot-mark { color: #D6263F; }

/* --- Sog'lom / zararli hayot ----------------------------------------------
   13-slaydning joylashuvi: tepada ikkita savat, pastda hamma kartochka
   yotgan patnis. Kartochkalar patnisdan savatlarga sudraladi.
   -------------------------------------------------------------------------- */

/* Savatlar soni mazmundan keladi (ikkita ham, uchta ham bo'ladi), shuning
   uchun ustunlar soni qotirilmaydi — `auto-fit` o'zi bo'lib beradi. */
.bins {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  flex: 1;
  gap: 16px;
  min-height: 0;
}

.bin {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 10px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
}

.bin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 9px;
  padding: 7px 9px 7px 16px;
  background: var(--c);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
}

.bin-count {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 26px;
  padding: 0 8px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
}

/* Uzuq chegara — "bu yer bo'sh, shu yerga tashla" degani. */
.bin-body {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  min-height: 0;
  padding: 9px;
  overflow-y: auto;
  border: 2px dashed rgba(27, 27, 35, .3);
  border-radius: 14px;
}

.tray { flex: none; margin-top: 14px; }

/* --- Tarqoq maket (9-slayd) ------------------------------------------------
   Kartochkalar tepada erkin joylashadi, pastda ikkita nishon: portfel va
   chiqindi rasmi. Slayddagi ko'rinish shu.
   -------------------------------------------------------------------------- */

.sort--scatter { gap: 0; }

/* Patnis bor bo'sh joyni egallaydi — kartochkalar keng tarqalib turadi. */
.tray--loose { display: flex; flex: 1; flex-direction: column; min-height: 0; margin-top: 8px; }

.tray--loose .tray-body {
  flex: 1;
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: 16px 14px;
  padding: 14px;
  background: none;
  border: 0;
}

/* --- Erkin suzish ---------------------------------------------------------
   Patnisdagi kartochkalar fazodagidek sekin suzib turadi. Har biri o'z
   tezligida va o'z vaqtida boshlanadi (`--i` — kartochkaning raqami), aks
   holda hammasi bir vaqtda qimirlab, mexanik ko'rinardi.

   Nishonga tashlangach harakat to'xtaydi: joylashtirilgan kartochka
   qimirlab tursa, bola uni hali tashlamagandek his qiladi.

   Sudralayotganda ham to'xtaydi — sort.js kartochkani `left`/`top` bilan
   suradi, `transform` esa uni barmoq ostidan siljitib yuborardi.
   -------------------------------------------------------------------------- */

.tray--loose [data-sort-home] .habit {
  animation: drift 7s ease-in-out infinite;
  animation-duration: calc(6.4s + var(--i, 0) * .37s);
  animation-delay: calc(var(--i, 0) * -.83s);
  will-change: transform;
}

/* Sudralayotgan kartochkada harakat butunlay o'chiriladi: `paused` bo'lsa
   oxirgi siljish transform bo'lib qolib, kartochka barmoqdan chetda turardi. */
.tray--loose .habit.is-dragging { animation: none; }

/* Bosilgan yoki sichqoncha ostidagi kartochka joyida qotadi — nishonga
   bosish oson bo'lsin. */
.tray--loose .habit.is-picked,
.tray--loose .habit:hover { animation-play-state: paused; }

@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  22% { transform: translate(7px, -9px) rotate(-1.6deg); }
  48% { transform: translate(-8px, 5px) rotate(1.3deg); }
  74% { transform: translate(5px, 8px) rotate(1deg); }
}

.targets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: none;
  gap: 20px;
  width: min(760px, 100%);
  margin: 6px auto 0;
}

.target {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Slayddagi kabi och ko'k kvadrat — ichida rasm. Rasm hali qo'yilmagan
   bo'lsa o'rniga emoji chiqadi, o'lchami bir xil qoladi. */
.target-pic {
  display: grid;
  place-items: center;
  width: clamp(96px, 13vh, 132px);
  height: clamp(96px, 13vh, 132px);
  background: #BFE0F7;
  border: var(--edge) solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--pop, 5px 5px 0 var(--ink));
  font-size: clamp(46px, 7vh, 66px);
  line-height: 1;
}

.target-pic img { width: 82%; height: 82%; object-fit: contain; }

.target-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 5px 16px;
  background: var(--c);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
}

.target-name b {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
}

/* Tashlangan kartochkalar rasm ostida yig'iladi — o'n to'rttasi rasm
   ichiga sig'maydi, shuning uchun ular alohida qatorda turadi. */
.target-drop {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 46px;
  max-height: 96px;
  overflow-y: auto;
  padding: 7px;
  border: 2px dashed rgba(27, 27, 35, .3);
  border-radius: 14px;
}

.target-drop.is-over { border-color: var(--ink); border-style: solid; background: #FFF6D6; }
.sort--scatter.is-picking .target-drop { border-color: var(--ink); }

/* Kartochka nishon ustida turganda rasm ham javob beradi — bola qayerga
   qo'yayotganini butun nishondan ko'radi, faqat punktir joydan emas. */
.target:has(.target-drop.is-over) .target-pic {
  background: #FFF6D6;
  transform: translate(-2px, -2px);
  box-shadow: var(--pop, 7px 7px 0 var(--ink));
}

/* --- Ikki tomonga otish (deck) --------------------------------------------
   Chapda va o'ngda nishon, markazda kartochkalar to'plami. Faqat eng
   tepadagi kartochka ko'rinadi va sudraladi; qo'yib yuborilganda u
   tomonga uchib boradi, keyingisi o'z-o'zidan chiqadi.

   JS bo'lmasa `.is-deck` qo'shilmaydi va hamma kartochka oddiy ro'yxat
   bo'lib, o'z tugmalari bilan ko'rinib turadi.
   -------------------------------------------------------------------------- */

.duel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
  flex: 1;
  gap: 16px;
  min-height: 0;
  margin-top: 12px;
}

.duel-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 12px;
  background: color-mix(in srgb, var(--c) 16%, var(--paper));
  border: var(--edge) solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--drop);
  transition: background-color .15s ease, transform .15s ease;
}

/* Kartochka shu tomonga qaratilganda nishon "ochiladi" — bola qo'yib
   yuborishdan oldin qayerga tushishini ko'radi. */
.duel-side.is-aimed {
  background: color-mix(in srgb, var(--c) 45%, var(--paper));
  transform: translateY(-3px);
}

.duel-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 9px 12px;
  background: var(--c);
  border: 2px solid var(--ink);
  border-radius: 999px;
}

.duel-emoji { font-size: 24px; line-height: 1; }
.duel-name { flex: 1; font-family: var(--display); font-size: 17px; }

.duel-count {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-style: normal;
  font-weight: 700;
  font-size: 14px;
}

/* Tomonga tushgan kartochkalar — kichik, lekin bosiladi: bosilsa
   to'plamga qaytadi. */
.duel-list {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 7px;
  flex: 1;
  min-height: 0;
  padding: 10px;
  border: 2px dashed rgba(27, 27, 35, .28);
  border-radius: 16px;
  overflow-y: auto;
}

/* Bo'sh tomon "shu yerga tashla" deb turadi — aks holda katta bo'sh
   maydon nima uchun ekani tushunarsiz bo'lardi. */
.duel-list::before {
  content: "Bu yerga tashla";
  align-self: center;
  width: 100%;
  font-size: 14px;
  color: var(--soft);
  text-align: center;
}

.duel-list:has(.dcard)::before { display: none; }
.duel-side.is-aimed .duel-list { border-color: var(--ink); border-style: solid; }

.deck {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 0;
}

.deck-left {
  margin: 0;
  padding: 5px 15px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
}

.deck-done {
  margin: 0;
  font-family: var(--display);
  font-size: 19px;
  text-align: center;
}

.deck-done span { font-family: var(--body); font-size: 14px; color: var(--soft); }

/* --- To'plam va kartochka ------------------------------------------------- */

.deck-stack { display: flex; flex-direction: column; gap: 12px; }

.dcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 16px;
  background: color-mix(in srgb, var(--card, var(--paper)) 34%, var(--paper));
  border: var(--edge) solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--drop);
}

.dcard--bad { border-color: #D6263F; }

.dcard-face { display: grid; place-items: center; }
.dcard-face img { width: 110px; height: 110px; object-fit: contain; }
.dcard-emoji { font-size: 96px; line-height: 1; }
.dcard-name { font-family: var(--display); font-size: 26px; }

.picks--wide { flex-wrap: wrap; justify-content: center; width: 100%; }

.pick--wide {
  width: auto;
  min-width: 0;
  height: auto;
  flex: 1;
  padding: 10px 9px;
  font-size: 14px;
}

.pick--wide span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.pick--wide i { font-style: normal; font-size: 18px; }

/* Yo'nalish o'qi tomon sarlavhasida turadi: kartochkani qaysi yoqqa
   tortish kerakligi bir qarashda ko'rinsin. O'q sof bezak — nom matni
   ekran o'qigich uchun o'zgarmaydi. */
.is-deck .duel-head::before,
.is-deck .duel-head::after {
  font-weight: 700;
  font-size: 19px;
  opacity: .5;
}

.is-deck .duel-side--a .duel-head::before { content: "←"; }
.is-deck .duel-side--b .duel-head::after { content: "→"; }

/* Tomonning butun maydoni tugma vazifasini bajaradi — bosilsa tepadagi
   kartochka o'sha yoqqa uchadi. */
.is-deck .duel-side { cursor: pointer; }
.is-deck .duel-side:hover { background: color-mix(in srgb, var(--c) 30%, var(--paper)); }

/* --- JS yoqilgan holat ---------------------------------------------------- */

.is-deck .deck-stack {
  display: grid;
  place-items: center;
  width: min(420px, 100%);
}

/* Hamma kartochka bitta katakda ustma-ust turadi; orqadagilari
   `--depth` ga qarab pastga siljib, kichrayib va qiyshayib boradi. */
.is-deck .deck-stack .dcard {
  grid-area: 1 / 1;
  width: 100%;
  transform:
    translateY(calc(var(--depth, 0) * 14px))
    scale(calc(1 - var(--depth, 0) * .05))
    rotate(calc((var(--i, 0) - 1) * 1.4deg));
  transition: transform .2s ease;
  touch-action: none;
  cursor: grab;
}

/* Uchinchidan keyingilari ko'rinmaydi — shundan ortig'i faqat shovqin. */
.is-deck .deck-stack .dcard:nth-child(n + 4) { opacity: 0; }

/* Orqadagi kartochkalarning ichi ko'rinmaydi: bola faqat tepadagisini
   o'qishi kerak, qolganlari "yana bor" degan belgi xolos. */
.is-deck .deck-stack .dcard:not(.is-top) > * { opacity: 0; }

.is-deck .dcard.is-top { z-index: 3; }
.is-deck .dcard.is-dragging { cursor: grabbing; transition: none; z-index: 4; }
.is-deck .dcard.is-flying { z-index: 4; pointer-events: none; }

/* Tomonga tushgan kartochka kichik yorliqqa aylanadi. */
.is-deck .duel-list .dcard {
  flex-direction: row;
  gap: 6px;
  width: auto;
  padding: 5px 11px 5px 6px;
  border-width: 2px;
  border-radius: 999px;
  box-shadow: var(--pop, 2px 2px 0 var(--ink));
  font-size: 13px;
  cursor: pointer;
  transform: none;
}

.is-deck .duel-list .dcard:hover { transform: translateY(-2px); }
.is-deck .duel-list .dcard-face img { width: 26px; height: 26px; }
.is-deck .duel-list .dcard-emoji { font-size: 20px; }
.is-deck .duel-list .dcard-name { font-size: 14px; }

/* Sudrash yoqilganda kartochkada faqat rasm va nom qoladi — tugmalar
   uni chalg'itadi. Ularning o'rniga tomonning o'ziga bosiladi, chetga
   tushgan kartochka esa bosilsa qaytib keladi. */
.is-deck .picks { display: none; }

/* Tugmalar ketgach kartochka juda yassi bo'lib qolmasin — o'yin
   kartasidek balandroq turadi. */
.is-deck .deck-stack .dcard {
  gap: 14px;
  justify-content: center;
  min-height: 260px;
  padding: 24px 18px;
}

/* JS bo'lmasa hech narsa tomonga o'tmaydi — bo'sh punktir joy faqat
   chalg'itardi. Nishonlarning sarlavhasi qoladi: tugmalar nimani
   bildirishini o'sha aytib turadi. */
.sort--deck:not(.is-deck) .duel { align-items: start; }
.sort--deck:not(.is-deck) .duel-list { display: none; }

/* Tor ekranda uch ustun sig'maydi: to'plam tepaga chiqadi, tomonlar esa
   uning ostida yonma-yon turadi — chapga/o'ngga sudrash ma'nosi
   saqlanadi. */
@media (max-width: 860px) {
  .duel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "deck deck"
      "a    b";
    gap: 12px;
  }

  .deck { grid-area: deck; }
  .duel-side--a { grid-area: a; }
  .duel-side--b { grid-area: b; }
  .duel-list { max-height: 130px; }
  .is-deck .deck-stack { width: min(320px, 100%); }
  .dcard { padding: 14px 10px; }
  .dcard-emoji { font-size: 68px; }
  .dcard-face img { width: 78px; height: 78px; }
  .dcard-name { font-size: 21px; }

  /* JS'siz holatda tor kartochkaga ikkita tugma yonma-yon sig'maydi —
     ular ustma-ust turadi. */
  .picks--wide { flex-direction: column; gap: 6px; }
  .pick--wide { flex: none; width: 100%; padding: 9px 10px; }
}

.target-pic { transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease; }

.bin:has(.bin-body.is-over) { box-shadow: var(--pop, 6px 6px 0 var(--ink)); }

@media (max-width: 640px) {
  .targets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .target-pic { width: 78px; height: 78px; font-size: 38px; }
  .target-name { font-size: 13px; padding: 4px 11px; }
}

.tray-head {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
}

.tray-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 62px;
  padding: 10px;
  background: #F4F1E7;
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
}

/* Patnis bo'shaganda kichrayadi — bo'sh joy savatlarga o'tsin. Butunlay
   yo'qolmaydi: kartochkani orqaga qaytarish yo'li ochiq qolishi kerak. */
.is-empty-tray .tray-body {
  min-height: 42px;
  background: none;
  border-style: dashed;
  border-color: rgba(27, 27, 35, .3);
}

/* Kartochka ustida turgan idish yorishadi. */
.bin-body.is-over,
.tray-body.is-over { border-color: var(--ink); border-style: solid; background: #FFF6D6; }

/* Kartochka bosib olinganda hamma idish "meni bos" deb turadi. */
.sort.is-picking .bin-body,
.sort.is-picking .tray-body { border-color: var(--ink); }

/* Rang `--card` dan olinadi (mazmun bergan bo'lsa). `--c` emas: u bosqich
   rangi sifatida yuqoridan meros bo'lib tushadi va rangsiz kartochkalarni
   ham bo'yab yuborardi. */
.habit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 11px;
  background: var(--card, var(--paper));
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  line-height: 1.2;
  transition: transform .12s ease, background-color .15s ease;
}

.habit-emoji { font-size: 20px; line-height: 1; }

/* Emoji o'rniga haqiqiy surat: fon oq emas, shuning uchun `contain` —
   kesilmasin va cho'zilmasin. */
.habit-pic {
  flex: none;
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.habit-name { white-space: nowrap; }
.habit-mark { font-size: 15px; font-weight: 700; line-height: 1; }

.habit--bad { border-color: #D6263F; background: #FFF3F4; }

/* Sudrash faqat JS bor holatda. `touch-action` bo'lmasa barmoq bilan
   sudraganda brauzer sahifani aylantirib yuboradi. */
.is-draggable .habit {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.is-draggable .habit:hover { transform: translateY(-2px); }
.is-draggable .habit:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.habit.is-picked { background: #F2C879; box-shadow: var(--pop, 3px 3px 0 var(--ink)); }

.habit.is-dragging {
  position: fixed;
  z-index: 80;
  margin: 0;
  transform: rotate(-3deg) scale(1.05);
  box-shadow: 6px 6px 0 rgba(27, 27, 35, .3);
  cursor: grabbing;
  pointer-events: none;
}

body.is-sorting { cursor: grabbing; }

/* Tekshiruv belgilari */
.habit.is-right { border-color: #2E9E4B; background: #E8FBEA; }
.habit.is-wrong { border-color: #D6263F; background: #FFF3F4; }
.habit.is-shown { border-color: #C79A08; background: #FFF6D6; }
.habit.is-right .habit-mark { color: #2E9E4B; }
.habit.is-wrong .habit-mark { color: #D6263F; }

/* JS bor — sudrash ishlaydi, radio tugmalar keraksiz.
   JS yo'q bo'lsa ular ko'rinib qoladi va topshiriq shular bilan bajariladi. */
.is-draggable .picks { display: none; }

.picks { display: flex; gap: 6px; flex: none; }

/* Radio tugmalar ko'rinmaydi — yorliqning o'zi tugma bo'lib ishlaydi. */
.pick-input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.pick {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-size: 17px;
  cursor: pointer;
  /* To'liq oqartirilsa ikkala tugma bir xil ko'rinadi — yashil yurak va
     qizil taqiq belgisi tanlashdan oldin ham farqlanib tursin. */
  opacity: .5;
  transition: background-color .15s ease, opacity .15s ease, transform .15s ease;
}

.pick:hover { transform: translateY(-2px); opacity: .9; }
.pick--good { background: #EEFBEC; }
.pick--bad { background: #FDEFEF; }
/* Uchta variantli topshiriqda (masalan "Ha / Qisman / Yo'q") o'rtadagisi. */
.pick--mid { background: #FFF6D6; }
.pick--mid:has(.pick-input:checked) { background: #FFE9A3; }

.pick:has(.pick-input:checked) {
  opacity: 1;
  transform: none;
  box-shadow: var(--pop, 3px 3px 0 var(--ink));
}

.pick--good:has(.pick-input:checked) { background: #CFE5B4; }
.pick--bad:has(.pick-input:checked) { background: #FFD3D3; }

/* Savat rangidagi tugma. Ikkitadan ortiq savat bo'lganda yashil/qizil
   juftlik yetmaydi — har bir tugma o'z savatining rangida turadi. */
.pick--tint {
  /* Kartochkaning o'z rangi ostidan ko'rinib turmasin: aralashma oq bilan
     olinadi va shaffoflik kamroq — uchta tugma bir-biridan ajralib tursin. */
  background: color-mix(in srgb, var(--pick) 38%, #FFFFFF);
  opacity: .72;
}
.pick--tint:has(.pick-input:checked) {
  background: color-mix(in srgb, var(--pick) 85%, #FFFFFF);
}

.pick:has(.pick-input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }

/* --- Javob sanog'i --------------------------------------------------------
   Baholanadigan topshiriqlarda tekshirish tugmasi yo'q, shuning uchun
   "3 / 5" degan kichik hisob tepada turadi. Hammasi to'lganda yashil.
   -------------------------------------------------------------------------- */

.tally {
  align-self: flex-end;
  margin: 0 0 12px;
  padding: 6px 15px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  transition: background-color .2s ease;
}

.tally b { font-family: var(--display); font-weight: 700; }

.is-tally-full .tally { background: #CFE5B4; }
.is-tally-full .tally::after { content: " ✓"; font-weight: 700; }

/* --- EVALUATE 1: To'g'ri & Noto'g'ri --------------------------------------
   16-slayddagi maket: beshta rangli lenta zinapoya bo'lib tushadi, har
   birining o'ng chetida belgi qo'yiladigan doiralar.

   Doiralarda faqat ✓ va ✕ turadi — so'z sig'maydi. Ular yolg'iz qolmasligi
   uchun tepada izoh bor: 3–4-sinf o'quvchisi ✓ ni "bajarildi" deb tushunib
   qolmasin. Slaydda ham xuddi shunday: o'ng chetda ikkita namuna doira.
   -------------------------------------------------------------------------- */

.claims-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.legend { display: flex; gap: 16px; margin: 0; }

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
}

.legend-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-style: normal;
  font-size: 15px;
}

.legend-mark--yes { background: #CFE5B4; }
.legend-mark--no { background: #FFD9DC; }

.claims {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-height: 0;
}

/* Zinapoya: har bir lenta oldingisidan bir qadam o'ngroqda boshlanadi.
   Kengligi bir xil, shuning uchun o'ng cheti ham xuddi shunday suriladi. */
.claim {
  display: flex;
  align-items: center;
  align-self: flex-start;
  gap: 14px;
  width: 74%;
  /* Zinapoya: oxirgi lenta o'ng chetga tegadi. Qadam lentalar soniga
     (`--n`, shablon beradi) qarab bo'linadi — 6 ta gap ham sig'adi. */
  margin-left: calc(var(--i) * 26% / max(var(--n, 5) - 1, 1));
  padding: 10px 12px 10px 13px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: 999px;
  box-shadow: 5px 5px 0 rgba(27, 27, 35, .22);
  transition: box-shadow .18s ease, transform .18s ease;
  /* Lentalar navbat bilan chiqadi — zinapoya yuqoridan pastga "tushadi". */
  animation: pop-in .45s cubic-bezier(.2, .8, .3, 1) backwards;
}

.claim:hover { transform: translate(-2px, -2px); }

.claims .claim:nth-child(1) { animation-delay: .06s; }
.claims .claim:nth-child(2) { animation-delay: .12s; }
.claims .claim:nth-child(3) { animation-delay: .18s; }
.claims .claim:nth-child(4) { animation-delay: .24s; }
.claims .claim:nth-child(5) { animation-delay: .30s; }
.claims .claim:nth-child(6) { animation-delay: .36s; }

.claim-no {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  transition: background-color .2s ease;
}

.claim-text { flex: 1; font-size: 18px; line-height: 1.25; }
.claim-mark { flex: none; font-size: 19px; font-weight: 700; }

/* Javob berilgan lenta: soyasi qattiqlashadi — "bu bajarildi" degan belgi,
   lekin to'g'ri-noto'g'riligiga ishora emas (ball oxirida chiqadi). */
.claim.is-answered { box-shadow: var(--pop, 5px 5px 0 var(--ink)); }

.claim .picks { gap: 8px; }

/* Slayddagi oq doiralar — belgi shularning ichiga qo'yiladi.
   Tanlanmagani bo'sh doira: oq fon, rangli belgi.
   Tanlangani to'la bo'yaladi va belgisi oqarib ketadi — ikkisi orasidagi
   farq shakl darajasida, faqat rang yoki shaffoflik darajasida emas.
   Rangli lentaning ustida yengil farq bilinmay qolardi. */
.pick--round {
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--paper);
  border-width: var(--edge);
  border-radius: 50%;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  opacity: 1;
  box-shadow: none;
  transition: background-color .18s ease, color .18s ease,
              transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.pick--round.pick--good { color: #1F8A40; }
.pick--round.pick--bad { color: #C42133; }

.pick--round:hover { transform: translateY(-2px); }

.pick--round:has(.pick-input:checked) {
  transform: scale(1.16);
  box-shadow: var(--pop, 3px 3px 0 var(--ink));
  color: var(--paper);
}

.pick--round.pick--good:has(.pick-input:checked) { background: #22A24C; }
.pick--round.pick--bad:has(.pick-input:checked) { background: #DE3145; }

/* Javob berilgach tanlanmagan doira orqa fonga chekinadi — ko'z darrov
   tanlanganiga tushadi. */
.claim.is-answered .pick--round:not(:has(.pick-input:checked)) {
  opacity: .38;
  border-color: rgba(27, 27, 35, .55);
}

/* Keng tugma: belgi + so'z. `.pick` ning kvadrat o'lchamini bekor qiladi. */
.pick--wide {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  height: auto;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
}

.pick--wide > span { font-size: 19px; line-height: 1; }
.pick--wide b { font-family: var(--display); font-weight: 600; font-size: 15px; }

.claim--bad { border-color: #D6263F; box-shadow: 5px 5px 0 #D6263F; }

.claim.is-right { border-color: #2E9E4B; }
.claim.is-wrong { border-color: #D6263F; }
.claim.is-right .claim-mark { color: #17692F; }
.claim.is-wrong .claim-mark { color: #A5122A; }

/* Tor ekranda zinapoya sig'maydi — lentalar to'liq kenglikda tik turadi. */
@media (max-width: 860px) {
  .claim { width: 100%; margin-left: 0; border-radius: 20px; }
  .claim-text { font-size: 16px; }
}

/* --- EVALUATE 2: Moslashtiring --------------------------------------------
   Chapda a'zolar, o'ngda vazifalar, orasida rangli iplar (match.js).
   Ustunlar orasidagi bo'sh yo'lak — iplar o'sha yerda kesishadi.
   -------------------------------------------------------------------------- */

.wires {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  flex: 1;
  gap: 140px;
  min-height: 0;
  /* Kengligi cheklangan: tugunlar cho'zilib ketmasin, o'rtadagi yo'lak esa
     iplar kesishishi uchun yetarli bo'lsin. */
  width: min(100%, 1040px);
  margin: 10px auto 0;
}

/* Iplar tugunlar ostidan o'tadi va bosishga xalaqit bermaydi. */
.wires-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wire-col {
  display: grid;
  grid-auto-rows: minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.node { position: relative; display: flex; align-items: center; }

/* Sudrash barmoq bilan ham ishlasin — aks holda harakat sahifani
   aylantirishga ketadi. Tor ekranda bekor qilinadi (u yerda iplar yo'q). */
.is-wired .node-btn,
.is-wired .node-dot { touch-action: none; }

/* Ipning uchini ushlab sudrash mumkin — kursor shuni aytib tursin. */
.is-wired .node-dot { cursor: grab; }
.is-wired.is-dragging { cursor: grabbing; user-select: none; }
.is-wired.is-dragging .node-btn:hover { transform: none; box-shadow: none; }

.node-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 8px 14px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15.5px;
  text-align: left;
  cursor: pointer;
  transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.node--organ .node-btn { background: var(--c); }
.node--job .node-btn { justify-content: flex-end; text-align: right; }

.node-btn:hover { transform: translate(-2px, -2px); box-shadow: var(--pop, 4px 4px 0 var(--ink)); }

.node-emoji { flex: none; font-size: 21px; line-height: 1; }
.node-name { line-height: 1.2; }

/* Ipning uchi — ustunning ichki chetidagi doira. */
.node-dot {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 50%;
  transition: background-color .18s ease;
}

.node--organ .node-dot { right: -8px; }
.node--job .node-dot { left: -8px; }

.node.is-linked .node-dot { background: var(--c); }

/* Tanlangan tugun — ipning uchi qo'lda turibdi degani. */
.node.is-picked .node-btn {
  transform: translate(-2px, -2px);
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
  outline: 3px dashed var(--ink);
  outline-offset: 3px;
}

.node--job.is-linked .node-btn { background: var(--c); }
.node--bad .node-btn { border-color: #D6263F; }

/* JS bor — javob iplar bilan beriladi, radio tugmalar ko'rinmaydi. */
.is-wired .picks { display: none; }

/* Vazifa yonidagi a'zo nomlari — iplar ishlamaydigan holatlarda (JS o'chiq
   yoki tor ekran) tanlov tugmalari bo'lib chiqadi.

   Har biri o'z a'zosining rangida (`--pick` shablondan keladi): tanlanmagani
   o'sha rangning ochiq tusi, tanlangani esa to'la rang. Sakkizta bir xil oq
   tugma bo'lsa bola qaysi birini bosganini ham, qaysi a'zo qayerdaligini ham
   ajrata olmasdi — chap ustundagi rangli nishonlar tor ekranda yo'q. */
.pick--word {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  height: auto;
  padding: 5px 11px;
  background: color-mix(in srgb, var(--pick, #FFFFFF) 26%, #FFFFFF);
  border-radius: 999px;
  font-size: 13px;
  opacity: .62;
}

.pick--word:has(.pick-input:checked) {
  background: var(--pick, var(--paper));
  opacity: 1;
}

.pick-emoji { flex: none; font-size: 15px; line-height: 1; }

/* --- Ipsiz holat ----------------------------------------------------------
   Ikki holatda iplar chizilmaydi: JS o'chiq bo'lsa va tor ekranda (ustunlar
   orasiga yo'lak sig'maydi). Ikkalasida ham chap ustun, iplar va uchlar
   olib tashlanadi; o'ngdagi ro'yxat esa oddiy tanlov formasiga aylanadi —
   vazifa nomi sarlavha, ostida sakkizta a'zo tugmasi.
   -------------------------------------------------------------------------- */

html:not(.js) .wires,
.wires--plain { grid-template-columns: minmax(0, 1fr); gap: 0; }

html:not(.js) .wires-svg,
html:not(.js) .wire-col:first-of-type,
html:not(.js) .node-dot,
.wires--plain .wires-svg,
.wires--plain .wire-col:first-of-type,
.wires--plain .node-dot { display: none; }

html:not(.js) .wire-col,
.wires--plain .wire-col { grid-auto-rows: auto; gap: 10px; }

html:not(.js) .node,
.wires--plain .node {
  display: block;
  padding: 12px 15px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 16px;
}

/* Tugma endi tugma emas — shunchaki vazifa nomi. */
html:not(.js) .node-btn,
.wires--plain .node-btn {
  display: block;
  /* Asosiy qoidadagi `height: 100%` bu yerda keraksiz — u tugmani butun
     kartochkaga cho'zib, tanlov tugmalarini pastga itarib yuboradi. */
  height: auto;
  padding: 0 0 8px;
  background: none;
  border: 0;
  border-radius: 0;
  text-align: left;
  cursor: default;
  pointer-events: none;
}

html:not(.js) .node-btn:hover,
.wires--plain .node-btn:hover { transform: none; box-shadow: none; }

.wires--plain .picks { display: flex; flex-wrap: wrap; gap: 6px; }

@media (max-width: 780px) {
  /* `flex: none` shart: aks holda ustun idish balandligiga qisiladi va
     kartochkalar o'z mazmunidan kichrayib, tugmalari tashqariga chiqib
     ketadi. Bu yerda sahifaning o'zi aylanishi kerak. */
  .wires { flex: none; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .wires-svg,
  .wire-col:first-of-type,
  .node-dot { display: none; }
  .wire-col { grid-auto-rows: auto; gap: 10px; }

  .node {
    display: block;
    padding: 12px 15px;
    background: var(--paper);
    border: var(--edge) solid var(--ink);
    border-radius: 16px;
  }

  .node--job.is-linked { background: var(--c); }

  .node-btn,
  .node--job .node-btn,
  .node--job.is-linked .node-btn {
    display: block;
    /* Asosiy qoidada `height: 100%` — bu yerda bekor qilinadi, aks holda
       tugma butun kartochkani egallab, tanlov tugmalarini pastga itaradi. */
    height: auto;
    padding: 0 0 8px;
    background: none;
    border: 0;
    border-radius: 0;
    text-align: left;
    cursor: default;
    pointer-events: none;
  }

  .node-btn:hover { transform: none; box-shadow: none; }
  .is-wired .node-btn { touch-action: auto; }

  /* Maket o'zgardi — yo'riqnoma ham o'zgaradi. */
  .task-lead--narrow ~ .task-lead,
  .task-lead:has(~ .task-lead--narrow) { display: none; }
  .task-lead--narrow { display: block; }

  /* Vazifa nomi kartochkaning sarlavhasi — a'zo tugmalaridan aniq ajralib
     tursin, aks holda o'nta bir xil yozuv bo'lib qoladi. */
  .node .node-name { font-size: 17px; }

  /* A'zo tugmalari ikki ustunli to'rga tiziladi. Yonma-yon oqim bo'lsa
     ular har xil enda bo'lib, qatorlar tishli chiqadi va barmoq uchun
     kichik nishon qoladi — bu yerda esa hammasi bir xil, keng va baland. */
  .is-wired .picks,
  .wires--plain .picks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .pick--word {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 15px;
    /* Uzun nom (masalan "Harakatlantiradi") tugmadan chiqib ketmasin. */
    overflow-wrap: anywhere;
    line-height: 1.2;
  }
}

/* --- Pazl -------------------------------------------------------------------
   Chapda o'yin maydoni, o'ngda savollar. Maydon ikki qavatdan iborat:
   tepada taxta (rasm shu yerda yig'iladi), ostida patnis (bo'laklar shu
   yerga sochiladi). Ikkalasi bitta `position: relative` idishda — bo'laklar
   ular orasida erkin ko'chadi.
   -------------------------------------------------------------------------- */

/* Maydon butun enni oladi. Avval u savollar bilan yonma-yon turardi va
   ustunning yarmiga siqilardi — bo'laklar juda kichkina chiqardi. */
.stack--puzzle { gap: 18px; }

.puz { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* --- To'liq ekran ------------------------------------------------------------
   Brauzerning o'z rejimi: maydon butun ekranni egallaydi va bo'laklar eng
   katta ko'rinishda bo'ladi. O'lchamlarni JS qayta hisoblaydi — CSS faqat
   fonni va joylashuvni beradi.
   -------------------------------------------------------------------------- */

.puz:fullscreen {
  gap: 14px;
  padding: 18px 22px 20px;
  background: var(--paper);
  justify-content: center;
}

.puz:fullscreen .puz-stage { margin: 0 auto; }

.puz-stage {
  position: relative;
  width: 100%;
  margin: 0 auto;
  touch-action: none; /* sudrash sahifani aylantirmasin */
}

/* Taxta — yig'iladigan joyning belgisi. O'lchami va o'rni JS dan keladi:
   maydon butun ustunni egallaydi, taxta esa uning o'rtasida turadi.

   Burchaklari o'tkir: rasm ham to'rtburchak, chetdagi bo'laklar ham o'tkir
   burchakli — dumaloq ramka ular bilan mos tushmasdi. */
.puz-stage::before {
  content: "";
  position: absolute;
  left: var(--puz-board-x, 0);
  top: 0;
  width: var(--puz-board-w, 100%);
  height: var(--puz-board-h, 0);
  background: rgba(27, 27, 35, .05);
  border: 3px dashed rgba(27, 27, 35, .25);
}

/* Sanoq va tabrik — taxtaning o'rtasida, bo'laklar ustida. */
.puz-flash {
  position: absolute;
  left: var(--puz-board-x, 0);
  top: 0;
  display: grid;
  place-items: center;
  width: var(--puz-board-w, 100%);
  height: var(--puz-board-h, 0);
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(34px, 7vh, 72px);
  color: var(--ink);
  text-shadow: 0 2px 0 var(--paper), 0 -2px 0 var(--paper),
               2px 0 0 var(--paper), -2px 0 0 var(--paper);
  pointer-events: none;
}

.puz-flash[hidden] { display: none; }

/* JS ishlamaganda shu rasm qoladi — topshiriq oddiy holda ishlayveradi. */
.puz-peek {
  display: block;
  width: 100%;
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
}

.puz.is-live .puz-peek { display: none; }

.puz-piece {
  position: absolute;
  left: 0;
  top: 0;
  cursor: grab;
  filter: drop-shadow(2px 3px 0 rgba(27, 27, 35, .35));
}

.puz-edge { fill: none; stroke: rgba(27, 27, 35, .5); stroke-width: 4; }

/* Titilish — bo'laklar o'z joyidan sochilib tushadi va yo'lda burilib
   ketadi. Burilish `transform` bilan beriladi (JS), shuning uchun u ham
   animatsiyaga qo'shilgan. */
.puz-piece.is-flying {
  transition: left .6s cubic-bezier(.3, .8, .4, 1),
              top .6s cubic-bezier(.3, .8, .4, 1),
              transform .6s cubic-bezier(.3, .8, .4, 1);
}

.puz-piece.is-held {
  cursor: grabbing;
  filter: drop-shadow(5px 7px 0 rgba(27, 27, 35, .4));
}

/* Taxtaga qo'yilgan bo'lak — soyasi yo'q, chegarasi ingichka: u rasmning
   bir qismidek ko'rinadi. Lekin qotib qolmaydi: uni yana ushlab, boshqa
   katakka yoki stolga qaytarish mumkin. */
.puz-piece.is-set { filter: none; }
.puz-piece.is-set .puz-edge { stroke: rgba(27, 27, 35, .18); }

.puz-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  flex-wrap: wrap;
}

.puz-btn {
  padding: 7px 14px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.puz-btn:hover { background: #FFF3C4; }
.puz-btn[hidden] { display: none; }

/* --- EVALUATE 3: Men kimman? ----------------------------------------------
   Topishmoq birinchi shaxsda yozilgan, ya'ni a'zoning o'zi gapiryapti —
   kartochka ham shunga qurilgan: noma'lum gapiruvchi va uning gap qutisi.
   Ostida "Javob:" maydoni (20-slayddagi oval yozuv joyi).

   Beshta kartochka uchtadan va ikkitadan ikki qatorga bo'linadi, ikkinchi
   qatori o'rtaga tenglashadi — bitta qatorda tizilsa ular ingichkalashib,
   ekranning yarmi bo'sh qolardi.
   -------------------------------------------------------------------------- */

.riddles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  flex: 1;
  gap: 16px;
  min-height: 0;
}

.riddle { grid-column: span 2; }

/* Oxirgi ikkitasi o'rtada. Shart aynan beshta kartochkani tanlaydi —
   boshqa sondagi topshiriqda oddiy uch ustunli to'r bo'lib qolaveradi. */
.riddle:nth-child(4):nth-last-child(2) { grid-column: 2 / span 2; }
.riddle:nth-child(5):nth-last-child(1) { grid-column: 4 / span 2; }

.riddle {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 16px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--pop, 5px 5px 0 var(--ink));
  transition: transform .18s ease, box-shadow .18s ease;
}

.riddle:focus-within { transform: translate(-2px, -2px); box-shadow: var(--pop, 7px 7px 0 var(--ink)); }

/* Quti butun bo'sh joyni egallaydi, matni esa o'rtada turadi — aks holda
   quti bilan "Javob:" maydoni orasida rangli bo'shliq ochilib qolardi. */
.riddle-head { display: flex; flex: 1; align-items: stretch; gap: 13px; min-height: 0; }

/* Noma'lum gapiruvchi. Javob yozilgach belgisi ✓ ga aylanadi. */
.riddle-face {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 25px;
  transition: background-color .2s ease;
}

.riddle-face::after { content: "?"; }

.riddle.is-answered .riddle-face { background: #CFE5B4; }
.riddle.is-answered .riddle-face::after { content: "✓"; }

.riddle-text {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  margin: 0;
  padding: 13px 15px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 16px;
  font-size: 15.5px;
  line-height: 1.4;
}

/* Gap qutisining dumchasi — burilgan kvadratning ikki tomoni. */
.riddle-text::before {
  content: "";
  position: absolute;
  top: 17px;
  left: -9px;
  width: 14px;
  height: 14px;
  background: var(--paper);
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  border-radius: 0 0 0 4px;
  transform: rotate(45deg);
}

.riddle-answer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px 7px 13px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
}

.riddle-answer > label {
  flex: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
}

/* Maydon idish ichida — o'z chegarasi va foni kerak emas. */
.riddle-answer .input {
  padding: 3px 0;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 15px;
}

.riddle-answer .input:focus { box-shadow: none; }
.riddle-answer:focus-within { box-shadow: 0 0 0 4px rgba(27, 27, 35, .16); }

.riddle-mark { flex: none; font-size: 17px; font-weight: 700; }

.riddle--bad .riddle-answer { border-color: #D6263F; background: #FFF3F4; }

.riddle.is-right .riddle-answer { border-color: #2E9E4B; background: #EDFBEF; }
.riddle.is-wrong .riddle-answer { border-color: #D6263F; background: #FFF3F4; }
.riddle.is-shown .riddle-answer { border-color: #C79A08; background: #FFF6D6; }
.riddle.is-right .riddle-mark { color: #2E9E4B; }
.riddle.is-wrong .riddle-mark { color: #D6263F; }

/* Tor ekranda kartochkalar bittadan tushadi va o'z bo'yiga qaytadi. */
@media (max-width: 860px) {
  .riddles { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; gap: 12px; }
  .riddle,
  .riddle:nth-child(4):nth-last-child(2),
  .riddle:nth-child(5):nth-last-child(1) { grid-column: auto; }
  .riddle-head { align-items: flex-start; }
  .riddle-text { display: block; }
}

/* --- Belgilar jadvali -----------------------------------------------------
   Qatorlar — obyekt, ustunlar — jonlilik belgisi. Har katakda ikkita mayda
   tugma: ✔ va ✘.
   -------------------------------------------------------------------------- */

/* `safe center` — jadval sig'sa o'rtada, sig'masa tepadan boshlanadi va
   qirqilib qolmaydi. */
.signs-wrap {
  display: grid;
  align-content: safe center;
  /* Qisqarmaydi: aks holda qatori ko'p jadvalning oxirgi qatori ichki
     aylantirish ortida yashirinib qoladi. Joy yetmasa — sahifa aylanadi. */
  flex: 1 0 auto;
  min-width: 0;
  overflow-x: auto;
  margin-bottom: 10px;
}

.signs {
  width: 100%;
  border-collapse: separate;
  border-spacing: 6px;
}

.signs th {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
}

.signs thead th {
  padding: 6px 10px;
  background: var(--c);
  border: 2px solid var(--ink);
  border-radius: 999px;
  white-space: nowrap;
}

.signs thead th:first-child { background: none; border: none; }

.signs tbody th {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  text-align: left;
  white-space: nowrap;
}

.signs tbody th span { font-size: 21px; line-height: 1; }

.signs td {
  padding: 4px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px;
  text-align: center;
}

.signs td .picks { justify-content: center; }
.signs .pick { width: 36px; height: 36px; font-size: 16px; }

.cell-mark { display: block; font-size: 13px; font-weight: 700; line-height: 1.4; }

/* Qatori kam jadval. Kataklar balandroq, tugmalar yirikroq — shunda ikkita
   qator ham ekranni to'ldirib turadi. */
.signs--roomy th { font-size: 17px; }
.signs--roomy td { padding: 18px 8px; }
.signs--roomy tbody th { padding: 14px 18px; font-size: 19px; }
.signs--roomy tbody th span { font-size: 26px; }
.signs--roomy .pick { width: 50px; height: 50px; font-size: 22px; border-radius: 13px; }
.signs--roomy .picks { gap: 10px; }

.signs td.is-right { border-color: #2E9E4B; background: #F2FCF3; }
.signs td.is-wrong { border-color: #D6263F; background: #FFF6F7; }
.signs td.is-shown { border-color: #C79A08; background: #FFF6D6; }
.signs td.is-right .cell-mark { color: #2E9E4B; }
.signs td.is-wrong .cell-mark { color: #D6263F; }

/* --- Rangli kartochkalar (bir nechta uzun savol) --------------------------
   `quad` dan farqi: soni oldindan ma'lum emas, to'r o'zi joylashtiradi.

   Sinf nomi `cards2` — `cards` bosh sahifadagi mavzular to'ri uchun band.
   Ilgari ikkalasi bir xil nomda edi va bu qoida (fayl oxirroqda turgani
   uchun) bosh sahifani ham bosib qo'yardi: mavzular 4 emas, 5 ustunga
   tizilib qolardi.
   -------------------------------------------------------------------------- */

.cards2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
  flex: 1;
  gap: 13px;
  min-height: 0;
  align-content: stretch;
  overflow-y: auto;
}

.card2 {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 15px 15px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
}

.card2--bad { border-color: #D6263F; }

.card2 .field { display: flex; flex: 1; flex-direction: column; min-height: 0; margin-bottom: 0; }
.card2 .field > label { font-size: 15px; }
.card2 .input { flex: 1; min-height: 74px; }

/* --- Tadqiqot: chapda tartib, o'ngda javoblar ------------------------------ */

.split--lab { grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); align-items: stretch; }

.recipe {
  display: flex;
  flex-direction: column;
  padding: 20px 22px 22px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--pop, 5px 5px 0 var(--ink));
}

.recipe-head {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
}

.recipe-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: recipe;
}

.recipe-steps li {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.3;
}

.recipe-emoji { flex: none; font-size: 22px; line-height: 1; }

.recipe-note {
  margin: auto 0 0;
  padding-top: 14px;
  font-size: 14px;
  line-height: 1.4;
}

/* --- So'z to'ri ------------------------------------------------------------
   Ekranda faqat harflar jadvali turadi va u bor joyni to'la egallaydi.
   So'z birinchi harfidan oxirigacha sudrab belgilanadi.
   -------------------------------------------------------------------------- */

.words { display: flex; flex: 1; flex-direction: column; min-height: 0; }

.wordgrid-wrap { display: flex; flex: 1; align-items: center; justify-content: center; min-height: 0; }

.wordgrid {
  display: grid;
  grid-template-columns: repeat(var(--cols), auto);
  gap: 3px;
  padding: 12px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--pop, 6px 6px 0 var(--ink));
  /* Barmoq bilan sudralganda sahifa aylanib ketmasin, harflar ham
     belgilanib qolmasin. */
  touch-action: none;
  user-select: none;
}

/* Katak o'lchami balandlikka qarab olinadi: to'r kvadrat (15×15), demak
   ekranning past tomoni cheklovchi bo'ladi. */
.wcell {
  display: grid;
  place-items: center;
  width: clamp(22px, min(3.9vh, 3.4vw), 46px);
  height: clamp(22px, min(3.9vh, 3.4vw), 46px);
  padding: 0;
  background: none;
  border: 2px solid transparent;
  border-radius: 9px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(11px, min(2vh, 1.7vw), 23px);
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}

.wcell:hover { background: rgba(27, 27, 35, .08); }
.wcell.is-first { background: #F2C879; border-color: var(--ink); }
.wcell.is-try { background: #FFE9A3; border-color: var(--ink); }
.wcell.is-found { background: #CFE5B4; border-color: #2E9E4B; }
.wcell.is-miss { background: #FFD3D3; border-color: #D6263F; }

/* Topilgan so'z ustidagi belgilash o'chib ketmasin. */
.wcell.is-found.is-try { background: #A9EFB3; }

/* --- Javob kaliti ---------------------------------------------------------
   JS ishlaganda bu ro'yxat butunlay yashiriladi: u so'zlarni sanab bergani
   uchun topshiriqni "ro'yxatdan qidirish"ga aylantirib qo'yardi. JS
   bo'lmasa esa u yagona yo'l — so'zlar qo'lda belgilanadi.
   -------------------------------------------------------------------------- */

.is-solving .wordkeys { display: none; }

.wordkeys { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }

.wordkeys-head {
  flex-basis: 100%;
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
}

.wchip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 17px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 16px;
  transition: background-color .2s ease;
}

.wchip.is-found { background: #CFE5B4; border-color: #2E9E4B; }
.wchip.is-found .wchip-name { text-decoration: line-through; }

.pick--mini { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }

/* Telefonda 15 ta katak eni bo'yicha sig'ishi kerak — eng kichik o'lchov
   ekran kengligidan hisoblanadi, aks holda to'r chetdan chiqib ketadi. */
@media (max-width: 560px) {
  .wordgrid { gap: 2px; padding: 8px; border-radius: 14px; }
  .wcell {
    width: min(5.6vw, 30px);
    height: min(5.6vw, 30px);
    border-radius: 6px;
    font-size: min(2.9vw, 15px);
  }
}

/* --- Test: savol va to'rtta variant ---------------------------------------- */

.quiz {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  flex: 1;
  gap: 13px;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
}

.qcard {
  min-width: 0;
  margin: 0;
  padding: 11px 13px 12px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: 4px 4px 0 rgba(27, 27, 35, .16);
}

.qcard--bad { border-color: #D6263F; background: #FFF3F4; }
.qcard.is-right { border-color: #2E9E4B; background: #F2FCF3; }
.qcard.is-wrong { border-color: #D6263F; background: #FFF6F7; }

.qcard-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  padding: 0;
  font-size: 15px;
  line-height: 1.3;
}

.qcard-no {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  background: var(--c);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
}

.qcard-text { flex: 1; font-family: var(--display); font-weight: 600; }
.qcard-mark { flex: none; font-size: 17px; font-weight: 700; }
.qcard.is-right .qcard-mark { color: #2E9E4B; }
.qcard.is-wrong .qcard-mark { color: #D6263F; }

.qopts { display: grid; gap: 5px; }

.qopt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 11px 6px 7px;
  background: var(--paper);
  border: 2px solid rgba(27, 27, 35, .25);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.qopt:hover { border-color: var(--ink); }

.qopt-letter {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  background: #F1EFE7;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
}

.qopt:has(.pick-input:checked) {
  background: #FFF6D6;
  border-color: var(--ink);
  box-shadow: var(--pop, 2px 2px 0 var(--ink));
}

.qopt:has(.pick-input:checked) .qopt-letter { background: #F2C879; }
.qopt:has(.pick-input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }

/* --- Taxmin: gap ichidagi bo'sh joy ---------------------------------------
   Bitta savol butun ekranni egallaydi — bu ataylab: ENGAGE'da maqsad
   javobni topish emas, bolani to'xtatib o'ylatish.
   -------------------------------------------------------------------------- */

/* Karta bo'sh joyni to'la egallamaydi — `margin: auto 0` uni o'rtaga
   suzdiradi. To'la egallasa bir varaq rang bo'lib qoladi, gap esa
   o'rtasida yo'qolib ketadi. */
.guess {
  display: flex;
  flex: none;
  flex-direction: column;
  align-self: center;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: min(880px, 100%);
  margin: auto 0;
  padding: 34px 38px 38px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
  text-align: center;
  animation: pop-in .5s cubic-bezier(.2, .8, .3, 1) backwards;
}

.guess-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 86px;
  height: 86px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  box-shadow: var(--pop, 5px 5px 0 var(--ink));
  font-size: 40px;
  animation: seal-pop .6s cubic-bezier(.2, 1.5, .4, 1) .18s backwards;
}

.guess-line {
  max-width: 700px;
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(21px, 2.9vw, 33px);
  line-height: 1.75;
}

.guess-slot { display: inline-block; }

/* Maydon gapning ichida turadi — o'z chegarasi emas, tagiga chizilgan
   chiziq. Shunda u "to'ldiriladigan joy" bo'lib ko'rinadi. */
.guess-slot .input {
  display: inline-block;
  width: min(300px, 56vw);
  margin: 0 5px;
  vertical-align: middle;
  padding: 2px 16px 5px;
  background: var(--paper);
  border: none;
  border-bottom: 4px solid var(--ink);
  border-radius: 12px 12px 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: inherit;
  line-height: 1.25;
  text-align: center;
}

.guess-slot .input:focus { box-shadow: 0 0 0 4px rgba(27, 27, 35, .18); }
.guess-slot .input::placeholder { font-size: .7em; }

.guess--bad .guess-slot .input { border-bottom-color: #D6263F; background: #FFF3F4; }
.guess .field-error { color: #7A0F22; font-size: 15px; }

/* --- Javob savatlari (reveal ichida) -------------------------------------- */

.buckets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.bucket {
  padding: 14px 16px 16px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
}

.bucket-head { margin: 0 0 10px; font-family: var(--display); font-weight: 700; font-size: 16px; }

.bucket-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }

.bucket-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-size: 14px;
}

.bucket-list span { font-size: 18px; }

/* Ostki qator */
.task-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.task-hint {
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--soft);
  text-align: center;
}

/* Xabarcha aynan shu izohning ustida turadi — ikkalasi bir vaqtda ko'rinsa
   ustma-ust tushadi. Shuning uchun izoh xabarcha so'ngach paydo bo'ladi:
   pastdagi qator hech qachon to'rt qavat bo'lib qolmaydi. */
.has-snack .task-hint {
  opacity: 0;
  animation: hint-back .35s ease 3.7s forwards;
}

@keyframes hint-back { to { opacity: 1; } }

.task-nav-gap { flex: none; }

/* Muammoli savolda maydonlar ko'p — bo'shliqlar zichroq. */
.task--problem .split { margin-top: 12px; gap: 26px; }
.task--problem .task-lead { margin-top: 8px; }

/* Saralash topshirig'ida ikkita savat simmetrik turadi — sarlavha ham
   ularning o'rtasiga tenglashsa, ekran muvozanatli ko'rinadi. */
.task--sort .task-head { text-align: center; }
.task--sort .task-lead { margin-left: auto; margin-right: auto; }

/* Fikr maydonining yorlig'i o'ylash belgisi bilan boshlanadi — bu yerda
   to'g'ri javob emas, o'quvchining o'z fikri so'ralayotgani bilinsin. */
.task--problem .split-form > .field > label::before { content: "💭 "; }

/* Past ekranlarda (noutbuk) topshiriq zichroq teriladi — maqsad: "Saqlash"
   tugmasi aylantirmasdan ko'rinsin. */
@media (max-height: 900px) {
  .task { padding: 18px 24px 20px; }
  .task-eyebrow { margin-bottom: 7px; padding: 5px 12px; }
  .task-title { font-size: clamp(21px, 2.2vw, 28px); }
  .task-lead { margin-top: 6px; font-size: 15px; }
  .split { margin-top: 12px; gap: 24px; }
  .hex { width: min(168px, 100%); }
  .hex-mark { font-size: 34px; }
  .hex-in b { font-size: 13px; }
  .example { padding: 7px 13px; font-size: 14px; }
  .organs-title { margin: 12px 0 8px; font-size: 16px; }
  .organs { gap: 10px; }
  .organ { padding: 9px 12px 11px; }
  .organ .field > label { font-size: 14px; }
  .task-nav { margin-top: 14px; }
  .task-nav .btn { padding: 12px 22px; font-size: 16px; }
  .task-hint { font-size: 13px; }
  .shot figcaption { padding: 9px 12px; font-size: 14px; }
  .organ .input { padding: 9px 13px; }
  .check { margin-top: 12px; padding: 8px 14px 8px 8px; gap: 12px; }
  .btn--check { padding: 9px 17px; font-size: 15px; }
  .check-score { font-size: 14px; }
}

/* Eng past ekranlar (768px noutbuk). Muammoli savolda 7 ta maydon bor —
   faqat o'sha ekran yana bir pog'ona zichlashadi. */
@media (max-height: 820px) {
  /* Kichkina olti burchakka yozuv sig'maydi — faqat "?" qoladi,
     "Muammoli savol" yozuvi tepadagi yorliqda baribir bor. */
  .task--problem .hex { width: min(120px, 100%); }
  .task--problem .hex-in b { display: none; }
  .task--problem .organs { gap: 7px; }
  .task--problem .hex-mark { font-size: 28px; }
  .task--problem .hex-side { gap: 10px; }
  .task--problem textarea.input { height: 96px; min-height: 0; }
  .task--problem .organs { gap: 8px; }
  .task--problem .organ { padding: 8px 11px 10px; }
  .task--problem .organs-title { margin: 10px 0 7px; }
  .task--problem .split { margin-top: 10px; }
  .task--problem .task-lead { margin-top: 4px; font-size: 14px; }
  .task--problem .examples { gap: 7px; }
  .task--problem .example { padding: 6px 12px; font-size: 13px; }
  .task--problem .organ { padding: 7px 11px 9px; }
  .task--problem .organ .field > label { margin-bottom: 5px; font-size: 13px; }
  .task--gallery .task-lead { margin-top: 4px; font-size: 14px; }
  .task--gallery .shot figcaption { padding: 7px 11px; font-size: 13px; }
  /* Faqat kvadrat tugmalar kichrayadi — ichida yozuv bo'lganlari (belgi +
     so'z, yoki a'zo nomi) o'z eniga muhtoj: siqilsa yozuv tugmadan chiqib
     ketadi. "Moslashtiring" topshirig'ida aynan shu bo'lgan — sakkizta a'zo
     nomi 34px doiralarga tiqilib, o'qib bo'lmas holga kelgan. */
  .pick:not(.pick--wide):not(.pick--word) { width: 34px; height: 34px; font-size: 15px; }
  .tally { margin-bottom: 9px; padding: 5px 13px; font-size: 13px; }
  .claims { gap: 10px; }
  .claim { gap: 12px; padding: 9px 11px 9px 10px; }
  .claim-no { width: 34px; height: 34px; font-size: 16px; }
  .claim-text { font-size: 16px; }
  .pick--wide { padding: 8px 16px 8px 12px; }
  .pick--wide > span { font-size: 17px; }
  .pick--wide b { font-size: 14px; }
  .riddle { padding: 12px 13px 11px; }
  .qcard { padding: 9px 11px 10px; }
  .qcard-head { margin-bottom: 6px; font-size: 14px; }
  .qcard-no { width: 25px; height: 25px; font-size: 13px; }
  .qopt { padding: 5px 10px 5px 6px; font-size: 13px; }
  .qopt-letter { width: 23px; height: 23px; font-size: 12px; }
  .qopts { gap: 4px; }
  .recipe { padding: 15px 17px 17px; }
  .recipe-head { margin-bottom: 10px; font-size: 17px; }
  .recipe-steps { gap: 8px; }
  .recipe-steps li { padding: 8px 12px; font-size: 14px; }
  .recipe-note { padding-top: 10px; font-size: 13px; }
  .split--lab textarea.input { min-height: 0; height: 84px; }
  .card2 { padding: 11px 12px 12px; }
  .card2 .input { min-height: 60px; }
  .wordlist-head { margin-bottom: 7px; font-size: 15px; }
  .wchip { padding: 6px 13px; font-size: 14px; }

  .riddle-text { font-size: 14px; }
  .bins { gap: 12px; }
  .bin { padding: 8px; }
  .bin-head { margin-bottom: 7px; padding: 5px 7px 5px 13px; font-size: 15px; }
  .bin-body { gap: 6px; padding: 7px; }
  .tray { margin-top: 10px; }
  .tray-head { margin-bottom: 6px; font-size: 14px; }
  .tray-body { gap: 6px; min-height: 54px; padding: 8px; }
  .habit { padding: 5px 11px 5px 9px; font-size: 13px; }
  .habit-emoji { font-size: 18px; }
  .slots { gap: 8px; }
  .exp-run { gap: 26px; margin-top: 12px; }
  .exp-phases { gap: 7px; margin-bottom: 14px; }
  .exp-phase { padding: 8px 12px; }
  .exp-label { font-size: 19px; }
  .exp-controls { margin-top: 14px; }
}

/* --- Yakun sahifasi: to'liq ekran, ikki ustun -------------------------------
   Chapda tabrik, o'ngda o'quvchining javoblari. Javoblar ko'p bo'lsa sahifa
   emas, faqat o'ng panel ichida aylanadi — tabrik doim ko'rinib turadi.
   ------------------------------------------------------------------------- */

.done-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  /* Qator ham cheklanishi shart: `auto` bo'lsa katak mazmun bo'yicha
     cho'ziladi va ichki aylantirish o'rniga sahifa aylanadi. */
  grid-template-rows: minmax(0, 1fr);
  flex: 1;
  gap: 18px;
  min-height: 0;
}

.done {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 30px 30px 28px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
  text-align: center;
  overflow-y: auto;
  animation: pop-in .55s cubic-bezier(.2, .8, .3, 1) backwards;
}

/* Mazmun tik o'rtada tursin. `justify-content: center` o'rniga chetki
   farzandlarga `auto` chet berilgan — sig'masa tepasi kesilib qolmaydi. */
.done > :first-child { margin-top: auto; }
.done > :last-child { margin-bottom: auto; }

.done-seal {
  display: grid;
  place-items: center;
  flex: none;
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  box-shadow: var(--pop, 5px 5px 0 var(--ink));
  font-size: 42px;
  animation: seal-pop .6s cubic-bezier(.2, 1.5, .4, 1) .2s backwards;
}

@keyframes seal-pop { from { transform: scale(0) rotate(-25deg); } }

.done-eyebrow {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
}

.done h1 { margin: 6px 0 0; font-size: clamp(24px, 2.6vw, 36px); line-height: 1.1; letter-spacing: -1px; }
.done-lead { margin: 10px auto 0; max-width: 42ch; line-height: 1.5; }

/* --- Yakuniy ball (EVALUATE) ----------------------------------------------
   Siferblat tajriba taymeriniki bilan bir xil o'lchamda — bir xil shakl
   darsning boshida ham, oxirida ham takrorlansin.
   -------------------------------------------------------------------------- */

.scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin-top: 18px;
  text-align: left;
}

.score-dial {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: min(clamp(150px, 28vh, 220px), 46%);
  aspect-ratio: 1;
}

.score-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.score-ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-dasharray: 327;
  /* Boshlang'ich holat serverdagi foizdan — JS ishlamasa ham halqa to'g'ri
     turadi, JS bo'lsa uni noldan qayta sanaydi. */
  stroke-dashoffset: calc(327 - 327 * var(--pct) / 100);
  transition: stroke-dashoffset .25s linear;
}

.score-face { position: absolute; display: grid; place-items: center; text-align: center; }
.score-face b { font-family: var(--display); font-weight: 700; font-size: clamp(38px, 7vh, 62px); line-height: 1; }
.score-face i { font-style: normal; font-size: 13px; color: var(--soft); }

.score-rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }

.score-rows li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 13px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
}

.score-row-name { flex: 1; }
.score-row-hits { color: var(--soft); font-size: 13px; }
.score-row-pts { font-family: var(--display); font-weight: 700; white-space: nowrap; }

/* Oldingi baholanadigan bosqichning jami bali (ball bo'lingan mavzuda). */
.score-rows .score-row--stage { background: #F7DFA1; }

/* Ball chiqqanda karta bir marta sakraydi — qarsak bilan birga. */
.done--score.is-lit .score-dial { animation: score-pop .6s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes score-pop { from { transform: scale(.82); } }

.done-facts {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.done-facts li {
  min-width: 118px;
  padding: 12px 18px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
}

.done-facts b { display: block; font-family: var(--display); font-weight: 700; font-size: 25px; line-height: 1.1; }
.done-facts span { font-size: 13px; color: var(--soft); }

.done-status {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 9px;
  margin: 20px 0 0;
  padding: 9px 18px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
}

.done-status-dot {
  width: 11px;
  height: 11px;
  background: #F5A524;
  border: 2px solid var(--ink);
  border-radius: 50%;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse { 50% { transform: scale(1.45); opacity: .65; } }

.done-note { margin: 18px auto 0; max-width: 46ch; font-size: 14px; line-height: 1.5; }

/* Tugmalar doim kartochka tubida turadi */
.done-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

/* "Qaytadan ishlash" javoblarni o'chiradi, shuning uchun havola emas, forma.
   Forma qutisi qatorga qo'shimcha katak qo'shmasin — tugmaning o'zi qolgan
   tugmalar bilan yonma-yon tursin. */
.done-nav form,
.start-nav form { display: contents; }

/* --- O'ng panel: yozganlari ----------------------------------------------- */

.review-panel {
  /* Panel rangi. Eski brauzerda shu qiymat o'z holicha qoladi (oq qog'oz),
     `color-mix` ni tushunadiganida esa pastdagi @supports uni bosqich
     rangining yuvindisiga almashtiradi. Shunday qilib rangni bilmaydigan
     brauzerda panel shaffof bo'lib qolmaydi. */
  --panel: var(--paper);

  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 10px 22px 24px;
  background: var(--panel);
  border: var(--edge) solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
  animation: pop-in .55s cubic-bezier(.2, .8, .3, 1) .1s backwards;
}

/* Bosqich rangining yengil yuvindisi — o'ng panel chapdagi tabrik bilan bir
   oilada tursin. To'yingan rang emas: ichidagi javob kartochkalari oq, ular
   fondan ajralib turishi kerak. */
@supports (background: color-mix(in srgb, red 14%, white)) {
  .review-panel { --panel: color-mix(in srgb, var(--c) 26%, var(--paper)); }
}

.review-head { flex: none; margin: 0 0 14px; font-size: 21px; letter-spacing: -.4px; }

/* Pastdagi yumshoq soyalanish — ostida yana javob borligini bildiradi. */
.review-panel::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  left: 4px;
  height: 46px;
  /* Panel rangi endi bosqichga qarab o'zgaradi, shuning uchun boshlang'ich
     nuqta qat'iy rgba emas. Brauzerlar gradientni oldindan ko'paytirilgan
     alfa bilan aralashtiradi — `transparent` kulrang dog' qoldirmaydi. */
  background: linear-gradient(transparent, var(--panel) 78%);
  border-radius: 0 0 19px 19px;
  pointer-events: none;
}

.review-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--ink) transparent;
}

.review-scroll::-webkit-scrollbar { width: 10px; }
.review-scroll::-webkit-scrollbar-track { background: transparent; }
.review-scroll::-webkit-scrollbar-thumb {
  background: var(--ink);
  border: 3px solid var(--panel);
  border-radius: 999px;
}

.review {
  margin-bottom: 12px;
  padding: 16px 18px;
  background: #F7F8FC;
  border: 2px solid var(--ink);
  border-radius: 16px;
}

.review:last-child { margin-bottom: 0; }

.review-eyebrow { margin: 0 0 3px; font-size: 12px; font-weight: 700; color: var(--soft); letter-spacing: .5px; }
.review h3 { font-size: 17px; line-height: 1.25; }

.review-list { margin: 12px 0 0; }
.review-list dt { margin-top: 11px; font-family: var(--display); font-weight: 600; font-size: 14px; }
.review-list dt:first-child { margin-top: 0; }

.review-list dd {
  margin: 4px 0 0;
  padding: 9px 13px;
  background: var(--paper);
  border-left: 4px solid var(--c);
  border-radius: 0 10px 10px 0;
  font-size: 15px;
  line-height: 1.45;
}

/* Baholangan javob: yashil ✓ yoki qizil ✗, xato bo'lsa to'g'risi ham. */
.review-list .dd--right { border-left-color: #2E9E4B; background: #F2FCF3; }
.review-list .dd--wrong { border-left-color: #D6263F; background: #FFF6F7; }

.dd-mark { margin-right: 6px; font-weight: 700; }
.dd--right .dd-mark { color: #2E9E4B; }
.dd--wrong .dd-mark { color: #D6263F; }

.dd-right {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #2E9E4B;
}

/* Ochiq savolga o'qituvchining yulduzchasi va izohi. */
.dd-feedback {
  display: block;
  margin-top: 7px;
  padding: 7px 10px;
  background: #FFFDF5;
  border: 2px solid var(--ink);
  border-left: 5px solid #F2A93B;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.4;
}
.dd-feedback i { color: var(--soft); font-size: 12px; white-space: nowrap; }
.stars-show { margin-right: 6px; font-size: 17px; letter-spacing: 1px; color: #D9D3C3; white-space: nowrap; }
.stars-show .is-on { color: #F2A93B; }

.review-edit {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
}

.soon-note--go { background: #CFE5B4; }

/* --- Sertifikat -----------------------------------------------------------
   O'z sahifasida turadi (/mavzu/<slug>/sertifikat/) — dars ekranlarining
   maketiga aralashmaydi. Unga yakun sahifasidagi oltin tugma va
   "Natijalarim"dagi kartochka havolasi olib keladi.
   -------------------------------------------------------------------------- */

.done-cert { margin: 16px 0 0; }

/* Oltin tugma — mukofot rangi boshqa tugmalardan ajralib tursin. */
.btn--cert { background: #F2C879; }

/* Saqlash canvas orqali bo'ladi: JS o'chiq bo'lsa tugmadan foyda yo'q. */
html:not(.js) .cert-save { display: none; }

.work-cert {
  align-self: center;
  padding: 8px 16px;
  background: #F2C879;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.work-cert:hover { text-decoration: underline; }

.cert-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 100dvh;
  max-width: 1500px;
  margin: 0 auto;
  padding: 22px 26px 30px;
  text-align: center;
}

.cert-head h1 { font-size: 30px; letter-spacing: -.4px; }
.cert-head p { margin: 5px 0 0; color: var(--soft); }

.cert-page .done-nav { margin-top: 4px; }

.cert {
  position: relative;
  margin: 0;
  /* Butun sertifikat bir ekranga sig'sin: eni balandlikdan hisoblanadi
     (rasm nisbati 1402:1122 ≈ 1.25). Tor ekranda enidan to'ladi, juda
     past ekranda ham 340px dan kichraymaydi — o'qib bo'lmay qolmasin. */
  width: min(100%, 1100px, max(340px, calc((100dvh - 240px) * 1.25)));
  border: var(--edge) solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
  overflow: hidden;
}

.cert-paper { display: block; width: 100%; height: auto; }

/* Yozuvlar qatlami rasm ustida. `viewBox` rasmning piksel to'riga teng,
   shuning uchun matn rasm bilan bir xil nisbatda kichrayadi. */
.cert-ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cert-ink text { text-anchor: middle; }

/* Shrift slaydga qarab tanlanadi (content.py → CERTIFICATES → font):
   kitobiy sertifikatda Georgia, bolalarcha dumaloq slaydda saytning
   o'z sarlavha shrifti. `content.py` dagi kenglik nisbatlari aynan shu
   ikkalasi bo'yicha o'lchangan — birini o'zgartirsangiz, o'shanisini ham. */
.cert-ink--serif text { font-family: Georgia, "Times New Roman", serif; }
/* Ism Fredoka'da: `_FONTS["display"]` aynan shu shrift kengligi bo'yicha
   o'lchangan. Fredoka faqat sertifikat sahifasida yuklanadi (certificate.html). */
.cert-ink--display text { font-family: "Fredoka", var(--display); }

/* Ranglar shablonda, `fill` orqali beriladi: har bir sertifikatning o'z
   palitrasi bor (qarang: content.py, CERTIFICATES → ink). */
.cert-name { font-weight: 700; }

.cert-medal { stroke-width: 3; }
.cert-score { font-weight: 700; dominant-baseline: central; }

/* --- Pastki qator --------------------------------------------------------- */

.foot {
  max-width: var(--wrap);
  margin: 60px auto 0;
  padding: 22px 24px 40px;
  border-top: 2px solid var(--ink);
  font-size: 15px;
  color: var(--soft);
}

/* --- Moslashuvchanlik ----------------------------------------------------- */

@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
  .folders { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .screen { padding-left: 18px; padding-right: 18px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
  .exp-screen { grid-template-columns: minmax(0, 1fr); gap: 20px; justify-items: center; align-content: start; }
  .exp-side { width: 100%; }
  .exp-dial { width: min(230px, 60%); }
  .split--reveal { grid-template-columns: minmax(0, 1fr); }
  .reveal-panel img { max-height: 42vh; }
  .vid video, .vid img { max-height: 46vh; }
  .split--slots { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .slots-form { width: 100%; }
  .scheme img { max-height: 40vh; }
  .photo img { max-height: 46vh; }
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shot img { height: min(26vh, 230px); }
  .organs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail { max-width: 340px; }
  .rail-label { display: none; }
  .done-split,
  .cover-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
  .done, .cover { padding: 22px 20px 20px; }
  .done-facts li,
  .cover-facts li { min-width: 100px; padding: 10px 14px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card { min-height: 0; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .folders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  /* Tor ekranda emoji matn ustiga chiqadi */
  .lesson-card { grid-template-columns: minmax(0, 1fr); }
  .lesson-emoji { grid-row: auto; margin-bottom: 14px; font-size: 72px; }
  .welcome { padding-top: 20px; }

  /* Bosqich sahifalari */
  .screen { padding: 12px 14px 20px; gap: 10px; }
  .task { padding: 20px 16px 22px; }
  .cover, .start-card, .done { padding-left: 20px; padding-right: 20px; }
  .cover { grid-template-columns: minmax(0, 1fr); }
  .cover-emoji { grid-row: auto; margin-bottom: 12px; font-size: 64px; }

  /* Yuqori qator ikki qavat bo'ladi: chiziq alohida qatorga tushadi. */
  .stage-bar { gap: 8px; }
  .rail { order: 3; flex-basis: 100%; max-width: none; margin-top: 4px; }
  .rail-dot { width: 33px; height: 33px; font-size: 15px; }
  .rail-step::before { top: 15px; }
  .stage-who { margin-left: auto; }

  /* Uchala yorliq bitta qatorga sig'sin. Avval "👤 Ism" alohida qatorga
     tushib, topshiriqni pastga surib qo'yardi. Joy uch yerdan tejaladi:
     yorliqlar kichrayadi, orqaga havolasida faqat o'q qoladi (mavzu nomi
     `title` da turaveradi), ism esa sig'masa uch nuqta bilan qisqaradi. */
  .stage-chip,
  .stage-who { padding: 6px 12px; font-size: 12.5px; }

  .stage-bar .back-name { display: none; }

  .stage-who {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .photo img { max-height: 42vh; }
  .shots { gap: 10px; margin-bottom: 16px; }
  .shot img { height: min(20vh, 175px); border-radius: 14px 14px 0 0; }
  .shot figcaption { padding: 8px 10px; font-size: 13px; border-radius: 0 0 14px 14px; }
  .organs { grid-template-columns: minmax(0, 1fr); }
  .organs--exp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hex { width: min(210px, 70%); }
  .hex-mark { font-size: 42px; }
  .exp-dial { width: min(190px, 62%); }
  .quad { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .slots { grid-template-columns: minmax(0, 1fr); }
  .scheme img { max-height: 34vh; }
  /* Tor ekranda tugma va natija bir qatorga sig'maydi — ustma-ust qo'yamiz. */
  .check { flex-wrap: wrap; justify-content: center; padding: 10px 12px; border-radius: 22px; }
  .check-score { flex-basis: 100%; text-align: center; }
  /* Tor ekranda gap va tugmalar bir qatorga sig'maydi — tugmalar pastga
     tushib, ikkiga bo'linib butun enni egallaydi. */
  .claim { flex-wrap: wrap; }
  .claim-text { flex-basis: calc(100% - 66px); font-size: 16px; }
  .claim .picks { width: 100%; }
  .pick--wide { flex: 1; justify-content: center; padding: 9px 12px; }

  .pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Tor ekranda ikkita savat yonma-yon sig'maydi — ustma-ust. */
  /* 5x4 jadval tor ekranga zo'rg'a sig'adi — hamma o'lcham kichrayadi. */
  .signs { border-spacing: 3px; }
  .signs thead th { padding: 5px 6px; font-size: 12px; white-space: normal; }
  .signs tbody th { gap: 6px; padding: 5px 8px; font-size: 13px; white-space: normal; }
  .signs tbody th span { font-size: 17px; }
  .signs td { padding: 2px; }
  .signs .pick { width: 26px; height: 26px; font-size: 12px; }
  .signs .picks { gap: 4px; }
  .bins { grid-template-columns: minmax(0, 1fr); }
  .bin-body { min-height: 76px; }
  .buckets { grid-template-columns: minmax(0, 1fr); }
  .quad-card .input { min-height: 74px; }
  .reveal-tab { padding: 7px 12px; font-size: 13px; }
  .reveal-panel img { max-height: 36vh; }
  .vid video, .vid img { max-height: 34vh; }
  .exp-controls { justify-content: center; }
  .exp-controls .btn { flex: 1; }

  /* Tor ekranda ikki ustun sig'maydi — ustma-ust, tabiiy aylantirish bilan. */
  .screen--fixed { height: auto; min-height: 100dvh; }
  .done-split,
  .cover-split { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .done, .cover, .review-panel, .cover-panel { overflow: visible; }
  .review-panel, .cover-panel { padding: 20px; }
  .review-panel::after { display: none; }   /* ichki aylantirish yo'q */
  .review-scroll, .cover-scroll { overflow: visible; padding-right: 0; }
  .done > :first-child, .done > :last-child { margin-top: 0; margin-bottom: 0; }
  .cover-mid { margin: 18px 0; }
  .rail5-mark { width: 34px; height: 34px; font-size: 15px; }
  .rail5-item.is-current .rail5-mark { width: 42px; height: 42px; font-size: 19px; }
  .rail5-item + .rail5-item::before { width: 12px; }
  .done-seal { margin: 0 auto 14px; }
  .done-nav .btn { flex: 1; text-align: center; }
  .start-nav .btn { flex: 1; text-align: center; }
  .task-nav { flex-direction: column-reverse; align-items: stretch; }
  .task-nav .btn { text-align: center; }
  .task-nav-gap { display: none; }
  .toasts { width: calc(100% - 24px); }
  .toast { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   HISOB: kirish, ro'yxatdan o'tish, o'qituvchi paneli, natijalar
   Uslub qolgan sahifalar bilan bir xil — to'liq bo'yalgan blok, qalin qora
   chegara, qattiq soya. Yangi rang kiritilmaydi, mavjud bo'yoqlar olinadi.
   ========================================================================== */

/* --- Yuqori paneldagi hisob burchagi -------------------------------------- */

.who { display: flex; align-items: center; gap: 10px; }

.who-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  background: var(--c, #B4D4E2);
  border: var(--edge) solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--pop, 3px 3px 0 var(--ink));
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
}

.who-badge--student { --c: #B4D4E2; }
.who-badge--teacher { --c: #F0D3A4; }
.who-badge--big { width: 62px; height: 62px; font-size: 28px; }

.who-text { display: flex; flex-direction: column; line-height: 1.2; }
.who-text b { font-size: 16px; }
.who-text i { color: var(--soft); font-size: 13px; font-style: normal; }

.who-out {
  padding: 8px 14px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}

.who-out:hover { background: var(--ink); color: var(--paper); }

.btn--small { padding: 10px 18px; font-size: 15px; }
.btn--wide { display: block; width: 100%; text-align: center; }

.welcome-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* --- Kirish / ro'yxatdan o'tish varag'i ----------------------------------- */

.gate {
  display: grid;
  place-items: center;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 30px 24px 70px;
}

.gate-card {
  width: 100%;
  max-width: 460px;
  padding: 34px 30px 28px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
  /* Tepasidagi rangli chiziq — qaysi sahifada turganini ko'rsatadi. */
  border-top: 10px solid var(--c);
}

.gate-card--wide { max-width: 620px; }

.gate-emoji { display: block; font-size: 44px; line-height: 1; }

.gate-card h1 { margin: 10px 0 0; font-size: 32px; letter-spacing: -.6px; }

.gate-lead { margin: 8px 0 22px; color: var(--soft); font-size: 15.5px; line-height: 1.5; }

.gate-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.gate-alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  background: #FFF3F4;
  border: var(--edge) solid #D6263F;
  border-radius: 14px;
  color: #B01B31;
  font-weight: 700;
  font-size: 15px;
}

.gate-alert p { margin: 0; }
.gate-alert p + p { margin-top: 6px; }

.gate-foot {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 2px dashed #D8D8E0;
  color: var(--soft);
  font-size: 15px;
  text-align: center;
}

.gate-foot a { font-weight: 700; }

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--soft);
  font-size: 13.5px;
  line-height: 1.4;
}

/* --- Rol tanlash: ikkita katta kartochka ---------------------------------- */

.roles { margin: 0 0 20px; padding: 0; border: 0; }

.roles legend {
  padding: 0;
  margin-bottom: 9px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
}

.roles-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.role {
  position: relative;
  display: block;
  padding: 16px 14px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 16px;
  cursor: pointer;
  transition: background-color .15s, transform .15s, box-shadow .15s;
}

.role--student { --c: #B4D4E2; }
.role--teacher { --c: #F0D3A4; }

.role input { position: absolute; opacity: 0; pointer-events: none; }

.role-emoji { display: block; font-size: 30px; line-height: 1; }
.role-name { display: block; margin-top: 8px; font-size: 18px; }
.role-text { display: block; margin-top: 3px; color: var(--soft); font-size: 13.5px; line-height: 1.35; }

.role-tick {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--ink);
  border-radius: 999px;
  color: var(--paper);
  font-size: 14px;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s, transform .15s;
}

.role:hover { transform: translate(-2px, -2px); box-shadow: var(--pop, 4px 4px 0 var(--ink)); }

.role:has(input:checked) {
  background: var(--c);
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
}

.role:has(input:checked) .role-text { color: var(--ink); }
.role:has(input:checked) .role-tick { opacity: 1; transform: scale(1); }
.role:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }

.roles--bad .role { border-color: #D6263F; }

/* --- Panel sahifalari ----------------------------------------------------- */

.panel { max-width: var(--wrap); margin: 0 auto; padding: 10px 24px 70px; }

.panel-head { margin: 18px 0 26px; }

.panel-eyebrow {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  color: var(--soft);
  letter-spacing: .4px;
  text-transform: uppercase;
}

.panel-head h1 { font-size: 38px; letter-spacing: -.8px; }

.panel-lead { margin: 8px 0 0; color: var(--soft); font-size: 16px; }
.panel-lead b { color: var(--ink); }

.panel-who { display: flex; align-items: center; gap: 16px; }

.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-note {
  margin: 26px 0 0;
  padding: 14px 16px;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.5;
}

.sorts { display: flex; gap: 8px; }

.sort-link {
  padding: 8px 14px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.sort-link.is-on { background: var(--ink); color: var(--paper); }

/* --- Sanoq kafellari ------------------------------------------------------ */

.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 34px;
}

.tile {
  padding: 18px 18px 16px;
  background: var(--c);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
}

.tile b {
  display: block;
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
  letter-spacing: -1.5px;
}

.tile b i { font-size: 22px; font-style: normal; opacity: .65; }

.tile span {
  display: block;
  margin-top: 6px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px;
}

/* --- Jadval --------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  margin-bottom: 34px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
}

.grid-table { width: 100%; border-collapse: collapse; font-size: 15px; }

.grid-table th,
.grid-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid #E7E7EE;
  white-space: nowrap;
}

.grid-table thead th {
  background: #F2F2F7;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  color: var(--soft);
}

.grid-table tbody tr:last-child th,
.grid-table tbody tr:last-child td { border-bottom: 0; }

.grid-table tbody tr:hover { background: #FAFAFD; }

.grid-table tbody th { font-weight: 400; }

.table-empty { color: var(--soft); text-align: center; padding: 26px; }

.who-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.who-link b { display: block; font-size: 16px; }
.who-link i { color: var(--soft); font-size: 13px; font-style: normal; }
.who-link:hover b { text-decoration: underline; }

.topic-dot {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--c);
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-size: 18px;
}

.pill {
  display: inline-block;
  padding: 4px 11px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
}

.pill--warn { background: #FFD9A8; }
.pill--ok { background: #C8F0CF; }
.pill--score { background: #F0D3A4; }
.pill--soft { background: var(--paper); color: var(--soft); border-color: #C9C9D4; }

/* --- Ish kartochkasi (panel va natijalar) --------------------------------- */

.works { display: grid; gap: 22px; }

.work {
  margin-bottom: 24px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: var(--round);
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
  overflow: hidden;
}

.work--mine { margin-bottom: 0; }

.work-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 22px;
  background: var(--c);
  border-bottom: var(--edge) solid var(--ink);
}

.work-emoji { font-size: 34px; line-height: 1; }

.work-title { flex: 1 1 220px; }
.work-title h2 { font-size: 24px; letter-spacing: -.4px; }
.work-title h2 a { text-decoration: none; }
.work-title h2 a:hover { text-decoration: underline; }
.work-title p { margin: 3px 0 0; font-size: 14.5px; }

.work-stages { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

.work-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 62px;
  padding: 7px 9px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  line-height: 1.2;
}

.work-stage.is-done { background: var(--c); }
.work-stage b { font-size: 17px; }
.work-stage span { font-family: var(--display); font-weight: 600; font-size: 13px; }
.work-stage i { font-style: normal; font-size: 11px; color: var(--soft); }

/* --- Javoblar ro'yxati ---------------------------------------------------- */

.work-block { padding: 18px 22px; border-bottom: 2px dashed #DDDDE6; }
.work-block:last-child { border-bottom: 0; }

.work-block-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 6px solid var(--c);
  font-size: 18px;
}

.work-block-head span { color: var(--soft); font-family: var(--body); font-size: 13.5px; font-weight: 400; }

.qstep { margin-bottom: 16px; }
.qstep:last-child { margin-bottom: 0; }

.qstep-head {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  color: var(--soft);
}

.qrow {
  padding: 13px 15px;
  margin-bottom: 10px;
  background: #F7F7FB;
  border: 2px solid #E2E2EA;
  border-radius: 14px;
}

/* Tekshirilmagan javob ko'zga tashlanib tursin. */
.qrow--new { background: #FFFBEF; border-color: var(--ink); }

.qrow-q { margin: 0; font-family: var(--display); font-weight: 600; font-size: 15px; }
.qrow-a { margin: 6px 0 0; font-size: 16px; line-height: 1.5; }

.qrow-key { margin: 6px 0 0; font-size: 14px; color: var(--soft); }
.qrow-key b { color: var(--ink); }

/* Rasmli javob — o'quvchi chizib yuklagan surat. Bosilsa to'liq o'lchamda
   yangi oynada ochiladi. */
.qrow-pic {
  display: inline-block;
  max-width: 240px;
  margin-top: 6px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
}

.qrow-pic img { display: block; width: 100%; height: auto; }
.qrow-pic:hover { box-shadow: var(--pop, 3px 3px 0 var(--ink)); }

.qrow-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 2px dashed #DDDDE6;
}

.qcheck {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 7px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.qcheck input { width: 20px; height: 20px; accent-color: #1B1B23; cursor: pointer; }

.input--note { padding: 8px 12px; font-size: 14.5px; border-width: 2px; border-radius: 10px; }

/* Ochiq savolga yulduzcha (1–5). Belgilar teskari tartibda yozilgan va
   row-reverse bilan 1→5 bo'lib turadi: tanlangan yulduzcha va undan
   chapdagilar `~` bilan yonadi. */
.stars-pick { flex: none; display: inline-flex; flex-direction: row-reverse; align-items: center; }
.stars-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.stars-pick label { padding: 0 2px; font-size: 26px; line-height: 1; color: #D9D3C3; cursor: pointer; transition: color .12s, transform .12s; }
.stars-pick input:checked ~ label:not(.stars-none) { color: #F2A93B; }
.stars-pick label:not(.stars-none):hover,
.stars-pick label:hover ~ label:not(.stars-none) { color: #F2A93B; transform: scale(1.12); }
.stars-pick input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.stars-pick .stars-none { margin-right: 4px; font-size: 18px; font-weight: 800; color: #B9B2A2; }
.stars-pick .stars-none:hover { color: #D6263F; transform: none; }
.stars-pick input:checked + .stars-none { color: var(--ink); }

.save-bar {
  position: sticky;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  background: #F0D3A4;
  border: var(--edge) solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--pop, var(--drop) var(--drop) 0 var(--ink));
}

.save-bar p { margin: 0; font-size: 15px; }

/* --- Natijalarim: bosqichlar qatori --------------------------------------- */

.stage-rows { margin: 0; padding: 14px 18px; list-style: none; display: grid; gap: 10px; }

.stage-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 11px 14px;
  background: #F7F7FB;
  border: 2px solid #E2E2EA;
  border-radius: 14px;
}

.stage-row.is-done { background: var(--paper); border-color: var(--ink); }

.stage-row-emoji { font-size: 22px; line-height: 1; }

.stage-row-name { flex: 0 0 150px; line-height: 1.2; }
.stage-row-name b { display: block; font-size: 15px; }
.stage-row-name i { color: var(--soft); font-size: 13px; font-style: normal; }

.meter {
  flex: 1 1 110px;
  height: 14px;
  min-width: 90px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}

.meter-fill { display: block; height: 100%; background: var(--c); }

.stage-row-num { font-family: var(--display); font-weight: 600; font-size: 14px; min-width: 40px; }

.stage-row-go {
  margin-left: auto;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.stage-row-go:hover { text-decoration: underline; }

/* --- Ko'rib chiqish rejimi (o'qituvchi darsni ochganda) -------------------- */

.stage-who--peek { background: #F0D3A4; }
.task-saved--peek { background: #F0D3A4; }
.start-card--peek { border-style: dashed; }

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-head h1 { font-size: 30px; }
}

@media (max-width: 640px) {
  .topbar { gap: 10px; }
  .who-text { display: none; }
  .gate { padding: 16px 16px 50px; }
  .gate-card { padding: 26px 20px 22px; }
  .gate-two,
  .roles-grid { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 6px 16px 50px; }
  .stage-row-name { flex-basis: 100%; }
  .stage-row-go { margin-left: 0; }
  .qrow-tools { flex-direction: column; align-items: stretch; }
  .stars-pick { align-self: flex-start; }
  .save-bar { border-radius: 20px; }
  .save-bar .btn { width: 100%; text-align: center; }
}

/* ==========================================================================
   SIRLI SAYYORA — fazo ekrani
   Butun sahifa qorong'i fazoga aylanadi: yulduzlar, tumanlik va sayyora.
   Bu faqat shu ijodiy topshiriqda ishlaydi (`body.space`), qolgan darslar
   o'sha yorug' ko'rinishida qoladi.
   ========================================================================== */

body.space {
  background:
    radial-gradient(120% 85% at 80% 8%, rgba(129, 74, 236, .40), transparent 58%),
    radial-gradient(95% 70% at 8% 92%, rgba(28, 152, 216, .32), transparent 60%),
    linear-gradient(180deg, #090819 0%, #14113A 52%, #090819 100%);
  background-attachment: fixed;
  color: #ECE9FF;
}


/* Yulduzlar: ikki qatlam, har biri boshqa zichlikda — chuqurlik hissi
   shundan. Bittasi sekin miltillaydi. */
body.space::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(1.7px 1.7px at 38px 52px, rgba(255, 255, 255, .95), transparent),
    radial-gradient(1.2px 1.2px at 152px 24px, rgba(214, 226, 255, .8), transparent),
    radial-gradient(1.9px 1.9px at 96px 158px, rgba(255, 255, 255, .9), transparent),
    radial-gradient(1.1px 1.1px at 214px 116px, rgba(200, 214, 255, .7), transparent),
    radial-gradient(1.4px 1.4px at 268px 196px, rgba(255, 255, 255, .8), transparent);
  background-size: 300px 240px;
  animation: star-twinkle 6s ease-in-out infinite;
}

body.space::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .55;
  background-image:
    radial-gradient(1px 1px at 60px 90px, rgba(255, 255, 255, .75), transparent),
    radial-gradient(1.3px 1.3px at 180px 40px, rgba(190, 210, 255, .7), transparent),
    radial-gradient(1px 1px at 120px 190px, rgba(255, 255, 255, .6), transparent);
  background-size: 190px 230px;
}

@keyframes star-twinkle {
  50% { opacity: .55; }
}

/* Sayyora — o'ng pastda, ekran chetidan chiqib turadi. */
body.space .screen::before {
  content: "";
  position: fixed;
  right: -140px;
  bottom: -180px;
  z-index: -1;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 34% 28%, #7C6BE0, #33246E 60%, #150F35);
  box-shadow:
    inset -26px -20px 70px rgba(0, 0, 0, .6),
    0 0 110px rgba(129, 74, 236, .40);
}

/* Topshiriq kartochkasi — shaffof "boshqaruv paneli". */
body.space .task {
  background: rgba(23, 20, 56, .74);
  border-color: #6E5BD8;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 26px 80px rgba(0, 0, 0, .55);
  backdrop-filter: blur(7px);
}

body.space .task-eyebrow {
  background: rgba(129, 74, 236, .32);
  border-color: #8A78F0;
  color: #EDE9FF;
}

body.space .task-title { color: #F6F3FF; text-shadow: 0 0 26px rgba(150, 110, 255, .5); }
body.space .task-lead { color: #BDB5EA; }
body.space .task-hint { color: #9A92C9; }
body.space .task-saved { background: rgba(129, 74, 236, .25); border-color: #8A78F0; color: #EDE9FF; }

/* Pastdagi qatordagi tugmalar qorong'ida ham ko'rinsin. */
body.space .btn--ghost { background: rgba(255, 255, 255, .92); }
body.space .btn:not(.btn--ghost) { background: #7C4DEE; border-color: #C6B6FF; }

/* Yuqori qatordagi havolalar va nishonlar — qorong'i fonda o'qilsin. */
body.space .back,
body.space .stage-who {
  background: rgba(23, 20, 56, .8);
  border-color: #8A78F0;
  color: #EDE9FF;
}

body.space .rail-label { color: #A79FD6; }
body.space .rail-step.is-current .rail-label { color: #F6F3FF; }

body.space .rail-dot {
  background: rgba(23, 20, 56, .85);
  border-color: #8A78F0;
  color: #EDE9FF;
}

body.space .rail-step.is-done .rail-dot { background: #7C4DEE; border-color: #C6B6FF; }
body.space .rail-step.is-current .rail-dot { background: #C6B6FF; border-color: #F6F3FF; color: #1B1B23; }
body.space .rail::before,
body.space .rail-step::before { background: rgba(198, 182, 255, .35); }

/* --- Mavjudot pasporti ----------------------------------------------------- */

.pass { display: flex; flex: 1; flex-direction: column; min-height: 0; }

.pass-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  margin-top: 12px;
  padding: 16px 18px 18px;
  background: rgba(255, 253, 248, .07);
  border: 2px solid rgba(198, 182, 255, .5);
  border-radius: 22px;
}

.pass-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 2px dashed rgba(198, 182, 255, .35);
  font-family: var(--display);
}

.pass-seal {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: rgba(129, 74, 236, .35);
  border: 2px solid #A08EF5;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}

.pass-head b { font-size: 20px; letter-spacing: .3px; color: #F6F3FF; }
.pass-head i { margin-left: auto; font-style: normal; font-size: 13px; color: #A79FD6; }

.pass-body {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  flex: 1;
  gap: 20px;
  min-height: 0;
}

/* --- Surat uchun joy ------------------------------------------------------- */

.shot { display: flex; flex-direction: column; min-height: 0; }

.shot-slot {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 200px;
  overflow: hidden;
  background: rgba(10, 8, 30, .55);
  border: 3px dashed #8A78F0;
  border-radius: 18px;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease;
}

.shot-slot:hover { border-color: #C6B6FF; background: rgba(129, 74, 236, .18); }
.shot.has-pic .shot-slot { border-style: solid; padding: 0; }

/* `.shot img` (galereya surati) uslubi bu yerga o'tib ketmasin: u rasmga
   qalin ramka va qat'iy balandlik beradi. */
.shot-pic,
.shot .shot-pic { width: 100%; height: 100%; object-fit: contain; border: 0; border-radius: 0; }
.shot-pic[hidden] { display: none; }

.shot-hint {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px;
  text-align: center;
  color: #C9C1F2;
}

.shot-hint b { font-size: 40px; line-height: 1; }
.shot-hint > span { font-family: var(--display); font-weight: 600; font-size: 16px; color: #EDE9FF; }
.shot-hint i { font-style: normal; font-size: 13px; line-height: 1.4; max-width: 24ch; }

.shot.has-pic .shot-hint { display: none; }

/* Rasm qo'yilgach — "boshqasini tanlash" eslatmasi pastda paydo bo'ladi. */
.shot-again {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: none;
  padding: 6px 13px;
  background: rgba(10, 8, 30, .82);
  border: 2px solid #A08EF5;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  color: #EDE9FF;
}

.shot.has-pic .shot-again { display: block; }

/* JS bor — fayl tugmasi yashiriladi, butun ramka bosiladigan joy bo'ladi.
   JS yo'q bo'lsa tugma ko'rinib turadi va rasm oddiy yo'l bilan tanlanadi. */
.shot.is-live .shot-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.shot-input { margin-top: 10px; color: #C9C1F2; }

.shot--bad .shot-slot { border-color: #FF8A9B; }

/* --- Pasport qatorlari ----------------------------------------------------- */

/* Ikki ustun: nomi tepada butun kenglikda, qolgan to'rtta savol 2×2 bo'lib.
   Bitta ustunga tizilsa ular ekranga sig'may, ro'yxat aylanadigan bo'lib
   qolardi — to'liq ekranli topshiriqda buni sezmay qolish oson. */
.pass-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  min-height: 0;
}

.pass-rows .prow:first-child { grid-column: 1 / -1; }

.prow {
  padding: 9px 13px 11px;
  background: rgba(10, 8, 30, .45);
  border: 2px solid var(--c);
  border-radius: 14px;
}

.prow > label {
  display: block;
  margin-bottom: 5px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--c);
}

.prow .input {
  background: rgba(255, 253, 248, .95);
  border: 2px solid transparent;
  border-radius: 10px;
  font-size: 15px;
}

.prow .input:focus { border-color: var(--c); box-shadow: 0 0 0 4px rgba(198, 182, 255, .25); }
.prow--bad { border-color: #FF8A9B; }

@media (max-width: 900px) {
  .pass-body { grid-template-columns: minmax(0, 1fr); }
  .shot-slot { min-height: 200px; }
  .pass-rows { overflow: visible; }
  body.space .screen::before { width: 320px; height: 320px; right: -110px; bottom: -130px; }
}


/* ==========================================================================
   HAYVONLAR — 5-mavzu bilan kelgan maketlar
   Izlar, pasportlar, kuzatish jadvali, tiriklik siri, sirli laboratoriya,
   xotira o'yini, zoologik qulf, qutqarish missiyasi va detektiv papkasi.
   Nomlari umumiy: boshqa mavzu ham shu maketlarni ishlata oladi.
   ========================================================================== */

/* --- Izlar: surat va lupa -------------------------------------------------- */

.trail {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr);
  gap: 26px;
  align-items: start;
}

.trail-map { position: relative; margin: 0; }

.trail-map img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 300px);
  object-fit: cover;
  border: var(--edge) solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--pop, 6px 6px 0 var(--ink));
}

.has-lens img { cursor: zoom-in; touch-action: pinch-zoom; }

.trail-tip { margin: 12px 0 0; font-size: 13.5px; color: var(--soft); }
.trail-map:not(.has-lens) .trail-tip { display: none; }

/* Lupa: oq hoshiyali dumaloq oyna va jigarrang dasta. */
.lens {
  position: absolute;
  z-index: 3;
  width: 170px;
  height: 170px;
  background-color: #FFFFFF;
  background-repeat: no-repeat;
  border: 5px solid #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ink), 0 12px 30px rgba(14, 28, 24, .35);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}

.lens::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -20px;
  width: 52px;
  height: 16px;
  background: #8A5A2B;
  border: 2px solid var(--ink);
  border-radius: 8px;
  transform: rotate(45deg);
}

.lens.is-on { opacity: 1; transform: none; }

.trail-side { display: flex; flex-direction: column; min-width: 0; }

.trail-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

/* Keng ekranda hayvon bitta qatorda: belgi, nomi va izi, raqamlar. Tor
   ekranda raqamlar ikkinchi qatorga tushadi (pastdagi media-blok). */
.track {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto 24px;
  grid-template-areas: "emoji text picks mark";
  gap: 8px 12px;
  align-items: center;
  padding: 11px 14px 12px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: 4px 4px 0 rgba(27, 27, 35, .16);
  animation: pop-in .4s cubic-bezier(.2, .8, .3, 1) backwards;
  animation-delay: calc(var(--i, 0) * 60ms);
  transition: background-color .2s ease, border-color .2s ease;
}

.track.is-answered { background: #F3F8EE; }
.track--bad { border-color: #D6263F; background: #FFF3F4; }

.track-emoji {
  grid-area: emoji;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  background: #EAF2E3;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 27px;
  line-height: 1;
}

.track-text { grid-area: text; min-width: 0; }
.track-text b { display: block; font-size: 19px; }
.track-text i { display: block; font-style: normal; font-size: 14.5px; line-height: 1.35; color: var(--soft); }

.track-mark { grid-area: mark; font-size: 20px; font-weight: 700; text-align: center; }

.track-picks { grid-area: picks; display: flex; gap: 7px; }

.track-no {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: color-mix(in srgb, var(--pick) 20%, #FFFFFF);
  border: 2px solid var(--pick);
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.track-no:hover { transform: translateY(-2px); }

.track-no:has(.pick-input:checked) {
  background: var(--pick);
  border-color: var(--ink);
  box-shadow: var(--pop, 3px 3px 0 var(--ink));
  color: #FFFFFF;
  transform: scale(1.1);
}

.track-no:has(.pick-input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }

.track.is-right { border-color: #2E9E4B; background: #E8FBEA; }
.track.is-wrong { border-color: #D6263F; background: #FFF3F4; }
.track.is-shown { border-color: #C79A08; background: #FFF6D6; }
.track.is-right .track-mark { color: #2E9E4B; }
.track.is-wrong .track-mark { color: #D6263F; }

/* --- Hayvon pasportlari ---------------------------------------------------
   4-slayddagi pasportlarning o'zi: qog'oz rangi, gerb, raqam, dalillar va
   pastda shtrix-kod. Rang `--paper` / `--line` orqali har biriga alohida.
   -------------------------------------------------------------------------- */

.ppgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.pp {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, transparent 0 9px,
      color-mix(in srgb, var(--line) 6%, transparent) 9px 10px),
    var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
  animation: pop-in .45s cubic-bezier(.2, .8, .3, 1) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.pp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: color-mix(in srgb, var(--line) 14%, var(--paper));
  border-bottom: 2px solid var(--line);
}

.pp-globe { font-size: 22px; line-height: 1; }
.pp-title { min-width: 0; line-height: 1.05; }
.pp-title b {
  display: block;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--line);
}
.pp-title i {
  display: block;
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--soft);
}
.pp-mark { margin-left: auto; font-size: 20px; line-height: 1; }

.pp-body {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  flex: 1;
  gap: 10px;
  padding: 10px;
}

.pp-photo {
  display: grid;
  place-items: center;
  height: 124px;
  background: rgba(255, 255, 255, .72);
  border: 2px dashed color-mix(in srgb, var(--line) 55%, #FFFFFF);
  border-radius: 12px;
  transition: background-color .15s ease, border-color .15s ease;
}

.pp-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 4px;
  font-size: 26px;
  line-height: 1;
  text-align: center;
  color: var(--line);
}

.pp-empty i { font-style: normal; font-size: 11px; line-height: 1.2; color: var(--soft); }

.pp-photo:has(.habit) { padding: 0; border-style: solid; border-color: var(--line); background: #FFFFFF; }
.pp-photo:has(.habit) .pp-empty { display: none; }
.pp-photo.is-over { background: #FFF6D6; border-color: var(--ink); border-style: solid; }
.sort.is-picking .pp-photo { border-color: var(--ink); }

.pp-no { margin: 0 0 6px; font-size: 12px; color: var(--soft); }
.pp-no b { font-size: 15px; color: #B3261E; letter-spacing: .5px; }

.pp-clues { display: grid; gap: 4px; margin: 0; padding-left: 17px; font-size: 13px; line-height: 1.3; }
.pp-clues li::marker { color: var(--line); font-family: var(--display); font-weight: 700; }

.pp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-top: 2px dashed color-mix(in srgb, var(--line) 40%, transparent);
  font-size: 11px;
  line-height: 1.2;
  color: var(--soft);
}

.pp-foot b { color: var(--line); text-transform: uppercase; }

.pp-code {
  flex: none;
  width: 48px;
  height: 18px;
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px);
  opacity: .65;
}

/* Surat kartochkasi: patnisda — katta surat va nomi. */
.habit--photo {
  position: relative;
  flex-direction: column;
  gap: 5px;
  width: 116px;
  padding: 6px 6px 8px;
  border-radius: 16px;
  box-shadow: 3px 3px 0 rgba(27, 27, 35, .2);
}

.habit-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 11px;
}

/* Uzun nom ("Pechka ustidagi choynak") qo'shni kartaga chiqib ketmasin —
   suratning eniga sig'ib, ikki qatorga o'tadi. */
.habit--photo .habit-name {
  max-width: 100%;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.habit--photo .habit-mark { position: absolute; top: 4px; right: 6px; }

/* Pasportga tushgach — ramkani to'la egallaydi va "muhr" bo'lib bosiladi. */
.pp-photo .habit--photo {
  width: 100%;
  height: 100%;
  padding: 3px;
  gap: 2px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  animation: stamp-in .35s cubic-bezier(.2, .9, .3, 1.3);
}

.pp-photo .habit-photo { flex: 1; min-height: 0; border-radius: 8px; }
.pp-photo .habit-name { font-size: 12px; }

.pp-photo .habit--photo.is-right,
.pp-photo .habit--photo.is-wrong,
.pp-photo .habit--photo.is-shown { border: 3px solid; }

@keyframes stamp-in {
  from { opacity: .3; transform: scale(1.35) rotate(-8deg); }
}

.tray--photos .tray-body { justify-content: center; gap: 12px; }

/* --- Kuzating va taqqoslang ------------------------------------------------ */

.obs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.obs-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 10px 10px 12px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-top: 7px solid var(--line);
  border-radius: 18px;
  box-shadow: 4px 4px 0 rgba(27, 27, 35, .16);
  animation: pop-in .45s cubic-bezier(.2, .8, .3, 1) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.obs-pic { position: relative; margin: 0; }

.obs-pic img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 12px;
}

.obs-pic figcaption {
  position: absolute;
  left: 7px;
  bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
}

.obs-pic figcaption b {
  padding: 1px 7px;
  background: var(--line);
  border-radius: 999px;
  color: #FFFFFF;
  font-size: 11.5px;
}

.obs-cell { flex-direction: column; align-items: stretch; gap: 4px; }
.obs-q { font-family: var(--display); font-weight: 600; font-size: 13px; line-height: 1.25; color: var(--soft); }
.obs-pickrow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.obs-pickrow .drop,
.obs-pickrow .input--select { flex: 1; min-width: 0; }
.obs .drop-btn { padding: 7px 8px 7px 11px; font-size: 14px; border-radius: 12px; }
.obs .slot-mark { width: 18px; font-size: 16px; }

.discuss {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
  padding: 14px 18px;
  background: #EAF3F8;
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
}

.discuss-head { margin: 0 0 8px; font-family: var(--display); font-weight: 600; font-size: 17px; }
.discuss ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.discuss li { position: relative; padding-left: 26px; font-size: 14.5px; line-height: 1.35; }
.discuss li::before { content: var(--discuss-mark, "🐾"); position: absolute; top: 0; left: 0; font-size: 14px; }
.discuss-note .field { margin-bottom: 0; }

/* --- Tiriklikning siri: hayvonlar uyasi va sirli kartalar ------------------ */

.nest {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.nest-cell {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: 4px 4px 0 rgba(27, 27, 35, .16);
  animation: pop-in .45s cubic-bezier(.2, .8, .3, 1) backwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}

.nest-pic { display: flex; flex-direction: column; margin: 0; }

.nest-pic img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 166 / 140;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 12px;
}

.nest-pic figcaption {
  margin-top: 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  text-align: center;
}

.nest-drop {
  display: grid;
  place-items: center;
  min-height: 128px;
  padding: 6px;
  border: 2px dashed rgba(27, 27, 35, .3);
  border-radius: 14px;
  transition: background-color .15s ease, border-color .15s ease;
}

.nest-empty { font-size: 13px; line-height: 1.35; text-align: center; color: var(--soft); }
.nest-drop:has(.habit) { padding: 0; border-color: transparent; }
.nest-drop:has(.habit) .nest-empty { display: none; }
.nest-drop.is-over { background: #FFF6D6; border-color: var(--ink); border-style: solid; }
.sort.is-picking .nest-drop { border-color: var(--ink); }

.habit--secret {
  position: relative;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 196px;
  padding: 8px 10px 10px;
  border-radius: 16px;
  box-shadow: 3px 3px 0 rgba(27, 27, 35, .2);
}

.secret-badge {
  align-self: flex-start;
  padding: 1px 9px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 12px;
}

.secret-pic {
  display: block;
  width: 100%;
  height: 62px;
  object-fit: cover;
  background: #FFFFFF;
  border: 2px solid rgba(27, 27, 35, .15);
  border-radius: 10px;
}

.habit--secret .habit-name { white-space: normal; font-size: 13px; line-height: 1.3; }
.habit--secret .habit-mark { position: absolute; top: 8px; right: 10px; font-size: 17px; }

.nest-drop .habit--secret { width: 100%; animation: stamp-in .35s cubic-bezier(.2, .9, .3, 1.3); }
.nest-drop .secret-pic { height: 40px; }

.tray--secrets .tray-body { justify-content: center; gap: 10px; }

/* --- Sirli laboratoriya ----------------------------------------------------- */

.lab-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }

.lab-no,
.lab-stars {
  flex: none;
  padding: 6px 15px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
}

.lab-no { background: var(--c); }
.lab-stars { background: #FFF3C4; }

.lab-bar {
  flex: 1;
  height: 16px;
  overflow: hidden;
  background: #E3E9DF;
  border: 2px solid var(--ink);
  border-radius: 999px;
}

.lab-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(135deg, #63B46B 0 10px, #4F9D5B 10px 20px);
  transition: width .5s cubic-bezier(.2, .8, .3, 1);
}

.lab-deck { display: grid; align-content: start; gap: 16px; width: 100%; max-width: 920px; margin: 0 auto; }

.secret {
  min-width: 0;
  margin: 0;
  padding: 20px 22px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--pop, 6px 6px 0 var(--ink));
}

.secret--bad { border-color: #D6263F; }

/* `float` — legend fieldset chegarasiga yopishmasin, kartaning ichida
   oddiy sarlavha bo'lib tursin. */
.secret-q {
  float: left;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.3;
}

.secret-no {
  flex: none;
  margin-top: 2px;
  padding: 3px 12px;
  background: #2F6B3A;
  border-radius: 999px;
  color: #FFFFFF;
  font-size: 14px;
}

.secret-opts { display: grid; clear: both; gap: 10px; }

.secret-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: #F4F6F1;
  border: 2px solid rgba(27, 27, 35, .22);
  border-radius: 14px;
  font-size: 16.5px;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.secret-opt:hover { border-color: var(--ink); transform: translateX(3px); }

.secret-letter {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  background: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 9px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
}

.secret-opt:has(.pick-input:checked) { background: #FFF6D6; border-color: var(--ink); box-shadow: var(--pop, 3px 3px 0 var(--ink)); }
.secret-opt:has(.pick-input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.secret-opt:has(.pick-input:disabled) { cursor: default; opacity: .55; transform: none; }

/* `.secret` oldida — yopilgan variantlarning xiraligidan ustun tursin
   (`:has()` o'z argumentining og'irligini oladi). */
.secret .secret-opt.is-right { opacity: 1; background: #E1F5E3; border-color: #2E9E4B; }
.secret .secret-opt.is-wrong { opacity: 1; }
.secret-opt.is-right .secret-letter { background: #63C46D; }
.secret-opt.is-wrong { background: #FDE6E8; border-color: #D6263F; }
.secret-opt.is-wrong .secret-letter { background: #F28B95; }

.secret-open {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 14px 18px;
  background: #EAF5EA;
  border: 2px dashed #2F6B3A;
  border-radius: 16px;
}

.secret-open p { margin: 0; font-size: 16px; line-height: 1.5; }
.secret-verdict { font-size: 18px; }
.secret-next { justify-self: end; }
.secret.is-wrong .secret-open { background: #FFF2E6; border-color: #C2610C; }

/* JS bor — sirlar bittalab chiqadi, izoh esa javobdan keyin ochiladi. */
.lab.is-live .secret { display: none; }
.lab.is-live .secret.is-current { display: block; animation: lab-in .45s cubic-bezier(.2, .8, .3, 1); }
.lab.is-live .secret-open { display: none; }
.lab.is-live .secret.is-open .secret-open { display: grid; animation: unlock .5s cubic-bezier(.2, .9, .3, 1.2); }
.lab.is-review .secret { display: block; }
.lab.is-review .secret-next { display: none; }
.lab:not(.is-live) .secret-next { display: none; }

@keyframes lab-in { from { opacity: 0; transform: translateX(40px) rotate(1deg); } }
@keyframes unlock { from { opacity: 0; transform: scale(.92) translateY(-8px); } }

.lab-finish {
  padding: 26px 22px;
  background: linear-gradient(180deg, #FFF6D6, #FCE5B0);
  border: var(--edge) solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--pop, 6px 6px 0 var(--ink));
  text-align: center;
  animation: pop-in .5s cubic-bezier(.2, .8, .3, 1);
}

.lab-finish[hidden] { display: none; }
.lab-finish h2 { font-size: 30px; }
.lab-finish p { max-width: 56ch; margin: 10px auto 0; line-height: 1.5; }
.lab-cup { display: block; font-size: 64px; line-height: 1; animation: cup-hop 1.6s ease-in-out infinite; }
.lab-score b { font-family: var(--display); font-size: 26px; }

.lab-again {
  margin-top: 14px;
  padding: 9px 18px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

@keyframes cup-hop {
  0%, 100% { transform: none; }
  40% { transform: translateY(-10px) rotate(-6deg); }
  60% { transform: translateY(-4px) rotate(5deg); }
}

/* --- Xotira o'yini ---------------------------------------------------------- */

.memo-play {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(300px, 1fr);
  flex: 1;
  gap: 24px;
  align-items: start;
}

.memo-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }

.memo-stat {
  margin: 0;
  padding: 6px 14px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
}

.memo-stat b { font-family: var(--display); font-size: 16px; }

.memo-btn {
  margin-left: auto;
  padding: 7px 15px;
  background: #F2C879;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.memo-board {
  --card: clamp(78px, calc((100dvh - 440px) / 4), 128px);
  display: grid;
  grid-template-columns: repeat(4, var(--card));
  gap: 10px;
}

.memo-card {
  width: var(--card);
  aspect-ratio: 1;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  perspective: 800px;
  transition: transform .15s ease;
}

.memo-card:not(.is-open):hover { transform: translateY(-3px); }
.memo-card:disabled { cursor: default; }
.memo-card:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 14px; }

.memo-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.3, 1.3, .5, 1);
}

.memo-card.is-open .memo-inner { transform: rotateY(180deg); }

.memo-back,
.memo-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--pop, 3px 3px 0 var(--ink));
  backface-visibility: hidden;
}

.memo-face { transform: rotateY(180deg); }

.memo-back img,
.memo-face img { display: block; width: 100%; height: 100%; object-fit: cover; }

.memo-tag {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 0 5px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  line-height: 1.4;
}

.memo-card.is-matched .memo-face { border-color: #2E9E4B; box-shadow: 0 0 0 3px #9EE0A6, 3px 3px 0 var(--ink); }
.memo-card.is-matched { animation: memo-hop .55s cubic-bezier(.3, 1.4, .5, 1); }
.memo-card.is-miss .memo-face { border-color: #D6263F; box-shadow: 0 0 0 3px #F7A8B1, 3px 3px 0 var(--ink); }
.memo-card.is-miss { animation: memo-shake .4s ease; }

@keyframes memo-hop {
  40% { transform: translateY(-12px) scale(1.06); }
}

@keyframes memo-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* JS bo'lmasa kartalar ochilmaydi — ularni ko'rsatishning ma'nosi yo'q.
   Mazmun albomda havola bo'lib qoladi. */
.memo:not(.is-live) .memo-board,
.memo:not(.is-live) .memo-top { display: none; }

.memo-win {
  margin: 14px 0 0;
  padding: 10px 16px;
  background: #CFE5B4;
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-family: var(--display);
  font-weight: 600;
  animation: pop-in .45s cubic-bezier(.2, .8, .3, 1);
}

.memo-win[hidden] { display: none; }

.memo-album {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background: #F4F1E7;
  border: var(--edge) solid var(--ink);
  border-radius: 20px;
}

.memo-album-head { margin: 0; font-family: var(--display); font-weight: 600; font-size: 17px; }

.album {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 118px));
  gap: 10px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.album-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--ink);
  font-size: 11.5px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.album-pic {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 12px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.album-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }

.album-lock {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: repeating-linear-gradient(45deg, #DCE3D8 0 10px, #E8EDE4 10px 20px);
  color: rgba(22, 48, 44, .45);
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
}

.album-item.is-locked { cursor: not-allowed; }
.album-item.is-locked .album-lock { display: grid; }
.album-item.is-locked .album-name { opacity: .5; }
.album-item:not(.is-locked):hover .album-pic { transform: translateY(-2px); box-shadow: var(--pop, 3px 3px 0 var(--ink)); }
.album-item.is-shake { animation: memo-shake .4s ease; }
.album-item:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 12px; }

.memo-note .field { margin-bottom: 0; }

/* Plakat oynasi */
.poster {
  width: min(1100px, 96vw);
  max-width: none;
  max-height: 94dvh;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
}

.poster::backdrop { background: rgba(14, 28, 24, .72); backdrop-filter: blur(3px); }
.poster[open] .poster-card { animation: poster-in .45s cubic-bezier(.2, .9, .3, 1.15); }

@keyframes poster-in { from { opacity: 0; transform: scale(.85) rotate(-2deg); } }

.poster-card {
  display: flex;
  flex-direction: column;
  max-height: 94dvh;
  overflow: hidden;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--pop, 8px 8px 0 var(--ink));
}

.poster-head {
  position: relative;
  padding: 12px 64px 10px 20px;
  background: #FFF3C4;
  border-bottom: 2px solid var(--ink);
}

.poster-eyebrow { margin: 0 0 2px; font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--soft); }
.poster-head h2 { font-size: clamp(19px, 2.2vw, 25px); }

.poster-x {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}

.poster-view {
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
  background: #EEF2EA;
}

.poster-view img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(94dvh - 200px);
  border-radius: 10px;
  cursor: zoom-in;
}

.poster-view.is-zoom { place-items: start; }
.poster-view.is-zoom img { width: 1500px; max-width: none; max-height: none; cursor: zoom-out; }

.poster-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 18px;
  border-top: 2px solid var(--ink);
}

.poster-fact { flex: 1; min-width: 260px; margin: 0; font-size: 15px; line-height: 1.4; }
.poster-zoom { font-size: 12.5px; color: var(--soft); }

/* --- Hayvon pasporti (yorug' "tabiat" ko'rinishi) -------------------------- */

.pass--wild .pass-card {
  position: relative;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(207, 229, 180, .7), transparent 60%),
    linear-gradient(180deg, #F5F9EF, #EAF2E0);
  border: var(--edge) solid var(--ink);
  box-shadow: var(--pop, 5px 5px 0 var(--ink));
}

.pass--wild .pass-head { border-bottom-color: rgba(47, 107, 58, .35); }
.pass--wild .pass-seal { background: #CFE5B4; border-color: #2F6B3A; }
.pass--wild .pass-head b { color: #2F6B3A; letter-spacing: 1px; text-transform: uppercase; }
.pass--wild .pass-head i { color: #5E7A5A; font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase; }

.pass--wild .shot-slot { background: #FFFFFF; border-color: #7FB77E; }
.pass--wild .shot-slot:hover { background: #F4FBEF; border-color: #2F6B3A; }
.pass--wild .shot-hint { color: var(--soft); }
.pass--wild .shot-hint > span { color: var(--ink); }
.pass--wild .shot-again { background: var(--paper); border-color: #2F6B3A; color: var(--ink); }
.pass--wild .shot-input { color: var(--soft); }

/* Sakkizta qator uch ustunda: 3 + 3 + 2. Oxirgisi ikki ustunni oladi —
   ikki ustunda ular ekranga sig'may, ichki aylantirishga tushib qolardi. */
.pass--wild .pass-rows { grid-template-columns: repeat(3, minmax(0, 1fr)); overflow-y: auto; padding: 2px 4px 4px 2px; }
.pass--wild .pass-rows .prow:first-child { grid-column: auto; }
.pass--wild .pass-rows .prow:last-child { grid-column: span 2; }

.pass--wild .prow { background: #FFFFFF; }
.pass--wild .prow > label { color: color-mix(in srgb, var(--c) 62%, #16302C); }
.pass--wild .prow .input { background: #F6F9F2; border-color: rgba(22, 48, 44, .14); }
.pass--wild .prow .input:focus { box-shadow: 0 0 0 4px rgba(127, 183, 126, .3); }
.pass--wild .prow--bad { border-color: #D6263F; }

/* --- Zoologik qulf ---------------------------------------------------------- */

.lock-row {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 14px;
  padding: 14px 22px;
  background: linear-gradient(135deg, #FFF6D6, #FCE5B0);
  border: var(--edge) solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
}

.padlock { position: relative; flex: none; width: 214px; height: 150px; }

.padlock-shackle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 118px;
  height: 84px;
  margin-left: -59px;
  border: 15px solid #9AA4AF;
  border-bottom: 0;
  border-radius: 60px 60px 0 0;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45);
  outline: 2px solid var(--ink);
  outline-offset: -2px;
  transform-origin: 88% 100%;
  transition: transform .5s cubic-bezier(.3, 1.5, .5, 1);
}

.padlock-body {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 98px;
  background: linear-gradient(180deg, #F7C95A, #DE9E1C);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
}

.padlock-dials { display: flex; gap: 6px; }

.dial {
  display: grid;
  place-items: center;
  width: 38px;
  height: 46px;
  overflow: hidden;
  background: linear-gradient(180deg, #34504B, #16302C 45%, #34504B);
  border: 2px solid var(--ink);
  border-radius: 9px;
  transition: box-shadow .2s ease;
}

.dial i { font-style: normal; font-family: var(--display); font-weight: 700; font-size: 23px; color: #CFC6A6; }
.dial.is-set i { color: #FFFFFF; }
.dial.is-set { box-shadow: 0 0 0 2px #FFF3C4; }
.dial.is-spin i { animation: dial-spin .55s cubic-bezier(.2, .8, .3, 1.3); }

@keyframes dial-spin {
  0%  { opacity: 0; transform: translateY(-140%); }
  60% { opacity: 1; transform: translateY(18%); }
}

.padlock-paw { font-size: 15px; line-height: 1; }

.padlock.is-coded .padlock-shackle { transform: translateY(-16px) rotate(-14deg); }
.padlock.is-coded .padlock-body { animation: lock-wiggle .5s ease; }

@keyframes lock-wiggle {
  30% { transform: rotate(-4deg); }
  60% { transform: rotate(3deg); }
}

.lock-side { display: flex; flex: 1; flex-direction: column; gap: 10px; min-width: 0; }
.lock-note { margin: 0; font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 1.35; }
.lock-side .tally { align-self: flex-start; margin: 0; }

.lockq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.lockq { position: relative; padding-right: 116px; background: color-mix(in srgb, var(--c) 45%, #FFFFFF); }
.lockq .qcard-no { background: var(--c); }

.lockq-pic {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 92px;
  height: 92px;
  object-fit: contain;
  background: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 3px 3px 0 rgba(27, 27, 35, .2);
}

/* --- Qutqarish missiyasi ---------------------------------------------------- */

.rescue-scene {
  position: relative;
  height: clamp(170px, 31dvh, 310px);
  margin: 0 0 12px;
  overflow: hidden;
  background: #CFE3C2;
  border: var(--edge) solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--pop, 5px 5px 0 var(--ink));
}

.rescue-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.07);
  transition: opacity .8s ease, transform 1.6s cubic-bezier(.2, .8, .3, 1);
}

.rescue-shot.is-on { opacity: 1; transform: none; }
.rescue-shot--wide { object-position: center 62%; }

.rescue-problem {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  margin: 0;
  padding: 9px 14px;
  background: rgba(248, 250, 246, .94);
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  transition: opacity .35s ease, transform .35s ease;
}

.rescue-scene.is-result .rescue-problem { opacity: 0; transform: translateY(24px); }

.rescue-verdict {
  position: absolute;
  bottom: 14px;
  left: 50%;
  max-width: calc(100% - 28px);
  margin: 0;
  padding: 10px 20px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  text-align: center;
  transform: translateX(-50%);
  animation: verdict-in .5s cubic-bezier(.2, .9, .3, 1.3) .35s backwards;
}

.rescue-verdict[hidden] { display: none; }
[data-outcome="all"] .rescue-verdict { background: #CFE5B4; }
[data-outcome="some"] .rescue-verdict { background: #FFF3C4; }
[data-outcome="bad"] .rescue-verdict { background: #FFD3D3; }

@keyframes verdict-in { from { opacity: 0; transform: translate(-50%, 20px) scale(.9); } }

.rescue-bit {
  position: absolute;
  top: -34px;
  z-index: 2;
  pointer-events: none;
  animation: bit-fall 2.4s ease-in forwards;
}

@keyframes bit-fall {
  to { opacity: 0; transform: translateY(330px) rotate(260deg); }
}

.needs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.needs--bad .need { border-color: #D6263F; }

.need {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 rgba(27, 27, 35, .18);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease,
              opacity .3s ease, filter .3s ease;
  animation: pop-in .4s cubic-bezier(.2, .8, .3, 1) backwards;
  animation-delay: calc(var(--i, 0) * 35ms);
}

.need-input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.need-pic { display: block; aspect-ratio: 240 / 104; }
.need-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }

.need-name {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 8px;
  padding: 7px 9px;
  border-top: 2px solid var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.2;
}

.need-box {
  display: grid;
  place-items: center;
  flex: none;
  width: 21px;
  height: 21px;
  background: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 6px;
  color: #FFFFFF;
  font-style: normal;
  font-size: 13px;
}

.need:hover { transform: translateY(-2px); }

.need:has(.need-input:checked) {
  background: #E3F6E4;
  box-shadow: 0 0 0 3px #9ED79F, 3px 3px 0 var(--ink);
  transform: translateY(-2px);
}

.need:has(.need-input:checked) .need-box { background: #2F8F46; }
.need:has(.need-input:checked) .need-box::after { content: "✓"; font-weight: 700; }
.need:has(.need-input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }

.rescue.is-launched .need { pointer-events: none; }
.rescue.is-launched .need:not(:has(.need-input:checked)) { opacity: .4; filter: grayscale(.7); }

.rescue-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 12px 0 2px; }

.rescue-count {
  margin: 0;
  padding: 6px 14px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
}

.rescue-count b { font-family: var(--display); font-size: 16px; }
.rescue-bar .btn { margin-left: auto; }
.rescue-bar .btn[hidden] { display: none; }

.btn--launch { background: #F08A3C; color: var(--ink); }
.btn--launch:disabled { opacity: .45; cursor: not-allowed; transform: none; }


/* --- Zoologik detektiv ------------------------------------------------------ */

.case {
  display: grid;
  grid-template-columns: minmax(270px, 350px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.case-file {
  position: sticky;
  top: 14px;
  /* Yashirin muhr 1.8× kattalashib turadi — telefonda sahifani kengaytirmasin.
     `clip` scroll konteyner yaratmaydi, shuning uchun sticky ishlayveradi. */
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: #EFE2C4;
  border: var(--edge) solid var(--ink);
  border-radius: 6px 20px 20px 20px;
  box-shadow: var(--pop, 5px 5px 0 var(--ink));
}

.case-tab {
  align-self: flex-start;
  margin: 0;
  padding: 4px 12px;
  background: #DCC594;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
}

.case-tab b { color: #B3261E; letter-spacing: 1px; text-transform: uppercase; }

.case-photo {
  position: relative;
  margin: 6px 4px 0;
  padding: 8px 8px 32px;
  background: #FFFFFF;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(27, 27, 35, .25);
  transform: rotate(-1.5deg);
}

/* Yopishqoq lenta */
.case-photo::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  z-index: 1;
  width: 84px;
  height: 22px;
  margin-left: -42px;
  background: rgba(255, 236, 170, .88);
  border: 1px solid rgba(0, 0, 0, .12);
  transform: rotate(3deg);
}

.case-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }

.case-tag {
  position: absolute;
  right: 0;
  bottom: 6px;
  left: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  text-align: center;
}

.case-stamp {
  position: absolute;
  top: 40%;
  left: 50%;
  padding: 6px 12px;
  background: rgba(255, 255, 255, .78);
  border: 4px solid #B3261E;
  border-radius: 8px;
  color: #B3261E;
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-14deg) scale(1.8);
  transition: opacity .3s ease, transform .35s cubic-bezier(.2, .9, .3, 1.4);
}

.is-solved .case-stamp { opacity: 1; transform: translate(-50%, -50%) rotate(-14deg) scale(1); }

.case-clues {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-clue {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, .5);
  border: 2px dashed rgba(22, 48, 44, .35);
  border-radius: 10px;
  font-size: 12.5px;
  transition: background-color .25s ease, border-color .25s ease;
}

.case-clue b { font-weight: 600; font-size: 12.5px; }
.case-clue i { margin-left: auto; font-style: normal; font-weight: 700; color: #2E7D44; opacity: 0; }
.case-clue.is-on { background: var(--c); border-style: solid; border-color: var(--ink); }
.case-clue.is-on i { opacity: 1; }

.case-file .tally { align-self: flex-start; margin: 0; }

.case-qs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.caseq { background: color-mix(in srgb, var(--c) 32%, #FFFFFF); }
.caseq .qcard-no { background: var(--c); }

.caseq-clue {
  display: block;
  margin-bottom: 2px;
  color: var(--soft);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.case-verdict {
  grid-column: 1 / -1;
  padding: 14px 16px;
  background: #FFF3C4;
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: 4px 4px 0 rgba(27, 27, 35, .16);
}

.case-verdict > label { display: block; margin-bottom: 8px; font-family: var(--display); font-weight: 600; font-size: 17px; }
.case-verdict--bad .input { border-color: #D6263F; }

/* --- Rangli test kartalari --------------------------------------------------- */

.qcard--ink { background: color-mix(in srgb, var(--c) 34%, var(--paper)); }
.qcard-emoji { font-size: 18px; }

/* --- Moslashuvchanlik -------------------------------------------------------- */

@media (max-width: 1280px) {
  .track {
    grid-template-columns: 50px minmax(0, 1fr) 24px;
    grid-template-areas:
      "emoji text  mark"
      "picks picks picks";
  }
  .track-picks { padding-left: 62px; }
}

@media (max-width: 1100px) {
  .obs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .needs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-qs { grid-template-columns: minmax(0, 1fr); }
  .pass--wild .pass-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pass--wild .pass-rows .prow:last-child { grid-column: auto; }
}

@media (max-width: 900px) {
  .trail { grid-template-columns: minmax(0, 1fr); }
  .trail-map img { max-height: none; }
  .memo-play { grid-template-columns: minmax(0, 1fr); }
  .memo-board { --card: calc((100vw - 110px) / 4); justify-content: center; }
  .lockq-grid { grid-template-columns: minmax(0, 1fr); }
  .case { grid-template-columns: minmax(0, 1fr); }
  .case-file { position: static; }
  .discuss { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .ppgrid { grid-template-columns: minmax(0, 1fr); }
  .obs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .needs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nest { grid-template-columns: minmax(0, 1fr); }
  .track-picks { justify-content: space-between; padding-left: 0; }
  .lock-row { flex-direction: column; align-items: stretch; text-align: center; }
  .padlock { align-self: center; transform: scale(.85); }
  .lockq { padding-top: 112px; padding-right: 13px; }
  .lockq-pic { right: auto; left: 50%; margin-left: -46px; }
  .lab-top { flex-wrap: wrap; }
  .lab-bar { flex-basis: 100%; order: 3; }
  .rescue-verdict { border-radius: 16px; font-size: 15px; }
}

/* --- Parolni ko'rsatish (ko'z tugmasi) ------------------------------------ */

.peek { position: relative; display: block; }
.peek .input { padding-right: 54px; }

/* Edge'ning o'z "ko'z" tugmasi bizniki bilan ikkita bo'lib qolmasin. */
.peek .input::-ms-reveal { display: none; }

.peek-btn {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--soft);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color .15s ease, color .15s ease;
}

.peek-btn:hover { background: rgba(22, 48, 44, .08); color: var(--ink); }
.peek-btn[aria-pressed="true"] { color: var(--ink); }
.peek-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }


/* ==========================================================================
   O'SIMLIKLAR — 4-mavzu bilan kelgan maketlar
   Nima birlashtiradi, tajriba jadvali, kitob, suratli saralash, ijodiy
   topshiriq va rasmli moslashtirish.
   ========================================================================== */

/* --- Ularni nima birlashtiradi? -------------------------------------------- */

.unite-tiles {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.unite-tile {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 132px;
  padding: 14px 10px 12px;
  background: var(--card, var(--paper));
  border: var(--edge) solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
  font-family: var(--display);
  animation:
    pop-in .45s cubic-bezier(.2, .8, .3, 1) backwards,
    unite-float 4.2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 90ms), calc(var(--i, 0) * -.7s);
}

.unite-tile b { font-size: 17px; }
.unite-emoji { font-size: 58px; line-height: 1.1; }

.unite-tile--ask {
  background: repeating-linear-gradient(45deg, #FFF6D6 0 12px, #FCEBB4 12px 24px);
  border-style: dashed;
}

/* Rasmli variant: surat ustida burchakda emoji nishonchasi. */
.unite-tile--pic { position: relative; width: 200px; padding: 8px 8px 12px; gap: 8px; }
.unite-pic {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 16px;
}
.unite-badge {
  position: absolute;
  top: -12px;
  right: -10px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--card, var(--paper));
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 24px;
}
.unite-tiles--pic .unite-tile--ask { align-self: stretch; align-content: center; width: 150px; }
.unite-tiles--pic .unite-tile--ask .unite-emoji { font-size: 72px; }

.unite-plus {
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
  color: var(--soft);
}

@keyframes unite-float {
  50% { transform: translateY(-7px) rotate(-1.5deg); }
}

.unite-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.unite-q {
  min-width: 0;
  margin: 0;
  padding: 16px 18px 18px;
  background: var(--paper);
  border: var(--edge) solid #4F9D5B;
  border-radius: 26px;
  box-shadow: 4px 4px 0 rgba(27, 27, 35, .16);
}

.unite-q.is-right { background: #F2FCF3; border-color: #2E9E4B; }
.unite-q.is-wrong { background: #FFF6F7; border-color: #D6263F; }
.unite-q.is-shown { background: #FFF6D6; border-color: #C79A08; }

.unite-ask {
  float: left;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
  padding: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
}

.unite-mark { margin-left: auto; font-size: 20px; font-weight: 700; }
.unite-q.is-right .unite-mark { color: #2E9E4B; }
.unite-q.is-wrong .unite-mark { color: #D6263F; }

.unite-opts { display: grid; clear: both; gap: 10px; }

.unite-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #F6F8F3;
  border: 2px solid rgba(27, 27, 35, .2);
  border-radius: 16px;
  font-size: 16.5px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.unite-opt:hover { border-color: var(--ink); transform: translateX(3px); }

.unite-dot {
  flex: none;
  width: 24px;
  height: 24px;
  background: color-mix(in srgb, var(--pick) 25%, #FFFFFF);
  border: 3px solid var(--pick);
  border-radius: 50%;
  transition: background-color .15s ease, box-shadow .15s ease;
}

.unite-opt:has(.pick-input:checked) {
  background: color-mix(in srgb, var(--pick) 16%, #FFFFFF);
  border-color: var(--ink);
  box-shadow: var(--pop, 3px 3px 0 var(--ink));
}

.unite-opt:has(.pick-input:checked) .unite-dot {
  background: var(--pick);
  box-shadow: inset 0 0 0 4px #FFFFFF;
}

.unite-opt:has(.pick-input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.unite-note .field { margin-bottom: 0; }

/* --- Ikki o'simlik tajribasi ------------------------------------------------ */

.labx {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.labx-plants { display: grid; gap: 12px; }

.labx-plant { position: relative; margin: 0; }

.labx-plant img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: var(--edge) solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--pop, 4px 4px 0 var(--ink));
}

.labx-plant figcaption {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
}

.labx-plant--1 figcaption { background: #CFE8B8; }
.labx-plant--2 figcaption { background: #EAD9C2; }

.labx-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: 4px 4px 0 rgba(27, 27, 35, .16);
}

.labx-table th,
.labx-table td {
  padding: 8px 10px;
  border-right: 2px solid rgba(22, 48, 44, .14);
  border-bottom: 2px solid rgba(22, 48, 44, .14);
  font-family: var(--display);
  text-align: center;
}

.labx-table thead th { background: #D9EFD0; font-weight: 600; font-size: 16px; }
.labx-table tbody th { width: 30%; background: #E2EEF7; font-weight: 600; font-size: 16px; text-align: left; }
.labx-table tr > :last-child { border-right: 0; }
.labx-table tbody tr:last-child > * { border-bottom: 0; }

.labx-cell { height: 66px; }

.labx-given,
.habit--chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
}

.labx-given { background: #EFEDE4; border-style: dashed; color: var(--soft); }

.labx-drop {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 2px dashed rgba(27, 27, 35, .25);
  border-radius: 14px;
  transition: background-color .15s ease, border-color .15s ease;
}

.labx-empty { font-family: var(--display); font-weight: 700; font-size: 20px; color: rgba(22, 48, 44, .3); }
.labx-drop:has(.habit) { border-color: transparent; }
.labx-drop:has(.habit) .labx-empty { display: none; }
.labx-drop.is-over { background: #FFF6D6; border-color: var(--ink); border-style: solid; }
.sort.is-picking .labx-drop { border-color: var(--ink); }

.habit--chip { background: #FFFFFF; box-shadow: 3px 3px 0 rgba(27, 27, 35, .18); }
.labx-drop .habit--chip { animation: stamp-in .35s cubic-bezier(.2, .9, .3, 1.3); }
.tray--chips .tray-body { justify-content: center; gap: 12px; }

.labx-note { margin-top: 14px; }
.labx-note .field { margin-bottom: 0; }

/* --- Suratli saralash (uch guruh) ------------------------------------------- */

.sort--photos .bin-body { gap: 10px; }
.sort--photos .bin .habit--photo { width: 104px; }
.sort--photos .tray-body { justify-content: center; gap: 12px; }
.sort--photos .bin .habit--photo { animation: stamp-in .35s cubic-bezier(.2, .9, .3, 1.3); }

/* --- O'simliklar kitobi ----------------------------------------------------- */

.lab--book .lab-deck { max-width: 1180px; }

/* `.lab.is-live .secret.is-current { display: block }` dan og'irroq
   bo'lishi shart — aks holda plakat va savol ustma-ust tushadi. */
.lab.is-live .secret--pic.is-current,
.lab.is-review .secret--pic,
.lab:not(.is-live) .secret--pic {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 22px;
  align-items: start;
}

.secret-poster {
  position: relative;
  display: block;
  justify-self: center;
  padding: 0;
  overflow: hidden;
  background: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 4px 4px 0 rgba(27, 27, 35, .2);
  cursor: zoom-in;
  transition: transform .2s ease, box-shadow .2s ease;
}

.secret-poster:hover { transform: rotate(-.6deg) translateY(-2px); box-shadow: 6px 6px 0 rgba(27, 27, 35, .25); }

/* Plakat ekranga sig'adi — savol uning yonida ko'rinib tursin. To'liq
   o'qish uchun bosiladi va katta oynada ochiladi. */
.secret-poster img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: max(300px, calc(100dvh - 400px));
  margin: 0 auto;
}

.secret-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 12px;
  background: rgba(248, 250, 246, .94);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
}

.secret-main { min-width: 0; }

/* --- Ijodiy topshiriq ------------------------------------------------------- */

.sort--classify > .tally { align-self: flex-end; }

.cls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.cls-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 9px 9px 11px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: 4px 4px 0 rgba(27, 27, 35, .16);
  animation: pop-in .45s cubic-bezier(.2, .8, .3, 1) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.cls-pic { position: relative; margin: 0; }

.cls-no {
  position: absolute;
  top: 6px;
  left: 6px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
}

.cls-pic img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  object-position: center 70%;
  border: 2px solid var(--ink);
  border-radius: 12px;
}

.cls-label { margin: 2px 0 0; font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--soft); }

/* `minmax(0, 1fr)` — uzun guruh nomi ("Tugamaydigan") ustunni kengaytirib,
   kartani sahifadan chiqarib yubormasin. */
.cls-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.cls-pick:last-child { grid-column: 1 / -1; }

.cls-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  text-align: center;
  overflow-wrap: anywhere;
  padding: 5px 6px;
  background: color-mix(in srgb, var(--pick) 14%, #FFFFFF);
  border: 2px solid color-mix(in srgb, var(--pick) 70%, #FFFFFF);
  border-radius: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.1;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}

.cls-pick:hover { transform: translateY(-1px); }

.cls-pick:has(.pick-input:checked) {
  background: var(--pick);
  border-color: var(--ink);
  box-shadow: var(--pop, 2px 2px 0 var(--ink));
  color: var(--ink);
}

.cls-pick:has(.pick-input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.cls-group--bad .cls-pick { border-color: #D6263F; }

.cls-drop {
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 74px;
  padding: 4px;
  border: 2px dashed rgba(27, 27, 35, .25);
  border-radius: 12px;
  transition: background-color .15s ease, border-color .15s ease;
}

.cls-empty { font-size: 12px; line-height: 1.3; text-align: center; color: var(--soft); }
.cls-drop:has(.habit) { padding: 0; border-color: transparent; }
.cls-drop:has(.habit) .cls-empty { display: none; }
.cls-drop.is-over { background: #FFF6D6; border-color: var(--ink); border-style: solid; }
.sort.is-picking .cls-drop { border-color: var(--ink); }

/* Yopishqoq qog'oz — 18-slayddagi sabab kartochkalari. */
.habit--note {
  position: relative;
  flex-direction: column;
  justify-content: center;
  width: 176px;
  min-height: 84px;
  padding: 14px 12px 12px;
  border: 2px solid rgba(27, 27, 35, .55);
  border-radius: 4px 4px 4px 18px;
  box-shadow: 3px 4px 0 rgba(27, 27, 35, .18);
  text-align: center;
  transform: rotate(calc((var(--i, 0) - 2) * 1.3deg));
}

.habit--note .habit-name { white-space: normal; font-family: var(--display); font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.habit--note .habit-mark { position: absolute; top: 5px; right: 7px; }
.note-clip { position: absolute; top: -12px; left: 12px; font-size: 20px; transform: rotate(-20deg); }

.cls-drop .habit--note { width: 100%; min-height: 66px; padding: 10px 8px 8px; transform: none; animation: stamp-in .35s cubic-bezier(.2, .9, .3, 1.3); }
.cls-drop .habit--note .habit-name { font-size: 12.5px; }
.cls-drop .note-clip { top: -10px; font-size: 16px; }
.tray--notes .tray-body { justify-content: center; gap: 16px; padding-top: 18px; }

/* --- Rasmli moslashtirish (barg detektivi) ---------------------------------- */

.match-sample {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 1040px);
  margin: 0 auto 6px;
  padding: 8px 16px 8px 8px;
  background: color-mix(in srgb, var(--c) 40%, #FFFFFF);
  border: 2px dashed var(--ink);
  border-radius: 18px;
  font-family: var(--display);
  font-size: 15px;
}

.match-sample img {
  flex: none;
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 12px;
}

.match-sample-tag {
  flex: none;
  padding: 3px 10px;
  background: var(--ink);
  border-radius: 999px;
  color: var(--paper);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.match-sample-wire {
  flex: 0 0 60px;
  height: 3px;
  background: var(--ink);
  border-radius: 3px;
}

.match-sample-text { font-weight: 600; }

.node-btn--pic { padding: 5px 16px 5px 5px; border-radius: 18px; }

.node-pic {
  flex: none;
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #FFFFFF;
  border: 2px solid rgba(27, 27, 35, .2);
  border-radius: 12px;
}

/* --- Moslashuvchanlik -------------------------------------------------------- */

@media (max-width: 1100px) {
  .cls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .unite-tile--pic { width: 160px; }
}

@media (max-width: 900px) {
  .unite-body { grid-template-columns: minmax(0, 1fr); }
  .labx { grid-template-columns: minmax(0, 1fr); }
  .labx-plants { grid-template-columns: 1fr 1fr; }
  .lab.is-live .secret--pic.is-current,
  .lab.is-review .secret--pic,
  .lab:not(.is-live) .secret--pic { grid-template-columns: minmax(0, 1fr); }
  .secret-poster img { max-height: 60dvh; }
  .match-sample-wire { display: none; }
}

@media (max-width: 640px) {
  .unite-tile { width: 92px; padding: 10px 6px; }
  .unite-emoji { font-size: 40px; }
  .unite-plus { font-size: 22px; }
  /* Rasmli belgilar telefonda ikki ustunli to'rga tushadi, "+" lar kerak emas. */
  .unite-tiles--pic { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; }
  .unite-tiles--pic .unite-plus { display: none; }
  .unite-tile--pic { width: auto; padding: 6px 6px 10px; }
  .unite-tiles--pic .unite-tile--ask { grid-column: 1 / -1; width: auto; padding: 8px; }
  .unite-tiles--pic .unite-tile--ask .unite-emoji { font-size: 40px; }
  .cls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cls-picks { grid-template-columns: minmax(0, 1fr); }
  .labx-table th, .labx-table td { padding: 6px; }
  .labx-given, .habit--chip { padding: 6px 10px; font-size: 14px; }
  .match-sample { flex-wrap: wrap; }
}

/* ==========================================================================
   NAVIGATSIYA VA TASDIQ — bola hech qayerda qotib qolmasin
   ========================================================================== */

/* Qadamlar chizig'i — har bir qadam havola. */
.rail-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: inherit;
  text-decoration: none;
}

a.rail-link .rail-dot { transition: transform .15s ease, box-shadow .15s ease; }
a.rail-link:hover .rail-dot { transform: translateY(-2px) scale(1.06); box-shadow: var(--pop, 3px 3px 0 var(--ink)); }
a.rail-link:hover .rail-label { color: var(--ink); text-decoration: underline; }
a.rail-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 10px; }

/* Saqlanmagan topshiriq — sababi tepada aniq yoziladi. */
.task-alert {
  display: grid;
  gap: 3px;
  margin: 12px 0 0;
  padding: 11px 16px;
  background: #FFF0F1;
  border: 2px solid #D6263F;
  border-radius: 14px;
  color: #8E1427;
  font-size: 15px;
  line-height: 1.4;
}

.task-alert b { font-size: 16px; }

/* O'tkazib yuborish — izoh ostida kichik havola. */
.task-skip {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  border: 2px dashed rgba(22, 48, 44, .35);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease;
}

.task-skip:hover { background: #FFF6D6; border-color: var(--ink); border-style: solid; }
.task-skip:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* Tasdiq qatori — "baribir saqlaysanmi?" */
.guard {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 16px;
  padding: 12px 14px 12px 18px;
  background: #FFF6D6;
  border: var(--edge) solid var(--ink);
  border-radius: 18px;
  box-shadow: 4px 4px 0 rgba(27, 27, 35, .2);
  animation: pop-in .3s cubic-bezier(.2, .8, .3, 1);
}

.guard[hidden] { display: none; }
.guard-text { flex: 1 1 320px; margin: 0; font-family: var(--display); font-weight: 600; font-size: 15.5px; line-height: 1.35; }
.guard-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.guard .btn { padding: 10px 18px; font-size: 15px; }

/* "Javob beraman" bosilganda — javobsiz savol bir silkinadi. */
.is-nudged { animation: nudge .6s ease; }

@keyframes nudge {
  0%, 100% { box-shadow: none; }
  20%, 60% { transform: translateX(-5px); box-shadow: 0 0 0 4px #F2C879; }
  40%, 80% { transform: translateX(5px); box-shadow: 0 0 0 4px #F2C879; }
}

/* Muqova: rasmiy balli bosqich — oltin. */
.cover-note--gold { background: #F7DFA1; }

/* Yakun: mashq bali va qolgan topshiriqlar. */
.done-practice {
  margin: 8px auto 0;
  max-width: 44ch;
  font-size: 14px;
  line-height: 1.4;
  color: var(--soft);
}

.done-missing {
  margin: 16px auto 0;
  max-width: 46ch;
  padding: 12px 16px;
  background: #FFF6D6;
  border: 2px solid var(--ink);
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.4;
  text-align: left;
}

.done-missing ul { display: grid; gap: 4px; margin: 8px 0; padding: 0; list-style: none; }
.done-missing a { color: var(--ink); font-family: var(--display); font-weight: 600; }
.done-missing > span { color: var(--soft); font-size: 13.5px; }

.review-list .dd--shown { border-left-color: #C79A08; background: #FFF9E6; }

.pill--practice { background: #D5EFC8; }

/* Qulflangan papka endi havola — bosilsa to'sib turgan bosqichga. */
a.folder--shut { cursor: pointer; text-decoration: none; }
a.folder--shut:hover { filter: saturate(.7) brightness(1.02); }

@media (max-width: 640px) {
  .task-skip { display: table; margin: 6px auto 0; }
  .guard-btns { width: 100%; }
  .guard .btn { flex: 1; }
}

.review-empty {
  margin: 8px 0 4px;
  padding: 8px 12px;
  background: #FFF6D6;
  border-left: 4px solid #C79A08;
  border-radius: 8px;
  font-size: 14px;
}

/* O'qituvchi paneli: javob to'g'rimi — bir qarashda. */
.qrow-key--right { color: #237A3B; font-weight: 700; }
.qrow-key--wrong { color: #A3192F; }

/* ==========================================================================
   Dars ekranlari — "stiker" ish varaqlari (2026-10-29)
   Bosqich muqovasi, topshiriq, yakun va sertifikat (`body.lesson-sheet`)
   mijoz so'rovi bilan yana asl ko'rinishida: to'liq bosqich bo'yog'idagi
   varaq, qalin siyoh chegara, qattiq soya (`--pop` berilmaydi — `style.css`
   dagi asl soyalar ishlaydi). `portal.css` dagi `body.is-task` va
   `multimedia-lessons.css` qatlamlari bu sahifalarga tegmaydi. Katalog va
   mavzu sahifasi (`body.discovery`) o'z dizaynida qoladi.
   ========================================================================== */

body.lesson-sheet {
  --display: "Fredoka", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
}

/* Yangi bosqich rasmchalari eski emoji doirachasi bo'lib turadi. */
body.lesson-sheet :is(.discover-cover-art, .discover-done-art) {
  display: block;
  width: clamp(94px, 14vh, 132px);
  height: clamp(94px, 14vh, 132px);
  margin: 0 auto 14px;
  padding: clamp(12px, 2vh, 18px);
  background: rgba(255, 253, 248, .5);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  box-shadow: var(--pop, 5px 5px 0 var(--ink));
  filter: none;
  overflow: visible;
}

/* Topshiriq sarlavhasida emoji bor — mavzu rasmchasi ortiqcha. */
body.lesson-sheet .discover-task-art { display: none; }

/* Qadamlar chizig'i doirachalar ORTIDAN o'tsin: keyingi qadamning chizig'i
   (`::before`, absolute) oldingi doiracha ustiga chizilib, raqam va ✓ ni
   kesib qo'yardi. */
.rail-dot { position: relative; z-index: 1; }

/* Telefonda halqa va ball qatorlari yonma-yon sig'maydi (halqa chapdan,
   qatorlar o'ngdan chiqib ketardi) — ustma-ust turadi. */
@media (max-width: 560px) {
  .scoreboard { flex-direction: column; gap: 16px; }
  .score-dial { width: min(190px, 62%); }
  .score-rows { width: 100%; }
}
