/* 1. 글로벌 테마 및 리셋 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0b0f19;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #f3f4f6;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  background-color: #050202;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* 2. 오버레이 공통 스타일 (Glassmorphism) */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* 픽셀아트 야간 전장. 예전 blood_splatter 사진은 "무섭다"는 의견이 많았고
     게임의 도트 아트와도 톤이 맞지 않았다. 320x180 로 그린 뒤 확대해
     계단 픽셀을 그대로 살린다 (pixelated). */
  background: linear-gradient(180deg, rgba(8, 12, 26, 0.28) 0%, rgba(6, 10, 20, 0.45) 100%),
              url('assets/bg_arena_pixel.png') no-repeat center center;
  background-size: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 40px 0;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.glass-panel {
  background: rgba(12, 18, 32, 0.82);
  border: 1px solid rgba(96, 165, 250, 0.14);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(148, 197, 255, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  max-width: 480px;
  width: 90%;
  margin: auto;
}

/* 3. 대기/스타트 스크린 */
.skull-emblem {
  font-size: 3.8rem;
  margin-bottom: 5px;
  filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.65));
  animation: skullPulse 1.8s infinite ease-in-out;
  display: inline-block;
}

@keyframes skullPulse {
  0% { transform: scale(0.95); filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.9)); }
  100% { transform: scale(0.95); filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5)); }
}

.logo {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #ff3333 0%, #8b0000 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  text-shadow: 0 0 25px rgba(239, 68, 68, 0.4);
}

.tagline {
  color: #9ca3af;
  margin-bottom: 35px;
  font-size: 1.05rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#username-input {
  background: rgba(17, 24, 39, 0.8);
  border: 2px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 1.1rem;
  color: #fff;
  outline: none;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* 관전자 모드에서 이름은 '관전자'로 고정된다 — 잠긴 상태를 눈으로 알려준다 */
#username-input.is-locked {
  color: #4facfe;
  border-color: rgba(79, 172, 254, 0.45);
  background: rgba(79, 172, 254, 0.08);
  cursor: not-allowed;
}

#username-input:focus {
  border-color: #ef4444;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

#start-button, .accent-btn {
  background: linear-gradient(135deg, #dc2626 0%, #7f1d1d 100%);
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f3f4f6;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
}

#start-button:hover, .accent-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(220, 38, 38, 0.4);
}

#start-button:active, .accent-btn:active {
  transform: translateY(0);
}

.controls-guide {
  background: rgba(17, 24, 39, 0.4);
  border-radius: 16px;
  padding: 20px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.03);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.controls-guide h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: #e5e7eb;
}

.controls-guide ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.controls-guide li {
  font-size: 0.9rem;
  color: #9ca3af;
}

.controls-guide strong {
  color: #4facfe;
}

/* ── 메인(스타트) 화면 가로 레이아웃 ────────────────────────────────
   예전에는 480px 폭에 로고·입력·서버목록·조작법을 세로로 다 쌓아서
   1080p 화면에서도 전체 높이가 1686px, 즉 686px 을 스크롤해야 했다.
   대기실과 같은 방식으로 눕혀서 한 화면에 담는다. */
.start-box {
  max-width: 1240px !important;
  width: min(96vw, 1240px);
  /* .overlay 가 위아래 40px 씩 패딩을 주므로 그만큼 빼야 오버레이가 스크롤되지 않는다 */
  max-height: calc(100vh - 80px);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;          /* 스크롤은 각 컬럼이 알아서 한다 */
}

.start-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: left;
  flex-shrink: 0;
}

.start-header .skull-emblem {
  font-size: 3rem;
  margin-bottom: 0;
}

.start-title { display: flex; flex-direction: column; }

.start-header .logo {
  font-size: 2.6rem;
  letter-spacing: 3px;
  margin-bottom: 2px;
}

.start-header .tagline {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.start-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 18px;
  flex: 1;
  min-height: 0;
  text-align: left;
}

/* 세 열을 같은 카드로 세운다. 판을 안 깔면 입력 열이 그냥 빈 여백처럼 보인다 */
.start-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  min-width: 0;
  background: rgba(17, 24, 39, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 18px;
}

/* 조작법은 이미 컬럼이 판을 깔았으므로 자기 배경은 벗긴다 (이중 카드 방지) */
.start-col .controls-guide {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
}

.start-col-title {
  font-size: 1rem;
  color: #e5e7eb;
  font-weight: 700;
}

/* 조작법은 항목이 많아 가장 먼저 넘친다 — 이 컬럼만 스크롤을 허용한다 */
.start-col--guide .controls-guide h3 { margin-bottom: 10px; }

.start-box .footer-copyright {
  margin-top: 0;
  flex-shrink: 0;
}

/* 좁은 화면에서는 2열 → 1열로 접는다 */
@media (max-width: 1100px) {
  .start-grid { grid-template-columns: 300px minmax(0, 1fr); }
  .start-col--guide { grid-column: 1 / -1; max-height: 30vh; }
}

@media (max-width: 720px) {
  .start-box { max-height: none; overflow-y: auto; }
  .start-grid { grid-template-columns: 1fr; }
  .start-header { flex-direction: column; text-align: center; }
  .start-col--guide { max-height: none; }
}


/* 4. 게임 HUD 플레이 상태 */
#game-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* HUD 패널 공통 */
.hud-panel {
  position: absolute;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  pointer-events: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* 접속 유저 현황 (좌측 상단) */
.stats-panel {
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #d1d5db;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.stat-dot.total { background: #38bdf8; box-shadow: 0 0 8px #38bdf8; }
.stat-dot.survivors { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.stat-dot.dead { background: #f87171; box-shadow: 0 0 8px #f87171; }

.danger-banner {
  width: 196px;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(153, 27, 27, 0.95) 100%);
  border: 1.5px solid #ef4444;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  pointer-events: auto;
  text-align: center;
  white-space: normal;
  line-height: 1.4;
  animation: dangerPulse 1.5s infinite alternate;
  z-index: 6;
}

@keyframes dangerPulse {
  from { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }
  to { transform: scale(1.03); box-shadow: 0 0 20px rgba(239, 68, 68, 0.55); }
}

/* 우측 상단 그룹 (미니맵 + 킬피드) */
.top-right-group {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  z-index: 6;
}

/* 미니맵 */
.minimap-container {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.minimap-container canvas {
  position: relative;
  background: #090c15;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.minimap-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: #9ca3af;
  margin-top: 6px;
  letter-spacing: 1.5px;
}

/* 킬 피드 */
.kill-feed {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.kill-item {
  background: rgba(15, 23, 42, 0.85);
  border-left: 4px solid #ef4444;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideInRight 0.3s forwards, fadeOut 0.5s 4.5s forwards;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

@keyframes slideInRight {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* 캐릭터 상태 (좌측 하단) */
/* 좌하단 스택 — 아군 상태 HUD가 캐릭터 패널 위에 얹힌다.
   각자 absolute 좌표를 잡으면 캐릭터 패널 높이가 바뀔 때마다 겹치므로 flex로 쌓는다. */
.hud-left-bottom {
  position: absolute;
  left: 20px;
  bottom: 20px;
  width: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  pointer-events: none;   /* 자식 패널만 마우스를 받는다 */
  z-index: 5;
}

.char-panel {
  position: static;       /* .hud-left-bottom 이 배치를 담당 */
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.player-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.level-badge {
  background: #ffcc00;
  color: #111827;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

.player-names {
  display: flex;
  flex-direction: column;
}

.char-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.kills-badge {
  font-size: 0.75rem;
  color: #ef4444;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ❤️ 목숨 표시 (한눈에 보이도록 별도 강조) */
.lives-display {
  margin-left: auto;
  font-size: 1.3rem;
  letter-spacing: 2px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  padding: 4px 10px;
  white-space: nowrap;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.5));
}

/* 프로그레스 바 공통 */
.bar-container {
  position: relative;
  width: 100%;
  height: 20px;
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  transition: width 0.1s ease-out;
}

.bar-text {
  position: absolute;
  width: 100%;
  text-align: center;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.hp-fill {
  background: linear-gradient(90deg, #ef4444, #f87171);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.xp-fill {
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* 장비 그리드 */
.gear-status h4 {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.gear-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 4열 -> 3열로 변경하여 3x2 정렬 */
  gap: 6px;
}

.gear-slot {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 6px;
  text-align: center;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

/* 주무기 전용 슬롯 데코레이션 */
.gear-slot.weapon-slot {
  border-color: rgba(251, 191, 36, 0.5); /* 골드 네온 보더 */
  background: rgba(251, 191, 36, 0.1);
}

.gear-slot.weapon-slot .gear-lvl {
  color: #fbbf24;
  font-weight: 700;
}

.gear-lvl {
  font-size: 0.65rem;
  font-weight: 700;
  color: #9ca3af;
}

.gear-slot.active-upgrade {
  border-color: rgba(79, 172, 254, 0.5);
  background: rgba(79, 172, 254, 0.1);
}

.gear-slot.active-upgrade .gear-lvl {
  color: #38bdf8;
}

/* 5. 레벨업 업그레이드 선택 - 하단 상시 UI (비블로킹) */
.upgrade-bar {
  position: fixed;
  left: 50%;
  bottom: 130px;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(22, 14, 14, 0.85);
  border: 1px solid rgba(255, 204, 0, 0.3);
  border-radius: 16px;
  padding: 10px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  animation: scaleUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
  from { transform: translateX(-50%) scale(0.9); opacity: 0; }
  to { transform: translateX(-50%) scale(1); opacity: 1; }
}

.upgrade-bar-label {
  font-weight: 800;
  color: #ffcc00;
  text-shadow: 0 0 10px rgba(255, 204, 0, 0.4);
  font-size: 0.85rem;
  white-space: nowrap;
}

.upgrade-bar-badge {
  background: rgba(255, 51, 102, 0.15);
  border: 1px solid rgba(255, 51, 102, 0.3);
  color: #ff3366;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.upgrade-bar-cards {
  display: flex;
  gap: 8px;
}

/* 무기 강화가 레벨 조건 때문에 카드에서 빠져 있을 때의 안내.
   조용히 사라지면 "왜 안 나오지"가 되므로 언제 다시 나오는지를 적는다. */
.upgrade-bar-gate {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 5px 9px;
  white-space: nowrap;
}

.upgrade-mini-card {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 84px;
}

.mini-hotkey {
  position: absolute;
  top: -8px;
  right: -6px;
  min-width: 16px;
  text-align: center;
  background: #ffcc00;
  color: #111827;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 6px;
  box-shadow: 0 0 6px rgba(255, 204, 0, 0.4);
}

.upgrade-mini-card:hover {
  transform: translateY(-4px);
  border-color: #ffcc00;
  box-shadow: 0 8px 18px rgba(255, 204, 0, 0.2);
}

.upgrade-mini-card .mini-icon {
  font-size: 1.5rem;
}

.upgrade-mini-card .mini-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.upgrade-mini-card .mini-lvl {
  font-size: 0.6rem;
  color: #ffcc00;
}

/* 6. 게임 오버 화면 */
.gameover-box {
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.gameover-title {
  font-size: 3rem;
  font-weight: 800;
  color: #ef4444;
  text-shadow: 0 0 25px rgba(239, 68, 68, 0.4);
  margin-bottom: 12px;
}

.gameover-msg {
  color: #9ca3af;
  margin-bottom: 30px;
}

.summary-stats {
  display: flex;
  justify-content: space-around;
  background: rgba(17, 24, 39, 0.5);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 30px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-item .label {
  font-size: 0.85rem;
  color: #9ca3af;
}

.summary-item .value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

#respawn-button {
  width: 100%;
}

/* 시작 무기 선택 UI 스타일 */
.start-weapon-container {
  text-align: left;
  margin-top: 15px;
  width: 100%;
}

.start-weapon-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #d1d5db;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

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

.start-weapon-card {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 8px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.start-weapon-card:hover {
  transform: translateY(-3px);
  border-color: rgba(251, 191, 36, 0.4);
}

.start-weapon-card.active {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.2);
}

.start-weapon-icon {
  font-size: 2.2rem;
}

.start-weapon-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
}

.start-weapon-desc {
  font-size: 0.65rem;
  color: #9ca3af;
  line-height: 1.3;
}

/* [신설] 제한시간 타이머 스타일 */
.top-center-group {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 6;
  gap: 8px;
  pointer-events: none;
}

.timer-display {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 20px;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
}

/* [신설] 우승 세레머니 화면 스타일 */
.victory-box {
  border-color: rgba(251, 191, 36, 0.4) !important;
  box-shadow: 0 20px 50px rgba(251, 191, 36, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.victory-title {
  font-size: 3.5rem;
  font-weight: 800;
  color: #fbbf24;
  text-shadow: 0 0 30px rgba(251, 191, 36, 0.6);
  margin-bottom: 12px;
}

.victory-msg {
  color: #e5e7eb;
  margin-bottom: 30px;
  font-size: 1.05rem;
}

.animate-victory {
  animation: victoryPulse 2s infinite alternate, scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes victoryPulse {
  from { box-shadow: 0 20px 50px rgba(251, 191, 36, 0.15); }
  to { box-shadow: 0 20px 60px rgba(251, 191, 36, 0.35); }
}

/* [신설] 하단 HUD 통합 스타일 (소모품 + 스킬) */
.bottom-center-hud {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  pointer-events: auto;
  z-index: 6;
}

/* 스킬 바 */
.skill-bar {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 10px 16px;
  display: flex;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.skill-slot {
  position: relative;
  width: 72px;
  height: 72px;
  background: rgba(17, 24, 39, 0.8);
  border: 2px solid rgba(56, 189, 248, 0.3); /* 연파랑 보더 */
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.15);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, filter 0.25s;
}

/* 스킬 잠금 해제 활성화 */
.skill-slot.unlocked {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.05);
}

/* 3차 전직 궁극기 특화 */
.skill-slot[data-skill="E"].unlocked {
  border-color: #f59e0b; /* 황금색 */
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.05);
}

/* 대시 스킬 특화 (초록 계열) */
.skill-slot[data-skill="Space"] {
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.05);
}

.skill-slot[data-skill="Space"] .skill-num {
  color: #10b981;
}

/* 스킬 미각성 상태 */
.skill-slot.locked {
  border-color: rgba(255, 255, 255, 0.05);
  filter: grayscale(1);
  opacity: 0.6;
}

.skill-num {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(0,0,0,0.4);
  padding: 1px 4px;
  border-radius: 4px;
}

.skill-slot[data-skill="E"] .skill-num {
  color: #f59e0b;
}

.skill-icon {
  font-size: 1.6rem;
  margin-top: 4px;
}

.skill-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: #9ca3af;
  margin-top: 2px;
  text-align: center;
}

.skill-slot.unlocked .skill-name {
  color: #e5e7eb;
}

/* 쿨타임 딤드 오버레이 효과 */
.skill-cooldown-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%; /* JS에서 동적으로 설정 */
  background: rgba(15, 23, 42, 0.75);
  transition: height 0.1s linear;
  pointer-events: none;
}

.skill-cooldown-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffcc00;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9);
  pointer-events: none;
}

/* 대기실 듀오 팀 선택 UI */
.lobby-team-section {
  margin: 16px 0;
  padding: 12px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.lobby-team-section h3 {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 8px;
  text-align: center;
}

/* 🚩 LoL 스타일 팀 보드 */

/* 헤더 부제 — 허용 조합을 상시 노출 */
.team-rule {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  margin-left: 6px;
}

/* 시작 가능 여부 실시간 배너 */
.team-start-status {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.team-start-status.ok {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

/* 미선택 영역을 라벨과 함께 명확히 구분 */
.team-unassigned-wrap {
  background: rgba(15, 23, 42, 0.35);
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  padding: 7px 9px;
  margin-bottom: 10px;
}

.team-unassigned-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}

/* 팀별 인원 카운터 */
.team-count {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 1px 8px;
  margin-left: 4px;
  vertical-align: middle;
}

.team-count.full {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

/* 팀 컬럼에 소속 색을 입혀 좌우 구분을 강화 */
.team-column-1 {
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: inset 0 0 22px rgba(239, 68, 68, 0.06);
}

.team-column-2 {
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: inset 0 0 22px rgba(59, 130, 246, 0.06);
}

/* 본인 카드 강조 — 내가 어느 팀인지 즉시 식별 */
.team-member-card.is-self {
  border-color: rgba(34, 211, 238, 0.7);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.25);
}

.self-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  background: #22d3ee;
  color: #06283d;
  border-radius: 8px;
  padding: 0 6px;
  margin-left: 5px;
  vertical-align: middle;
}

.team-unassigned-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 10px;
  margin-bottom: 10px;
  justify-content: center;
}

.team-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.team-column {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
  padding: 8px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.team-column-header {
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 4px 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2px;
}

.team-header-1 {
  color: #ef4444;
}

.team-header-2 {
  color: #3b82f6;
}

.team-member-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.team-member-card.is-host {
  border-color: rgba(251, 191, 36, 0.35);
}

.team-member-card.is-bot {
  border-color: rgba(148, 163, 184, 0.35);
}

.team-card-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-mini-controls {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.team-mini-btn {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(31, 41, 55, 0.8);
  color: #9ca3af;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}

.team-mini-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.team-mini-btn.active:nth-child(1) {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ef4444;
}

.team-mini-btn.active:nth-child(2) {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  color: #3b82f6;
}

/* 7. 멀티 매칭 시스템 추가 스타일 */
.room-action-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

#room-name-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(17, 24, 39, 0.8);
  border: 2px solid rgba(79, 172, 254, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.95rem;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.mode-select {
  width: 100%;
  box-sizing: border-box;
  background: rgba(17, 24, 39, 0.8);
  border: 2px solid rgba(79, 172, 254, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.95rem;
  color: #fff;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

#create-room-btn {
  width: 100%;
  box-sizing: border-box;
  padding: 14px;
}

.mode-select:focus:not(:disabled) {
  border-color: #ef4444;
}

#room-name-input:focus:not(:disabled) {
  border-color: #ef4444;
}

#room-name-input:disabled,
#create-room-btn:disabled,
#refresh-rooms-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.room-list-section {
  text-align: left;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.room-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.room-list-header h3 {
  font-size: 1rem;
  color: #e5e7eb;
}

.refresh-btn {
  background: rgba(79, 172, 254, 0.15);
  border: 1px solid rgba(79, 172, 254, 0.3);
  color: #38bdf8;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.refresh-btn:hover:not(:disabled) {
  background: rgba(79, 172, 254, 0.3);
  transform: translateY(-1px);
}

.room-list-container {
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.no-rooms-msg {
  text-align: center;
  color: #6b7280;
  font-size: 0.85rem;
  margin-top: 40px;
}

.room-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 14px;
  transition: border-color 0.2s;
}

.room-item:hover {
  border-color: rgba(79, 172, 254, 0.4);
}

.room-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.room-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.room-item-count {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* 방 목록에 팀별 인원을 노출해 진입 전에 상황을 파악할 수 있게 함 */
.room-item-teams {
  display: flex;
  gap: 6px;
  margin-top: 3px;
}

.team-chip {
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 1px 7px;
}

.team-chip-1 {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.team-chip-2 {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* 정원이 찬 방은 흐리게 처리하고 참가 버튼을 잠근다 */
.room-item.room-full {
  opacity: 0.55;
}

.room-item.room-full:hover {
  border-color: rgba(255, 255, 255, 0.05);
}

.room-full-tag {
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  padding: 0 6px;
  margin-left: 5px;
  vertical-align: middle;
}

.join-room-btn:disabled {
  background: rgba(100, 116, 139, 0.5);
  cursor: not-allowed;
  opacity: 0.7;
}

.join-room-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
  transition: transform 0.1s;
}

.join-room-btn:hover {
  transform: translateY(-1px);
}

/* 대기실 (Lobby) */
.lobby-box {
  /* 세로로 길게 쌓이면 인원이 늘 때마다 스크롤이 생긴다. 가로로 넓게 펴서
     1팀 · 2팀 · 사이드(미선택·관전자·봇)를 한 화면에 나란히 둔다. */
  max-width: 1180px !important;
  width: min(96vw, 1180px);
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#lobby-room-name {
  font-size: 2rem;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 4px;
}

#lobby-players-count {
  font-size: 0.95rem;
  color: #9ca3af;
  margin-bottom: 25px;
}

.lobby-members-section {
  text-align: left;
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 25px;
}

.lobby-members-section h3 {
  font-size: 0.95rem;
  color: #d1d5db;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.lobby-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.lobby-member-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.lobby-member-tag.is-host {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.05);
}

/* 🎥 관전자 슬롯 표기 */
.lobby-member-tag.is-observer {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.06);
}

/* 🤖 봇 표기 */
.lobby-member-tag.is-bot {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.06);
}

.host-badge {
  background: #fbbf24;
  color: #111827;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.lobby-member-tag.is-observer .host-badge {
  background: #22d3ee;
}

.lobby-member-tag.is-bot .host-badge {
  background: #94a3b8;
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* 버튼이 패널 폭 전체로 늘어나 지나치게 길어 보였다.
   글자 길이에 맞추되 최소 폭만 확보해 누르기 편한 크기를 유지한다.
   대기 메시지는 안내문이므로 폭을 그대로 채운다. */
.lobby-actions .accent-btn,
.lobby-actions .danger-btn {
  width: auto;
  min-width: 200px;
  padding-left: 34px;
  padding-right: 34px;
}

.lobby-actions .waiting-msg {
  align-self: stretch;
}

.waiting-msg {
  color: #fbbf24;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 14px;
  background: rgba(251, 191, 36, 0.05);
  border: 1px dashed rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  text-align: center;
  animation: waitPulse 1.5s infinite alternate;
}

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

.danger-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: #fff;
  border-radius: 12px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
  transition: transform 0.1s;
}

.danger-btn:hover {
  transform: translateY(-2px);
}

/* 🤖 대기실 봇 추가/제거 */
.lobby-bot-section {
  margin: 16px 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lobby-bot-controls {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.secondary-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f3f4f6;
  border-radius: 12px;
  padding: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
}

.secondary-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 204, 0, 0.4);
}

/* 직업 선택 */
.class-select-box {
  max-width: 580px !important;
}

#select-class-btn {
  width: 100%;
  margin-top: 25px;
}

.hidden-wait-msg {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hidden-wait-msg p {
  color: #fbbf24;
  font-weight: 700;
  font-size: 0.95rem;
}

/* 스피너 */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(251, 191, 36, 0.1);
  border-top-color: #fbbf24;
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden-wait-msg.hidden {
  display: none !important;
}

/* --- 🎥 7. 관전자(옵저버) 및 팀 HUD 스타일 --- */

/* 관전자 체크박스 */
.observer-checkbox-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -8px;
  margin-bottom: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #9ca3af;
  transition: color 0.2s;
}

.checkbox-label:hover {
  color: #4facfe;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(79, 172, 254, 0.4);
  border-radius: 4px;
  display: inline-block;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkbox {
  background: #4facfe;
  border-color: #00f2fe;
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkbox::after {
  content: '✓';
  position: absolute;
  top: -2px;
  left: 3px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: bold;
}

/* 👥 팀원 상태 HUD (좌측 하단 캐릭터 패널 위) */
.team-status-panel {
  position: static;       /* .hud-left-bottom 이 배치를 담당 */
  width: 100%;
  max-height: 34vh;
  overflow-y: auto;
  background: rgba(18, 25, 41, 0.75);
  border: 1px solid rgba(16, 185, 129, 0.2); /* 초록빛 테두리 */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 10px rgba(16, 185, 129, 0.05);
}

.team-status-panel h4 {
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: #10b981;
  letter-spacing: 1px;
}

.team-members-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-member-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-left: 3px solid #10b981;
}

.team-member-row.dead {
  border-left-color: #ef4444;
  opacity: 0.6;
}

.team-member-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.team-member-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.team-member-hp-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.team-member-hp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  border-radius: 3px;
  transition: width 0.15s ease-out;
}

.team-member-row.dead .team-member-hp-bar-fill {
  background: #4b5563;
}

/* 🎥 옵저버 스코어보드 독 — LoL 관전 화면처럼 중앙 하단 가로 배치.
   예전에는 좌측 세로 사이드바(max-height:400px)라 10명이면 내용 592px 로 194px 이 잘려
   반드시 스크롤해야 했다. 팀을 좌우 두 열로 세우면 5행이면 끝나서 스크롤이 사라진다. */
.observer-dock {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(1120px, 96vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  z-index: 6;
  pointer-events: none;
}

.observer-dock-toggle {
  pointer-events: auto;
  border: 1px solid rgba(79, 172, 254, 0.35);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #4facfe;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 18px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.observer-dock-toggle:hover {
  background: rgba(79, 172, 254, 0.18);
  color: #bfe6ff;
}

.observer-dock-body {
  pointer-events: auto;
  width: 100%;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(79, 172, 254, 0.22);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  padding: 10px 14px 8px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4);
}

/* 접힘 상태 — 토글 버튼만 남는다 */
.observer-dock.collapsed .observer-dock-body { display: none; }

.obs-team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.obs-team-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.obs-team-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 4px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.obs-team-tag {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.obs-team-col.team-1 .obs-team-tag { color: #ef4444; }
.obs-team-col.team-2 .obs-team-tag { color: #3b82f6; }

.obs-team-score {
  font-size: 0.75rem;
  color: #9ca3af;
  font-weight: 700;
}

.obs-team-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* 한 선수 = 한 행. 레벨 · 이름 · HP바 · K/D 가 한 줄에 들어간다 */
.obs-player-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 84px 52px;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  pointer-events: auto;
}

/* 자식 요소들의 마우스 이벤트를 차단하고 부모 행이 직접 수신하게 함 (클릭 인식 범위 확대) */
.obs-player-row * { pointer-events: none; }

.obs-player-row:hover {
  background: rgba(79, 172, 254, 0.1);
}

.obs-player-row.active-lock {
  background: rgba(0, 242, 254, 0.14);
  box-shadow: inset 0 0 0 1px #00f2fe;
}

.obs-player-row.dead {
  opacity: 0.45;
  cursor: not-allowed;
}

.obs-player-lv {
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
  color: #111827;
  background: #ffcc00;
  border-radius: 4px;
  padding: 1px 0;
}

.obs-player-row.dead .obs-player-lv {
  background: #4b5563;
  color: #d1d5db;
}

.obs-player-name {
  font-size: 0.78rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.obs-player-hp-bar {
  position: relative;
  height: 12px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 3px;
  overflow: hidden;
}

.obs-player-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  transition: width 0.15s ease-out;
}

.obs-player-hp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.obs-player-kd {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
  color: #e5e7eb;
  white-space: nowrap;
}

.obs-player-kd .kd-k { color: #fbbf24; }
.obs-player-kd .kd-d { color: #9ca3af; }

.obs-player-row.team-1 { border-left-color: #ef4444; }
.obs-player-row.team-2 { border-left-color: #3b82f6; }

.obs-guide {
  font-size: 0.7rem;
  color: #6b7280;
  text-align: center;
  margin: 8px 0 0;
  line-height: 1.3;
}

/* 좁은 화면에서는 팀을 위아래로 쌓는다 */
@media (max-width: 760px) {
  .obs-team-grid { grid-template-columns: 1fr; }
  .obs-player-row { grid-template-columns: 30px minmax(0, 1fr) 64px 46px; }
}

/* 8. 저작권 푸터 */
.footer-copyright {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(156, 163, 175, 0.45);
  margin-top: 25px;
  pointer-events: none;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 1px;
}




/* ── 아이템 즉시 발동 토스트 ─────────────────────────────
   아이템 슬롯/단축키가 폐지되어 무엇이 터졌는지 알 방법이 없으므로
   스킬 바 위쪽에 짧은 알림을 쌓아 보여준다. */
.item-toast-stack {
  position: absolute;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 8;
}

.item-toast {
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid currentColor;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  animation: itemToastIn 0.18s ease-out;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.item-toast.fade-out {
  opacity: 0;
  transform: translateY(-14px);
}

@keyframes itemToastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── 부쉬 은신 상태 표시 ─────────────────────────────────────────── */
/* 은신은 화면에서 즉시 알 수 있어야 한다. 부쉬 테두리 강조만으로는
   "지금 정말 안 보이는 상태인지"가 모호해 별도 배너를 둔다. */
.stealth-indicator {
  position: absolute;
  left: 50%;
  bottom: 190px;
  transform: translateX(-50%);
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(9, 32, 19, 0.82);
  border: 1px solid rgba(125, 255, 176, 0.55);
  color: #7dffb0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-shadow: 0 0 10px rgba(125, 255, 176, 0.55);
  box-shadow: 0 0 22px rgba(45, 200, 120, 0.25);
  pointer-events: none;
  z-index: 40;
  animation: stealthPulse 1.6s ease-in-out infinite;
}

@keyframes stealthPulse {
  0%, 100% { opacity: 0.78; }
  50%      { opacity: 1; }
}

/* ── 피격 / 저체력 비네트 ────────────────────────────────────────── */
/* 체력이 위험한지 HUD 숫자를 확인하지 않고도 알 수 있어야 한다.
   opacity는 client.js가 매 프레임 계산해 넣는다. */
.hit-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 25;
  background: radial-gradient(ellipse at center,
    rgba(255, 0, 0, 0) 42%,
    rgba(180, 0, 0, 0.35) 78%,
    rgba(130, 0, 0, 0.75) 100%);
  transition: opacity 90ms linear;
}

/* ── 정글 캠프 처치 버프 HUD ─────────────────────────────────────── */
/* 남은 시간이 보여야 "버프 있을 때 밀어붙일지"를 판단할 수 있다. */
.buff-bar {
  position: fixed;
  left: 50%;
  top: 96px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  pointer-events: none;
  z-index: 30;
}

.buff-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 9px;
  border-radius: 10px;
  background: rgba(9, 14, 25, 0.86);
  border: 1px solid var(--buff, #8b7cf6);
  box-shadow: 0 0 16px color-mix(in srgb, var(--buff, #8b7cf6) 35%, transparent);
  animation: buffIn 220ms ease-out;
}

.buff-icon { font-size: 18px; line-height: 1; }

.buff-text { display: flex; flex-direction: column; line-height: 1.2; }
.buff-text b { color: var(--buff, #8b7cf6); font-size: 12px; font-weight: 700; }
.buff-text i { color: #b8c4dc; font-size: 10px; font-style: normal; }

.buff-time {
  color: var(--buff, #8b7cf6);
  font: 700 14px/1 'Outfit', monospace;
  min-width: 30px;
  text-align: right;
}

@keyframes buffIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}

/* ── 승리 화면: 우승 팀 명단 ─────────────────────────────────────── */
/* 승리는 팀 단위이므로 누가 함께 이겼는지 보여야 한다. */
.victory-roster-title {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #9fb3d0;
}

.victory-roster {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
}

.victory-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 13px;
}

.victory-member.is-me {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.5);
}

.victory-member .vm-rank { width: 22px; text-align: center; font-weight: 700; color: #fbbf24; }
.victory-member .vm-name { flex: 1; text-align: left; font-weight: 600; color: #eaf2ff; }
.victory-member .vm-stat { color: #9fb3d0; font-size: 12px; }
.victory-member .vm-down { color: #f87171; font-size: 11px; }

.victory-actions { margin-top: 18px; }

/* 인게임 승리 배너 — 오버레이가 뜨기 전에 화면에서 먼저 알린다 */
.victory-banner {
  position: fixed;
  left: 50%;
  top: 32%;
  transform: translate(-50%, -50%);
  padding: 18px 44px;
  border-radius: 16px;
  background: rgba(10, 16, 28, 0.86);
  border: 2px solid #fbbf24;
  box-shadow: 0 0 46px rgba(251, 191, 36, 0.45);
  color: #fbbf24;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 4px;
  text-align: center;
  pointer-events: none;
  z-index: 60;
  animation: victoryBannerIn 480ms cubic-bezier(.2, 1.4, .4, 1);
}

.victory-banner small {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  letter-spacing: 1px;
  color: #ffe9b0;
  font-weight: 600;
}

@keyframes victoryBannerIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ── 대기실: 가로 3열 레이아웃 ──────────────────────────────────── */
.lobby-header { margin-bottom: 10px; }
#lobby-room-name { margin-bottom: 2px; }
#lobby-players-count { margin-bottom: 0; }

.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 0.82fr;
  gap: 14px;
  align-items: start;
  margin: 14px 0 18px;
  text-align: left;
}

.lobby-grid .team-column {
  min-height: 330px;
  padding: 12px;
  gap: 8px;
}

.lobby-grid .team-column-header {
  font-size: 1rem;
  padding-bottom: 8px;
}

/* 폭이 넓어져 5명이 스크롤 없이 들어간다 */
.lobby-grid .team-column-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: none;
  overflow: visible;
}

.lobby-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-block {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
}

.side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.side-count { color: #94a3b8; font-weight: 600; }

.side-empty {
  color: #64748b;
  font-size: 0.78rem;
  text-align: center;
  padding: 8px 0;
}

.lobby-observer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lobby-side .lobby-member-tag {
  padding: 8px 10px;
  font-size: 0.82rem;
}

.lobby-side .lobby-bot-section {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0;
}

.lobby-side .lobby-bot-controls {
  display: flex;
  gap: 8px;
}

.lobby-side .lobby-bot-controls .secondary-btn {
  flex: 1;
  padding: 8px 4px;
  font-size: 0.8rem;
}

.lobby-side .team-rule {
  font-size: 0.74rem;
  color: #64748b;
  text-align: center;
  line-height: 1.5;
}

.team-start-status { margin-bottom: 0; }

/* 좁은 화면에서는 다시 세로로 접는다 */
@media (max-width: 900px) {
  .lobby-grid { grid-template-columns: 1fr; }
  .lobby-grid .team-column { min-height: 0; }
}

/* 패널 안 스크롤바를 얇고 어둡게 */
.lobby-box::-webkit-scrollbar { width: 7px; }
.lobby-box::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 4px;
}
.lobby-box::-webkit-scrollbar-track { background: transparent; }

/* ── FPS 미터 (우측 상단, 미니맵 위) ─────────────── */
#fps-meter {
  font: 700 0.78rem/1.4 'Cascadia Code', Consolas, monospace;
  color: #4ade80;
  background: rgba(10, 14, 25, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 3px 10px;
  pointer-events: none;
  letter-spacing: 0.02em;
}
#fps-meter.fps-warn { color: #fbbf24; }
#fps-meter.fps-bad { color: #f87171; }

/* ══════════════════════════════════════════════════════════════════
   모바일 터치 조작 + 소형 화면 HUD 축소
   활성 조건: JS 가 터치 기기 감지 시 body.touch-device 부여
   ══════════════════════════════════════════════════════════════════ */

/* ── 터치 스틱 (시각 전용 — 터치 이벤트는 캔버스가 받는다) ── */
#touch-controls { position: fixed; inset: 0; pointer-events: none; z-index: 7; }
.touch-stick {
  position: absolute;
  width: 104px; height: 104px;
  margin: -52px 0 0 -52px;         /* 중심 기준 배치 */
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.35);
}
.touch-stick .stick-knob {
  position: absolute;
  left: 50%; top: 50%;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.5);
}
.touch-stick.aim .stick-knob {
  background: rgba(248, 113, 113, 0.5);   /* 조준 스틱 = 공격 톤 */
  border-color: rgba(248, 113, 113, 0.8);
}

/* ── 터치 기기 공통 ── */
body.touch-device { -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body.touch-device #game-canvas { touch-action: none; }
/* 터치에서는 스킬 슬롯이 곧 버튼 — 탭 타깃 확보 */
body.touch-device .skill-slot { min-width: 56px; min-height: 56px; }
body.touch-device .bottom-center-hud { pointer-events: auto; }

/* ── 세로 모드 안내 (게임 중 + 세로 + 터치 기기) ── */
#rotate-hint {
  display: none;
  position: fixed; inset: 0; z-index: 60;
  background: rgba(5, 8, 15, 0.92);
  color: #e2e8f0;
  font: 700 1.1rem/1.6 Outfit, sans-serif;
  align-items: center; justify-content: center; text-align: center;
  padding: 24px;
}
@media (orientation: portrait) {
  /* #rotate-hint 는 #game-ui 의 뒤 형제 — 게임 UI가 표시 중일 때만 노출 */
  body.touch-device #game-ui:not(.hidden) ~ #rotate-hint { display: flex; }
}

/* ── 폰 가로(게임 플레이) — HUD 압축 ── */
@media (max-height: 560px) {
  body.touch-device .stats-panel { transform: scale(0.75); transform-origin: top left; top: 8px; left: 8px; }
  body.touch-device .hud-left-bottom { transform: scale(0.62); transform-origin: bottom left; }
  body.touch-device .top-right-group { transform: scale(0.58); transform-origin: top right; top: 6px; right: 6px; gap: 6px; pointer-events: none; }
  body.touch-device .kill-feed { display: none; }  /* 폰 화면에선 소음 — 킬로그는 배너로 충분 */
  body.touch-device .top-center-group { transform: translateX(-50%) scale(0.78); transform-origin: top center; top: 6px; }
  /* HUD 패널이 터치를 삼키면 그 위에서 스틱을 시작할 수 없다 — 조작이 우선 */
  body.touch-device .stats-panel,
  body.touch-device .hud-left-bottom,
  body.touch-device .team-status-panel { pointer-events: none; }
  body.touch-device #fps-meter { display: none; }

  /* 스킬 바 = 터치 버튼: 오른쪽 세로 열, 엄지 닿는 자리 (조준 스틱 위) */
  body.touch-device .bottom-center-hud {
    left: auto; right: max(12px, env(safe-area-inset-right)); bottom: 12px;
    top: auto; transform: none; width: auto;
  }
  body.touch-device .skill-bar { flex-direction: column; padding: 8px; gap: 8px; }

  /* 레벨업 카드 — 하단 중앙 유지, 탭 타깃 축소 없이 컴팩트 */
  body.touch-device .upgrade-bar { transform: translateX(-50%) scale(0.85); transform-origin: bottom center; bottom: 6px; }

  body.touch-device .buff-bar { transform: scale(0.8); transform-origin: bottom left; }
  body.touch-device .stealth-indicator { transform: translateX(-50%) scale(0.85); }
}

/* ── 폰 세로(로비·로그인 메뉴) — 폼이 화면을 넘지 않게 ── */
@media (max-width: 600px) {
  body.touch-device .glass-panel { max-width: 94vw; padding: 18px; }
  body.touch-device input[type="text"] { font-size: 16px; }   /* iOS 포커스 줌 방지 */
  body.touch-device .accent-btn, body.touch-device .secondary-btn,
  body.touch-device .danger-btn, body.touch-device .refresh-btn { min-height: 44px; }
  body.touch-device .start-weapon-card { min-height: 44px; }
  body.touch-device .team-columns { flex-direction: column; }
}
