:root {
  --bg: #0e0f13;
  --card: #181a20;
  --card2: #1f222b;
  --line: #2a2e39;
  --text: #e8e9ee;
  --muted: #9aa0ac;
  --gold: #ffd34e;
  --gold2: #ffa751;
  --green: #4ade80;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -200px, #1a1d27, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

/* ---- шапка ---- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 18px 24px; border-bottom: 1px solid var(--line);
  background: rgba(14,15,19,.7); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.brand span { background: linear-gradient(90deg, var(--gold), var(--gold2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.nick { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
#nick {
  width: 220px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card2); color: var(--text);
  font-size: 15px; outline: none; transition: border-color .15s;
}
#nick:focus { border-color: var(--gold); }
#nick.invalid { border-color: #ef4444; }
.nick-hint { font-size: 11px; color: var(--muted); }

/* ---- контент ---- */
main { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
h2 { font-size: 20px; margin: 26px 0 14px; }
h2::before { content: "▶ "; color: var(--gold); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.card {
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px; transition: transform .12s, border-color .12s;
}
.card:hover { transform: translateY(-2px); border-color: #3a3f4d; }
.card .title { font-size: 17px; font-weight: 700; }
.card .sub { font-size: 12px; color: var(--muted); min-height: 16px; }
.card.rank .title { background: linear-gradient(90deg, var(--gold), var(--gold2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }

.buys { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.buy {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card2); color: var(--text);
  font-size: 14px; transition: background .12s, border-color .12s;
}
.buy:hover { background: #262a34; border-color: var(--gold); }
.buy .label { color: var(--muted); }
.buy .price { font-weight: 800; }
.buy .price::after { content: " ₽"; font-weight: 500; color: var(--muted); }
.buy.single { justify-content: center; gap: 8px;
  background: linear-gradient(90deg, rgba(255,211,78,.15), rgba(255,167,81,.12)); }
.buy.single .price { color: var(--gold); }

.status { margin-top: 22px; text-align: center; font-size: 14px; min-height: 20px; }
.status.err { color: #f87171; }
.status.ok { color: var(--green); }

footer { text-align: center; padding: 24px; color: var(--muted);
  font-size: 12px; border-top: 1px solid var(--line); }

@media (max-width: 520px) {
  .top { justify-content: center; }
  .nick { align-items: center; }
  #nick { width: 100%; }
}
