* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #121016;
  color: #f1eef6;
  min-height: 100vh;
}
.hidden { display: none !important; }

.screen { min-height: 100vh; }

.login-box {
  max-width: 380px;
  margin: 15vh auto 0;
  padding: 32px;
  background: #1c1922;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.login-box h1 { margin-top: 0; }
.login-box input {
  width: 100%;
  padding: 12px;
  margin: 12px 0;
  border-radius: 8px;
  border: 1px solid #35313f;
  background: #0f0d13;
  color: #fff;
  font-size: 16px;
}
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
button.secondary {
  background: #2a2632;
  color: #ddd;
}
.error { color: #ff6b6b; min-height: 20px; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #232030;
}
header h1 { margin: 0; font-size: 20px; }

.album-list {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}
.album-card {
  background: #1c1922;
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  transition: transform 0.1s;
}
.album-card:hover { transform: translateY(-2px); }
.album-title { font-weight: 600; font-size: 16px; }
.album-desc { font-size: 13px; color: #c9c4d6; margin-top: 6px; }
.album-count { font-size: 12px; color: #9d97ac; margin-top: 10px; }

.song-list {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 700px;
  margin: 0 auto 100px;
}
.back-btn { margin-bottom: 16px; }
.song-card {
  background: #1c1922;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.song-title { font-weight: 600; font-size: 16px; }
.song-date { font-size: 12px; color: #9d97ac; margin-top: 2px; }
.song-desc { font-size: 14px; color: #c9c4d6; margin-top: 6px; }
.song-avg-rating { font-size: 13px; color: #ffcf6b; margin-top: 6px; }
.play-btn { white-space: nowrap; align-self: flex-start; }
.empty { text-align: center; color: #9d97ac; margin-top: 40px; }

.song-actions { display: flex; flex-direction: column; gap: 10px; }
.rating-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #15131a;
  border-radius: 10px;
  padding: 12px;
}
.rating-box label { font-size: 13px; color: #c9c4d6; }
.rating-slider { width: 100%; }
.rating-comment {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #35313f;
  background: #0f0d13;
  color: #fff;
  font-size: 13px;
  resize: vertical;
}
.save-rating-btn { align-self: flex-start; font-size: 13px; padding: 8px 14px; }
.rating-status { min-height: 16px; }

.song-card.playing {
  outline: 2px solid #a855f7;
}

.player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #1c1922;
  border-top: 1px solid #2c2836;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.player-info { min-width: 160px; }
.player-title { font-weight: 600; }
.player-desc { font-size: 12px; color: #9d97ac; }
.player audio { display: none; }

.player-controls {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.player-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.player-btn {
  background: none;
  color: #ddd;
  font-size: 18px;
  padding: 6px 10px;
  border-radius: 8px;
}
.player-btn.play-pause {
  font-size: 20px;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  padding: 8px 14px;
}
.player-btn.active {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.15);
}
.player-seek {
  display: flex;
  align-items: center;
  gap: 8px;
}
.player-seek input[type="range"] { flex: 1; }
.time-label { font-size: 12px; color: #9d97ac; min-width: 36px; text-align: center; }

/* Admin */
.admin-main {
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.panel {
  background: #1c1922;
  border-radius: 12px;
  padding: 20px;
  flex: 1;
  min-width: 300px;
}
.panel.wide { flex-basis: 100%; }
.panel h2 { margin-top: 0; font-size: 17px; }
.panel form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel input, .panel textarea, .panel select {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #35313f;
  background: #0f0d13;
  color: #fff;
  font-size: 14px;
}
.group-list { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.group-chip {
  background: #2a2636;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.group-chip button {
  background: none;
  padding: 0;
  color: #ff6b6b;
  font-weight: 700;
}

.song-row {
  border-bottom: 1px solid #26222f;
  padding: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.song-row-main { flex: 1; min-width: 200px; }
.song-row-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 200px;
}
.chk { font-size: 13px; display: flex; align-items: center; gap: 4px; }
.muted { color: #9d97ac; font-size: 13px; }
.delete-song {
  background: #3a1f24;
  color: #ff9b9b;
}

.log-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.stat-chip {
  background: #2a2636;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  color: #d8c7ff;
}
.log-table {
  max-height: 300px;
  overflow-y: auto;
  border-top: 1px solid #26222f;
}
.log-row {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #26222f;
  font-size: 13px;
}
.log-row span:first-child {
  min-width: 150px;
  color: #9d97ac;
}

.ratings-panel {
  flex-basis: 100%;
  background: #15131a;
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 6px;
}
.ratings-panel .log-row span:nth-child(2) {
  min-width: 50px;
  color: #ffcf6b;
}

.edit-panel {
  flex-basis: 100%;
  background: #15131a;
  border-radius: 10px;
  padding: 14px;
  margin-top: 6px;
}
.edit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
}
.edit-form-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}
