/* Telegram injects --tg-theme-* vars inside the client; fallbacks are for a normal browser. */
:root {
  --f-bg: #ffffff; --f-bg2: #f1f1f4; --f-section: #ffffff; --f-text: #000000;
  --f-hint: #8e8e93; --f-link: #2481cc; --f-button: #2481cc; --f-button-text: #ffffff;
  --f-sep: rgba(0,0,0,.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --f-bg: #17212b; --f-bg2: #0e1621; --f-section: #17212b; --f-text: #f5f5f5;
    --f-hint: #708499; --f-link: #6ab3f3; --f-button: #5288c1; --f-button-text: #ffffff;
    --f-sep: rgba(255,255,255,.08);
  }
}
:root {
  --bg: var(--tg-theme-secondary-bg-color, var(--f-bg2));
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, var(--f-section)));
  --text: var(--tg-theme-text-color, var(--f-text));
  --hint: var(--tg-theme-hint-color, var(--f-hint));
  --link: var(--tg-theme-link-color, var(--f-link));
  --button: var(--tg-theme-button-color, var(--f-button));
  --button-text: var(--tg-theme-button-text-color, var(--f-button-text));
  --sep: var(--f-sep);
  --gold: #f5b301;
  --radius: 14px;
  /* in full screen: device status bar + room for Telegram's floating Close/⋯ buttons */
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", sans-serif;
  min-height: 100vh; overscroll-behavior: none; user-select: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: var(--bg);
}
.wallet { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.balance { display: flex; align-items: center; gap: 6px; font-size: 20px; line-height: 1.2; }
.balance b { font-variant-numeric: tabular-nums; }
.balance.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.08); } }
.rate { color: #3fb950; font-weight: 600; font-size: 12px; }
/* the in-game balance is USDT (1:1), so every "coin" is drawn as the USDT logo */
.coin {
  display: inline-block; width: 1em; height: 1em; border-radius: 50%; flex: none;
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%2216%22%20fill%3D%22%2326A17B%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M17.9%2017.4c-.1%200-.7.1-1.9.1-1%200-1.7%200-1.9-.1-3.7-.2-6.5-.8-6.5-1.6s2.8-1.4%206.5-1.6v2.5c.2%200%20.9.1%201.9.1%201.2%200%201.8-.1%201.9-.1v-2.5c3.7.2%206.4.8%206.4%201.6s-2.7%201.4-6.4%201.6zm0-3.4v-2.3h5.2V8.3H8.9v3.4h5.2V14c-4.2.2-7.4%201-7.4%202s3.2%201.8%207.4%202v7.2h3.8V18c4.2-.2%207.3-1%207.3-2s-3.1-1.8-7.3-2z%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
  vertical-align: -0.12em;
}
.coin.sm { font-size: 13px; }

main { padding: 0 12px calc(84px + var(--safe-bottom)); }
.tab { display: none; animation: fade .2s ease; }
.tab.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; padding: 6px 8px calc(6px + var(--safe-bottom));
  background: var(--card); border-top: 1px solid var(--sep);
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--hint); padding: 4px 0;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.tabbar button.active { color: var(--button); }

/* cards / sections */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.muted { color: var(--hint); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 48px; border-radius: 12px;
  background: var(--button); color: var(--button-text); font-weight: 600; font-size: 16px;
  transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; }
.btn.secondary { background: color-mix(in srgb, var(--button) 14%, transparent); color: var(--button); }
.btn-row { display: flex; gap: 10px; margin-top: 10px; }

/* profile */
.topbar .profile { cursor: pointer; }
.topbar .profile { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; margin-right: 12px; }
.avatar {
  position: relative; width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.who b, .who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who b { font-size: 15px; line-height: 1.25; }
.who span { font-size: 13px; }
.star { color: #a78bfa; }

/* vault */
.vault { background: linear-gradient(140deg, color-mix(in srgb, var(--gold) 16%, var(--card)), var(--card) 65%); }
.vault { position: relative; transition: box-shadow .4s; }
.vault.full { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--gold) 70%, transparent), 0 0 24px color-mix(in srgb, var(--gold) 25%, transparent); }
.vault-top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.ring { position: relative; width: 92px; height: 92px; flex: none; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-bg { stroke: var(--sep); }
.ring-fg { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset .4s; }
.vault.full .ring-fg { filter: drop-shadow(0 0 4px var(--gold)); }
.ring .coin { font-size: 36px; margin-top: -8px; }
.vault.full .ring .coin { animation: coin-bob 1.6s ease-in-out infinite; }
@keyframes coin-bob { 50% { transform: translateY(-3px) rotate(-6deg); } }
.ring-pct { position: absolute; bottom: 19px; font-size: 11px; font-weight: 700; color: var(--hint); font-variant-numeric: tabular-nums; }
.vault-info { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.vault-amount { font-size: 36px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.vault-dec { font-size: 20px; font-weight: 700; color: var(--hint); }
.vault-rates { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.rate-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; color: #3fb950; background: color-mix(in srgb, #3fb950 15%, transparent); }
.vault-time { font-size: 13px; color: var(--hint); }
.vault.full .vault-time { color: var(--gold); font-weight: 600; }
#collectBtn .coin { font-size: 15px; }
.progress { height: 8px; border-radius: 4px; background: var(--sep); overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #f5b301, #ffd95a); transition: width .3s; }
#collectBtn.ready { animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--button) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 10px transparent; }
}

/* collection shelf */
/* 6 per row; a shorter last row is centred instead of leaving a hole */
.shelf { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.slot {
  position: relative; width: calc((100% - 5 * 8px) / 6); aspect-ratio: 1; border-radius: 12px; padding: 5px;
  background: color-mix(in srgb, var(--tier) 16%, var(--bg));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tier) 55%, transparent);
  transition: transform .12s;
}
.slot:active { transform: scale(.94); }
.slot img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* not owned yet: faded grey gift + lock, readable in light and dark themes */
.slot.locked { background: var(--bg); box-shadow: inset 0 0 0 1px var(--sep); }
.slot.locked img { filter: grayscale(1); opacity: .3; }
.slot .slot-lock { position: absolute; right: 3px; bottom: 3px; width: 13px; height: 13px; color: var(--hint); stroke-width: 2.2; }

/* next goal */
.goal { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; }
.goal-art { width: 84px; flex: none; }
.goal-info { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.goal-info b { font-size: 16px; }
.goal-info .progress { margin: 6px 0; }
.ready-text { color: #3fb950; font-weight: 600; }

/* daily bonus */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 12px; }
.day { border-radius: 8px; padding: 5px 0; text-align: center; font-size: 11px; font-weight: 600; background: var(--sep); color: var(--hint); }
.day.done { background: color-mix(in srgb, #3fb950 22%, transparent); color: #3fb950; }
.day.today { outline: 2px solid var(--gold); color: var(--text); }
.bonus-btn { width: auto; height: 38px; padding: 0 14px; font-size: 14px; flex: none; }

/* gift grid */
/* 3 compact cards per row on phones, more on wider screens */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; } }
.gift {
  background: var(--card); border-radius: 12px; padding: 6px 6px 8px; text-align: left; min-width: 0;
  display: flex; flex-direction: column; gap: 4px; transition: transform .12s; position: relative;
}
.gift:active { transform: scale(.97); }
.gift .name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gift .name small { display: block; font-weight: 400; font-size: 11px; color: var(--hint); overflow: hidden; text-overflow: ellipsis; }
.model-name { text-align: center; font-weight: 600; color: var(--link); margin-top: 2px; }
.gift .meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 3px 4px; font-size: 12px; }
.gift .inc { color: #3fb950; font-weight: 600; }
.price { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.gift:has(.owned) .art { opacity: .75; }

/* gift art */
.art { position: relative; aspect-ratio: 1; }
.art.playing img { visibility: hidden; }
.art img, .art .lottie {
  position: absolute; inset: 3%; width: 94%; height: 94%; object-fit: contain; z-index: 1;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.22));
}

/* sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: var(--kb, 0px); z-index: 11; overflow-y: auto;
  max-height: calc(var(--vvh, 100vh) - var(--safe-top) - 12px);
  background: var(--card); border-radius: 18px 18px 0 0; padding: 8px 16px calc(16px + var(--safe-bottom));
  transform: translateY(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s linear .3s;
  visibility: hidden; /* once closed it is really gone (not just parked below the screen) */
}
.sheet.open { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--sep); margin: 0 auto 10px; }
.sheet .art { width: min(260px, 70vw); margin: 0 auto 12px; border-radius: 18px; }
.sheet h2 { margin: 0; text-align: center; font-size: 22px; }
.sheet .sub { text-align: center; color: var(--hint); margin: 4px 0 14px; }
.kv { border-radius: 12px; overflow: hidden; background: var(--bg); margin-bottom: 12px; }
.kv > div { display: flex; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--sep); }
.kv > div:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--hint); }
.kv .rar { color: var(--hint); font-size: 13px; margin-left: 6px; }

.empty { text-align: center; padding: 40px 16px; color: var(--hint); }
.empty .btn { max-width: 220px; margin: 14px auto 0; }


.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); z-index: 20;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: rgba(20,20,20,.88); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px;
  transition: .25s; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.float-coin {
  position: fixed; z-index: 30; pointer-events: none; font-size: 18px;
  transition: transform .7s cubic-bezier(.5,0,.8,.6), opacity .7s;
}

/* profile page */
/* compact profile card: avatar left, name + handle + start date right */
.profile-hero { display: flex; align-items: center; gap: 14px; padding: 14px; }
.profile-hero .who b { font-size: 17px; }
.profile-hero .who span { font-size: 13px; }
.avatar.lg { width: 56px; height: 56px; font-size: 21px; }
.profile-hero .since { font-size: 12px; margin-top: 2px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--card); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.stat b { font-size: 17px; display: flex; align-items: center; gap: 5px; }
.list { padding: 4px 0; }
.ach { display: flex; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--sep); }
.ach:last-child { border-bottom: 0; }
.ach-body { flex: 1; min-width: 0; font-size: 13px; }
.ach-body b { font-size: 15px; }
.ach.done .row .muted { color: #3fb950; font-weight: 700; }
.ach .progress { height: 5px; margin: 6px 0 0; }
.menu { margin-top: 12px; }
.menu button { display: flex; align-items: center; gap: 12px; font-weight: 500; width: 100%; padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--sep); }
.menu button:last-child { border-bottom: 0; }
.menu .chev { margin-left: auto; color: var(--hint); font-size: 20px; line-height: 1; }

/* newcomer gift */
.welcome {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: linear-gradient(140deg, color-mix(in srgb, #14b8a6 22%, var(--card)), var(--card) 70%);
  outline: 1.5px solid color-mix(in srgb, #14b8a6 45%, transparent); outline-offset: -1.5px;
}
.welcome .goal-info { gap: 3px; }
.welcome-tag { color: #14b8a6; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.welcome-btn { height: 36px; font-size: 14px; margin-top: 6px; width: auto; align-self: flex-start; padding: 0 16px; }
.welcome-note {
  background: color-mix(in srgb, #14b8a6 14%, transparent); color: var(--text);
  border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; text-align: center;
}

/* friends */
.copy-btn { flex: 0 0 auto; width: auto; padding: 0 16px; }
.invited-by { text-align: center; font-size: 13px; margin: -2px 0 4px; }
.friend { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--sep); }
.friend:last-child { border-bottom: 0; }
.friend .who span { font-size: 13px; }
.brought { display: flex; align-items: center; gap: 4px; font-weight: 700; color: #3fb950; flex: none; }
.brought.muted { color: var(--hint); font-weight: 500; }
code { font-size: 12px; background: var(--sep); padding: 1px 5px; border-radius: 5px; }

/* sub-pages */
.page-back { color: var(--link); font-size: 16px; padding: 6px 4px 10px; }
.menu-count { margin-left: auto; color: var(--hint); font-size: 14px; }
.menu-count + .chev { margin-left: 8px; }

.ach-summary b { color: var(--text); }
.ach-reward { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--gold); flex: none; }
.ach-claim { height: 34px; font-size: 14px; margin-top: 6px; }
.ach-claimed { color: #3fb950; font-weight: 600; }
.ach-note { font-size: 12px; text-align: center; margin: 4px 12px 0; }

/* shop */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 6px 12px; border-radius: 16px; font-size: 13px; font-weight: 600;
  background: var(--bg); color: var(--hint); transition: background .15s, color .15s;
}
.chip.active { background: var(--button); color: var(--button-text); }
#tab-shop .gift {
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--tier) 20%, transparent), transparent 70%),
    var(--card);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--tier) 45%, transparent);
}
#tab-shop .gift.is-owned .art { opacity: .55; }
.pill {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 10px;
  font-weight: 700; font-size: 12px; background: var(--bg); color: var(--hint); white-space: nowrap;
}
.pill.can { background: var(--button); color: var(--button-text); }
.pill.starter.can { background: #14b8a6; }
.owned-pill { background: color-mix(in srgb, #3fb950 18%, transparent); color: #3fb950; }
.afford { height: 3px; border-radius: 2px; background: var(--sep); overflow: hidden; margin-top: 2px; }
.afford > div { height: 100%; background: var(--gold); border-radius: 2px; }
.afford.hidden { visibility: hidden; } /* keeps every card the same height */
#tab-shop .gift .inc { font-size: 12px; }
#tab-shop .gift .pill { align-self: flex-start; }

/* ---------- shared UI (one look for every page) ---------- */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.section-head { --dot: var(--button); display: flex; align-items: center; gap: 8px; margin: 20px 4px 8px; font-weight: 700; font-size: 15px; }
.section-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 8px var(--dot); flex: none; }
.section-head .muted { margin-left: auto; font-weight: 500; font-size: 13px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 10px; }
.card-title .ico { color: var(--gold); }
.card-title .muted { margin-left: auto; font-size: 12px; font-weight: 400; }
.row .card-title { margin-bottom: 2px; }
.card.accent { background: radial-gradient(130% 100% at 0% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 62%), var(--card); }
.tile-ico { --c: var(--button); width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; color: #fff; background: var(--c); }
.tile-ico .ico { width: 17px; height: 17px; }
.tile-ico.big { width: 46px; height: 46px; border-radius: 14px; }
.tile-ico.big .ico { width: 25px; height: 25px; }
.stat .btn { height: 34px; font-size: 14px; margin-top: 8px; }

/* page details */
.goal-label { display: flex; align-items: center; gap: 5px; color: var(--hint); }
.goal-label .ico { width: 15px; height: 15px; color: var(--gold); }
.goal .tile-ico.big { margin-bottom: 8px; }
.welcome-tag { display: inline-flex; align-items: center; gap: 5px; }
.welcome-tag .ico { width: 14px; height: 14px; }
.welcome-note .ico, .price .ico, .pill .ico { width: 15px; height: 15px; vertical-align: -3px; }
.vault-time { display: flex; align-items: center; gap: 5px; }
.vault-time .ico { width: 15px; height: 15px; }
.bonus-sub { font-size: 13px; display: flex; align-items: center; gap: 4px; }
.flame { width: 15px; height: 15px; color: #f97316; fill: color-mix(in srgb, #f97316 25%, transparent); }
.invite-row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.invite-row > div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.invite-row b { font-size: 16px; }
.invite-card .welcome-note { margin: 0; }
.invite-card .btn-row { margin-top: 0; }
.ach-summary { font-size: 13px; margin-bottom: 2px; }
.ach-summary b { color: var(--text); }
.ach-badge {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 800; font-size: 13px; color: var(--hint); border: 2px solid var(--sep);
}
.ach-badge.reached { color: #3a2500; border: 0; background: linear-gradient(135deg, #ffd95a, #f08c00); box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 45%, transparent); }
.ach-badge.claimed { color: #fff; border: 0; background: #3fb950; }
.ach-badge .ico { width: 20px; height: 20px; stroke-width: 2.6; }

/* page stays put while a sheet is open */
/* lock only <html>: also locking <body> makes it a scroll box of its own, and the sticky top bar then sticks
   to the body's top (scrolled off-screen when the page was scrolled down) instead of the screen's */
html.scroll-locked { overflow: hidden; }
.sheet { overscroll-behavior: contain; }
.sheet-backdrop { touch-action: none; }
/* same small gap under the top bar on every page */
.tab > :first-child { margin-top: 4px; }

/* Profile: no top bar (the profile card shows the same info + balance) */
body.no-topbar .topbar { display: none; }
body.no-topbar main { padding-top: calc(10px + var(--safe-top)); }
.hero-wallet { margin-left: auto; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12px; }
.hero-wallet b { display: flex; align-items: center; gap: 5px; font-size: 18px; font-variant-numeric: tabular-nums; }
.hero-wallet .coin { font-size: 16px; }

/* demo wallet */
.wallet-actions { margin: 0 0 4px; }
.btn .ico { width: 18px; height: 18px; }
.wallet-sheet { text-align: center; }
.wallet-sheet .tile-ico.big { margin: 6px auto 10px; }
.amount-field {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--bg); border-radius: 14px; padding: 12px 16px; margin-bottom: 10px;
}
.amount-field .coin { font-size: 22px; }
.amount-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.amount-field input::-webkit-inner-spin-button, .amount-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.wallet-sheet .chips { justify-content: center; margin-bottom: 12px; }
.wallet-sheet .welcome-note { margin-bottom: 0; }
.wallet-sheet .section-head { text-align: left; }
.tx { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--sep); text-align: left; }
.tx:last-child { border-bottom: 0; }
.tx .who span { font-size: 12px; }
.tx-amt { flex: none; font-variant-numeric: tabular-nums; }
.tx-amt.in { color: #3fb950; }
.tx-amt.out { color: var(--text); }
.deposit-addr { margin-bottom: 4px; }
.deposit-addr .qr { display: block; width: 168px; height: 168px; margin: 4px auto 10px; border-radius: 12px; background: #fff; padding: 6px; }
.addr-label { font-size: 12px; margin-bottom: 4px; }
.addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all;
  background: var(--bg); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; user-select: all;
}
.deposit-addr .btn { margin-bottom: 12px; }
.wallet-label { text-align: left; margin: 4px 4px 6px; }
.wallet-sheet #netChips { margin-top: -4px; }
.addr-input {
  width: 100%; border: 0; outline: 0; background: var(--bg); color: var(--text); border-radius: 12px;
  padding: 12px 14px; font: inherit; font-size: 16px; margin-bottom: 10px; /* 16px: iOS doesn't zoom in on focus */
}
.pay-row .who { gap: 2px; }
.pay-row .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; word-break: break-all; }
.pay-row .btn-row { margin-top: 8px; }
.pay-row .btn { height: 34px; font-size: 14px; }
.w-status { flex: none; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--bg); color: var(--hint); }
.w-status.confirmed { color: #3fb950; background: color-mix(in srgb, #3fb950 15%, transparent); }
.w-status.refunded { color: #e5484d; background: color-mix(in srgb, #e5484d 12%, transparent); }

/* ---------- admin panel ---------- */
.gate { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 30px; }
.gate .tile-ico.big { margin-bottom: 4px; }
.gate .btn { margin-top: 10px; }
.admin-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; text-align: left;
  border-bottom: 1px solid var(--sep); font-size: 14px;
}
.admin-row:last-child { border-bottom: 0; }
.admin-row > img { width: 38px; height: 38px; object-fit: contain; flex: none; }
.admin-row .who { flex: 1; min-width: 0; text-align: left; }
.admin-row .who span { font-size: 12px; }
.admin-row > .muted:first-child { flex: 1; }
.admin-row .price { flex: none; }
.gift-row .who { padding: 0; }
.order-btns { display: flex; flex-direction: column; gap: 2px; flex: none; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--hint); background: var(--bg); flex: none; }
.icon-btn:disabled { opacity: .3; }
.icon-btn .ico { width: 16px; height: 16px; }
.icon-btn.danger { color: #e5484d; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; margin-left: 6px; background: var(--sep); color: var(--hint); vertical-align: 1px; }
.tag.teal { background: color-mix(in srgb, #14b8a6 20%, transparent); color: #14b8a6; }
.link-btn { color: var(--link); font-size: 13px; font-weight: 600; }
.search-card { padding: 8px; }
.search-card input, .admin-form input, .admin-form select, .admin-form textarea, .adjust-row input, .adjust-row select, .adj-note {
  width: 100%; min-width: 0; border: 0; outline: 0; border-radius: 10px; padding: 10px 12px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px; /* 16px: no iOS zoom on focus */
}
.admin-form textarea { resize: vertical; line-height: 1.4; font-size: 14px; }
.admin-form input[type="color"] { padding: 4px; height: 40px; }
.admin-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.field-label { font-size: 12px; font-weight: 600; color: var(--hint); }
.field-hint { font-size: 12px; color: var(--hint); margin: 0; }
.field-pair { display: flex; gap: 10px; align-items: flex-end; }
.row-with-del .icon-btn { margin-bottom: 5px; }
.bonus-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.toggle input { display: none; }
.toggle span { width: 40px; height: 24px; border-radius: 12px; background: var(--sep); position: relative; flex: none; transition: background .2s; }
.toggle span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked + span { background: var(--button); }
.toggle input:checked + span::after { transform: translateX(16px); }
.admin-form .btn-row { margin-top: 4px; }
.danger-btn { background: color-mix(in srgb, #e5484d 15%, transparent); color: #e5484d; }
.danger-text { color: #e5484d; }
.gift-preview { width: 120px; margin: 0 auto; }
.adjust-row { display: flex; gap: 8px; align-items: center; }
.adjust-row .btn { width: auto; padding: 0 16px; height: 42px; flex: none; }
.adj-note { margin-top: 8px; }
.give-gift { padding: 10px 14px 12px; }
.admin-player .profile-hero { margin-top: 0; }
.bc-row .progress { height: 4px; margin: 6px 0 0; }
.bc-count { flex: none; font-size: 13px; text-align: right; }
.save-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(70px + var(--safe-bottom)); z-index: 6;
  display: none; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-radius: 14px;
  background: var(--card); box-shadow: 0 6px 24px rgba(0,0,0,.25), inset 0 0 0 1px var(--sep); font-size: 14px; font-weight: 600;
}
.save-bar.show { display: flex; }
.save-bar span { flex: 1; }
.save-bar .btn { width: auto; height: 38px; padding: 0 16px; font-size: 14px; }
#tab-admin { padding-bottom: 70px; }
.pay-row .link-btn { padding: 0; font-size: inherit; }
.pay-kind, .pay-status { margin-bottom: 8px; }
.wd-only { background: var(--bg); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }

/* admin: header + sidebar (a slide-in drawer on phones, a fixed column on wide screens) */
.admin-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; position: relative; }
.admin-head .tile-ico { width: 34px; height: 34px; }
.admin-title { display: flex; flex-direction: column; min-width: 0; }
.admin-title .muted { font-size: 12px; }
.admin-title b { font-size: 17px; }
.menu-btn { width: 40px; height: 40px; border-radius: 12px; position: relative; color: var(--text); }
.menu-btn .ico { width: 22px; height: 22px; }
.menu-btn .nav-badge { position: absolute; top: -4px; right: -4px; }
.nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff;
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1;
}
.nav-badge[hidden] { display: none; }
.admin-nav {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 14; width: min(280px, 82vw);
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(14px + var(--safe-top)) 10px calc(14px + var(--safe-bottom));
  background: var(--card); box-shadow: 4px 0 24px rgba(0,0,0,.25);
  transform: translateX(-105%); transition: transform .22s ease;
}
.admin-shell.nav-open .admin-nav { transform: none; }
.admin-nav-backdrop { position: fixed; inset: 0; z-index: 13; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.admin-shell.nav-open .admin-nav-backdrop { opacity: 1; pointer-events: auto; }
.admin-nav-title { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 6px 10px 12px; }
.admin-nav-title .ico { color: #e5484d; }
.admin-nav button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 12px;
  border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--text); text-align: left;
}
.admin-nav button span:not(.nav-badge) { flex: 1; }
.admin-nav button .ico { width: 20px; height: 20px; color: var(--hint); }
.admin-nav button.active { background: color-mix(in srgb, var(--button) 14%, transparent); color: var(--button); }
.admin-nav button.active .ico { color: var(--button); }
.admin-nav .admin-exit { margin-top: auto; color: var(--hint); }
.exit-ico { flex: none !important; width: 20px; text-align: center; font-size: 22px; line-height: 1; }
@media (min-width: 720px) {
  .admin-shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; align-items: start; }
  .admin-head { grid-column: 1 / -1; margin-bottom: 0; }
  .menu-btn { display: none; }
  .admin-nav {
    position: sticky; top: 10px; z-index: auto; width: auto; transform: none; transition: none;
    box-shadow: none; border-radius: var(--radius); padding: 8px; max-height: calc(100vh - 20px);
  }
  .admin-nav-title { display: none; }
  .admin-nav-backdrop { display: none; }
}

/* admin on small screens */
.admin-body { min-width: 0; }
.field-pair { flex-wrap: wrap; }
.field-pair > .field { min-width: 130px; }
.adjust-row { flex-wrap: wrap; }
.adjust-row input, .adjust-row select { flex: 1 1 160px; }
.pay-row { align-items: flex-start; }
.pay-row .who b { overflow-wrap: anywhere; }
.pay-row .btn-row .btn { flex: 1; }
.pay-row > .w-status, .pay-row > .price { margin-top: 2px; }
.admin-body .chips { padding-bottom: 2px; }
.admin-body .chip { padding: 8px 14px; }
.admin-body .section-head .muted .link-btn { margin-left: 6px; }
@media (max-width: 360px) {
  .stat b { font-size: 15px; }
  .admin-row { padding: 10px 12px; gap: 10px; }
  .save-bar { left: 8px; right: 8px; }
}

/* coin & network logos */
.cicon { position: relative; display: inline-block; width: 22px; height: 22px; flex: none; vertical-align: middle; }
.cicon > svg { width: 100%; height: 100%; display: block; }
.cicon.sm { width: 16px; height: 16px; vertical-align: -3px; }
.cicon.lg { width: 34px; height: 34px; }
.cicon-badge {
  position: absolute; right: -3px; bottom: -3px; width: 48%; height: 48%; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--card); background: var(--card);
}
.cicon-badge svg { width: 100%; height: 100%; display: block; }
.icon-chip { display: inline-flex; align-items: center; gap: 6px; padding-left: 6px; }
.icon-chip .cicon { width: 18px; height: 18px; }
.addr-label { display: flex; align-items: center; justify-content: center; gap: 6px; }
.coin-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-bottom: 10px; font-size: 13px; }
.coin-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 14px; background: var(--bg); font-weight: 700; font-size: 13px; }
.coin-pill .cicon { width: 20px; height: 20px; }
.wd-only { display: flex; align-items: center; gap: 12px; text-align: left; }
.wd-only > div { display: flex; flex-direction: column; }
.wd-only .muted { font-size: 13px; }
.tx > .cicon.lg, .pay-row > .cicon.lg { margin-top: 1px; }
.toggle .cicon { margin-right: -2px; }
.pay-row { flex-wrap: wrap; }
.pay-row .pay-actions { flex-basis: 100%; margin-top: 2px; }
.pay-row .pay-actions .btn { white-space: nowrap; }
.saved-addr {
  display: flex; align-items: center; gap: 10px; text-align: left; background: var(--bg);
  border-radius: 12px; padding: 10px 10px 10px 12px; margin-bottom: 10px;
}
.saved-addr > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.saved-addr .muted { font-size: 12px; }
.saved-addr b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.saved-addr .btn { width: auto; height: 34px; padding: 0 14px; font-size: 14px; flex: none; }
.addr-cancel { display: block; margin: -4px auto 10px; }

/* deposit / withdrawal history pages: total + table */
.hist-total { display: flex; align-items: center; gap: 14px; }
.hist-total > div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.hist-total b { display: flex; align-items: center; gap: 6px; font-size: 24px; font-variant-numeric: tabular-nums; }
.hist-total .coin { font-size: 20px; }
.hist-card { padding: 4px 0; overflow: hidden; }
.hist-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.hist-table th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--hint); padding: 8px 6px; border-bottom: 1px solid var(--sep);
}
.hist-table td { padding: 10px 6px; border-bottom: 1px solid var(--sep); vertical-align: middle; }
.hist-table tr:last-child td { border-bottom: 0; }
.hist-table th:first-child, .hist-table td:first-child { padding-left: 12px; width: 23%; }
.hist-table th:last-child, .hist-table td:last-child { padding-right: 12px; }
.hist-table th:nth-child(2) { width: 26%; }
.hist-table .h-sum { text-align: right; width: 25%; }
.hist-table .h-status { text-align: right; }
.hist-table td span { display: block; font-size: 11px; color: var(--hint); }
.h-date { white-space: nowrap; }
.h-method > div { display: flex; align-items: center; gap: 6px; min-width: 0; }
.h-method > div > div { min-width: 0; }
.h-method b, .h-sum b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-method .cicon { width: 24px; height: 24px; }
.h-sum b { font-variant-numeric: tabular-nums; }
.h-status .w-status { white-space: nowrap; font-size: 11px; padding: 2px 7px; }
.hist-row[data-explorer] { cursor: pointer; }
.hist-row[data-explorer]:active { background: var(--bg); }

/* keyboard open: the sheet fits above it (see fitToKeyboard in app.js) */
html.kb-open .sheet { max-height: calc(var(--vvh, 100vh) - 8px); padding-bottom: 12px; border-radius: 14px 14px 0 0; }
html.kb-open .sheet .grabber { display: none; }

/* deposit / withdraw as full pages */
.wallet-page { padding-top: 18px; }
.wallet-page h2 { margin: 0; text-align: center; font-size: 22px; }
.wallet-page .sub { text-align: center; color: var(--hint); margin: 4px 0 14px; }
.wallet-hist-link { display: block; margin: 4px auto 0; padding: 8px 12px; font-size: 14px; }

/* text fields must stay selectable: the page turns selection off (body), and on iPhones a field that
   inherits that misbehaves (cursor hard to place, no long-press Paste) */
input, textarea, select { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
/* while typing (html.typing, see app.js): the bottom tab bar would ride on top of the keyboard */
html.typing .tabbar, html.typing .save-bar { display: none; }

/* deposit: coin & network pickers */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 14px; }
.pick {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px 8px;
  border-radius: 14px; background: var(--bg); box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .15s, background .15s;
}
.pick b { font-size: 14px; }
.pick span { font-size: 11px; color: var(--hint); line-height: 1.2; text-align: center; }
.pick .cicon.lg { width: 32px; height: 32px; margin-bottom: 2px; }
.pick.active { box-shadow: inset 0 0 0 2px var(--button); background: color-mix(in srgb, var(--button) 12%, var(--bg)); }
.send-only { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--bg); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.send-only span { display: block; font-size: 12px; color: var(--hint); }

/* deposit steps */
.stepper { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 2px 0 16px; font-size: 12px; font-weight: 600; color: var(--hint); }
.stepper > div { display: flex; align-items: center; gap: 5px; }
.stepper > div span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--bg); }
.stepper > div.active { color: var(--text); }
.stepper > div.active span { background: var(--button); color: var(--button-text); }
.stepper > div.done span { background: #3fb950; color: #fff; }
.stepper i { width: 18px; height: 2px; border-radius: 1px; background: var(--sep); }
.step-title { font-weight: 700; font-size: 15px; text-align: left; margin: 0 2px 10px; }
.step-hint { font-size: 12px; color: var(--hint); margin: -6px 2px 12px; text-align: left; }
.step-done {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; margin-bottom: 8px;
  border-radius: 12px; background: var(--bg); text-align: left; font-size: 14px;
}
.step-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.step-num.done { background: #3fb950; color: #fff; }
.step-num .ico { width: 13px; height: 13px; stroke-width: 3; }
.step-label { color: var(--hint); font-size: 13px; }
.step-value { flex: 1; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.step-done .link-btn { flex: none; }
.deposit-addr[hidden] { display: none; }
.deposit-addr { margin-top: 8px; }


/* shop cards: 2 per row with labelled facts */
#tab-shop .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { #tab-shop .shop-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
.gcard { padding: 8px 8px 10px; gap: 6px; border-radius: 16px; }
.gcard .art { width: 78%; margin: 4px auto 0; }
.gcard .name { font-size: 14px; text-align: center; }
.gcard .name small { font-size: 12px; }
.gc-tier {
  position: absolute; top: 8px; left: 8px; z-index: 2; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--tier); background: color-mix(in srgb, var(--tier) 16%, var(--card));
}
.gc-stats { display: flex; flex-direction: column; gap: 3px; padding: 7px 9px; border-radius: 10px; background: var(--bg); font-size: 12px; }
.gc-stats > div { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.gc-stats span { color: var(--hint); }
.gc-stats b { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gc-stats b.inc { color: #3fb950; }
/* owned: green check badge in the top-right corner */
.gc-owned {
  position: absolute; top: 7px; right: 7px; z-index: 2; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: #3fb950; color: #fff; box-shadow: 0 0 0 2px var(--card);
}
.gc-owned .ico { width: 14px; height: 14px; stroke-width: 3; }
#tab-shop .gift.is-owned .art { opacity: .7; }

/* gift details */
.gc-tier.inline { position: static; display: inline-block; vertical-align: 1px; }
.owned-tag { color: #3fb950; }
.section-label { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--hint); margin: 4px 4px 6px; }
.earn-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.earn-row > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px; border-radius: 12px; background: var(--bg); }
.earn-row span { font-size: 11px; color: var(--hint); }
.earn-row b { font-size: 16px; color: #3fb950; font-variant-numeric: tabular-nums; }
.inc-strong { color: #3fb950; font-weight: 700; }
.gift-note { font-size: 12px; color: var(--hint); margin: 0 4px 12px; text-align: left; }

/* profile: account ID (tap to copy) */
.user-id {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; margin: 3px 0 1px; padding: 3px 8px;
  border-radius: 8px; background: var(--bg); color: var(--hint); font-size: 12px;
}
.user-id b { color: var(--text); font-variant-numeric: tabular-nums; }
.user-id .ico { width: 13px; height: 13px; }

/* profile menu: title + short description */
.menu-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.menu-text b { font-weight: 600; }
.menu-text small { font-size: 12px; color: var(--hint); line-height: 1.3; }
.menu-text + .menu-count { margin-left: 8px; flex: none; }
.wd-submit { margin-top: 12px; }

/* withdraw steps */
.wd-live { font-size: 13px; text-align: center; margin: -2px 0 4px; min-height: 18px; }
.wd-live b { color: #3fb950; }
.wd-confirm > div { align-items: center; gap: 10px; }
.wd-confirm .wd-get b { color: #3fb950; font-size: 17px; display: inline-flex; align-items: center; gap: 5px; }
.wd-confirm .wd-to { flex-direction: column; align-items: stretch; gap: 4px; }
.mono-addr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; text-align: left; }
.wd-to .mono-addr { color: var(--text); }
.wd-confirm .wd-to > span { text-align: left; }
.gift-buy { margin-top: 4px; }

/* daily check-in page */
.checkin-card { text-align: center; }
.checkin-card .tile-ico.big { margin: 4px auto 10px; }
.checkin-card h2 { margin: 0; font-size: 22px; }
.checkin-card .sub { display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--hint); margin: 4px 0 16px; font-size: 14px; }
.checkin-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.checkin-day {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px;
  background: var(--bg); color: var(--hint); font-size: 12px;
}
.checkin-day .coin { font-size: 22px; }
.checkin-day b { color: var(--text); font-size: 14px; }
.checkin-day i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #3fb950; color: #fff; }
.checkin-day i .ico { width: 13px; height: 13px; stroke-width: 3; }
.checkin-day.done { background: color-mix(in srgb, #3fb950 14%, var(--bg)); }
.checkin-day.done b { color: #3fb950; }
.checkin-day.today { box-shadow: inset 0 0 0 2px var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--bg)); color: var(--text); }
.checkin-btn { font-size: 15px; }
.checkin-note { font-size: 12px; color: var(--hint); margin: 12px 4px 0; }

/* floating check-in button */
.fab {
  position: fixed; z-index: 9; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #ffd95a, #f08c00); color: #3a2500; touch-action: none; user-select: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.35); transition: left .2s ease, top .2s ease, transform .15s;
}
.fab[hidden] { display: none; }
.fab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fab.dragging { transition: none; transform: scale(1.08); }
.fab:active { transform: scale(.94); }
.fab-dot { position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 2px var(--bg); display: none; }
.fab.ready .fab-dot { display: block; }
.fab.ready { animation: fab-pulse 2s ease-in-out infinite; }
@keyframes fab-pulse { 50% { box-shadow: 0 6px 18px rgba(0,0,0,.35), 0 0 0 8px color-mix(in srgb, #f59e0b 25%, transparent); } }
html.typing .fab, html.scroll-locked .fab { display: none; }

/* friends: referral levels */
.team-levels { padding: 2px 0; }
.team-row { display: grid; grid-template-columns: 1.6fr .9fr .9fr 1.1fr; align-items: center; gap: 6px; padding: 9px 14px; border-bottom: 1px solid var(--sep); font-size: 14px; }
.team-row:last-child { border-bottom: 0; }
.team-row > span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.team-row > span:first-child { display: flex; align-items: baseline; gap: 6px; }
.team-row small { font-size: 11px; color: var(--hint); }
.team-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--hint); padding-top: 8px; padding-bottom: 6px; }
.team-rate { color: var(--gold); font-weight: 700; }
.team-earned { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; color: #3fb950; font-weight: 600; }

/* outside the Telegram phone app: a full-screen "open it on your phone" notice and nothing else */
body.phone-only .topbar, body.phone-only .tabbar, body.phone-only .fab { display: none !important; }
body.phone-only main { padding: 0 20px; }
.phone-gate { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; max-width: 360px; margin: 0 auto; }
.phone-gate-icon { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; background: var(--button); color: var(--button-text); margin-bottom: 6px; }
.phone-gate-icon svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.phone-gate h1 { font-size: 22px; margin: 0; }
.phone-gate p { margin: 0; font-size: 15px; line-height: 1.45; }
.phone-gate ol { text-align: left; margin: 6px 0; padding: 12px 16px 12px 34px; border-radius: 14px; background: var(--card); font-size: 14px; line-height: 1.7; width: 100%; }

/* admins on Telegram Desktop / Mac / Web: the admin panel only, no game around it */
body.admin-only .topbar, body.admin-only .tabbar, body.admin-only .fab,
body.admin-only .page-back, body.admin-only .admin-exit { display: none !important; }
body.admin-only main { padding-top: 12px; padding-bottom: 24px; }

/* ---------- admin: controls, alerts, money ---------- */
/* chart colours (validated for colour-blind separation and 3:1 contrast on Telegram's light and dark cards) */
:root { --viz-1: #2a78d6; --viz-2: #eb6834; --viz-neg: #e34948; --viz-grid: rgba(0,0,0,.08); --viz-base: rgba(0,0,0,.22);
  --good: #0ca30c; --warning: #c98500; --critical: #d03b3b; }
body[data-scheme="dark"] { --viz-1: #3987e5; --viz-2: #d95926; --viz-neg: #e66767; --viz-grid: rgba(255,255,255,.08); --viz-base: rgba(255,255,255,.22);
  --warning: #fab219; }

/* notices: an icon + text, never colour alone */
.notice { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.4; text-align: left;
  background: color-mix(in srgb, var(--warning) 14%, transparent); }
.notice .ico { width: 18px; height: 18px; flex: none; color: var(--warning); margin-top: 1px; }
.notice.danger { background: color-mix(in srgb, var(--critical) 13%, transparent); }
.notice.danger .ico { color: var(--critical); }
.notice.good { background: color-mix(in srgb, var(--good) 13%, transparent); }
.notice.good .ico { color: var(--good); }
.wallet-page .notice { margin: 8px 0 4px; }
.admin-player > .notice { margin: 10px 0; }

/* emergency switch on: a strip under the admin header */
.admin-alarm { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 9px 12px; border-radius: 12px; font-size: 13px; font-weight: 600;
  background: color-mix(in srgb, var(--critical) 14%, transparent); }
.admin-alarm[hidden] { display: none; }
.admin-alarm .ico { width: 18px; height: 18px; flex: none; color: var(--critical); }
.admin-alarm span { flex: 1; }

.tag.status-frozen { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.tag.status-banned { background: color-mix(in srgb, var(--critical) 15%, transparent); color: var(--critical); }
.tag.role { background: color-mix(in srgb, var(--button) 15%, transparent); color: var(--button); text-transform: capitalize; }
.chips-end { margin-left: auto; display: flex; align-items: center; padding-right: 4px; flex: none; }
.chip:disabled { opacity: .4; }
.admin-row > button.link-btn, .section-head .link-btn { padding: 0; }
.log-row details { margin-top: 4px; }
.log-row details summary { font-size: 12px; cursor: pointer; }
.log-row details .mono { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; word-break: break-all; }
.switch-row { align-items: flex-start; }
.switch-row > div { display: flex; flex-direction: column; gap: 2px; }
.switch-row small { display: block; }
.admin-form .list .admin-row { padding-left: 0; padding-right: 0; }

/* can you pay everyone? */
.solvency { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.solvency p { margin: 0; font-size: 13px; }
.solv-head { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.solv-head .ico { width: 22px; height: 22px; }
.solv-head.status-good .ico { color: var(--good); }
.solv-head.status-warning .ico { color: var(--warning); }
.solv-head.status-critical .ico { color: var(--critical); }
.solv-head.status-muted .ico { color: var(--hint); }
.solv-ratio { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.solvency .admin-row > :first-child { flex: 1; }
.solvency .sub-row { padding-top: 2px; padding-bottom: 2px; border-bottom: 0; padding-left: 12px; }

/* bar charts */
.chart-card { text-align: left; }
.chart-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 6px; font-size: 14px; }
.viz-legend { display: inline-flex; gap: 12px; font-size: 12px; color: var(--hint); }
.viz-legend span, .viz-tip span { display: inline-flex; align-items: center; gap: 5px; }
.viz-legend i, .viz-tip i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.viz { position: relative; touch-action: pan-y; }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz .grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz .grid.base { stroke: var(--viz-base); }
.viz .axis { fill: var(--hint); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.viz .hover-band { fill: var(--viz-grid); }
.viz-tip { position: absolute; top: -6px; transform: translateY(-100%); z-index: 2; pointer-events: none; display: flex; flex-direction: column; gap: 3px;
  padding: 8px 10px; border-radius: 10px; background: var(--card); color: var(--text); font-size: 12px; white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0,0,0,.18), 0 0 0 1px var(--sep); }
.viz-tip[hidden] { display: none; }
.viz-tip span b { margin-left: auto; padding-left: 10px; font-variant-numeric: tabular-nums; }
.viz-table-wrap { padding: 0; overflow-x: auto; }
.viz-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.viz-table th, .viz-table td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--sep); }
.viz-table th:first-child, .viz-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
.viz-table th { color: var(--hint); font-weight: 600; }
.viz-table tfoot td { font-weight: 700; border-bottom: 0; }

/* promo code sheet (Profile) */
.promo-sheet { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 6px 0 4px; }
.promo-sheet h2 { margin: 0; }
.promo-sheet p { margin: 0; }
.promo-sheet input { width: 100%; border: 0; outline: 0; border-radius: 12px; padding: 13px 14px; background: var(--bg); color: var(--text);
  font: inherit; font-size: 18px; font-weight: 700; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.promo-sheet .btn { width: 100%; }

/* banned / maintenance screen */
.phone-gate-icon.danger { background: var(--critical); color: #fff; }

/* "join our channels" screen */
.join-list { width: 100%; padding: 4px 0; margin: 6px 0; text-align: left; }
.join-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; }
.join-row + .join-row { border-top: 1px solid var(--sep); }
.join-name { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.join-name .muted { font-size: 12px; }
.join-state { flex: none; font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 16px; background: var(--button); color: var(--button-text); }
.join-row.joined .join-state { background: color-mix(in srgb, #3fb950 15%, transparent); color: #3fb950; }
.phone-gate > .btn { width: 100%; }

/* lucky wheel */
.spin-badge { flex: none; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; display: grid; place-items: center;
  background: var(--gold); color: #000; font-size: 13px; font-weight: 800; }
.wheel-page { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.wheel-page h2 { margin: 0; }
.wheel-page p { margin: 0; font-size: 14px; line-height: 1.4; }
.wheel-page > .btn { width: 100%; }
.wheel-wrap { position: relative; width: min(300px, 82vw); aspect-ratio: 1; margin: 8px 0 4px; }
.wheel { width: 100%; height: 100%; will-change: transform; }
.wheel svg { width: 100%; height: 100%; display: block; }
.wheel-rim { fill: var(--gold); }
.wheel-edge { fill: none; stroke: rgba(255,255,255,.35); stroke-width: 1.5; }
.wheel path { stroke: rgba(0,0,0,.18); stroke-width: 1; }
.wheel-label { fill: #fff; font-size: 13px; font-weight: 800; paint-order: stroke; stroke: rgba(0,0,0,.35); stroke-width: 2.5px; font-variant-numeric: tabular-nums; }
.wheel-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; z-index: 1;
  border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 24px solid var(--text); filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.wheel-hub { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 22%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; background: var(--card); color: var(--gold); box-shadow: 0 2px 8px rgba(0,0,0,.3), 0 0 0 4px var(--gold); }
.wheel-hub .ico { width: 46%; height: 46%; }
.wheel-dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.wheel-odds .admin-row .who { display: flex; flex-direction: column; }
.wheel-win-amount { font-size: 34px; font-weight: 800; color: #3fb950; font-variant-numeric: tabular-nums; }
.spins-left { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 14px; border-radius: 12px; background: var(--bg); }
.spins-left b { font-size: 22px; font-variant-numeric: tabular-nums; }
.spins-left.has b { color: var(--gold); }
.prize-cell { flex-direction: row; align-items: center; gap: 4px; }
.prize-cell .icon-btn { flex: none; }
.wheel-tier { margin-top: 10px; }
#tab-profile .menu .spin-badge { margin-left: auto; margin-right: 6px; }
/* lucky spin floating button: the number of waiting spins in place of the check-in dot */
.fab-count { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; display: none;
  place-items: center; background: #e5484d; color: #fff; font-size: 11px; font-weight: 800; box-shadow: 0 0 0 2px var(--bg); }
.fab.ready .fab-count:not(:empty) { display: grid; }
/* wheel page: how it works */
.how-list { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.how-step { display: flex; gap: 12px; align-items: flex-start; }
.how-step > div { display: flex; flex-direction: column; gap: 2px; }
.how-step .muted { font-size: 13px; line-height: 1.35; }
.how-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: linear-gradient(135deg, #ffd95a, #f08c00); color: #3a2500; }
/* wheel: the gift in the middle spins it */
button.wheel-hub { border: 0; padding: 0; cursor: pointer; transition: transform .15s; }
button.wheel-hub:active { transform: translate(-50%, -50%) scale(.92); }
button.wheel-hub:disabled { cursor: default; }
.wheel-hub.can-spin { animation: hub-pulse 1.8s ease-in-out infinite; }
@keyframes hub-pulse { 50% { box-shadow: 0 2px 8px rgba(0,0,0,.3), 0 0 0 4px var(--gold), 0 0 0 10px color-mix(in srgb, var(--gold) 30%, transparent); } }
.wheel-label { font-size: 12.5px; }
