/* Dizayn tizimi: qorong'i premium, yagona oltin aksent (SaraStars spetsifikatsiyasi asosida). */
:root {
  --bg: #140d1d;
  --surface: #1e1530;
  --surface-2: #2b1f40;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .13);
  --gold: #ff8ec7;
  --gold-d: #e4569f;
  --gold-bg: rgba(255, 142, 199, .09);
  --gold-glow: rgba(255, 142, 199, .2);
  --on-gold: #2a0a1d;
  --star: #ffd39a;
  --grad: linear-gradient(135deg, #ffc9e2 0%, #ff86bf 50%, #e65aa3 100%);
  --grad-h: linear-gradient(90deg, #ffc9e2, #ff86bf);
  --text: #ffffff;
  --text2: #bba8d0;
  --text3: #8b7aa3;
  --green: #34d399;
  --red: #ff6b7a;
  --r: 16px;
  --r-pill: 30px;
  --t: .24s cubic-bezier(.34, 1.56, .64, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font: 400 15px/1.45 var(--font);
  color: var(--text);
  background:
    radial-gradient(130% 60% at 50% 10%, rgba(255, 120, 190, .14), transparent 50%),
    radial-gradient(100% 50% at 100% 15%, rgba(150, 110, 255, .07), transparent 45%),
    radial-gradient(90% 60% at 0% 25%, rgba(255, 170, 120, .06), transparent 50%),
    linear-gradient(180deg, #140d1d 0%, #0f0916 50%, #08050d 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: -40%;
  width: 180%;
  height: 180%;
  z-index: -1;
  background:
    radial-gradient(circle at 75% 25%, rgba(255, 142, 199, .04) 0%, transparent 40%),
    radial-gradient(circle at 25% 75%, rgba(150, 110, 255, .03) 0%, transparent 45%);
  animation: nebula 35s ease-in-out infinite alternate;
}
@keyframes nebula {
  0% { transform: translate(0, 0) scale(1) rotate(0); }
  50% { transform: translate(-4%, 3%) scale(1.08) rotate(8deg); }
  100% { transform: translate(4%, -3%) scale(1.02) rotate(-8deg); }
}
body.no-anim *, body.no-anim *::before { animation: none !important; }
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
a { color: var(--gold); }
h1, h2, h3 { font-weight: 800; letter-spacing: -.4px; text-wrap: balance; overflow-wrap: anywhere; }
h1 { font-size: 24px; line-height: 1.2; }
h2 { font-size: 17px; margin: 22px 0 10px; }
h3 { font-size: 15px; }
p { text-wrap: pretty; }
.muted { color: var(--text2); font-size: 13px; }
.dim { color: var(--text3); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.gold { color: var(--gold); }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap-row { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- ikonkalar ---------- */
.ic { display: inline-grid; place-items: center; flex: none; }
.ic svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- tugmalar ---------- */
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cta {
  width: 100%;
  min-height: 54px;
  border-radius: var(--r-pill);
  background: var(--grad);
  color: var(--on-gold);
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 6px 24px rgba(228, 86, 159, .25), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform var(--t), box-shadow var(--t), opacity .2s;
}
.cta:active { transform: scale(.97); }
.cta:disabled { background: rgba(255, 255, 255, .04); color: var(--text3); box-shadow: none; cursor: default; }
.btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  font-weight: 700;
  transition: transform var(--t), background .2s;
}
.btn:active { transform: scale(.97); }
.btn.gold { background: var(--gold-bg); border-color: rgba(255, 142, 199, .3); color: var(--gold); }
.btn.red { color: var(--red); border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .08); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.wide { width: 100%; }

/* ---------- maydonlar ---------- */
input, select, textarea {
  font: inherit;
  color: var(--text);
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(14, 8, 22, .6);
  transition: border-color .2s;
}
textarea { min-height: 110px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }
select option { background: var(--surface); }
label.field { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text2); }
label.field input, label.field select, label.field textarea { font-weight: 400; font-size: 15px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.switch input { appearance: none; width: 46px; height: 28px; min-height: 0; padding: 0; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); position: relative; flex: none; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text2); transition: transform var(--t), background .2s; }
.switch input:checked { background: var(--gold-bg); border-color: var(--gold); }
.switch input:checked::after { transform: translateX(18px); background: var(--gold); }

/* ---------- kartalar ---------- */
.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.glass { background: rgba(30, 21, 48, .62); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 4px 16px rgba(0, 0, 0, .3); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--text2); }
.badge.ok { background: rgba(16, 185, 129, .13); color: var(--green); }
.badge.bad { background: rgba(239, 68, 68, .13); color: var(--red); }
.badge.gold { background: var(--gold-bg); color: var(--gold); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips button { flex: none; min-height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--text2); background: var(--surface); border: 1px solid var(--line); }
.chips button[aria-pressed="true"] { color: var(--on-gold); background: var(--grad); border-color: transparent; }
.empty { padding: 36px 16px; text-align: center; color: var(--text2); }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.skeleton { height: 110px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- pastki varaq va xabar ---------- */
.overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 5, 16, .65); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); opacity: 0; pointer-events: none; transition: opacity .28s ease; }
.overlay.open { opacity: 1; pointer-events: all; }
.sheet { width: 100%; max-width: 520px; max-height: 92dvh; overflow-y: auto; background: rgba(30, 21, 48, .94); -webkit-backdrop-filter: blur(25px); backdrop-filter: blur(25px); border-radius: 28px 28px 0 0; padding: 0 18px calc(18px + env(safe-area-inset-bottom)); transform: translateY(110%); transition: transform .32s cubic-bezier(.32, .72, 0, 1); }
.overlay.open .sheet { transform: translateY(0); }
.handle { width: 44px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .18); margin: 10px auto 14px; }
.toast { position: fixed; left: 16px; right: 16px; top: calc(14px + env(safe-area-inset-top)); max-width: 460px; margin: 0 auto; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(43, 31, 64, .96); border: 1px solid var(--line-2); box-shadow: 0 8px 28px rgba(0, 0, 0, .4); z-index: 400; animation: drop .3s cubic-bezier(.34, 1.56, .64, 1); }
.toast.ok .ic { color: var(--green); }
.toast.err .ic { color: var(--red); }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }
@media (hover: hover) {
  .btn:hover { background: #26324a; }
  .chips button:hover { color: var(--text); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
