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

:root {
  --bg: #ffffff;
  --text: #000000;
  --text-secondary: #666666;
  --accent: #000000;
  --accent-gradient: #000000 !important;
  --accent-blue: #333333;
  --accent-purple: #333333;
  --border: #e8e8e8;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --nav-height: 60px;
  --player-height: 64px;
  --header-height: 120px;
  --transition: 0.2s ease;
  --font: 'Inter', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: #f0f0f0;
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
}

#search-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  margin: 2px 0;
  line-height: 0;
}

.logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
  display: block;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: #f5f5f5;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
  background: var(--bg);
}

.search-icon {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.search-submit {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.search-submit:disabled {
  opacity: 0.45;
  cursor: default;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  min-width: 0;
}

.search-bar input::placeholder {
  color: #b0b0b0;
}

.search-clear {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#main-content::-webkit-scrollbar {
  display: none;
}

.view {
  display: none;
  padding: var(--spacing-md);
  padding-bottom: calc(var(--nav-height) + var(--spacing-lg));
  min-height: 100%;
}

.view.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-bar {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  min-height: 36px;
}

.filter-btn.active {
  background: #000000 !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

.filter-btn:active {
  transform: scale(0.96);
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.video-card {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  transition: background var(--transition);
  cursor: pointer;
}

.video-card:active {
  background: #f5f5f5;
}

.video-card .thumbnail {
  width: 140px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: #f0f0f0;
}

.video-card .thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card .thumbnail .duration-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
}

.video-card .video-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 2px 0;
}

.video-card .video-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.video-card .video-channel {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.video-card .video-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
}

.btn-add-video {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-add-video:hover {
  background: #f0f0f0;
  color: var(--accent);
}

.btn-add-video:active {
  transform: scale(0.9);
}

.playlist-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.playlist-card:active {
  background: #f8f8f8;
  transform: scale(0.99);
}

.playlist-card .playlist-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.playlist-card .playlist-info {
  flex: 1;
  min-width: 0;
}

.playlist-card .playlist-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-card .playlist-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.playlist-card .playlist-arrow {
  color: #ccc;
  flex-shrink: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
}

.section-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.btn-create {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 8px 14px;
  border: none;
  background: #000000 !important;
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-create:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.playlist-detail-header {
  margin-bottom: var(--spacing-lg);
}

.playlist-detail-header .detail-back {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  padding: 0;
  margin-bottom: var(--spacing-md);
}

.playlist-detail-header .detail-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.playlist-detail-header .detail-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.playlist-detail-header .detail-count {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: var(--spacing-sm);
}

.playlist-detail-header .detail-actions {
  margin-top: var(--spacing-md);
  display: flex;
  gap: var(--spacing-sm);
}

.btn-danger {
  padding: 8px 16px;
  border: 1px solid #ff4444;
  background: transparent;
  color: #ff4444;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-danger:active {
  background: #ff4444;
  color: #fff;
}

.playlist-video-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--border);
}

.playlist-video-item:last-child {
  border-bottom: none;
}

.playlist-video-item .pv-thumbnail {
  width: 100px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  background: #f0f0f0;
}

.playlist-video-item .pv-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-video-item .pv-info {
  flex: 1;
  min-width: 0;
}

.playlist-video-item .pv-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.playlist-video-item .pv-channel {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.playlist-video-item .btn-remove {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #ccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.playlist-video-item .btn-remove:hover {
  color: #ff4444;
  background: #fff0f0;
}

.profile-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--spacing-xl);
  gap: var(--spacing-sm);
}

.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-sm);
}

.profile-nickname {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.profile-email {
  font-size: 14px;
  color: var(--text-secondary);
}

.btn-logout {
  margin-top: var(--spacing-lg);
  padding: 12px 40px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-logout:active {
  background: #f5f5f5;
  transform: scale(0.97);
}

.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: var(--spacing-xl);
}

.auth-logo {
  margin: 6px 0 var(--spacing-md);
  padding: 0;
  line-height: 0;
}

.auth-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
  display: block;
}

.auth-form {
  width: 100%;
  max-width: 320px;
}

.auth-form h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.input-group {
  margin-bottom: var(--spacing-md);
}

.input-group input,
.input-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition);
  outline: none;
}

.input-group input:focus,
.input-group textarea:focus {
  border-color: var(--accent);
}

.input-group textarea {
  resize: vertical;
  min-height: 80px;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  background: #000000 !important;
  color: #ffffff !important;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary:active {
  opacity: 0.85;
  transform: scale(0.99);
}

.auth-switch {
  text-align: center;
  margin-top: var(--spacing-lg);
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-forgot {
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-resend {
  text-align: center;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-forgot a {
  color: #000000;
  text-decoration: underline;
  font-weight: 600;
}

.auth-resend a {
  color: #000000;
  text-decoration: underline;
  font-weight: 600;
}

.auth-resend a.disabled {
  color: #999999;
  text-decoration: none;
  pointer-events: none;
  cursor: default;
}

.auth-switch a {
  color: #000000;
  text-decoration: underline;
  font-weight: 600;
}

#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: var(--nav-height);
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 300;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: #b0b0b0;
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: color var(--transition);
  min-height: 44px;
  justify-content: center;
}

.nav-item.active {
  color: #000000 !important;
}

.nav-item:active {
  transform: scale(0.92);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeOverlay 0.2s ease;
}

@keyframes fadeOverlay {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--bg);
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: modalZoom 0.2s ease;
  margin: auto;
}

@keyframes modalZoom {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-md);
  flex-shrink: 0;
}

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

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition);
}

.modal-close:active {
  background: #e0e0e0;
}

.modal-body {
  padding: 0 var(--spacing-lg) var(--spacing-lg);
  overflow-y: auto;
  flex: 1;
}

.modal-current-queue-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  background: #fafafa;
}

.modal-current-queue-section.disabled {
  opacity: 0.7;
}

.mcq-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.mcq-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.mcq-btn {
  width: 100%;
  margin-top: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: #111111;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  height: 40px;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}

.mcq-btn:active {
  transform: scale(0.98);
}

.mcq-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.modal-playlist-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: opacity var(--transition);
}

.modal-playlist-item:last-child {
  border-bottom: none;
}

.modal-playlist-item:active {
  opacity: 0.6;
}

.modal-playlist-item .mpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.modal-playlist-item .mpi-name {
  font-size: 15px;
  font-weight: 500;
}

.modal-member-notice {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  background: #fafafa;
}

.modal-member-notice p {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.modal-member-notice span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.modal-member-notice .btn-primary {
  margin-top: 12px;
}

#toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  width: calc(100% - 32px);
  max-width: 440px;
  pointer-events: none;
}

.toast {
  background: var(--accent);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
}

.toast.toast-error {
  background: #ff4444;
}

.toast.toast-success {
  background: #333333;
}

.toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-12px);
  }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl) 0;
  gap: var(--spacing-sm);
  min-height: 200px;
}

.empty-state p {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.empty-state span {
  font-size: 13px;
  color: var(--text-secondary);
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-lg) 0;
  flex-wrap: wrap;
}

.pagination .page-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.pagination .page-btn.active {
  background: var(--accent);
  color: #fff;
}

.pagination .page-btn:active {
  transform: scale(0.9);
}

.pagination .page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.hidden {
  display: none !important;
}

#yt-player-wrap {
  position: absolute;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

#mini-player {
  position: fixed;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 200;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.4s cubic-bezier(0.4, 0, 0.2, 1), bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  height: var(--player-height);
}

#mini-player.visible {
  transform: translateX(-50%) translateY(0);
}

#mini-player.expanded {
  height: 100%;
  bottom: 0;
  border-top: none;
}


/* Mini Player Bar */
.mp-bar {
  height: var(--player-height);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transition: opacity 0.2s;
}

#mini-player.expanded .mp-bar {
  opacity: 0;
  pointer-events: none;
  height: 0;
}

.mp-progress-bar {
  width: 100%;
  height: 2px;
  background: var(--border);
  cursor: pointer;
}

.mp-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.15s linear;
}

.mp-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0 var(--spacing-md);
  flex: 1;
}

.mp-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #eee;
}

.mp-info {
  flex: 1;
  min-width: 0;
}

.mp-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-channel {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mp-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  border-radius: 50%;
}

.mp-btn-play {
  background: var(--accent);
  color: #fff;
  padding: 8px;
  border-radius: 50%;
}

/* Expanded Player */
.mp-expanded {
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease 0.1s;
  background: var(--bg);
  overflow-y: auto;
}

#mini-player.expanded .mp-expanded {
  opacity: 1;
  pointer-events: auto;
}

.mp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.mp-header-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mp-minimize-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
}

.mp-main {
  padding: var(--spacing-xl) var(--spacing-xl) 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xl);
}

.mp-album-artwork {
  width: 100%;
  aspect-ratio: 1/1;
  max-width: 320px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #eee;
}

.mp-album-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp-details {
  text-align: center;
  width: 100%;
}

.mp-details h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.mp-details p {
  font-size: 16px;
  color: var(--text-secondary);
}

.mp-add-playlist-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
}

.mp-add-playlist-btn:active {
  background: #f0f0f0;
  transform: scale(0.96);
}

.mp-progressive-controls {
  width: 100%;
}

.mpx-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 8px;
}

.mpx-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  position: relative;
  border-radius: 2px;
}

.mpx-progress-fill::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
}

.mpx-time-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.mp-main-controls {
  display: flex;
  align-items: center;
  gap: 32px;
}

.mp-ctrl-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-play-circle {
  width: 80px;
  height: 80px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mp-volume-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  max-width: 280px;
  color: var(--text-secondary);
}

.mp-volume-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

.mp-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

.mp-queue-section {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.mp-queue-header {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: var(--spacing-md);
}

.mp-queue-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.queue-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.queue-item.queue-item-dragging {
  opacity: 0.55;
}

.queue-item.queue-drop-before {
  border-top-color: var(--accent);
  box-shadow: inset 0 2px 0 var(--accent);
}

.queue-item.queue-drop-after {
  border-bottom-color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.queue-reorder-handle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b0b0b0;
  flex-shrink: 0;
}

.queue-reorder-handle:active {
  background: #f0f0f0;
}

.queue-item.active {
  background: linear-gradient(135deg, #181818 0%, #222 100%);
  border-color: #2f2f2f;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.queue-item.active .queue-title {
  color: #fff;
  font-weight: 700;
}

.queue-item.active .queue-channel {
  color: #bdbdbd;
}

.queue-item.active .queue-reorder-handle {
  color: #efefef;
  background: rgba(255, 255, 255, 0.08);
}

.queue-item.active .queue-thumb {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.queue-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.queue-info {
  flex: 1;
  min-width: 0;
}

.queue-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-channel {
  font-size: 12px;
  color: var(--text-secondary);
}

.queue-remove-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #b8b8b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.queue-remove-btn:hover {
  color: #ff4444;
  background: #fff0f0;
}

.queue-remove-btn:active {
  transform: scale(0.9);
}

.queue-item.active .queue-remove-btn {
  color: #e2e2e2;
  background: rgba(255, 255, 255, 0.08);
}

.queue-item.active .queue-remove-btn:hover {
  color: #ffd0d0;
  background: rgba(255, 80, 80, 0.22);
}

#app.player-active .view {
  padding-bottom: calc(var(--nav-height) + var(--player-height) + var(--spacing-md));
}

/* Bottom nav remains persistent in V3 */
#app.player-expanded #bottom-nav {
  display: flex !important;
}

.btn-guest {
  width: 100%;
  max-width: 320px;
  margin-top: 16px;
  padding: 14px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-guest:active {
  background: #f5f5f5;
  transform: scale(0.98);
}

.queue-badge {
  font-size: 10px;
  color: #fff;
  background: #666;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}

.queue-playing-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.queue-playing-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@media (max-width: 360px) {
  .logo-img {
    height: 34px;
  }

  .auth-logo-img {
    height: 24px;
  }
}

@media (max-width: 480px) {
  .mp-main {
    padding: var(--spacing-sm) var(--spacing-sm) 140px;
    gap: var(--spacing-sm);
  }

  .mp-album-artwork {
    max-width: 180px;
  }

  .mp-details h2 {
    font-size: 16px;
  }

  .mp-details p {
    font-size: 13px;
  }

  .mp-play-circle {
    width: 56px;
    height: 56px;
  }
}

@media (min-width: 768px) {
  #app {
    max-width: 480px;
  }

  #bottom-nav {
    max-width: 480px;
  }

  #mini-player {
    max-width: 480px;
  }
}
