@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;800;900&family=Noto+Sans+KR:wght@400;600;700;900&family=Orbitron:wght@700;900&display=swap');

:root {
  --bg-dark: #0a080d;
  --bg-card: rgba(20, 16, 26, 0.85);
  --bg-glass: rgba(28, 22, 38, 0.7);
  --border-glass: rgba(180, 140, 220, 0.15);
  --border-killer: #b31a1a;
  --border-survivor: #2779bd;
  --border-gold: #e5b95c;
  
  --color-killer: #ff3333;
  --color-killer-glow: rgba(255, 51, 51, 0.4);
  --color-surv: #38bdf8;
  --color-surv-glow: rgba(56, 189, 248, 0.35);
  
  --rarity-common: #6e5c48;
  --rarity-uncommon: #e8c252;
  --rarity-rare: #199b1e;
  --rarity-very-rare: #9c27b0;
  --rarity-ultra-rare: #e91e63;
  
  --text-main: #f3f0f7;
  --text-muted: #9e97ab;
  --text-highlight: #ffcc00;
  
  --font-title: 'Cinzel', 'Noto Sans KR', serif;
  --font-body: 'Noto Sans KR', sans-serif;
  --font-tech: 'Orbitron', monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(139, 36, 163, 0.18), transparent 50%),
    radial-gradient(circle at 15% 90%, rgba(179, 26, 26, 0.22), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(39, 121, 189, 0.18), transparent 45%),
    linear-gradient(to bottom, #07050a, #0d0a14);
}

/* 안개 배경 애니메이션 */
.fog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(10, 8, 13, 0.8) 100%);
  z-index: 1;
}

#app {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 네비게이션 & 헤더 */
header.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 24px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #b31a1a, #5c0808);
  border: 2px solid var(--color-killer);
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--color-killer-glow);
}

.logo-icon span {
  transform: rotate(-45deg);
  font-size: 20px;
}

.logo-title h1 {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #ffffff, #f0c3c3, #ff7a7a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 50, 50, 0.3);
}

.logo-title p {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

#btn-sound-toggle {
  background: rgba(30, 30, 40, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
}

#btn-sound-toggle:hover {
  background: rgba(50, 50, 70, 0.85);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.12);
}

#btn-sound-toggle.muted {
  opacity: 0.65;
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

@media (max-width: 768px) {
  #app {
    padding: 12px 10px;
  }
  header.app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 16px;
  }
  .header-status {
    width: 100%;
    display: flex;
    gap: 8px !important;
  }
  .header-status .btn {
    flex: 1;
    font-size: 12px !important;
    padding: 8px 6px !important;
    justify-content: center;
    white-space: nowrap;
  }
}

/* 공통 버튼 */
.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  background: var(--bg-glass);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, #a81919, #6e0c0c);
  border-color: #ff4d4d;
  color: #fff;
  box-shadow: 0 0 15px var(--color-killer-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #c41e1e, #850f0f);
  box-shadow: 0 0 25px rgba(255, 51, 51, 0.6);
}

.btn-surv {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 15px var(--color-surv-glow);
}

.btn-surv:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.6);
}

.btn-gold {
  background: linear-gradient(135deg, #b48325, #704f0f);
  border-color: #e5b95c;
  color: #fff;
}

.btn-warning {
  background: linear-gradient(135deg, #d97706, #b45309);
  border-color: #fbbf24;
  color: #fff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.btn-warning:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.7);
}

.btn-outline {
  border-color: var(--border-glass);
  background: rgba(255, 255, 255, 0.05);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

/* 화면 전환 컨테이너 */
.screen {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 1. 홈 / 방 참가 화면 */
.lobby-screen {
  max-width: 680px;
  margin: 40px auto;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.75);
  text-align: center;
  transition: all 0.3s ease;
}

.lobby-screen h2 {
  font-family: var(--font-title);
  font-size: 28px;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.lobby-screen p.desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

/* 2단계 선택 스텝 컨테이너 */
.lobby-step {
  display: none;
}

.lobby-step.active {
  display: block;
  animation: fadeIn 0.25s ease forwards;
}

.step-nav-bar {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.btn-step-back {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-step-back:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateX(-2px);
}

/* 1단계 선택 카드 그리드 */
.lobby-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 16px 0 20px 0;
}

.choice-card {
  background: rgba(18, 14, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.choice-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0.6;
  transition: opacity 0.25s ease;
}

#card-choose-create::before {
  background: linear-gradient(90deg, #ec4899, #8b5cf6);
}

#card-choose-join::before {
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
}

.choice-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.25);
}

#card-choose-create:hover {
  border-color: rgba(236, 72, 153, 0.5);
  box-shadow: 0 12px 30px rgba(236, 72, 153, 0.2);
}

#card-choose-join:hover {
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 12px 30px rgba(6, 182, 212, 0.2);
}

.choice-icon {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.choice-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.choice-badge.badge-host {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.choice-badge.badge-guest {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.choice-title {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.choice-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
  flex-grow: 1;
}

.btn-choice-action {
  width: 100%;
  justify-content: center;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
}

/* 최근 참여한 방 배너 */
.recent-room-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 16px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.recent-room-bar strong {
  color: #fde047;
  letter-spacing: 1px;
}

@media (max-width: 600px) {
  .lobby-screen {
    padding: 26px 18px;
    margin: 20px auto;
  }
  .lobby-choice-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.form-group {
  margin-bottom: 22px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(12, 9, 18, 0.85);
  border: 1px solid var(--border-glass);
  color: #fff;
  font-size: 16px;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #9c27b0;
  box-shadow: 0 0 12px rgba(156, 39, 176, 0.4);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 28px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider span {
  padding: 0 12px;
}

.lobby-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.lobby-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 14px;
}

/* 2. 대기실 화면 */
.room-header-bar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-card);
  padding: 18px 24px;
  border-radius: 14px;
  border: 1px solid var(--border-glass);
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}

.room-header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.room-code-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.room-code-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.room-rules-pill {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

.rule-pill {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  white-space: nowrap;
}

.rule-pill strong {
  color: #fff;
}

@media (max-width: 768px) {
  .room-header-bar {
    padding: 14px 16px;
    gap: 12px;
    margin-bottom: 16px;
  }
  .room-header-main {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .room-code-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
  }
  .room-code-box {
    flex: 1;
    justify-content: center;
    max-width: 100%;
    padding: 6px 12px;
  }
  .header-room-actions {
    width: 100%;
  }
  .header-room-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 11px 14px;
    font-size: 14px;
  }
  .room-rules-pill {
    gap: 6px;
  }
  .rule-pill {
    font-size: 11px;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  .room-code-group {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .room-code-label {
    font-size: 13px;
    color: var(--text-muted);
  }
  .room-code-box {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
    box-sizing: border-box;
  }
}

/* 슬롯 배정 그리드 */
.slots-container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  margin-bottom: 28px;
}

@media (max-width: 900px) {
  .slots-container {
    grid-template-columns: 1fr;
  }
}

.slot-section-title {
  font-family: var(--font-title);
  font-size: 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.slot-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 18px;
  border: 1px solid var(--border-glass);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.slot-card.killer-slot {
  border-left: 5px solid var(--border-killer);
  background: linear-gradient(90deg, rgba(179, 26, 26, 0.15), var(--bg-card));
}

.slot-card.surv-slot {
  border-left: 5px solid var(--border-survivor);
  background: linear-gradient(90deg, rgba(39, 121, 189, 0.15), var(--bg-card));
}

.slot-card.active-user {
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

.slot-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.slot-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.slot-card.killer-slot .slot-icon {
  background: rgba(179, 26, 26, 0.3);
  color: #ff6b6b;
}

.slot-card.surv-slot .slot-icon {
  background: rgba(39, 121, 189, 0.3);
  color: #60a5fa;
}

.slot-meta h4 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.slot-meta p {
  font-size: 13px;
  color: var(--text-muted);
}

.bench-card {
  background: rgba(20, 16, 26, 0.5);
  border: 1px dashed var(--border-glass);
  border-radius: 12px;
  padding: 16px;
  margin-top: 14px;
}

.bench-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.bench-tag {
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 방 컨트롤 바 */
.host-action-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--border-glass);
}

/* 3. 모달 레이아웃 */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.active {
  display: flex;
}

.modal-window {
  background: #14101a;
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  max-width: 680px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-glass);
}

.modal-header h3 {
  font-family: var(--font-title);
  font-size: 22px;
  color: #fff;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: #fff;
}

.setting-row {
  margin-bottom: 20px;
}

.setting-row label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #e2e8f0;
}

.setting-row select, .setting-row input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  background: #0d0a12;
  border: 1px solid var(--border-glass);
  color: #fff;
  font-size: 14px;
}

.setting-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 체크리스트 그리드 */
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding: 10px 4px;
}

.check-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.check-item.selected {
  background: rgba(156, 39, 176, 0.25);
  border-color: #ab47bc;
  box-shadow: 0 0 10px rgba(171, 71, 188, 0.3);
}

#killer-checklist-grid .check-item.selected {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

#survivor-checklist-grid .check-item.selected {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

#killer-checklist-grid .check-item img {
  object-fit: cover;
  object-position: center top;
}

#survivor-checklist-grid .check-item img {
  object-fit: cover;
  object-position: center 15%;
}

.check-item .name {
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px;
}

/* 밴 퍽 태그 리스트 */
.banned-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  min-height: 40px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.banned-tag {
  background: #e53935;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.banned-tag span.remove {
  cursor: pointer;
  font-weight: 900;
}

/* 방 코드 보안 마스킹 UI */
.room-code-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(25, 20, 32, 0.95);
  border: 1px solid rgba(255, 204, 0, 0.45);
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.15);
  padding: 5px 12px;
  border-radius: 8px;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.room-code-secret {
  font-family: var(--font-tech);
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--text-highlight);
  font-weight: 700;
  min-width: 75px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.room-code-secret.masked {
  letter-spacing: 5px;
  color: #a8a29e;
  font-size: 18px;
}

.btn-icon-subtle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon-subtle:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.08);
}

/* 주최자 드래그 권한 안내 배너 */
.host-drag-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.15), rgba(20, 16, 26, 0.75));
  border: 1px solid rgba(234, 179, 8, 0.4);
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 20px;
  font-size: 13.5px;
  color: #fef08a;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* 드래그 앤 드롭 스타일 */
.draggable-player {
  cursor: grab !important;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.draggable-player:active {
  cursor: grabbing !important;
}

.draggable-player.is-dragging {
  opacity: 0.45 !important;
  transform: scale(0.96) !important;
}

.drag-handle-icon {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-right: 5px;
  cursor: grab;
}

.host-badge-small {
  font-size: 10px;
  background: linear-gradient(135deg, #eab308, #ca8a04);
  color: #000;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

/* 드롭 타겟 하이라이트 */
.slot-card.drag-over,
.bench-card.drag-over {
  border-color: #facc15 !important;
  background: rgba(250, 204, 21, 0.14) !important;
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.45) !important;
  transform: translateY(-2px);
}

/* DBD 다크 글래스 토스트 알림 (방송 송출 시 안전한 플로팅 알림) */
.dbd-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(18, 14, 26, 0.96);
  border: 1px solid rgba(255, 204, 0, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 18px rgba(255, 204, 0, 0.25);
  color: #fff;
  padding: 12px 26px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dbd-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==============================================================================
   모바일 스마트폰 화면 (< 768px, < 480px) 전면 최적화
   ============================================================================== */
@media (max-width: 768px) {
  .container {
    padding: 12px 14px;
  }

  .app-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .logo-title {
    font-size: 22px;
    text-align: center;
  }

  .logo-tagline {
    font-size: 12px;
    text-align: center;
  }

  .header-user-nav {
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .user-badge {
    padding: 6px 12px;
    font-size: 13px;
  }

  /* 1. 로비 모드 선택 카드 모바일 1열 */
  .lobby-choices {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .choice-card {
    padding: 22px 18px;
  }

  .choice-icon {
    font-size: 38px;
    margin-bottom: 8px;
  }

  .choice-title {
    font-size: 19px;
  }

  /* 2. 대기실 헤더 바 */
  .room-header-bar {
    padding: 14px 16px;
    gap: 12px;
    margin-bottom: 16px;
    border-radius: 12px;
  }

  .room-header-main {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .room-code-group {
    width: 100%;
    justify-content: space-between;
  }

  .header-room-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .header-room-actions .btn {
    width: 100%;
    padding: 10px 8px;
    font-size: 13px;
    justify-content: center;
  }

  .room-rules-pill {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .rule-pill {
    font-size: 11px;
    padding: 3px 8px;
  }

  /* 슬롯 배정 그리드 모바일 */
  .slots-container {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 18px;
  }

  .slot-card {
    padding: 12px 14px;
    margin-bottom: 10px;
  }

  .slot-info {
    gap: 10px;
  }

  .slot-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .slot-meta h4 {
    font-size: 15px;
  }

  .slot-meta p {
    font-size: 12px;
  }

  .slot-card .btn-move {
    padding: 6px 12px;
    font-size: 12px;
  }

  /* 하단 액션 바: 메인 버튼 상단 풀와이드 + 보조 버튼 하단 2열 그리드 */
  .host-action-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
    border-radius: 12px;
  }

  /* 🎲 랜덤 뽑기 시작 버튼 (1번째 줄 전체 차지) */
  #btn-roll-match,
  #btn-reroll-all-host {
    grid-column: 1 / -1;
    order: -1;
    width: 100%;
    padding: 14px 16px !important;
    font-size: 16px !important;
    font-weight: 800;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
  }

  .host-action-bar .btn {
    padding: 10px 8px;
    font-size: 12.5px;
    justify-content: center;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    min-height: 42px;
  }

  /* 모달 윈도우 모바일 풀사이즈 */
  .modal-window {
    width: 95%;
    max-width: 95%;
    padding: 18px 14px;
    max-height: 90vh;
    border-radius: 14px;
  }

  .modal-header {
    margin-bottom: 16px;
    padding-bottom: 10px;
  }

  .modal-header h3 {
    font-size: 17px;
  }

  .setting-row[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .checklist-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .checklist-grid {
    grid-template-columns: 1fr !important;
  }

  .room-code-box {
    padding: 6px 10px;
  }

  .room-code-secret {
    font-size: 17px;
  }

  .host-drag-notice {
    padding: 10px 12px;
    font-size: 12px;
    gap: 8px;
  }
}


