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

:root {
  --bg: #0d0d0d;
  --surface: #1a0000;
  --surface2: #220000;
  --accent: #cc0000;
  --accent-hover: #e60000;
  --text: #f0f0f0;
  --text-dim: #999;
  --border: #2e0000;
  --radius: 12px;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) 180px calc(16px + env(safe-area-inset-left, 0px));
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Club Header */
.club-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 20px;
  animation: fadeInUp 0.4s ease-out;
}

.club-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.club-name {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
}

.admin-link {
  font-size: 11px;
  font-weight: 500;
  color: #444;
  text-decoration: none;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid #2a2a2a;
  transition: all 0.15s ease;
  display: inline-block;
}

.admin-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Album Header */
.album-header {
  text-align: center;
  padding: 0 0 28px;
  animation: fadeInUp 0.5s ease-out;
}

.cover-wrapper {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto 20px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(200,0,0,0.3), 0 4px 16px rgba(0,0,0,0.6);
  animation: scaleIn 0.6s ease-out;
  border: 1px solid var(--border);
}

.album-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  transition: opacity 0.4s ease;
}

.album-cover.loaded { display: block; }

.cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a0000 0%, #2e0000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-placeholder img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  opacity: 0.6;
}

.cover-placeholder.hidden { display: none; }

.album-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.album-artist {
  font-size: 15px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 6px;
}

.album-description {
  font-size: 13px;
  color: var(--text-dim);
}

/* Song List */
.song-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.song-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: fadeInUp 0.4s ease-out both;
  animation-delay: calc(var(--i, 0) * 0.04s);
}

.song-item:hover { background: var(--surface); }
.song-item:active { background: var(--surface2); transform: scale(0.99); }
.song-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.song-item.active { background: var(--surface2); }
.song-item.active .song-title { color: var(--accent); }

.song-number {
  font-size: 14px;
  color: var(--text-dim);
  min-width: 24px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.song-item.active .song-number { color: var(--accent); }

.song-eq {
  display: none;
  gap: 2px;
  align-items: flex-end;
  height: 16px;
}

.song-item.active.playing .song-number-text { display: none; }
.song-item.active.playing .song-eq { display: flex; }

.eq-bar {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  animation: eq 0.8s ease-in-out infinite alternate;
}
.eq-bar:nth-child(1) { height: 60%; animation-delay: 0s; }
.eq-bar:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.eq-bar:nth-child(3) { height: 40%; animation-delay: 0.4s; }

@keyframes eq {
  0% { height: 30%; }
  100% { height: 100%; }
}

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

.song-title {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.song-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.song-duration {
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.song-playcount {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.song-playcount.has-plays {
  color: var(--accent);
  opacity: 0.8;
}

/* Player Bar */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(18, 0, 0, 0.97);
  border-top: 1px solid var(--border);
  padding: 12px calc(16px + env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  transition: transform 0.3s ease;
}

.player-bar.hidden { transform: translateY(100%); }

.now-playing {
  text-align: center;
  margin-bottom: 8px;
}

.now-playing-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 2px;
}

.now-playing-title {
  font-size: 14px;
  font-weight: 600;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: height 0.15s ease;
}

.progress-bar:hover { height: 6px; }

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

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

.progress-bar:hover .progress-fill::after {
  transform: translateY(-50%) scale(1);
}

.time {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}

.time:last-child { text-align: right; }

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.ctrl-btn:hover { color: #fff; transform: scale(1.1); }
.ctrl-btn:active { transform: scale(0.95); }
.ctrl-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ctrl-btn.active { color: var(--accent); }
.ctrl-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.play-btn {
  background: var(--accent);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.play-btn:hover { background: var(--accent-hover); color: #fff; transform: scale(1.08); }
.play-btn.active::after { display: none; }

.mute-btn {
  margin-left: auto;
  color: var(--text-dim);
}

.error-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #cc0000;
  color: #fff;
  text-align: center;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.error-banner.visible { transform: translateY(0); }

.error-retry {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.error-retry:hover { background: rgba(255,255,255,0.3); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  font-size: 16px;
  animation: fadeInUp 0.5s ease-out;
}

@media (max-width: 400px) {
  .volume-control { display: none; }
  .controls { gap: 12px; }
}
