:root {
  color-scheme: dark;
  --background: #131313;
  --surface-lowest: #0e0e0e;
  --surface-low: #1c1b1b;
  --surface: #201f1f;
  --surface-high: #2a2a2a;
  --surface-highest: #353534;
  --on-surface: #e5e2e1;
  --muted: #d0c6ab;
  --outline: #4d4732;
  --gold: #ffd700;
  --gold-dim: #e9c400;
  --gold-soft: rgba(255, 215, 0, 0.1);
  --blue: #1e95f2;
  --blue-soft: rgba(30, 149, 242, 0.16);
  --cyan: #00dbe8;
  --error: #ffb4ab;
  --radius: 16px;
  --app-inline-padding: clamp(16px, 5vw, 24px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  overflow-x: hidden;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% -5%, rgba(255, 215, 0, 0.12), transparent 32%),
    radial-gradient(circle at 110% 28%, rgba(30, 149, 242, 0.12), transparent 34%),
    var(--background);
  color: var(--on-surface);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.app-icon {
  display: block;
  flex: 0 0 auto;
  width: 1.5em;
  height: 1.5em;
  overflow: visible;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(88px);
}

.ambient-gold {
  top: 18%;
  left: -120px;
  width: 260px;
  height: 260px;
  background: rgba(255, 215, 0, 0.08);
}

.ambient-blue {
  right: -120px;
  bottom: 16%;
  width: 300px;
  height: 300px;
  background: rgba(30, 149, 242, 0.08);
}

.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 64px;
  padding: max(12px, env(safe-area-inset-top)) 24px 0;
  background: linear-gradient(180deg, rgba(19, 19, 19, 0.94), rgba(19, 19, 19, 0));
  backdrop-filter: blur(18px);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(53, 53, 52, 0.56);
  color: var(--gold);
  box-shadow: 0 4px 28px rgba(255, 215, 0, 0.06);
}

.app-shell {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 82px var(--app-inline-padding) 0;
  overflow-x: clip;
}

.screen {
  display: grid;
  gap: clamp(18px, 4vw, 28px);
  min-width: 0;
}

.headline {
  display: grid;
  gap: 6px;
}

.headline h1,
.headline h2,
.card h3,
.module-title {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: #fff;
  letter-spacing: 0;
}

.headline h1 {
  font-size: 32px;
  line-height: 1.08;
  font-weight: 900;
}

.headline h2 {
  font-size: 22px;
}

.headline p,
.muted,
.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.eyebrow {
  color: var(--gold-dim);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.glass,
.card,
.module-card,
.task-card,
.rank-row,
.lesson-hero,
.quiz-card {
  border: 1px solid rgba(255, 215, 0, 0.06);
  border-radius: var(--radius);
  background: rgba(53, 53, 52, 0.58);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(20px);
}

.xp-total {
  color: var(--gold);
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin: 20px 0 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 700;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-highest);
}

.progress-fill {
  display: block;
  height: 100%;
  width: var(--progress);
  border-radius: inherit;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.45);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-title h2 {
  margin: 0;
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 21px;
}

.section-title span {
  color: #9ecaff;
  font-size: 14px;
  font-weight: 800;
}

.module-list,
.task-list,
.answer-list,
.rank-list {
  display: grid;
  gap: 14px;
}

.module-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 20px;
  overflow: hidden;
  cursor: pointer;
}

.module-card.active {
  box-shadow: 0 0 40px rgba(30, 149, 242, 0.12), 0 12px 34px rgba(0, 0, 0, 0.26);
}

.module-card.locked {
  opacity: 0.48;
  background: rgba(28, 27, 27, 0.55);
  cursor: default;
}

.module-certificate {
  display: grid;
  margin-top: 18px;
  padding-top: 10px;
}

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

.module-head .pill {
  flex: none;
}

.module-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #201f1f, #2a2a2a 55%, #1d262d);
}

.module-card-media img {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.module-card-placeholder,
.lesson-media-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--gold);
}

.module-card-placeholder .app-icon,
.lesson-media-placeholder .app-icon {
  font-size: clamp(64px, 18vw, 108px);
  text-shadow: 0 0 38px rgba(255, 215, 0, 0.35);
}

.module-icon,
.task-icon,
.stat-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
}

.module-title {
  min-width: 0;
  margin: 0;
  font-size: clamp(17px, 4.5vw, 20px);
  line-height: 1.25;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pill.gold {
  background: var(--gold-soft);
  color: var(--gold);
}

.gold-button,
.dark-button,
.blue-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 999px;
  padding: 0 18px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 900;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.gold-button:active,
.dark-button:active,
.blue-button:active,
.answer-button:active,
.nav-button:active {
  transform: scale(0.97);
}

.gold-button {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #221b00;
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.22);
}

.dark-button {
  background: var(--surface-highest);
  color: #fff;
}

.blue-button {
  background: #24a1de;
  color: #fff;
}

.lesson-hero {
  overflow: hidden;
}

.lesson-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.62), transparent 15%),
    radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.22), transparent 34%),
    linear-gradient(135deg, #050505, #1a1605 48%, #101a25);
}

.lesson-media img {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lesson-media.has-image .lesson-media-placeholder,
.lesson-media.has-image::after {
  display: none;
}

.lesson-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle, black, transparent 72%);
}

.lesson-content,
.card {
  padding: 22px;
}

.concept-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.concept-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(28, 27, 27, 0.62);
  font-weight: 700;
}

.lesson-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.lesson-link:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.lesson-link span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.muted-dot {
  background: var(--surface-highest);
}

.dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
}

.lesson-body {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.lesson-body h4 {
  margin: 0;
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 18px;
}

.lesson-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.lesson-body ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.lesson-body li::marker {
  color: var(--gold);
}

.reward-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-left: 4px solid var(--gold);
}

.reward-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reward-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
}

.quiz-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
}

.question-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.question-line::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(77, 71, 50, 0.7);
}

.quiz-card h1 {
  margin: 0;
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 24px;
  line-height: 1.22;
}

.answer-button {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 68px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface-high);
  padding: 14px 16px;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.answer-letter {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
}

.answer-button.selected,
.answer-button.correct {
  border-color: var(--gold);
  background: rgba(255, 215, 0, 0.08);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.1);
}

.answer-button.selected .answer-letter,
.answer-button.correct .answer-letter {
  border-color: transparent;
  background: var(--gold);
  color: #221b00;
}

.answer-button.wrong {
  border-color: rgba(255, 180, 171, 0.8);
  background: rgba(255, 180, 171, 0.08);
}

.quiz-error {
  margin: -10px 0 0;
  color: var(--error);
  font-weight: 800;
  text-align: center;
}

.result-card {
  min-height: calc(100dvh - 200px);
  display: grid;
  place-items: center;
  text-align: center;
}

.result-icon {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 0 auto 22px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  box-shadow: 0 0 42px rgba(255, 215, 0, 0.16);
}

.result-icon .app-icon {
  width: 58px;
  height: 58px;
}

.result-actions {
  display: grid;
  gap: 12px;
}

.task-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 18px;
}

.task-main {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 14px;
  min-width: 0;
}

.task-icon {
  flex: 0 0 auto;
}

.task-card .gold-button,
.task-card .dark-button,
.task-card .blue-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.task-main > div:last-child {
  min-width: 0;
}

.task-title-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
}

.task-main h3 {
  margin: 0 0 5px;
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 16px;
}

.task-title-row h3 {
  margin-bottom: 0;
}

.task-main p {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.task-main small {
  display: block;
  max-width: 420px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.task-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.76);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.task-status.approved,
.task-status.ready {
  background: var(--gold-soft);
  color: var(--gold);
}

.task-status.pending,
.task-status.manual {
  background: color-mix(in srgb, var(--blue) 16%, transparent);
  color: var(--blue);
}

.task-status.open,
.task-status.progress {
  background: color-mix(in srgb, var(--cyan) 14%, transparent);
  color: var(--cyan);
}

.task-status.rejected {
  background: rgba(255, 101, 101, 0.14);
  color: #ff8f8f;
}

.manual-response {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.manual-response textarea {
  width: min(100%, 420px);
  min-height: 86px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.26);
  color: #fff;
  font: inherit;
  font-size: 14px;
  outline: none;
  resize: vertical;
}

.manual-response textarea:focus {
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.manual-response textarea:disabled {
  opacity: 0.72;
}

.manual-response span {
  max-width: 420px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.task-card .story-repost-button {
  justify-self: start;
  width: fit-content;
  min-height: 42px;
  gap: 8px;
}

.story-repost-button .app-icon {
  width: 18px;
  height: 18px;
}

.tip-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-color: rgba(255, 215, 0, 0.12);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.16), rgba(53, 53, 52, 0.28));
}

.campaign-banner {
  margin-bottom: 18px;
}

.campaign-banner p {
  margin: 8px 0 0;
}

.requirement-note {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 215, 0, 0.16);
  border-radius: 12px;
  background: var(--gold-soft);
  color: var(--gold);
  font-weight: 800;
}

.banner-carousel {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  overflow: hidden;
}

.banner-track {
  display: flex;
  align-items: flex-start;
  transform: translateX(calc(var(--banner-index, 0) * -100%));
  transition: transform 0.42s ease;
}

.home-banner {
  flex: 0 0 100%;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 215, 0, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.32);
  padding: 0;
}

.home-banner img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.home-banner.banner-image-failed::before {
  content: "Баннер недоступен";
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.banner-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.banner-dots button {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.banner-dots button.active {
  width: 20px;
  background: var(--gold);
}

.tip-card::after {
  content: "✦";
  position: absolute;
  right: -18px;
  bottom: -26px;
  color: rgba(255, 215, 0, 0.12);
  font-size: 96px;
}

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 10px;
  margin-top: 6px;
}

.podium-card {
  display: grid;
  place-items: center;
  min-height: 132px;
  padding: 14px 8px;
  border-radius: 18px;
  background: var(--surface-high);
  text-align: center;
}

.podium-card.first {
  min-height: 154px;
  transform: translateY(-14px) scale(1.06);
  background: linear-gradient(145deg, rgba(255, 215, 0, 0.18), var(--surface-high));
  box-shadow: 0 12px 34px rgba(255, 215, 0, 0.12);
}

.avatar {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  border: 2px solid rgba(255, 215, 0, 0.28);
  border-radius: 999px;
  background: linear-gradient(135deg, #3a3939, #151515);
  color: var(--gold);
  font-weight: 900;
}

.avatar img,
.mini-avatar img,
.profile-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.has-photo span,
.mini-avatar.has-photo span,
.profile-avatar.has-photo > span:first-of-type {
  visibility: hidden;
}

.podium-card.first .avatar {
  width: 66px;
  height: 66px;
  border-color: var(--gold);
}

.rank-row {
  display: grid;
  grid-template-columns: 28px 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(42, 42, 42, 0.75);
}

.rank-row.highlight {
  border-left: 4px solid var(--gold);
}

.rank-no {
  color: var(--gold);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 900;
  text-align: center;
}

.mini-avatar {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--surface-highest);
  color: var(--muted);
  font-weight: 900;
}

.rank-name {
  color: #fff;
  font-weight: 800;
}

.podium-xp {
  margin-top: 4px;
  color: var(--gold);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 12px;
  font-weight: 900;
}

.leaderboard-sentinel {
  min-height: 40px;
  padding: 12px;
  color: var(--muted);
  text-align: center;
}

.rank-role {
  color: rgba(208, 198, 171, 0.62);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rank-xp {
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 900;
}

.profile-head {
  display: grid;
  place-items: center;
  text-align: center;
}

.profile-avatar {
  position: relative;
  overflow: visible;
  display: grid;
  place-items: center;
  width: clamp(96px, 30vw, 124px);
  height: clamp(96px, 30vw, 124px);
  margin-bottom: 14px;
  border: 4px solid var(--surface-highest);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--blue));
  box-shadow: 0 0 42px rgba(255, 215, 0, 0.15);
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(30px, 9vw, 38px);
  font-weight: 900;
}

.verified {
  position: absolute;
  z-index: 2;
  right: -5px;
  bottom: 5px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 3px solid var(--background);
  border-radius: 999px;
  background: var(--gold);
  color: #221b00;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.profile-avatar img {
  border-radius: inherit;
}

.verified .app-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.uid {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-high);
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.profile-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.text-input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(77, 71, 50, 0.8);
  border-radius: 14px;
  outline: 0;
  background: var(--surface-lowest);
  color: #fff;
  padding: 0 14px;
  font: inherit;
  font-weight: 800;
}

.text-input::placeholder {
  color: rgba(208, 198, 171, 0.54);
}

.text-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.12);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 3vw, 12px);
  min-width: 0;
}

.stat-card {
  display: grid;
  align-content: space-between;
  min-width: 0;
  min-height: 118px;
  padding: clamp(12px, 4vw, 16px);
  border-radius: var(--radius);
  background: var(--surface-high);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
}

.stat-value {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(22px, 7vw, 24px);
  font-weight: 900;
}

.streak-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(77, 71, 50, 0.72);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.09), rgba(36, 42, 42, 0.84));
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.streak-card h3 {
  margin: 4px 0;
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 20px;
}

.streak-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.streak-card .pill {
  flex: 0 0 auto;
}

.referral-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 50px;
  padding: 0 12px;
  border: 1px solid rgba(77, 71, 50, 0.7);
  border-radius: 14px;
  background: var(--surface-lowest);
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
}

.referral-code span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.toast {
  min-height: 20px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

body.onboarding-active {
  padding-bottom: 0;
}

body.onboarding-active .topbar,
body.onboarding-active .bottom-nav {
  display: none;
}

body.onboarding-active .app-shell {
  min-height: 100dvh;
  padding: max(28px, env(safe-area-inset-top)) var(--app-inline-padding) max(24px, env(safe-area-inset-bottom));
}

.onboarding-screen {
  display: grid;
  align-content: space-between;
  gap: 24px;
  min-height: calc(100dvh - max(28px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
}

.onboarding-card {
  display: grid;
  align-content: center;
  gap: 28px;
  min-height: 70dvh;
}

.onboarding-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.onboarding-progress span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: width 0.2s ease, background 0.2s ease;
}

.onboarding-progress span.active {
  width: 28px;
  background: var(--gold);
}

.onboarding-icon {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  margin: 0 auto;
  border: 1px solid rgba(255, 215, 0, 0.24);
  border-radius: 32px;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 215, 0, 0.28), transparent 36%),
    linear-gradient(135deg, rgba(255, 215, 0, 0.14), rgba(30, 149, 242, 0.12));
  color: var(--gold);
  box-shadow: 0 20px 70px rgba(255, 215, 0, 0.1);
}

.onboarding-icon .app-icon {
  width: 66px;
  height: 66px;
}

.onboarding-screen .headline {
  text-align: center;
}

.onboarding-screen .headline h1 {
  max-width: 560px;
  margin-inline: auto;
}

.onboarding-screen .headline p {
  max-width: 520px;
  margin-inline: auto;
}

.onboarding-actions {
  display: grid;
  gap: 10px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  min-height: calc(74px + env(safe-area-inset-bottom));
  padding: 8px clamp(10px, 4vw, 18px) calc(8px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: rgba(42, 42, 42, 0.92);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(18px);
}

.nav-button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 52px;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.42);
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.nav-button .app-icon {
  width: 24px;
  height: 24px;
}

.nav-button strong {
  max-width: 74px;
  overflow: hidden;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-button.active {
  background: var(--gold-soft);
  color: var(--gold);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.14);
}

@media (max-width: 370px) {
  :root {
    --app-inline-padding: 14px;
  }

  .app-shell {
    padding-inline: var(--app-inline-padding);
  }

  .headline h1 {
    font-size: 28px;
  }

  .task-card {
    align-items: stretch;
    flex-direction: column;
  }

  .task-card .gold-button,
  .task-card .dark-button {
    width: 100%;
  }

  .bottom-nav {
    padding-inline: 10px;
  }
}

@media (max-width: 430px) {
  .reward-left {
    min-width: 0;
  }

  .reward-left > div:last-child {
    min-width: 0;
  }

  .streak-card {
    align-items: flex-start;
  }

  .streak-card h3 {
    font-size: 18px;
    line-height: 1.2;
  }

  .gold-button,
  .dark-button,
  .blue-button {
    height: auto;
    min-height: 48px;
    padding-block: 12px;
    line-height: 1.25;
    white-space: normal;
  }

  .profile-head {
    transform: none;
  }

  .profile-head .headline h1 {
    font-size: 30px;
  }

  .module-icon,
  .task-icon,
  .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    min-height: 112px;
  }

  .task-card {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .task-card .gold-button,
  .task-card .dark-button,
  .task-card .blue-button {
    width: 100%;
  }
}

@media (max-width: 370px) {
  .nav-button .app-icon {
    width: 21px;
    height: 21px;
  }

  .nav-button strong {
    font-size: 8px;
    letter-spacing: 0.04em;
  }
}

@media (max-height: 820px) and (max-width: 430px) {
  body {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .app-shell {
    padding-top: 70px;
  }

  .profile-avatar {
    width: 92px;
    height: 92px;
    margin-bottom: 10px;
    border-width: 3px;
  }

  .verified {
    right: -4px;
    bottom: 3px;
    width: 28px;
    height: 28px;
  }

  .verified .app-icon {
    width: 16px;
    height: 16px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    min-height: 104px;
    padding: 12px;
  }

  .bottom-nav {
    min-height: calc(68px + env(safe-area-inset-bottom));
  }
}
