html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: #100819;
  color: #f4eef8;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 48px;
  position: relative;
}

.screen.hidden,
.hidden {
  display: none !important;
}

.panel {
  width: 520px;
  max-width: 100%;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand.tight {
  margin: 0;
  gap: 8px;
}

.brand-mark {
  width: 64px;
  height: 64px;
  display: block;
  object-fit: contain;
}

.brand.tight .brand-mark {
  width: 32px;
  height: 32px;
}

.brand-word {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand.tight .brand-word {
  font-size: 22px;
}

h1 {
  margin: 0 0 16px;
  font-size: 32px;
  font-weight: 600;
}

.muted {
  color: #c7b7d6;
  line-height: 1.4;
}

.qr-box {
  display: inline-block;
  background: #fff;
  padding: 16px;
  margin: 24px 0 16px;
}

.code {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 0;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 18px;
  cursor: pointer;
}

button.primary {
  background: #b24bf3;
  color: #fff;
}

button.ghost {
  background: transparent;
  color: #f4eef8;
  border: 1px solid rgba(244, 238, 248, 0.35);
}

#retry-button {
  margin-top: 24px;
  background: #b24bf3;
  color: #fff;
}

.loading-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.equalizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 48px;
}

.equalizer i {
  display: block;
  width: 8px;
  height: 50%;
  border-radius: 999px;
  background: linear-gradient(#f7d046, #ff4d9a, #5ce1e6);
  box-shadow: 0 0 18px rgba(178, 75, 243, 0.45);
  transform-origin: center bottom;
  animation: bounce 1.2s ease-in-out infinite alternate;
}

.equalizer i:nth-child(2) {
  height: 100%;
  animation-delay: -0.4s;
}

.equalizer i:nth-child(3) {
  height: 68%;
  animation-delay: -0.75s;
}

.equalizer i:nth-child(4) {
  height: 85%;
  animation-delay: -0.15s;
}

@keyframes bounce {
  to {
    transform: scaleY(0.42);
  }
}

.dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: rgba(16, 8, 25, 0.72);
  box-sizing: border-box;
}

.dialog-card {
  width: 480px;
  max-width: 100%;
  padding: 32px;
  border-radius: 16px;
  background: #1c1228;
  text-align: center;
}

.dialog-card h2 {
  margin: 0 0 12px;
  font-size: 28px;
}

.dialog-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.dialog-actions button.ghost {
  background: transparent;
  border: 1px solid rgba(244, 238, 248, 0.35);
  color: #f4eef8;
}

.dialog-actions button.primary {
  background: #ff0000;
  color: #fff;
}

.screen.link {
  align-items: center;
  justify-content: center;
  padding: 96px 48px 48px;
  overflow: auto;
}

.corner-sign-out {
  position: absolute;
  top: 36px;
  right: 36px;
  z-index: 4;
  background: rgba(16, 8, 25, 0.72);
  border: 0;
  color: #f4eef8;
}

.link-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  width: 100%;
  max-width: 1100px;
}

.link-qr {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.link-qr .brand,
.link-qr .qr-box,
.link-qr .code {
  display: flex;
  justify-content: center;
}

.link-qr .qr-box {
  margin-top: 0;
}

.link-help {
  flex: 1 1 420px;
  min-width: 0;
  max-width: 560px;
  text-align: left;
}

.link-help h1 {
  margin-bottom: 12px;
}

.link-steps {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

.link-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 12px;
  line-height: 1.4;
}

.link-steps .step-index {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ff0000;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
}

@media (max-width: 900px) {
  .link-layout {
    flex-direction: column;
    gap: 24px;
  }

  .link-help {
    max-width: 520px;
  }
}

.screen.player {
  display: block;
  padding: 0;
  position: relative;
  background: #000;
  overflow: hidden;
  /* All children are absolutely positioned; without an explicit height the
     iframe collapses to 0px and YouTube plays audio with no picture. */
  width: 100%;
  height: 100%;
}

.player-bar {
  position: absolute;
  z-index: 4;
  top: 72px;
  right: 36px;
  left: auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0;
  background: transparent;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.player-bar.chrome-hidden {
  opacity: 0;
  pointer-events: none;
}

.player-bar.chrome-hidden .player-bar-actions {
  pointer-events: none;
}

.player-bar-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  pointer-events: auto;
}

.player-bar-actions button.ghost {
  background: rgba(16, 8, 25, 0.72);
  border: 1px solid rgba(244, 238, 248, 0.35);
  color: #f4eef8;
  text-align: center;
  min-width: 148px;
}

.player-bar-actions button.primary {
  min-width: 148px;
}

#player-shell {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #000;
  overflow: hidden;
}

#player-shell iframe,
#player-host {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  border: 0;
  background: #000;
}

.waiting {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: #100819;
}

.center-next {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: calc(50% + 72px);
  width: 60px;
  height: 60px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.center-next svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

.center-next.chrome-hidden {
  opacity: 0;
  pointer-events: none;
}

.player-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  pointer-events: none;
}

.player-shield.chrome-hidden {
  pointer-events: auto;
}

.track-credit {
  position: absolute;
  z-index: 3;
  top: 72px;
  left: 36px;
  min-width: 35%;
  /* Leave room for the stacked action buttons, plus a gap before them. */
  max-width: min(720px, calc(100% - 36px - 36px - 148px - 24px));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin: 0;
  padding: 20px 24px;
  border-radius: 16px;
  background: rgba(16, 8, 25, 0.72);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.25s ease;
  box-sizing: border-box;
}

.track-credit.chrome-hidden {
  opacity: 0;
}

.track-brand {
  margin: 0;
}

.track-brand .brand-mark {
  width: 64px;
  height: 64px;
}

.track-brand .brand-word {
  font-size: 28px;
}

.track-copy {
  min-width: 0;
  width: 100%;
  text-align: left;
}

.track-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  color: #f4eef8;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.track-added-by {
  margin: 8px 0 0;
  font-size: 18px;
  line-height: 1.3;
  color: #c7b7d6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen.player.is-fullscreen .player-bar,
.screen.player.is-fullscreen .track-credit {
  top: 72px;
}
