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

body {
  font-family: 'Segoe UI', sans-serif;
  background: #121212;
  color: #fff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 500px;
  padding: 24px;
}

/* Mobile */
@media (max-width: 480px) {
  #app { padding: 16px; }
  h1 { font-size: 1.6rem; }
  button { padding: 14px 20px; font-size: 1rem; min-height: 48px; }
  input[type="text"] { font-size: 16px; } /* prevents iOS zoom */
  ul li { padding: 14px 16px; min-height: 48px; }
}

.screen {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.screen.active {
  display: flex;
}

h1 {
  font-size: 2rem;
  color: #1DB954;
}

h3 {
  font-size: 1rem;
  color: #aaa;
  margin-top: 8px;
}

p {
  color: #ccc;
  line-height: 1.5;
}

input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #1e1e1e;
  color: #fff;
  font-size: 1rem;
}

input[type="text"]:focus {
  outline: none;
  border-color: #1DB954;
}

button {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  background: #1DB954;
  color: #000;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #1ed760;
}

button.secondary {
  background: #333;
  color: #fff;
}

button.secondary:hover {
  background: #444;
}

.button-row {
  display: flex;
  gap: 12px;
}

.button-row button {
  flex: 1;
}

ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

ul li {
  padding: 12px 16px;
  background: #1e1e1e;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

ul li:hover {
  background: #2a2a2a;
}

ul li.selected {
  border: 2px solid #e84444;
  background: #2a1a1a;
  color: #fff;
  font-weight: 600;
}

.search-row {
  display: flex;
  gap: 8px;
}

.search-row input {
  flex: 1;
}

.search-row button {
  flex-shrink: 0;
}

#selected-song {
  background: #1e1e1e;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid #1DB954;
}

#spotify-embed {
  margin: 12px 0;
}

#error-msg {
  color: #ff5555;
  text-align: center;
  min-height: 24px;
  margin-top: 8px;
}

#display-room-code {
  font-size: 1.4rem;
  letter-spacing: 4px;
  color: #1DB954;
}

#scores-list {
  list-style: decimal;
  padding-left: 20px;
}

#scores-list li {
  background: #1e1e1e;
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: default;
  gap: 8px;
}

#scores-list li:hover {
  background: #1e1e1e;
}

.score-detail {
  color: #aaa;
  font-size: 0.85rem;
  text-align: right;
}

.score-detail strong {
  color: #1DB954;
  font-size: 1rem;
}

#now-playing {
  background: #1e1e1e;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
}

#track-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
}

#artist-name {
  color: #aaa;
  margin-top: 4px;
}

.already-picked {
  font-size: 0.75rem;
  background: #2a2a2a;
  color: #aaa;
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Timer */
.playing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timer {
  font-size: 2rem;
  font-weight: 700;
  color: #1DB954;
  min-width: 48px;
  text-align: right;
}

.timer.warning {
  color: #e84444;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Fade in animation for results */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
}

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

#host-controls {
  margin-top: 8px;
}

#host-controls button {
  width: 100%;
  background: #333;
  color: #fff;
}

#host-controls button:hover {
  background: #444;
}

/* Review screen */
#review-songs {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}

.review-song {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 14px 16px;
}

.review-song-title {
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}

.review-artist {
  color: #aaa;
  font-weight: 400;
}

.review-player-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-guess-btn {
  padding: 8px 14px;
  font-size: 0.9rem;
  background: #2a2a2a;
  color: #fff;
  border: 2px solid transparent;
}

.review-guess-btn:hover {
  background: #333;
}

.review-guess-btn.selected {
  border-color: #1DB954;
  background: #1a3a25;
  color: #1DB954;
}

.review-guess-btn.selected.duplicate {
  border-color: #e84444;
  background: #2a1a1a;
  color: #e84444;
}

#guess-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.summary-label {
  font-size: 0.85rem;
  color: #aaa;
}

.summary-chip {
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.summary-chip.ok {
  background: #1a3a25;
  color: #1DB954;
}

.summary-chip.zero {
  background: #2a1a1a;
  color: #e84444;
}

.summary-chip.over {
  background: #2a1f1a;
  color: #E8832A;
}

#duplicate-warning {
  color: #e84444;
  font-size: 0.9rem;
  text-align: center;
  min-height: 20px;
}

/* Results reveals list */
#reveals-list li {
  cursor: default;
  color: #ccc;
}

#reveals-list li:hover {
  background: #1e1e1e;
}

#reveals-list strong {
  color: #1DB954;
}

#reveals-list li.correct-reveal {
  border-left: 3px solid #1DB954;
  padding-left: 13px;
  background: #162a1e;
}

.correct-tick {
  color: #1DB954;
  font-weight: 700;
  margin-left: 8px;
  font-size: 1.1rem;
}

/* Kick button — host-only ✕ next to player names */
.kick-btn {
  padding: 3px 8px;
  font-size: 0.75rem;
  background: #3a1a1a;
  color: #e84444;
  border: 1px solid #55221a;
  border-radius: 4px;
  margin-left: auto;
  cursor: pointer;
  font-weight: 700;
  flex-shrink: 0;
  min-height: unset;
}

.kick-btn:hover {
  background: #e84444;
  color: #fff;
}

#player-list li {
  display: flex;
  align-items: center;
}

/* Host-only ready list on review screen */
#player-ready-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.ready-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #1a1a1a;
  border-radius: 6px;
}

.ready-yes {
  color: #1DB954;
  font-weight: 600;
  font-size: 0.95rem;
}

.ready-no {
  color: #888;
  font-size: 0.95rem;
}
