/* ============================================
   DUEL ARENA V3 - EPIC BATTLE SYSTEM
   LearnBlox 2025
   ============================================ */

/* ============================================
   ARENA CARD STYLES
   ============================================ */

.duel-arena-card {
  position: relative;
  overflow: hidden;
}

.duel-arena-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    #ef4444,
    #f97316,
    #eab308,
    #22c55e,
    #3b82f6,
    #8b5cf6
  );
  background-size: 300% 100%;
  animation: rainbowSlide 3s linear infinite;
}

@keyframes rainbowSlide {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 300% 50%;
  }
}

.duel-arena-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.duel-arena-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.1rem;
}

.duel-arena-header h2 i {
  color: var(--danger-color);
}

.duel-daily-limit {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.duel-daily-limit i {
  width: 14px;
  height: 14px;
  color: var(--warning-color);
}

.duel-daily-limit.exhausted {
  background: var(--danger-bg);
  border-color: var(--danger-color);
  color: var(--danger-color);
}

.duel-arena-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ============================================
   MODE SELECTOR - Epic Cards
   ============================================ */

.duel-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.duel-mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  background: var(--bg-alt);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.duel-mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-accent);
  box-shadow: 0 8px 30px rgba(var(--primary-accent-rgb), 0.2);
}

.duel-mode-card.bot-mode:hover {
  border-color: #8b5cf6;
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.25);
}

.duel-mode-card.pvp-mode:hover {
  border-color: #ef4444;
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.25);
}

/* Mode Icon */
.mode-icon {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.mode-icon i {
  width: 28px;
  height: 28px;
  position: relative;
  z-index: 2;
}

.mode-icon.bot {
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.2),
    rgba(168, 85, 247, 0.1)
  );
  color: #8b5cf6;
}

.mode-icon.pvp {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.2),
    rgba(249, 115, 22, 0.1)
  );
  color: #ef4444;
}

.mode-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.duel-mode-card:hover .mode-glow {
  opacity: 1;
}

.bot-mode .mode-glow {
  background: radial-gradient(
    circle,
    rgba(139, 92, 246, 0.3) 0%,
    transparent 70%
  );
  animation: pulseGlow 2s ease-in-out infinite;
}

.pvp-mode .mode-glow {
  background: radial-gradient(
    circle,
    rgba(239, 68, 68, 0.3) 0%,
    transparent 70%
  );
  animation: pulseGlow 1.5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
}

/* Pulse ring for PvP */
.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border: 2px solid #ef4444;
  border-radius: 16px;
  transform: translate(-50%, -50%);
  animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

/* Mode Info */
.mode-info {
  text-align: center;
}

.mode-info h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
  color: var(--text-headings);
}

.mode-info p {
  margin: 0 0 0.35rem 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.mode-reward {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--warning-color);
  font-weight: 600;
}

.mode-reward i {
  width: 12px;
  height: 12px;
}

.mode-reward.hot {
  color: #ef4444;
}

/* Mode Badge */
.mode-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mode-badge.free {
  background: var(--primary-light);
  color: var(--primary-accent);
}

.mode-badge.live {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* Quick Stats */
.duel-quick-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.75rem;
  background: var(--bg-alt);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.quick-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.quick-stat i {
  width: 16px;
  height: 16px;
  color: var(--warning-color);
}

.quick-stat:first-child i {
  color: var(--warning-color);
}

.quick-stat:nth-child(2) i {
  color: var(--success-color);
}

.online-count {
  color: var(--text-secondary);
  font-weight: 500;
}

.live-indicator {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}

/* ============================================
   BET SELECTION MODAL
   ============================================ */

.bet-selection-screen,
.bot-start-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   BOT START SCREEN - Gratuit
   ============================================ */

.bot-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.bot-icon-big {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.2),
    rgba(139, 92, 246, 0.2)
  );
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  color: var(--primary-color);
}

.bot-icon-big i {
  width: 40px;
  height: 40px;
}

.bot-icon-big .bot-glow {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3), transparent 70%);
  animation: pulseGlow 2s ease-in-out infinite;
}

.bot-header h3 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--text-headings);
}

.bot-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Rewards info */
.bot-rewards-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-content);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: 320px;
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.reward-item i {
  width: 20px;
  height: 20px;
  color: var(--warning-color);
  flex-shrink: 0;
}

.reward-item strong {
  color: var(--warning-color);
}

/* Daily status */
.bot-daily-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.1),
    rgba(16, 185, 129, 0.05)
  );
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  width: 100%;
  max-width: 320px;
}

.bot-daily-status.exhausted {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.1),
    rgba(220, 38, 38, 0.05)
  );
  border-color: rgba(239, 68, 68, 0.3);
}

.daily-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 197, 94, 0.2);
  border-radius: 50%;
  color: var(--success-color);
}

.bot-daily-status.exhausted .daily-icon {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger-color);
}

.daily-icon i {
  width: 24px;
  height: 24px;
}

.daily-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.daily-count {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--success-color);
}

.bot-daily-status.exhausted .daily-count {
  color: var(--danger-color);
}

.daily-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Limit message */
.bot-limit-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 320px;
  text-align: left;
}

.bot-limit-message i {
  width: 18px;
  height: 18px;
  color: var(--primary-color);
  flex-shrink: 0;
}

/* Bot start button */
.btn-start-duel.bot-start {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
}

.btn-start-duel.bot-start:hover:not(:disabled) {
  background: linear-gradient(
    135deg,
    var(--primary-hover),
    var(--accent-color)
  );
}

/* ============================================
   BET SELECTION (PvP)
   ============================================ */

.bet-header {
  text-align: center;
}

.bet-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.3rem;
  color: var(--text-headings);
}

.bet-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* User balance */
.user-balance-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(
    135deg,
    rgba(251, 191, 36, 0.1),
    rgba(245, 158, 11, 0.05)
  );
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  font-weight: 700;
  color: #fbbf24;
}

.user-balance-display i {
  width: 20px;
  height: 20px;
}

/* Bet slider */
.bet-slider-container {
  width: 100%;
  max-width: 350px;
}

.bet-amount-display {
  text-align: center;
  margin-bottom: 1rem;
}

.bet-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--warning-color);
}

.bet-value i {
  width: 32px;
  height: 32px;
}

.potential-win {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--success-color);
}

.potential-win span {
  font-weight: 700;
}

/* Custom slider */
.bet-slider {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-alt);
  border-radius: 4px;
  outline: none;
  margin: 1rem 0;
}

.bet-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
  transition: transform 0.2s ease;
}

.bet-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.bet-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.bet-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Quick bet buttons */
.quick-bet-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.quick-bet-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  background: var(--bg-alt);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-bet-btn:hover {
  border-color: var(--warning-color);
  background: rgba(251, 191, 36, 0.1);
}

.quick-bet-btn.selected {
  border-color: var(--warning-color);
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning-color);
}

.quick-bet-btn i {
  width: 14px;
  height: 14px;
  color: var(--warning-color);
}

/* Bet actions */
.bet-actions {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 350px;
}

.btn-start-duel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.btn-start-duel:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.4);
}

.btn-start-duel:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-start-duel i {
  width: 20px;
  height: 20px;
}

.btn-back {
  padding: 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: var(--bg-element);
  color: var(--text-primary);
}

.btn-back i {
  width: 20px;
  height: 20px;
}

/* ============================================
   MATCHMAKING SCREEN V3
   ============================================ */

.matchmaking-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
  text-align: center;
  animation: fadeInUp 0.3s ease;
}

.matchmaking-visual {
  position: relative;
  width: 120px;
  height: 120px;
}

.matchmaking-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top-color: var(--primary-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.matchmaking-ring:nth-child(2) {
  width: 90%;
  height: 90%;
  top: 5%;
  left: 5%;
  border-top-color: #8b5cf6;
  animation-duration: 1.5s;
  animation-direction: reverse;
}

.matchmaking-ring:nth-child(3) {
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  border-top-color: #ef4444;
  animation-duration: 2s;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.matchmaking-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: var(--bg-content);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.matchmaking-center i {
  width: 28px;
  height: 28px;
  color: var(--primary-accent);
  animation: pulse 1.5s ease-in-out infinite;
}

.matchmaking-text h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  color: var(--text-headings);
}

.matchmaking-text p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.matchmaking-text .status-text {
  color: var(--primary-accent);
  font-weight: 600;
}

.matchmaking-bet-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-alt);
  border-radius: 8px;
  color: var(--warning-color);
  font-weight: 600;
}

.matchmaking-bet-display i {
  width: 16px;
  height: 16px;
}

.btn-cancel-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel-search:hover {
  background: var(--danger-bg);
  border-color: var(--danger-color);
  color: var(--danger-color);
}

.btn-cancel-search i {
  width: 16px;
  height: 16px;
}

/* ============================================
   PVP READY SCREEN V3
   ============================================ */

.pvp-ready-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  animation: fadeInUp 0.3s ease;
}

.ready-title {
  text-align: center;
}

.ready-title h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.3rem;
  color: var(--text-headings);
}

.ready-title p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.ready-players {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 400px;
}

.ready-player {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--bg-alt);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.ready-player.is-ready {
  border-color: var(--success-color);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

.ready-player.is-ready .player-status {
  background: var(--success-bg);
  color: var(--success-color);
  border-color: var(--success-color);
}

.ready-player .player-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 3px solid var(--primary-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-accent);
}

.ready-player .player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ready-player.opponent .player-avatar {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.ready-player .player-name {
  font-weight: 600;
  color: var(--text-headings);
  font-size: 0.9rem;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-content);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.player-status i {
  width: 14px;
  height: 14px;
}

.ready-vs {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--danger-color);
  text-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.ready-bet-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-alt);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.ready-bet-info i {
  width: 18px;
  height: 18px;
  color: var(--warning-color);
}

.ready-bet-info span {
  font-weight: 600;
  color: var(--text-primary);
}

.ready-bet-info .potential {
  color: var(--success-color);
  font-size: 0.85rem;
}

.ready-actions {
  display: flex;
  gap: 1rem;
}

.btn-ready {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

.btn-ready:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(34, 197, 94, 0.4);
}

.btn-ready:disabled {
  background: var(--success-color);
  opacity: 0.7;
  cursor: default;
  transform: none;
}

.btn-ready.is-ready {
  background: var(--success-color);
}

.btn-ready i {
  width: 20px;
  height: 20px;
}

.btn-cancel-ready {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel-ready:hover {
  background: var(--danger-bg);
  border-color: var(--danger-color);
  color: var(--danger-color);
}

.btn-cancel-ready i {
  width: 18px;
  height: 18px;
}

/* ============================================
   COUNTDOWN V3
   ============================================ */

.duel-countdown-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 1rem;
  animation: fadeInUp 0.3s ease;
}

.countdown-number {
  font-size: 8rem;
  font-weight: 900;
  color: var(--danger-color);
  text-shadow: 0 0 50px rgba(239, 68, 68, 0.5);
  animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
  0% {
    transform: scale(1.5);
    opacity: 0;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 1;
  }
}

.countdown-text {
  font-size: 1.2rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 4px;
}

/* ============================================
   BATTLE SCREEN V3
   ============================================ */

.duel-battle-screen {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 700px;
  animation: fadeInUp 0.3s ease;
}

/* Battle Header */
.battle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-content);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.battle-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.battle-player.opponent {
  flex-direction: row-reverse;
  text-align: right;
}

.battle-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 3px solid var(--primary-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: bold;
  font-size: 1rem;
  color: var(--primary-accent);
}

.battle-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.battle-player.opponent .battle-avatar {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.battle-info .player-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.battle-info .player-score {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-accent);
}

.battle-player.opponent .player-score {
  color: #ef4444;
}

.player-score.score-up {
  animation: scoreUp 0.5s ease;
}

@keyframes scoreUp {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
    color: var(--success-color);
  }
  100% {
    transform: scale(1);
  }
}

/* Timer */
.battle-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0 1rem;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

.question-counter {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.timer-circle {
  position: relative;
  width: 56px;
  height: 56px;
}

.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring-bg {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 3;
}

.timer-ring-progress {
  fill: none;
  stroke: var(--success-color);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 1s linear, stroke 0.3s ease;
}

.timer-ring-progress.warning {
  stroke: var(--warning-color);
}

.timer-ring-progress.danger {
  stroke: var(--danger-color);
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-headings);
}

/* Question */
.question-container {
  background: var(--bg-content);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
}

.question-text {
  font-size: 1.1rem;
  color: var(--text-headings);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-alt);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.option-btn:hover:not(:disabled):not(.correct):not(.incorrect) {
  border-color: var(--primary-accent);
  background: var(--primary-light);
  transform: translateX(4px);
}

.option-btn:disabled {
  cursor: default;
}

.option-letter {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--bg-content);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.option-text {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.option-btn.correct {
  background: var(--success-bg);
  border-color: var(--success-color);
}

.option-btn.correct .option-letter {
  background: var(--success-color);
  border-color: var(--success-color);
  color: white;
}

.option-btn.incorrect {
  background: var(--danger-bg);
  border-color: var(--danger-color);
}

.option-btn.incorrect .option-letter {
  background: var(--danger-color);
  border-color: var(--danger-color);
  color: white;
}

/* Answer Status */
.answer-status {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-content);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-alt);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.status-indicator i {
  width: 14px;
  height: 14px;
}

.status-indicator.correct {
  background: var(--success-bg);
  color: var(--success-color);
}

.status-indicator.incorrect {
  background: var(--danger-bg);
  color: var(--danger-color);
}

.status-indicator.timeout {
  background: var(--warning-bg);
  color: var(--warning-color);
}

/* ============================================
   RESULT SCREEN V3
   ============================================ */

.duel-result-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
  max-width: 450px;
  width: 100%;
  animation: fadeInUp 0.5s ease;
}

.result-banner {
  text-align: center;
}

.result-banner h2 {
  font-size: 2.5rem;
  font-weight: 900;
  margin: 0;
}

.duel-result-screen.victory .result-banner h2 {
  color: var(--success-color);
  text-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
  animation: victoryBounce 1s ease infinite;
}

@keyframes victoryBounce {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.duel-result-screen.defeat .result-banner h2 {
  color: var(--danger-color);
}

.duel-result-screen.draw .result-banner h2 {
  color: var(--warning-color);
}

/* Forfeit / Disconnect screen */
.duel-result-screen.forfeit .result-banner {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.2),
    rgba(139, 92, 246, 0.2)
  );
  border-color: var(--primary-color);
}

.forfeit-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-content);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  text-align: center;
}

.opponent-left-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid var(--danger-color);
  border-radius: 50%;
  color: var(--danger-color);
}

.opponent-left-icon i {
  width: 30px;
  height: 30px;
}

.forfeit-message p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.forfeit-message p strong {
  color: var(--text-primary);
}

/* Confetti animation */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10002;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0;
  animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(-100%) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

/* Result scores card */
.result-scores-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem 2rem;
  background: var(--bg-content);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 100%;
}

.result-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.result-player .result-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 3px solid var(--primary-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-accent);
}

.result-player .result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-player.opponent .result-avatar {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.result-player.winner .result-avatar {
  border-color: #fbbf24;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.5);
}

.result-player .result-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.result-player .result-score {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.result-player.winner .result-score {
  color: var(--success-color);
}

.winner-crown {
  position: absolute;
  top: -20px;
  font-size: 1.75rem;
  animation: crownBounce 1s ease infinite;
}

@keyframes crownBounce {
  0%,
  100% {
    transform: translateY(0) rotate(-5deg);
  }
  50% {
    transform: translateY(-5px) rotate(5deg);
  }
}

.result-vs {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* Rewards */
.result-rewards {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.1),
    rgba(22, 163, 74, 0.05)
  );
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--success-color);
}

.result-rewards i {
  width: 22px;
  height: 22px;
  color: var(--warning-color);
}

/* Points reward (Bot mode) */
.result-rewards.points {
  background: linear-gradient(
    135deg,
    rgba(251, 191, 36, 0.15),
    rgba(245, 158, 11, 0.05)
  );
  border-color: rgba(251, 191, 36, 0.4);
  color: var(--warning-color);
}

.result-rewards.points i {
  color: var(--warning-color);
}

/* Refund (draw in PvP) */
.result-rewards.refund {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1),
    rgba(37, 99, 235, 0.05)
  );
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--primary-color);
  font-size: 0.95rem;
}

.result-limit-warning {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--warning-bg);
  border: 1px solid var(--warning-color);
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--warning-color);
  text-align: center;
}

.result-limit-warning i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.result-daily-counter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.result-daily-counter i {
  width: 14px;
  height: 14px;
  color: var(--warning-color);
}

/* Result stats */
.result-stats {
  display: flex;
  gap: 2rem;
}

.result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.result-stat .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.result-stat .stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Result actions */
.result-actions {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.btn-play-again {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-play-again:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.btn-play-again i {
  width: 20px;
  height: 20px;
}

.btn-quit {
  padding: 1rem 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-quit:hover {
  background: var(--bg-element);
  color: var(--text-primary);
}

.btn-quit i {
  width: 18px;
  height: 18px;
}

/* ============================================
   OPPONENT DISCONNECT
   ============================================ */

.opponent-disconnect-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  text-align: center;
  animation: fadeInUp 0.3s ease;
}

.disconnect-icon {
  width: 80px;
  height: 80px;
  background: var(--warning-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.disconnect-icon i {
  width: 40px;
  height: 40px;
  color: var(--warning-color);
}

.disconnect-text h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.3rem;
  color: var(--text-headings);
}

.disconnect-text p {
  margin: 0;
  color: var(--text-secondary);
}

.disconnect-reward {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--success-bg);
  border: 1px solid var(--success-color);
  border-radius: 10px;
  color: var(--success-color);
  font-weight: 600;
}

.disconnect-reward i {
  width: 18px;
  height: 18px;
  color: var(--warning-color);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .duel-mode-selector {
    grid-template-columns: 1fr;
  }

  .duel-mode-card {
    flex-direction: row;
    padding: 1rem;
    gap: 1rem;
  }

  .mode-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .mode-icon i {
    width: 24px;
    height: 24px;
  }

  .mode-info {
    text-align: left;
    flex: 1;
  }

  .mode-badge {
    position: static;
  }

  .duel-quick-stats {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .ready-players {
    flex-direction: column;
    gap: 1rem;
  }

  .ready-vs {
    order: 2;
  }

  .ready-player:first-child {
    order: 1;
  }

  .ready-player.opponent {
    order: 3;
  }

  .battle-header {
    padding: 0.875rem;
  }

  .battle-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .battle-info .player-score {
    font-size: 1.25rem;
  }

  .timer-circle {
    width: 48px;
    height: 48px;
  }

  .timer-text {
    font-size: 1.1rem;
  }

  .countdown-number {
    font-size: 5rem;
  }

  .result-scores-card {
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
  }

  .result-vs {
    order: 2;
  }

  .result-player:first-child {
    order: 1;
  }

  .result-player.opponent {
    order: 3;
  }

  .result-actions {
    flex-direction: column;
  }

  .btn-quit {
    width: 100%;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .duel-arena-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .bet-value {
    font-size: 2rem;
  }

  .bet-value i {
    width: 24px;
    height: 24px;
  }

  .quick-bet-buttons {
    gap: 0.35rem;
  }

  .quick-bet-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .question-text {
    font-size: 1rem;
  }

  .option-btn {
    padding: 0.875rem;
  }

  .option-letter {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 0.85rem;
  }

  .option-text {
    font-size: 0.9rem;
  }

  .result-banner h2 {
    font-size: 2rem;
  }

  .result-player .result-avatar {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
  }
}

/* ============================================
   CONNECTION WARNING
   ============================================ */

.connection-warning {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 10001;
  background: linear-gradient(
    135deg,
    rgba(251, 191, 36, 0.95),
    rgba(245, 158, 11, 0.95)
  );
  color: #1a1a1a;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.4);
  opacity: 0;
  transition: all 0.3s ease;
}

.connection-warning.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.connection-warning-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.connection-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #1a1a1a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
