/* Aql chempionati — «Pastel kartalar» dizayni (3-variant) */
:root {
  --bg: #F6EEE2;
  --ink: #18100A;
  --muted: #6B6256;
  --gold: #DCAF6E;
  --ember: #B5461E;
  --pink: #F3CDBF;
  --peach: #F1DDB8;
  --lilac: #DDD5EA;
  --mint: #D3E4C9;
  --yellow: #FFC807;
  --line: #EDE3D3;
  --pink-ink: #5E3324;
  --peach-ink: #4A3D28;
  --lilac-ink: #423B5C;
  --mint-ink: #34472C;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; flex-shrink: 0; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; }
.screen { display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 24px; min-height: 100vh; }
.screen.with-nav { padding-bottom: 110px; }
.grow { flex-grow: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.span2 { grid-column: span 2; }
.center { text-align: center; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- tipografiya */
/* Sarlavhalar — muqovadagi kabi keng geometrik shrift */
.h-light { margin: 0; font-family: 'Montserrat', 'DM Sans', sans-serif; font-weight: 300; letter-spacing: -1px; line-height: 1.08; font-size: 34px; }
.h-xl { font-size: 38px; letter-spacing: -1.2px; }
.num-light { font-family: 'Montserrat', 'DM Sans', sans-serif; font-weight: 300; letter-spacing: -1px; line-height: 1; }
.label { font-size: 14px; font-weight: 500; color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }

/* --------------------------------------------------------------------- kartalar */
.card { border-radius: 24px; padding: 14px; display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; border: 0; text-align: left; }
.card.lg { border-radius: 28px; padding: 16px; }
.card.xl { border-radius: 32px; padding: 18px; }
.card.list { padding: 4px 16px; gap: 0; }
.white { background: #fff; }
.pink { background: var(--pink); }
.peach { background: var(--peach); }
.lilac { background: var(--lilac); }
.mint { background: var(--mint); }
.yellow { background: var(--yellow); }
.black { background: var(--ink); color: #fff; }
/* Qora kartalarda muqovadagi oltinrang nurlar */
.card.black { background: var(--ink) url(rays.svg) right -20px top -30px / 300px 300px no-repeat; }
.pink .sub { color: var(--pink-ink); }
.peach .sub { color: var(--peach-ink); }
.lilac .sub { color: var(--lilac-ink); }
.mint .sub { color: var(--mint-ink); }
.black .sub { color: #CFCFCF; }
.white .sub { color: var(--muted); }
.ring-deco { position: relative; overflow: hidden; }
.ring-deco::before {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 300px; height: 300px;
  background: url(rays.svg) 0 0 / 100% 100% no-repeat; pointer-events: none;
}
.ring-deco > * { position: relative; }

.ico { width: 36px; height: 36px; border-radius: 999px; background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ico.lg { width: 40px; height: 40px; }
.ico.dark { background: var(--ink); color: #fff; }
.ico.yellow { background: var(--yellow); }

.chip { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; background: #fff; color: var(--ink); border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.chip.dark { background: var(--ink); color: #fff; }
.chip.yellow { background: var(--yellow); color: var(--ink); }
.chip.mint { background: var(--mint); }
.chip.lilac { background: var(--lilac); }
.chip.peach { background: var(--peach); }
.chip.pink { background: var(--pink); }
.chip.soft { background: rgba(255,255,255,0.55); }
.chip.bg { background: var(--bg); }
.chip.lg { font-size: 13px; padding: 6px 12px; }
.chip.xl { height: 36px; padding: 0 14px; font-size: 13px; }

/* ---------------------------------------------------------------------- tugmalar */
.pill-btn {
  height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 6px 0 20px; border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 16px; font-weight: 600; text-decoration: none; border: 0; cursor: pointer; width: 100%;
}
.pill-btn.tall { height: 56px; padding-left: 22px; }
.pill-btn .arrow { width: 40px; height: 40px; border-radius: 999px; background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; }
.pill-btn.tall .arrow { width: 44px; height: 44px; }
.pill-btn:disabled { opacity: 0.5; }
.soft-btn { height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 999px; background: #fff; font-size: 15px; font-weight: 600; border: 0; cursor: pointer; width: 100%; text-decoration: none; }
.round-btn { width: 44px; height: 44px; border-radius: 999px; background: #fff; border: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; color: var(--ink); }
.round-btn.white-on-dark { background: #fff; color: var(--ink); }
.tab { height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; }
.tab.on { background: var(--ink); color: #fff; font-weight: 600; }
.tapable { cursor: pointer; }

/* -------------------------------------------------------------------- avatarlar */
.avatar { width: 30px; height: 30px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; color: var(--ink); }
.stack { display: flex; }
.stack span { width: 26px; height: 26px; border-radius: 999px; border: 2px solid var(--bg); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--ink); }
.stack span + span { margin-left: -8px; }
.black .stack span { border-color: var(--ink); }

/* ------------------------------------------------------------------------- menyu */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom));
  display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: var(--ink);
  box-shadow: 0 12px 30px rgba(20,20,20,0.25); z-index: 10;
}
.nav button { width: 48px; height: 48px; border-radius: 999px; color: #fff; background: transparent; border: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; gap: 8px; font-size: 14px; font-weight: 600; }
.nav button.on { width: auto; padding: 0 16px 0 12px; background: #fff; color: var(--ink); }

/* -------------------------------------------------------------------- elementlar */
.day-chips { display: flex; gap: 6px; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
.day-chips::-webkit-scrollbar { display: none; }
.day-chips span { flex-shrink: 0; width: 44px; height: 44px; border-radius: 999px; background: #fff; border: 1px solid #E6DACA; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }
.day-chips span.done { background: var(--mint); border-color: var(--mint); }
.day-chips span.now { background: var(--ink); border-color: var(--ink); color: #fff; }

.bars { display: grid; gap: 6px; align-items: end; height: 72px; }
.bars > div { display: flex; flex-direction: column; justify-content: flex-end; height: 72px; }
.bars .b2 { background: var(--lilac); border-radius: 6px 6px 0 0; }
.bars .b1 { background: var(--peach); border-radius: 0 0 6px 6px; }
.bars .b1.only { border-radius: 6px; }
.bars .b1.today { background: var(--pink); }
.bars .empty { height: 8px; background: var(--line); border-radius: 6px; }

.progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.6); overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: var(--ink); }

.lrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: 0; }
.book-line { display: flex; align-items: center; gap: 8px; padding: 2px 0 10px; font-size: 12px; font-weight: 700; }
.book-line i { flex-grow: 1; border-top: 2px dashed var(--ink); }

.answer-box { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 999px; background: #fff; box-shadow: 0 10px 24px rgba(20,20,20,0.08); }
.answer-box input { flex-grow: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 0 14px; font-size: 17px; font-weight: 500; }
.answer-box input::placeholder { color: #7A7A7A; }
.send { width: 52px; height: 52px; border-radius: 999px; background: var(--ink); color: #fff; border: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.send:disabled { opacity: 0.4; }

.puzzle-img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 20px; background: rgba(255,255,255,0.6); }
.body-text { margin: 0; font-size: 16px; line-height: 1.5; white-space: pre-line; }
.link-field { flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; background: #fff; border-radius: 999px; padding: 12px 16px; }

.book { width: 112px; height: 166px; flex-shrink: 0; border-radius: 4px 10px 10px 4px; background: var(--bg); transform: rotate(6deg); box-shadow: 0 16px 30px rgba(24,16,10,0.3), inset 3px 0 0 rgba(24,16,10,0.08); overflow: hidden; }
.book img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* ------------------------------------------------------- oyna (ism, manzil) va xabar */
.sheet-bg { position: fixed; inset: 0; background: rgba(20,20,20,0.35); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet { width: 100%; max-width: 480px; background: var(--bg); border-radius: 28px 28px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.sheet input, .sheet textarea { width: 100%; border: 0; outline: none; background: #fff; border-radius: 20px; padding: 14px 16px; font-size: 16px; resize: none; }
.toast { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 16px; font-size: 14px; font-weight: 600; z-index: 30; max-width: 90vw; text-align: center; }
.loader { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.loader span { width: 40px; height: 40px; border-radius: 999px; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pop { animation: pop 0.35s ease-out; }

.mini-cover { width: 34px; height: 50px; border-radius: 3px 6px 6px 3px; object-fit: cover; box-shadow: 0 4px 10px rgba(24,16,10,0.18); flex-shrink: 0; }
.brand { font-family: 'Montserrat', 'DM Sans', sans-serif; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; font-size: 13px; }
