/* --- Переменные --- */
:root {
  --bg-page: #f0f7ff;
  --bg-main: #fff;
  --bg-header: #1e3a5f;
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --shadow: 0 2px 12px rgba(30, 58, 95, 0.08);
  --shadow-strong: 0 4px 20px rgba(30, 58, 95, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --success: #0d9488;
  --error: #dc2626;
  --font: 'Segoe UI', system-ui, sans-serif;
}

/* --- Базовые стили --- */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  background: var(--bg-page);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Шапка --- */
.site-header {
  background: linear-gradient(180deg, #1e3a5f 0%, #1a3658 100%);
  color: #fff;
  padding: 12px 20px;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  box-shadow: var(--shadow-strong);
}

.site-nav {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.site-nav__menu {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.site-nav__home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.site-nav__home img {
  display: block;
}

.site-nav__home:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.site-nav__link {
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.15s;
}

.site-nav__link:hover {
  color: #fff;
  background: rgba(59, 130, 246, 0.45);
  border-color: rgba(147, 197, 253, 0.9);
  transform: translateY(-1px);
}

.site-nav__logout-form {
  margin-left: auto;
}

.site-nav__toggle {
  display: none;
}

.site-nav__logout-btn {
  appearance: none;
  border: 1px solid rgba(248, 113, 113, 0.85);
  background: rgba(220, 38, 38, 0.18);
  color: #fee2e2;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.site-nav__logout-btn:hover {
  background: rgba(220, 38, 38, 0.35);
  border-color: #f87171;
  transform: translateY(-1px);
}

@media (max-width: 760px) {
  .site-nav {
    position: relative;
    flex-wrap: nowrap;
  }

  .site-nav__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
  }

  .site-nav__menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 20;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(180deg, #1f3f68 0%, #1a3658 100%);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.35);
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .site-nav.is-open .site-nav__menu {
    display: flex;
  }

  .site-nav__menu .site-nav__link,
  .site-nav__menu .site-nav__logout-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .site-nav__menu .site-nav__logout-form {
    width: 100%;
    margin-left: 0;
  }
}

/* --- Кнопка «В начало страницы» --- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--bg-header);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-strong);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.2s;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
}

.back-to-top:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Основной контент --- */
main {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 20px 40px;
  flex: 1 0 auto;
  width: 100%;
}

.main-card {
  background: var(--bg-main);
  border-radius: var(--radius);
  padding: 32px 36px;
  box-shadow: var(--shadow);
  font-size: 1rem;
}

main h2 {
  margin: 0 0 24px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

/* --- Главная страница --- */
.home-hero {
  text-align: center;
  padding: 24px 0 32px;
  border-bottom: 1px solid var(--border);
}

.home-title {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--bg-header);
}

.home-subtitle {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.home-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.home-section:last-of-type {
  border-bottom: none;
}

.home-section-title {
  margin: 0 0 14px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-link {
  display: inline-block;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background 0.2s, transform 0.1s;
}

.home-link:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.home-footer {
  margin-top: 32px;
  padding-top: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.home-footer a {
  color: var(--accent);
  text-decoration: none;
}

.home-footer a:hover {
  text-decoration: underline;
}

/* --- Стихи о крупье --- */
.home-poems {
  margin-top: 40px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.home-poems__title {
  margin: 0 0 20px;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

.home-poems__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
  margin-bottom: 28px;
}

.home-poems__nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.home-poems__nav a:hover {
  background: rgba(37, 99, 235, 0.1);
}

.home-poem-details {
  margin-bottom: 12px;
}

.home-poem-details:last-of-type {
  margin-bottom: 0;
}

.home-poem-details__summary {
  cursor: pointer;
  padding: 12px 16px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  user-select: none;
}

.home-poem-details__summary::-webkit-details-marker {
  display: none;
}

.home-poem-details__summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 8px;
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.home-poem-details[open] .home-poem-details__summary::before {
  transform: rotate(90deg);
}

.home-poem-details__summary:hover {
  background: rgba(37, 99, 235, 0.12);
}

.home-poems__list {
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 560px;
  margin: 0 auto;
}

.home-poem {
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(30, 58, 95, 0.04) 0%, rgba(37, 99, 235, 0.04) 100%);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  text-align: left;
}

.home-poem__title {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.home-poem__body {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
}

.home-poem__body p {
  margin: 0 0 12px;
}

.home-poem__body p:last-child {
  margin-bottom: 0;
}

.home-poem__author {
  margin: 16px 0 0;
  padding-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid var(--border);
}

/* Главная: только стихи — без отступа «под игры» */
.home-poems--landing {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.home-poems--landing .home-poems__title {
  margin-bottom: 1.25rem;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--bg-header);
  letter-spacing: -0.02em;
}

.home-poems--in-shell .home-poems__list {
  gap: 0.85rem;
}

.home-poems--landing .home-poem-details__summary {
  background: rgba(30, 58, 95, 0.08);
  color: var(--bg-header);
  border: 1px solid rgba(30, 58, 95, 0.12);
}

.home-poems--landing .home-poem-details__summary:hover {
  background: rgba(30, 58, 95, 0.12);
}

.home-poems--landing .home-poem {
  border-left-color: var(--bg-header);
  background: linear-gradient(135deg, rgba(30, 58, 95, 0.05) 0%, rgba(37, 99, 235, 0.04) 100%);
}

.home-footer--landing {
  margin-top: 2.5rem;
  padding-top: 0;
  text-align: left;
}

.home-footer--landing .home-footer__panel {
  max-width: 560px;
  margin: 0;
  padding: 1.2rem 1.35rem 1.25rem;
  background: linear-gradient(145deg, rgba(30, 58, 95, 0.07) 0%, rgba(240, 247, 255, 0.9) 55%, #fff 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--bg-header);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.home-footer__title {
  margin: 0 0 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bg-header);
}

.home-footer--landing .home-footer__links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: stretch;
}

.home-footer--landing .home-footer__links li {
  position: relative;
  padding-left: 1.1rem;
}

.home-footer--landing .home-footer__links li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.85;
}

.home-footer--landing .home-footer__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem 0.4rem 0;
  margin-left: -0.5rem;
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.home-footer--landing .home-footer__links a::after {
  content: '↗';
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.55;
  transform: translateY(-1px);
}

.home-footer--landing .home-footer__links a:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-hover);
  text-decoration: none;
}

.home-footer--landing .home-footer__links a:hover::after {
  opacity: 0.9;
}

/* Внутри auth-shell — без второй «тяжёлой» тени у панели ссылок */
.home-footer--in-shell {
  margin-top: 1.75rem;
}

.home-footer--in-shell .home-footer__panel {
  box-shadow: none;
  background: rgba(30, 58, 95, 0.045);
}

/* --- Мобильная версия --- */
@media (max-width: 600px) {
  body {
    font-size: 18px;
  }

  main {
    margin: 8px auto;
    padding: 0 8px 24px;
  }

  .main-card {
    padding: 16px 10px;
    font-size: 18px;
  }

  main h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
  }

  .combo-form select {
    font-size: 18px;
    min-width: 100%;
    max-width: 100%;
  }

  .message {
    font-size: 1rem;
  }

  .page-links a {
    font-size: 1rem;
  }

  .combo-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .btn-combo {
    font-size: 0.9rem;
    padding: 10px 8px;
  }

  .chaevye-btn--platform {
    width: 100%;
    max-width: 20rem;
    box-sizing: border-box;
  }

  .tip-thanks__quote {
    font-size: 1.15rem;
  }
}

/* --- Карты (рука) --- */
.hand {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
}

.hand-card {
  flex: 0 0 auto;
  cursor: grab;
  transition: opacity 0.15s;
}

.hand-card:active {
  cursor: grabbing;
}

.hand-card.dragging {
  opacity: 0.5;
}

.hand-card.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}

.hand-card.selected {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  z-index: 1;
}

.card-img {
  flex: 0 0 auto;
  width: 72px;
  height: auto;
  aspect-ratio: 75 / 110;
  object-fit: contain;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 1px 3px 8px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease;
}

.card-img:hover {
  transform: translateY(-2px);
  box-shadow: 2px 6px 12px rgba(0, 0, 0, 0.15);
}

/* 5 карт в ряд на мобильном без прокрутки */
@media (max-width: 600px) {
  .hand {
    gap: 4px;
    justify-content: space-between;
    margin-bottom: 20px;
  }

  .hand .hand-card {
    flex: 1 1 0;
    min-width: 0;
  }

  .hand .hand-card .card-img {
    width: 100%;
  }
}

/* --- Texas Hold'em layout --- */
.texas-layout {
  margin: 24px 0;
}

.texas-board {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.texas-hole {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.texas-board .card-img,
.texas-hole .card-img {
  flex: 0 0 auto;
}

@media (max-width: 600px) {
  .texas-board .card-img {
    width: calc((100% - 32px) / 5);
  }
  .texas-hole .card-img {
    width: 56px;
  }
}

/* --- Hold'em: сравнение гость / дилер (9 карт) --- */
.texas-layout--compare {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.texas-compare-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.texas-compare-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.texas-board--compare {
  margin-bottom: 0;
}

.holdem-compare-panel .texas-layout--compare {
  margin-top: 0.35rem;
  margin-bottom: 0.25rem;
}

.holdem-compare-form {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(30, 58, 95, 0.1);
}

/* Оверлей на весь вьюпорт — у формы не оставляем полосы сверху */
.holdem-compare-form:has(.payout-success-overlay) {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Младше | Ничья | Старше — слева / центр / справа */
.holdem-compare-buttons {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.holdem-compare-buttons .holdem-compare-btn:nth-child(1) {
  justify-self: start;
}

.holdem-compare-buttons .holdem-compare-btn:nth-child(2) {
  justify-self: center;
}

.holdem-compare-buttons .holdem-compare-btn:nth-child(3) {
  justify-self: end;
}

.holdem-compare-buttons .holdem-compare-btn {
  min-width: 0;
  text-align: center;
}

/* Кнопки ответа: без синих заливок — шкала «слабее → ничья → сильнее» */
.holdem-compare-btn {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  padding: 11px 14px;
  margin: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  appearance: none;
  box-shadow: 0 1px 3px rgba(30, 58, 95, 0.07);
  transition:
    background 0.18s,
    border-color 0.18s,
    color 0.18s,
    box-shadow 0.18s,
    transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.holdem-compare-btn:focus-visible {
  outline: 2px solid var(--bg-header);
  outline-offset: 2px;
}

.holdem-compare-btn--lower {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: #cbd5e1;
  color: #475569;
}

.holdem-compare-btn--lower:hover {
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  border-color: #94a3b8;
  color: #334155;
}

.holdem-compare-btn--tie {
  background: #fff;
  border-color: #cbd5e1;
  color: #334155;
  box-shadow: 0 1px 4px rgba(30, 58, 95, 0.06);
}

.holdem-compare-btn--tie:hover {
  border-color: #94a3b8;
  background: #fafafa;
}

.holdem-compare-btn--higher {
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #6ee7b7;
  color: #065f46;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.12);
}

.holdem-compare-btn--higher:hover {
  background: linear-gradient(180deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: #34d399;
  color: #064e3b;
}

.holdem-compare-btn:active {
  transform: scale(0.98);
}

.holdem-compare-btn--ante {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #f59e0b;
  color: #92400e;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.holdem-compare-btn--ante:hover {
  background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
  border-color: #d97706;
  color: #78350f;
}

.holdem-compare-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
}

.holdem-compare-actions__hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-muted);
  text-align: center;
}

.holdem-compare-actions .holdem-compare-btn--ante {
  width: 100%;
  justify-self: stretch;
  min-height: 46px;
}

.holdem-compare-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  text-align: initial;
}

@media (max-width: 600px) {
  /* Пять карт борда на всю ширину ряда (без искусственного max-width) */
  .texas-layout--compare .texas-board--compare {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    max-width: 100%;
  }

  .texas-layout--compare .texas-board--compare .card-img {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    max-width: none;
    height: auto;
  }

  /*
   * Hold'em «старше / младше»: мобилка — обычные поля main/main-card,
   * у блока с картами сохраняем «стеклянную» панель с нормальными отступами (не в линию с краем экрана).
   */
  .holdem-compare-page.auth-shell {
    padding: 1rem 12px 1.15rem;
  }

  .holdem-compare-page {
    overflow: visible;
    box-sizing: border-box;
  }

  .holdem-compare-page .holdem-compare-panel {
    padding: 1.05rem max(14px, env(safe-area-inset-left, 0px)) 1.15rem max(14px, env(safe-area-inset-right, 0px));
    margin-left: 0;
    margin-right: 0;
    border-radius: var(--radius);
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-left: 4px solid rgba(37, 99, 235, 0.35);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 24px rgba(30, 58, 95, 0.07);
  }

  .holdem-compare-page .texas-layout--compare .texas-board--compare {
    gap: 5px;
  }

  .holdem-compare-page .holdem-compare-form {
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
    padding-top: 1rem;
    padding-bottom: 0.65rem;
    margin-top: 0.15rem;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(241, 245, 249, 0.5) 55%, transparent 100%);
    border-top: 1px solid rgba(30, 58, 95, 0.09);
  }

  .holdem-compare-page .holdem-compare-actions {
    max-width: none;
  }

  .holdem-compare-page .holdem-compare-buttons {
    gap: 6px;
  }

  .holdem-compare-page .holdem-compare-btn {
    min-height: 48px;
    padding: 10px 8px;
    font-size: 0.86rem;
    letter-spacing: 0.01em;
    border-radius: 12px;
  }

  .holdem-compare-page .texas-compare-label {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: #64748b;
  }

  .holdem-compare-page .site-shell__footer {
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
  }
}

/* --- Форма (комбо) --- */
.combo-form {
  margin-top: 8px;
}

.combo-form select {
  font-family: var(--font);
  font-size: 1.05rem;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--text);
  min-width: 220px;
  cursor: pointer;
}

.combo-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.15);
}

.combo-form select:disabled {
  opacity: 0.8;
  cursor: default;
}

.combo-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.btn-combo {
  font-size: 0.95rem;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(45, 90, 39, 0.3);
}

.btn-combo:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  box-shadow: 0 3px 8px rgba(45, 90, 39, 0.4);
}

.btn-combo:active {
  transform: scale(0.98);
}

.form-actions {
  margin: 18px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Payout: полноэкранный режим, по центру --- */
.payout-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 70px);
  margin: 0;
  padding: 20px;
}

@supports (height: 100dvh) {
  .payout-main {
    min-height: calc(100dvh - 70px);
  }
}

.payout-main .main-card {
  width: 100%;
  max-width: 520px;
  margin: 0;
}

.payout-screen {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* --- Blackjack/Poker выплата: настройки (шестерёнка) --- */
.payout-page {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 56px;
}

.payout-page--ptc {
  padding-top: 96px;
}

.payout-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.payout-header .payout-bet {
  margin: 0;
  text-align: left;
  font-size: 2rem;
}

.payout-header--right {
  justify-content: flex-end;
}

.payout-header--center {
  justify-content: center;
}
.payout-header--center .payout-bet {
  text-align: center;
}
.payout-header--center .payout-settings-btn {
  position: absolute;
  right: 0;
  top: 0;
}

.payout-timer-row--compact {
  margin: 28px 0 0;
  width: 100%;
}

.payout-ptc-table {
  border-collapse: collapse;
  font-size: 1.4rem;
  margin: 0 auto;
}
.payout-ptc-table th,
.payout-ptc-table td {
  border: 1px solid var(--border-color, #ddd);
  padding: 10px 20px;
  text-align: center;
}
.payout-ptc-table th {
  background: var(--bg-muted, #f5f5f5);
  font-weight: 600;
}
.payout-ptc-table td {
  min-width: 80px;
}
.payout-ptc-question {
  margin: 4px 0 0;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
}
.payout-ptc-settings-hint {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.payout-ptc-stacks-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.payout-ptc-stacks-row .ar-stacks-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.payout-ptc-stacks-input input {
  width: 70px;
}

.payout-ptc-answer-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.payout-ptc-answer-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.payout-ptc-answer-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.payout-ptc-input {
  padding: 4px 6px;
  box-sizing: border-box;
}
.payout-ptc-answer-cell:first-child .payout-ptc-input {
  width: 42px;  /* 3–4 знака */
}
.payout-ptc-answer-cell:last-child .payout-ptc-input {
  width: 30px;  /* до 19 */
}

.payout-settings-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.payout-settings-btn:hover {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.payout-settings-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.payout-settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) 16px max(12px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.payout-settings-overlay.is-open {
  display: flex;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.payout-settings-modal {
  background: var(--bg-main);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-strong);
  flex-shrink: 0;
  max-height: min(92vh, calc(100svh - 2rem));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: auto;
}

@supports (height: 100dvh) {
  .payout-settings-modal {
    max-height: min(92dvh, calc(100dvh - 2rem));
  }
}

/* Страница под модалкой не скроллится (телефоны) */
@supports selector(:has(*)) {
  html:has(.payout-settings-overlay.is-open),
  body:has(.payout-settings-overlay.is-open) {
    overflow: hidden;
    overscroll-behavior: none;
  }
}

.payout-settings-title {
  margin: 0 0 20px;
  font-size: 1.25rem;
  font-weight: 600;
}

.payout-settings-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.payout-settings-fields label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: var(--text);
}

.payout-settings-fields input {
  width: 80px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.payout-settings-fields input:focus {
  outline: none;
  border-color: var(--accent);
}

.payout-settings-fields input:disabled {
  background: #f1f5f9;
  color: var(--text-muted);
  cursor: not-allowed;
}

.payout-settings-fields select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  min-width: 120px;
}

.ar-stacks-row {
  cursor: pointer;
}

.ar-stacks-row input[type="checkbox"] {
  margin: 0;
}

.ar-stacks-row span {
  margin-left: 0;
}

.ar-stacks-row select {
  min-width: 56px;
  padding: 6px 8px;
}

#ar-number-select {
  min-width: 56px;
  padding: 6px 8px;
}

.roulette-multipliers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.roulette-multipliers-label {
  font-weight: 500;
  flex-basis: 100%;
}

.roulette-multiplier-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.roulette-multiplier-check input {
  margin: 0;
  width: 18px;
  height: 18px;
}

.payout-settings-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.payout-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 56px;
}
.payout-page--ptc .payout-form {
  padding-top: 0;
}

.payout-bet {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--bg-header);
  margin: 0 0 24px;
  text-align: center;
}

.payout-combo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 12px 0 16px;
  text-align: center;
}

.payout-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* Кнопка «?» в шапке тренажёров: без серого фона/рамки по умолчанию у <button> */
.payout-header.series-stake-header .neighbors-help-btn {
  background: transparent;
  border: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.payout-header.series-stake-header .neighbors-help-btn::-moz-focus-inner {
  border: 0;
  padding: 0;
}
.payout-header.series-stake-header .neighbors-help-btn:focus {
  outline: none;
}
.payout-header.series-stake-header .neighbors-help-btn:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 2px;
  border-radius: 50%;
}

.payout-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: linear-gradient(160deg, #f8fafc 0%, #eef2f7 100%);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(30, 58, 95, 0.06), inset 0 1px 0 rgba(255,255,255,0.9);
}

.payout-keyboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  max-width: 280px;
  touch-action: manipulation; /* быстрый отклик на мобильных */
}

@media (min-width: 480px) {
  .payout-keyboard {
    grid-template-columns: repeat(4, 56px);
    gap: 10px;
    max-width: none;
    width: auto;
  }
}

.payout-key {
  width: 100%;
  height: auto;
  min-height: 48px;
  aspect-ratio: 1 / 1;
  padding: 0;
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation; /* быстрый отклик на тач, без 300ms задержки */
  -webkit-tap-highlight-color: transparent; /* убирает подсветку тапа на iOS */
  -webkit-tap-highlight-color: transparent; /* убирает подсветку тапа на iOS */
  -webkit-tap-highlight-color: transparent; /* убирает подсветку тапа на iOS/Android */
  box-shadow: 0 2px 4px rgba(30, 58, 95, 0.12), 0 1px 0 rgba(255,255,255,0.9) inset;
  transition: transform 0.08s, box-shadow 0.2s, background 0.15s;
}

.payout-key:hover:not(:disabled) {
  background: #fff;
  box-shadow: 0 3px 8px rgba(30, 58, 95, 0.18), 0 1px 0 rgba(255,255,255,0.9) inset;
  transform: translateY(-1px);
}

.payout-key:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(30, 58, 95, 0.15) inset;
}

.payout-key--special {
  background: linear-gradient(180deg, var(--accent) 0%, #1d4ed8 100%);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.4), 0 1px 0 rgba(255,255,255,0.2) inset;
}

.payout-key--special:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--accent-hover) 0%, var(--accent) 100%);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.4);
}

.payout-key--backspace {
  font-size: 1.35rem;
  color: var(--text-muted);
}

.payout-key--backspace:hover:not(:disabled) {
  color: var(--error);
  background: rgba(220, 38, 38, 0.08);
}


.payout-key--enter {
  grid-column: 4;
  grid-row: 2 / span 2;
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
  align-self: stretch;
  background: linear-gradient(180deg, var(--accent) 0%, #1d4ed8 100%);
  color: #fff;
  font-size: 1.2rem;
}

.payout-key--enter:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--accent-hover) 0%, var(--accent) 100%);
}

.payout-pass-row {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.payout-pass-btn {
  min-width: 140px;
}

@media (min-width: 480px) {
  .payout-key {
    width: 56px;
    height: 56px;
    min-height: 56px;
    aspect-ratio: auto;
  }
}

.payout-input {
  width: 100%;
  min-width: 160px;
  max-width: 220px;
  padding: 16px 20px;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.payout-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Активное поле для кастомной клавиатуры (тач: без постоянного фокуса после каждой цифры) */
.payout-input.payout-keyboard-target:not(:focus) {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.payout-input.payout-input--custom-kb {
  cursor: pointer;
  caret-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

@media (max-width: 479px) {
  .payout-main {
    align-items: flex-start;
    justify-content: flex-start;
    min-height: auto;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .payout-entry {
    width: 100%;
    box-sizing: border-box;
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

.payout-input:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
}

.payout-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.payout-buttons .btn {
  min-width: 120px;
}

.btn-secondary {
  background: #64748b;
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  background: #475569;
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.payout-message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 500;
}

.payout-message.success {
  color: var(--success);
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid rgba(13, 148, 136, 0.3);
}

.payout-message.error {
  color: var(--error);
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

/* --- Payout: успех / фейерверки --- */
.payout-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.payout-success-tap {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border: none;
  background: transparent;
}

.payout-success-text {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  pointer-events: none;
}

.payout-success-text small {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.9;
}

.payout-success-text .emoji {
  font-size: 2.6rem;
  line-height: 1;
  display: inline-block;
}

.payout-fireworks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.payout-fireworks span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: firework-burst 0.8s ease-out forwards;
  opacity: 0;
}

.payout-fireworks span:nth-child(1) { --a: 0deg; --c: #f59e0b; }
.payout-fireworks span:nth-child(2) { --a: 30deg; --c: #10b981; }
.payout-fireworks span:nth-child(3) { --a: 60deg; --c: #3b82f6; }
.payout-fireworks span:nth-child(4) { --a: 90deg; --c: #ef4444; }
.payout-fireworks span:nth-child(5) { --a: 120deg; --c: #8b5cf6; }
.payout-fireworks span:nth-child(6) { --a: 150deg; --c: #ec4899; }
.payout-fireworks span:nth-child(7) { --a: 180deg; --c: #f59e0b; }
.payout-fireworks span:nth-child(8) { --a: 210deg; --c: #14b8a6; }
.payout-fireworks span:nth-child(9) { --a: 240deg; --c: #6366f1; }
.payout-fireworks span:nth-child(10) { --a: 270deg; --c: #f97316; }
.payout-fireworks span:nth-child(11) { --a: 300deg; --c: #22c55e; }
.payout-fireworks span:nth-child(12) { --a: 330deg; --c: #eab308; }

.payout-fireworks--stop span:nth-child(1) { --c: #ef4444; }
.payout-fireworks--stop span:nth-child(2) { --c: #dc2626; }
.payout-fireworks--stop span:nth-child(3) { --c: #f97316; }
.payout-fireworks--stop span:nth-child(4) { --c: #b91c1c; }
.payout-fireworks--stop span:nth-child(5) { --c: #ea580c; }
.payout-fireworks--stop span:nth-child(6) { --c: #ef4444; }
.payout-fireworks--stop span:nth-child(7) { --c: #dc2626; }
.payout-fireworks--stop span:nth-child(8) { --c: #f97316; }
.payout-fireworks--stop span:nth-child(9) { --c: #b91c1c; }
.payout-fireworks--stop span:nth-child(10) { --c: #ea580c; }
.payout-fireworks--stop span:nth-child(11) { --c: #ef4444; }
.payout-fireworks--stop span:nth-child(12) { --c: #dc2626; }

.payout-fireworks span:nth-child(1) { animation-delay: 0s; }
.payout-fireworks span:nth-child(2) { animation-delay: 0.05s; }
.payout-fireworks span:nth-child(3) { animation-delay: 0.1s; }
.payout-fireworks span:nth-child(4) { animation-delay: 0.15s; }
.payout-fireworks span:nth-child(5) { animation-delay: 0.2s; }
.payout-fireworks span:nth-child(6) { animation-delay: 0.25s; }
.payout-fireworks span:nth-child(7) { animation-delay: 0.3s; }
.payout-fireworks span:nth-child(8) { animation-delay: 0.35s; }
.payout-fireworks span:nth-child(9) { animation-delay: 0.4s; }
.payout-fireworks span:nth-child(10) { animation-delay: 0.45s; }
.payout-fireworks span:nth-child(11) { animation-delay: 0.5s; }
.payout-fireworks span:nth-child(12) { animation-delay: 0.55s; }

@keyframes firework-burst {
  0% {
    transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(1);
    opacity: 1;
    background: var(--c);
  }
  100% {
    transform: translate(-50%, -50%) rotate(var(--a)) translateY(-180px) scale(0);
    opacity: 0;
    background: var(--c);
  }
}

.payout-back {
  margin-top: 20px;
  text-align: center;
}

.payout-back a {
  color: var(--text-muted);
  text-decoration: none;
}

.payout-back a:hover {
  color: var(--accent);
}

/* --- Blackjack self-draw --- */
.self-draw-main {
  display: flex;
  min-height: calc(100vh - 70px);
  padding: 20px;
}

@supports (height: 100dvh) {
  .self-draw-main {
    min-height: calc(100dvh - 70px);
  }
}

.self-draw-main .main-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 500px;
  margin: auto;
}

.self-draw-screen {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  flex: 1;
}

.self-draw-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 24px;
}

.self-draw-cards .card-img {
  margin: 0;
}

.self-draw-error-overlay {
  background: rgba(0, 0, 0, 0.6);
}

.self-draw-error-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.self-draw-error-hand {
  font-size: 5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.self-draw-error-text {
  color: #fff;
}

.self-draw-error-text small {
  color: rgba(255,255,255,0.9);
}

.self-draw-error-hint {
  display: block;
  margin-top: 8px;
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
}

.self-draw-screen {
  position: relative;
}

.self-draw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.self-draw-help-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.self-draw-help-icon {
  width: 28px;
  height: 28px;
}

.self-draw-help-btn:hover .self-draw-help-icon circle {
  fill: #1d4ed8;
}

.self-draw-settings-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: rgba(0,0,0,0.08);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.self-draw-settings-btn:hover {
  background: rgba(0,0,0,0.12);
}

.self-draw-settings-btn .payout-settings-icon {
  width: 24px;
  height: 24px;
}

.self-draw-fuse, .fuse-timer {
  margin: 0;
  width: 100%;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
  overflow: visible;
}

.self-draw-fuse-track, .fuse-timer-track {
  height: 12px;
  background:
    repeating-linear-gradient(
      105deg,
      #1a120c 0px,
      #1a120c 2px,
      #2d1f14 2px,
      #2d1f14 4px
    );
  border-radius: 6px;
  overflow: visible;
  position: relative;
  box-shadow:
    inset 0 2px 2px rgba(255,255,255,0.04),
    inset 0 -2px 2px rgba(0,0,0,0.5),
    0 3px 6px rgba(0,0,0,0.25);
}

.self-draw-fuse-burn, .fuse-timer-burn {
  height: 100%;
  width: 100%;
  background:
    repeating-linear-gradient(
      -75deg,
      #5a3a1a 0px,
      #5a3a1a 1px,
      #7a5228 1px,
      #7a5228 3px
    ),
    linear-gradient(to right, #4a3018 0%, #8b5a2b 25%, #b87333 55%, #c45a2a 85%, #a04020 100%);
  border-radius: 6px;
  position: relative;
  min-width: 0;
  overflow: visible;
  box-shadow:
    inset 0 1px 0 rgba(255,220,180,0.2),
    inset 0 -1px 0 rgba(0,0,0,0.25),
    0 0 0 1px rgba(0,0,0,0.1);
}

.self-draw-fuse-flame, .fuse-timer-flame {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(50%, -50%);
  width: 24px;
  height: 30px;
  background: radial-gradient(ellipse 55% 75% at 50% 65%, #ffb347 0%, #ff8c42 20%, #ff5722 45%, #e65100 65%, #bf360c 80%, transparent 90%);
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  box-shadow:
    0 0 18px #ff8c42,
    0 0 30px #ff5722,
    0 0 45px rgba(255,87,34,0.6);
  animation: self-draw-flame-flicker 0.12s ease-in-out infinite alternate;
  overflow: visible;
}

.self-draw-spark, .fuse-timer-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, #fff3b0 0%, #ffcc00 30%, #ff9800 60%, transparent 80%);
  border-radius: 50%;
  box-shadow: 0 0 6px #ffcc00, 0 0 10px #ff9800, 0 0 14px rgba(255,152,0,0.6);
  animation: self-draw-spark-fly 0.7s ease-out infinite;
  animation-delay: var(--delay, 0s);
  animation-duration: var(--dur, 0.7s);
  transform-origin: center center;
  pointer-events: none;
}

.self-draw-spark::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: radial-gradient(circle, rgba(255,204,0,0.5) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(2px);
}

@keyframes self-draw-spark-fly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2) translate(0, 0);
  }
  70% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) translate(calc(var(--dx, 0) * 1px), calc(var(--dy, -40) * 1px));
  }
}

@keyframes self-draw-flame-flicker {
  from { opacity: 1; transform: translate(50%, -50%) scale(1); }
  to { opacity: 0.92; transform: translate(50%, -50%) scale(1.08); }
}

/* --- Fuse timer (reusable) --- */
.fuse-timer, .fuse-timer-track, .fuse-timer-burn, .fuse-timer-flame { box-sizing: border-box; }
.fuse-timer { margin: 0; width: 100%; max-width: 300px; margin-left: auto; margin-right: auto; overflow: visible; }
.fuse-timer-track { height: 12px; background: repeating-linear-gradient(105deg,#1a120c 0,#1a120c 2px,#2d1f14 2px,#2d1f14 4px); border-radius: 6px; overflow: visible; position: relative; box-shadow: inset 0 2px 2px rgba(255,255,255,0.04),inset 0 -2px 2px rgba(0,0,0,0.5),0 3px 6px rgba(0,0,0,0.25); }
.fuse-timer-burn { height: 100%; width: 100%; background: repeating-linear-gradient(-75deg,#5a3a1a 0,#5a3a1a 1px,#7a5228 1px,#7a5228 3px),linear-gradient(to right,#4a3018 0%,#8b5a2b 25%,#b87333 55%,#c45a2a 85%,#a04020 100%); border-radius: 6px; position: relative; min-width: 0; overflow: visible; box-shadow: inset 0 1px 0 rgba(255,220,180,0.2),inset 0 -1px 0 rgba(0,0,0,0.25),0 0 0 1px rgba(0,0,0,0.1); }
.fuse-timer-flame { position: absolute; right: 0; top: 50%; transform: translate(50%, -50%); width: 24px; height: 30px; background: radial-gradient(ellipse 55% 75% at 50% 65%,#ffb347 0%,#ff8c42 20%,#ff5722 45%,#e65100 65%,#bf360c 80%,transparent 90%); border-radius: 50% 50% 50% 50%/55% 55% 45% 45%; box-shadow: 0 0 18px #ff8c42,0 0 30px #ff5722,0 0 45px rgba(255,87,34,0.6); animation: self-draw-flame-flicker 0.12s ease-in-out infinite alternate; overflow: visible; }
.fuse-timer-spark { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; background: radial-gradient(circle,#fff3b0 0%,#ffcc00 30%,#ff9800 60%,transparent 80%); border-radius: 50%; box-shadow: 0 0 6px #ffcc00,0 0 10px #ff9800,0 0 14px rgba(255,152,0,0.6); animation: self-draw-spark-fly 0.7s ease-out infinite; animation-delay: var(--delay,0s); animation-duration: var(--dur,0.7s); transform-origin: center center; pointer-events: none; }
.fuse-timer-spark::before { content: ''; position: absolute; inset: -2px; background: radial-gradient(circle,rgba(255,204,0,0.5) 0%,transparent 70%); border-radius: 50%; filter: blur(2px); }

/* После истечения времени убираем весь виджет (трек + горящая часть + пламя). Обёртка *-fuse-wrap — чтобы убрать и внешние отступы. Stub: [class*="fuse-fill-stub"]. */
.fuse-timer.fuse-timer--exhausted,
[class*="fuse-fill-stub"].fuse-timer--exhausted,
[class*="-fuse-wrap"].fuse-timer--exhausted,
[id$="-fuse-wrap"].fuse-timer--exhausted {
  opacity: 0 !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  border: none !important;
}
.fuse-timer.fuse-timer--exhausted .fuse-timer-flame,
.fuse-timer.fuse-timer--exhausted .fuse-timer-spark {
  animation: none !important;
}

.self-draw-settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.self-draw-settings-overlay.open {
  opacity: 1;
  visibility: visible;
}

.self-draw-settings-panel {
  background: var(--bg-main);
  border-radius: 12px;
  padding: 24px;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.self-draw-settings-panel h3 {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

.self-draw-settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.self-draw-settings-row label {
  margin: 0;
  cursor: pointer;
}

.self-draw-settings-row input[type="number"] {
  width: 60px;
  padding: 6px 10px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.self-draw-settings-panel label {
  display: block;
  margin-bottom: 12px;
  cursor: pointer;
}

.self-draw-timer-input-wrap {
  margin: 12px 0 20px;
}

.self-draw-timer-input-wrap label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.self-draw-timer-input-wrap input {
  width: 100%;
  max-width: 120px;
  padding: 8px 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.self-draw-settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.self-draw-actions {
  display: flex;
  gap: 24px;
  margin-top: auto;
  padding-top: 32px;
  padding-bottom: env(safe-area-inset-bottom, 24px);
  flex-wrap: wrap;
  justify-content: center;
}

.self-draw-screen {
  position: relative;
}

.self-draw-settings-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.self-draw-settings-btn:hover {
  opacity: 1;
}

.self-draw-settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.self-draw-settings-overlay.open {
  opacity: 1;
  visibility: visible;
}

.self-draw-settings-panel {
  background: var(--bg-main);
  padding: 24px;
  border-radius: 12px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.self-draw-settings-panel h3 {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

.self-draw-settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.self-draw-settings-row label {
  margin: 0;
  cursor: pointer;
}

.self-draw-settings-row input[type="number"] {
  width: 60px;
  padding: 6px 10px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.self-draw-settings-panel label {
  display: block;
  margin-bottom: 12px;
  cursor: pointer;
}

.self-draw-timer-input-wrap {
  margin: 12px 0 20px;
}

.self-draw-timer-input-wrap label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.self-draw-timer-input-wrap input {
  width: 80px;
  padding: 8px 12px;
  font-size: 1rem;
  border: 1px solid var(--border, #333);
  border-radius: 6px;
  background: var(--bg-card);
}

.self-draw-settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

@media (max-width: 480px) {
  .self-draw-actions {
    position: static;
    margin: 0;
    padding: 20px 0 calc(24px + env(safe-area-inset-bottom, 0px));
    background: transparent;
  }
  .self-draw-screen {
    padding-bottom: 0;
  }
}

.btn-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-circle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.btn-circle:active {
  transform: scale(0.98);
}

.btn-hit {
  background: #166534;
}

.btn-hit:hover {
  background: #15803d;
}

.btn-stand {
  background: #b91c1c;
}

.btn-stand:hover {
  background: #991b1b;
}

/* --- Кнопки --- */
.btn {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

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

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

/* --- Сообщение (результат проверки) --- */
.message {
  margin: 18px 0;
  font-size: 1.05rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.message.success {
  color: var(--success);
  background: rgba(13, 107, 13, 0.08);
  border: 1px solid rgba(13, 107, 13, 0.25);
}

.message.error {
  color: var(--error);
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.25);
}

/* --- Страница индекса покера --- */
.page-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.page-links a {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 12px 18px;
  background: rgba(45, 90, 39, 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(45, 90, 39, 0.2);
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
}

.page-links a:hover {
  background: rgba(45, 90, 39, 0.14);
  border-color: var(--accent);
}

/* --- AR: хаб (как BJ / Poker) --- */
.ar-hub .auth-shell__title {
  margin-bottom: 1.1rem;
}

.ar-hub__nav {
  margin: 0 0 0.25rem;
}

.ar-hub__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 520px;
  margin: 0 auto;
}

.ar-hub__tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-top: 3px solid #0f766e;
  box-shadow: 0 2px 10px rgba(15, 118, 110, 0.12);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.ar-hub__tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.2);
  color: var(--text);
  border-color: rgba(15, 118, 110, 0.28);
}

.ar-hub__tile-img {
  width: 100%;
  aspect-ratio: 1;
  max-height: 180px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.ar-hub__tile-img--bets { background-color: #1e3a5f; }
.ar-hub__tile-img--color { background-color: #a83255; }
.ar-hub__tile-img--payout { background-color: #2d5a3d; }
.ar-hub__tile-img--neighbors { background-color: #1e3a5f; }
.ar-hub__tile-img--mix { background-color: #5a3d7a; }

.ar-hub__tile-label {
  padding: 11px 8px;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  color: #0f172a;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.07) 0%, rgba(255, 255, 255, 0.5) 100%);
}

@media (min-width: 480px) {
  .ar-hub__tile-img {
    max-height: 200px;
  }
}

@media (min-width: 600px) {
  .ar-hub__grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 960px;
    gap: 18px;
  }
}

.ar-content {
  padding-top: 0;
}

/* --- AR canvas --- */
.ar-canvas-wrap {
  margin: 16px 0 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #1a1a1a;
  overflow: hidden;
  width: 100%;
  height: 66vh;
  min-height: 200px;
  max-height: 560px;
  position: relative;
}

.ar-settings-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5) !important;
  color: #fff !important;
}

.ar-settings-btn:hover {
  background: rgba(0, 0, 0, 0.7) !important;
  color: #fff !important;
}

.ar-camera-reset-btn {
  right: auto;
  left: 12px;
}

.ar-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.ar-canvas-hint {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Подсказка: можно крутить поле рулетки */
.ar-rotate-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.6);
  border-radius: 24px;
  pointer-events: none;
  animation: ar-rotate-hint-pulse 2.5s ease-in-out infinite;
}
.ar-rotate-hint.ar-rotate-hint--hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}
.ar-rotate-hint__icon {
  font-size: 1.2rem;
  line-height: 1;
}
.ar-rotate-hint__arrows {
  font-size: 1rem;
  opacity: 0.9;
}
.ar-rotate-hint__text {
  white-space: nowrap;
}
@keyframes ar-rotate-hint-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* PTC: на мобилке таблица не съезжает на клавиатуру */
@media (max-width: 600px) {
  .payout-page--ptc {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .payout-page--ptc .payout-header {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
    margin-bottom: 12px;
    background: var(--bg-main, #fff);
    padding-bottom: 8px;
  }
  .payout-page--ptc .payout-form {
    padding-top: 0;
    flex-shrink: 0;
  }
  .payout-page--ptc .payout-ptc-question {
    margin: 4px 0 4px;
    flex-shrink: 0;
  }
  .payout-page--ptc .payout-ptc-table th,
  .payout-page--ptc .payout-ptc-table td {
    padding: 6px 12px;
    font-size: 1.1rem;
  }
}

/* --- Страницы входа / регистрации --- */
main.auth-main .main-card {
  max-width: 440px;
  margin: 28px auto 48px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

/* Главная (стихи): та же схема, что у чаевых, но шире под текст */
main.auth-main--wide .main-card {
  max-width: 640px;
}

main.auth-main--ar-hub .main-card {
  max-width: 980px;
}

.home-index__lead {
  margin-bottom: 1.25rem;
}

.auth-shell {
  background: linear-gradient(165deg, #ffffff 0%, #f0f7ff 45%, #e8f0fc 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-strong);
  padding: 2rem 1.75rem 1.75rem;
  position: relative;
  overflow: hidden;
}

.auth-shell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1e3a5f, var(--accent), #0d9488);
  border-radius: calc(var(--radius) + 4px) calc(var(--radius) + 4px) 0 0;
}

.auth-shell__title {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.auth-shell__lead {
  margin: 0 0 1.35rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* --- BJ: страница раздела (хаб), плитки как AR, стиль shell + зелёный акцент --- */
.bj-hub .auth-shell__title {
  margin-bottom: 1.1rem;
}

.bj-hub__nav {
  margin: 0 0 0.25rem;
}

.bj-hub__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 440px;
  margin: 0 auto;
}

.bj-hub__tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-top: 3px solid #1a472a;
  box-shadow: 0 2px 10px rgba(26, 71, 42, 0.12);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.bj-hub__tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(26, 71, 42, 0.2);
  color: var(--text);
  border-color: rgba(26, 71, 42, 0.28);
}

.bj-hub__tile-img {
  width: 100%;
  aspect-ratio: 1;
  max-height: 180px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.bj-hub__tile-label {
  padding: 11px 8px;
  font-size: 0.98rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  color: #0f172a;
  background: linear-gradient(180deg, rgba(26, 71, 42, 0.06) 0%, rgba(255, 255, 255, 0.5) 100%);
}

@media (min-width: 480px) {
  .bj-hub__tile-img {
    max-height: 200px;
  }

  .bj-hub__grid {
    gap: 18px;
    max-width: 480px;
  }
}

/* --- Poker: хаб (как BJ) --- */
.poker-hub .auth-shell__title {
  margin-bottom: 1.1rem;
}

.poker-hub__nav {
  margin: 0 0 0.25rem;
}

.poker-hub__section {
  margin: 0 0 1.5rem;
}

.poker-hub__section:last-child {
  margin-bottom: 0;
}

.poker-hub__section-title {
  margin: 0 0 0.7rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: #8b2942;
  letter-spacing: -0.02em;
}

.poker-hub__section-title--holdem {
  color: #6b2340;
}

.poker-hub__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 480px;
  margin: 0 auto;
}

.poker-hub__tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-top: 3px solid #8b2942;
  box-shadow: 0 2px 10px rgba(139, 41, 66, 0.14);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.poker-hub__tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(139, 41, 66, 0.22);
  color: var(--text);
  border-color: rgba(139, 41, 66, 0.3);
}

.poker-hub__tile--holdem {
  border-top-color: #6b2340;
  box-shadow: 0 2px 10px rgba(107, 35, 64, 0.14);
}

.poker-hub__tile--holdem:hover {
  box-shadow: 0 6px 18px rgba(107, 35, 64, 0.2);
  border-color: rgba(107, 35, 64, 0.28);
}

.poker-hub__tile-img {
  width: 100%;
  aspect-ratio: 1;
  max-height: 180px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.poker-hub__tile-label {
  padding: 11px 8px;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  color: #0f172a;
  background: linear-gradient(180deg, rgba(139, 41, 66, 0.07) 0%, rgba(255, 255, 255, 0.5) 100%);
}

.poker-hub__tile-label--holdem {
  background: linear-gradient(180deg, rgba(107, 35, 64, 0.08) 0%, rgba(255, 255, 255, 0.5) 100%);
}

@media (min-width: 480px) {
  .poker-hub__tile-img {
    max-height: 200px;
  }

  .poker-hub__grid {
    gap: 18px;
    max-width: 520px;
  }
}

.authors-entries {
  margin: 1rem 0 1.35rem;
}

.authors-entry {
  margin-bottom: 1.15rem;
}

.authors-entry:last-child {
  margin-bottom: 0;
}

.authors-entry__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.authors-entry__tag {
  font-weight: 600;
  color: var(--text-muted);
}

.authors-entry__list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.55;
}

.authors-entry__list li {
  margin-bottom: 0.35rem;
}

.authors-entry__roles {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.authors-thanks {
  margin-top: 1.75rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}

.authors-thanks__title {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--bg-header);
}

.authors-thanks__text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-field {
  margin-bottom: 1.1rem;
}

.auth-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}

.auth-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.auth-field .helptext,
.auth-field + .helptext {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.auth-errors {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #991b1b;
  font-size: 0.88rem;
}

.auth-errors li {
  margin: 0.2rem 0;
}

.auth-nonfield {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #991b1b;
  font-size: 0.88rem;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, var(--accent-hover) 0%, var(--accent) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  transition: transform 0.12s, box-shadow 0.12s;
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.auth-footer {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.auth-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-footer.ar-exercise-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  text-align: initial;
}

.auth-banner {
  margin: 0 0 1.15rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.4;
}

.auth-banner--ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.auth-icon-mail {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
}

.auth-icon-warn {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #fee2e2, #ffedd5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
}

/* --- Подвал (как шапка: тёмно-синий) --- */
.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 18px 20px 24px;
  background: linear-gradient(180deg, #1e3a5f 0%, #1a3658 100%);
  color: #e2e8f0;
  box-shadow: 0 -4px 20px rgba(30, 58, 95, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer__inner {
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}

.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  font-size: 0.88rem;
}

.site-footer__link {
  color: #e2e8f0;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.site-footer__link:hover {
  color: #fff;
  background: rgba(59, 130, 246, 0.45);
  border-color: rgba(147, 197, 253, 0.9);
}

.site-footer__sep {
  color: rgba(148, 163, 184, 0.7);
  user-select: none;
}

@media (max-width: 760px) {
  .site-footer {
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
    padding-top: 16px;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  }

  .site-footer__link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
  }

  .site-footer__row {
    flex-direction: column;
    gap: 10px;
  }

  .site-footer__sep {
    display: none;
  }

  /* Не перекрывать подвал фиксированной кнопкой «вверх» */
  .back-to-top {
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Инфо-страницы: тот же фон и стеклянные панели, что у чаевых */
.site-shell {
  --shell-spot-teal-dim: rgba(13, 148, 136, 0.14);
  --shell-spot-warm: rgba(180, 83, 9, 0.1);
}

@media (prefers-reduced-motion: no-preference) {
  .site-shell {
    background:
      radial-gradient(ellipse 120% 80% at 100% 0%, var(--shell-spot-teal-dim) 0%, transparent 55%),
      radial-gradient(ellipse 90% 60% at 0% 100%, var(--shell-spot-warm) 0%, transparent 50%),
      linear-gradient(165deg, #ffffff 0%, #f0f7ff 45%, #e8f0fc 100%);
  }
}

.site-shell .auth-shell__title {
  text-align: center;
  color: #0f172a;
}

.site-shell .auth-shell__lead {
  text-align: center;
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
}

.site-shell .sop-quiz__lead,
.site-shell .sop-quiz__public-text {
  text-align: center;
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
}

.site-shell .tip-thanks__note {
  text-align: center;
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
  margin-top: 1rem;
}

.site-shell__panel {
  margin-top: 0.85rem;
  padding: 1.25rem 1.35rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid rgba(30, 58, 95, 0.12);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(30, 58, 95, 0.07);
  border-left: 4px solid rgba(37, 99, 235, 0.35);
}

.site-shell__panel--narrow {
  max-width: 26rem;
  margin-left: auto;
  margin-right: auto;
}

.site-shell__panel--wide {
  max-width: 100%;
}

.site-shell__panel .auth-shell__title {
  margin-top: 0;
}

.site-shell__footer {
  margin-top: 1.75rem;
}

.site-shell__footer--tight {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: none;
}

.site-shell .tip-thanks__quote {
  margin: 0;
}

.site-shell__panel > .authors-entries:first-child {
  margin-top: 0.35rem;
}

/* Чаевые: блоки СБП / онлайн */
.chaevye-methods {
  --chaevye-teal: #0d9488;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 26rem;
  margin: 0.25rem auto 0;
}

.chaevye-panel {
  position: relative;
  padding: 1.25rem 1.35rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid rgba(30, 58, 95, 0.12);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(30, 58, 95, 0.07);
}

.chaevye-panel--sbp {
  border-left: 4px solid var(--chaevye-teal);
}

.chaevye-panel--online {
  border-left: 4px solid var(--accent);
}

.chaevye-panel__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.chaevye-panel__head--plain {
  margin-bottom: 0.5rem;
}

.chaevye-panel__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--chaevye-teal) 0%, #0f766e 100%);
  box-shadow: 0 1px 4px rgba(13, 148, 136, 0.35);
}

.chaevye-panel__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.chaevye-panel__hint {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.chaevye-panel__text {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.chaevye-panel__action {
  display: flex;
  justify-content: center;
}

.chaevye-phone {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.chaevye-phone:hover {
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 4px 14px rgba(13, 148, 136, 0.12);
  transform: translateY(-1px);
  color: inherit;
}

.chaevye-phone:focus-visible {
  outline: 2px solid var(--chaevye-teal);
  outline-offset: 2px;
}

.chaevye-phone__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chaevye-phone__num {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--chaevye-teal);
  line-height: 1.2;
}

.chaevye-banks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
}

.chaevye-bank-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(30, 58, 95, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8125rem;
}

.chaevye-or {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.65rem 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chaevye-or span {
  padding: 0 0.75rem;
  position: relative;
}

.chaevye-or span::before,
.chaevye-or span::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 3.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border));
}

.chaevye-or span::before {
  right: 100%;
  margin-right: 0.25rem;
  background: linear-gradient(90deg, transparent, var(--border));
}

.chaevye-or span::after {
  left: 100%;
  margin-left: 0.25rem;
  background: linear-gradient(90deg, var(--border), transparent);
}

.chaevye-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.chaevye-btn--platform {
  background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.chaevye-btn--platform:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  color: #fff;
}

.chaevye-btn--platform:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Чаевые / благодарность (страница «Спасибо») */

.tip-thanks__quote {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--bg-header);
  text-align: center;
}

.tip-thanks__note {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- Тесты СОП (Boomerang) --- */
.sop-quiz__lead {
  color: var(--text-muted);
  max-width: 42rem;
}

.sop-quiz__public-text {
  max-width: 40rem;
}

.sop-quiz__public-actions {
  margin-top: 1rem;
}

.sop-quiz__back {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.sop-quiz__back a {
  color: var(--accent);
}

.sop-quiz__test-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.sop-quiz__test-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.sop-quiz__test-link {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.sop-quiz__test-link:hover {
  text-decoration: underline;
}

.sop-quiz__test-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sop-quiz__progress {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.sop-quiz__question {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 1.25rem;
}

.sop-quiz__options {
  border: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.sop-quiz__option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.sop-quiz__option:hover {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.04);
}

.sop-quiz__option input {
  margin-top: 4px;
  flex-shrink: 0;
}

.sop-quiz__options--revealed {
  margin-bottom: 1rem;
}

.sop-quiz__option--static {
  cursor: default;
}

.sop-quiz__option--static:hover {
  border-color: var(--border);
  background: transparent;
}

.sop-quiz__option.sop-quiz__option--wrong {
  border: 2px solid var(--error);
  background: rgba(220, 38, 38, 0.18);
  box-shadow: inset 4px 0 0 var(--error);
  color: #991b1b;
  font-weight: 600;
}

.sop-quiz__option.sop-quiz__option--correct {
  border: 2px solid #16a34a;
  background: rgba(22, 163, 74, 0.18);
  box-shadow: inset 4px 0 0 #16a34a;
  color: #166534;
  font-weight: 600;
}

.sop-quiz__option.sop-quiz__option--wrong:hover,
.sop-quiz__option.sop-quiz__option--correct:hover {
  border-color: inherit;
  background: inherit;
}

.sop-quiz__feedback-note {
  margin: 0 0 1rem;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #991b1b;
  font-weight: 600;
}

.sop-quiz__form--next {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.sop-quiz__next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, background 0.15s;
}

.sop-quiz__next:hover {
  transform: translateX(2px);
  filter: brightness(1.05);
}

.sop-quiz__next-icon {
  display: block;
}

.sop-quiz__score {
  font-size: 1.1rem;
  margin: 0 0 1.25rem;
}

.sop-quiz__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.sop-quiz__mistakes {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.sop-quiz__mistake {
  margin-bottom: 1.25rem;
  padding: 12px 14px;
  border-left: 4px solid var(--error);
  background: rgba(220, 38, 38, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.sop-quiz__mistake-q {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.sop-quiz__mistake-wrong {
  margin: 0.35rem 0;
  font-size: 0.95rem;
  color: var(--error);
}

.sop-quiz__mistake-right {
  margin: 0.35rem 0;
  font-size: 0.95rem;
  color: var(--success);
}
