:root {
  --bg: #040404;
  --panel: #111114;
  --text: #fff;
  --muted: #a9a9ad;
  --red: #ff0000;
  --red2: #cb0000;
  --green: #2a5934;
  --green-light: #3e8a4d;
  --line: rgba(255, 255, 255, 0.115);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-top: 80px;
}

.app {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Утилиты */
.text-red {
  color: var(--red);
}
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.mb-2 {
  margin-bottom: 12px;
}
.mb-4 {
  margin-bottom: 24px;
}
.mt-4 {
  margin-top: 24px;
}
.w-100 {
  width: 100%;
}

/* Шапка (Topbar) */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(180deg, #242428 0%, #0b0b0d 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 1000;
}
.topbar-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  height: 40px;
  width: auto;
  display: block;
}
.brand-suffix {
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}

/* Кнопки */
.btn {
  border: 1px solid var(--line);
  color: #fff;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  transition: 0.2s;
}
.btn.primary {
  background: linear-gradient(135deg, var(--red), var(--red2));
  border-color: transparent;
}
.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
/* Экраны */
.screen {
  display: none;
  animation: fadeIn 0.3s;
}
.screen.active {
  display: block;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Карточки и панели */
.hero-card,
.panel,
.modal-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(
    180deg,
    rgba(19, 19, 22, 0.92),
    rgba(7, 7, 8, 0.92)
  );
  padding: 30px;
}

/* Меню режимов (Landing) */
.mode-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.invest-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  padding: 16px 20px;
  border-radius: 16px;
  cursor: pointer;
  transition: 0.2s;
}
.row-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  width: 100%;
}
.row-info b {
  font-size: 16px;
}
.row-info span {
  font-size: 13px;
  color: var(--muted);
}
.row-action {
  margin-left: 16px;
}
.question-count-select {
  background: #080809 !important;
  color: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  padding: 4px 8px !important;
  font-size: 13px !important;
  min-width: 50px;
}

/* Интерфейс Игры */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 10px;
}
.progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.progress-wrapper .eyebrow {
  font-size: 18px;
  font-weight: 700;
}
.progress-bar-track {
  height: 4px;
  width: 80px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}
.progress-bar-red {
  height: 100%;
  width: 0%;
  background: #ff0000;
  transition: width 0.3s;
}
.badge-pill {
  background: #2a2a2c;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge-pill.has-dot::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff0000;
}

.question-header-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 15px;
}
.question-mark-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4d0000 0%, #1a0000 100%);
  border: 1px solid #cc0000;
  color: #ff0000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  flex-shrink: 0;
}
#question-text {
  font-size: 20px;
  margin: 0;
  font-weight: 600;
}

/* Сетка ответов */
.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.answer-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 16px 20px;
  border-radius: 16px;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}
.btn-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* Состояния кнопок (Защита от залипания) */
@media (hover: hover) and (pointer: fine) {
  .invest-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
  }
  .btn:hover {
    transform: translateY(-2px);
  }
  .answer-btn:hover:not(.correct):not(.wrong):not(.selected) {
    background: rgba(255, 255, 255, 0.05);
  }
}

.answer-btn:active:not(.correct):not(.wrong):not(.selected) {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.08);
}
.answers-grid .answer-btn.correct {
  background: rgba(42, 187, 85, 0.2) !important;
  border-color: #2abb55 !important;
}
.answers-grid .answer-btn.wrong {
  background: rgba(255, 0, 0, 0.2) !important;
  border-color: var(--red) !important;
}
.answers-grid .answer-btn.selected {
  background: linear-gradient(135deg, #a60000 0%, #ff0000 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 20px rgba(255, 0, 0, 0.3) !important;
}

/* История и Промо */
.history-list {
  max-height: 300px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.3);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  text-align: left;
}
.hist-item {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.hist-q {
  font-weight: 600;
  margin-bottom: 4px;
}
.hist-a.correct {
  color: #55d98b;
}
.hist-a.wrong {
  color: #ff6868;
}

.promo-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.promo-icon {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #7a0000, #ff0000);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.promo-icon img {
  width: 32px;
  height: 32px;
  filter: brightness(0) invert(1);
}
.promo-text b {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}
.promo-text span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.promo-action {
  margin-left: auto;
  flex-shrink: 0;
}

/* Модалки */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active {
  display: flex;
}
.modal-card {
  width: 100%;
  max-width: 360px;
}
input {
  width: 100%;
  background: #080809;
  border: 1px solid var(--line);
  color: #fff;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  outline: none;
}
input:focus {
  border-color: var(--red);
}
.error-text {
  color: #ff6868;
  font-size: 13px;
  display: none;
  margin-bottom: 10px;
}

/* Результаты стола */
.result-table-container {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  border: 1px solid var(--line);
}
.result-board {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 12px;
}
.result-board .card {
  width: 36px;
  height: 52px;
  font-size: 16px;
}
.result-players {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.player-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.player-result-name {
  font-size: 11px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #cc0000;
}
.player-result-cards {
  display: flex;
  gap: 3px;
}
.player-result-cards .card {
  width: 32px;
  height: 46px;
  font-size: 14px;
}
.result-board .card-mini-suit,
.result-board .card-mini-rank,
.player-result-cards .card-mini-suit,
.player-result-cards .card-mini-rank {
  font-size: 12px !important;
}

.result-board .card {
  width: 38px !important;
  height: 54px !important;
}
.result-board .card-top-left {
  top: 2px;
  left: 2px;
}
.result-board .card-rank {
  font-size: 17px;
}
.result-board .card-suit-small {
  font-size: 9px;
}
.result-board .card-suit-large {
  font-size: 26px;
  bottom: 0px;
  right: 2px;
}

/* Стилизация новой верстки карт для рук игроков в истории */
.player-result-cards .card {
  width: 32px !important;
  height: 46px !important;
}
.player-result-cards .card-top-left {
  top: 1px;
  left: 2px;
}
.player-result-cards .card-rank {
  font-size: 14px;
}
.player-result-cards .card-suit-small {
  font-size: 8px;
}
.player-result-cards .card-suit-large {
  font-size: 21px;
  bottom: 0px;
  right: 1px;
}

/* ========================================================================================= */
/* ==================== АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ (FLEXBOX LOCK) ==================== */
/* ========================================================================================= */

@media (max-width: 768px) {
  html,
  body {
    overflow-y: auto !important;
    min-height: 100dvh !important;
  }

  /* Шапка */
  .topbar {
    height: 50px !important;
  }
  .topbar-content {
    padding: 0 10px !important;
    height: 100%;
    align-items: center;
    gap: 8px !important;
  }
  .brand {
    gap: 6px !important;
  }
  .brand-logo {
    height: 22px !important;
  }
  .brand-suffix {
    font-size: 13px !important;
  }
  .nav {
    display: flex !important;
    gap: 4px !important;
  }
  .nav .btn {
    padding: 6px 10px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
  }
  .nav .btn-link {
    display: none;
  }
  /* Обертка приложения: ВЕРХНИЙ ОТСТУП ПОЛНОСТЬЮ УБРАН (0px) */
  .app {
    padding: 0px 10px 6px 10px !important;
    height: calc(100dvh - 50px) !important;
    display: flex;
    flex-direction: column;
  }

  /* Экран игры */
  #screen-game {
    display: flex !important;
    flex-direction: column;
    height: 100% !important;
  }
  #screen-game:not(.active) {
    display: none !important;
  }

  /* Шапка игры (Прогресс-бар). Задаем ТОЧНЫЙ минимальный отступ */
  .game-header {
    margin-top: 6px !important; /* Ровно 6px от черной полосы хедера */
    margin-bottom: 2px !important;
    padding-top: 0 !important;
    gap: 4px !important;
    flex-shrink: 0;
  }

  .progress-wrapper {
    gap: 2px !important;
  }

  .progress-wrapper .eyebrow {
    font-size: 12px !important;
    margin-bottom: 0 !important;
  }

  .badges-wrapper {
    padding-bottom: 0 !important;
  }

  .badge-pill {
    padding: 2px 8px !important;
    font-size: 10px !important;
  }

  /* Панель вопроса: сохранили увеличенный отступ 16px от стола */
  .panel.quiz-panel {
    padding: 0 !important;
    margin-top: 16px !important;
    background: none !important;
    border: none !important;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
  }

  .question-header-wrapper {
    margin-bottom: 8px !important;
    gap: 6px !important;
    justify-content: center;
  }
  .question-mark-icon {
    display: none;
  }
  #question-text {
    font-size: 15px !important;
    margin: 0 !important;
    text-align: center;
  }

  /* Стол - пружина */
  .poker-table-container {
    flex-grow: 1 !important;
    flex-shrink: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 4px 0 !important;
  }

  /* Кнопки ответов (адаптивные по высоте) */
  .answers-grid {
    grid-template-columns: 1fr !important;
    margin-top: 8px !important;
    gap: 6px !important;
    flex-shrink: 0;
  }
  .answer-btn {
    padding: 10px 14px !important;
    font-size: 13px !important;
    border-radius: 12px !important;
    min-height: 44px !important;
    height: auto !important;
    white-space: normal !important;
    line-height: 1.3 !important;
    display: flex;
    align-items: center;
  }
  .btn-icon {
    width: 20px !important;
    height: 20px !important;
  }

  .promo-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
    text-align: center;
  }
  .promo-action {
    width: 100%;
    margin-left: 0;
  }

  /* Адаптация Лендинга */
  .invest-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }
  .row-info > div {
    flex-wrap: wrap;
    margin-top: 6px;
  }
  .row-action {
    margin-left: 0;
  }
  .row-action .btn {
    width: 100%;
    display: block;
    text-align: center;
  }
}

@media (max-width: 400px) {
  .answer-btn {
    min-height: 40px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
  }
  #question-text {
    font-size: 14px !important;
  }
}

/* ==================== СЕЛЕКТОР ИГРЫ (ХОЛДЕМ / ОМАХА) ==================== */
.game-selector-container {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
}

.game-selector-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.game-mode-tabs {
  display: flex;
  gap: 10px;
}

.mode-tab {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mode-tab .tab-icon {
  font-size: 16px;
  opacity: 0.5;
}

.mode-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.mode-tab.active {
  background: linear-gradient(135deg, var(--red2) 0%, #990000 100%);
  color: var(--text);
  border-color: var(--red);
  box-shadow: 0 4px 20px rgba(203, 0, 0, 0.4);
}

.mode-tab.active .tab-icon {
  opacity: 1;
}

/* Мобильная адаптация селектора */
@media (max-width: 480px) {
  .game-mode-tabs {
    flex-direction: column;
    gap: 8px;
  }
  .mode-tab {
    padding: 12px 16px;
    font-size: 14px;
  }
}

.player-result[data-game="omaha"] .player-result-cards {
  gap: 0;
}
.player-result[data-game="omaha"] .player-result-cards .card:not(:first-child) {
  margin-left: -18px;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3);
}

.result-board .card-suit-small {
  font-size: 15px !important;
}

.player-result-cards .card-suit-small {
  font-size: 13px !important;
}

.player-result-cards .card-top-left {
  left: 4px !important;
}

/* CSS-генератор покерных фишек */
.css-chip {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--chip-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    border: 4px dashed rgba(255, 255, 255, 0.6);
    box-shadow: 
        inset 0 0 0 3px var(--chip-color), 
        inset 0 0 0 5px rgba(255, 255, 255, 0.15), 
        0 4px 6px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

/* ==================== УЛУЧШЕНИЯ ДЛЯ СПРАВОЧНИКА ==================== */
.mode-tabs {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  gap: 10px;
  padding-bottom: 4px;
}
.mode-tabs::-webkit-scrollbar {
  display: none;
}
.mode-tab {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Стилизация текстового блока турнира */
.rules-step {
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.rules-step h4 {
  color: var(--red2);
  margin-bottom: 8px;
  font-size: 15px;
}
.rules-step p {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.rules-step ul {
  padding-left: 20px;
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.5;
  color: var(--text);
}
.rules-step li {
  margin-bottom: 6px;
  color: var(--muted);
}
.rules-step li b {
  color: var(--text);
}

/* Скрытие текста кнопок меню на узких экранах */
@media (max-width: 768px) {
  .btn-text-hide-mob {
    display: none;
  }
}

/* ==================== АДАПТИВНОСТЬ ШАПКИ ДЛЯ МОБИЛЬНЫХ ==================== */
@media (max-width: 768px) {
  /* Снимаем жесткую фиксацию высоты у шапки, чтобы она могла растягиваться */
  .topbar {
    height: auto !important;
    min-height: 50px;
    padding-bottom: 8px;
  }
  
  /* Разрешаем элементам шапки переноситься на новую строку */
  .topbar-content {
    flex-wrap: wrap !important;
    justify-content: center !important;
    padding-top: 10px !important;
    gap: 12px !important;
  }

  /* Логотип по центру сверху */
  .brand {
    margin-bottom: 4px;
    width: 100%;
    justify-content: center !important;
  }

  /* Блок с кнопками снизу под логотипом */
  .nav {
    width: 100%;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  /* Чтобы основной контент не заезжал под увеличенную шапку */
  body {
    padding-top: 100px !important;
  }
  .app {
    height: calc(100dvh - 100px) !important;
  }
}

/* ==================== ТАБЫ FAQ В ДВА РЯДА НА МОБИЛЬНЫХ ==================== */
@media (max-width: 768px) {
  /* Оптимизируем отступы панели для мобильных */
  #screen-faq .panel {
    padding: 16px !important;
    border-radius: 16px !important;
  }

  /* Разрешаем перенос кнопок на новые строки */
  #screen-faq .mode-tabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important; /* Включаем перенос */
    gap: 8px !important; /* Расстояние между кнопками */
    width: 100% !important;
    padding-bottom: 0 !important;
    margin-bottom: 16px !important;
  }

  /* Делаем так, чтобы кнопки делили экран ровно 2 на 2 */
  #screen-faq .mode-tabs .mode-tab {
    flex: 1 1 calc(50% - 4px) !important; /* Каждая кнопка занимает ровно половину ширины */
    min-width: calc(50% - 4px) !important;
    max-width: calc(50% - 4px) !important;
    padding: 10px 6px !important; /* Компактные отступы для исключения переноса текста внутри кнопки */
    font-size: 13px !important;
    border-radius: 10px !important;
    text-align: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }
}

.card.dimmed {
  opacity: 0.25 !important;
  filter: grayscale(0.6) !important;
}

/* ===== ЭНЦИКЛОПЕДИЯ ===== */
.encyclopedia-term-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s;
  font-weight: 500;
}

.encyclopedia-term-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.encyclopedia-term-btn.active {
  background: rgba(255, 0, 0, 0.15);
  border-color: var(--red);
  color: #fff;
}

.encyclopedia-term-btn .badge {
  font-size: 10px;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.encyclopedia-term-btn .badge.holdem { border-color: #4a9eff; color: #4a9eff; }
.encyclopedia-term-btn .badge.omaha { border-color: #ff9f4a; color: #ff9f4a; }
.encyclopedia-term-btn .badge.both { border-color: #a9a9ad; color: #a9a9ad; }

/* Карточка термина */
.term-detail-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  animation: fadeIn 0.3s;
}

.term-detail-card .term-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffeb3b;
}

.term-detail-card .term-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
  font-style: italic;
}

.term-detail-card .term-definition {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border-left: 3px solid var(--red);
}

.term-detail-card .term-example {
  font-size: 15px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.term-detail-card .term-example .label {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.term-detail-card .term-infographic {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid var(--line);
}

.term-detail-card .term-infographic .item {
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
}

.term-detail-card .term-infographic .item strong {
  color: #ffeb3b;
}

.term-detail-card .term-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.term-detail-card .term-tag {
  font-size: 11px;
  padding: 4px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
}

.term-detail-card .term-tag.holdem { border-color: #4a9eff; color: #4a9eff; }
.term-detail-card .term-tag.omaha { border-color: #ff9f4a; color: #ff9f4a; }
.term-detail-card .term-tag.both { border-color: #a9a9ad; color: #a9a9ad; }

/* Адаптация для мобильных */
@media (max-width: 768px) {
  #encyclopedia-term-list {
    flex: 0 0 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--line);
    padding-right: 0 !important;
    padding-bottom: 12px !important;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  #encyclopedia-term-list .encyclopedia-term-btn {
    flex: 1 0 calc(50% - 4px);
    font-size: 12px;
    padding: 6px 10px;
  }
  .term-detail-card .term-title { font-size: 20px; }
}

/* ==================== НОВЫЕ СТИЛИ СПРАВОЧНИКА (ОБНОВЛЕННЫЕ) ==================== */

/* Заставляем табы переноситься и заполнять ширину */
.mode-tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px;
  overflow-x: visible !important;
  padding-bottom: 0 !important;
}
.mode-tabs::-webkit-scrollbar {
  display: none;
}
.mode-tab {
  flex: 1 1 calc(33.333% - 10px);
  white-space: nowrap;
  justify-content: center;
  min-width: 110px;
}

.faq-section-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.red-bullets {
  list-style: none;
  padding-left: 0;
}
.red-bullets li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}
.red-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 6px;
  height: 6px;
  background-color: var(--red);
}

.red-callout {
  background: var(--red);
  color: #fff;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.4;
}

/* Обновленный Таймлайн раздачи (переносится, карты крупные) */
.flow-timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap; /* Перенос на узких экранах */
  padding-bottom: 10px;
}
.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: auto;
  min-width: 90px;
}
.flow-num {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}
.flow-cards {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  justify-content: center;
  transform: scale(0.85); /* Масштаб как в Омахе */
  transform-origin: center;
}
.flow-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}
.flow-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}
.flow-arrow {
  color: var(--muted);
  font-size: 18px;
  font-weight: bold;
}

/* Список комбинаций (убрана жесткая ширина, нормальный масштаб) */
.combinations-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.combo-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.combo-cards {
  display: flex;
  gap: 4px;
  transform: scale(0.9);
  transform-origin: left;
  flex-shrink: 0;
  /* width: 140px; - УДАЛЕНО для нормального размера */
}
.combo-info {
  display: flex;
  flex-direction: column;
}
.combo-name {
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
}
.combo-desc {
  font-size: 12px;
  color: var(--muted);
}

/* Сетка действий (С иллюстрациями) */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.action-card {
  background: #fff;
  color: #000;
  border-radius: 12px;
  padding: 20px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 260px;
  overflow: visible; /* ВАЖНО: чтобы стрелки не обрезались границами карточки */
}
.action-title {
  color: var(--red);
  font-weight: 900;
  font-size: 24px;
  margin-bottom: 8px;
}
.action-desc {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  color: #222;
  margin-bottom: 20px;
}

/* Контейнер для иллюстраций */
.action-ill {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-top: auto;
  height: 110px;
  overflow: visible;
  padding-bottom: 8px;
}

/* Для CALL и RAISE */
.action-card:nth-child(3) .action-ill,
.action-card:nth-child(4) .action-ill {
  height: 140px;
}

/* CSS-Карты для FOLD (увеличенные) */
.ill-cards {
  position: relative;
  width: 50px;
  height: 56px;
  overflow: visible;
}
.ill-card {
  position: absolute;
  width: 34px;
  height: 48px;
  background: repeating-linear-gradient(45deg, #cc0000, #cc0000 3px, #fff 3px, #fff 6px);
  border: 2px solid #fff;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}
.ill-card.c1 {
  transform: rotate(-15deg);
  left: 0;
  top: 8px;
  z-index: 1;
}
.ill-card.c2 {
  transform: rotate(10deg);
  left: 16px;
  top: 0;
  z-index: 2;
}

/* Знак РАВНО для CALL */
.ill-equals {
  font-size: 38px;
  font-weight: 900;
  color: #cc0000;
  line-height: 1;
  margin: 0 8px;
}

/* ==================== АДАПТИВНОСТЬ ДЛЯ СПРАВОЧНИКА ==================== */
@media (max-width: 992px) {
  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 600px) {
  /* Исправление для сетки действий (уменьшение отступов и масштаба графики) */
  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .action-card {
    padding: 16px 8px;
    min-height: 200px;
    min-width: 0; /* ВАЖНО: Избавляет от распирания сетки на узких экранах */
  }
  .action-title {
    font-size: 20px;
  }
  .action-desc {
    font-size: 12px;
    margin-bottom: 12px;
  }
  .action-ill {
    transform: scale(0.75); /* Пропорционально масштабируем графику */
    transform-origin: bottom center;
    width: 100%;
  }

  /* Сетка Стратегии */
  .zones-grid {
    grid-template-columns: 1fr;
  }

  /* Исправление для вкладки "Комбинации" */
  .combo-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .combo-info {
    margin-top: 0;
  }

  /* Исправление для вкладки "Памятка" (Таймлайн) */
  .flow-arrow {
    display: none;
  }
  .flow-step {
    width: 100%;
    margin-bottom: 24px;
    align-items: center;
  }
}

@media (max-width: 400px) {
  /* Дополнительное сжатие графики на очень узких экранах (iPhone SE и т.д.) */
  .action-ill {
    transform: scale(0.65);
  }
}

/* Новая инфографика для Стратегии */
.zones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.zone-card {
  background: #fff;
  color: #000;
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
}
.zone-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 24px;
  font-weight: 900;
}
.zone-icon.green { background: rgba(42, 187, 85, 0.15); color: #2abb55; }
.zone-icon.yellow { background: rgba(255, 235, 59, 0.25); color: #d4c000; }
.zone-icon.red { background: rgba(255, 0, 0, 0.1); color: #ff0000; }

.zone-title {
  font-size: 17px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.zone-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
  border-bottom: 2px dashed #eee;
  padding-bottom: 12px;
}
.zone-hands {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 16px;
}
.hand-tag {
  border: 1px solid #ddd;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 13px;
}
.hand-tag.green { border-color: #2abb55; background: #eaffef; color: #1a8a3a; }
.hand-tag.yellow { border-color: #ffeb3b; background: #fffde7; color: #b09f00; }
.hand-tag.red { border-color: #ff0000; background: #ffebee; color: #c60000; }

.zone-text {
  font-size: 13px;
  font-weight: 700;
  color: #444;
  line-height: 1.4;
  margin-top: auto; /* Прижимаем к низу, если карточки разной высоты */
}

/* Адаптивность */
@media (max-width: 768px) {
  #screen-faq .mode-tabs .mode-tab {
    flex: 1 1 calc(50% - 10px) !important;
  }
}

@media (max-width: 600px) {
  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .action-card {
    padding: 16px 8px;
    min-height: 200px;
    min-width: 0; 
  }
  .action-title {
    font-size: 20px;
  }
  .action-desc {
    font-size: 12px;
    margin-bottom: 12px;
  }
  .action-ill {
    /* Было 0.75, теперь 0.95 - иллюстрации на мобилках будут крупнее */
    transform: scale(0.95); 
    transform-origin: bottom center;
    width: 100%;
  }

  .zones-grid {
    grid-template-columns: 1fr;
  }

  .combo-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .combo-info {
    margin-top: 0;
  }

  .flow-arrow {
    display: none;
  }
  .flow-step {
    width: 100%;
    margin-bottom: 24px;
    align-items: center;
  }
}

@media (max-width: 400px) {
  .action-ill {
    /* Было 0.65, теперь 0.85 */
    transform: scale(0.85);
  }
}
