/* edilbot mini app — visual system.
   Theme: golden yellow on deep black. Deliberately brand-consistent, so it
   does NOT inherit Telegram's per-user theme variables — the app looks the
   same in every client. */

/* Nexa — self-hosted in fonts/ (see fonts/README.md). Missing files just
   fall through to Jost, then the platform sans. */
@font-face {
  font-family: "Nexa";
  src: url("/fonts/NexaRegular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Nexa";
  src: url("/fonts/NexaBold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Nexa";
  src: url("/fonts/NexaHeavy.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg:          #0a0a0c;
  --bg-2:        #0f0f12;
  --surface:     #16161a;
  --surface-hi:  #1e1e24;
  --line:        rgba(255, 255, 255, 0.08);
  --line-gold:   rgba(245, 197, 66, 0.22);

  --gold:        #f5c542;
  --gold-bright: #ffd866;
  --gold-deep:   #c99a24;
  --gold-grad:   linear-gradient(135deg, #ffe08a 0%, #f5c542 42%, #d7a52c 100%);

  --ink:         #f6f5f2;
  --ink-dim:     #a3a3ab;
  --ink-mute:    #6e6e77;
  --good:        #4ade80;
  --bad:         #ff6b6b;

  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;

  --shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  --tabbar-h: 62px;
  --topbar-h: 52px;

  /* Nexa throughout, Jost (web) then platform sans as fallbacks.
     `--font-display` stays as a separate name for the "value" moments
     (wordmark, prize, totals, timers) even though it resolves the same. */
  --font-ui: "Nexa", "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Nexa", "Jost", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

button { font-family: inherit; }

::selection { background: var(--gold); color: #000; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- shell ---------- */

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background:
    radial-gradient(120% 240px at 50% -40px, rgba(245, 197, 66, 0.10), transparent 70%),
    var(--bg);
  position: relative;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: calc(11px + env(safe-area-inset-top)) 18px 10px;
  background: linear-gradient(var(--bg) 68%, transparent);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Wallet balance — a pill on the right of the app bar; taps through to
   /deposit. Amount in white, a gold "+" segment as the deposit affordance. */
.balance {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 5px 5px 13px;
  border-radius: 999px;
  background: var(--surface-hi);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: transform 0.08s ease, border-color 0.15s ease;
}
.balance:active { transform: scale(0.96); }
.balance:hover { border-color: var(--line-gold); }

.balance-val {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.balance-add {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #1a1400;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gold);
}

.brand-mark b { color: var(--ink); font-weight: 800; }

.brand-sub {
  margin-top: 1px;
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.01em;
}

@media (max-width: 360px) {
  .brand-sub { display: none; }
}

/* ---------- live draw (full-screen takeover) ---------- */

.live {
  position: fixed;
  inset: 0;
  margin: 0 auto; /* centre within max-width — NOT transform: the fade-up
                     animation below sets `transform` and would clobber it */
  max-width: 480px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(88% 50% at 50% 20%, rgba(245, 197, 66, 0.13), transparent 70%),
    var(--bg);
  animation: fade-up 0.24s ease both;
}

.live-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 18px 10px;
}

.live-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.live-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease;
}
.live-close:active { transform: scale(0.92); }

.live-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 0 32px calc(48px + env(safe-area-inset-bottom));
}

.live-ring {
  position: relative;
  width: 152px;
  height: 152px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.live-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 6%, var(--gold-bright) 40%, var(--gold) 54%, transparent 76% 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
}
.live-ring.is-idle::before {
  background: conic-gradient(from 0deg, rgba(245, 197, 66, 0.20), rgba(245, 197, 66, 0.05));
}
.live-ring.is-spinning::before { animation: spin 0.9s linear infinite; }
.live-ring.is-done::before {
  background: var(--gold);
  box-shadow: 0 0 34px rgba(245, 197, 66, 0.35);
}

.live-ring-num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.is-spinning .live-ring-num { animation: flicker 0.5s ease-in-out infinite alternate; }
.is-done .live-ring-num {
  color: var(--ink);
  font-size: 34px;
  animation: reveal 0.35s ease both;
}

.live-emoji { font-size: 44px; }

.live-headline {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}
.live-headline.gold {
  color: var(--gold);
  text-shadow: 0 0 26px rgba(245, 197, 66, 0.3);
}

.live-sub {
  font-size: 14px;
  color: var(--ink-dim);
  max-width: 32ch;
}

.live-body .btn { width: auto; margin-top: 6px; padding: 12px 22px; }

/* ---------- screens ---------- */

.screen {
  padding: 16px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
  /* No transform/animation here: it would become the containing block for
     the `position: fixed` live-draw screen and pull it off the viewport.
     Cards fade themselves in instead. */
}

/* Standalone screens (`/draws`, `/live/:id`) that render without the Shell. */
.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background:
    radial-gradient(120% 200px at 50% -40px, rgba(245, 197, 66, 0.08), transparent 70%),
    var(--bg);
  padding: calc(16px + env(safe-area-inset-top)) 16px
    calc(28px + env(safe-area-inset-bottom));
}

.section-head {
  margin: 6px 4px 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 2px 12px;
}
.section-row .section-head { margin: 0; }

.soon {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: rgba(245, 197, 66, 0.12);
  border: 1px solid var(--line-gold);
  padding: 3px 7px;
  border-radius: 999px;
}

.bids-lead {
  margin: -4px 4px 12px;
  font-size: 12.5px;
  color: var(--ink-dim);
}

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

/* ---------- draw card ---------- */

.draw {
  position: relative;
  margin-bottom: 10px;
  background: linear-gradient(180deg, var(--surface-hi), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  animation: fade-up 0.25s ease both;
}

.draw-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  z-index: 1;
  background: var(--gold-grad);
  transition: width 0.5s ease;
}

.draw-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px 10px;
}

.draw-cta {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}
.draw-cta .btn { flex: 1; width: auto; }

.bid-cta {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}
.bid-cta > * { flex: 1 1 0; min-width: 0; }   /* input + button share the row */
.bid-cta .btn { width: auto; }

/* Text/number field, used by the bid card and the deposit screen. */
.input {
  display: block;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  -webkit-text-fill-color: var(--ink); /* webkit ignores `color` on inputs otherwise */
  caret-color: var(--gold);
  font-family: inherit;
  font-size: 16px; /* >=16px stops iOS zooming in on focus */
  line-height: 1.2;
}
.input::placeholder { color: var(--ink-mute); -webkit-text-fill-color: var(--ink-mute); }
.input:focus { outline: none; border-color: var(--line-gold); }
.input--area { resize: vertical; min-height: 64px; line-height: 1.4; }

/* ---------- deposit screen ---------- */

.field-label {
  display: block;
  margin: 0 2px 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.field-hint {
  margin: 6px 2px 0;
  font-size: 11.5px;
  color: var(--ink-mute);
}

.amount-field { position: relative; }
.amount-input {
  padding-right: 52px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.amount-cur {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-mute);
}

.chips-row { display: flex; gap: 8px; margin-top: 10px; }
.chip--tap {
  flex: 1;
  appearance: none;
  cursor: pointer;
  padding: 9px 0;
  border-radius: 8px;
  background: var(--surface-hi);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  transition: transform 0.08s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip--tap:active {
  transform: scale(0.95);
  border-color: var(--line-gold);
  color: var(--gold-bright);
}

.seg {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  padding: 4px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.seg-btn {
  flex: 1;
  appearance: none;
  cursor: pointer;
  padding: 9px 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-mute);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg-btn.active { background: var(--surface-hi); color: var(--gold-bright); }

.pay-card { padding: 4px 14px; }
.pay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}
.pay-row + .pay-row { border-top: 1px solid var(--line); }
.pay-text { min-width: 0; }
.pay-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.pay-value {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.form-error {
  margin: 12px 2px 0;
  font-size: 13px;
  color: var(--bad);
}
.submit-hint {
  margin: 8px 2px 0;
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
}

.draw-img {
  flex: none;
  width: 66px;
  height: 66px;
  border-radius: 10px;
  object-fit: cover;
  background: linear-gradient(135deg, #2a2411, #15140f);
  border: 1px solid var(--line-gold);
}
.draw-img.is-empty {
  display: grid;
  place-items: center;
  font-size: 26px;
}

.draw-info { flex: 1; min-width: 0; }

.draw-prize {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draw-name {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draw-chips { display: flex; gap: 6px; margin-top: 7px; }

.chip {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.draw-timer {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.draw-timer-val {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.draw-timer-lbl {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.see-all {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold-bright);
  text-decoration: none;
  white-space: nowrap;
}
.see-all:active { opacity: 0.6; }

/* ---------- game placeholders ---------- */

.games {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.game {
  display: block;
  padding: 15px 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  opacity: 0.82;
  transition: transform 0.08s ease, opacity 0.15s ease, border-color 0.15s ease;
}
.game:active { transform: scale(0.97); }
.game:hover { opacity: 1; border-color: var(--line-gold); }
.game-emoji { font-size: 23px; filter: grayscale(0.4); }
.game-name {
  font-family: var(--font-display);
  margin-top: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}
.game-soon {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ---------- sub-page header ---------- */

.screen-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 2px 14px;
}
.screen-head span {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.back {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--gold-bright);
  font-size: 17px;
  line-height: 1;
  text-decoration: none;
}
.back:active { transform: scale(0.92); }

/* ---------- buttons ---------- */

.btn {
  appearance: none;
  display: block;
  border: 0;
  border-radius: var(--r-md);
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease, opacity 0.15s ease;
  width: 100%;
}

.btn:active { transform: scale(0.978); }
.btn:disabled { opacity: 0.55; cursor: default; }

.btn--primary {
  background: var(--gold-grad);
  color: #1a1400;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 20px rgba(245, 197, 66, 0.18);
}
.btn--primary:active { filter: brightness(0.96); }

.btn--ghost {
  background: transparent;
  color: var(--gold-bright);
  border: 1px solid var(--line-gold);
}
.btn--ghost:active { background: rgba(245, 197, 66, 0.08); }

.btn--sm { padding: 10px 12px; font-size: 13px; }

/* ---------- empty / skeleton ---------- */

.empty {
  text-align: center;
  padding: 56px 24px;
  animation: fade-up 0.3s ease both;
}
.empty-emoji { font-size: 34px; }
.empty-title {
  font-family: var(--font-display);
  margin-top: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  text-wrap: balance;
}
.empty-badge { margin-top: 10px; }
.empty-sub { margin-top: 10px; font-size: 13.5px; color: var(--ink-mute); }

/* ---------- open-in-Telegram gate (shown outside Telegram) ---------- */

.tg-gate {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding: 40px 32px calc(40px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(120% 260px at 50% -20px, rgba(245, 197, 66, 0.12), transparent 70%),
    var(--bg);
  animation: fade-in 0.3s ease both;
}
.tg-gate-mark {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold);
  margin-bottom: 26px;
}
.tg-gate-emoji { font-size: 42px; }
.tg-gate-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  color: var(--ink);
  margin: 16px 0 10px;
  text-wrap: balance;
}
.tg-gate-sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-dim);
  max-width: 32ch;
}

.sk-card {
  height: 190px;
  border-radius: var(--r-lg);
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.sk-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.05) 45%, transparent 70%);
  animation: shimmer 1.4s infinite;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  max-width: 420px;
  width: calc(100% - 40px);
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface-hi);
  border: 1px solid var(--line-gold);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow);
  animation: pop 0.24s ease both;
}

/* ---------- winners ---------- */

.winner {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  margin-bottom: 8px;
  animation: fade-up 0.3s ease both;
}

.winner-media {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--surface-hi);
  border: 1px solid var(--line-gold);
}
.winner-media.is-placeholder {
  display: grid;
  place-items: center;
  font-size: 20px;
}

.winner-text { flex: 1; min-width: 0; }

.winner-proof-btn {
  flex: none;
  width: auto;
  padding: 8px 12px;
  font-size: 12px;
}

.winner-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.winner-name:active { opacity: 0.7; }
.winner-prize {
  font-size: 13px;
  color: var(--ink-dim);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.winner-meta {
  font-size: 11.5px;
  color: var(--ink-mute);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* ---------- proof bottom sheet ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
  animation: fade-in 0.2s ease both;
}

.sheet {
  width: 100%;
  max-width: 480px;
  max-height: 78vh;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.5);
  padding-bottom: env(safe-area-inset-bottom);
  animation: sheet-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  margin: 10px auto 4px;
  border-radius: 999px;
  background: var(--line);
}

.sheet-img {
  display: block;
  width: calc(100% - 32px);
  height: 220px; /* fixed frame — the photo is letterboxed, sheet stays compact */
  margin: 8px 16px 0;
  border-radius: var(--r-md);
  border: 1px solid var(--line-gold);
  object-fit: contain;
  background: #000;
}

.sheet-body { padding: 14px 16px 10px; }
.sheet-name {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
a.sheet-name:active { opacity: 0.7; }
.sheet-prize {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
}
.sheet-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.sheet-close { width: auto; margin: 2px 16px 16px; }

/* ---------- profile ---------- */

.profile-card { padding: 16px; }

.profile-head { display: flex; align-items: center; gap: 12px; }
.profile-avatar {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold-grad);
  color: #1a1400;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
}
.profile-id { min-width: 0; }
.profile-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-handle { margin-top: 1px; font-size: 12.5px; color: var(--ink-dim); }

.profile-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.pstat-num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.pstat-lbl {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.profile-deposit { margin-left: auto; width: auto; }

/* ---------- invite ---------- */

.invite { padding: 18px; }

.invite-lead { font-size: 13.5px; color: var(--ink-dim); margin: 0 0 14px; }

.ref-row { display: flex; gap: 8px; }

.ref-row input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 13px;
}

.ref-row .btn { width: auto; padding: 11px 18px; }

.earned {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(245, 197, 66, 0.10);
  border: 1px solid var(--line-gold);
}
.earned-num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.earned-lbl {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.promos { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.promos li {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  border-left: 3px solid var(--gold);
  font-size: 13px;
  color: var(--ink-dim);
}

/* ---------- tab bar ---------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(12, 12, 15, 0.9);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar a {
  color: var(--ink-mute);
  height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
  position: relative;
}

/* Line icons (inline SVG, `stroke: currentColor`) — they take the tab's
   colour, so muted grey when inactive and gold when active, on theme. */
.tabbar a .ico { display: flex; }
.tabbar a .ico svg {
  width: 22px;
  height: 22px;
  display: block;
}

.tabbar a.active { color: var(--gold); }
.tabbar a.active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 24px;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: var(--gold);
}

/* ---------- keyframes ---------- */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pop {
  from { opacity: 0; transform: translate(-50%, 8px) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(245, 197, 66, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(245, 197, 66, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 197, 66, 0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flicker { from { opacity: 0.35; } to { opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes reveal {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
