/* ============================================================
   Blvck Gaming — design tokens
   Чёрно-золотая премиальная тема, в тон фирменному лого клуба
   (чёрный + металлик золото/серебро + красный акцент).
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #121214;
  --bg-soft: #17171a;
  --surface: #1c1c1f;
  --surface-2: #242428;
  --surface-hover: #2c2c31;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #f6f5f2;
  --text-dim: rgba(246, 245, 242, 0.64);
  --text-faint: rgba(246, 245, 242, 0.38);

  --accent: #d9a94e;
  --accent-2: #b8860b;
  --accent-bright: #f3d98b;
  --accent-contrast: #14100a;
  --accent-soft: rgba(217, 169, 78, 0.16);
  --accent-gradient: linear-gradient(135deg, var(--accent-bright), var(--accent-2));
  --silver: #c9ced6;

  --free: #35d07f;
  --free-glow: rgba(53, 208, 127, 0.35);
  --busy: #ff3b47;
  --busy-glow: rgba(255, 59, 71, 0.3);
  --warn: #ffb74d;
  --warn-soft: rgba(255, 183, 77, 0.16);
  --warn-glow: rgba(255, 183, 77, 0.35);
  --danger: #ff3b47;
  --danger-soft: rgba(255, 59, 71, 0.14);
  --success: #35d07f;
  --success-soft: rgba(53, 208, 127, 0.14);

  /* Тиры зон: MIDDLE — серый неон, PRO — красный неон, ULTRA — золотой неон */
  --tier-main: #c9ced6;
  --tier-main-glow: rgba(201, 206, 214, 0.35);
  --tier-pro: #ff3b47;
  --tier-pro-glow: rgba(255, 59, 71, 0.35);
  --tier-ultra: #d9a94e;
  --tier-ultra-glow: rgba(217, 169, 78, 0.4);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.4);
  --shadow-nav: 0 -8px 24px rgba(0, 0, 0, 0.35);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --top-bar-h: 60px;
  --nav-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

button, input, select {
  font-family: inherit;
  color: inherit;
}

/* Safety net: any inline SVG without an explicit size rule (e.g. a fresh
   icon dropped into a new spot) falls back to a sane 20px instead of
   rendering at its raw viewBox size. */
svg { width: 20px; height: 20px; flex: none; display: block; }

svg.icon, .nav-item svg, .icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ---------------------------------------------------------- shell */

#shell {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

#top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: calc(var(--safe-top) + 14px) var(--space-4) 14px;
  background: rgba(18, 18, 20, 0.82);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: var(--space-3); min-width: 0; flex: 1; }

.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 11px;
  overflow: hidden;
  background: #000;
  /* золотой кант + лёгкая красная неоновая засветка, как у вывески клуба */
  box-shadow:
    0 0 0 1px rgba(217, 169, 78, 0.45),
    0 4px 14px rgba(0, 0, 0, 0.5),
    0 0 16px 1px rgba(255, 30, 60, 0.3);
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 24%;
  display: block;
}

.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--accent-bright), var(--silver) 55%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex: none;
  transition: background 0.2s ease;
}
.chip .icon { color: var(--accent); }

#content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-4) var(--space-4) calc(var(--nav-h) + var(--safe-bottom) + var(--space-6));
}

.view { display: none; animation: view-in 0.28s ease; }
.view.active { display: block; }

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

/* ---------------------------------------------------------- bottom nav */

/* Без общей плашки-подложки — три кнопки просто плавают над фоном сами по себе. */
#bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 10px var(--space-3) calc(10px + var(--safe-bottom));
}

/* Каждая вкладка — отдельная кнопка с золотым неоновым контуром в покое;
   активная заливается золотом и пульсирует свечением ("сияет"). */
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px;
  border: 1px solid rgba(217, 169, 78, 0.35);
  background: rgba(20, 20, 20, 0.55);
  border-radius: var(--radius-md);
  color: var(--text-faint);
  cursor: pointer;
  transition: color 0.18s ease, transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}
.nav-item span { font-size: 11px; font-weight: 700; }
.nav-item:active { transform: scale(0.94); }
.nav-item.active {
  background: var(--accent-gradient);
  color: var(--accent-contrast);
  border-color: transparent;
  animation: nav-shine 2.4s ease-in-out infinite;
}

@keyframes nav-shine {
  0%, 100% { box-shadow: 0 0 12px 1px rgba(217, 169, 78, 0.45), 0 4px 14px rgba(184, 134, 11, 0.35); }
  50% { box-shadow: 0 0 20px 4px rgba(217, 169, 78, 0.7), 0 4px 14px rgba(184, 134, 11, 0.45); }
}

/* ---------------------------------------------------------- headings */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.section-head h2 { font-size: 19px; margin: 0; font-weight: 800; letter-spacing: 0.2px; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.icon-btn:active { background: var(--surface-hover); transform: scale(0.92); }
.icon-btn.spinning svg { animation: spin 0.7s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- stats + filters */

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: var(--space-3);
}
.stat-card {
  padding: 12px 12px 11px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-faint);
}
.stat-value { font-size: 21px; font-weight: 800; }
.stat-value.stat-free { color: var(--free); }
.stat-value.stat-busy { color: var(--busy); }
.stat-note { font-size: 10px; font-weight: 600; color: var(--text-faint); }

.segmented-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: var(--space-3);
}
.segmented-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 9px 4px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.segmented-toggle button.selected {
  background: var(--accent-gradient);
  color: var(--accent-contrast);
}

.zone-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-4);
}
.zone-chips button {
  flex: none;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.zone-chips button:active { transform: scale(0.96); }
.zone-chips button.selected {
  background: var(--accent-gradient);
  color: var(--accent-contrast);
  border-color: transparent;
}

/* Тиры зон — контур неонового цвета в покое, заливка тем же цветом при
   выборе: MIDDLE серый, PRO красный, ULTRA золотой. */
.zone-chips button.tier-main { border-color: rgba(201, 206, 214, 0.4); color: var(--tier-main); }
.zone-chips button.tier-main.selected {
  background: linear-gradient(135deg, #eef0f2, #9aa1ab);
  color: #101214;
  box-shadow: 0 0 14px 1px var(--tier-main-glow);
}

.zone-chips button.tier-pro { border-color: rgba(255, 59, 71, 0.4); color: var(--tier-pro); }
.zone-chips button.tier-pro.selected {
  background: linear-gradient(135deg, #ff5a66, #c81c2c);
  color: #ffffff;
  box-shadow: 0 0 14px 1px var(--tier-pro-glow);
}

.zone-chips button.tier-ultra { border-color: rgba(217, 169, 78, 0.45); color: var(--tier-ultra); }
.zone-chips button.tier-ultra.selected {
  background: var(--accent-gradient);
  color: var(--accent-contrast);
  box-shadow: 0 0 14px 1px var(--tier-ultra-glow);
}

/* ---------------------------------------------------------- pc lists */

.groups { display: flex; flex-direction: column; gap: var(--space-4); }

/* Каждая зона — отдельная панель с рамкой/подсветкой своего тира:
   MIDDLE серый, PRO красный, ULTRA золотой. */
.zone-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  padding: 14px;
}
.zone-panel.tier-main {
  border-color: rgba(201, 206, 214, 0.35);
  background: linear-gradient(165deg, rgba(201, 206, 214, 0.09), var(--surface) 60%);
}
.zone-panel.tier-pro {
  border-color: rgba(255, 59, 71, 0.35);
  background: linear-gradient(165deg, rgba(255, 59, 71, 0.09), var(--surface) 60%);
}
.zone-panel.tier-ultra {
  border-color: rgba(217, 169, 78, 0.4);
  background: linear-gradient(165deg, rgba(217, 169, 78, 0.1), var(--surface) 60%);
}

.room-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 var(--space-2) 2px;
}
.room-title-right { display: flex; align-items: center; gap: 8px; flex: none; }

.room-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.room-title.tier-main { color: var(--tier-main); text-shadow: 0 0 10px rgba(201, 206, 214, 0.3); }
.room-title.tier-pro { color: var(--tier-pro); text-shadow: 0 0 10px rgba(255, 59, 71, 0.35); }
.room-title.tier-ultra { color: var(--tier-ultra); text-shadow: 0 0 10px rgba(217, 169, 78, 0.35); }

.room-title-count {
  font-size: 13px;
  font-weight: 800;
  text-shadow: none;
  white-space: nowrap;
}
.count-free { color: var(--free); text-shadow: 0 0 8px var(--free-glow); }
.count-busy { color: var(--busy); text-shadow: 0 0 8px var(--busy-glow); }
.count-sep { color: var(--text-faint); margin: 0 1px; }

.peripherals-btn {
  flex: none;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.peripherals-btn:active { transform: scale(0.94); }
.peripherals-btn.tier-main {
  border-color: rgba(201, 206, 214, 0.45);
  color: var(--tier-main);
  background: rgba(201, 206, 214, 0.14);
}
.peripherals-btn.tier-pro {
  border-color: rgba(255, 59, 71, 0.45);
  color: var(--tier-pro);
  background: rgba(255, 59, 71, 0.14);
}
.peripherals-btn.tier-ultra {
  border-color: rgba(217, 169, 78, 0.5);
  color: var(--tier-ultra);
  background: rgba(217, 169, 78, 0.14);
}

.pc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }

.pc-card {
  position: relative;
  padding: 11px 12px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.pc-card .pc-name { font-size: 14px; font-weight: 700; }
.pc-card .pc-state {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Заливаем всю карточку цветом статуса — считывается с одного взгляда,
   без необходимости всматриваться в точку-индикатор. */
.pc-card.status-free {
  background: linear-gradient(165deg, rgba(53, 208, 127, 0.16), rgba(53, 208, 127, 0.03));
  border-color: rgba(53, 208, 127, 0.32);
}
.pc-card.status-free .pc-state { color: var(--free); }
.pc-card.status-busy {
  background: linear-gradient(165deg, rgba(255, 59, 71, 0.16), rgba(255, 59, 71, 0.03));
  border-color: rgba(255, 59, 71, 0.28);
}
.pc-card.status-busy .pc-state { color: var(--busy); }
.pc-card.status-reserved {
  background: linear-gradient(165deg, rgba(255, 183, 77, 0.18), rgba(255, 183, 77, 0.03));
  border-color: rgba(255, 183, 77, 0.35);
}
.pc-card.status-reserved .pc-state { color: var(--warn); }

.status-icon {
  width: 15px;
  height: 15px;
  flex: none;
}
.status-icon.free { color: var(--free); filter: drop-shadow(0 0 4px var(--free-glow)); animation: pulse-icon 2.4s ease-in-out infinite; }
.status-icon.busy { color: var(--busy); filter: drop-shadow(0 0 4px var(--busy-glow)); }
.status-icon.reserved { color: var(--warn); filter: drop-shadow(0 0 4px var(--warn-glow)); animation: pulse-icon 2.4s ease-in-out infinite; }

/* Свободный ПК можно тапнуть и забронировать — значок "+" в углу карточки
   подсказывает это, не дожидаясь чтения текста. */
.pc-card-bookable { cursor: pointer; }
.pc-card-bookable:active { transform: scale(0.96); }
.pc-book-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--free);
  color: #08150d;
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 8px var(--free-glow);
}

/* ---------------------------------------------------------- бронирование */

.booking-section-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-faint);
  margin: 4px 0 8px;
}
.booking-section-label:not(:first-child) { margin-top: var(--space-4); }

.picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-3);
}
.picker-chips button {
  flex: none;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.picker-chips button:active { transform: scale(0.96); }
.picker-chips button.selected {
  background: var(--accent-gradient);
  color: var(--accent-contrast);
  border-color: transparent;
  box-shadow: 0 0 12px 1px rgba(217, 169, 78, 0.35);
}

#booking-modal .field-hint { margin: var(--space-1) 0 var(--space-4); }

.booking-list { display: flex; flex-direction: column; gap: 10px; }

.booking-item {
  position: relative;
  padding: 12px 14px 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.booking-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.booking-item.status-pending::before { background: var(--warn); }
.booking-item.status-confirmed::before { background: var(--free); }
.booking-item.status-rejected::before,
.booking-item.status-cancelled::before,
.booking-item.status-expired::before { background: var(--busy); }
.booking-item.status-done::before { background: var(--text-faint); }

.booking-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.booking-item-pc { font-weight: 800; font-size: 14.5px; }
.booking-item-time { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }

.booking-item-status {
  flex: none;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.booking-item.status-pending .booking-item-status { color: var(--warn); background: var(--warn-soft); }
.booking-item.status-confirmed .booking-item-status { color: var(--free); background: var(--success-soft); }
.booking-item.status-rejected .booking-item-status,
.booking-item.status-cancelled .booking-item-status,
.booking-item.status-expired .booking-item-status { color: var(--busy); background: var(--danger-soft); }
.booking-item.status-done .booking-item-status { color: var(--text-faint); background: var(--surface-2); }

.booking-cancel-btn {
  margin-top: 9px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 59, 71, 0.35);
  background: rgba(255, 59, 71, 0.1);
  color: var(--busy);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.booking-cancel-btn:active { transform: scale(0.96); }
.booking-cancel-btn:disabled { opacity: 0.5; pointer-events: none; }

@keyframes pulse-icon {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ---------------------------------------------------------- forms */

.field-block { margin-bottom: var(--space-5); }

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

.native-input {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease;
}
/* Отступ после инпута перед следующей меткой/кнопкой — без этого поля
   и кнопка "Войти" слипались друг с другом. Поле почти всегда обёрнуто в
   .input-with-done (см. ниже), поэтому те же отступы нужны и для него —
   иначе не соблюдался бы визуально тот же межблочный ритм. */
.native-input + label,
.input-with-done + label { margin-top: 14px; }
.native-input + .btn-primary,
.native-input + .btn-secondary,
.input-with-done + .btn-primary,
.input-with-done + .btn-secondary { margin-top: 16px; }

.field-hint {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 6px;
}
.field-hint + label { margin-top: 14px; }
.field-hint + .btn-primary,
.field-hint + .btn-secondary { margin-top: 16px; }
.native-input:focus { border-color: var(--accent); }
.native-input::-webkit-calendar-picker-indicator { filter: invert(1) opacity(0.6); }

/* Кнопка-галочка внутри текстовых полей: на iPhone (особенно в Telegram
   WebView) программная клавиатура часто не закрывается сама, пока не
   тапнешь в другое место на экране. Кнопка просто снимает фокус с поля
   (input.blur() в app.js), что закрывает клавиатуру одним тапом. */
.input-with-done { position: relative; display: block; }
.input-with-done .native-input { padding-right: 46px; }
.input-done-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.input-done-btn svg { width: 16px; height: 16px; }
.input-done-btn:active { transform: translateY(-50%) scale(0.9); }

.hidden { display: none !important; }

/* ---------------------------------------------------------- buttons */

.btn-primary, .btn-secondary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.2s ease;
}
.btn-primary:active, .btn-secondary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary { background: var(--accent-gradient); color: var(--accent-contrast); box-shadow: 0 8px 20px rgba(184, 134, 11, 0.3); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

/* Кнопка с иконкой слева от текста (напр. "Поехали на Яндекс Go") —
   тот же .btn-primary/.btn-secondary, просто раскладка в строку. */
.btn-icon-row { display: flex; align-items: center; justify-content: center; gap: 9px; margin-bottom: var(--space-3); }
.btn-icon-row svg { width: 19px; height: 19px; flex: none; }

/* Вкладка BLVCK — 2 кнопки начисления друг под другом. */
.owner-credit-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: var(--space-4); }

/* Вкладка BLVCK — сетка ПК с кнопками включения/выключения. */
.power-all-buttons { display: flex; gap: 10px; margin-bottom: var(--space-3); }
.power-all-buttons .btn-primary,
.power-all-buttons .btn-secondary { width: auto; flex: 1; }
.btn-danger-outline { color: var(--busy); border-color: rgba(255, 59, 71, 0.4); background: rgba(255, 59, 71, 0.1); }

/* Вкладка BLVCK — отчёты: топ-списки (пополнения, время игры на ПК). */
.report-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
}
.report-item-rank { color: var(--text-faint); font-weight: 800; width: 16px; flex: none; }
.report-item-name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-item-value { color: var(--accent); font-weight: 800; white-space: nowrap; flex: none; }

/* Вкладка BLVCK — логи (сырые события биллинга). */
.log-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.log-item-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.log-item-event { font-weight: 800; font-size: 13.5px; }
.log-item-time { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; flex: none; }
.log-item-meta { font-size: 12px; color: var(--text-dim); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-item-amounts { display: flex; gap: 10px; margin-top: 5px; }
.log-amount { font-size: 12.5px; font-weight: 800; }
.log-amount-in { color: var(--free); }
.log-amount-out { color: var(--busy); }
.log-amount-bonus { color: var(--warn); }

.power-pc-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.power-pc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.power-pc-info { display: flex; flex-direction: column; gap: 2px; }
.power-pc-name { font-weight: 800; font-size: 14px; }
.power-pc-status { font-size: 11px; font-weight: 700; color: var(--text-faint); }
.power-pc-status.status-free { color: var(--free); }
.power-pc-status.status-busy { color: var(--busy); }
.power-pc-status.status-reserved { color: var(--warn); }

.power-pc-actions { display: flex; gap: 8px; flex: none; }
.power-btn {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.power-btn svg { width: 17px; height: 17px; }
.power-btn:active { transform: scale(0.92); }
.power-btn:disabled { opacity: 0.5; pointer-events: none; }
.power-btn-on { color: var(--free); border-color: rgba(53, 208, 127, 0.4); background: rgba(53, 208, 127, 0.1); }
.power-btn-off { color: var(--busy); border-color: rgba(255, 59, 71, 0.4); background: rgba(255, 59, 71, 0.1); }
.power-btn-end { color: var(--warn); border-color: rgba(255, 183, 77, 0.4); background: rgba(255, 183, 77, 0.1); }

.btn-text-danger {
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--busy);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0.85;
}
.btn-text-danger:active { opacity: 1; transform: scale(0.98); }

/* ---------------------------------------------------------- profile: identity */

.identity-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  margin-bottom: var(--space-4);
}
.identity-avatar {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-contrast);
  background: var(--accent-gradient);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(184, 134, 11, 0.3);
}
.identity-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.identity-info { min-width: 0; }
.identity-name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.identity-handle { font-size: 12.5px; color: var(--text-faint); }

/* Уровни клиента (Bronze/Silver/Gold/Diamond) — по накопленным member_points,
   калибровано по реальному распределению баллов среди клиентов клуба:
   Bronze ~50% клиентов, Silver ~25%, Gold ~17%, Diamond ~8% (эксклюзив). */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 3px 10px;
  margin-top: 6px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.tier-badge.tier-bronze { background: rgba(205, 127, 50, 0.16); color: #cd7f32; border: 1px solid rgba(205, 127, 50, 0.4); }
.tier-badge.tier-silver { background: rgba(201, 206, 214, 0.16); color: var(--silver); border: 1px solid rgba(201, 206, 214, 0.4); }
.tier-badge.tier-gold {
  background: var(--accent-soft);
  color: var(--accent-bright);
  border: 1px solid rgba(217, 169, 78, 0.5);
  text-shadow: 0 0 8px rgba(217, 169, 78, 0.4);
}
.tier-badge.tier-diamond {
  background: rgba(185, 242, 255, 0.14);
  color: #b9f2ff;
  border: 1px solid rgba(185, 242, 255, 0.5);
  text-shadow: 0 0 8px rgba(185, 242, 255, 0.5);
}

/* Подпись "Топ N% клиентов клуба" под бейджем уровня — считается от того
   же реального распределения баллов, что и пороги самих уровней. */
.tier-note { font-size: 10.5px; font-weight: 700; margin-top: 4px; opacity: 0.85; }
.tier-note.tier-bronze { color: #cd7f32; }
.tier-note.tier-silver { color: var(--silver); }
.tier-note.tier-gold { color: var(--accent-bright); }
.tier-note.tier-diamond { color: #b9f2ff; }

/* ---------------------------------------------------------- profile: активная сессия */

.active-session-card {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(53, 208, 127, 0.16), rgba(53, 208, 127, 0.03));
  border: 1px solid rgba(53, 208, 127, 0.4);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3), 0 0 16px rgba(53, 208, 127, 0.12);
  margin-bottom: var(--space-3);
}
.active-session-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.active-session-icon {
  color: var(--free);
  width: 26px;
  height: 26px;
  flex: none;
  filter: drop-shadow(0 0 4px var(--free-glow));
}
.active-session-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--free);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.active-session-detail { font-size: 13.5px; color: var(--text-dim); margin-top: 2px; }

/* ---------------------------------------------------------- profile: баланс/бонусы */

.stat-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: var(--space-3);
}
/* Карточка на всю ширину — напр. "Всего пополнено", ей одной не место
   в паре с Баланс/Бонусы, но и отдельная 3-я колонка была бы слишком узкой. */
.stat-card-lg-wide { grid-column: 1 / -1; }
.stat-card-lg {
  padding: 16px 14px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #1b1b1b, #060606 65%);
  border: 1px solid rgba(217, 169, 78, 0.35);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-card-lg-icon { color: var(--accent); }
.stat-card-lg-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-faint);
}
.stat-card-lg-amount {
  font-size: 21px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent-bright), #ffffff 45%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-card-lg-amount-bonus {
  background: linear-gradient(90deg, var(--silver), #ffffff 45%, #8f97a3);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ---------------------------------------------------------- цены */

.price-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  padding: 18px 16px 16px;
  margin-bottom: var(--space-4);
  overflow: hidden;
}
.price-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--text-faint);
}
.price-card.tier-main::before { background: var(--tier-main); }
.price-card.tier-pro::before { background: var(--tier-pro); }
.price-card.tier-ultra::before { background: var(--tier-ultra); }
.price-card.price-bonus-card::before { background: var(--accent-gradient); }

.price-card-head {
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}
.price-card.tier-main .price-card-head { color: var(--tier-main); text-shadow: 0 0 10px rgba(201, 206, 214, 0.3); }
.price-card.tier-pro .price-card-head { color: var(--tier-pro); text-shadow: 0 0 10px rgba(255, 59, 71, 0.35); }
.price-card.tier-ultra .price-card-head { color: var(--tier-ultra); text-shadow: 0 0 10px rgba(217, 169, 78, 0.35); }
.price-bonus-card .price-card-head { color: var(--accent); text-shadow: 0 0 10px rgba(217, 169, 78, 0.35); }

.price-rows { display: flex; flex-direction: column; }
.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-dim);
}
.price-row:last-child { border-bottom: none; }
.price-value { font-weight: 800; color: var(--text); white-space: nowrap; }
.price-bonus-value { color: var(--free); }

.price-package {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.price-package-title { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.price-package-desc { font-size: 11.5px; color: var(--text-faint); margin-bottom: 4px; }
.price-package-value { font-size: 16px; font-weight: 800; color: var(--text); }

/* ---------------------------------------------------------- auth (вход в аккаунт клуба) */

.auth-card {
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.auth-title { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.auth-desc { font-size: 12.5px; color: var(--text-faint); margin-bottom: 14px; line-height: 1.4; }
.auth-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}
.auth-hint b { color: var(--accent); font-weight: 700; }

/* ---------------------------------------------------------- empty state */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--text-faint);
}
.empty-state svg { width: 40px; height: 40px; opacity: 0.5; }
.empty-state .title { font-size: 14px; font-weight: 700; color: var(--text-dim); }
.empty-state .desc { font-size: 12.5px; max-width: 220px; line-height: 1.5; }

/* ---------------------------------------------------------- skeletons */

.skeleton {
  position: relative;
  color: transparent !important;
  overflow: hidden;
  background: var(--surface-2);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}
.skeleton-card {
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* ---------------------------------------------------------- toasts */

#toast-root {
  position: fixed;
  top: calc(var(--safe-top) + 10px);
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  max-width: 88%;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  animation: toast-in 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.success { border-color: rgba(53, 208, 127, 0.4); }
.toast.error { border-color: rgba(255, 93, 108, 0.45); }
.toast.leaving { animation: toast-out 0.2s ease forwards; }

.toast-icon { width: 16px; height: 16px; flex: none; }
.toast.success .toast-icon { color: var(--free); }
.toast.error .toast-icon { color: var(--busy); }

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

/* ---------------------------------------------------------- модалка (периферия) */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  animation: modal-fade-in 0.2s ease;
}
.modal-overlay.hidden { display: none; }

.modal-sheet {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-top: 2px solid var(--accent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 8px 20px calc(20px + var(--safe-bottom));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  animation: modal-slide-up 0.25s ease;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-sheet.tier-main { border-top-color: var(--tier-main); }
.modal-sheet.tier-pro { border-top-color: var(--tier-pro); }
.modal-sheet.tier-ultra { border-top-color: var(--tier-ultra); }

.modal-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
  margin: 8px auto 14px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.modal-close {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.modal-close svg { width: 14px; height: 14px; }
.modal-close:active { transform: scale(0.92); }

.modal-body { font-size: 14px; color: var(--text-dim); line-height: 1.6; }

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.spec-row:last-child { border-bottom: none; }
.spec-label { color: var(--text-faint); font-size: 12.5px; }
.spec-value { color: var(--text); font-weight: 700; text-align: right; }

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-slide-up {
  from { transform: translateY(30px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------------------------------------------------------- misc */

::selection { background: var(--accent-soft); }

@media (min-width: 480px) {
  .pc-grid { grid-template-columns: repeat(3, 1fr); }
}
