* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  margin: 0;
}

/* ============== PLAYER ============== */
body.player {
  background: #0f0f12;
  color: #fff;
  height: 100dvh;
  overflow: hidden;
}
.player-main {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}
.logo {
  font-size: 12px;
  letter-spacing: 8px;
  font-weight: 700;
  opacity: 0.4;
  position: absolute;
  top: 32px;
}
.play-btn {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.25s, color 0.25s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.play-btn:active { transform: scale(0.95); }
.play-btn svg { width: 80px; height: 80px; }
.play-btn.playing {
  background: #ef4444;
  color: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6), 0 8px 32px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 0 0 30px rgba(239,68,68,0), 0 8px 32px rgba(0,0,0,0.4); }
}
.status {
  font-size: 14px;
  opacity: 0.6;
  letter-spacing: 1px;
  text-transform: uppercase;
  min-height: 18px;
}
.timer {
  font-size: 32px;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  min-height: 40px;
}

/* ============== ADMIN ============== */
body.admin {
  background: #f5f5f7;
  color: #111;
  padding: 24px;
  max-width: 1000px;
  margin: 0 auto;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
h1 { margin: 0; font-size: 22px; }
h2 { margin-top: 0; font-size: 16px; }

section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.btn-primary {
  background: #111;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  display: inline-block;
  font-weight: 500;
}
.btn-primary:hover { background: #333; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  background: #f5f5f7;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.tab.active { background: #111; color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  align-items: flex-end;
}
.row > * { flex: 1; min-width: 140px; }

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #444;
  margin-bottom: 12px;
}

input {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  font-family: inherit;
}
input:focus { outline: 2px solid #111; outline-offset: -1px; }

.hint {
  font-size: 12px;
  color: #888;
  margin: 8px 0 12px 0;
}

/* iTunes results */
.itunes-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}
.itunes-result:last-child { border-bottom: none; }
.itunes-result img { width: 48px; height: 48px; border-radius: 4px; flex-shrink: 0; }
.itunes-result .info { flex: 1; min-width: 160px; }
.itunes-result .title { font-weight: 600; font-size: 14px; }
.itunes-result .artist { color: #666; font-size: 12px; }
.itunes-result audio { height: 36px; max-width: 240px; }

/* Songs table */
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}
th {
  background: #fafafa;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: #666;
}
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions a { color: #0066cc; text-decoration: none; font-size: 13px; }
.actions a:hover { text-decoration: underline; }
.btn-del {
  background: #fee;
  border: 1px solid #fcc;
  color: #c33;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.btn-del:hover { background: #fdd; }

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-mp3 { background: #e8f5e9; color: #2e7d32; }
.badge-itunes { background: #fff3e0; color: #e65100; }
