:root {
  --bg: #14151a;
  --text: var(--tg-theme-text-color, #f2f3f5);
  --hint: var(--tg-theme-hint-color, #8a8d98);
  --button: var(--tg-theme-button-color, #3b82f6);
  --button-text: var(--tg-theme-button-text-color, #ffffff);
  --card: #1d1e25;
  --card-2: #262832;
  --border: #2f3038;
  --gold: #f5b942;
  --common: #93969f;
  --uncommon: #4ade80;
  --rare: #38bdf8;
  --epic: #a78bfa;
  --legendary: #fbbf24;
  --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

button, input, textarea { font-family: inherit; }

/* ---------- Shimmering aurora background ---------- */

.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.45;
  filter: blur(70px) saturate(150%);
  animation: aurora-hue 20s linear infinite;
}

.bg-aurora span {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
}

.bg-aurora span:nth-child(1) { width: 46vmax; height: 46vmax; top: -18%; left: -12%; background: #6d5bff; animation: blob-1 22s ease-in-out infinite alternate; }
.bg-aurora span:nth-child(2) { width: 38vmax; height: 38vmax; top: 25%; right: -16%; background: #ff6bd6; animation: blob-2 27s ease-in-out infinite alternate; }
.bg-aurora span:nth-child(3) { width: 40vmax; height: 40vmax; bottom: -20%; left: 18%; background: #ffcf5c; animation: blob-3 31s ease-in-out infinite alternate; }
.bg-aurora span:nth-child(4) { width: 30vmax; height: 30vmax; bottom: 5%; right: 8%; background: #3ddcff; animation: blob-4 25s ease-in-out infinite alternate; }

@keyframes aurora-hue {
  from { filter: blur(70px) saturate(150%) hue-rotate(0deg); }
  to { filter: blur(70px) saturate(150%) hue-rotate(360deg); }
}
@keyframes blob-1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(10vw, 8vh) scale(1.15); } }
@keyframes blob-2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-8vw, 10vh) scale(0.9); } }
@keyframes blob-3 { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vw, -10vh) scale(1.1); } }
@keyframes blob-4 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-10vw, -8vh) scale(1.08); } }

@media (prefers-reduced-motion: reduce) {
  .bg-aurora, .bg-aurora span { animation: none; }
}

.app {
  max-width: 620px;
  margin: 0 auto;
  padding: 12px 14px calc(80px + env(safe-area-inset-bottom));
}

.hidden { display: none; }

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0 14px;
}

.profile-mini {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
  flex: none;
}

.header-avatar.big { width: 52px; height: 52px; font-size: 24px; }
.header-avatar img { width: 100%; height: 100%; object-fit: cover; }

.header-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.header-username { font-size: 14px; font-weight: 700; }
.header-level { font-size: 11px; color: var(--hint); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.balance-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
}

.add-btn, .avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--button);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}

/* ---------- Bottom nav ---------- */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: space-around;
  background: rgba(20, 21, 26, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}

.bnav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--hint);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  flex: 1;
}

.bnav-icon { font-size: 19px; }

.bnav-btn.active { color: var(--button); }

/* ---------- Games hub ---------- */

.online-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--hint);
  margin-bottom: 12px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse-dot 1.6s infinite;
  flex: none;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

#online-count { color: var(--text); font-weight: 700; }

.hub-ticker-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 18px;
  overflow: hidden;
}

.ticker-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ticker-strip::-webkit-scrollbar { display: none; }

.ticker-item {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1.5px solid transparent;
}

.ticker-item .gift-img { width: 26px; height: 26px; object-fit: contain; }

.ticker-item.common { border-color: var(--common); }
.ticker-item.uncommon { border-color: var(--uncommon); }
.ticker-item.rare { border-color: var(--rare); }
.ticker-item.epic { border-color: var(--epic); }
.ticker-item.legendary { border-color: var(--legendary); }

.section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 20px 0 10px;
  color: var(--text);
}

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

.game-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 26px 12px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.12s ease;
}

.game-card:active { transform: scale(0.96); }

.game-card::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 80%;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.4;
  z-index: 0;
}

.game-card.accent-blue::before { background: #3b82f6; }
.game-card.accent-red::before { background: #ef4444; }
.game-card.accent-cyan::before { background: #22d3ee; }
.game-card.accent-purple::before { background: #a78bfa; }

.game-card.accent-blue { border-color: rgba(59, 130, 246, 0.4); }
.game-card.accent-red { border-color: rgba(239, 68, 68, 0.4); }
.game-card.accent-cyan { border-color: rgba(34, 211, 238, 0.4); }
.game-card.accent-purple { border-color: rgba(167, 139, 250, 0.4); }

.game-icon {
  position: relative;
  z-index: 1;
  font-size: 40px;
  margin-bottom: 10px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}

.game-title {
  position: relative;
  z-index: 1;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.bonus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bonus-card {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 20px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.bonus-card:active { transform: scale(0.96); }
.bonus-icon { font-size: 28px; margin-bottom: 8px; }
.bonus-title { font-size: 13px; font-weight: 800; letter-spacing: 0.02em; }

/* ---------- Filter chips ---------- */

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--hint);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: var(--button);
  border-color: var(--button);
  color: var(--button-text);
}

.chip-soon { opacity: 0.55; }

/* ---------- Case grid ---------- */

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.case-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 16px 12px 14px;
  text-align: center;
  cursor: pointer;
  background: var(--card);
  overflow: hidden;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.case-card:active { transform: scale(0.97); }

.case-card::before {
  content: "";
  position: absolute;
  inset: -20% -20% auto -20%;
  height: 70%;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.35;
  z-index: 0;
}

.case-card[data-accent="green"]::before { background: var(--uncommon); }
.case-card[data-accent="blue"]::before { background: var(--rare); }
.case-card[data-accent="gold"]::before { background: var(--legendary); }
.case-card[data-accent="purple"]::before { background: var(--epic); }

.case-card[data-accent="green"] { border-color: rgba(74, 222, 128, 0.35); }
.case-card[data-accent="blue"] { border-color: rgba(56, 189, 248, 0.35); }
.case-card[data-accent="gold"] { border-color: rgba(251, 191, 36, 0.35); }
.case-card[data-accent="purple"] { border-color: rgba(167, 139, 250, 0.35); }

.case-price-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  float: right;
}

.case-icon {
  position: relative;
  z-index: 1;
  font-size: 44px;
  margin: 18px 0 10px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
}

.case-title {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
}

.case-price-pill {
  position: relative;
  z-index: 1;
  display: inline-block;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
}

/* ---------- Case detail (roulette) ---------- */

.case-detail { margin-top: 16px; }

.back-btn {
  background: none;
  border: none;
  color: var(--hint);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0 12px;
}

.case-detail h2 { font-size: 18px; margin: 0 0 12px; }

.roulette-wrap { position: relative; margin-bottom: 16px; }

.roulette-viewport {
  overflow: hidden;
  height: 110px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
}

.roulette-marker {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--button);
  z-index: 2;
  transform: translateX(-1px);
}

.strip { display: flex; height: 100%; align-items: center; will-change: transform; }

.strip-item {
  flex: 0 0 96px;
  height: 88px;
  margin: 0 4px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: var(--card-2);
  border: 2px solid transparent;
}

.strip-item .gift-img { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.5)); }

.strip-item.common { border-color: var(--common); }
.strip-item.uncommon { border-color: var(--uncommon); }
.strip-item.rare { border-color: var(--rare); }
.strip-item.epic { border-color: var(--epic); }
.strip-item.legendary { border-color: var(--legendary); }

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.item-card {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
  border: 1px solid var(--border);
}

.item-card .emoji { font-size: 28px; display: block; margin-bottom: 4px; }
.item-card .gift-img { width: 40px; height: 40px; object-fit: contain; display: block; margin: 0 auto 4px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45)); }
.item-card .name { font-size: 11px; color: var(--hint); display: block; }
.item-card .rarity { font-size: 10px; text-transform: uppercase; margin-top: 2px; display: block; font-weight: 700; }
.item-card .value { font-size: 10px; color: var(--gold); margin-top: 2px; display: block; font-weight: 700; }

.rarity.common { color: var(--common); }
.rarity.uncommon { color: var(--uncommon); }
.rarity.rare { color: var(--rare); }
.rarity.epic { color: var(--epic); }
.rarity.legendary { color: var(--legendary); }

.open-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: var(--button);
  color: var(--button-text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.open-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.status-text { text-align: center; color: var(--hint); font-size: 13px; margin-top: 8px; }

/* ---------- Inventory / selectable grids ---------- */

.inventory-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}

.inventory-list .empty { grid-column: 1 / -1; text-align: center; color: var(--hint); padding: 32px 0; }

.item-card.selectable { cursor: pointer; transition: border-color 0.15s, transform 0.1s; }
.item-card.selectable.selected { border-color: var(--button); transform: scale(0.96); background: #202844; }
.item-card.picked { border-color: var(--button); background: #202844; }

/* ---------- Upgrade page ---------- */

.upgrade-target-box {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 14px;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 16px;
}

.upgrade-help {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 11px;
  color: var(--hint);
}

.upgrade-target-empty { text-align: center; color: var(--hint); }
.cube-icon { font-size: 34px; margin-bottom: 8px; opacity: 0.6; }
.upgrade-target-empty p { margin: 0; font-size: 13px; }

.upgrade-target-filled {
  display: flex;
  align-items: center;
  gap: 14px;
}

.upgrade-target-filled .gift-img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5)); }
.upgrade-target-filled .emoji { font-size: 50px; }
.upgrade-target-filled .target-name { font-weight: 800; font-size: 15px; }
.upgrade-target-filled .target-value { color: var(--gold); font-size: 13px; font-weight: 700; }

.upgrade-chance-row { display: flex; justify-content: center; margin-bottom: 16px; }

.dial-circle { position: relative; width: 130px; height: 130px; border-radius: 50%; overflow: visible; }

.dial-ring { position: absolute; inset: 0; border-radius: 50%; background: var(--card-2); transition: background 0.25s; }

.dial-inner {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dial-arrow-wrap { position: absolute; inset: 0; transform: rotate(0deg); }

.dial-arrow {
  position: absolute;
  top: -9px;
  left: 50%;
  width: 0;
  height: 0;
  margin-left: -8px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid var(--gold);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

.dial-circle.spinning .dial-arrow { border-bottom-color: #fff; }
.dial-circle.result-win .dial-arrow { border-bottom-color: var(--uncommon); }
.dial-circle.result-lose .dial-arrow { border-bottom-color: var(--danger); }

#dial-percent { font-size: 26px; font-weight: 800; }
.dial-label { font-size: 10px; color: var(--hint); letter-spacing: 0.08em; text-transform: uppercase; }

.upgrade-stake-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 20px;
}

.stake-value { color: var(--gold); font-size: 13px; font-weight: 700; }

.stake-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.stake-slot {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--hint);
  cursor: pointer;
  position: relative;
}

.stake-slot.filled {
  border-style: solid;
  border-color: var(--button);
  flex-direction: column;
  gap: 2px;
  padding: 6px;
}

.stake-slot .gift-img { width: 34px; height: 34px; object-fit: contain; }
.stake-slot .emoji { font-size: 26px; }
.stake-slot .stake-slot-name { font-size: 9px; color: var(--hint); text-align: center; line-height: 1.2; }
.stake-slot .stake-slot-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

.action-btn {
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: var(--button);
  color: var(--button-text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.action-btn.wide { width: 100%; padding: 14px; font-size: 14px; }
.action-btn.danger { background: var(--danger); }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  flex: none;
}

/* ---------- Bottom sheets ---------- */

.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet.hidden { display: none; }

.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }

.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 78vh;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
}

.sheet-body {
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}

/* ---------- Mines ---------- */

.mines-setup, .mines-info-row { margin-bottom: 14px; }

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
}

.field-row label { font-size: 13px; color: var(--hint); font-weight: 600; }

.field-input {
  width: 90px;
  text-align: right;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.field-input:focus { outline: none; }

.mines-info-row {
  display: flex;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--hint);
}

.mines-info-row b { color: var(--gold); font-size: 15px; }

.mines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.mine-tile {
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}

.mine-tile:active { transform: scale(0.92); }
.mine-tile.safe { background: rgba(74, 222, 128, 0.18); border-color: var(--uncommon); cursor: default; }
.mine-tile.mine { background: rgba(239, 68, 68, 0.25); border-color: var(--danger); cursor: default; }
.mine-tile.disabled { pointer-events: none; opacity: 0.6; }

/* ---------- Crash ---------- */

.crash-history {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.crash-history::-webkit-scrollbar { display: none; }

.crash-history-chip {
  flex: none;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--card);
  border: 1px solid var(--border);
}

.crash-history-chip.low { color: var(--hint); }
.crash-history-chip.mid { color: var(--rare); }
.crash-history-chip.high { color: var(--uncommon); }

.crash-stage {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 16px;
  text-align: center;
  margin-bottom: 16px;
  overflow: hidden;
  min-height: 180px;
}

.crash-multiplier {
  font-size: 40px;
  font-weight: 800;
  transition: color 0.2s;
}

.crash-multiplier.crashed { color: var(--danger); }
.crash-multiplier.running { color: var(--uncommon); }

.crash-phase-label { color: var(--hint); font-size: 12px; margin-top: 6px; }

.crash-rocket-track {
  position: relative;
  height: 70px;
  margin-top: 14px;
}

.crash-rocket {
  position: absolute;
  left: 10%;
  bottom: 0;
  font-size: 28px;
  transform: rotate(-45deg);
  transition: left 0.3s linear, bottom 0.3s linear;
}

/* ---------- Coming soon ---------- */

.coming-soon { text-align: center; padding: 60px 20px; color: var(--hint); font-size: 15px; }
.coming-soon h3 { color: var(--text); font-size: 18px; margin: 10px 0 4px; }

/* ---------- Profile / Friends ---------- */

.friends-card, .profile-card, .promo-card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.profile-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.profile-head .header-user-info { flex: 1; }

.connect-btn {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--hint);
  font-size: 12px;
  font-weight: 700;
  cursor: not-allowed;
}

.ref-level-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-2);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.ref-level-title { font-size: 16px; font-weight: 800; margin: 0 0 4px; }
.ref-level-sub { font-size: 12px; color: var(--hint); margin: 0; }
.ref-mascot { font-size: 36px; }

.friends-stats { display: flex; gap: 24px; margin-bottom: 4px; }
.friends-stats > div { display: flex; flex-direction: column; }
.friends-stats b { font-size: 22px; }
.friends-stats span { font-size: 11px; color: var(--hint); }

.ref-actions { display: flex; gap: 8px; margin-top: 12px; }

.profile-row { margin: 0 0 8px; font-size: 14px; }

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

.ref-link-input {
  flex: 1;
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #101116;
  color: var(--text);
  font-size: 12px;
}

.leaders-list { display: flex; flex-direction: column; gap: 8px; }

.leader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
}

.leader-rank { font-weight: 800; color: var(--hint); width: 28px; }
.leader-name { flex: 1; font-size: 14px; }
.leader-count { font-size: 13px; color: var(--hint); }

/* ---------- Modal ---------- */

.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); display: flex; align-items: center; justify-content: center; z-index: 30; }
.modal.hidden { display: none; }

.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  text-align: center;
  width: 260px;
}

.modal-label { color: var(--hint); font-size: 13px; margin: 0 0 8px; }
.modal-emoji { font-size: 64px; margin-bottom: 8px; }
.modal-emoji .gift-img { width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55)); }
.modal-name { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.modal-rarity { font-size: 12px; text-transform: uppercase; font-weight: 700; margin: 0 0 18px; }

.modal-close {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 10px;
  background: var(--button);
  color: var(--button-text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
