/* ===========================
   LR Drums — Estilos
   =========================== */

:root {
  --bg-0: #07070d;
  --bg-1: #0f0f1a;
  --bg-2: #161627;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f7;
  --text-dim: #b6b6c7;
  --text-mute: #7d7d92;
  --accent: #ff5a3c;
  --accent-2: #ffb13c;
  --accent-3: #6c5cff;
  --success: #3ddc97;
  --shadow-lg: 0 24px 60px -20px rgba(255, 90, 60, 0.35),
               0 12px 30px -12px rgba(108, 92, 255, 0.35);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(255, 90, 60, 0.18), transparent 60%),
              radial-gradient(1000px 500px at 110% 10%, rgba(108, 92, 255, 0.18), transparent 60%),
              linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 60%, var(--bg-2) 100%);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Foco visível para acessibilidade */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ===========================
   Hero
   =========================== */
.hero {
  position: relative;
  padding: 56px 24px 40px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 200px at 50% 0%, rgba(255, 177, 60, 0.18), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0 2px, transparent 2px 18px);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  filter: drop-shadow(0 18px 28px rgba(255, 90, 60, 0.4));
}

.brand__logo {
  width: 100%;
  height: 100%;
  display: block;
}

.brand__title {
  font-family: 'Bebas Neue', 'Inter', sans-serif;
  letter-spacing: 2px;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  margin: 0;
  background: linear-gradient(90deg, #fff, #ffd6a4 50%, #ff8a6b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

.brand__subtitle {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  max-width: 60ch;
}

/* ===========================
   Layout principal
   =========================== */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 24px 80px;
  display: grid;
  gap: 40px;
}

/* ===========================
   Player
   =========================== */
.player {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
}

.player__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(10, 10, 18, 0.7);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
  backdrop-filter: blur(6px);
}

.player__close:hover {
  background: rgba(255, 90, 60, 0.85);
  border-color: var(--accent);
  transform: scale(1.05);
}

.player__close:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.player__frame {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-strong);
  position: relative;
  aspect-ratio: 16 / 9;
}

.player__main,
.player__main iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* PiP flutuante sobre o principal */
.player__pip {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32%;
  max-width: 260px;
  min-width: 140px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7),
              0 0 0 1px rgba(255, 90, 60, 0.25);
  z-index: 3;
  animation: pipIn 0.25s ease both;
}

.player__pip-frame {
  position: absolute;
  inset: 0;
}

.player__pip-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  pointer-events: none; /* impede que o usuário interaja com o PiP por engano */
}

.player__pip-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  pointer-events: none;
  z-index: 4;
}

@keyframes pipIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

/* Iframe oculto do drumless: precisa estar no DOM com tamanho > 0
   (alguns navegadores pausam iframes 0x0). 1px off-screen resolve. */
.player__hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  left: -9999px;
  top: -9999px;
  pointer-events: none;
  opacity: 0;
}

.player__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-dim);
  background:
    radial-gradient(400px 200px at 50% 30%, rgba(255, 90, 60, 0.18), transparent 70%),
    linear-gradient(180deg, #0c0c14, #050509);
  padding: 24px;
  text-align: center;
  z-index: 2;
}

.player__placeholder-icon {
  font-size: 56px;
  filter: drop-shadow(0 8px 20px rgba(255, 90, 60, 0.4));
}

.player__info {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.player__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.72rem;
  color: var(--accent-2);
  font-weight: 600;
}

.player__title {
  margin: 4px 0 2px;
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  font-weight: 700;
  line-height: 1.15;
  word-break: break-word;
}

.player__artist {
  margin: 0;
  color: var(--text-dim);
  font-size: 1rem;
}

.player__controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.version-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.version-btn:hover:not([disabled]) {
  background: var(--surface-strong);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.version-btn[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(255, 90, 60, 0.25), rgba(108, 92, 255, 0.2));
  border-color: var(--accent);
  box-shadow: 0 8px 22px -10px rgba(255, 90, 60, 0.6);
}

.version-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.version-btn__label {
  font-weight: 700;
  font-size: 0.95rem;
}

.version-btn__hint {
  font-size: 0.72rem;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.version-btn--luigi .version-btn__hint {
  color: var(--accent-2);
}

.player__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.btn--ghost:hover:not([aria-disabled="true"]) {
  background: var(--surface-strong);
  border-color: rgba(255, 255, 255, 0.32);
}

.btn[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

.player__luigi-msg {
  margin: 0;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255, 177, 60, 0.12), rgba(108, 92, 255, 0.12));
  border: 1px dashed rgba(255, 177, 60, 0.45);
  border-radius: var(--radius-sm);
  color: #ffe1b8;
  font-size: 0.92rem;
}

/* ===========================
   Lista de músicas
   =========================== */
.songs__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.songs__title {
  font-family: 'Bebas Neue', 'Inter', sans-serif;
  letter-spacing: 2px;
  font-size: 1.8rem;
  margin: 0;
}

.songs__count {
  margin: 0;
  color: var(--text-mute);
  font-size: 0.9rem;
}

.song-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-auto-flow: row dense;
  gap: 18px;
}

/* Wrapper <li> de cada card. order é setado inline pelo JS pra que o player
   apareça logo após o card ativo na ordem visual. */
.song-card-wrapper {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Wrapper do player dentro da grid: ocupa a linha inteira.
   No mobile (1 coluna), o card ativo some e o player toma seu lugar.
   No desktop (multi-coluna), o card ativo continua visível e o player aparece
   numa nova linha logo abaixo, full-width. */
.player-wrapper {
  grid-column: 1 / -1;
  list-style: none;
  margin: 0;
  padding: 0;
}

.player-wrapper[hidden] {
  display: none;
}

/* Esconde o card ativo: o player toma seu lugar na grid */
.song-card-wrapper:has(.song-card.is-active) {
  display: none;
}

.song-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 0 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  overflow: hidden;
}

.song-card__cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b0b14;
  overflow: hidden;
}

.song-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease, filter 0.3s ease;
  filter: saturate(0.95);
}

.song-card__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

.song-card__play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #16161f;
  font-size: 1rem;
  font-weight: 800;
  padding-left: 3px;
  box-shadow: 0 8px 22px -6px rgba(255, 90, 60, 0.7);
  transform: translateY(4px) scale(0.96);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2;
}

.song-card:hover .song-card__cover img {
  transform: scale(1.04);
  filter: saturate(1.1);
}

.song-card:hover .song-card__play,
.song-card.is-active .song-card__play {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.song-card__top,
.song-card__badges,
.song-card__hint {
  padding-left: 18px;
  padding-right: 18px;
}

.song-card__top {
  margin-top: 14px;
}

.song-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 90, 60, 0.18), rgba(108, 92, 255, 0.18));
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.song-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 18px 40px -22px rgba(0,0,0,0.7);
}

.song-card:hover::before {
  opacity: 0.4;
}

.song-card.is-active {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.song-card.is-active::before {
  opacity: 0.7;
}

.song-card__top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.song-card__num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #16161f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 1px;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.song-card__titles {
  min-width: 0;
}

.song-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-card__artist {
  margin: 2px 0 0;
  color: var(--text-dim);
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-card__badges {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
}

.badge--full {
  border-color: rgba(255, 90, 60, 0.45);
  color: #ffd1c4;
  background: rgba(255, 90, 60, 0.12);
}

.badge--drumless {
  border-color: rgba(108, 92, 255, 0.45);
  color: #d3ccff;
  background: rgba(108, 92, 255, 0.12);
}

.badge--luigi {
  border-color: rgba(255, 177, 60, 0.45);
  color: #ffe1b8;
  background: rgba(255, 177, 60, 0.12);
}

.song-card__hint {
  position: relative;
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-mute);
}

/* ===========================
   Footer
   =========================== */
.footer {
  text-align: center;
  padding: 28px 16px 40px;
  color: var(--text-mute);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ===========================
   Responsivo
   =========================== */
@media (max-width: 900px) {
  .player {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .hero {
    padding: 36px 18px 24px;
  }
  main {
    padding: 0 18px 60px;
    gap: 28px;
  }
  .player {
    padding: 14px;
    border-radius: 18px;
  }
  .player__controls {
    grid-template-columns: 1fr;
  }
  .brand__icon {
    width: 56px;
    height: 56px;
  }
}

/* Animação leve ao trocar de música */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.fade-in {
  animation: fadeIn 0.25s ease both;
}
