:root {
  --bg: #0e0e10;
  --surface: #1a1a1f;
  --surface-2: #25252c;
  --text: #f5f5f7;
  --muted: #9b9ba3;
  --accent: #f4b942;
  --accent-text: #1a1a1f;
  --danger: #ff6b6b;
  --border: #2e2e36;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  min-height: 100vh;
  min-height: 100dvh;
}

.hidden { display: none !important; }

.screen { animation: fade 0.18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.muted { color: var(--muted); margin: 0 0 20px; }
.error { color: var(--danger); margin: 8px 0 0; font-size: 14px; }

.show-header { margin-bottom: 20px; }

/* slots */
.slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.slot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}
.slot.empty {
  border-style: dashed;
  color: var(--muted);
  justify-content: center;
}
.slot.filled .art {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--surface-2);
  flex-shrink: 0;
  object-fit: cover;
}
.slot.filled .meta {
  flex: 1;
  min-width: 0;
}
.slot.filled .meta .title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot.filled .meta .artist {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot .remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  cursor: pointer;
}
.slot .remove:hover { background: var(--surface-2); color: var(--text); }

/* search */
.search { position: relative; margin-bottom: 24px; }
#search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 17px;
  outline: none;
}
#search-input:focus { border-color: var(--accent); }
#search-input:disabled { opacity: 0.5; }

.results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 360px;
  overflow-y: auto;
}
.results:empty { display: none; }
.results li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.results li:last-child { border-bottom: none; }
.results li:hover, .results li:active { background: var(--surface-2); }
.results .art {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--surface-2);
  flex-shrink: 0;
  object-fit: cover;
}
.results .meta { min-width: 0; flex: 1; }
.results .title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.results .artist {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* buttons */
button.primary, button.secondary {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
}
button.primary {
  background: var(--accent);
  color: var(--accent-text);
}
button.primary:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}
button.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.row button { flex: 1; }

/* contact form */
form label {
  display: block;
  margin-bottom: 14px;
}
form label span {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}
form input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 17px;
  outline: none;
}
form input:focus { border-color: var(--accent); }

/* recap */
.recap {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
.recap li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 6px;
}
.recap .art {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--surface-2);
  object-fit: cover;
  flex-shrink: 0;
}
.recap .title { font-weight: 600; font-size: 15px; }
.recap .artist { color: var(--muted); font-size: 13px; }

/* admin */
.admin-wrap { max-width: 880px; margin: 0 auto; padding: 24px 20px 40px; }
.admin-wrap header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.admin-wrap select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 15px;
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.stat {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
}
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 4px; }

.admin-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
@media (max-width: 720px) { .admin-grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
}
.panel h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }

.ranking-list, .feed { list-style: none; margin: 0; padding: 0; }
.ranking-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.ranking-list li:last-child { border-bottom: none; }
.ranking-list .info { min-width: 0; }
.ranking-list .title { font-weight: 600; }
.ranking-list .artist { color: var(--muted); font-size: 13px; }
.ranking-list .votes {
  background: var(--accent);
  color: var(--accent-text);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  align-self: center;
  flex-shrink: 0;
}

.feed li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.feed li:last-child { border-bottom: none; }
.feed .meta { color: var(--muted); font-size: 12px; }

.export-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
