:root {
  --bg: var(--tg-theme-bg-color, #0f1115);
  --card: var(--tg-theme-secondary-bg-color, #1a1d24);
  --text: var(--tg-theme-text-color, #e7e9ee);
  --hint: var(--tg-theme-hint-color, #8b919e);
  --accent: var(--tg-theme-button-color, #5b8cff);
  --accent-text: var(--tg-theme-button-text-color, #fff);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, system-ui, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: env(safe-area-inset-bottom);
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
}
.brand { font-weight: 700; font-size: 18px; }
.balance { font-weight: 600; background: var(--card); padding: 6px 12px; border-radius: 999px; }

.tabs { display: flex; gap: 8px; padding: 0 16px 12px; }
.tab {
  flex: 1; padding: 10px; border: 0; border-radius: 10px;
  background: var(--card); color: var(--hint); font-weight: 600; font-size: 14px;
}
.tab.active { background: var(--accent); color: var(--accent-text); }
.tab-panel { display: none; padding: 0 16px 24px; }
.tab-panel.active { display: block; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.case {
  background: var(--card); border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  border-top: 4px solid var(--case-color, var(--accent));
}
.case-name { font-weight: 700; }
.case-items { color: var(--hint); font-size: 12px; line-height: 1.4; }
.btn {
  margin-top: auto; padding: 10px; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--accent-text); font-weight: 600; font-size: 14px;
}
.btn:disabled { opacity: .5; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  background: var(--card); border-radius: 12px; padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.item-name { font-weight: 600; }
.item-meta { color: var(--hint); font-size: 12px; }
.sell { padding: 8px 12px; border: 0; border-radius: 8px; background: #2a2f3a; color: var(--text); font-size: 13px; }
.empty { color: var(--hint); text-align: center; padding: 40px 0; }

.rarity-common { color: #a3a3a3; }
.rarity-rare { color: #60a5fa; }
.rarity-epic { color: #c084fc; }
.rarity-legendary { color: #fbbf24; }
.rarity-mythic { color: #f472b6; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-card {
  background: var(--card); border-radius: 18px; padding: 24px; width: 100%; max-width: 320px;
  text-align: center; display: flex; flex-direction: column; gap: 10px;
}
.modal-title { color: var(--hint); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.drop-name { font-size: 22px; font-weight: 700; }
.drop-rarity { font-weight: 600; text-transform: capitalize; }
.drop-value { color: var(--hint); }

.error {
  position: fixed; left: 16px; right: 16px; bottom: 16px;
  background: #b91c1c; color: #fff; padding: 12px 14px; border-radius: 12px; font-size: 14px;
}
.hidden { display: none !important; }
