/* ===========================================================
   Stalcraft Companion — дизайн-система
   Палитра: тёмная зона, индустриальный фон + радиационно-зелёный
   акцент (как индикатор счётчика Гейгера) + тревожный янтарный
   для предупреждений/уведомлений.
   =========================================================== */

:root {
  /* --- Цвет --- */
  --bg-void: #0b0d0a;          /* фон приложения — почти чёрный, с лёгкой зеленью */
  --bg-panel: #14180f;         /* панели/карточки */
  --bg-panel-raised: #1a2014;  /* приподнятые элементы, hover */
  --line: #2a3320;             /* тонкие разделители */
  --line-bright: #3c4a2a;      /* акцентные границы */

  --accent: #9dff5c;           /* радиационно-зелёный — главный акцент */
  --accent-dim: #6fae3f;
  --accent-glow: rgba(157, 255, 92, 0.18);

  --warn: #ffb02e;             /* янтарный — предупреждения, уведомления */
  --danger: #ff5c5c;           /* опасность, отрицательные значения */

  --text-primary: #eef2e6;
  --text-secondary: #9aa68c;
  --text-faded: #5c6652;

  /* --- Типографика --- */
  --font-display: "Oswald", "Arial Narrow", sans-serif;   /* заголовки — индустриальный, сжатый */
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace; /* цифры, цены, id предметов */

  /* --- Форма --- */
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 800px 400px at 50% -10%, var(--accent-glow), transparent 60%);
  background-attachment: fixed;
  padding-bottom: 24px;
}

a { color: inherit; text-decoration: none; }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* --- Скроллбар (где поддерживается) --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 4px; }

/* ===========================================================
   Шапка приложения
   =========================================================== */

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 14px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(to bottom, var(--bg-void) 70%, transparent);
}

.app-header__back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-s);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.app-header__title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0;
}

.app-header__subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 2px 0 0;
}

.scan-indicator {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.scan-indicator__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ===========================================================
   Главное меню (index.html)
   =========================================================== */

.hero {
  padding: 8px 20px 4px;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 8px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.hero__desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 20px;
  max-width: 420px;
}

.section-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 20px 20px;
}

.section-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, transform 0.1s ease;
  text-align: left;
  width: 100%;
}

.section-card:active {
  transform: scale(0.98);
  border-color: var(--line-bright);
}

.section-card__icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-m);
  background: var(--bg-panel-raised);
  border: 1px solid var(--line-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.section-card__body { flex: 1; min-width: 0; }

.section-card__title {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 3px;
}

.section-card__desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.section-card__arrow {
  color: var(--text-faded);
  flex-shrink: 0;
}

.status-strip {
  margin: 4px 20px 0;
  padding: 10px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-strip__icon { color: var(--accent); font-size: 14px; }

/* ===========================================================
   Общие компоненты (карточки, инпуты, теги)
   =========================================================== */

.page-content { padding: 0 18px 18px; }

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

.panel__title {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 10px 14px;
  margin-bottom: 14px;
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  font-family: var(--font-body);
}

.search-bar input::placeholder { color: var(--text-faded); }
.search-bar__icon { color: var(--text-faded); flex-shrink: 0; }

.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.item-row__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-s);
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.item-row__name {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 2px;
}

.item-row__meta {
  font-size: 11.5px;
  color: var(--text-faded);
  font-family: var(--font-mono);
}

.item-row__price {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg-panel-raised);
  border: 1px solid var(--line-bright);
  color: var(--text-secondary);
}

.pill--active {
  background: var(--accent-glow);
  border-color: var(--accent-dim);
  color: var(--accent);
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.tab {
  flex: 1;
  padding: 9px 0;
  text-align: center;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.tab.active {
  background: var(--accent-glow);
  border-color: var(--accent-dim);
  color: var(--accent);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 0;
  border-radius: var(--radius-m);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.btn--primary {
  background: var(--accent);
  color: #0b0d0a;
}

.btn--primary:active { background: var(--accent-dim); }

.btn--secondary {
  background: var(--bg-panel-raised);
  border: 1px solid var(--line-bright);
  color: var(--text-primary);
}

.btn--ghost {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-faded);
}

.empty-state__icon { font-size: 36px; margin-bottom: 10px; opacity: 0.6; }
.empty-state__text { font-size: 13px; line-height: 1.5; }

.loader {
  display: flex;
  justify-content: center;
  padding: 30px 0;
}

.loader__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  margin: 0 4px;
  animation: pulse 1s ease-in-out infinite;
}
.loader__dot:nth-child(2) { animation-delay: 0.15s; }
.loader__dot:nth-child(3) { animation-delay: 0.3s; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 18px;
  right: 18px;
  background: var(--bg-panel-raised);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-m);
  padding: 12px 16px;
  font-size: 13px;
  text-align: center;
  z-index: 100;
  box-shadow: var(--shadow-card);
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Артефакты: выбор карточками (калькулятор) --- */

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.artifact-card {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 12px;
  text-align: left;
}

.artifact-card.selected {
  border-color: var(--accent-dim);
  background: var(--accent-glow);
}

.artifact-card__icon { font-size: 22px; margin-bottom: 6px; }
.artifact-card__name { font-size: 12.5px; font-weight: 600; margin: 0 0 4px; line-height: 1.25; }
.artifact-card__rarity {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  color: var(--text-faded);
}

.artifact-card__check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.artifact-card.selected .artifact-card__check {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0d0a;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--line);
}
.stat-row:last-child { border-bottom: none; }
.stat-row__name { color: var(--text-secondary); }
.stat-row__value { font-family: var(--font-mono); font-weight: 600; }
.stat-row__value.positive { color: var(--accent); }
.stat-row__value.negative { color: var(--danger); }

/* --- Профиль --- */

.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 4px 18px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-panel-raised);
  border: 2px solid var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  object-fit: cover;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 19px;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.profile-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faded);
}

.list-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.list-action:last-child { border-bottom: none; }

.toggle {
  width: 42px;
  height: 24px;
  border-radius: 100px;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line-bright);
  position: relative;
  flex-shrink: 0;
}

.toggle__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-faded);
  transition: left 0.15s ease, background 0.15s ease;
}

.toggle.on { border-color: var(--accent-dim); background: var(--accent-glow); }
.toggle.on .toggle__knob { left: 22px; background: var(--accent); }
