:root {
  --bg: #0b0d18;
  --bg-soft: #12162a;
  --card: #14182b;
  --card-hover: #1a2038;
  --text: #f4f6ff;
  --muted: #8b93ad;
  --blue: #5b8cff;
  --purple: #8b5cf6;
  --green: #34d399;
  --orange: #fb923c;
  --red: #f87171;
  --border: rgba(255, 255, 255, 0.08);
  --glow: rgba(91, 140, 255, 0.22);
  --tg-viewport-height: 100vh;
  --tg-viewport-stable-height: 100vh;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  height: var(--tg-viewport-stable-height);
  overscroll-behavior: none;
}

body {
  font-family: Inter, system-ui, sans-serif;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(91, 140, 255, 0.22), transparent 55%),
    radial-gradient(90% 60% at 100% 20%, rgba(139, 92, 246, 0.14), transparent 50%),
    linear-gradient(180deg, #101428 0%, var(--bg) 42%, #080a14 100%);
  color: var(--text);
  overflow-x: hidden;
}

#app {
  min-height: var(--tg-viewport-stable-height);
  padding: calc(12px + env(safe-area-inset-top)) 14px calc(96px + env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

#content {
  flex: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.user-block {
  display: flex;
  gap: 12px;
  align-items: center;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.15);
}

.user-name { font-weight: 700; font-size: 15px; }
.user-handle { color: var(--muted); font-size: 12px; margin-top: 2px; }

.trust-badge {
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, rgba(20, 24, 43, 0.95), rgba(18, 22, 40, 0.8));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #d7dcf0;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.05);
}

.ticker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--green);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

#tickerText {
  overflow: hidden;
  text-overflow: ellipsis;
}

#tickerText.ticker-flash {
  animation: ticker-in 0.35s ease;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

@keyframes ticker-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 12px;
}

.card.glow {
  box-shadow: 0 0 0 1px rgba(91, 140, 255, 0.08), 0 12px 40px rgba(0, 0, 0, 0.35);
}

.card-title {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 600;
}

.balance-value {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 2px 0 10px;
}

.progress-line {
  height: 7px;
  background: #1a1f35;
  border-radius: 999px;
  overflow: hidden;
}

.progress-line > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.muted { color: var(--muted); font-size: 13px; line-height: 1.45; }

.cta-btn {
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 18px 16px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #4f7cff 0%, #7c5cff 100%);
  color: white;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 30px rgba(79, 124, 255, 0.25);
}

.cta-btn:active { transform: scale(0.985); }

.cta-title { font-size: 17px; font-weight: 700; display: block; }
.cta-sub { font-size: 12px; opacity: 0.85; margin-top: 4px; display: block; }
.cta-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card { text-align: center; padding: 16px 10px; }

.ring-wrap {
  width: 88px;
  height: 88px;
  margin: 0 auto 10px;
  position: relative;
}

.ring-wrap svg { transform: rotate(-90deg); }
.ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}

.level-badge {
  display: inline-block;
  background: rgba(251, 146, 60, 0.15);
  color: var(--orange);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 8px 0 10px;
}

.promo-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.promo-scroll::-webkit-scrollbar { display: none; }

.promo-card {
  min-width: 240px;
  border-radius: 18px;
  padding: 16px;
  color: white;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
}

.promo-blue { background: linear-gradient(135deg, #2563eb, #4f46e5); }
.promo-orange { background: linear-gradient(135deg, #ea580c, #f59e0b); }
.promo-purple { background: linear-gradient(135deg, #7c3aed, #a855f7); }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 10px;
  padding: 10px 2px 4px;
}

.quick-item {
  background: transparent;
  border: none;
  padding: 0;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}

.quick-item:active .quick-icon {
  transform: scale(0.96);
}

.quick-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: #151933;
  border: 1px solid rgba(91, 140, 255, 0.18);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.04);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.quick-item.accent .quick-icon {
  border-color: rgba(91, 140, 255, 0.55);
  box-shadow: 0 0 18px rgba(91, 140, 255, 0.35);
  background: radial-gradient(circle at 30% 30%, #2a3568, #151933 70%);
}

.quick-label {
  display: block;
  font-weight: 600;
  color: #c9d0ea;
}

.balance-remain {
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

.cta-btn {
  gap: 12px;
}

.cta-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cta-inbox {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.stat-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.stat-note.orange { color: var(--orange); }

.level-progress {
  margin-top: 14px;
}

.level-progress-text {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.account-card {
  background: #171b2d;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
}

.account-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: #c9d0ea;
}

.pill.green {
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
}

.pill.red {
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
}

.account-link {
  font-size: 13px;
  word-break: break-all;
  color: #d7dcf0;
  margin-bottom: 10px;
}

.copy-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: #0b0e19;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
}

.copy-inline input {
  margin: 0;
  border: none;
  padding: 0;
  background: transparent;
  flex: 1;
  min-width: 0;
}

.copy-inline button {
  border: none;
  background: var(--blue);
  color: white;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.ref-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.ref-stat {
  background: #171b2d;
  border-radius: 16px;
  padding: 14px;
}

.ref-stat .value {
  font-size: 22px;
  font-weight: 800;
  margin-top: 6px;
}

.ref-stat .value.green { color: var(--green); }
.ref-stat .value.blue { color: var(--blue); }

.ref-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.ref-user-row {
  background: #171b2d;
  border-radius: 12px;
  padding: 10px 12px;
}

.training-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.training-tab {
  border: none;
  border-radius: 999px;
  padding: 11px 10px;
  background: #171b2d;
  color: #d7dcf0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  width: 100%;
}

.training-tab.active {
  background: white;
  color: #111;
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.12);
}

.training-card {
  background: #171b2d;
  border-radius: 18px;
  padding: 16px;
}

.training-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.training-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.train-step {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.train-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.train-step strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.train-step span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.support-sheet {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
}

.support-chat {
  flex: 1;
  min-height: 220px;
  max-height: 45vh;
  overflow-y: auto;
  background: #171b2d;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}

.support-bubble {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 8px;
  color: #d7dcf0;
}

.support-bubble.system {
  background: rgba(91, 140, 255, 0.12);
}

.support-bubble.mine {
  background: rgba(139, 92, 246, 0.2);
  margin-left: 24px;
}

.support-compose {
  display: flex;
  gap: 8px;
  align-items: center;
}

.support-compose input {
  margin: 0;
  flex: 1;
}

.support-send {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f7cff, #7c5cff);
  color: white;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.cancel-sheet {
  text-align: center;
  padding-top: 22px;
}

.cancel-warn-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  color: #111;
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.28);
}

.cancel-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
}

.cancel-text {
  margin: 0 auto 14px;
  max-width: 340px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.cancel-text b { color: #e8ecff; }

.cancel-limit {
  display: inline-block;
  margin: 0 auto 16px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(251, 146, 60, 0.45);
  color: #fdba74;
  font-size: 13px;
  font-weight: 700;
  background: rgba(251, 146, 60, 0.08);
}

.cancel-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 18px;
  color: #c9d0ea;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.cancel-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.cancel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cancel-keep,
.cancel-confirm {
  border-radius: 16px;
  padding: 14px 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.cancel-keep {
  border: 1px solid var(--border);
  background: #1a2038;
  color: var(--text);
}

.cancel-confirm {
  border: 1px solid rgba(248, 113, 113, 0.55);
  background: transparent;
  color: #fca5a5;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  flex: 1;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: white;
  color: #111;
  border-color: white;
}

.task-card { position: relative; overflow: hidden; }

.task-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.platform-name { font-weight: 800; font-size: 17px; }

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(91, 140, 255, 0.18);
  color: #9db7ff;
}

.status-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(91, 140, 255, 0.15);
  color: var(--blue);
  font-weight: 600;
}

.status-pill.status-active,
.status-pill.status-submit { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
.status-pill.status-review { background: rgba(91, 140, 255, 0.18); color: #93c5fd; }
.status-pill.status-late { background: rgba(251, 146, 60, 0.18); color: var(--orange); }
.status-pill.status-waiting { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.status-pill.status-done { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.status-pill.status-cancelled,
.status-pill.status-expired { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

.meta-chip {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.payout-chip {
  color: var(--green);
  font-weight: 800;
  font-size: 14px;
  background: rgba(52, 211, 153, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
}

.task-block {
  background: #0b0e19;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin-top: 10px;
}

.task-block-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.task-preview {
  font-size: 13px;
  line-height: 1.45;
  color: #d7dcf0;
  margin-top: 4px;
}

.mini-btn {
  border: none;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  flex-shrink: 0;
}

.mini-btn:disabled,
.tg-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tg-btn {
  background: rgba(91, 140, 255, 0.18);
  color: #9db7ff;
}

.tg-action {
  flex: 1;
  min-width: 140px;
  border: none;
  border-radius: 14px;
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #4f7cff, #6b5cff);
  color: white;
}

.btn-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.footer-actions { margin-top: 10px; }

button.ghost-btn, button.success-btn, button.primary-btn, button.danger-btn {
  border: none;
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  min-width: 120px;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
}

.danger-btn {
  background: rgba(248, 113, 113, 0.08);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.success-btn {
  background: #22c55e;
  color: #052e1a;
  margin-top: 12px;
  width: 100%;
}

.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(91, 140, 255, 0.2);
  color: #9db7ff;
  font-size: 12px;
  margin-left: 6px;
}

.archive-card .archive-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.archive-title {
  font-weight: 700;
  font-size: 15px;
}

.archive-rows {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.archive-rows div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.archive-rows b { color: var(--text); font-weight: 700; }
.archive-rows b.green { color: var(--green); }

.primary-btn {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: white;
  width: 100%;
}

.auto-card {
  text-align: center;
  padding: 24px 16px;
}

.auto-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(91, 140, 255, 0.12);
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  font-size: 24px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  right: auto;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(8, 10, 20, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 8px 6px calc(10px + env(safe-area-inset-bottom));
  max-width: 520px;
  z-index: 50;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 11px;
  padding: 6px 4px;
  position: relative;
  cursor: pointer;
}

.nav-btn.active { color: var(--blue); font-weight: 700; }

.nav-icon {
  display: block;
  font-size: 18px;
  margin-bottom: 3px;
}

.badge {
  position: absolute;
  top: 0;
  right: 14px;
  background: var(--red);
  color: white;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  font-weight: 700;
}

.badge.hidden { display: none; }

.trust-badge {
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.trust-shield { margin-right: 2px; }

.rewards-level-card .level-name {
  font-size: 28px;
  font-weight: 800;
  margin: 4px 0 8px;
}

.level-progress-wrap { margin-top: 14px; }

.level-progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.achievement {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 8px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
}

.achievement-icon {
  font-size: 28px;
  line-height: 1;
  filter: grayscale(1);
  opacity: 0.45;
}

.achievement-title {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  color: var(--muted);
}

.achievement.unlocked {
  border-color: rgba(251, 146, 60, 0.35);
  background: rgba(251, 146, 60, 0.08);
  box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.12);
}

.achievement.unlocked .achievement-icon {
  filter: none;
  opacity: 1;
}

.achievement.unlocked .achievement-title {
  color: var(--text);
}

.leader-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.leader-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.leader-rank {
  width: 18px;
  font-weight: 700;
  color: var(--muted);
}

.leader-row.gold .leader-rank { color: #fbbf24; }
.leader-row.silver .leader-rank { color: #cbd5e1; }
.leader-row.bronze .leader-rank { color: #d97706; }

.leader-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1a2038;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.leader-views { color: var(--muted); white-space: nowrap; }

.leader-dots {
  text-align: center;
  color: var(--muted);
  padding: 8px 0;
  letter-spacing: 2px;
}

.leader-row.me {
  background: rgba(91, 140, 255, 0.1);
  border-radius: 12px;
  padding: 10px;
  border: 1px solid rgba(91, 140, 255, 0.2);
  margin-top: 4px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: end center;
  z-index: 100;
  padding: 12px;
}

.modal-overlay.hidden { display: none; }

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: #101322;
  border: 1px solid var(--border);
  border-radius: 22px 22px 18px 18px;
  padding: 18px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.modal-icon {
  font-size: 54px;
  text-align: center;
  margin: 8px 0 12px;
}

.modal-heading {
  text-align: center;
  font-size: 22px;
  margin: 0 0 12px;
}

.modal-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 16px;
}

.modal-rules {
  background: #171b2d;
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 14px;
}

.rule-item {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #d7dcf0;
}

.rule-icon { font-size: 18px; flex-shrink: 0; }

.modal-score {
  margin-top: 16px;
  text-align: center;
  color: var(--blue);
  font-weight: 700;
  font-size: 15px;
}

.achievement-toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 452px;
  background: rgba(18, 21, 40, 0.96);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.4;
  z-index: 90;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.achievement-toast.hidden { display: none; }

input, select {
  width: 100%;
  background: #0b0e19;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 14px;
  padding: 14px;
  margin-top: 8px;
  font-size: 14px;
  outline: none;
}

input:focus, select:focus {
  border-color: rgba(91, 140, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.12);
}

input.input-error, select.input-error {
  border-color: rgba(248, 113, 113, 0.7);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  cursor: pointer;
}

.select-wrap::after {
  content: "▾";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-20%);
  color: var(--muted);
  pointer-events: none;
  font-size: 14px;
}

.field-error {
  margin-top: 8px;
  color: #fecaca;
  font-size: 12px;
  line-height: 1.4;
}

.field-error.hidden { display: none; }

.payout-card .primary-btn {
  background: linear-gradient(135deg, #4f7cff, #6b5cff);
}

label.field-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 12px;
  font-weight: 600;
}

.error-box {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #fecaca;
  padding: 16px;
  border-radius: 18px;
  line-height: 1.5;
}

.loader {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.loader-ring {
  width: 42px;
  height: 42px;
  border: 3px solid #1f2438;
  border-top-color: var(--blue);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 28px 12px;
  color: var(--muted);
}

.stat-tile {
  background: #0b0e19;
  border-radius: 14px;
  padding: 12px;
}

.stat-tile .value { font-size: 20px; font-weight: 800; margin-top: 4px; }
.stat-tile .value.green { color: var(--green); }
.stat-tile .value.blue { color: var(--blue); }
