﻿/* ══════════════════════════════════════════════
   JACKPOT
══════════════════════════════════════════════ */

/* ── Обёртка (как double-game-row) ── */
.jp-wrap {
  width: 100%;
  max-width: 1240px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Страница раунда: банк той же ширины что и на главной (без сайдбара) ── */
.jp-wrap--round .jp-bank-roulette {
  max-width: calc(100% - 274px);
}

/* ── Таймер ── */
.jp-timer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid rgba(var(--accent-rgb),0.14);
  border-radius: 10px;
}

.jp-timer-label {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  flex-shrink: 0;
}

.jp-timer-val {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 1px;
}

.jp-t-sec {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.jp-t-dot {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  margin: 0 1px;
}

.jp-t-ms {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.jp-timer-track {
  flex: 1;
  height: 6px;
  background: rgba(var(--accent-rgb),0.08);
  border-radius: 3px;
  overflow: hidden;
}

.jp-timer-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
}


/* ── Верхняя строка: рулетка + сайдбар ── */
.jp-game-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

/* ── Нижняя строка: таблица участников ── */
.jp-players-row {
  display: flex;
  gap: 14px;
}

.jp-players-sidebar-spacer,
.jp-sidebar-spacer {
  width: 310px;
  flex-shrink: 0;
}

/* ── Контейнер банка + рулетки ── */
.jp-bank-roulette {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb),0.14);
  border-radius: 12px;
  overflow: hidden;
  padding: 12px 12px 0;
}

.jp-bank-block {
  background: #070a10;
  border: 1px solid rgba(var(--accent-rgb),0.14);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 12px;
  padding: 10px 10px 14px;
  text-align: center;
}

.jp-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  white-space: nowrap;
}

.jp-bank-val {
  font-size: 30px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -1px;
  text-shadow: 0 0 18px rgba(var(--accent-rgb),0.35);
}

/* ── Правая колонка: ставка ── */
.jp-sidebar {
  width: 310px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jp-bet-card {
  background: var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb),0.14);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.jp-bet-card-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(var(--accent-rgb),0.14);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.jp-bet-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(var(--accent-rgb),0.6);
  flex-shrink: 0;
}

.jp-bet-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* ── Обёртка быстрых кнопок + карандаш ── */
.jp-quick-wrap {
  display: flex;
  align-items: stretch;
  gap: 5px;
}

.jp-quick-rows {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.jp-preset-edit-btn {
  margin-left: auto;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid rgba(var(--accent-rgb),0.12);
  background: var(--bg-card);
  color: var(--text-mute);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.jp-preset-edit-btn:hover { background: rgba(var(--accent-rgb),0.12); border-color: #2a3f5a; color: var(--text-dim); }
.jp-preset-edit-btn.active {
  background: rgba(74,212,118,0.12);
  border-color: rgba(74,212,118,0.35);
  color: #4ad476;
}

/* ── Инпуты при редактировании пресетов ── */
.jp-q-inp {
  width: 100%;
  min-width: 0;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb),0.4);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  outline: none;
  padding: 0 4px;
  transition: border-color 0.2s, box-shadow 0.2s;
  -moz-appearance: textfield;
}
.jp-q-inp:focus {
  border-color: rgba(var(--accent-rgb),0.7);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb),0.07);
}
.jp-q-inp::-webkit-outer-spin-button,
.jp-q-inp::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.jp-amt-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pm-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  line-height: 1;
}
.pm-btn-minus {
  background: rgba(212,99,74,0.12);
  border-color: rgba(212,99,74,0.2);
  color: #d4634a;
}
.pm-btn-minus:hover { background: rgba(212,99,74,0.22); border-color: rgba(212,99,74,0.4); color: #f0795e; transform: scale(1.08); }
.pm-btn-plus {
  background: rgba(74,212,118,0.12);
  border-color: rgba(74,212,118,0.2);
  color: #4ad476;
}
.pm-btn-plus:hover { background: rgba(74,212,118,0.22); border-color: rgba(74,212,118,0.4); color: #6fe890; transform: scale(1.08); }

.jp-amt-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.jp-amt-coin {
  position: absolute;
  left: 10px;
  width: 20px;
  height: 20px;
  background: var(--gradient-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: #0e0e0e;
  box-shadow: 0 0 6px rgba(var(--accent-rgb),0.35);
  pointer-events: none;
  flex-shrink: 0;
}

.jp-amt-in {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb),0.12);
  border-radius: 10px;
  padding: 10px 10px 10px 38px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -moz-appearance: textfield;
}
.jp-amt-in::-webkit-outer-spin-button,
.jp-amt-in::-webkit-inner-spin-button { -webkit-appearance: none; }
.jp-amt-in:focus {
  border-color: rgba(var(--accent-rgb),0.45);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.07);
}

.jp-btn-place {
  background: var(--gradient-accent);
  color: var(--bg);
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  height: 48px;
  width: 100%;
  cursor: pointer;
  letter-spacing: 0.4px;
  margin: 4px 14px 14px;
  width: calc(100% - 28px);
  transition: opacity 0.2s, transform 0.1s;
}
.jp-btn-place:hover:not(:disabled) { opacity: 0.88; }
.jp-btn-place:active  { transform: scale(0.98); }
.jp-btn-place:disabled { opacity: 0.4; cursor: not-allowed; }
.jp-btn-place.error    { background: rgba(212,99,74,0.1) !important; border: 1px solid rgba(212,99,74,0.45) !important; color: #d4634a !important; }

.jp-btn-history {
  background: var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb),0.14);
  border-radius: 12px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
  height: 38px;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.jp-btn-history:hover {
  background: rgba(var(--accent-rgb),0.14);
  border-color: #2a3f5a;
  color: var(--text);
}

/* ── Модалка истории ── */
.jp-history-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.jp-history-overlay.open { display: flex; }

.jp-history-modal {
  background: var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb),0.12);
  border-radius: 16px;
  width: 420px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: jpWinIn 0.2s ease;
}

.jp-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(var(--accent-rgb),0.12);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}


.jp-history-close {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.jp-history-close:hover { color: var(--text); background: rgba(var(--accent-rgb),0.08); }

.jp-history-list {
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.jp-history-list::-webkit-scrollbar { width: 4px; }
.jp-history-list::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb),0.08); border-radius: 2px; }

.jp-history-empty {
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
  padding: 24px 0;
}

.jp-history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 12px 14px;
  border-left: 3px solid transparent;
}

.jp-history-win {
  background: #0d1f12;
  border-left-color: #4ad476;
}

.jp-history-lose {
  background: #1a0d0d;
  border-left-color: #d4634a;
}

.jp-history-label {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  width: 110px;
  flex-shrink: 0;
}

.jp-history-win  .jp-history-label { color: #4ad476; }
.jp-history-lose .jp-history-label { color: #d4634a; }

.jp-history-meta {
  flex: 1;
  font-size: 12px;
  color: var(--text-faint);
}
.jp-history-meta strong { color: var(--text-dim); }

.jp-history-result {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.jp-history-result-win  { color: #4ad476; }
.jp-history-result-lose { color: #d4634a; }

.jp-qb-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 5px;
}
.jp-qb-row:first-child { margin-top: 0; }

.jp-qb {
  background: var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb),0.12);
  border-radius: 8px;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 700;
  height: 30px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.jp-qb:hover {
  background: rgba(var(--accent-rgb),0.12);
  border-color: #2a3f5a;
  color: var(--text);
  transform: translateY(-1px);
}
.jp-qb:active { transform: translateY(0); }

/* ── Игровая зона (фон как в crash/double) ── */
.jp-game-area {
  background: #070a10;
  border: 1px solid rgba(var(--accent-rgb),0.14);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

/* ── Рулетка ── */
.jp-roulette-wrap {
  height: 150px;
  position: relative;
  overflow: hidden;
}

.jp-roulette-wrap::before,
.jp-roulette-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 90px;
  z-index: 5;
  pointer-events: none;
}
.jp-roulette-wrap::before {
  left: 0;
  background: linear-gradient(to right, #070a10, transparent);
}
.jp-roulette-wrap::after {
  right: 0;
  background: linear-gradient(to left, #070a10, transparent);
}

.jp-roulette-window {
  width: 100%;
  height: 150px;
  position: relative;
  overflow: hidden;
}

.jp-roulette-pointer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 14px solid var(--accent);
  z-index: 10;
  filter: drop-shadow(0 0 6px var(--accent));
}

.jp-roulette-window::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: var(--gradient-accent)33;
  z-index: 4;
  pointer-events: none;
}

.jp-roulette-track {
  display: flex;
  height: 150px;
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.jp-roulette-item {
  width: 84px;
  height: 150px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-right: 1px solid rgba(var(--accent-rgb),0.12)44;
  box-sizing: border-box;
}

.jp-roulette-item.is-winner .jp-roulette-avatar {
  border: 3px solid #1a9fff;
  box-shadow: 0 0 12px rgba(var(--accent-rgb),0.6);
}

.jp-roulette-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s ease-out;
}

.jp-roulette-item.jp-active .jp-roulette-avatar {
  transform: scale(1.14);
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.5);
}

.jp-roulette-item.jp-active .jp-roulette-name {
  color: var(--text);
}

.jp-roulette-name {
  font-size: 9px;
  color: var(--text-faint);
  text-align: center;
  max-width: 76px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Победитель (внутри jp-game-area) ── */
.jp-winner-block {
  height: 150px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.03) 0%, transparent 60%);
  animation: jpWinIn 0.35s ease;
}

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

.jp-winner-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.jp-winner-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.jp-winner-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid #1a9fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(var(--accent-rgb),0.35);
}

.jp-winner-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.jp-winner-sub {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 2px;
}
.jp-winner-sub span {
  color: var(--text);
  font-weight: 600;
}

/* ── Участники ── */
.jp-players-section {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb),0.12);
  border-radius: 12px;
  overflow: hidden;
}

/* ── Общая сетка таблицы (заголовок + строки) ── */
.jp-players-header,
.jp-bet-row {
  display: grid;
  grid-template-columns: 1fr 110px 150px 80px;
  align-items: center;
}

.jp-players-header {
  padding: 11px 26px 11px 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mute);
  border-bottom: 1px solid rgba(var(--accent-rgb),0.12);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.jp-th-player  { }
.jp-th-amt     { text-align: right; padding-right: 6px; }
.jp-th-tickets { text-align: right; padding-right: 6px; }
.jp-th-chance  { text-align: right; }
.jp-th-count   { color: var(--text-faint); margin-left: 4px; }

.jp-players-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  min-height: 66px;
}

.jp-empty-state {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-mute);
  padding: 12px 0;
}

@keyframes jpBetRowIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.jp-bet-row {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 9px 16px 9px 12px;
  animation: jpBetRowIn 0.2s ease-out both;
}

/* Колонка: аватар + ник */
.jp-col-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.jp-bet-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.jp-bet-nick {
  font-size: 13px;
  font-weight: 600;
  color: #c9d1dc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.jp-link { text-decoration: none; color: inherit; cursor: pointer; transition: filter 0.12s ease, color 0.12s ease; display: inline-block; }
a.jp-link:hover { filter: brightness(1.2); }
a.jp-bet-nick.jp-link:hover, a.jp-tb-nick.jp-link:hover { color: #fff; }

/* Колонка: сумма */
.jp-col-amt {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  text-align: right;
  padding-right: 8px;
}

/* Колонка: билеты */
.jp-col-tickets {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
  padding-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jp-col-tickets .jp-tk-empty { color: var(--text-mute); font-weight: 500; }

/* Колонка: шанс */
.jp-col-chance {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
  text-align: right;
  white-space: nowrap;
}
.jp-col-chance span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-mute);
}

/* ── Топ ставок (вместо рулетки когда нет прокрута) ── */
.jp-top-bets {
  height: 150px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.jp-top-bets::-webkit-scrollbar { display: none; }

.jp-top-bets-empty {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  font-size: 13px;
}

.jp-tb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb),0.12);
  width: 96px;
  flex-shrink: 0;
  flex-grow: 0;
  overflow: hidden;
}

.jp-tb-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.jp-tb-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.jp-tb-nick {
  font-size: 10px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 84px;
  text-align: center;
}

.jp-tb-amt {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  max-width: 100%;
  display: inline-block;
  transform-origin: center;
}

.jp-tb-chance {
  font-size: 12px;
  font-weight: 700;
}

/* ── Строки всех раундов в модалке ── */
.jp-round-row {
  display: grid;
  grid-template-columns: 1fr 80px 110px 32px;
  align-items: center;
  background: var(--bg-card);
  border-radius: 9px;
  padding: 6px 10px 6px 10px;
  animation: jpBetRowIn 0.2s ease-out both;
}

.jp-round-row .jp-col-chance { text-align: right; }
.jp-round-row .jp-col-amt   { text-align: right; }

.jp-round-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(var(--accent-rgb),0.08);
  color: var(--text-faint);
  font-size: 14px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  justify-self: end;
}
.jp-round-link:hover { background: rgba(var(--accent-rgb),0.13); color: var(--accent); }

/* ── Provably Fair блок в сайдбаре (страница раунда) ── */
.jr-fair-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg);
  border: 1px solid rgba(var(--accent-rgb),0.12);
  border-radius: 8px;
  padding: 10px 12px;
}

.jr-fair-key {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.jr-fair-val {
  font-size: 12px;
  font-family: monospace;
  color: var(--text-dim);
  word-break: break-all;
}
