/* ---------- Compact Telegram Mini App viewport ----------
   Keep the game dense without placing content underneath Telegram's chrome.
 */

html,
body {
  min-height: 100%;
  min-height: var(--tg-viewport-stable-height, 100vh);
}

.topbar {
  position: relative;
  z-index: 2;
}

body {
  padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
}

.tabbar {
  bottom: env(safe-area-inset-bottom, 0px);
  padding-bottom: 8px;
}

@media (max-width: 600px) and (max-height: 760px) {
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .topbar { padding: 7px 10px; }
  .balance-chip, .stats-chip { padding: 5px 9px; font-size: 12px; }
  .identity-banner { padding: 5px 10px; font-size: 11px; }
  #panel-game { padding: 7px 12px 6px; }
  .betting-label { font-size: 12px; margin-bottom: 1px; }
  .ring-wrap { width: 166px; height: 166px; margin: 3px auto 2px; }
  .countdown { font-size: 29px; }
  .ring-label { font-size: 10px; margin-top: 1px; }
  .entry-price { font-size: 10px; margin-top: 1px; margin-bottom: 5px; }
  .pools-bar { height: 7px; margin-bottom: 4px; }
  .pools-legend { font-size: 10px; margin-bottom: 7px; }
  .direction-row { gap: 7px; margin-bottom: 2px; }
  .dir-btn { padding: 8px 6px; border-radius: 11px; font-size: 12px; gap: 2px; }
  .dir-btn .dir-icon { font-size: 18px; }
  .amount-row { margin-top: 7px; }
}

@media (max-width: 600px) and (max-height: 640px) {
  #panel-game { padding-top: 4px; }
  .ring-wrap { width: 146px; height: 146px; margin-top: 2px; }
  .countdown { font-size: 26px; }
  .entry-price { margin-bottom: 4px; }
  .pools-legend { margin-bottom: 5px; }
  .dir-btn { padding: 7px 5px; }
}

/* ---------- Secondary-tab shared spacing ----------
   Visual ownership for secondary-tab controls and typography lives in
   secondary-tabs.css, which is loaded after this file.
 */
.deposit-section { margin-bottom: 18px; }

/* ---------- Referral / Affiliate UI ---------- */
.ref-link-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-top: 14px;
}

.ref-card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.ref-link-card .cta-btn {
  width: 100%;
  margin-top: 2px;
}

@media (max-width: 380px) {
  .copy-field-row { gap: 5px; }
  .copy-btn { padding: 9px 7px; font-size: 10px; }
}
