*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #0a0a0a;
  color: #f0f0f0;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Ubuntu,
    sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app.app--with-signout {
  padding-top: 3.25rem;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.65rem 1rem 0.5rem;
  pointer-events: none;
}

.app-header > * {
  pointer-events: auto;
}

.btn-signout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(24, 24, 24, 0.85);
  color: #b8b8b8;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.08s ease;
  backdrop-filter: blur(8px);
}

.btn-signout:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(40, 40, 40, 0.9);
}

.btn-signout:active {
  transform: scale(0.98);
}

.btn-signout-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.banner {
  background: #2a1f00;
  color: #ffe6a8;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 1rem;
}

.hidden {
  display: none !important;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  gap: 1rem;
}

.brand {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  color: #b8b8b8;
}

.welcome {
  font-size: 1.25rem;
  margin: 0;
  text-align: center;
}

.hint {
  font-size: 1rem;
  color: #b8b8b8;
  text-align: center;
  max-width: 28rem;
  margin: 0;
}

.status-msg {
  font-size: 1.25rem;
}

.btn {
  min-height: 56px;
  min-width: 200px;
  padding: 0 1.5rem;
  border-radius: 999px;
  border: none;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #1db954;
  color: #0a0a0a;
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-secondary {
  background: #2a2a2a;
  color: #f0f0f0;
  border: 1px solid #3a3a3a;
}

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

.btn-ghost {
  background: transparent;
  color: #b8b8b8;
  border: 1px solid #3a3a3a;
  min-height: 48px;
}

.btn-ghost:hover {
  color: #f0f0f0;
  border-color: #5a5a5a;
}

.error-text {
  font-size: 1.125rem;
  text-align: center;
  max-width: 32rem;
  line-height: 1.5;
  color: #f0f0f0;
}

/* Player layout — landscape-first */
#state-player {
  align-items: stretch;
  justify-content: flex-start;
  padding: 1.25rem 1.5rem 1rem;
  gap: 1.25rem;
}

.player-top {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
  align-items: start;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.art-wrap {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a1a;
  flex-shrink: 0;
}

.album-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #444;
}

.meta {
  min-width: 0;
}

.track-title {
  margin: 0 0 0.35rem;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  color: #f0f0f0;
}

.track-artist {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  color: #c8c8c8;
}

.progress-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-bar {
  height: 8px;
  background: #2a2a2a;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #1db954;
  border-radius: 4px;
  transition: width 0.1s linear;
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: #a8a8a8;
}

.transport-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.85rem;
}

.transport-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #e8e8e8;
  cursor: pointer;
  transition:
    color 0.15s ease,
    transform 0.08s ease,
    opacity 0.15s ease;
}

.transport-btn:hover:not(:disabled) {
  color: #fff;
  transform: scale(1.06);
}

.transport-btn:active:not(:disabled) {
  transform: scale(1);
}

.transport-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.transport-skip {
  width: 40px;
  height: 40px;
}

.transport-skip:hover:not(:disabled) {
  color: #fff;
}

.transport-play {
  width: 56px;
  height: 56px;
  background: #fff;
  color: #121212;
  flex-shrink: 0;
}

.transport-play:hover:not(:disabled) {
  transform: scale(1.05);
  background: #fff;
}

.transport-play:disabled {
  background: #3a3a3a;
  color: #888;
}

.transport-play .transport-icon-play.hidden,
.transport-play .transport-icon-pause.hidden {
  display: none;
}

.paused-badge {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: #888;
  font-weight: 600;
}

.lyrics-panel {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.lyrics-loading {
  font-size: 1.05rem;
  color: #a8a8a8;
}

.lyrics-content {
  width: 100%;
  max-height: min(55vh, 520px);
  overflow-y: auto;
  padding: 0.5rem 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.lyrics-content::-webkit-scrollbar {
  width: 6px;
}

.lyrics-content::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

.lyrics-line {
  margin: 0 0 0.65rem;
  font-size: 2rem;
  line-height: 1.45;
  color: #f0f0f0;
}

.lyrics-pre {
  width: 100%;
  max-height: min(55vh, 520px);
  overflow-y: auto;
  margin: 0;
  font-family: inherit;
  font-size: 2rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #f0f0f0;
}

.lyrics-empty {
  padding: 1rem 0;
}

@media (max-width: 899px) {
  .player-top {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .meta {
    width: 100%;
  }

  .progress-row {
    max-width: 100%;
  }

  .transport-row {
    gap: 1rem;
    margin-top: 0.75rem;
  }

  .transport-play {
    width: 52px;
    height: 52px;
  }

  .track-title {
    font-size: 1.25rem;
  }

  .lyrics-line,
  .lyrics-pre {
    font-size: 1.2rem;
  }
}

@media (min-width: 1200px) {
  .player-top {
    grid-template-columns: 180px 1fr;
  }

  .art-wrap {
    width: 180px;
    height: 180px;
  }

  .track-title {
    font-size: 1.5rem;
  }

  .lyrics-line,
  .lyrics-pre {
    font-size: 1.45rem;
  }
}
