:root {
  --bg: #0d0d12;
  --bg2: #14141c;
  --card: #191922;
  --card2: #20202c;
  --border: #2a2a38;
  --text: #f2f2f7;
  --muted: #8a8a99;
  --accent: #ff4655;
  --accent-dim: #b3323e;
  --green: #3ddc84;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.45; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
.screen { min-height: 100vh; padding: 24px; text-align: center; }

.logo-big {
  font-size: 40px; font-weight: 900; letter-spacing: 2px;
  color: var(--accent);
}
.logo-big span { color: var(--text); }

.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  background: rgba(13, 13, 18, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { font-size: 20px; font-weight: 900; letter-spacing: 1px; color: var(--accent); }
.brand span { color: var(--text); }

.icon-btn {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  width: 38px; height: 38px; border-radius: 12px; font-size: 16px; cursor: pointer;
}
.icon-btn:active { transform: scale(0.94); }

/* ---------- вкладки ---------- */
.tab { padding: 18px 16px 110px; max-width: 560px; margin: 0 auto; }
.tab h2 { font-size: 20px; margin-bottom: 14px; }

.store-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.store-head h2 { margin: 0; }
.timer {
  font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600;
  color: var(--accent); background: rgba(255, 70, 85, 0.12);
  padding: 6px 10px; border-radius: 10px;
}

/* ---------- картки скінів ---------- */
.skin-card {
  position: relative;
  background: linear-gradient(145deg, var(--card), var(--bg2));
  border: 1px solid var(--border); border-radius: 18px;
  padding: 16px; margin-bottom: 12px; overflow: hidden;
}
.skin-card.match { border-color: var(--accent); box-shadow: 0 0 18px rgba(255, 70, 85, 0.25); }
.skin-card .tierbar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.skin-img { width: 100%; height: 84px; object-fit: contain; margin-bottom: 10px;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.5)); }
.skin-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.skin-name { font-weight: 700; font-size: 15px; }
.skin-cost { color: var(--muted); font-size: 13px; white-space: nowrap; }
.match-tag {
  display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700;
  color: var(--accent);
}

.star-btn {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--border); transition: transform 0.15s;
}
.star-btn.on { color: gold; }
.star-btn:active { transform: scale(1.25); }

/* ---------- картки/кнопки ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 16px; margin-bottom: 14px;
}
.card-label {
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.row { display: flex; align-items: center; gap: 12px; }

.btn-primary {
  width: 100%; padding: 15px; margin-top: 12px;
  background: var(--accent); color: #fff; border: none; border-radius: 14px;
  font-size: 15px; font-weight: 800; letter-spacing: 0.5px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 70, 85, 0.35);
}
.btn-primary:active { background: var(--accent-dim); transform: translateY(1px); }

.btn-outline {
  width: 100%; padding: 13px; margin-top: 10px;
  background: var(--card2); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-outline.accent { border-color: var(--accent); color: var(--accent); }
.btn-ghost {
  width: 100%; padding: 12px; margin-top: 8px; background: none;
  color: var(--muted); border: none; font-size: 13px; cursor: pointer;
}

.input {
  width: 100%; padding: 14px; margin-top: 10px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
  color: var(--text); font-size: 14px; outline: none;
}
.input:focus { border-color: var(--accent); }

/* ---------- профіль ---------- */
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7b2d8b);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 20px; flex-shrink: 0;
}
.pf-name { font-weight: 800; font-size: 16px; }
.badge {
  margin-left: auto; padding: 5px 12px; border-radius: 10px;
  font-size: 12px; font-weight: 800;
}
.badge.pro { background: linear-gradient(135deg, #ffb400, #ff4655); color: #fff; }
.badge.free { background: var(--card2); color: var(--muted); }

/* ---------- вішліст ---------- */
.wl-title { margin: 18px 0 10px; font-size: 16px; }
.wl-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 14px; margin-bottom: 8px;
}
.wl-item img { width: 72px; height: 36px; object-fit: contain; }
.wl-item .name { flex: 1; font-size: 14px; font-weight: 600; }
.wl-item .rm { background: none; border: none; color: var(--muted); font-size: 17px; cursor: pointer; }

/* ---------- каталог зброї ---------- */
.weapon-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
}
.weapon-row:active { background: var(--card2); }
.weapon-row .name { flex: 1; font-size: 15px; font-weight: 700; }
.weapon-row .count {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--card2); border-radius: 8px; padding: 3px 8px;
}
.weapon-row img { width: 88px; height: 30px; object-fit: contain; }
.weapon-row .chev { color: var(--muted); font-size: 20px; }

.weapon-head { margin: 4px 0 12px; gap: 10px; }
.weapon-head h3 { flex: 1; margin: 0; }
.chip {
  background: var(--card2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 7px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.chip:active { border-color: var(--accent); }

.tier-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tier-name { font-size: 11px; font-weight: 700; margin-top: 2px; }

.lock-card { text-align: center; padding: 34px 22px; background: var(--card);
  border: 1px solid var(--border); border-radius: 20px; }
.lock-icon { font-size: 44px; margin-bottom: 10px; }
.lock-card h3 { margin-bottom: 8px; }

.empty {
  text-align: center; color: var(--muted); font-size: 14px;
  border: 1px dashed var(--border); border-radius: 14px; padding: 26px 16px;
}

/* ---------- налаштування ---------- */
.settings-head { margin-bottom: 14px; }
.settings-head h2 { margin: 0; }

.switch-row { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; font-size: 14px; cursor: pointer; }
.switch-row input { display: none; }
.switch {
  width: 46px; height: 27px; background: var(--card2); border-radius: 20px;
  position: relative; transition: background 0.2s; flex-shrink: 0;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; background: var(--muted); border-radius: 50%;
  transition: all 0.2s;
}
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { left: 22px; background: #fff; }

.hour-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 14px; font-size: 14px;
}
.hour-select { width: auto; margin-top: 0; padding: 10px 12px; }

/* ---------- модалка ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px);
  display: flex; justify-content: center; padding: 18px;
  overflow-y: auto; /* коли клавіатура зʼїдає екран — модалку можна прокрутити */
}
.modal {
  width: 100%; max-width: 420px;
  margin: auto; /* центр, але з можливістю скролу при малому вʼюпорті */
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 22px; padding: 20px;
  animation: pop 0.2s ease;
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.steps { padding-left: 20px; margin-bottom: 6px; }
.steps li { margin-bottom: 6px; }
.error { color: var(--accent); font-size: 13px; margin-top: 10px; }

/* ---------- нижня навігація ---------- */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: rgba(13, 13, 18, 0.95); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 0 max(10px, env(safe-area-inset-bottom));
}
.nav-btn {
  background: none; border: none; color: var(--muted);
  font-size: 11px; font-weight: 700; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 18px; border-radius: 14px;
}
.nav-btn span { font-size: 20px; }
.nav-btn.active { color: var(--accent); background: rgba(255, 70, 85, 0.1); }

.footer { text-align: center; padding: 8px 0 90px; font-size: 12px; }
