/* ═══════════════════════════════════════════════════════════════════════════
   Fit Leader — zaldagi bandlik (ochiq sahifa)

   Qizil va qora: klub uchun kuchli, sport estetikasi. Boshqaruv panelidan
   ataylab farq qiladi — bu tashrifchilar uchun ekran, xodimlar uchun emas.

   Sahifa telefonda ham, zaldagi katta ekranda ham ochilishi mumkin, shuning
   uchun asosiy son `clamp()` bilan oyna kengligiga qarab o'sadi.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --black: #08080a;
  --coal: #121215;
  --coal-2: #1b1b20;
  --line: #2a2a31;

  --red: #ff2d3f;
  --red-deep: #c4121f;
  --red-glow: rgba(255, 45, 63, 0.22);

  --ink: #f4f4f6;
  --ink-2: #a8a8b3;
  --ink-3: #6e6e7a;

  --male: #ff2d3f;
  --female: #ff8fa0;
  --unknown: #4a4a55;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(70rem 40rem at 50% -10%, rgba(255, 45, 63, 0.14), transparent 65%),
    radial-gradient(50rem 34rem at 100% 110%, rgba(196, 18, 31, 0.1), transparent 60%),
    var(--black);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 5vh, 48px);
  min-height: 100svh;
  max-width: 640px;
  margin: 0 auto;
  padding: calc(24px + var(--safe-top)) 24px calc(24px + var(--safe-bottom));
}

/* ── Sarlavha ───────────────────────────────────────────────────────────── */

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.head__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.head__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(145deg, var(--red) 0%, var(--red-deep) 100%);
  border-radius: 12px;
  box-shadow: 0 6px 22px -8px var(--red-glow);
}

.head__name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.state {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--coal);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.state__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
}

.state[data-open='true'] .state__dot {
  background: var(--red);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.state[data-open='true'] {
  color: var(--ink);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 45, 63, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 45, 63, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 45, 63, 0);
  }
}

/* ── Asosiy son ─────────────────────────────────────────────────────────── */

.count {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
}

.count__label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.count__value {
  margin: 4px 0 0;
  font-size: clamp(96px, 30vw, 190px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 0%, var(--red) 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 70px var(--red-glow);
  transition: opacity 0.2s ease;
}

.count__value.is-stale {
  opacity: 0.45;
}

.count__unit {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-2);
}

/* ── Taqsimot ───────────────────────────────────────────────────────────── */

.split {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.split__bar {
  display: flex;
  gap: 3px;
  height: 10px;
  overflow: hidden;
  background: var(--coal-2);
  border-radius: 999px;
}

.split__fill {
  min-width: 0;
  border-radius: 999px;
  transition: flex-grow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  flex-grow: 0;
  flex-basis: 0;
}

.split__fill--male {
  background: var(--male);
}
.split__fill--female {
  background: var(--female);
}
.split__fill--unknown {
  background: var(--unknown);
}

.split__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(160deg, var(--coal) 0%, rgba(18, 18, 21, 0.6) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.card__icon {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 21px;
  line-height: 1;
  border-radius: 11px;
}

.card--male .card__icon {
  color: var(--male);
  background: rgba(255, 45, 63, 0.13);
}

.card--female .card__icon {
  color: var(--female);
  background: rgba(255, 143, 160, 0.13);
}

.card__value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.card__label {
  font-size: 12.5px;
  color: var(--ink-3);
}

.split__note {
  margin: 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ── Pastki qator ───────────────────────────────────────────────────────── */

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
}

.foot p {
  margin: 0;
}

/* Katta ekranda (zaldagi monitor) sonlar yanada yiriklashadi */
@media (min-width: 900px) and (min-height: 700px) {
  .screen {
    max-width: 860px;
  }
  .count__value {
    font-size: clamp(190px, 22vw, 280px);
  }
  .card__value {
    font-size: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
