/* shop.stormrust.ru — пополнение StormCoin. Палитра как у stormrust.ru */

:root {
  --bg: #060911;
  --bg-card: rgba(16, 24, 40, 0.82);
  --bg-soft: rgba(30, 41, 59, 0.7);
  --border: rgba(30, 58, 102, 0.6);
  --cyan: #00d2ff;
  --gold: #f5c542;
  --green: #10b981;
  --red: #ef4444;
  --text: #f8fafc;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: 'JetBrains Mono', Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #0f1d36 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
}

a { color: var(--cyan); }
code { font-family: var(--mono); background: var(--bg-soft); padding: 1px 6px; border-radius: 4px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; border-bottom: 1px solid var(--border); background: rgba(6, 9, 17, 0.6);
}
.brand { font-weight: 900; font-size: 20px; letter-spacing: 2px; color: var(--text); text-decoration: none; }
.brand span { color: var(--cyan); }
.brand small { font-size: 12px; font-weight: 600; letter-spacing: 1px; color: var(--text-2); margin-left: 6px; }

.auth { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.user { display: flex; align-items: center; gap: 10px; }
.user img, .user .avatar-empty { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); }
.user .avatar-empty { display: inline-block; background: #1e293b; }
.user-name { font-size: 13px; font-weight: 700; line-height: 1.2; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-balance { font-size: 13px; color: var(--gold); font-weight: 700; font-family: var(--mono); }

.main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 28px 16px; display: grid; gap: 20px; }

.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); min-width: 0;
}
h1 { font-size: 26px; font-weight: 900; margin-bottom: 6px; }
h2 { font-size: 20px; font-weight: 800; margin-bottom: 14px; }
h3 { font-size: 14px; color: var(--text-2); font-weight: 700; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.coin-name { color: var(--gold); }
.lead { color: var(--text-2); margin-bottom: 20px; line-height: 1.5; }
.fine { color: var(--text-3); font-size: 12px; margin-top: 10px; line-height: 1.5; }

.notice { border-color: rgba(16, 185, 129, 0.5); }
.notice.wait { border-color: rgba(0, 210, 255, 0.45); }
.notice.bad { border-color: rgba(239, 68, 68, 0.5); }
.notice b { color: var(--gold); }

.login-needed { background: var(--bg-soft); border-radius: 12px; padding: 16px; margin-bottom: 18px; display: grid; gap: 12px; justify-items: start; }

.field-label { display: block; font-size: 12px; color: var(--text-2); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.amount-row { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
#amount {
  flex: 1 1 200px; min-width: 0; font: 800 34px var(--mono); color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px;
}
#amount:focus-visible, .btn:focus-visible, .cat:focus-visible, #slider:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.get { flex: 1 1 200px; background: rgba(245, 197, 66, 0.08); border: 1px solid rgba(245, 197, 66, 0.35); border-radius: 12px; padding: 10px 16px; }
.get-label { font-size: 12px; color: var(--text-2); }
.get-value { font: 800 30px var(--mono); }
.bonus { font-size: 13px; color: var(--green); min-height: 18px; }

#slider { width: 100%; margin: 18px 0 10px; accent-color: var(--cyan); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset { background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 7px 12px; font: 700 14px var(--font); cursor: pointer; }
.preset.active { border-color: var(--cyan); color: var(--cyan); }
.error { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 10px; }

.pay-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px;
  padding: 12px 18px; font: 700 15px var(--font); cursor: pointer; text-decoration: none; border: 1px solid transparent;
}
.btn-primary { background: var(--cyan); color: #04121c; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-small { padding: 7px 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: wait; }

.tiers { margin-top: 18px; color: var(--text-2); }
.tiers summary { cursor: pointer; font-weight: 700; }
.tiers table { margin-top: 10px; border-collapse: collapse; width: 100%; max-width: 420px; }
.tiers th, .tiers td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.tiers td:last-child { font-family: var(--mono); color: var(--text); }

.history-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.list { list-style: none; display: grid; gap: 6px; font-size: 14px; }
.list li { display: flex; justify-content: space-between; gap: 10px; background: var(--bg-soft); border-radius: 8px; padding: 8px 10px; }
.list .when { color: var(--text-3); font-size: 12px; }
.list .plus { color: var(--green); font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.list .minus { color: var(--text); font-family: var(--mono); white-space: nowrap; }
.list .empty { color: var(--text-3); background: none; padding: 0; }

.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cat { background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-2); border-radius: 8px; padding: 8px 14px; font: 700 14px var(--font); cursor: pointer; }
.cat[aria-selected="true"] { color: var(--text); border-color: var(--cyan); background: rgba(0, 210, 255, 0.12); }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 6px; justify-items: center; text-align: center; position: relative; }
.item img { width: 72px; height: 72px; object-fit: contain; }
.item .qty { position: absolute; top: 8px; right: 10px; font: 700 12px var(--mono); color: var(--text-2); }
.item .name { font-size: 13px; font-weight: 700; line-height: 1.3; min-height: 34px; }
.item .price { font: 800 15px var(--mono); color: var(--gold); }
.item .old { font-size: 12px; color: var(--text-3); text-decoration: line-through; margin-right: 4px; font-weight: 500; }

.foot { color: var(--text-3); font-size: 12px; text-align: center; padding: 20px 16px 28px; display: grid; gap: 4px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px);
  background: #0f172a; border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }

@media (max-width: 640px) {
  .top { padding: 12px 16px; }
  .brand small { display: none; }
  .card { padding: 18px; }
  .history-cols { grid-template-columns: 1fr; }
  .pay-buttons .btn { flex: 1 1 100%; }
  .user-name { max-width: 110px; }
}
