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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a0a;
  color: #fff;
  min-height: 100vh;
  overflow: hidden;
}

.view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.hidden {
  display: none !important;
}

/* ============ HOME (style Google) ============ */

.home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 580px;
}

.home-logo {
  font-size: 4rem;
  font-weight: 200;
  letter-spacing: -0.02em;
  color: #fff;
}

.home-tagline {
  color: #888;
  font-size: 1rem;
}

.home-form {
  display: flex;
  width: 100%;
  gap: 0;
  border-radius: 28px;
  overflow: hidden;
  background: #1a1a1a;
  border: 1px solid #333;
  transition: border-color 0.2s;
}

.home-form:focus-within {
  border-color: #666;
}

.home-form input {
  flex: 1;
  padding: 0.9rem 1.5rem;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1rem;
  outline: none;
}

.home-form input::placeholder {
  color: #666;
}

#btn-play {
  padding: 0.9rem 2rem;
  background: #fff;
  color: #0a0a0a;
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s;
}

#btn-play:hover {
  background: #e0e0e0;
}

.link-btn {
  background: none;
  border: none;
  color: #555;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}

.link-btn:hover {
  color: #888;
}

/* ============ PLAYER ============ */

#view-player {
  justify-content: flex-start;
  padding: 0;
}

.player-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem 1.5rem;
  background: #111;
  border-bottom: 1px solid #222;
}

.vibe-bar {
  display: flex;
  flex: 1;
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #1a1a1a;
  border: 1px solid #333;
  transition: border-color 0.2s;
}

.vibe-bar:focus-within {
  border-color: #555;
}

.vibe-bar input {
  flex: 1;
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.vibe-bar input::placeholder {
  color: #555;
}

.vibe-btn {
  padding: 0.6rem 1.2rem;
  background: #333;
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.vibe-btn:hover {
  background: #444;
}

.settings-btn {
  background: none;
  border: none;
  color: #555;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.4rem;
  transition: color 0.2s;
}

.settings-btn:hover {
  color: #aaa;
}

/* Now Playing */

.now-playing {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 0.5rem;
}

.now-status {
  font-size: 0.8rem;
  color: #555;
  min-height: 1.2em;
}

.now-title {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-artist {
  font-size: 1.4rem;
  color: #999;
  font-weight: 300;
}

.now-year {
  font-size: 0.9rem;
  color: #555;
}

/* Progress Bar */

.progress-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.time {
  font-size: 0.8rem;
  color: #666;
  font-variant-numeric: tabular-nums;
  min-width: 3em;
}

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

.progress-bar {
  flex: 1;
  height: 4px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 2px;
  transition: width 0.5s linear;
}

.controls-wrapper {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  max-width: 650px;
  padding: 0 2rem 1.5rem;
  align-self: center;
}

.control-btn {
  background: none;
  border: 1px solid #333;
  color: #888;
  font-size: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.control-btn:hover {
  border-color: #555;
  color: #fff;
}

/* Next Track */

.next-track {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.5rem;
  background: #111;
  border-top: 1px solid #222;
}

.next-label {
  font-size: 0.75rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.next-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.next-info #next-title {
  font-size: 0.95rem;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-info #next-artist {
  font-size: 0.8rem;
  color: #666;
}

.reroll-btn {
  background: none;
  border: 1px solid #333;
  color: #888;
  font-size: 1.3rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.reroll-btn:hover {
  border-color: #555;
  color: #fff;
}

.reroll-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.reroll-btn.spinning {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============ MODAL ============ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  position: relative;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.modal-content h2 {
  font-size: 1.3rem;
  font-weight: 600;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.setting-group label {
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.setting-group input,
.setting-group select {
  padding: 0.7rem 1rem;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.setting-group input:focus,
.setting-group select:focus {
  border-color: #666;
}

.setting-group input::placeholder {
  color: #555;
}

.setting-help {
  font-size: 0.75rem;
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.setting-help:hover {
  color: #aaa;
}

.modal-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.modal-actions button {
  flex: 1;
  padding: 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#btn-save-settings {
  background: #fff;
  color: #0a0a0a;
  border: none;
}

#btn-save-settings:hover {
  background: #e0e0e0;
}

.btn-secondary {
  background: transparent;
  color: #888;
  border: 1px solid #333;
}

.btn-secondary:hover {
  background: #222;
}

/* ============ LOADING ============ */

.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* ============ RESPONSIVE ============ */

@media (max-width: 600px) {
  .home-logo {
    font-size: 3rem;
  }

  .now-title {
    font-size: 2rem;
  }

  .now-artist {
    font-size: 1.1rem;
  }

  .progress-wrapper {
    padding: 0 1.5rem 1.5rem;
  }
}
