/* ⚔️ 쿠키 배틀 화면 꾸미기 */

.경기장 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
  margin: 20px auto;
  max-width: 720px;
}

.선수 {
  position: relative;
  background: #ffffff;
  border-radius: 24px;
  width: 240px;
  padding: 16px 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  border: 6px solid #cfcfcf;
  transition: transform 0.15s;
}

.선수.우리편 { border-color: #2f8fe0; }
.선수.상대편 { border-color: #e0567a; }

.선수 h3 { font-size: 22px; margin: 8px 0 4px; }
.선수 .소개 { font-size: 15px; color: #6b5344; margin: 4px 0; }

/* 체력 막대 */
.체력칸 {
  background: #e6ded4;
  border-radius: 999px;
  height: 22px;
  overflow: hidden;
  margin: 8px 0 4px;
  border: 2px solid #d3c8ba;
}

.체력칸 b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6bcB77, #a8e063);
  border-radius: 999px;
  transition: width 0.35s ease-out, background 0.3s;
}

/* 체력이 줄면 색이 바뀌어요 */
.체력칸.보통 b { background: linear-gradient(90deg, #ffd93d, #ffb347); }
.체력칸.위험 b { background: linear-gradient(90deg, #ff6b6b, #e0567a); }

.체력숫자 {
  font-size: 18px;
  font-weight: bold;
  transition: color 0.2s;
}

.체력숫자.깎임 { color: #e0567a; animation: 콩콩 0.3s; }

@keyframes 콩콩 {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.대결글자 {
  font-size: 40px;
  align-self: center;
  color: #ffffff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
}

/* 💥 공격 모션 : 상대에게 달려들었다 돌아와요 */
.우리편.달려듦 { animation: 오른쪽돌진 0.5s ease-in-out; }
.상대편.달려듦 { animation: 왼쪽돌진 0.5s ease-in-out; }

@keyframes 오른쪽돌진 {
  0% { transform: translateX(0) rotate(0); }
  40% { transform: translateX(60px) rotate(8deg); }
  60% { transform: translateX(50px) rotate(-4deg); }
  100% { transform: translateX(0) rotate(0); }
}

@keyframes 왼쪽돌진 {
  0% { transform: translateX(0) rotate(0); }
  40% { transform: translateX(-60px) rotate(-8deg); }
  60% { transform: translateX(-50px) rotate(4deg); }
  100% { transform: translateX(0) rotate(0); }
}

/* 아플 때 흔들려요 */
.맞음 { animation: 흔들 0.3s; }

@keyframes 흔들 {
  0% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  50% { transform: translateX(10px); }
  75% { transform: translateX(-6px); }
  100% { transform: translateX(0); }
}

/* 💢 맞은 자리에 뜨는 숫자 */
.데미지글 {
  position: absolute;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  font-size: 32px;
  font-weight: bold;
  color: #e0567a;
  text-shadow: 2px 2px 0 #ffffff;
  pointer-events: none;
  animation: 위로뿅 0.9s ease-out forwards;
}

.데미지글.빗나감 { color: #2f8fe0; font-size: 24px; }
.데미지글.필살 { color: #ff8c00; font-size: 38px; }

@keyframes 위로뿅 {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.6); }
  30% { opacity: 1; transform: translate(-50%, -10px) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(1); }
}

/* 💥 부딪히는 순간 반짝 */
.번쩍 {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  font-size: 54px;
  pointer-events: none;
  animation: 팡 0.45s ease-out forwards;
}

@keyframes 팡 {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  40% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
}

/* 쓰러지면 옆으로 넘어져요 */
.쓰러짐 {
  opacity: 0.5;
  filter: grayscale(1);
  transform: rotate(-8deg);
}

/* 싸움 기록 */
.기록판 {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  max-width: 620px;
  margin: 16px auto 40px;
  padding: 14px 18px;
  text-align: left;
  max-height: 320px;
  overflow-y: auto;
}

.기록판 p {
  font-size: 17px;
  margin: 6px 0;
  padding: 6px 10px;
  border-radius: 12px;
  background: #fff6ef;
}

.기록판 p.우리편글 { background: #e3f0ff; }
.기록판 p.상대편글 { background: #ffe6ec; }

.기록판 p.승리글 {
  background: #ffd76e;
  font-size: 22px;
  font-weight: bold;
  text-align: center;
}
