/* GASHA Mini App — same design system as the landing, sized for a thumb.
   Fonts are the platform stack on purpose: a Telegram webview should paint
   instantly, and two webfont downloads is the difference between feeling
   native and feeling like a website in a box. */

:root {
  --ink: #07130f;
  --panel: #0f3d2e;
  --panel-2: #14503b;
  --bone: #f4f1e4;
  --gold: #d8b25a;
  --mint: #5ef2a0;
  --coral: #ff6b4a;
  --line: #2f6551;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.b { font-weight: 700; }
.mint { color: var(--mint); }
.coral { color: var(--coral); }
.hide { display: none !important; }

/* ── chrome ─────────────────────────────────────────────── */

.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 14px;
  background: var(--ink);
  border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { border: 2px solid var(--line); display: block; }

.live { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #f4f1ea99; }
.dot {
  width: 8px; height: 8px; background: var(--mint); flex: none;
  animation: blip 1.6s ease-in-out infinite;
}
.live.stale .dot { background: var(--coral); animation: none; }
@keyframes blip { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

.tabs {
  position: sticky; top: 47px; z-index: 10;
  display: flex; gap: 6px; padding: 8px 14px;
  background: var(--ink); border-bottom: 2px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: none; cursor: pointer;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 10px 14px; min-height: 40px;
  color: #f4f1ea8c; background: transparent;
  border: 2px solid var(--line);
  transition: background-color .18s, color .18s, border-color .18s;
}
.tab.on { background: var(--mint); border-color: var(--mint); color: var(--ink); }

main { padding: 14px; }
.view { display: block; }

/* ── shared bits ────────────────────────────────────────── */

.sortbar, .rips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.chip {
  cursor: pointer; min-height: 40px; padding: 9px 13px;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: #f4f1ea99; background: transparent; border: 2px solid var(--line);
  transition: background-color .18s, color .18s, border-color .18s;
}
.chip.on { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.rips .chip { flex: 1 1 28%; }

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

.row {
  background: var(--panel); border: 2px solid var(--line);
  box-shadow: 4px 4px 0 0 var(--line);
  padding: 12px;
}
.row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.row-code { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.row-price {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--gold); border: 2px solid var(--gold); padding: 1px 6px; flex: none;
}
.row-figs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px;
  font-family: var(--mono); font-size: 12px;
}
.row-figs span { display: block; font-size: 10px; color: #f4f1ea73; letter-spacing: .08em; text-transform: uppercase; }

.rar { display: flex; height: 6px; border: 2px solid var(--line); margin-top: 10px; overflow: hidden; }
.rar i { display: block; border-right: 2px solid var(--ink); }
.rar i:last-child { border-right: 0; }

.pull { display: flex; gap: 10px; align-items: center; }
.pull img { width: 40px; height: 56px; object-fit: contain; background: var(--ink); border: 2px solid var(--line); flex: none; }
.pull-name { font-family: var(--mono); font-size: 12px; line-height: 1.35; }
.pull-meta { font-family: var(--mono); font-size: 11px; color: #f4f1ea73; margin-top: 3px; }
.tier { font-weight: 700; }
.tier-1 { color: var(--coral); }
.tier-2 { color: var(--gold); }
.tier-3 { color: var(--mint); }
.tier-4 { color: #f4f1ea73; }

.skel { height: 84px; background: var(--panel); border: 2px solid var(--line); opacity: .45; }

/* ── calc ───────────────────────────────────────────────── */

.lbl {
  display: block; font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: #f4f1ea8c; margin-bottom: 7px;
}
.select {
  width: 100%; min-height: 46px; padding: 11px;
  background: var(--ink); color: var(--bone);
  border: 2px solid var(--line); font-size: 14px; margin-bottom: 16px;
}
.figs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 14px; }
.figs > div { background: var(--panel); border: 2px solid var(--line); padding: 11px; }
.figs > div:last-child { grid-column: 1 / -1; }
.figs dt { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #f4f1ea73; }
.figs dd { font-family: var(--mono); font-size: 22px; font-weight: 700; margin-top: 6px; }

.epic { background: var(--panel); border: 2px solid var(--line); padding: 11px; }
.track { height: 18px; border: 2px solid var(--line); margin: 8px 0 6px; }
.fill { height: 100%; width: 0; background: var(--coral); transition: width .3s; }
.epic .b { font-size: 16px; }

/* ── notes / footer ─────────────────────────────────────── */

.note { font-size: 12px; line-height: 1.55; color: #f4f1ea8c; margin-top: 14px; }
.note strong { color: var(--bone); font-weight: 600; }

.foot { padding: 18px 14px calc(24px + env(safe-area-inset-bottom)); border-top: 2px solid var(--line); }
.foot p { font-size: 11px; line-height: 1.5; color: #f4f1ea73; }
.foot p:first-child { font-size: 10px; margin-bottom: 8px; color: #f4f1ea59; }

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