/* KLEOS PWA: мобильный сценарий первичен. Палитра — от логотипа (assets/):
   глубокий тёмно-синий фон, фиолетовый акцент, циан для значений, лайм — редкий highlight. */

:root {
  --bg: #0a0b14;
  --panel: #14152a;
  --panel-2: #1e2038;
  --text: #e9e8f2;
  --muted: #8d8fa8;
  --accent: #7c5cff;
  --accent-dark: #5a3fd6;
  --value: #29c8f0;
  --highlight: #c8f000;
  --danger: #e0564f;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-decoration: none;
  font-size: 18px;
}

.brand img { width: 28px; height: 28px; }

.tabs {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
}

.tabs a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.tabs a.active {
  color: var(--text);
  background: var(--panel-2);
}

/* Телефон и Mini App: вкладки — фиксированная нижняя панель, все пункты
   видны сразу (горизонтальный скролл вкладок незаметен и неудобен). */
@media (max-width: 640px) {
  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: var(--panel);
    border-top: 1px solid var(--panel-2);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    overflow: visible;
  }
  .tabs a {
    text-align: center;
    font-size: 13px;
    padding: 8px 2px;
  }
  .tabs a.active {
    color: var(--accent);
    background: none;
    font-weight: 700;
  }
  .view {
    padding-bottom: 84px; /* контент не прячется за нижней панелью */
  }
  .footer {
    padding-bottom: 72px;
  }
  .topbar {
    justify-content: space-between;
  }
}

.view {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.footer {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 12px 16px 20px;
}

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

.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
}

.card:hover { border-color: var(--accent-dark); }

.card .price { color: var(--value); font-weight: 700; }

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.muted { color: var(--muted); }
.error { color: var(--danger); }

.entry-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--panel-2);
}

.entry-row:last-child { border-bottom: none; }

.price { color: var(--value); font-weight: 700; }

button, .button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: var(--accent-dark); }

button:disabled { background: var(--panel-2); color: var(--muted); cursor: default; }

textarea, input {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid #2c2f52;
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

textarea { min-height: 140px; font-family: ui-monospace, monospace; font-size: 13px; }

.check-list { list-style: none; padding: 0; }
.check-list li::before { content: "✗ "; color: var(--danger); }
.check-list li.ok::before { content: "✓ "; color: var(--highlight); }

/* --- auth / профиль --- */
.auth-area { white-space: nowrap; }
.balance-chip {
  color: var(--text);
  text-decoration: none;
  background: var(--panel-2);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
}
.auth-panel { max-width: 420px; margin: 24px auto; }
.link-button {
  background: none;
  color: var(--accent);
  padding: 10px 6px;
}

/* --- рулетка --- */
.roulette {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel-2);
  margin: 12px 0;
}
.roulette-pin {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--highlight);
  z-index: 2;
}
.strip {
  display: flex;
  transition: transform 4.2s cubic-bezier(0.12, 0.7, 0.12, 1);
  will-change: transform;
}
.cell {
  flex: 0 0 96px;
  width: 96px;
  padding: 10px 4px;
  text-align: center;
  border-right: 1px solid var(--panel);
  font-size: 12px;
}
.cell img { width: 72px; height: 54px; }
.mini { width: 28px; height: 21px; vertical-align: middle; }

/* цвет редкости — рамка карточек и ячеек */
.rarity-consumer { border-color: #b0c3d9 !important; }
.rarity-industrial { border-color: #5e98d9 !important; }
.rarity-mil-spec { border-color: #4b69ff !important; }
.rarity-restricted { border-color: #8847ff !important; }
.rarity-classified { border-color: #d32ce6 !important; }
.rarity-covert { border-color: #eb4b4b !important; }
.card[class*="rarity-"], .win-panel[class*="rarity-"] { border: 1px solid; }

.win-panel { text-align: center; }

.tg-button { background: #2aabee; color: #fff; }
.inline-form { display: flex; gap: 8px; margin-top: 10px; }
.inline-form input { flex: 1; }

/* --- джекпот --- */
.countdown {
  font-size: 40px;
  font-weight: 800;
  color: var(--highlight);
  text-align: center;
}
.round-card { cursor: pointer; }
.picker { margin-top: 8px; }
.picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
}
.picker-item img { width: 40px; height: 30px; }
pre {
  background: var(--panel-2);
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
  font-size: 12px;
}
