:root {
  --accent: #00d2ff;
  --accent-bg: rgba(0, 210, 255, 0.16);
  --accent-glow: rgba(0, 210, 255, 0.45);
  --accent-text: #000000;
}

.theme-youtube {
  --accent: #ff2a4b;
  --accent-bg: rgba(255, 42, 75, 0.18);
  --accent-glow: rgba(255, 42, 75, 0.5);
  --accent-text: #ffffff;
}

.theme-spotify {
  --accent: #1db954;
  --accent-bg: rgba(29, 185, 84, 0.18);
  --accent-glow: rgba(29, 185, 84, 0.45);
  --accent-text: #000000;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: #121212;
  color: #ffffff;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.app-container {
  width: 100%;
  max-width: 480px;
  background-color: #1e1e1e;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.hidden {
  display: none !important;
}

/* 초기 로비 스타일 */
.lobby-header {
  text-align: center;
  margin-bottom: 28px;
}

.lobby-header h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.lobby-header p {
  color: #aaa;
  font-size: 0.9rem;
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lobby-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: #282828;
  border: 1px solid #383838;
  color: #fff;
  padding: 18px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.lobby-btn:hover {
  border-color: #00d2ff;
  background: #2e2e2e;
}

.lobby-btn .icon {
  font-size: 1.8rem;
}

.lobby-btn strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.lobby-btn span {
  font-size: 0.82rem;
  color: #aaa;
}

/* 플랫폼 선택 카드 */
.platform-select-box {
  background: #252525;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #383838;
}

.select-guide {
  font-size: 0.85rem;
  color: #ccc;
  margin-bottom: 12px;
  text-align: center;
}

.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.platform-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: 10px;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.platform-card:hover {
  transform: translateY(-2px);
}

.platform-card.yt:hover {
  border-color: #ff2a4b;
  background: rgba(255, 42, 75, 0.1);
}

.platform-card.sp:hover {
  border-color: #1db954;
  background: rgba(29, 185, 84, 0.1);
}

.platform-card .p-icon {
  font-size: 1.4rem;
}

.platform-card.yt .p-icon {
  color: #ff2a4b;
}

.platform-card.sp .p-icon {
  color: #1db954;
}

.platform-card strong {
  font-size: 1rem;
}

.platform-card .p-desc {
  font-size: 0.75rem;
  color: #999;
}

/* 방 참가하기 */
.join-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #333;
}

.join-input-row {
  display: flex;
  gap: 8px;
}

.join-input-row input {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #444;
  background: #282828;
  color: #fff;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 14px 0;
  color: #777;
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #333;
}

.divider span {
  padding: 0 10px;
}

.qr-scan-btn {
  width: 100%;
  background: #2c2c2c;
  color: #00d2ff;
  border: 1px dashed #00d2ff;
  padding: 12px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 0.95rem;
  cursor: pointer;
}

.qr-reader-box {
  margin-top: 14px;
  background: #252525;
  border-radius: 12px;
  overflow: hidden;
  padding: 10px;
  border: 1px solid #383838;
}

/* 방 내부 상단 바 */
.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid #2e2e2e;
}

.room-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-tag {
  background: #333;
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 6px;
}

.platform-tag {
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.75rem;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 6px;
}

.room-code-text {
  font-size: 0.85rem;
  color: #ccc;
}

.leave-btn {
  background: #333;
  color: #ccc;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* 방장 QR 초대 카드 */
.invite-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #252525;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid #333;
}

.invite-label {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: bold;
}

.invite-text h2 {
  font-size: 1.8rem;
  letter-spacing: 3px;
  margin: 4px 0;
}

.invite-text p {
  font-size: 0.78rem;
  color: #999;
  margin-bottom: 10px;
}

.copy-btn {
  background: #333;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
}

.qr-wrapper {
  background: #ffffff;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 플레이어 영역 */
.player-box {
  background: #282828;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 24px;
}

.badge {
  display: inline-block;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.badge.recommended {
  background: rgba(255, 183, 3, 0.16);
  color: #ffb703;
}

/* === 턴테이블 LP 스테이지 === */
.turntable-stage {
  position: relative;
  width: 280px;
  height: 200px;
  margin: 0 auto 18px auto;
  display: flex;
  align-items: center;
}

.sleeve-box {
  position: relative;
  z-index: 2;
  width: 200px;
  height: 200px;
  border-radius: 14px;
  overflow: hidden;
  background: #141414;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65);
  border: 1px solid #3a3a3a;
}

.yt-square-slot,
#yt-player {
  width: 200px;
  height: 200px;
}

.yt-square-slot iframe {
  pointer-events: none;
}

.sp-square-slot {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #1db95444, #141414);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.vinyl-disc {
  position: absolute;
  right: 4px;
  z-index: 1;
  width: 184px;
  height: 184px;
  border-radius: 50%;
  background: radial-gradient(circle, #181818 0%, #0d0d0d 60%, #1c1c1c 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spinVinyl 4s linear infinite;
  animation-play-state: paused;
}

.turntable-stage.is-playing .vinyl-disc {
  animation-play-state: running;
}

.vinyl-grooves {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background:
    conic-gradient(
      from 35deg,
      transparent 0deg,
      rgba(255, 255, 255, 0.14) 25deg,
      transparent 55deg,
      transparent 180deg,
      rgba(255, 255, 255, 0.14) 205deg,
      transparent 235deg
    ),
    repeating-radial-gradient(
      circle,
      rgba(255, 255, 255, 0.04) 0px,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 2px,
      transparent 5px
    );
}

.vinyl-label {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.25);
}

.vinyl-label::after {
  content: '';
  position: absolute;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}

.vinyl-hole {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1e1e1e;
  border: 2px solid #444;
}

.tonearm {
  position: absolute;
  top: 6px;
  right: 12px;
  z-index: 3;
  width: 6px;
  height: 64px;
  background: linear-gradient(to bottom, #d0d0d0, #777);
  border-radius: 4px;
  transform-origin: top center;
  transform: rotate(-18deg);
  transition: transform 0.45s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.tonearm::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #999;
  border: 2px solid #333;
}

.turntable-stage.is-playing .tonearm {
  transform: rotate(16deg);
}

@keyframes spinVinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.player-box h2 {
  font-size: 1.1rem;
  margin-bottom: 4px;
  word-break: keep-all;
}

.player-box > p {
  color: #aaa;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

/* === 미니멀 감성 시크바 & 볼륨 슬라이더 === */
.audio-progress-wrap {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 10px auto;
}

.audio-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #888;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.volume-control-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 240px;
  margin: 0 auto 14px auto;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.icon-btn {
  background: none;
  border: none;
  color: #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 2px;
  transition: color 0.2s, transform 0.15s;
}

.icon-btn:hover {
  color: #fff;
  transform: scale(1.08);
}

.volume-text {
  font-size: 0.72rem;
  color: #888;
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 공통 커스텀 Range 슬라이더 (모바일 터치 & 마우스 드래그 최적화) */
.minimal-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px; /* 손가락 터치 영역은 넉넉하게 확보 */
  background: transparent;
  cursor: pointer;
  touch-action: none;
  --progress: 0%;
}

.volume-slider {
  --progress: 85%;
}

.minimal-slider:focus {
  outline: none;
}

/* Chrome, Edge, Safari 트랙 (실제 보이는 선 두께는 4px) */
.minimal-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--progress),
    rgba(255, 255, 255, 0.13) var(--progress),
    rgba(255, 255, 255, 0.13) 100%
  );
  transition: height 0.15s ease;
}

.minimal-slider:hover::-webkit-slider-runnable-track,
.minimal-slider:active::-webkit-slider-runnable-track {
  height: 5px;
}

/* Chrome, Edge, Safari 펄(Pearl) 조절 핸들 */
.minimal-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  margin-top: -4px;
  box-shadow: 0 0 8px var(--accent-glow), 0 0 0 3px var(--accent-bg);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease;
}

.minimal-slider:hover::-webkit-slider-thumb,
.minimal-slider:active::-webkit-slider-thumb {
  transform: scale(1.28);
  box-shadow: 0 0 12px var(--accent), 0 0 0 6px var(--accent-bg);
}

/* Firefox 트랙 & 핸들 호환 */
.minimal-slider::-moz-range-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.minimal-slider::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.minimal-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px var(--accent-glow), 0 0 0 3px var(--accent-bg);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.minimal-slider:hover::-moz-range-thumb,
.minimal-slider:active::-moz-range-thumb {
  transform: scale(1.28);
  box-shadow: 0 0 12px var(--accent), 0 0 0 6px var(--accent-bg);
}

.next-hint {
  font-size: 0.8rem;
  color: #888;
  background: #1e1e1e;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 14px;
}

.player-controls {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 8px;
}

.primary-btn {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  padding: 11px 16px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

.secondary-btn {
  background: #363636;
  color: #fff;
  border: 1px solid #4a4a4a;
  padding: 11px 14px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

/* 게스트 영역 */
.guest-now-playing {
  background: #252525;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  border-left: 3px solid var(--accent);
}

.mini-label {
  display: block;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: bold;
  margin-bottom: 4px;
}

.guest-song-title {
  font-size: 0.95rem;
}

.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-box input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #282828;
  color: #fff;
}

.list-box, #queue-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.empty-msg {
  color: #777;
  font-size: 0.85rem;
  text-align: center;
  padding: 16px;
  background: #252525;
  border-radius: 10px;
}

.song-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #282828;
  padding: 10px 12px;
  border-radius: 10px;
}

.song-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.song-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: #181818;
  flex-shrink: 0;
}

.song-info {
  min-width: 0;
}

.song-info strong {
  display: block;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-info span {
  display: block;
  font-size: 0.78rem;
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.add-btn {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
}

.del-btn {
  background: #ff4d4d;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.queue-section h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: #ddd;
}