:root {
  --bg: #050a14;
  --bg-elevated: #0c1424;
  --card: #121c2f;
  --card-border: rgba(33, 150, 243, 0.12);
  --text: #f4f7fc;
  --muted: #8b95a8;
  --blue: #2176ff;
  --blue-bright: #0088ff;
  --green: #00c853;
  --green-neon: #00e676;
  --ticker-green: #34d399;
  --radius: 16px;
  --radius-sm: 12px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  overflow-x: hidden;
}

a {
  color: var(--blue-bright);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  min-height: 100dvh;
  padding: calc(12px + var(--safe-top)) 16px calc(20px + var(--safe-bottom));
  max-width: 440px;
  margin: 0 auto;
  position: relative;
}

/* —— Telegram gate —— */
.tg-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 10, 20, 0.92);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.tg-gate.is-open {
  opacity: 1;
  pointer-events: auto;
}

.tg-gate__card {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(165deg, #121c2f 0%, #0a101f 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.tg-gate__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #2962ff, #0d47a1);
  display: grid;
  place-items: center;
  font-size: 28px;
  box-shadow: 0 0 32px rgba(33, 118, 255, 0.45);
}

.tg-gate__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.tg-gate__text {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 22px;
}

.tg-gate__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

a.btn {
  text-decoration: none;
  box-sizing: border-box;
}

.tg-go-miniapp {
  display: none;
}

.tg-gate--strict .tg-go-miniapp {
  display: inline-flex;
}
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: linear-gradient(180deg, #1a8cff 0%, var(--blue-bright) 100%);
  color: #fff;
  padding: 14px 20px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0, 136, 255, 0.35);
}

.btn--primary:hover {
  box-shadow: 0 6px 32px rgba(0, 136, 255, 0.45);
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
  padding: 12px;
  font-size: 0.88rem;
}

.btn--green {
  background: linear-gradient(180deg, #00e676 0%, var(--green) 100%);
  color: #041208;
  padding: 15px 20px;
  width: 100%;
  font-weight: 700;
  box-shadow: 0 4px 28px rgba(0, 230, 118, 0.35);
}

.btn--green:hover {
  box-shadow: 0 6px 36px rgba(0, 230, 118, 0.45);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* —— Header —— */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.link-back {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.link-back:hover {
  color: var(--text);
}

/* —— Live ticker —— */
.ticker-wrap {
  overflow: hidden;
  margin: 0 -16px 20px;
  padding: 8px 0;
  background: rgba(12, 20, 36, 0.6);
  border-block: 1px solid rgba(255, 255, 255, 0.04);
}

.ticker {
  display: flex;
  gap: 28px;
  width: max-content;
  animation: ticker 38s linear infinite;
}

@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  white-space: nowrap;
  color: var(--muted);
}

.ticker-item span.user {
  color: var(--text);
}

.ticker-item span.sum {
  color: var(--ticker-green);
  font-weight: 700;
}

.badge-live {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ff5252;
  margin-right: 6px;
}

/* —— Hero landing —— */
.hero-title {
  font-size: clamp(1.65rem, 5.5vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  margin: 8px 0 14px;
  letter-spacing: -0.03em;
}

.hero-title .grad {
  background: linear-gradient(135deg, #4da3ff 0%, var(--blue-bright) 50%, #00b4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 auto 28px;
  max-width: 320px;
}

.hero-cta-wrap {
  text-align: center;
}

.hero-note {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 40px;
}

.stat-box {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  text-align: center;
  border: 1px solid var(--card-border);
}

.stat-box .num {
  font-size: 1.35rem;
  font-weight: 800;
}

.stat-box .lbl {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

/* —— Stepper —— */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 16px 0 28px;
  padding: 0 8px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  z-index: 1;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: #1a2438;
  color: var(--muted);
  border: 2px solid #2a3548;
}

.step.done .step-circle {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.step.active .step-circle {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 0 20px rgba(33, 118, 255, 0.5);
}

.step-label {
  font-size: 0.68rem;
  color: var(--muted);
  max-width: 64px;
  text-align: center;
  line-height: 1.2;
}

.step.done .step-label,
.step.active .step-label {
  color: var(--text);
  font-weight: 600;
}

.step-line {
  flex: 1;
  height: 2px;
  min-width: 24px;
  max-width: 48px;
  background: #2a3548;
  margin: 0 -4px;
  margin-bottom: 22px;
  align-self: center;
}

.step-line.done {
  background: linear-gradient(90deg, var(--green), var(--green));
}

/* —— Views —— */
.view {
  display: none;
  animation: fadeIn 0.35s ease;
}

.view.is-active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  margin: 0 0 8px;
}

.screen-sub {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 22px;
}

/* —— Dropzone —— */
.dropzone {
  border: 2px dashed rgba(33, 118, 255, 0.45);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  background: rgba(18, 28, 47, 0.5);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.drag {
  border-color: var(--blue-bright);
  background: rgba(33, 118, 255, 0.08);
}

.dropzone p {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.dropzone .dz-main {
  font-weight: 600;
  color: var(--text);
}

.upload-meta {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--muted);
}

.progress-track {
  height: 6px;
  background: #1a2438;
  border-radius: 99px;
  margin-top: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), #00b4ff);
  border-radius: 99px;
  transition: width 0.25s ease;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.thumb-slot {
  aspect-ratio: 1;
  border-radius: 10px;
  background: #0f1829;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  color: #3d4a63;
  font-weight: 600;
  overflow: hidden;
}

.thumb-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.footer-actions {
  margin-top: 28px;
}

/* —— Processing —— */
.process-center {
  text-align: center;
  padding: 20px 0 10px;
}

.process-emoji {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #1e3a5f, #0c1424);
  display: grid;
  place-items: center;
  font-size: 2rem;
  border: 1px solid rgba(33, 118, 255, 0.2);
}

.process-bar-wrap {
  max-width: 280px;
  margin: 16px auto 8px;
}

.process-pct {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--blue-bright);
}

.status-card {
  margin-top: 24px;
  padding: 16px 18px;
  background: rgba(18, 28, 47, 0.85);
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  text-align: left;
}

.status-card .tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #64b5f6;
  margin-bottom: 6px;
}

.status-card .name {
  font-weight: 700;
  font-size: 1.05rem;
}

.status-card .hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

/* —— Result —— */
.result-icon {
  width: 96px;
  height: 96px;
  margin: 24px auto 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #69f0ae, var(--green));
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  color: #fff;
  box-shadow: 0 0 48px rgba(0, 200, 83, 0.45);
}

.result-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--blue-bright);
  text-align: center;
  margin-bottom: 28px;
}

/* —— Cabinet —— */
.profile-head {
  text-align: center;
  padding: 8px 0 20px;
}

.avatar {
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #42a5f5, #1565c0);
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  box-shadow: 0 0 40px rgba(33, 150, 243, 0.35);
}

.handle {
  font-size: 1.2rem;
  font-weight: 800;
}

.badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(0, 200, 83, 0.15);
  color: var(--green-neon);
  font-size: 0.75rem;
  font-weight: 700;
}

.card-big {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--card-border);
  margin-bottom: 12px;
}

.card-big .label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #64b5f6;
  margin-bottom: 8px;
}

.card-big .value-xl {
  font-size: 2rem;
  font-weight: 800;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.info-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1px solid var(--card-border);
  margin-bottom: 10px;
}

.info-card .ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #1a2438;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.info-card .l {
  font-size: 0.72rem;
  color: var(--muted);
}

.info-card .v {
  font-weight: 600;
  font-size: 0.95rem;
}

.tx-live-wrap {
  margin-top: 24px;
}

.tx-live-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-neon);
  box-shadow: 0 0 10px var(--green-neon);
  animation: livePulse 1.4s ease-in-out infinite;
}

@keyframes livePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.92);
  }
}

.tx-list {
  margin-top: 0;
}

.tx-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  margin-bottom: 8px;
}

.tx-item .left .u {
  font-weight: 600;
  font-size: 0.9rem;
}

.tx-item .left .ap {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

.tx-item .amt {
  font-weight: 800;
  color: var(--green-neon);
  white-space: nowrap;
}

.tx-item.tx-item--enter {
  animation: txLiveEnter 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes txLiveEnter {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-foot {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 28px;
  padding-bottom: 8px;
}

/* —— Earn page —— */
.earn-icon {
  width: 72px;
  height: 72px;
  margin: 8px auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #00e676, #00a040);
  display: grid;
  place-items: center;
  font-size: 2rem;
  box-shadow: 0 0 36px rgba(0, 230, 118, 0.4);
}

.earn-card {
  border: 1px solid rgba(0, 230, 118, 0.35);
  border-radius: var(--radius);
  padding: 20px;
  background: rgba(0, 230, 118, 0.06);
  position: relative;
  overflow: hidden;
}

.earn-card .bag {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  opacity: 0.85;
}

.earn-card .top {
  font-size: 0.88rem;
  color: var(--muted);
  padding-right: 48px;
}

.earn-card .sum {
  font-size: 2rem;
  font-weight: 900;
  color: var(--green-neon);
  margin-top: 4px;
}

.earn-paywall {
  margin-top: 22px;
  padding: 18px 16px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  text-align: left;
}

.earn-paywall-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.earn-hr {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 0 14px;
  border: none;
}

.earn-paywall-text {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}

.earn-paywall-text b {
  font-weight: 700;
}

.earn-callout {
  padding: 12px 14px 12px 16px;
  border-left: 3px solid var(--blue-bright);
  background: rgba(33, 118, 255, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.timeline {
  margin-top: 28px;
}

.timeline h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 16px;
}

.tl-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  margin-bottom: 4px;
}

.tl-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2962ff;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  z-index: 1;
}

.tl-line {
  width: 2px;
  flex: 1;
  background: #2a3548;
  margin: -4px auto 0;
  min-height: 16px;
}

.tl-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tl-body {
  padding-bottom: 18px;
}

.tl-body strong {
  color: var(--text);
}

.tl-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.tl-callout {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #0f1829;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  color: var(--muted);
}

.hidden-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}
