/* OzoHelper Mini App — современная стилистика (dark + light) */
@import url('https://fonts.googleapis.com/css2?family=Onest:wght@100..900&display=swap');

:root {
  --tg-theme-bg-color: #1c1c1e;
  --tg-theme-text-color: #ffffff;
  --tg-theme-hint-color: #8e8e93;
  --tg-theme-link-color: #0a84ff;
  --tg-theme-button-color: #0a84ff;
  --tg-theme-button-text-color: #ffffff;
  --tg-theme-secondary-bg-color: #2c2c2e;
  --text: #ffffff;
  --text-secondary: #8e8e93;
  --card-bg: #2c2c2e;
  --card-bg-hover: #363638;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --success: #30d158;
  --warning: #ff9f0a;
  --danger: #ff3b30;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.03);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-card: var(--shadow-md);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
}

/* Светлая тема Telegram */
[data-theme="light"] {
  --tg-theme-bg-color: #ffffff;
  --tg-theme-text-color: #1a1a1a;
  --tg-theme-hint-color: #6d6d72;
  --tg-theme-link-color: #2481cc;
  --tg-theme-button-color: #2481cc;
  --tg-theme-button-text-color: #ffffff;
  --tg-theme-secondary-bg-color: #f2f2f7;
  --text: #1a1a1a;
  --text-secondary: #6d6d72;
  --card-bg: #ffffff;
  --card-bg-hover: #f2f2f7;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --shadow-card: var(--shadow-md);
}
[data-theme="light"] .balance-card {
  background: linear-gradient(152deg, #ffffff 0%, #f8f9fc 50%, #f0f2f8 100%);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .balance-card::before {
  background: radial-gradient(ellipse 100% 80% at 100% 0%, rgba(36, 129, 204, 0.08) 0%, transparent 70%);
}
[data-theme="light"] .balance-icon {
  background: linear-gradient(135deg, rgba(36, 129, 204, 0.15) 0%, rgba(48, 209, 88, 0.12) 100%);
  color: #1a6bb5;
}
[data-theme="light"] .balance-value {
  color: #0d0d0d;
}
[data-theme="light"] .balance-card .balance-history-btn {
  color: #2481cc;
  background: rgba(36, 129, 204, 0.08);
}
[data-theme="light"] .balance-card .balance-history-btn:hover {
  background: rgba(36, 129, 204, 0.14);
}
[data-theme="light"] .nav-btn {
  background: linear-gradient(152deg, #ffffff 0%, #f8f9fc 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
  color: #1a1a1a;
}
[data-theme="light"] .nav-btn:hover {
  background: linear-gradient(152deg, #f8f9fc 0%, #f0f2f8 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.06);
  color: #1a1a1a;
}
[data-theme="light"] .nav-btn-primary {
  background: linear-gradient(180deg, #2481cc 0%, #1a6bb5 100%);
  box-shadow: 0 4px 16px rgba(36, 129, 204, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.2);
  color: #ffffff;
}
[data-theme="light"] .nav-btn-primary:hover {
  background: linear-gradient(180deg, #2d8fdd 0%, #2481cc 100%);
  box-shadow: 0 8px 24px rgba(36, 129, 204, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
[data-theme="light"] .links .nav-btn,
[data-theme="light"] .links .link-btn {
  background: linear-gradient(152deg, #ffffff 0%, #f8f9fc 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
  color: #1a1a1a;
}
[data-theme="light"] .links .nav-btn:hover,
[data-theme="light"] .links .link-btn:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.06);
  color: #1a1a1a;
}
[data-theme="light"] .warehouse-list {
  background: linear-gradient(152deg, #ffffff 0%, #f8f9fc 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .warehouse-list li.selected {
  background: rgba(36, 129, 204, 0.12);
  color: #2481cc;
}
[data-theme="light"] .caught-shifts-total {
  background: linear-gradient(152deg, #ffffff 0%, #f8f9fc 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .caught-shift-item {
  background: linear-gradient(152deg, #ffffff 0%, #f8f9fc 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .empty-hint {
  background: linear-gradient(152deg, #ffffff 0%, #f8f9fc 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .catch-card {
  background: linear-gradient(152deg, #ffffff 0%, #f8f9fc 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .balance-history-item {
  background: linear-gradient(152deg, #ffffff 0%, #f8f9fc 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .topup-buy-card:hover {
  background: #f4f4f5;
  border-color: rgba(0, 0, 0, 0.2);
}
[data-theme="light"] .topup-hero-icon {
  background: linear-gradient(135deg, rgba(36, 129, 204, 0.12) 0%, rgba(48, 209, 88, 0.1) 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .loader {
  background: rgba(255, 255, 255, 0.85);
}
[data-theme="light"] .recovery-overlay {
  background: rgba(255, 255, 255, 0.9);
}
[data-theme="light"] .recovery-overlay-card {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}
[data-theme="light"] .search-input:focus,
[data-theme="light"] .auth-phone-input:focus,
[data-theme="light"] .topup-input:focus {
  box-shadow: 0 0 0 3px rgba(36, 129, 204, 0.2);
}
[data-theme="light"] .loader-spinner {
  border-color: rgba(0, 0, 0, 0.12);
  border-top-color: #2481cc;
}
[data-theme="light"] .admin-nav-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .admin-action-btn-primary {
  background: linear-gradient(180deg, #2481cc 0%, #1a6bb5 100%);
  color: #ffffff;
}
[data-theme="light"] .btn-copy,
[data-theme="light"] .topup-activate-btn {
  color: #ffffff;
}
[data-theme="light"] .catch-option-btn {
  color: #1a1a1a;
}
[data-theme="light"] .catch-daynight-btn {
  color: #3a3a3c;
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .catch-daynight-btn.active {
  color: #ffffff;
  background: #2481cc;
  border-color: #2481cc;
}
[data-theme="light"] .catch-duration-chip {
  color: #1a1a1a;
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .catch-duration-chip.selected {
  color: #ffffff;
  background: #2481cc;
  border-color: #2481cc;
}
[data-theme="light"] .busy-actions .nav-btn {
  color: #1a1a1a;
}
[data-theme="light"] .busy-actions .nav-btn-primary {
  color: #ffffff;
}
[data-theme="light"] .busy-actions .nav-btn-danger {
  color: #c62828;
}
[data-theme="light"] .admin-nav-card {
  color: #1a1a1a;
}
[data-theme="light"] .admin-nav-desc {
  color: #6d6d72;
}
[data-theme="light"] .admin-action-btn {
  color: #1a1a1a;
}

* {
  box-sizing: border-box;
}

html, body {
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex="0"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--tg-theme-bg-color), 0 0 0 4px rgba(10, 132, 255, 0.4);
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--tg-theme-bg-color);
  color: var(--tg-theme-text-color);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom, 0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

#root {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 20px;
}

.screen {
  animation: fadeIn 0.25s var(--ease-out);
}
.screen[hidden] {
  display: none !important;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.screen-telegram-only {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 24px;
}
.telegram-only-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  text-align: center;
  border: 1px solid var(--border);
  max-width: 360px;
  box-shadow: var(--shadow-card);
}
.telegram-only-icon {
  font-size: 3.5rem;
  margin: 0 0 20px 0;
}
.telegram-only-card h2 {
  margin: 0 0 14px 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.telegram-only-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--tg-theme-hint-color);
  line-height: 1.5;
}

.header {
  text-align: center;
  margin-bottom: 24px;
}
.header h1 {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.subtitle {
  font-size: 0.9rem;
  color: var(--tg-theme-hint-color);
  margin: 6px 0 0 0;
}
.header-back {
  text-align: left;
  position: relative;
  padding-top: 4px;
  margin-bottom: 20px;
}
.header-back h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.03em;
  color: var(--text);
}

.back-btn {
  background: none;
  border: none;
  color: var(--tg-theme-link-color);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 10px 0;
  margin-bottom: 4px;
  cursor: pointer;
  transition: opacity var(--transition), color var(--transition);
}
.back-btn:hover { opacity: 0.9; }
.back-btn:active { opacity: 0.8; }

/* ——— Верхняя навигация на главной ——— */
.main-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.main-top-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.main-top-auth {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--tg-theme-hint-color);
  flex-shrink: 0;
}
.main-top-warehouse {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tg-theme-link-color);
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.main-top-warehouse:hover {
  text-decoration: underline;
}
.main-top-nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.main-top-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--tg-theme-text-color);
  font-size: 1.25rem;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.main-top-icon-btn:hover {
  background: var(--card-bg-hover);
  transform: scale(1.02);
}
.main-top-icon-btn:active {
  transform: scale(0.98);
}

.balance-card {
  position: relative;
  margin-bottom: 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-card);
  background: linear-gradient(160deg, #2c2c2e 0%, #262628 45%, #1f1f22 100%);
}
.balance-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(ellipse 100% 90% at 100% -10%, rgba(10, 132, 255, 0.2) 0%, transparent 50%);
}
.balance-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.balance-card-inner {
  position: relative;
  padding: 24px 22px 18px;
}
.balance-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.balance-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.28) 0%, rgba(48, 209, 88, 0.18) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.balance-icon::before {
  content: '₽';
  font-weight: 700;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.02em;
}
.balance-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tg-theme-hint-color);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.balance-value-wrap {
  margin: 0 0 16px 0;
  line-height: 1.1;
}
.balance-value {
  font-size: 2.35rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--tg-theme-text-color);
}
.balance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.balance-actions .balance-history-btn {
  flex: 1;
  min-width: 0;
  box-shadow: none;
}
.balance-actions .balance-history-btn:hover,
.balance-actions .balance-history-btn:active {
  box-shadow: none;
}
.balance-card .balance-history-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--tg-theme-link-color, #0a84ff);
  background: rgba(10, 132, 255, 0.12);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.balance-card .balance-history-btn:hover {
  background: rgba(10, 132, 255, 0.22);
  opacity: 1;
}
.balance-card .balance-history-btn:active {
  opacity: 0.9;
}
.balance-card .balance-history-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.35);
}

.status-card {
  position: relative;
  margin-bottom: 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.02);
  background: linear-gradient(152deg, #2c2c2e 0%, #252528 50%, #1f1f22 100%);
}
.status-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(ellipse 80% 50% at 0% 0%, rgba(48, 209, 88, 0.08) 0%, transparent 50%);
}
.status-card-inner {
  position: relative;
  padding: 18px 20px;
}
.status-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}
.status-auth-row {
  margin-bottom: 12px;
}
.status-card-row.status-warehouse-row {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--tg-theme-hint-color);
  font-size: 0.9rem;
}
.status-badge {
  font-weight: 600;
  font-size: 1rem;
}
.status-card.authorized .status-badge { color: var(--success); }
.status-card.unauthorized .status-badge { color: var(--warning); }
.status-warehouse-label {
  flex-shrink: 0;
  font-weight: 500;
  min-width: 52px;
}
.status-warehouse-value {
  color: var(--tg-theme-text-color);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-card .unlink-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.status-card .btn-unlink {
  width: 100%;
  justify-content: center;
  border-radius: var(--radius-sm);
}
[data-theme="light"] .status-card {
  background: linear-gradient(152deg, #ffffff 0%, #f8f9fc 50%, #f0f2f8 100%);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .status-card::before {
  background: radial-gradient(ellipse 80% 50% at 0% 0%, rgba(48, 209, 88, 0.06) 0%, transparent 50%);
}
[data-theme="light"] .status-card-row.status-warehouse-row {
  border-top-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .status-card .unlink-row {
  border-top-color: rgba(0, 0, 0, 0.06);
}

/* ——— Последняя пойманная смена (минимальный блок) ——— */
.last-caught-block {
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card-bg);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.last-caught-block:focus-within {
  border-color: var(--border-strong);
}
.last-caught-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.last-caught-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.last-caught-info {
  font-size: 0.95rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.last-caught-all-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--tg-theme-link-color);
  background: rgba(10, 132, 255, 0.14);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.last-caught-all-btn:hover {
  background: rgba(10, 132, 255, 0.24);
}
.last-caught-all-btn:active {
  transform: scale(0.98);
}
[data-theme="light"] .last-caught-block {
  background: var(--card-bg);
  border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .last-caught-all-btn {
  color: #2481cc;
  background: rgba(36, 129, 204, 0.1);
}
[data-theme="light"] .last-caught-all-btn:hover {
  background: rgba(36, 129, 204, 0.18);
}

/* ——— Блок ловли/очереди: карточка с анимацией фона ——— */
.busy-block {
  position: relative;
  margin-bottom: 20px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.busy-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.busy-bg-gradient {
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(10, 132, 255, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 80% 70%, rgba(48, 209, 88, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(255, 159, 10, 0.12) 0%, transparent 45%);
  animation: busyGradientShift 12s ease-in-out infinite;
}

.busy-bg-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.busy-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  animation: busyOrbFloat 8s ease-in-out infinite;
}

.busy-orb-1 {
  width: 120px;
  height: 120px;
  background: rgba(10, 132, 255, 0.5);
  top: -20%;
  left: -10%;
  animation-delay: 0s;
}

.busy-orb-2 {
  width: 100px;
  height: 100px;
  background: rgba(48, 209, 88, 0.4);
  bottom: -15%;
  right: -5%;
  animation-delay: -2.5s;
}

.busy-orb-3 {
  width: 80px;
  height: 80px;
  background: rgba(255, 159, 10, 0.35);
  top: 40%;
  left: 50%;
  animation-delay: -5s;
}

@keyframes busyGradientShift {
  0%, 100% { transform: scale(1) rotate(0deg); }
  33% { transform: scale(1.08) rotate(2deg); }
  66% { transform: scale(0.98) rotate(-1deg); }
}

@keyframes busyOrbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(8px, -12px) scale(1.05); }
  50% { transform: translate(-5px, 6px) scale(0.95); }
  75% { transform: translate(10px, 8px) scale(1.02); }
}

.busy-card {
  position: relative;
  background: rgba(44, 44, 46, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 20px 20px 20px 20px;
  margin: 1px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.busy-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.busy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.12);
  color: var(--tg-theme-text-color);
}

.busy-block[data-mode="catching"] .busy-badge {
  background: rgba(48, 209, 88, 0.25);
  color: #30d158;
}

.busy-block[data-mode="queue"] .busy-badge {
  background: rgba(10, 132, 255, 0.25);
  color: #0a84ff;
}

/* Круг с номером очереди не показывать при ловле — только в режиме очереди */
.busy-block[data-mode="catching"] .busy-position {
  display: none !important;
}

.busy-position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  background: rgba(10, 132, 255, 0.3);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.4);
}

.busy-message {
  margin: 0 0 14px 0;
  font-size: 0.95rem;
  color: var(--tg-theme-text-color);
  white-space: pre-wrap;
  line-height: 1.45;
}

.busy-metrics {
  margin: 0 0 14px 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
}

.busy-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.busy-metric-label {
  color: var(--tg-theme-hint-color);
  font-weight: 500;
  font-size: 0.9rem;
}

.busy-metric-value {
  color: var(--tg-theme-text-color);
  font-weight: 700;
  font-size: 1rem;
}

.busy-progress {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.busy-progress-bar {
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(10, 132, 255, 0.35), rgba(48, 209, 88, 0.35), rgba(255, 159, 10, 0.25));
  transform: translateX(-60%);
  animation: busyProgressIndeterminate 1.6s var(--ease-out) infinite;
}

.busy-block[data-mode="queue"] .busy-progress-bar {
  width: 28%;
  background: linear-gradient(90deg, rgba(10, 132, 255, 0.35), rgba(10, 132, 255, 0.18));
}

@keyframes busyProgressIndeterminate {
  0% { transform: translateX(-80%); opacity: 0.7; }
  50% { opacity: 1; }
  100% { transform: translateX(220%); opacity: 0.8; }
}

.busy-catch-details {
  margin: 0 0 14px 0;
  padding: 14px 0 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 14px 14px 4px 14px;
}

.busy-detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px 0;
  font-size: 0.92rem;
  line-height: 1.4;
}

.busy-detail-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

.busy-detail-row .busy-detail-label {
  color: var(--tg-theme-hint-color);
  font-weight: 500;
  flex-shrink: 0;
}

.busy-detail-row .busy-detail-value {
  color: var(--tg-theme-text-color);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.busy-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.busy-actions .nav-btn {
  flex: 1;
  min-width: 120px;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-md);
}

/* Светлая тема: блок ловли/очереди */
[data-theme="light"] .busy-card {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .busy-badge {
  background: rgba(0, 0, 0, 0.06);
  color: var(--tg-theme-text-color);
}

[data-theme="light"] .busy-block[data-mode="catching"] .busy-badge {
  background: rgba(48, 209, 88, 0.2);
  color: #248f48;
}

[data-theme="light"] .busy-block[data-mode="queue"] .busy-badge {
  background: rgba(36, 129, 204, 0.2);
  color: #1a6bb5;
}

[data-theme="light"] .busy-position {
  background: rgba(36, 129, 204, 0.25);
  color: #1a6bb5;
  box-shadow: 0 0 0 2px rgba(36, 129, 204, 0.35);
}

[data-theme="light"] .busy-catch-details {
  border-top-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .busy-metrics {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .busy-actions .nav-btn {
  color: #1a1a1a;
}
[data-theme="light"] .busy-actions .nav-btn-danger {
  color: #c62828;
}
.nav-btn-danger {
  background: rgba(255, 59, 48, 0.15);
  border-color: var(--danger);
  color: var(--danger);
}
.nav-btn-danger:hover {
  background: rgba(255, 59, 48, 0.25);
}

.nav-grid {
  display: grid;
  gap: 16px;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  min-height: 58px;
  box-sizing: border-box;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: var(--shadow-sm);
}
.nav-btn:hover {
  background: var(--card-bg-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.nav-btn:active {
  opacity: 0.97;
  transform: translateY(0) scale(0.99);
  box-shadow: var(--shadow-sm);
}
.nav-btn.nav-btn-danger {
  background: rgba(255, 59, 48, 0.2);
  border-color: var(--danger);
  color: var(--danger);
}
.nav-btn.nav-btn-danger:hover {
  background: rgba(255, 59, 48, 0.35);
  border-color: var(--danger);
  color: var(--danger);
}
.nav-btn-primary {
  background: linear-gradient(180deg, var(--tg-theme-button-color) 0%, #0860d6 100%);
  color: var(--tg-theme-button-text-color, #ffffff);
  border: none;
  font-weight: 600;
  margin-top: 2px;
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.nav-btn-primary:hover {
  background: linear-gradient(180deg, #0d8aff 0%, var(--tg-theme-button-color) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(10, 132, 255, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.nav-btn-primary:active {
  transform: translateY(0) scale(0.99);
}
.nav-btn-primary.disabled {
  opacity: 0.6;
  pointer-events: none;
  transform: none;
}
.nav-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.links {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}
.links .nav-btn,
.links .link-btn {
  min-width: 140px;
  justify-content: center;
  font-weight: 500;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  min-height: 50px;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}
.links .nav-btn:hover,
.links .link-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* FAQ */
.faq-page {
  padding: 16px;
}
.faq-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}
.faq-q-text {
  text-align: left;
}
.faq-q-icon {
  opacity: 0.8;
}
.faq-answer {
  border-top: 1px solid var(--border);
  padding: 12px 14px 14px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}
.faq-image {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.faq-body {
  white-space: normal;
}
.news-block {
  margin: 6px 0 14px 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.news-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.news-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.news-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--tg-theme-link-color);
  background: rgba(10, 132, 255, 0.14);
  transition: background var(--transition), transform var(--transition);
}
.news-link-btn:hover {
  background: rgba(10, 132, 255, 0.24);
  transform: translateY(-1px);
}
.news-hide-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.news-hide-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
[data-theme="light"] .news-link-btn {
  color: #2481cc;
  background: rgba(36, 129, 204, 0.1);
}
[data-theme="light"] .news-link-btn:hover {
  background: rgba(36, 129, 204, 0.18);
}
[data-theme="light"] .news-hide-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1a1a1a;
}
.link {
  color: var(--tg-theme-link-color);
  font-size: 0.9rem;
  text-decoration: none;
}
.caught-shifts-total {
  margin: 0 auto 20px auto;
  font-size: 0.95rem;
  color: var(--tg-theme-hint-color);
  text-align: center;
  padding: 14px 20px;
  background: linear-gradient(152deg, var(--card-bg) 0%, rgba(38, 38, 40, 0.98) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: inline-block;
  max-width: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.02);
}

/* Warehouses */
.search-wrap {
  margin-bottom: 16px;
}
.search-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  color: var(--tg-theme-text-color);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
.search-input::placeholder {
  color: var(--tg-theme-hint-color);
}
.search-input:focus {
  outline: none;
  border-color: var(--tg-theme-button-color);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}
.search-input:focus-visible {
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25);
}

.warehouse-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(152deg, var(--card-bg) 0%, rgba(38, 38, 40, 0.98) 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.warehouse-list li {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s ease;
}
.warehouse-list li:last-child {
  border-bottom: none;
}
.warehouse-list li:active {
  background: var(--card-bg-hover);
}
.warehouse-list li.selected {
  background: rgba(10, 132, 255, 0.15);
  color: var(--tg-theme-link-color);
  font-weight: 500;
}

/* Caught shifts */
.caught-shifts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.caught-shift-item {
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(152deg, var(--card-bg) 0%, rgba(38, 38, 40, 0.98) 100%);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.caught-shift-item .cs-date {
  font-weight: 600;
  min-width: 4.5em;
  font-size: 0.95rem;
}
.caught-shift-item .cs-warehouse {
  color: var(--tg-theme-text-color);
  font-size: 0.95rem;
}
.caught-shift-item .cs-spec {
  font-size: 0.88rem;
  color: var(--tg-theme-hint-color);
}
.empty-hint {
  text-align: center;
  color: var(--tg-theme-hint-color);
  font-size: 0.95rem;
  margin: 32px 0;
  padding: 24px 20px;
  background: linear-gradient(152deg, var(--card-bg) 0%, rgba(38, 38, 40, 0.98) 100%);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.balance-history-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  width: 100%;
  justify-content: center;
}

.balance-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.balance-history-item {
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(152deg, var(--card-bg) 0%, rgba(38, 38, 40, 0.98) 100%);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  align-items: start;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.balance-history-item .bh-type {
  font-weight: 600;
  font-size: 0.95rem;
}
.balance-history-item .bh-amount {
  font-weight: 600;
  font-size: 1rem;
  text-align: right;
}
.balance-history-item.balance-history-type-topup .bh-type,
.balance-history-item.balance-history-type-topup .bh-amount { color: var(--success, #30d158); }
.balance-history-item.balance-history-type-spend .bh-type,
.balance-history-item.balance-history-type-spend .bh-amount { color: var(--danger, #ff3b30); }
.balance-history-item.balance-history-type-refund .bh-type,
.balance-history-item.balance-history-type-refund .bh-amount { color: var(--tg-theme-link-color); }
.balance-history-item .bh-reason {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  color: var(--tg-theme-hint-color);
}
.balance-history-item .bh-date {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--tg-theme-hint-color);
}

.unlink-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.unlink-row .nav-btn {
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
}
.nav-btn-small {
  padding: 12px 16px;
  min-height: 44px;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
}

/* Profile check page */
.profile-check-page {
  padding: 0 16px 24px;
}
.profile-check-card-main {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.profile-check-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.profile-check-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.profile-check-row:first-child {
  padding-top: 0;
}
.profile-check-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--tg-theme-hint-color);
  letter-spacing: 0.02em;
}
.profile-check-field-value {
  font-size: 16px;
  color: var(--tg-theme-text-color);
  word-break: break-word;
}
.profile-check-hint {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--tg-theme-hint-color);
  text-align: center;
}
.profile-check-error {
  padding: 32px 24px;
  text-align: center;
}
.profile-check-error-icon {
  font-size: 48px;
  margin: 0 0 16px;
  opacity: 0.8;
}
.profile-check-error-text {
  font-size: 15px;
  color: var(--tg-theme-hint-color);
  line-height: 1.5;
  margin: 0;
}

/* Referral */
.profile-check-card {
  margin-top: 16px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.profile-check-label {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--tg-theme-hint-color);
}
.profile-check-data {
  margin: 0;
  padding: 12px;
  background: var(--tg-theme-secondary-bg-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  color: var(--tg-theme-text-color);
}

/* ——— Рулетка «Удача дня» ——— */
.roulette-page {
  padding: 0 0 24px;
}
.roulette-hero {
  position: relative;
  text-align: center;
  padding: 24px 0 28px;
  margin-bottom: 22px;
  background: linear-gradient(165deg, rgba(255, 159, 10, 0.1) 0%, rgba(255, 159, 10, 0.03) 50%, transparent 100%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 159, 10, 0.14);
  box-shadow: var(--shadow-sm);
}
.roulette-hero-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.roulette-hero-close:hover {
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
}
.roulette-page.roulette-hero-hidden .roulette-hero,
.roulette-page.roulette-hero-hidden .roulette-weekdays {
  display: none;
}
.roulette-hero-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(255, 159, 10, 0.2);
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(255, 159, 10, 0.25);
}
.roulette-hero-title {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.roulette-hero-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
.roulette-weekdays {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  margin-bottom: 20px;
  padding: 8px 4px;
  gap: 4px;
}
.roulette-weekday {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 2px;
  border-radius: var(--radius-sm, 8px);
  transition: background 0.2s, color 0.2s;
}
.roulette-weekday-current {
  background: var(--primary, #007aff);
  color: var(--bg-primary, #fff);
}
.roulette-stats {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.roulette-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.roulette-weekly-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.roulette-weekly-amount {
  font-size: 0.95rem;
  color: var(--text);
}
.roulette-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--border, rgba(128,128,128,.2));
  overflow: hidden;
  margin-bottom: 8px;
}
.roulette-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34c759, #30d158);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}
.roulette-progress-fill.is-complete {
  background: linear-gradient(90deg, #30d158, #34c759, #30d158);
}
.roulette-progress-fill.is-low {
  background: linear-gradient(90deg, #ff3b30, #ff453a);
}
.roulette-progress-fill.is-mid {
  background: linear-gradient(90deg, #ff9f0a, #ffcc02);
}
.roulette-progress-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.roulette-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ——— 3D-карточки (замена колеса) ——— */
.roulette-cards-area {
  display: flex;
  flex-direction: row;
  gap: 10px;
  max-width: 340px;
  margin: 0 auto 10px;
}

.roulette-card {
  flex: 1;
  perspective: 700px;
  aspect-ratio: 3 / 4.5;
}
.roulette-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 16px;
}
.roulette-card.is-flipped .roulette-card-inner {
  transform: rotateY(180deg);
}
.roulette-card-back,
.roulette-card-front {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
}
.roulette-card-back {
  background: linear-gradient(145deg, #5e5ce6 0%, #3634a3 100%);
  box-shadow: 0 6px 20px rgba(94,92,230,.35), inset 0 1px 0 rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.12);
}
.roulette-card-back::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 18px 18px;
}
.roulette-card-back-icon {
  font-size: 2.2rem;
  position: relative;
  line-height: 1;
}
.roulette-card-back-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.75);
  position: relative;
}
.roulette-card-front {
  transform: rotateY(180deg);
  background: var(--card-bg);
  border: 2px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.roulette-card.is-winner .roulette-card-front {
  border-color: #f9c74f;
  background: linear-gradient(145deg, rgba(249,199,79,.18) 0%, var(--card-bg) 60%);
  box-shadow: 0 0 0 3px rgba(249,199,79,.25), 0 6px 24px rgba(249,199,79,.25);
}
.roulette-card.is-zero .roulette-card-front {
  opacity: 0.55;
}
.roulette-card-front-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.roulette-card-front-amount {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.roulette-card.is-winner .roulette-card-front-amount {
  color: #f9c74f;
  text-shadow: 0 0 16px rgba(249,199,79,.55);
}

/* Кликабельные карточки */
.roulette-card.is-clickable {
  cursor: pointer;
}
.roulette-card.is-clickable:not(.is-flipped):hover .roulette-card-inner {
  transform: translateY(-6px) scale(1.03);
}
.roulette-card.is-clickable:not(.is-flipped):active .roulette-card-inner {
  transform: translateY(-2px) scale(0.97);
}
.roulette-card.is-clickable:not(.is-flipped) .roulette-card-inner {
  transition: transform 0.2s ease;
}
.roulette-card.is-clickable:not(.is-flipped):hover .roulette-card-back {
  box-shadow: 0 10px 32px rgba(94,92,230,.55), inset 0 1px 0 rgba(255,255,255,.2);
}
/* Мигающее кольцо на активных картах */
@keyframes rouletteCardGlow {
  0%, 100% { box-shadow: 0 6px 20px rgba(94,92,230,.35), inset 0 1px 0 rgba(255,255,255,.15); }
  50% { box-shadow: 0 6px 28px rgba(94,92,230,.6), 0 0 0 3px rgba(94,92,230,.25), inset 0 1px 0 rgba(255,255,255,.2); }
}
.roulette-card.is-clickable:not(.is-flipped) .roulette-card-back {
  animation: rouletteCardGlow 2s ease-in-out infinite;
}

/* Подсказка под картами */
.roulette-card-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0 auto 16px;
  max-width: 300px;
  line-height: 1.4;
}
.roulette-card-hint[hidden] { display: none; }

/* Тряска перед открытием */
@keyframes rouletteCardShake {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  20% { transform: translateY(-5px) rotate(-2deg); }
  40% { transform: translateY(4px) rotate(2deg); }
  60% { transform: translateY(-3px) rotate(-1deg); }
  80% { transform: translateY(2px) rotate(1deg); }
}
.roulette-card.is-shaking .roulette-card-inner {
  animation: rouletteCardShake 0.45s ease-in-out;
}

/* Пульс победителя */
@keyframes rouletteCardWinPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(249,199,79,.25), 0 6px 24px rgba(249,199,79,.25); }
  50% { box-shadow: 0 0 0 6px rgba(249,199,79,.18), 0 8px 32px rgba(249,199,79,.4); }
}
.roulette-card.is-winner .roulette-card-front {
  animation: rouletteCardWinPulse 1.4s ease-in-out infinite;
}

/* Конфетти в модале */
.roulette-confetti {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  overflow: hidden;
}
.roulette-confetti-piece {
  position: absolute;
  top: -10px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: rouletteConfettiFall linear forwards;
}
@keyframes rouletteConfettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(220px) rotate(540deg); opacity: 0; }
}
.roulette-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
  backdrop-filter: blur(6px);
}
.roulette-modal-overlay[hidden] {
  display: none !important;
}
.roulette-modal {
  position: relative;
  background: var(--card-bg);
  border-radius: 24px;
  padding: 32px 24px 24px;
  text-align: center;
  max-width: 300px;
  width: 100%;
  border: 1px solid var(--border);
  box-shadow: 0 16px 50px rgba(0,0,0,0.45);
  animation: rouletteModalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
@keyframes rouletteModalIn {
  from { transform: scale(0.8) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.roulette-modal-emoji {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 10px;
  animation: rouletteEmojiPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}
@keyframes rouletteEmojiPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.roulette-modal-title {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.roulette-modal-value {
  margin: 0 0 22px 0;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--success, #34c759);
  letter-spacing: -0.04em;
  line-height: 1;
}
.roulette-modal-value.roulette-modal-zero {
  color: var(--text-secondary);
  font-size: 2rem;
}
.roulette-modal-btn {
  width: 100%;
  justify-content: center;
}

.catch-warning-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 520;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.catch-warning-modal-overlay[hidden] {
  display: none !important;
}
.catch-warning-modal {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  max-width: 360px;
  width: 100%;
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.catch-warning-modal-title {
  margin: 0 0 12px 0;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text);
}
.catch-warning-modal-text {
  margin: 0 0 10px 0;
  font-size: 0.93rem;
  line-height: 1.45;
  color: var(--text);
}
.catch-warning-modal-note {
  margin: 0 0 16px 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text-secondary);
}
.catch-warning-modal-actions {
  display: flex;
  gap: 10px;
}
.catch-warning-modal-btn {
  flex: 1;
  justify-content: center;
}
.catch-warning-modal-discount[hidden] { display: none; }
.catch-warning-modal-discount {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(120deg, rgba(255,69,0,0.14) 0%, rgba(255,140,0,0.1) 100%);
  border: 1px solid rgba(255, 130, 0, 0.3);
  border-radius: 14px;
  padding: 10px 13px;
  margin-bottom: 14px;
}
.cwm-discount-fire {
  font-size: 1.5rem;
  flex-shrink: 0;
  animation: firePop 1.2s ease-in-out infinite alternate;
}
.cwm-discount-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cwm-discount-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffaa30;
}
.cwm-discount-detail {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.75);
}
.cwm-discount-detail s {
  opacity: 0.45;
  margin-right: 3px;
}
.cwm-discount-detail b {
  color: #ffcc44;
  font-weight: 700;
}
.cwm-discount-badge {
  flex-shrink: 0;
  font-size: 1.1rem;
  font-weight: 900;
  color: #ffcc44;
  text-shadow: 0 0 10px rgba(255,200,60,0.5);
  letter-spacing: -0.02em;
}
[data-theme="light"] .catch-warning-modal-discount {
  background: linear-gradient(120deg, rgba(255,69,0,0.08) 0%, rgba(255,140,0,0.06) 100%);
}
[data-theme="light"] .cwm-discount-detail {
  color: rgba(0,0,0,0.65);
}

.topup-buy-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 520;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.topup-buy-modal-overlay[hidden] {
  display: none !important;
}
.topup-buy-modal {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  max-width: 360px;
  width: 100%;
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.topup-buy-modal-title {
  margin: 0 0 12px 0;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text);
}
.topup-buy-modal-text {
  margin: 0 0 10px 0;
  font-size: 0.93rem;
  line-height: 1.45;
  color: var(--text);
}
.topup-buy-modal-note {
  margin: 0 0 16px 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text-secondary);
}
.topup-buy-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.topup-buy-modal-btn {
  flex: 1;
  min-width: 140px;
  justify-content: center;
  text-decoration: none;
}
.roulette-prizes-block {
  margin-bottom: 20px;
  padding: 16px 18px;
  background: linear-gradient(145deg, var(--card-bg, #1c1c1e) 0%, color-mix(in srgb, var(--card-bg, #1c1c1e) 95%, var(--border, #38383a)) 100%);
  border-radius: var(--radius-lg, 16px);
  border: 1px solid var(--border, #38383a);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
.roulette-prizes-title {
  margin: 0 0 12px 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.9;
}
.roulette-prizes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.roulette-prize-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 10px 14px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-md, 12px);
  background: linear-gradient(135deg, #2d5a27 0%, #1e8a34 50%, #2d5a27 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30, 138, 52, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.roulette-prize-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 138, 52, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.roulette-prize-chip--zero {
  background: linear-gradient(135deg, #3a3a3c 0%, #2c2c2e 100%);
  color: var(--text-secondary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border-color: var(--border, #38383a);
}
.roulette-prize-chip--zero:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.roulette-prize-chip--jackpot {
  background: linear-gradient(135deg, #b8860b 0%, #daa520 30%, #ffd700 50%, #daa520 70%, #b8860b 100%);
  color: #1a1a1a;
  box-shadow: 0 2px 10px rgba(218, 165, 32, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.35);
}
.roulette-prize-chip--jackpot:hover {
  box-shadow: 0 4px 14px rgba(218, 165, 32, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.roulette-prize-chip-value {
  letter-spacing: 0.02em;
}
.roulette-spin-wrap {
  margin-bottom: 24px;
  text-align: center;
}
.roulette-buttons-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}
#roulette-spin-paid-btn {
  display: none;
}
#roulette-spin-paid-btn.roulette-paid-visible {
  display: inline-flex;
}
.roulette-spin-btn {
  min-width: 200px;
  justify-content: center;
}
.roulette-spin-btn[hidden] {
  display: none;
}
.roulette-spin-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.roulette-already {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.roulette-result {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.roulette-result-animate {
  animation: rouletteResultPop 0.5s var(--ease-out);
}
@keyframes rouletteResultPop {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}
.roulette-result-label {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.roulette-result-value {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--success, #34c759);
  letter-spacing: -0.02em;
}
.roulette-result-value.roulette-result-zero {
  color: var(--text-secondary);
}

/* ——— Реферальная страница (современный вид) ——— */
.referral-page {
  padding: 0 0 24px;
}
.referral-hero {
  text-align: center;
  padding: 24px 0 28px;
  margin-bottom: 22px;
  background: linear-gradient(165deg, rgba(10, 132, 255, 0.1) 0%, rgba(10, 132, 255, 0.03) 50%, transparent 100%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(10, 132, 255, 0.14);
  box-shadow: var(--shadow-sm);
}
.referral-hero-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(10, 132, 255, 0.18);
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.25);
}
.referral-hero-img {
  width: 100px;
  height: 100px;
  margin: 0 auto 16px;
  display: block;
  object-fit: contain;
  border-radius: var(--radius-lg);
}
.referral-hero-title {
  margin: 0 0 6px 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.referral-hero-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}
.referral-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.referral-stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.referral-stat-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.referral-stat-card-earnings .referral-stat-value {
  color: var(--success, #34c759);
}
.referral-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}
.referral-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: lowercase;
}
.referral-link-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.referral-link-label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.referral-link-wrap {
  display: flex;
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}
.referral-input {
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 16px;
  font-size: 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--tg-theme-secondary-bg-color, rgba(255, 255, 255, 0.06));
  color: var(--tg-theme-text-color);
  outline: none;
}
.referral-input:focus {
  border-color: rgba(10, 132, 255, 0.5);
}
.referral-copy-btn,
.referral-link-wrap .btn-copy {
  flex-shrink: 0;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  background: rgba(10, 132, 255, 0.2);
  color: var(--tg-theme-link-color, #0a84ff);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.1s ease;
}
.referral-copy-btn:hover,
.referral-link-wrap .btn-copy:hover {
  background: rgba(10, 132, 255, 0.3);
}
.referral-copy-btn:active,
.referral-link-wrap .btn-copy:active {
  transform: scale(0.98);
}
.referral-list-wrap {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid var(--border);
}
.referral-list-title {
  margin: 0 0 14px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.referral-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.referral-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  gap: 12px;
}
.referral-list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.referral-list-item:first-child {
  padding-top: 0;
}
.referral-list-item .ref-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.referral-list-item .ref-earned {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--success, #34c759);
}
.btn-copy {
  padding: 12px 20px;
  min-height: auto;
  box-sizing: border-box;
  border-radius: 999px;
  border: none;
  background: rgba(10, 132, 255, 0.2);
  color: var(--tg-theme-link-color, #0a84ff);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.btn-copy:active {
  transform: scale(0.98);
}

@media (max-width: 380px) {
  .referral-link-wrap {
    flex-direction: column;
  }
  .referral-copy-btn,
  .referral-link-wrap .btn-copy {
    width: 100%;
  }
}

/* Topup */
.topup-hero {
  text-align: center;
  margin-bottom: 24px;
}
.topup-hero-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.2) 0%, rgba(48, 209, 88, 0.15) 100%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.topup-hero-img {
  width: 100px;
  height: 100px;
  margin: 0 auto 14px;
  display: block;
  object-fit: contain;
  border-radius: var(--radius-lg);
  cursor: pointer;
}
.topup-hero-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--tg-theme-hint-color);
  line-height: 1.4;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}
.topup-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.topup-label {
  display: block;
  margin: 0 0 10px 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tg-theme-hint-color);
  letter-spacing: 0.02em;
}
.topup-input-wrap {
  margin-bottom: 16px;
}
.topup-input {
  width: 100%;
  padding: 16px 18px;
  font-size: 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--tg-theme-bg-color);
  color: var(--tg-theme-text-color);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.topup-input::placeholder {
  color: var(--tg-theme-hint-color);
  opacity: 0.8;
}
.topup-input:focus {
  border-color: var(--tg-theme-button-color);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}
.topup-activate-btn {
  width: 100%;
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  background: var(--tg-theme-button-color);
  color: var(--tg-theme-button-text-color, #ffffff);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.02s ease;
}
.topup-activate-btn:hover {
  opacity: 0.95;
}
.topup-activate-btn:active {
  transform: scale(0.99);
}
.topup-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  gap: 12px;
}
.topup-divider::before,
.topup-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.topup-divider-text {
  font-size: 0.8rem;
  color: var(--tg-theme-hint-color);
  text-transform: lowercase;
}
.topup-buy-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px dashed var(--border);
  text-decoration: none;
  color: var(--tg-theme-text-color);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.topup-buy-card:hover {
  background: rgba(44, 44, 46, 0.8);
  border-color: var(--tg-theme-hint-color);
}
.topup-buy-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.topup-buy-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.topup-buy-desc {
  font-size: 0.85rem;
  color: var(--tg-theme-hint-color);
}
.topup-support {
  text-align: center;
  margin: 24px 0 0 0;
}
.topup-support-link {
  font-size: 0.9rem;
  color: var(--tg-theme-link-color);
  text-decoration: none;
}
.topup-support-link:hover {
  text-decoration: underline;
}

/* Онлайн-оплата: способы */
.topup-payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.topup-payment-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: var(--tg-theme-bg-color);
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  text-align: center;
}
.topup-payment-method:hover {
  border-color: var(--tg-theme-hint-color);
}
.topup-payment-method[aria-pressed="true"] {
  border-color: var(--tg-theme-button-color);
  background: rgba(10, 132, 255, 0.1);
}
.topup-payment-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}
.topup-payment-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.topup-payment-desc {
  font-size: 0.75rem;
  color: var(--tg-theme-hint-color);
  line-height: 1.3;
}

/* Catch */
.catch-card {
  background: linear-gradient(152deg, var(--card-bg) 0%, rgba(38, 38, 40, 0.98) 100%);
  border-radius: var(--radius-xl);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.catch-step-title {
  margin: 0 0 14px 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--tg-theme-text-color);
  letter-spacing: -0.01em;
}
.catch-hint {
  margin: 0 0 14px 0;
  font-size: 0.95rem;
  color: var(--tg-theme-text-color);
  line-height: 1.45;
}
.catch-requirement {
  margin: 0 0 18px 0;
  font-size: 0.9rem;
  color: var(--warning);
  padding: 12px 14px;
  background: rgba(255, 159, 10, 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 159, 10, 0.2);
}
.catch-option-btn {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.catch-daynight-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.catch-dn-label {
  font-size: 0.95rem;
  color: var(--tg-theme-hint-color);
  min-width: 100px;
}
.catch-daynight-btns {
  display: flex;
  gap: 12px;
}
.catch-daynight-btn {
  padding: 14px 20px;
  min-height: 48px;
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--tg-theme-hint-color);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
}
.catch-daynight-btn:hover {
  border-color: var(--border-strong);
}
.catch-daynight-btn.active {
  background: var(--tg-theme-button-color);
  color: var(--tg-theme-button-text-color);
  border-color: var(--tg-theme-button-color);
}
.catch-dur-sublabel {
  margin: 0 0 12px 0;
  font-size: 0.9rem;
  color: var(--tg-theme-hint-color);
}
.catch-dur-info {
  margin: 4px 0 8px 0;
  font-size: 0.85rem;
  color: var(--tg-theme-hint-color);
}
.catch-dur-image {
  display: block;
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 8px 0 12px 0;
}
.catch-durations {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.catch-duration-chip {
  padding: 14px 18px;
  min-height: 48px;
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--tg-theme-text-color);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.catch-duration-chip:hover {
  border-color: var(--tg-theme-link-color);
  background: var(--card-bg-hover);
}
.catch-duration-chip.selected {
  background: var(--tg-theme-button-color);
  color: var(--tg-theme-button-text-color);
  border-color: var(--tg-theme-button-color);
}
.catch-done-btn {
  width: 100%;
  margin-top: 10px;
  border-radius: var(--radius-sm);
}
.catch-duration-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  cursor: pointer;
}
.catch-duration-label input {
  margin: 0;
}
.catch-summary {
  margin: 0 0 18px 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--tg-theme-text-color);
}

.catch-summary-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 0 0 18px 0;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.catch-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.95rem;
  line-height: 1.4;
}

.catch-summary-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.catch-summary-row:first-child {
  padding-top: 0;
}

.catch-summary-label {
  color: var(--tg-theme-hint-color);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 110px;
}

.catch-summary-value {
  color: var(--tg-theme-text-color);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.catch-summary-price .catch-summary-value {
  color: var(--tg-theme-button-color);
  font-size: 1.05rem;
}

[data-theme="light"] .catch-summary-row {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
.catch-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.catch-actions button[hidden],
.catch-actions .nav-btn[hidden] {
  display: none !important;
}
.catch-actions .nav-btn {
  flex: 1;
  min-width: 120px;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.catch-card .nav-btn {
  justify-content: center;
}

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}
.loader[hidden] {
  display: none !important;
}
.recovery-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  pointer-events: auto;
  backdrop-filter: blur(6px);
}
.recovery-overlay[hidden] {
  display: none !important;
}
.recovery-overlay-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  text-align: center;
  max-width: 320px;
  margin: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.recovery-overlay-card .loader-gif {
  margin: 0 auto;
}
.recovery-overlay-title {
  margin: 20px 0 10px 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--tg-theme-text-color);
  letter-spacing: -0.02em;
}
.recovery-overlay-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--tg-theme-hint-color);
  line-height: 1.45;
}
.loader-gif {
  width: 160px;
  height: 160px;
  object-fit: contain;
  display: block;
}
.loader-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--tg-theme-button-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loader p {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--tg-theme-hint-color);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-toast {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 16px 20px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
  background: var(--danger);
  color: #fff;
  border-radius: 0;
  font-size: 0.95rem;
  z-index: 101;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  box-shadow: 0 -4px 20px rgba(255, 59, 48, 0.35);
  text-align: center;
  box-sizing: border-box;
}
.error-toast.visible {
  opacity: 1;
}

/* Terms screen */
.terms-text {
  margin: 0 0 18px 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--tg-theme-hint-color);
}
.terms-link-btn {
  margin-bottom: 20px;
  justify-content: center;
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.terms-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
.terms-actions .nav-btn {
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.nav-btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--tg-theme-hint-color);
}
.nav-btn-secondary:hover {
  background: var(--card-bg);
  border-color: var(--border-strong);
}
[data-theme="light"] .nav-btn-secondary {
  color: #1c1c1e;
}
[data-theme="light"] .nav-btn-secondary:hover {
  color: #1c1c1e;
}
.nav-btn-secondary:active {
  opacity: 0.9;
}

/* ——— Экран настроек ——— */
.screen-settings .settings-warehouse-block {
  margin: 0 0 18px 0;
  padding: 20px 22px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.screen-settings .settings-warehouse-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.screen-settings .settings-warehouse-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.screen-settings .settings-warehouse-name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}
.settings-warehouse-block .settings-warehouse-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--tg-theme-link-color, #0a84ff);
  background: rgba(10, 132, 255, 0.12);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
  box-shadow: none;
}
.settings-warehouse-block .settings-warehouse-action-btn:hover {
  background: rgba(10, 132, 255, 0.22);
  opacity: 1;
}
.settings-warehouse-block .settings-warehouse-action-btn:active {
  opacity: 0.9;
}
[data-theme="light"] .settings-warehouse-block .settings-warehouse-action-btn {
  color: #2481cc;
  background: rgba(36, 129, 204, 0.08);
}
[data-theme="light"] .settings-warehouse-block .settings-warehouse-action-btn:hover {
  background: rgba(36, 129, 204, 0.14);
}
.screen-settings .settings-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
}
.screen-settings .settings-nav-btn {
  justify-content: flex-start;
  text-align: left;
}

/* Auth block (when not authorized) */
.auth-block {
  margin-top: 20px;
  padding: 24px 20px;
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

/* Email-авторизован баннер */
.auth-email-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.auth-email-banner-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.auth-email-banner-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.auth-email-banner-text {
  font-size: 0.92rem;
  color: var(--tg-theme-text-color);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-logout-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--danger, #ff3b30);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 12px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  line-height: 1;
}
.auth-logout-btn:hover {
  background: rgba(255, 59, 48, 0.08);
  border-color: var(--danger, #ff3b30);
}

.auth-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--tg-theme-text-color);
}
.auth-text {
  margin: 0 0 16px 0;
  font-size: 0.9rem;
  color: var(--tg-theme-hint-color);
  line-height: 1.4;
}
.auth-hint {
  margin: 0 0 16px 0;
  font-size: 0.85rem;
  color: var(--tg-theme-hint-color);
  line-height: 1.4;
}

/* Кнопки выбора метода авторизации */
.auth-method-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.auth-method-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  text-align: left;
  box-sizing: border-box;
}
.auth-method-btn:active {
  transform: scale(0.98);
}
.auth-method-btn-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.auth-method-btn-label {
  flex: 1;
}
.auth-method-btn-primary {
  background: linear-gradient(135deg, var(--tg-theme-button-color, #0a84ff) 0%, #0860d6 100%);
  color: var(--tg-theme-button-text-color, #fff);
  border: none;
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.3);
}
.auth-method-btn-primary:hover {
  box-shadow: 0 6px 20px rgba(10, 132, 255, 0.4);
  transform: translateY(-1px);
}
.auth-method-btn-secondary {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--tg-theme-text-color);
}
.auth-method-btn-secondary:hover {
  background: var(--card-bg);
  border-color: var(--border-strong);
}

.auth-phone-input {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.auth-phone-input:focus {
  border-color: var(--tg-theme-button-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}
.auth-submit-btn {
  justify-content: center;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  margin-top: 8px;
}
.auth-status-msg {
  margin: 0 0 14px 0;
  font-size: 0.95rem;
  color: var(--tg-theme-hint-color);
  min-height: 2em;
}
.auth-status-msg.auth-status-msg-error {
  color: var(--danger);
  font-weight: 500;
}
#auth-error-actions {
  margin-top: 16px;
}
.auth-support-btn {
  display: block;
  width: 100%;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  margin-top: 8px;
}
.auth-cancel-btn {
  margin-top: 12px;
}

/* Admin panel */
.admin-header {
  margin-bottom: 8px;
}
.admin-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.admin-dashboard {
  padding: 8px 0;
}
.admin-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.admin-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--tg-theme-text-color);
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}
.admin-nav-card:hover {
  background: var(--card-bg-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.admin-nav-card:active {
  transform: translateY(0);
}
.admin-nav-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  line-height: 1;
}
.admin-nav-label {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.admin-nav-desc {
  font-size: 0.8rem;
  color: var(--tg-theme-hint-color);
  text-align: center;
}

.admin-info-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.admin-stat-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tg-theme-secondary-bg-color);
  border-radius: var(--radius-md);
}
.admin-stat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-stat-content .admin-stat-label {
  font-size: 0.9rem;
  color: var(--tg-theme-hint-color);
}
.admin-stat-content .admin-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--tg-theme-text-color);
}
.admin-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.admin-action-btn {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--tg-theme-secondary-bg-color);
  color: var(--tg-theme-text-color);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.admin-action-btn:hover {
  background: var(--card-bg-hover);
}
.admin-action-btn-primary {
  background: linear-gradient(180deg, var(--tg-theme-button-color) 0%, #0968d9 100%);
  border-color: transparent;
  color: var(--tg-theme-button-text-color, #ffffff);
}
.admin-action-btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.admin-content { padding: 16px; }
.admin-nav { display: flex; gap: 12px; margin-bottom: 24px; }
.admin-nav-btn { flex: 1; justify-content: center; }
.admin-section { margin-top: 16px; }
.admin-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.admin-section-title {
  margin: 0 0 20px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--tg-theme-text-color);
}
.admin-form { display: flex; flex-direction: column; gap: 16px; }
.admin-label {
  display: block;
  font-size: 0.95rem;
  color: var(--tg-theme-hint-color);
  margin-bottom: 8px;
}
.admin-result {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.admin-result-label {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  color: var(--tg-theme-hint-color);
}
.admin-key-display {
  display: flex;
  gap: 8px;
  align-items: center;
}
.admin-key-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--tg-theme-secondary-bg-color);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--tg-theme-text-color);
  font-family: monospace;
  font-size: 0.9rem;
}
.admin-key-input:focus {
  outline: none;
  border-color: var(--tg-theme-button-color);
}
.admin-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}
.admin-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--tg-theme-secondary-bg-color);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.admin-stat-item:last-child { margin-bottom: 0; }
.admin-stat-label { font-size: 0.95rem; color: var(--tg-theme-hint-color); }
.admin-stat-value { font-size: 1.1rem; font-weight: 600; color: var(--tg-theme-text-color); }
.admin-keys-card { margin-top: 8px; }

.topup-hero-icon {
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease;
}

.topup-hero-icon:active {
  transform: scale(0.95);
}

/* ——— OTP Inputs ——— */
.otp-input-wrap {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 1.2rem 0 1rem;
}
.otp-input {
  width: 44px;
  height: 54px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-strong);
  background: var(--tg-theme-secondary-bg-color);
  color: var(--tg-theme-text-color);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  -moz-appearance: textfield;
  caret-color: var(--tg-theme-button-color);
}
.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.otp-input:focus {
  border-color: var(--tg-theme-button-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tg-theme-button-color) 20%, transparent);
}
.otp-input:not(:placeholder-shown) {
  border-color: var(--success);
}
[data-theme="light"] .otp-input {
  background: #f2f2f7;
  border-color: rgba(0,0,0,0.14);
}

/* ——— News Carousel ——— */
.news-carousel-block {
  margin: 0 0 16px;
}
.news-carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
}
.news-carousel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tg-theme-text-color);
  letter-spacing: -0.01em;
}
.news-carousel-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}
.news-carousel-wrap::-webkit-scrollbar { display: none; }
.news-carousel {
  display: flex;
  gap: 12px;
  padding: 0 2px;
}
.news-card {
  flex: 0 0 220px;
  min-width: 220px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
}
.news-card:active {
  transform: scale(0.97);
  box-shadow: none;
}
.news-card-img-wrap {
  width: 100%;
  height: 110px;
  overflow: hidden;
}
.news-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-card-body {
  padding: 10px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.news-card-date {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin: 0;
}
.news-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--tg-theme-text-color);
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-preview {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ——— News Detail ——— */
.news-detail-page {
  padding: 0;
}
.news-detail-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 16px;
}
.news-detail-img {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  display: block;
  max-height: 240px;
  object-fit: cover;
}
.news-detail-body {
  font-size: 0.97rem;
  color: var(--tg-theme-text-color);
  line-height: 1.65;
}
.news-detail-body p {
  margin: 0 0 1em;
}
.news-detail-body p:last-child { margin-bottom: 0; }

/* ——— Admin News ——— */
.admin-news-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 0 80px;
}
.admin-news-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 12px 14px;
}
.admin-news-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.admin-news-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--tg-theme-text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.admin-news-item-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.admin-news-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.admin-news-edit-btn,
.admin-news-delete-btn {
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  min-width: unset;
}

/* ——— Support Chat ——— */
.screen-support,
.screen-admin-support-chat {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--tg-theme-bg-color, #fff);
  z-index: 10;
  height: 95vh;
  height: 95dvh;
}

.support-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.support-header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}
.support-header .support-status {
  align-self: flex-start;
}
.support-status {
  font-size: 0.75rem;
  color: #4caf50;
  white-space: nowrap;
}

.support-tg-admin-bar {
  display: flex;
  justify-content: center;
  padding: 8px 16px 4px;
  border-bottom: 1px solid var(--tg-theme-secondary-bg-color, rgba(128,128,128,.15));
}
.support-tg-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 18px;
  border-radius: 20px;
  background: #2ca5e0;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(44,165,224,.25);
  transition: opacity .15s;
}
.support-tg-admin-btn:active {
  opacity: .8;
}

.support-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
}

.support-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
}
.support-empty-icon {
  font-size: 2.5rem;
  margin: 0;
}
.support-empty-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

.support-msg {
  display: flex;
  max-width: 80%;
}
.support-msg-out {
  align-self: flex-end;
}
.support-msg-in {
  align-self: flex-start;
}

.support-bubble {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--tg-theme-text-color);
  word-break: break-word;
  position: relative;
}
.support-msg-out .support-bubble {
  background: var(--tg-theme-button-color, #5288c1);
  color: var(--tg-theme-button-text-color, #fff);
  border-color: transparent;
  border-bottom-right-radius: 4px;
}
.support-msg-in .support-bubble {
  border-bottom-left-radius: 4px;
}

.support-msg-img {
  display: block;
  max-width: 200px;
  max-height: 200px;
  width: 100%;
  object-fit: cover;
  border-radius: 10px;
  cursor: zoom-in;
  margin-bottom: 4px;
}

.support-msg-text {
  display: block;
  word-break: break-word;
}

.support-msg-time {
  display: block;
  font-size: 0.68rem;
  opacity: 0.65;
  text-align: right;
  margin-top: 3px;
}

/* ——— Lightbox ——— */
#support-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#support-lightbox[hidden] { display: none !important; }
#support-lightbox-img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
#support-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 1.3rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.support-input-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--tg-theme-bg-color, #fff);
}

.support-attach-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.support-attach-preview {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.support-attach-remove {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.support-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.support-attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s;
}
.support-attach-btn:active { color: var(--tg-theme-button-color, #5288c1); }

.support-textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 0.9rem;
  background: var(--card-bg);
  color: var(--tg-theme-text-color);
  outline: none;
  overflow-y: auto;
  max-height: 120px;
  line-height: 1.4;
  font-family: inherit;
}
.support-textarea:focus {
  border-color: var(--tg-theme-button-color, #5288c1);
}

.support-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--tg-theme-button-color, #5288c1);
  color: var(--tg-theme-button-text-color, #fff);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.support-send-btn:active { opacity: 0.75; }

/* ——— Admin support: написать по ID ——— */
.admin-support-open-by-id {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
  align-items: center;
}
.admin-support-open-by-id .topup-input {
  flex: 1;
  margin-bottom: 0;
  min-width: 0;
}

/* ——— Admin support chat list ——— */
.admin-support-chats-list {
  display: flex;
  flex-direction: column;
  padding: 0 0 80px;
}

.admin-support-chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.admin-support-chat-item:active {
  background: var(--card-bg);
}
.admin-support-chat-item.has-unread {
  background: color-mix(in srgb, var(--tg-theme-button-color, #5288c1) 8%, transparent);
}

.admin-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--tg-theme-button-color, #5288c1);
  color: var(--tg-theme-button-text-color, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  flex-shrink: 0;
}

.admin-chat-info {
  flex: 1;
  min-width: 0;
}

.admin-chat-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--tg-theme-text-color);
}

.admin-chat-uid {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--tg-theme-hint-color);
}

.admin-chat-unread-dot {
  background: var(--tg-theme-button-color, #5288c1);
  color: var(--tg-theme-button-text-color, #fff);
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}

.admin-chat-last-msg {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-chat-time {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Стикер скидки на кнопке «Поймать смену» ── */
/* Стикер внутри кнопки (не выходит за border-radius, совместимо с Telegram WebView) */
#btn-catch {
  position: relative;
}
.catch-discount-sticker[hidden] { display: none; }
.catch-discount-sticker {
  position: absolute;
  top: 0px;
  right: -15px;
  display: flex;
  align-items: center;
  gap: 2px;
  background: linear-gradient(135deg, #ff4500 0%, #ff8c00 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  padding: 3px 8px 3px 6px;
  border-radius: 20px;
  transform: rotate(8deg);
  box-shadow:
    0 2px 8px rgba(255, 80, 0, 0.5),
    0 0 0 1.5px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255,255,255,0.25);
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
  animation: stickerIn 0.35s var(--ease-out) both, stickerBounce 3.5s ease-in-out 0.5s infinite;
}
.catch-discount-sticker::before {
  content: '🔥';
  font-size: 1rem;
}
@keyframes stickerIn {
  from { transform: rotate(8deg) scale(0.4); opacity: 0; }
  to   { transform: rotate(8deg) scale(1);   opacity: 1; }
}
@keyframes stickerBounce {
  0%, 80%, 100% { transform: rotate(8deg) scale(1); }
  88%            { transform: rotate(12deg) scale(1.08); }
  94%            { transform: rotate(6deg)  scale(1.04); }
}

/* Ценник на кнопке «Поймать смену» */
.catch-price-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255,255,255,0.22);
  border-radius: 8px;
  padding: 1px 7px;
  margin-left: 4px;
  letter-spacing: 0.01em;
  vertical-align: middle;
}
.catch-price-tag .price-old {
  text-decoration: line-through;
  opacity: 0.7;
  margin-right: 3px;
}
.catch-price-tag .price-new {
  font-weight: 700;
}

/* Admin support unread badge on nav card */
.admin-support-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e53935;
  color: #fff;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 18px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Бейдж непрочитанных ответов поддержки на кнопке в шапке */
.main-top-icon-btn--badge {
  position: relative;
}
.support-user-unread-badge[hidden] { display: none; }
.support-user-unread-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #e53935;
  color: #fff;
  border-radius: 8px;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--tg-theme-bg-color, #1c1c1e);
  pointer-events: none;
  animation: badgePop 0.3s var(--ease-out) both;
}
@keyframes badgePop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
