:root {
  --bg-gradient: linear-gradient(135deg, #0f0c20 0%, #15102a 50%, #090714 100%);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-hover: rgba(255, 255, 255, 0.09);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --like-color: #10b981;
  --like-glow: rgba(16, 185, 129, 0.35);
  --dislike-color: #ef4444;
  --dislike-glow: rgba(239, 68, 68, 0.35);
  --skip-color: #8b5cf6;
  --skip-glow: rgba(139, 92, 246, 0.35);
  --card-radius: 24px;
}

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

body {
  font-family: 'Outfit', 'Inter', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow-x: hidden;
  padding: 20px;
}

header {
  position: relative;
  z-index: 50;
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  margin-bottom: 24px;
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.brand-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #ffffff, #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.user-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 5px 14px 5px 6px;
  border-radius: 9999px;
  color: #fff;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  outline: none;
}

.user-profile-btn:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: var(--skip-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--skip-glow);
}

.header-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.user-profile-btn:hover .header-user-avatar {
  transform: scale(1.1);
}

.user-profile-name {
  color: #fff;
  text-transform: capitalize;
  letter-spacing: 0.3px;
  font-weight: 700;
}

.user-profile-caret {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-left: 2px;
}

.mode-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.mode-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: var(--skip-color);
  color: white;
  box-shadow: 0 2px 8px var(--skip-glow);
}

.btn-tab {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-tab:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

main {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  flex: 1;
}

/* Search Bar */
.search-bar-container {
  width: 100%;
  position: relative;
  z-index: 40;
}

.search-input-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 6px 16px;
  transition: all 0.25s ease;
}

.search-input-wrapper:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--skip-color);
  box-shadow: 0 0 20px var(--skip-glow);
}

.search-icon {
  font-size: 1.1rem;
  margin-right: 10px;
  color: var(--text-muted);
}

.search-input-wrapper input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 0;
}

.search-input-wrapper input::placeholder {
  color: var(--text-muted);
}

.btn-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
}

.btn-clear:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Search Results Panel */
.search-results-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: #141028;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  max-height: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.search-results-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  padding-right: 4px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.search-result-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  flex: 1;
  margin-right: 12px;
}

.search-result-title {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.search-result-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-search-action {
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-search-play {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-search-play:hover {
  background: rgba(56, 189, 248, 0.3);
  color: white;
}

.btn-search-like {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-search-like:hover, .btn-search-like.active {
  background: var(--like-color);
  color: white;
}

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

.btn-search-dislike:hover, .btn-search-dislike.active {
  background: var(--dislike-color);
  color: white;
}

/* Player Container */
.player-card {
  width: 100%;
  background: rgba(20, 16, 38, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, opacity 0.3s ease;
  position: relative;
}

.seek-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(10, 8, 20, 0.9);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 14px 28px;
  border-radius: 16px;
  font-size: 1.3rem;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.seek-toast.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}



/* Liked Playlist Queue View */
.liked-playlist-card {
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

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

.liked-playlist-title-box h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.liked-playlist-title-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.liked-queue-list {
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.liked-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.liked-queue-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.liked-queue-item.playing {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.25);
}

.queue-num {
  width: 36px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.liked-queue-item.playing .queue-num {
  color: #c084fc;
}

.queue-info {
  flex: 1;
  overflow: hidden;
  margin-right: 12px;
}

.queue-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Audio Player Box */
.audio-player-box {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.audio-visualizer {
  display: none !important;
}

.bar {
  flex: 1;
  max-width: 8px;
  min-width: 3px;
  height: 4px;
  background: linear-gradient(180deg, #8b5cf6, #10b981);
  border-radius: 4px;
  transition: height 0.05s linear, opacity 0.1s ease;
  opacity: 0.35;
}

audio {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  outline: none;
}

.player-wrapper {
  position: relative;
  width: 100%;
  padding-top: 52%; /* 16:9 ratio aspect container */
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

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

.track-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.track-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.track-meta a {
  color: #38bdf8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.track-meta a:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

.track-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #c084fc;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Buttons Row */
.controls-container {
  display: flex;
  gap: 20px;
  width: 100%;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}

.action-btn {
  flex: 1;
  max-width: 220px;
  height: 64px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: white;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.action-btn::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.action-btn:hover::after {
  opacity: 1;
}

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

.btn-like {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  box-shadow: 0 8px 24px var(--like-glow);
}

.btn-like:hover {
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}

.btn-dislike {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  box-shadow: 0 8px 24px var(--dislike-glow);
}

.btn-dislike:hover {
  box-shadow: 0 12px 32px rgba(239, 68, 68, 0.5);
  transform: translateY(-2px);
}

.btn-skip {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
  box-shadow: 0 8px 24px var(--skip-glow);
}

.btn-skip:hover {
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
}

.btn-nuke {
  background: linear-gradient(135deg, #b45309 0%, #d97706 50%, #eab308 100%);
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.45);
  color: #fff;
}

.btn-nuke:hover {
  box-shadow: 0 12px 32px rgba(234, 179, 8, 0.65);
  transform: translateY(-2px);
}

.btn-nuke:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.7);
  box-shadow: none !important;
  transform: none !important;
  pointer-events: none;
}

.btn-nuke .kbd-shortcut {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-icon {
  font-size: 1.4rem;
}

.kbd-shortcut {
  font-size: 0.75rem;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-left: 4px;
  font-weight: 500;
}

/* Keyboard Hints Footer */
.keyboard-hints {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--glass-bg);
  padding: 8px 18px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.keyboard-hints kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: inherit;
}

/* Stats bar */
.stats-card {
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-counters {
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-val {
  font-size: 1.4rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-bar-bg {
  height: 10px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
  display: flex;
}

.progress-liked {
  background: var(--like-color);
  height: 100%;
  transition: width 0.4s ease;
}

.progress-disliked {
  background: var(--dislike-color);
  height: 100%;
  transition: width 0.4s ease;
}

/* Modal / History Drawer */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overflow-y: auto;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex !important;
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #141026;
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  width: 90%;
  max-width: 700px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  overflow-y: auto;
  margin: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.btn-close:hover {
  color: #fff;
  background: var(--glass-hover);
}

.modal-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-tab-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.modal-tab-btn.active {
  background: var(--skip-color);
  color: white;
  border-color: transparent;
}

.history-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.history-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.history-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-artist {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-reset {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reset:hover {
  background: rgba(239, 68, 68, 0.3);
  color: white;
}

/* Finished view */
.finished-card {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.finished-icon {
  font-size: 3.5rem;
}

/* User Selection Modal Styles */
.user-modal-content {
  text-align: center;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  gap: 20px;
  margin: auto;
}

.user-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.user-modal-icon {
  font-size: 2.5rem;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, #10b981, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.user-modal-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

.user-modal-header p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  max-height: 48vh;
  overflow-y: auto;
  padding: 4px 6px 4px 2px;
}

.user-modal-content::-webkit-scrollbar,
.user-grid::-webkit-scrollbar {
  width: 6px;
}

.user-modal-content::-webkit-scrollbar-thumb,
.user-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.user-modal-content::-webkit-scrollbar-track,
.user-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.user-card-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.user-card-btn:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: var(--skip-color);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px var(--skip-glow);
}

.user-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.user-card-btn:hover .user-avatar {
  transform: scale(1.08);
}

.user-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-transform: capitalize;
}

/* Add YouTube Link Card Styles */
.add-link-card {
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.add-link-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.add-link-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.add-link-header code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  color: #38bdf8;
  font-family: inherit;
}

.add-link-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.add-link-target-group {
  display: flex;
  gap: 16px;
  align-items: center;
}

.target-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  padding: 6px 14px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.target-radio:hover {
  background: rgba(255, 255, 255, 0.08);
}

.target-radio input[type="radio"] {
  accent-color: var(--skip-color);
  cursor: pointer;
}

.add-link-input-wrapper {
  display: flex;
  gap: 12px;
  width: 100%;
}

.add-link-input-wrapper input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.add-link-input-wrapper input:focus {
  border-color: var(--skip-color);
  box-shadow: 0 0 12px var(--skip-glow);
}

.btn-primary {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%) !important;
  color: white !important;
  font-weight: 700 !important;
  padding: 0 20px !important;
  box-shadow: 0 4px 14px var(--skip-glow);
  white-space: nowrap;
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
  transform: translateY(-1px);
}

.add-link-status {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
}

.add-link-status.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.add-link-status.duplicate {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.add-link-status.error {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Responsive adjustments for mobile / small vertical viewports */
@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
  }

  .brand {
    justify-content: center;
    gap: 8px;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-radius: 8px;
  }

  .brand-title {
    font-size: 1.15rem;
  }

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

  .user-profile-btn {
    grid-row: 1;
    grid-column: 1;
    width: 100%;
    justify-content: center;
    padding: 4px 10px 4px 6px;
    font-size: 0.85rem;
  }

  #btn-open-history {
    grid-row: 1;
    grid-column: 2;
    width: 100%;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
  }

  .mode-toggle {
    grid-row: 2;
    grid-column: 1 / span 2;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 3px;
    border-radius: 10px;
  }

  .mode-btn {
    padding: 6px 2px;
    font-size: 0.75rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  main {
    gap: 16px;
  }

  .search-input-wrapper {
    border-radius: 12px;
    padding: 4px 12px;
  }

  .search-input-wrapper input {
    font-size: 0.9rem;
    padding: 8px 0;
  }

  .player-card {
    padding: 16px;
    gap: 16px;
    border-radius: 20px;
  }

  .audio-player-box {
    padding: 12px;
    gap: 12px;
    border-radius: 12px;
  }

  audio {
    height: 38px;
  }

  .track-title {
    font-size: 1.25rem;
    margin-bottom: 4px;
  }

  .track-artist {
    font-size: 0.95rem;
  }

  .track-meta {
    font-size: 0.8rem;
    margin-top: 8px;
    gap: 8px;
  }

  .controls-container {
    gap: 8px;
    margin-top: 4px;
  }

  .action-btn {
    height: 48px;
    border-radius: 12px;
    font-size: 0.9rem;
    gap: 6px;
  }

  .btn-icon {
    font-size: 1.15rem;
  }

  .kbd-shortcut {
    display: none !important;
  }

  .keyboard-hints {
    display: none !important;
  }

  .stats-card {
    padding: 14px;
    gap: 10px;
    border-radius: 14px;
  }

  .stat-val {
    font-size: 1.15rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .progress-bar-bg {
    height: 8px;
  }

  /* Add YouTube Link layout on mobile */
  .add-link-card {
    padding: 16px;
    gap: 12px;
    border-radius: 20px;
  }

  .add-link-header h2 {
    font-size: 1.1rem;
  }

  .add-link-header p {
    font-size: 0.8rem;
  }

  .add-link-target-group {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .target-radio {
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 8px;
  }

  .add-link-input-wrapper {
    flex-direction: column;
    gap: 8px;
  }

  .add-link-input-wrapper input {
    padding: 10px 12px;
    font-size: 0.85rem;
    border-radius: 10px;
  }

  .btn-primary {
    height: 40px !important;
    padding: 0 16px !important;
    border-radius: 10px !important;
    font-size: 0.85rem !important;
  }

  .user-modal-content {
    padding: 16px;
    gap: 14px;
    max-height: 92vh;
    width: 95%;
  }

  .user-modal-icon {
    width: 50px;
    height: 50px;
    font-size: 2rem;
  }

  .user-modal-header h2 {
    font-size: 1.3rem;
  }

  .user-modal-header p {
    font-size: 0.85rem;
  }

  .user-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 44vh;
  }

  .user-card-btn {
    padding: 10px 6px;
    border-radius: 12px;
  }

  .user-avatar {
    width: 38px;
    height: 38px;
  }

  .user-name {
    font-size: 0.85rem;
  }

  .modal-content {
    padding: 16px;
    border-radius: 20px;
  }

  .modal-title {
    font-size: 1.2rem;
  }

  .modal-tab-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
}

@media (max-height: 720px) {
  .user-modal-icon {
    width: 44px;
    height: 44px;
    font-size: 1.8rem;
    border-radius: 12px;
  }
  .user-modal-header h2 {
    font-size: 1.25rem;
  }
  .user-modal-header p {
    font-size: 0.8rem;
  }
  .user-modal-content {
    gap: 10px;
    padding: 14px;
    max-height: 95vh;
  }
  .user-grid {
    max-height: 36vh;
    gap: 8px;
  }
  .user-card-btn {
    padding: 8px 6px;
    border-radius: 12px;
  }
  .user-avatar {
    width: 36px;
    height: 36px;
  }
  .user-modal-footer {
    padding-top: 10px;
    margin-top: 2px;
  }
  .user-modal-stats-link {
    padding: 8px 14px;
    font-size: 0.85rem;
  }
}

/* ==========================================================================
   User Selection Modal Footer Link
   ========================================================================== */
.user-modal-footer {
  width: 100%;
  padding-top: 16px;
  margin-top: 6px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: center;
}

.user-modal-stats-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(16, 185, 129, 0.18));
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 14px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.user-modal-stats-link:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(16, 185, 129, 0.35));
  border-color: var(--skip-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--skip-glow);
}

.stats-link-icon {
  font-size: 1.2rem;
}

.stats-link-arrow {
  color: #a78bfa;
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.user-modal-stats-link:hover .stats-link-arrow {
  transform: translateX(4px);
}

/* ==========================================================================
   Statistics & Leaderboard Page Styles
   ========================================================================== */
.stats-page-body {
  max-width: 1160px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 20px 48px;
}

.stats-header {
  max-width: 1120px;
}

.btn-back-player {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.btn-back-player:hover {
  background: rgba(139, 92, 246, 0.35);
  border-color: var(--skip-color);
  box-shadow: 0 6px 18px var(--skip-glow);
  transform: translateY(-2px);
}

.active-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 4px 12px 4px 6px;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.stats-main-container {
  width: 100%;
  max-width: 1120px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* KPI Cards */
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  width: 100%;
}

.kpi-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.25s ease;
}

.kpi-card:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.kpi-icon {
  font-size: 2.2rem;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-data {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.kpi-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Leaderboard Section */
.leaderboard-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.section-header-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 0 4px;
}

.section-header-box h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

.section-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  padding: 6px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.sort-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sort-dropdown {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.sort-dropdown:focus {
  border-color: var(--skip-color);
}

.sort-dropdown option {
  background: #18132c;
  color: #fff;
}

/* User Cards Grid */
.users-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  width: 100%;
}

.user-stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.user-stat-card:hover {
  background: var(--glass-hover);
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Medal Ranks */
.user-stat-card.rank-gold {
  border-color: rgba(234, 179, 8, 0.4);
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.08), rgba(255, 255, 255, 0.03));
}
.user-stat-card.rank-gold:hover {
  border-color: #eab308;
  box-shadow: 0 12px 32px rgba(234, 179, 8, 0.25);
}

.user-stat-card.rank-silver {
  border-color: rgba(203, 213, 225, 0.4);
  background: linear-gradient(135deg, rgba(203, 213, 225, 0.08), rgba(255, 255, 255, 0.03));
}
.user-stat-card.rank-silver:hover {
  border-color: #cbd5e1;
  box-shadow: 0 12px 32px rgba(203, 213, 225, 0.25);
}

.user-stat-card.rank-bronze {
  border-color: rgba(217, 119, 6, 0.4);
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.08), rgba(255, 255, 255, 0.03));
}
.user-stat-card.rank-bronze:hover {
  border-color: #d97706;
  box-shadow: 0 12px 32px rgba(217, 119, 6, 0.25);
}

/* Inactive Users (No ratings yet) */
.user-stat-card.card-inactive {
  opacity: 0.45;
  filter: grayscale(80%);
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.06);
}

.user-stat-card.card-inactive .score-number {
  color: var(--text-muted);
}

.user-stat-card.card-inactive .rank-pill {
  color: var(--text-muted);
  opacity: 0.6;
}

.user-stat-card.card-inactive .btn-view-user-tracks {
  opacity: 0.6;
  background: transparent;
}

.user-stat-card.card-inactive:hover {
  opacity: 0.85;
  filter: grayscale(20%);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}


.user-stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.user-name-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-transform: capitalize;
}

.user-last-active {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rank-pill {
  font-size: 1.1rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  padding: 4px 10px;
  border-radius: 9999px;
  color: #fff;
}

.user-score-highlight {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.score-number {
  font-size: 1.9rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: -0.5px;
}

.score-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.user-metric-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
}

.like-tag {
  color: var(--like-color);
}

.dislike-tag {
  color: var(--dislike-color);
}

.user-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
}

.user-bar-liked {
  background: var(--like-color);
  height: 100%;
  transition: width 0.4s ease;
}

.user-bar-disliked {
  background: var(--dislike-color);
  height: 100%;
  transition: width 0.4s ease;
}

.catalog-coverage-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.coverage-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.coverage-val {
  font-weight: 600;
  color: #fff;
}

.coverage-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.coverage-bar-fill {
  background: linear-gradient(90deg, #8b5cf6, #38bdf8);
  height: 100%;
  transition: width 0.4s ease;
}

.btn-view-user-tracks {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.btn-view-user-tracks:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--skip-color);
  color: #fff;
}

.btn-view-user-tracks .arrow {
  color: #a78bfa;
  transition: transform 0.2s ease;
}

.btn-view-user-tracks:hover .arrow {
  transform: translateX(4px);
}

/* User Tracks Modal */
.user-tracks-modal-content {
  max-width: 820px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.modal-user-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-avatar-modal {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

#modal-user-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.modal-user-stats-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-switch-user {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #fff;
}

.btn-switch-user:hover {
  background: rgba(16, 185, 129, 0.35);
  border-color: var(--like-color);
  box-shadow: 0 4px 14px var(--like-glow);
}

.user-tracks-search-wrapper {
  width: 100%;
}

.user-tracks-search-wrapper input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.user-tracks-search-wrapper input:focus {
  border-color: var(--skip-color);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

.user-tracks-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  padding-right: 4px;
}

.user-track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px 14px;
  transition: all 0.2s ease;
}

.user-track-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.user-track-row.row-liked {
  border-left: 3px solid var(--like-color);
}

.user-track-row.row-disliked {
  border-left: 3px solid var(--dislike-color);
}

.track-row-status-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.track-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.track-row-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-row-artist {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.badge-status {
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.72rem;
}

.badge-like {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-dislike {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.track-badge-local {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.72rem;
}

.track-badge-yt {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.72rem;
}

.track-row-date {
  opacity: 0.8;
}

.track-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.mini-audio-player {
  height: 32px;
  max-width: 180px;
}

.btn-yt-link {
  color: #fca5a5;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-yt-link:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

.error-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
}

.loading-state, .empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .stats-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .stats-header .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .stats-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .users-stats-grid {
    grid-template-columns: 1fr;
  }

  .user-tracks-modal-content {
    padding: 16px;
  }

  .mini-audio-player {
    max-width: 120px;
  }
}

/* ==========================================================================
   Nuke Confirmation Modal Styles
   ========================================================================== */
.nuke-modal-content {
  max-width: 520px;
  text-align: center;
  gap: 20px;
  position: relative;
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 20px 60px rgba(239, 68, 68, 0.2), 0 25px 60px rgba(0, 0, 0, 0.8);
}

.nuke-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.nuke-modal-icon {
  font-size: 2.5rem;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.45);
}

.nuke-modal-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

.nuke-track-name {
  font-size: 1rem;
  font-weight: 600;
  color: #f3f4f6;
  background: rgba(0, 0, 0, 0.35);
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nuke-warning-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.nuke-warning-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fca5a5;
}

.nuke-users-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nuke-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 4px 10px 4px 6px;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.nuke-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.nuke-heart-badge {
  font-size: 0.75rem;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}

.nuke-sub-warning {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.nuke-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.btn-cancel-nuke {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: #fff;
  cursor: pointer;
}

.btn-cancel-nuke:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger-nuke {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border: 1px solid #ef4444;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
  cursor: pointer;
}

.btn-danger-nuke:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.6);
  transform: translateY(-2px);
}

/* PocketBase Google SSO Styles */
.auth-sso-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin: 12px 0 20px 0;
}

.auth-sso-desc {
  font-size: 0.92rem;
  color: var(--text-muted, #9ca3af);
  text-align: center;
  max-width: 380px;
  line-height: 1.4;
}

.btn-google-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 360px;
}

.btn-google-login:hover {
  background: #f3f4f6;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-google-login:active {
  transform: translateY(0);
}

.google-icon-svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.auth-error-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
  animation: fadeIn 0.3s ease;
}

.auth-divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 12px 0;
  color: var(--text-muted, #6b7280);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.auth-divider span {
  padding: 0 12px;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
}



