/* ══════════════ Модальное окно: запуск боев против AI ══════════════ */
.ai-mode-overlay {
  --ai-gold: #f5c542;
  --ai-gold-soft: #ffdf8e;
  --ai-violet: #7b4dff;
  --ai-text: #e9e2ff;
  --ai-muted: #a99acf;
  z-index: 1000;
  background: radial-gradient(ellipse at 50% 30%, rgba(80, 40, 160, 0.55), rgba(10, 4, 26, 0.92) 72%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ai-mode-modal {
  position: relative;
  width: 92%;
  max-width: 430px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 26px;
  padding: 30px 22px 22px;
  text-align: center;
  color: var(--ai-text);
  background:
    radial-gradient(circle at 50% 0%, rgba(123, 77, 255, 0.32), transparent 58%),
    linear-gradient(165deg, rgba(58, 27, 120, 0.92), rgba(24, 10, 54, 0.96) 55%, rgba(12, 4, 30, 0.98));
  border: 1px solid rgba(245, 197, 66, 0.45);
  box-shadow:
    0 0 0 1px rgba(123, 77, 255, 0.25),
    0 0 32px rgba(123, 77, 255, 0.35),
    0 0 90px rgba(245, 197, 66, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: aiModalIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.ai-mode-modal::before,
.ai-mode-modal::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.7;
}
.ai-mode-modal::before {
  width: 70px; height: 70px; top: -24px; right: 16px;
  background: radial-gradient(circle, rgba(255, 215, 106, 0.55), transparent 70%);
}
.ai-mode-modal::after {
  width: 90px; height: 90px; bottom: -30px; left: -24px;
  background: radial-gradient(circle, rgba(123, 77, 255, 0.5), transparent 70%);
}

.ai-mode-close { position: absolute; top: 10px; right: 10px; z-index: 5; }

@keyframes aiModalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.86); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Бейдж «Скоро» ── */
.ai-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #1c1030;
  background: linear-gradient(90deg, #ffdf8e, #f5c542 45%, #ff9d2f);
  border-radius: 999px;
  padding: 5px 14px;
  box-shadow: 0 2px 14px rgba(245, 197, 66, 0.5);
  animation: aiBadgePulse 2s ease-in-out infinite;
}
@keyframes aiBadgePulse {
  0%, 100% { box-shadow: 0 2px 14px rgba(245, 197, 66, 0.5); }
  50%      { box-shadow: 0 2px 26px rgba(245, 197, 66, 0.85); }
}

/* ── Заголовок ── */
.ai-mode-title {
  margin: 14px 0 6px;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #fff6d8, #ffd76a 60%, #c88a1f);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 2px 24px rgba(245, 197, 66, 0.35));
}

.ai-mode-subtitle {
  font-size: 14px;
  color: var(--ai-muted);
  margin: 0 0 22px;
  line-height: 1.45;
}

/* ── Таймер ── */
.ai-timer {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 20px;
}

.ai-timer-cell {
  position: relative;
  min-width: 62px;
  padding: 11px 4px 9px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 8, 48, 0.9), rgba(42, 18, 92, 0.9));
  border: 1px solid rgba(245, 197, 66, 0.4);
  box-shadow: inset 0 1px 6px rgba(255, 255, 255, 0.08), 0 4px 14px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.ai-timer-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.14) 48%, transparent 62%);
  animation: aiShine 2.8s ease-in-out infinite;
}
@keyframes aiShine {
  0%   { transform: translateX(-110%); }
  60%, 100% { transform: translateX(110%); }
}

.ai-timer-value {
  display: block;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff, #ffdf8e 70%, #d99b24);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 8px rgba(245, 197, 66, 0.45));
}

.ai-timer-label {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #b7a7e8;
}

.ai-timer-sep {
  align-self: center;
  font-size: 26px;
  font-weight: 900;
  color: #ffd76a;
  padding-bottom: 18px;
  animation: aiBlink 1s step-end infinite;
}
@keyframes aiBlink { 50% { opacity: 0.25; } }

/* ── Дата запуска ── */
.ai-mode-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cbbdf2;
  background: rgba(123, 77, 255, 0.14);
  border: 1px dashed rgba(245, 197, 66, 0.45);
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 16px;
}
.ai-mode-date b { color: #ffd76a; }

/* ── Описание ── */
.ai-mode-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ai-muted);
  margin: 0 4px 20px;
}

/* ── Кнопки ── */
.ai-mode-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-btn {
  width: 100%;
  border: none;
  cursor: pointer;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  font-family: inherit;
}
.ai-btn:active { transform: scale(0.97); }

.ai-btn-gold {
  color: #221303;
  background: linear-gradient(180deg, #ffe79a, #f5c542 45%, #e09626);
  box-shadow: 0 4px 18px rgba(245, 197, 66, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.ai-btn-gold:hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 26px rgba(245, 197, 66, 0.65);
}

.ai-btn-ghost {
  color: #ffd76a;
  background: rgba(123, 77, 255, 0.12);
  border: 1px solid rgba(245, 197, 66, 0.4);
}
.ai-btn-ghost:hover { background: rgba(123, 77, 255, 0.22); }

.ai-btn-green {
  color: #06220f;
  background: linear-gradient(180deg, #9dffb0, #3ddc68 50%, #1fa94d);
  box-shadow: 0 4px 20px rgba(61, 220, 104, 0.5);
}
.ai-btn-green:hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 28px rgba(61, 220, 104, 0.7);
}

/* ── Состояние «запущено» ── */
#ai-mode-launched { padding: 10px 0 4px; }
.ai-launched-icon {
  font-size: 46px;
  margin-bottom: 8px;
  animation: aiPulseIcon 1.6s ease-in-out infinite;
}
@keyframes aiPulseIcon {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}

.hidden { display: none !important; }

/* ── Мелкие экраны (Telegram WebApp) ── */
@media (max-width: 380px) {
  .ai-mode-modal { padding: 24px 14px 16px; }
  .ai-timer-cell { min-width: 54px; }
  .ai-timer-value { font-size: 28px; }
}