/* Мини-апп Football Cards: тёмная «стадионная» тема, крупные касания. */

:root {
  --bg: #0a1712;
  --card: #12241c;
  --line: #1e3a2d;
  --ink: #eaf5ef;
  --dim: #8fae9e;
  --green: #37d67a;
  --gold: #ffd23f;
  --red: #e5484d;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  overscroll-behavior: none;
}

/* ---------- шапка ---------- */

#bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  background: linear-gradient(180deg, #0d1f17, rgba(10, 23, 18, .92));
  border-bottom: 1px solid var(--line);
}

#bar .who b { display: block; font-size: 15px; }
#bar .who span { font-size: 12px; color: var(--dim); }

#bar .wallet {
  display: flex;
  gap: 10px;
  font-size: 13px;
  white-space: nowrap;
}

#bar .wallet b { font-weight: 700; }

/* ---------- экран ---------- */

#screen {
  padding: 14px 14px calc(86px + env(safe-area-inset-bottom));
  display: grid;
  gap: 12px;
}

.loading { padding: 40px 0; text-align: center; color: var(--dim); }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: .01em;
}

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--dim); font-size: 13px; }

button.big {
  width: 100%;
  padding: 15px;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  color: #05210f;
  font-size: 16px;
  font-weight: 700;
}

button.big:disabled { background: #2c4a3a; color: #7f9a8c; }

button.ghost {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

/* ---------- карточки ---------- */

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

.card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #0e1d16;
  border: 1px solid var(--line);
  aspect-ratio: 3 / 4;
}

.card img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card .meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 20px 8px 7px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .88));
  font-size: 11px;
  line-height: 1.25;
}

.card .meta b { display: block; font-size: 12px; }
.card .count {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .6);
  font-size: 11px;
}

.card.miss { opacity: .45; filter: grayscale(1); }

/* полоски прогресса по редкостям */
.bars { display: grid; gap: 8px; }
.bars .b { font-size: 12px; }
.bars .track {
  height: 7px;
  border-radius: 999px;
  background: #0e1d16;
  overflow: hidden;
  margin-top: 4px;
}
.bars .fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); }

/* ---------- список магазина и рейтинга ---------- */

.list { display: grid; gap: 8px; }

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

.item .name { font-size: 14px; }
.item .sub { font-size: 12px; color: var(--dim); }

.item button {
  border: 0;
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 700;
  background: var(--green);
  color: #05210f;
  white-space: nowrap;
}

.item button.coins { background: var(--gold); color: #2a1f00; }
.item button:disabled { background: #2c4a3a; color: #7f9a8c; }

.place { width: 26px; color: var(--dim); font-size: 13px; text-align: right; }
.me { border-color: var(--green); }

/* ---------- вкладки ---------- */

.seg {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.seg button {
  flex: 1;
  padding: 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--dim);
  font-size: 13px;
}

.seg button.on { background: var(--green); color: #05210f; font-weight: 700; }

/* ---------- нижняя навигация ---------- */

#tabs {
  position: fixed;
  inset: auto 0 0 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(9, 20, 15, .96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
  z-index: 6;
}

#tabs button {
  border: 0;
  background: transparent;
  color: var(--dim);
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 2px;
  font-size: 11px;
}

#tabs button i { font-style: normal; font-size: 19px; }
#tabs button.on { color: var(--green); }

/* ---------- мелочи ---------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: 88vw;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .88);
  font-size: 14px;
  text-align: center;
  z-index: 9;
  animation: rise .25s ease-out;
}

@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.hidden { display: none !important; }

.drop-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.drop-card img {
  width: min(72vw, 280px);
  border-radius: 18px;
  border: 1px solid var(--line);
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #0e1d16;
  border: 1px solid var(--line);
  font-size: 12px;
}
