/* ==================== 포켓몬 파이터즈 스타일시트 (Pokémon Street Fighters Style) ==================== */

:root {
  --font-main: 'Pretendard', sans-serif;
  --font-arcade: 'Black Han Sans', 'Press Start 2P', sans-serif;
  --font-num: 'Rajdhani', sans-serif;

  --bg-dark: #090d16;
  --bg-panel: rgba(18, 24, 38, 0.85);
  --border-glow: rgba(239, 68, 68, 0.4);
  
  --p1-color: #38bdf8;
  --cpu-color: #ef4444;
  --gold-color: #f59e0b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: #f8fafc;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  user-select: none;
}

.game-wrapper {
  width: 100vw;
  max-width: 1100px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: radial-gradient(circle at 50% 30%, #1e1b4b 0%, #090d16 100%);
  overflow: hidden;
}

/* ==================== SCREEN 1: 캐릭터 선택 화면 ==================== */
.select-screen {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100vh;
  justify-content: space-between;
  position: relative;
}

.select-bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

.select-header {
  text-align: center;
  margin-bottom: 12px;
  z-index: 2;
}

.logo-badge {
  background: #ef4444;
  color: #ffffff;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 4px;
}

.game-logo h1 {
  font-family: var(--font-arcade);
  font-size: 32px;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #ffffff 0%, #fbbf24 50%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 10px rgba(234, 88, 12, 0.6));
}

.logo-sub {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
}

/* 선택 메인 레이아웃 (3단: P1카드 / 캐릭터그리드 / CPU카드) */
.select-main-content {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 18px;
  align-items: stretch;
  z-index: 2;
  flex: 1;
}

.select-card {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.player-select-card {
  border-color: var(--p1-color);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.2);
}

.cpu-select-card {
  border-color: var(--cpu-color);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.2);
}

.card-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.p1-badge, .cpu-badge {
  font-family: var(--font-num);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 12px;
}

.p1-badge { background: #0284c7; color: #ffffff; }
.cpu-badge { background: #b91c1c; color: #ffffff; }

.nickname-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 6px 10px;
  gap: 6px;
  width: 100%;
}

.nickname-input-wrap input {
  background: none;
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-main);
  outline: none;
  width: 100%;
}

.cpu-name {
  font-size: 13px;
  font-weight: 700;
  color: #f87171;
  padding: 4px 0;
}

/* 대형 프리뷰 무대 */
.preview-stage {
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 10px 0;
}

.preview-poke-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6));
  animation: floatIdle 3s ease-in-out infinite;
  z-index: 1;
}

.preview-poke-img.flip {
  transform: scaleX(-1);
}

@keyframes floatIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.preview-shadow {
  position: absolute;
  bottom: 0;
  width: 120px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  filter: blur(4px);
}

.poke-info-box {
  width: 100%;
  text-align: center;
}

.poke-info-box h2 {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
}

.poke-info-box span {
  font-size: 12px;
  color: #94a3b8;
}

.stats-preview {
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-mini {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  font-size: 11px;
  color: #cbd5e1;
  text-align: left;
}

.stat-mini .bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.stat-mini .fill {
  height: 100%;
  background: #38bdf8;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.cpu-select-card .fill {
  background: #ef4444;
}

.special-move-badge {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

/* 중앙 캐릭터 선택 그리드 */
.character-grid-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grid-title {
  font-size: 15px;
  font-weight: 700;
  color: #fbbf24;
  text-align: center;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.char-card {
  background: rgba(30, 41, 59, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.char-card:hover {
  transform: translateY(-4px);
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.char-card.selected {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.25);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}

.char-card.cpu-selected {
  border-color: #ef4444;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

.char-img-thumb {
  width: 65px;
  height: 65px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

.char-name-label {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 4px;
}

.char-type-pill {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  margin-top: 2px;
}

/* 대전 설정 */
.battle-config-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

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

.difficulty-group {
  display: flex;
  gap: 4px;
}

.diff-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}

.diff-btn.active {
  background: #f59e0b;
  color: #000000;
  font-weight: 700;
  border-color: #f59e0b;
}

.battle-config-card select {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}

.btn-proceed-lobby {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
  transition: all 0.2s ease;
}

.btn-proceed-lobby:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.6);
}


/* ==================== SCREEN 2: 대전 전 말풍선 채팅 로비 ==================== */
.lobby-screen {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100vh;
  justify-content: space-between;
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.btn-back {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}

.lobby-header h2 {
  font-size: 18px;
  color: #38bdf8;
  font-family: var(--font-num);
  letter-spacing: 1px;
}

.sub-tip {
  font-size: 12px;
  color: #94a3b8;
}

/* 캐릭터 마주보기 무대 */
.faceoff-stage {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 380px;
  position: relative;
  margin: 20px 0;
}

.fighter-stand {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 280px;
}

/* 애니메이션 말풍선 (Speech Bubble) */
.speech-bubble {
  background: #ffffff;
  color: #0f172a;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 700;
  position: absolute;
  top: -60px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  animation: popBubble 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 260px;
  text-align: center;
  word-break: keep-all;
  z-index: 10;
}

.p1-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0;
  border-style: solid;
  border-color: #ffffff transparent;
}

.cpu-bubble {
  background: #fee2e2;
  border: 1px solid #f87171;
}

.cpu-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0;
  border-style: solid;
  border-color: #fee2e2 transparent;
}

@keyframes popBubble {
  0% { transform: scale(0.6) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.stand-avatar-wrap {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.stand-poke-img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  animation: combatStance 1.8s ease-in-out infinite alternate;
  z-index: 1;
}

.stand-poke-img.flip {
  transform: scaleX(-1);
}

@keyframes combatStance {
  0% { transform: translateY(0) scaleY(1); }
  100% { transform: translateY(-12px) scaleY(1.03); }
}

.stand-platform {
  position: absolute;
  bottom: 0;
  width: 160px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.4) 0%, transparent 70%);
}

.cpu-stand .stand-platform {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.4) 0%, transparent 70%);
}

.stand-name {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 8px;
}

/* VS 센터 배너 & 배틀 버튼 */
.vs-center-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.vs-emblem {
  font-family: var(--font-arcade);
  font-size: 48px;
  color: #fbbf24;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.8), 0 4px 0 #b45309;
  animation: pulseVs 1.5s infinite;
}

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

.btn-fight-start {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  border: 2px solid #fecaca;
  padding: 14px 28px;
  border-radius: 30px;
  font-size: 18px;
  font-family: var(--font-num);
  font-weight: 800;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.8);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  animation: glowBtn 2s infinite;
}

@keyframes glowBtn {
  0%, 100% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.6); }
  50% { box-shadow: 0 0 35px rgba(239, 68, 68, 1); }
}

.btn-fight-start:hover {
  transform: scale(1.08);
}

/* 로비 채팅 패널 */
.lobby-chat-panel {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-taunts-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.taunt-title {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 700;
  white-space: nowrap;
}

.quick-taunt-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.quick-taunt-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.chat-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
}

.chat-input-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 14px 12px 40px;
  color: #ffffff;
  font-size: 14px;
  font-family: var(--font-main);
  outline: none;
}

.chat-input-row input:focus {
  border-color: #38bdf8;
}

.btn-send-chat {
  background: #38bdf8;
  color: #0f172a;
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}


/* ==================== SCREEN 3: 2D 스트리트 파이터 대전 화면 ==================== */
.battle-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  justify-content: space-between;
  padding: 10px 14px;
  position: relative;
}

/* 스트리트 파이터 HUD 체력 바 */
.battle-hud {
  display: grid;
  grid-template-columns: 1fr 100px 1fr;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

.hud-player {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-cpu {
  flex-direction: row-reverse;
}

.hud-avatar-box {
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid #38bdf8;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hud-cpu .hud-avatar-box {
  border-color: #ef4444;
}

.hud-avatar {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.hud-avatar.flip {
  transform: scaleX(-1);
}

.hud-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hud-name-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
}

.hud-player-name {
  color: #ffffff;
}

.hud-hp-num {
  font-family: var(--font-num);
  color: #fbbf24;
}

/* HP 게이지 바 */
.hp-bar-track {
  height: 18px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #ffffff;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.hud-cpu .hp-bar-track {
  transform: scaleX(-1);
}

.hp-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #eab308 60%, #ef4444 100%);
  transition: width 0.15s ease-out;
  z-index: 2;
}

.hp-bar-decay {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  background: #f87171;
  transition: width 0.6s ease-out;
  z-index: 1;
}

/* 초필살기 EX 게이지 */
.super-bar-track {
  height: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.super-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8 0%, #a855f7 70%, #ec4899 100%);
  transition: width 0.2s ease;
}

.super-ready-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  font-weight: 900;
  color: #ffffff;
  display: none;
  animation: blinkSuper 0.6s infinite alternate;
}

@keyframes blinkSuper {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* 중앙 타이머 및 일시정지 버튼 */
.hud-center-timer {
  background: rgba(0, 0, 0, 0.75);
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 4px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.timer-top-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-num {
  font-family: var(--font-arcade);
  font-size: 26px;
  color: #fbbf24;
  line-height: 1;
}

.timer-num.warning {
  color: #ef4444;
  animation: blinkTimer 0.5s infinite alternate;
}

@keyframes blinkTimer {
  from { transform: scale(1); }
  to { transform: scale(1.15); filter: drop-shadow(0 0 8px #ef4444); }
}

.btn-pause-hud {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-pause-hud:hover {
  background: #f59e0b;
  color: #000000;
  transform: scale(1.1);
}

.round-badge {
  font-size: 9px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1px;
}

/* ==================== 일시정지 & 나가기 모달 ==================== */
.pause-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.pause-card {
  background: #0f172a;
  border: 2px solid #38bdf8;
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pause-icon {
  font-size: 40px;
  color: #38bdf8;
  margin-bottom: 8px;
}

.pause-card h2 {
  font-family: var(--font-arcade);
  font-size: 22px;
  color: #ffffff;
  letter-spacing: 1px;
}

.pause-sub {
  font-size: 12px;
  color: #94a3b8;
  margin: 6px 0 20px;
}

.pause-menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.btn-pause-opt {
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-pause-opt.resume {
  background: #38bdf8;
  color: #0f172a;
}

.btn-pause-opt.exit-lobby {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-pause-opt.exit-select {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-pause-opt:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

/* 장풍 및 키 가이드 스타일 */
.key-item.blast {
  border-color: #38bdf8;
  color: #38bdf8;
}

.key-item.blast kbd {
  background: #0284c7;
  color: #ffffff;
}

.key-item.pause kbd {
  background: #64748b;
}

.action-btn.blast {
  background: #06b6d4;
  color: #ffffff;
}

/* 콤보 카운터 알림 */
.combo-notice-p1, .combo-notice-cpu {
  position: absolute;
  top: 90px;
  display: flex;
  flex-direction: column;
  z-index: 20;
  animation: popCombo 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.combo-notice-p1 { left: 24px; }
.combo-notice-cpu { right: 24px; text-align: right; }

.combo-hits {
  font-family: var(--font-arcade);
  font-size: 28px;
  color: #fbbf24;
  text-shadow: 0 0 10px #f59e0b, 2px 2px 0 #000000;
}

.combo-text {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

@keyframes popCombo {
  0% { transform: scale(0.5); }
  100% { transform: scale(1); }
}

/* 배틀 오나운스 배너 (ROUND 1 / FIGHT / KO) */
.battle-announcement-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  pointer-events: none;
}

.announcement-text {
  font-family: var(--font-arcade);
  font-size: 64px;
  color: #ffffff;
  text-shadow: 0 0 30px #ef4444, 4px 4px 0 #000000;
  animation: announceAnim 1.2s ease forwards;
  letter-spacing: 4px;
  white-space: nowrap;
}

@keyframes announceAnim {
  0% { transform: scale(0.2); opacity: 0; }
  50% { transform: scale(1.1); opacity: 1; }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* 캔버스 뷰포트 */
.canvas-stage-wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #000000;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

#battleCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 하단 조작 안내 & 가상 컨트롤러 */
.battle-bottom-controls {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.key-guide-panel {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
}

.key-item {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #cbd5e1;
}

.key-item kbd {
  background: #334155;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 700;
}

.key-item.special {
  border-color: #f59e0b;
  color: #fbbf24;
}

.key-item.special kbd {
  background: #f59e0b;
  color: #000000;
}

/* 대전 모드 전환 탭 */
.mode-switch-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.mode-tab-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.mode-tab-btn.active {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}

/* 온라인 설정 카드 */
.online-config-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.online-action-row {
  display: flex;
  gap: 8px;
}

.btn-online-act {
  flex: 1;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid #38bdf8;
  color: #38bdf8;
  padding: 8px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-online-act:hover {
  background: #38bdf8;
  color: #0f172a;
}

.room-code-input-row {
  display: flex;
  gap: 6px;
}

.room-code-input-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 6px 10px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  font-family: monospace;
  letter-spacing: 1px;
  outline: none;
}

.btn-join-room {
  background: #f59e0b;
  color: #000000;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.online-status-msg {
  font-size: 11px;
  color: #fbbf24;
  text-align: center;
  min-height: 16px;
}

/* 로비 헤더 룸코드 배지 */
.lobby-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lobby-room-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.room-code-tag {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid #38bdf8;
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
}

.btn-copy-link {
  background: #38bdf8;
  color: #0f172a;
  border: none;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.online-wait-alert {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  color: #fbbf24;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
  animation: pulseWait 1.5s infinite alternate;
}

@keyframes pulseWait {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* 모바일 터치패드 고도화 (멀티터치 대응) */
.mobile-touch-pad {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  touch-action: none;
  user-select: none;
}

.dpad-wrap {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(2, 44px);
  gap: 6px;
}

.btn-left { grid-column: 1; grid-row: 2; }
.btn-jump { grid-column: 2; grid-row: 1; }
.btn-down { grid-column: 2; grid-row: 2; }
.btn-right { grid-column: 3; grid-row: 2; }

.action-buttons-wrap {
  display: flex;
  flex-wrap: wrap;
  max-width: 170px;
  gap: 6px;
  justify-content: flex-end;
}

.touch-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.touch-btn:active, .touch-btn.active {
  background: rgba(255, 255, 255, 0.5) !important;
  transform: scale(0.92);
}

.action-btn.punch { background: #0284c7; color: #ffffff; border-color: #38bdf8; }
.action-btn.kick { background: #ea580c; color: #ffffff; border-color: #fb923c; }
.action-btn.blast { background: #0891b2; color: #ffffff; border-color: #22d3ee; }
.action-btn.guard { background: #059669; color: #ffffff; border-color: #34d399; }
.action-btn.super { background: #9333ea; color: #ffffff; border-color: #c084fc; width: 50px; height: 50px; }

.action-btn span {
  font-size: 8px;
  opacity: 0.9;
}

/* 모바일 미디어 쿼리 최적화 */
@media (max-width: 800px) {
  .select-main-content {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .cpu-select-card {
    display: none;
  }

  .faceoff-stage {
    height: 240px;
  }

  .fighter-stand {
    width: 130px;
  }

  .stand-avatar-wrap {
    width: 110px;
    height: 110px;
  }

  .speech-bubble {
    font-size: 12px;
    padding: 8px 12px;
    top: -45px;
  }

  .mobile-touch-pad {
    display: flex;
  }

  .key-guide-panel {
    display: none;
  }
}
