/* ========== 战斗场景 ========== */
.battle-scene {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3e 40%, #2a1a3e 100%);
  position: relative;
  overflow: hidden;
}

.battle-scene::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(100, 100, 200, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(200, 100, 100, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

/* ========== 怪物区 ========== */
.battle-enemy {
  flex: 0 0 35%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.enemy-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  width: 80%;
}

.enemy-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--danger);
}

.enemy-hp-wrap,
.player-hp-wrap {
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.enemy-hp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--hp-red), #ff6666);
  border-radius: 6px;
  transition: width 0.5s ease;
}

.player-hp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--hp-green), #66ff66);
  border-radius: 6px;
  transition: width 0.5s ease;
}

.enemy-hp-text,
.player-hp-text {
  font-size: 12px;
  color: var(--text-dim);
}

/* ========== 战斗属性徽章 ========== */
.enemy-stats-battle,
.player-stats-battle {
  display: flex;
  gap: 12px;
  font-size: 14px;
  margin-top: 4px;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.stat-badge.stat-atk {
  background: rgba(255, 68, 68, 0.15);
  border: 1px solid rgba(255, 68, 68, 0.35);
  color: #ff6b6b;
}

.stat-badge.stat-def {
  background: rgba(68, 136, 255, 0.15);
  border: 1px solid rgba(68, 136, 255, 0.35);
  color: #6baaff;
}

.enemy-sprite,
.player-sprite {
  position: relative;
}

.sprite-emoji {
  font-size: 64px;
  display: block;
  animation: float 3s ease-in-out infinite;
}

/* ========== 战斗界面怪物图片 ========== */
.battle-monster-img {
  image-rendering: pixelated;
  display: block;
  width: 80px !important;
  height: 80px !important;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
  animation: float 3s ease-in-out infinite;
}

.sprite-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  min-height: 80px;
}

/* ========== 战斗界面英雄图片 ========== */
.battle-hero-img {
  image-rendering: pixelated;
  display: block;
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 2px 6px rgba(74, 144, 217, 0.5));
  animation: float 3s ease-in-out infinite;
}

.enemy-sprite .sprite-emoji {
  animation: float 2.5s ease-in-out infinite;
}

.enemy-sprite.attacking {
  animation: attackLeft 0.6s ease;
}

.player-sprite.attacking {
  animation: attackRight 0.6s ease;
}

.enemy-sprite.hurt,
.player-sprite.hurt {
  animation: hurt 0.5s ease;
}

.enemy-sprite.dodge {
  animation: dodge 0.5s ease;
}

.enemy-sprite.charging {
  animation: bossCharge 1s ease-in-out infinite;
}

/* ========== 伤害数字 ========== */
.damage-container {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.damage-number {
  position: absolute;
  font-size: 24px;
  font-weight: 900;
  white-space: nowrap;
  animation: damageFloat 1s ease forwards;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.damage-number.damage {
  color: #ff4444;
}

.damage-number.critical {
  color: #ff0000;
  font-size: 32px;
}

.damage-number.heal {
  color: #44ff44;
  animation: healFloat 1s ease forwards;
}

.damage-number.miss {
  color: #999;
  font-size: 18px;
}

.damage-number.block {
  color: #4488ff;
  font-size: 20px;
}

/* ========== 战斗效果 ========== */
.battle-effects {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 5;
}

.slash-effect {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 80px;
  animation: bounceIn 0.4s ease;
  opacity: 0;
}

/* ========== 口算题区 ========== */
.battle-question {
  flex: 0 0 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  position: relative;
  z-index: 2;
}

/* ========== Boss蓄力答题状态栏 ========== */
.boss-charge-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 320px;
  padding: 6px 14px;
  background: rgba(255, 0, 0, 0.12);
  border: 1px solid rgba(255, 68, 68, 0.35);
  border-radius: 10px;
  margin-bottom: 8px;
  animation: warningPulse 1.5s ease infinite;
}

.boss-charge-label {
  font-size: 14px;
  font-weight: 700;
  color: #ff6b6b;
}

.boss-charge-hint {
  font-size: 12px;
  color: var(--text-dim);
}

.battle-question .question-text {
  font-size: 32px;
  margin-bottom: 8px;
}

/* ========== 选择题按钮 ========== */
.answer-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}

.choice-btn {
  padding: 14px 10px;
  font-size: 22px;
  font-weight: 700;
  background: rgba(74, 144, 217, 0.15);
  color: var(--text-bright);
  border: 2px solid rgba(74, 144, 217, 0.4);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.choice-btn:active {
  transform: scale(0.95);
}

.choice-btn:hover {
  background: rgba(74, 144, 217, 0.3);
  border-color: var(--primary);
}

.choice-btn.correct {
  background: rgba(40, 167, 69, 0.4) !important;
  border-color: var(--success) !important;
  animation: pulse 0.3s ease;
}

.choice-btn.wrong {
  background: rgba(220, 53, 69, 0.4) !important;
  border-color: var(--danger) !important;
  animation: shake 0.4s ease;
}

.choice-btn:disabled {
  pointer-events: none;
  opacity: 0.6;
}

/* ========== 计时条 ========== */
.timer-bar-wrap {
  width: 100%;
  max-width: 320px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--warning));
  border-radius: 3px;
  transition: width 0.1s linear;
  width: 100%;
}

.timer-bar.urgent {
  background: linear-gradient(90deg, var(--danger), var(--warning));
}

/* ========== 连击显示 ========== */
.combo-display {
  position: absolute;
  top: -5px;
  right: 20px;
  text-align: right;
}

.combo-count {
  font-size: 36px;
  font-weight: 900;
  color: #ff6600;
  animation: comboFire 0.5s ease infinite, comboShake 0.3s ease infinite;
}

.combo-label {
  font-size: 14px;
  color: #ff9900;
  display: block;
}

/* ========== 速度提示 ========== */
.speed-hint {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 5px;
  animation: speedFlash 0.5s ease;
}

.speed-hint.speed-fast {
  color: #FFD700;
}

.speed-hint.speed-normal {
  color: var(--success);
}

.speed-hint.speed-slow {
  color: var(--text-dim);
}

/* ========== 玩家区 ========== */
.battle-player {
  flex: 0 0 35%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.player-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  width: 80%;
}

.player-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

/* ========== Boss战警告 ========== */
.boss-warning {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 0, 0, 0.15);
  border: 2px solid rgba(255, 0, 0, 0.5);
  border-radius: 12px;
  padding: 12px 24px;
  text-align: center;
  animation: warningPulse 0.5s ease infinite;
  z-index: 10;
}

.boss-warning-text {
  color: #ff4444;
  font-size: 16px;
  font-weight: 700;
}

/* ========== 胜利弹窗 ========== */
.victory-modal .victory-title {
  font-size: 28px;
  text-align: center;
  color: var(--gold);
  margin-bottom: 16px;
  animation: bounceIn 0.5s ease;
}

.victory-rewards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 8px;
  font-size: 15px;
  animation: slideUp 0.3s ease;
}

/* ========== 游戏结束 ========== */
.gameover-modal .gameover-title {
  font-size: 28px;
  text-align: center;
  color: var(--danger);
  margin-bottom: 16px;
}

.gameover-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
}

.gameover-stats p {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
}

.gameover-modal .btn {
  width: 100%;
  margin-bottom: 8px;
}

/* ========== 双倍奖励入口（胜利弹窗内） ========== */
.double-reward-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 215, 0, 0.2);
  width: 100%;
}

.double-reward-section .btn {
  margin-bottom: 6px;
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

.btn-gold {
  padding: 14px 8px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
  color: #FFD700;
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 4px;
}

.btn-gold:active {
  transform: scale(0.95);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.4), rgba(255, 165, 0, 0.4));
}

.btn-exp {
  padding: 14px 8px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(100, 200, 255, 0.2), rgba(50, 150, 255, 0.2));
  color: #64C8FF;
  border: 2px solid rgba(100, 200, 255, 0.5);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 4px;
}

.btn-exp:active {
  transform: scale(0.95);
  background: linear-gradient(135deg, rgba(100, 200, 255, 0.4), rgba(50, 150, 255, 0.4));
}

.btn-sm {
  padding: 6px 20px;
  font-size: 13px;
  opacity: 0.7;
}

/* ========== 双倍奖励做题面板 ========== */
.dr-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #0a0a2e 0%, #1a1a4e 50%, #0a0a2e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 100;
  overflow: hidden;
}

/* ========== 双倍奖励状态栏 ========== */
.dr-status-bar {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.25) 100%);
  border-bottom: 1px solid rgba(255,215,0,0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dr-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dr-reward-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}

.dr-earnings {
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
  background: rgba(40, 167, 69, 0.15);
  border: 1px solid rgba(40, 167, 69, 0.3);
  padding: 2px 10px;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.dr-earnings.has-earnings {
  color: #66ff66;
  background: rgba(40, 167, 69, 0.25);
  animation: earningsPulse 0.5s ease;
}

@keyframes earningsPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.dr-dots {
  display: flex;
  gap: 10px;
  align-items: center;
}

.dr-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.3s ease;
}

.dr-dot.active {
  border-color: var(--primary);
  background: rgba(74, 144, 217, 0.2);
  box-shadow: 0 0 8px rgba(74, 144, 217, 0.4);
  animation: dotActive 0.5s ease;
}

.dr-dot.correct {
  border-color: var(--success);
  background: rgba(40, 167, 69, 0.3);
  color: var(--success);
  box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
}

.dr-dot.correct::after {
  content: '✓';
}

.dr-dot.wrong {
  border-color: var(--danger);
  background: rgba(220, 53, 69, 0.3);
  color: var(--danger);
  box-shadow: 0 0 8px rgba(220, 53, 69, 0.4);
}

.dr-dot.wrong::after {
  content: '✗';
}

.dr-dot.timeout {
  border-color: var(--warning);
  background: rgba(255, 193, 7, 0.2);
  color: var(--warning);
}

.dr-dot.timeout::after {
  content: '⏰';
  font-size: 12px;
}

@keyframes dotActive {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.dr-remaining {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}

.dr-question-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  width: 100%;
  max-width: 400px;
}

.dr-question-text {
  font-size: 36px;
  font-weight: 900;
  color: var(--text-bright);
  margin-bottom: 24px;
  text-align: center;
  animation: bounceIn 0.4s ease;
}

.dr-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.dr-choice-btn {
  padding: 16px 10px;
  font-size: 24px;
  font-weight: 700;
  background: rgba(74, 144, 217, 0.15);
  color: var(--text-bright);
  border: 2px solid rgba(74, 144, 217, 0.4);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dr-choice-btn:active {
  transform: scale(0.95);
}

.dr-choice-btn:hover {
  background: rgba(74, 144, 217, 0.3);
  border-color: var(--primary);
}

.dr-choice-btn.correct {
  background: rgba(40, 167, 69, 0.4) !important;
  border-color: var(--success) !important;
  animation: pulse 0.3s ease;
}

.dr-choice-btn.wrong {
  background: rgba(220, 53, 69, 0.4) !important;
  border-color: var(--danger) !important;
  animation: shake 0.4s ease;
}

.dr-choice-btn:disabled {
  pointer-events: none;
  opacity: 0.6;
}

/* ========== 双倍奖励结算 ========== */
.dr-result {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
}

.dr-result-emoji {
  font-size: 72px;
  animation: bounceIn 0.5s ease;
}

.dr-result-msg {
  font-size: 24px;
  font-weight: 800;
  color: var(--gold);
  text-align: center;
}

.dr-result-detail {
  font-size: 16px;
  color: var(--text-bright);
  text-align: center;
  padding: 12px 20px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.2);
}
