:root {
  --ink: #050505;
  --ink-raised: rgba(20, 20, 20, 0.92);
  --paper: #F0F0F0;
  --gray-accent: #9a9a9a;
  --gray-bright: #E4E4E4;
  --gray-line: #333333;
  --gray-muted: #7a7a7a;
  --green: #3ECF8E;
  --green-pale: #46614F;
  --red: #E5484D;
  --red-pale: #6B3A3C;
  --font-body: 'Open Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #000;
  color: var(--paper);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

/* ===================================================================
   Chain backdrop — the user's own photo, at 50% opacity, slowly panning
   back and forth (not tiled — it's a single image, so a gentle Ken-Burns
   style drift reads as "moving chains" without visible seams).
   =================================================================== */
.chain-backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  background: #000;
}

.chain-layer {
  position: absolute;
  inset: -8%;
  background-image: url("assets/chains-bg.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  opacity: 0.5;
  filter: grayscale(0.3);
  animation: chainDrift 34s ease-in-out infinite alternate;
}

@keyframes chainDrift {
  0%   { background-position: 30% 30%; transform: scale(1); }
  50%  { background-position: 60% 55%; transform: scale(1.04); }
  100% { background-position: 40% 65%; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .chain-layer { animation: none; }
}

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 118px;
}

/* ===================================================================
   Splash screen — chain-link logo assembles out of darkness with a
   spark burst, the title glitches into place, then the whole thing
   fades out to reveal the app underneath.
   =================================================================== */
#splash {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#splash.fade-out {
  animation: splashFadeOut .6s ease forwards;
  pointer-events: none;
}
@keyframes splashFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.splash-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.splash-chain {
  width: 210px;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.15));
}

.splash-link {
  opacity: 0;
  transform-origin: center;
  animation: splashLinkIn .55s cubic-bezier(.34,1.56,.64,1) both;
}
.splash-link-1 { animation-delay: .05s; }
.splash-link-2 { animation-delay: .18s; }
.splash-link-3 { animation-delay: .31s; }
.splash-link-4 { animation-delay: .44s; }
.splash-link-5 { animation-delay: .57s; }

@keyframes splashLinkIn {
  0%   { opacity: 0; transform: translateY(-50px) rotate(-50deg) scale(0.4); }
  65%  { opacity: 1; transform: translateY(3px) rotate(6deg) scale(1.06); }
  100% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
}

.splash-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--gray-bright);
  opacity: 0;
  animation: splashGlitch .7s steps(1) .85s forwards;
}
@keyframes splashGlitch {
  0%   { opacity: 0; transform: translateX(0); text-shadow: none; }
  8%   { opacity: 1; transform: translateX(-4px); text-shadow: 3px 0 rgba(255,255,255,0.4), -3px 0 rgba(255,255,255,0.2); }
  16%  { transform: translateX(3px); }
  24%  { transform: translateX(-2px); opacity: 0.4; }
  32%  { opacity: 1; transform: translateX(2px); text-shadow: -2px 0 rgba(255,255,255,0.3), 2px 0 rgba(255,255,255,0.15); }
  40%  { transform: translateX(0); text-shadow: none; }
  100% { opacity: 1; transform: translateX(0); text-shadow: none; }
}

.splash-particles { position: absolute; inset: 0; pointer-events: none; }
.splash-spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gray-bright);
  opacity: 0;
  animation: splashSparkFly .7s ease-out forwards;
}
@keyframes splashSparkFly {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  35%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) scale(1.2); }
}

/* ===== Ledger header ===== */
/* ===== Online-now bar ===== */
.online-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: calc(8px + var(--tg-safe-top, env(safe-area-inset-top, 0px))) 12px 6px;
  font-size: 11.5px;
  color: var(--gray-muted);
  background: rgba(6, 6, 6, 0.9);
  backdrop-filter: blur(3px);
}
.online-bar #online-count { font-weight: 700; color: var(--gray-bright); font-family: var(--font-mono); }
.online-label { text-transform: uppercase; letter-spacing: 0.04em; font-size: 10px; }
.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(62, 207, 142, 0.7);
  animation: onlinePulse 1.6s ease-in-out infinite;
}
@keyframes onlinePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.ledger-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px 10px;
  background: rgba(6, 6, 6, 0.9);
  border-bottom: 1px solid var(--gray-line);
  backdrop-filter: blur(3px);
}

/* Avatar seal: initials sit underneath, the Telegram photo (if any) covers
   them once it loads; onerror hides the img so initials show through. */
.seal {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--gray-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 700;
  font-size: 16px;
  color: var(--gray-bright);
  background: #1a1a1a;
}
.seal img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ledger-main { flex: 1 1 auto; min-width: 0; }

.ledger-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--paper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger-title {
  font-size: 12px;
  color: var(--gray-bright);
  letter-spacing: 0.02em;
  margin-top: 2px;
  font-weight: 600;
}

.ledger-balance { flex: 0 0 auto; text-align: right; }

.balance-figure {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 21px;
  color: var(--gray-bright);
}

.balance-unit {
  font-size: 10px;
  color: var(--gray-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ledger-substats {
  display: flex;
  padding: 10px 16px 14px;
  gap: 10px;
  border-bottom: 1px solid var(--gray-line);
  background: rgba(5, 5, 5, 0.88);
  backdrop-filter: blur(3px);
}

.substat {
  flex: 1;
  background: var(--ink-raised);
  border: 1px solid var(--gray-line);
  border-radius: 8px;
  padding: 9px 10px;
  text-align: center;
}

.substat-label {
  display: block;
  font-size: 10px;
  color: var(--gray-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.substat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--paper);
}

/* ===================================================================
   Panels / tabs — FIX: panels used to be `position:absolute` at all
   times, which pulled them out of normal flow and collapsed #panels to
   zero height (absolutely positioned elements don't contribute to a
   parent's height). That's what caused the layout to break, especially
   noticeable on wide/desktop viewports. Fix: panels are normal flow
   (position:static) by default and only become position:absolute for
   the brief moment they're mid-transition, so the container always has
   a correct height the rest of the time.
   =================================================================== */
main#panels {
  flex: 1;
  padding: 18px 16px 8px;
  position: relative;
}

.panel { display: none; }
.panel.active { display: block; }

@keyframes staggerIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.panel.active > * {
  animation: staggerIn .32s cubic-bezier(.25,.46,.45,.94) both;
}
.panel.active > *:nth-child(1) { animation-delay: 0s; }
.panel.active > *:nth-child(2) { animation-delay: .04s; }
.panel.active > *:nth-child(3) { animation-delay: .08s; }
.panel.active > *:nth-child(4) { animation-delay: .12s; }
.panel.active > *:nth-child(5) { animation-delay: .16s; }
.panel.active > *:nth-child(6) { animation-delay: .2s; }
.panel.active > *:nth-child(7) { animation-delay: .24s; }
.panel.active > *:nth-child(8) { animation-delay: .28s; }
.panel.active > *:nth-child(n+9) { animation-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .panel.active > * { animation: none; }
}

.panel.transitioning {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 18px;
}

.panel.slide-in-right { animation: slideInRight .3s cubic-bezier(.25,.46,.45,.94) forwards; }
.panel.slide-in-left  { animation: slideInLeft  .3s cubic-bezier(.25,.46,.45,.94) forwards; }
.panel.slide-out-right { animation: slideOutRight .3s cubic-bezier(.55,.06,.68,.19) forwards; }
.panel.slide-out-left  { animation: slideOutLeft  .3s cubic-bezier(.55,.06,.68,.19) forwards; }

@keyframes slideInRight { from { transform: translateX(32px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInLeft  { from { transform: translateX(-32px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-32px); opacity: 0; } }
@keyframes slideOutLeft  { from { transform: translateX(0); opacity: 1; } to { transform: translateX(32px); opacity: 0; } }

.section-title { margin-bottom: 14px; }
.eyebrow {
  font-size: 11px;
  color: var(--gray-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.section-title h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 3px 0 0;
  color: var(--paper);
}

/* ===== Segmented toggle (Market: Свободные / Украсть) ===== */
/* ===== Shop bars (Монеты / Услуги / Фарм) ===== */
/* ===== Shop menu (Монеты / Услуги / Фарм stacked buttons) ===== */
#shop-menu { display: flex; flex-direction: column; gap: 10px; }
.shop-menu-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid var(--gray-accent);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--ink-raised);
  box-shadow: 0 3px 0 #000, 0 6px 10px rgba(0,0,0,0.4);
  transition: transform .12s cubic-bezier(.4,0,.2,1), box-shadow .12s cubic-bezier(.4,0,.2,1);
}
.shop-menu-btn:active { transform: translateY(3px); box-shadow: 0 0 0 #000, 0 1px 3px rgba(0,0,0,0.3); }
.shop-menu-title { font-size: 16px; font-weight: 700; color: var(--paper); }
.shop-menu-sub { font-size: 11.5px; color: var(--gray-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.shop-bar {
  border: 1px solid var(--gray-line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.015);
}
.shop-bar-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
  padding-left: 2px;
}

.segmented {
  display: flex;
  gap: 4px;
  background: var(--ink-raised);
  border: 1px solid var(--gray-line);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 14px;
}
.segmented-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--gray-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12.5px;
  padding: 8px 4px;
  border-radius: 7px;
  transition: background .15s ease, color .15s ease;
}
.segmented-btn.active {
  background: rgba(154, 154, 154, 0.16);
  color: var(--gray-bright);
}

/* ===== List rows ===== */
.list { display: flex; flex-direction: column; gap: 7px; }

.ledger-row {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--ink-raised);
  border: 1px solid var(--gray-accent);
  border-radius: 10px;
  padding: 10px 11px;
}

.row-seal {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 700;
  font-size: 13px;
  color: var(--gray-bright);
  background: #1a1a1a;
}
.row-seal img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row-name {
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-leader {
  flex: 1;
  border-bottom: 1px dotted #444;
  margin: 0 6px;
  min-width: 12px;
  transform: translateY(-3px);
}

.row-value {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--gray-bright);
  white-space: nowrap;
}

.row-actions { display: flex; gap: 6px; margin-top: 8px; width: 100%; }
.row-meta { font-size: 10.5px; color: var(--gray-muted); margin-top: 2px; }
.rank-badge { font-family: var(--font-mono); font-size: 11px; color: var(--gray-bright); width: 22px; text-align: center; }

.empty-state {
  text-align: center;
  padding: 30px 10px;
  color: #5c5c5c;
  font-size: 13px;
}

/* ===== Farm tab ===== */
.farm-counter-wrap { text-align: center; margin-bottom: 28px; }
.farm-counter {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-bright);
  transition: transform .1s ease;
}
.farm-counter.bump { transform: scale(1.1); }
.farm-counter-label {
  font-size: 11px;
  color: var(--gray-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.farm-btn-wrap {
  display: flex;
  justify-content: center;
  position: relative;
  height: 260px;
  align-items: center;
}

.farm-btn {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 3px solid var(--gray-accent);
  background:
    linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%),
    radial-gradient(circle at 35% 30%, #333, #0a0a0a 70%);
  background-size: 300% 300%, 100% 100%;
  background-position: 0% 0%, 0 0;
  color: var(--gray-bright);
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 6px 0 #000, 0 12px 22px rgba(0,0,0,0.5);
  transition: transform .06s ease, box-shadow .06s ease;
  animation: farmShimmer 2.6s ease-in-out infinite;
  overflow: visible;
}
.farm-btn:active { transform: translateY(5px) scale(0.97); box-shadow: 0 1px 0 #000, 0 3px 8px rgba(0,0,0,0.4); }
.farm-btn.locked { animation: none; opacity: 0.4; border-color: var(--gray-line); }
@keyframes farmShimmer {
  0%   { background-position: 0% 0%, 0 0; }
  50%  { background-position: 100% 100%, 0 0; }
  100% { background-position: 0% 0%, 0 0; }
}

.farm-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-bright);
  pointer-events: none;
  animation: farmParticleFly .7s ease-out forwards;
}
@keyframes farmParticleFly {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.8); }
  100% { opacity: 0; transform: translate(var(--fx), var(--fy)) scale(1.1); }
}

/* ===== Buttons — 3D press ===== */
.mini-btn {
  flex: 1;
  border: 1px solid var(--gray-accent);
  background: #181818;
  color: var(--gray-bright);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  padding: 7px 6px;
  border-radius: 7px;
  box-shadow: 0 3px 0 #050505, 0 5px 8px rgba(0,0,0,0.4);
  transition: transform .12s cubic-bezier(.4,0,.2,1), box-shadow .12s cubic-bezier(.4,0,.2,1), background .15s ease;
}
.mini-btn:active { transform: translateY(3px); box-shadow: 0 0 0 #050505, 0 1px 2px rgba(0,0,0,0.3); background: #101010; }
.mini-btn.collect { border-color: var(--green); color: var(--green); }
.mini-btn.collect:active { background: var(--green-pale); color: #cfe9db; }
.mini-btn.collect.just-collected { background: var(--green-pale); color: #cfe9db; }

.mini-btn.buy {
  border-color: var(--green);
  color: var(--green);
  font-weight: 700;
  background: linear-gradient(180deg, rgba(62, 207, 142, 0.14), rgba(62, 207, 142, 0.02));
}
.mini-btn.buy:active { background: var(--green-pale); color: #cfe9db; }
.mini-btn.danger { border-color: var(--red); color: #f0a2a4; }
.mini-btn.danger:active { background: var(--red-pale); }

.action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #151515;
  border: 1px solid var(--gray-line);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  box-shadow: 0 3px 0 #000, 0 6px 10px rgba(0,0,0,0.45);
  transition: transform .12s cubic-bezier(.4,0,.2,1), box-shadow .12s cubic-bezier(.4,0,.2,1), background .15s ease;
}
.action-btn.primary { border-color: var(--gray-accent); background: linear-gradient(180deg, rgba(154,154,154,0.14), rgba(154,154,154,0.03)); }
.action-btn:active { transform: translateY(3px); box-shadow: 0 0 0 #000, 0 1px 3px rgba(0,0,0,0.3); background: #0e0e0e; }
.btn-sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--gray-bright); }

.hint-box {
  font-size: 12.5px;
  color: var(--gray-muted);
  background: var(--ink-raised);
  border: 1px dashed var(--gray-line);
  border-radius: 8px;
  padding: 12px;
  margin-top: 4px;
  margin-bottom: 10px;
  word-break: break-all;
}

.invite-copy { font-size: 13.5px; color: var(--gray-muted); line-height: 1.5; margin-bottom: 16px; }

/* ===== Profile: rank progress + streak cards ===== */
.profile-status-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 14px;
  border: 1.5px solid var(--green);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(62, 207, 142, 0.08);
}
.profile-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px rgba(62, 207, 142, 0.6);
}
.profile-status-box.enslaved { color: var(--red); border-color: var(--red); background: rgba(229, 72, 77, 0.08); }
.profile-status-box.enslaved .profile-status-dot { background: var(--red); box-shadow: 0 0 7px rgba(229, 72, 77, 0.6); }

.rank-progress-card {
  background: var(--ink-raised);
  border: 1px solid var(--gray-line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.rank-progress-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.rank-progress-current { font-weight: 700; font-size: 15px; color: var(--paper); }
.rank-progress-next { font-size: 11.5px; color: var(--gray-muted); }
.rank-progress-bar { height: 6px; border-radius: 3px; background: #232323; overflow: hidden; }
.rank-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gray-accent), var(--gray-bright));
  border-radius: 3px;
  transition: width .4s ease;
}

.streak-card {
  background: var(--ink-raised);
  border: 1px solid var(--gray-line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.streak-label { font-size: 11px; color: var(--gray-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.streak-dots { display: flex; gap: 6px; }
.streak-dot { width: 15px; height: 15px; border-radius: 50%; background: #232323; border: 1px solid var(--gray-line); }
.streak-dot.filled { background: var(--green); border-color: var(--green); box-shadow: 0 0 7px rgba(62, 207, 142, 0.5); }

.status-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ink-raised);
  border: 1px solid var(--green);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 12.5px;
}
.status-badge .badge-title { color: var(--green); font-weight: 700; }
.status-badge .badge-time { color: var(--gray-muted); font-family: var(--font-mono); font-size: 11.5px; }

/* ===== Glow buttons: green (positive) / red (danger) / dim (used up) ===== */
.glow-btn.green,
#btn-daily.available {
  border-color: var(--green);
  background: linear-gradient(180deg, rgba(62, 207, 142, 0.16), rgba(62, 207, 142, 0.03));
}
.glow-btn.green .btn-sub,
#btn-daily.available .btn-sub { color: #9beec4; }

.glow-btn.red {
  border-color: var(--red);
  background: linear-gradient(180deg, rgba(229, 72, 77, 0.16), rgba(229, 72, 77, 0.03));
}
.glow-btn.red .btn-sub { color: #f0a2a4; }

#btn-daily.collected {
  opacity: 0.5;
  border-color: var(--gray-line) !important;
  background: #161616 !important;
  animation: none !important;
}

/* ===== Invite tab hero + reward cards ===== */
.invite-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ink-raised);
  border: 1px solid var(--gray-line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.invite-hero-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--green);
}
.invite-hero-title { font-weight: 700; font-size: 14.5px; color: var(--paper); }
.invite-hero-sub { font-size: 12px; color: var(--gray-muted); margin-top: 2px; }

.invite-rewards { display: flex; gap: 10px; margin-bottom: 18px; }
.invite-reward-card {
  flex: 1;
  background: var(--ink-raised);
  border: 1px solid var(--gray-line);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}
.invite-reward-figure {
  display: block;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 4px;
}
.invite-reward-label { font-size: 10.5px; color: var(--gray-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ===== Bottom tab bar ===== */
.tabbar {
  position: fixed;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  display: flex;
  background: rgba(16, 16, 16, 0.97);
  border: 1px solid var(--gray-line);
  border-radius: 16px;
  padding: 10px 4px;
  z-index: 2;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: #6b6b6b;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  padding: 8px 2px;
  border-radius: 8px;
  transition: background .18s cubic-bezier(.4,0,.2,1), color .18s ease;
}
.tab-btn.active { color: var(--gray-bright); background: rgba(154, 154, 154, 0.12); }
.tab-btn:active { background: rgba(154, 154, 154, 0.08); }

/* ===== Big in-app alert: "you've been enslaved" ===== */
#big-alert {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  padding: 24px;
}
#big-alert.show { display: flex; }
#big-alert-card {
  background: #111;
  border: 2px solid var(--gray-accent);
  border-radius: 14px;
  padding: 28px 22px;
  text-align: center;
  max-width: 340px;
  transform: scale(0);
}
#big-alert.show #big-alert-card { animation: bigAlertPop .5s cubic-bezier(.34, 1.56, .64, 1) forwards; }
@keyframes bigAlertPop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
#big-alert-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-bright);
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
#big-alert-body {
  font-size: 14px;
  color: var(--gray-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}
#big-alert-close {
  border: 1px solid var(--gray-accent);
  background: #1c1c1c;
  color: var(--gray-bright);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 8px;
}
#big-alert-close:active { background: #0e0e0e; }

/* ===== Toast — pop-up & bounce ===== */
#toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  background: #131313;
  border: 1px solid var(--gray-accent);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 13px;
  max-width: 90%;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0);
  z-index: 50;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}
#toast.show { animation: popBounce .42s cubic-bezier(.34, 1.56, .64, 1) forwards; }
#toast.hide { animation: popFade .18s ease forwards; }
@keyframes popBounce {
  0%   { transform: translateX(-50%) scale(0);  opacity: 0; }
  60%  { transform: translateX(-50%) scale(1.1); opacity: 1; }
  100% { transform: translateX(-50%) scale(1);   opacity: 1; }
}
@keyframes popFade {
  from { transform: translateX(-50%) scale(1); opacity: 1; }
  to   { transform: translateX(-50%) scale(0.85); opacity: 0; }
}
