/* =============================================================
   UrbaTube — interfaz al estilo YouTube (oscuro)
   Todo lo que vas a querer cambiar está aquí arriba, en :root.
   Cuando tengas la imagen de referencia, con cambiar --accent y
   --font-base el sitio entero se reviste solo.
   ============================================================= */
:root {
  /* --- Superficies --- */
  --bg: #0c0b12;            /* fondo general */
  --bg-bar: #0c0b12;        /* barra superior y menú lateral */
  --surface: #17151f;       /* tarjetas y paneles */
  --surface-2: #221f2d;     /* chips, botones, hover */
  --surface-3: #332e44;     /* hover fuerte */
  --line: #2a2635;          /* bordes y separadores */

  /* --- Texto --- */
  --text: #f1f1f1;
  --text-2: #aaaaaa;

  /* --- Acento (el "rojo" de YouTube, aquí en violeta) --- */
  --accent: #8b34ff;
  --violet: #8b34ff;         /* alias, usado en el marco de neón del botón de play */
  --accent-soft: rgba(139, 52, 255, .18);
  --accent-ink: #ffffff;
  --cyan: #35d6ff;
  --magenta: #ff2ecf;
  --warn: #ffb300;

  /* --- Tipografía --- */
  --font-base: 'Roboto', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  /* Gótica del banner: solo para el logotipo. Alternativas: 'Grenze Gotisch', 'UnifrakturCook' */
  --font-display: 'Pirata One', 'Grenze Gotisch', Georgia, serif;
  /* Cromado del banner, para el logotipo */
  --chrome: linear-gradient(180deg, #ffffff 0%, #dbeaff 26%, #8fb3ff 50%, #c9a4ff 72%, #f6eeff 100%);

  /* --- Medidas --- */
  --bar-h: 56px;
  --side-w: 240px;
  --radius: 12px;
  --radius-sm: 8px;
}

/* ---------- Puente con Bootstrap ---------- */
[data-bs-theme="dark"] {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--text-2);
  --bs-body-font-family: var(--font-base);
  --bs-body-font-size: .875rem;
  --bs-body-font-weight: 400;
  --bs-tertiary-bg: var(--surface);
  --bs-emphasis-color: var(--text);
}

* { -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-base);
  font-size: .875rem;
  line-height: 1.45;
  padding-top: var(--bar-h);
  overflow-x: hidden;
}

h1, h2, h3 { font-weight: 500; letter-spacing: -.01em; margin: 0; }

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

.min-w-0 { min-width: 0; }
.muted-note { color: var(--text-2); font-size: .8125rem; }

/* Título de sección: en YouTube son discretos, no decorativos. */
.sec-title { font-size: 1rem; font-weight: 500; color: var(--text); margin-bottom: .75rem; }
.count { color: var(--text-2); font-weight: 400; margin-left: .35rem; }

/* Recorte de texto a 1 y 2 líneas */
.q-title, .q-artist, .stats { overflow: hidden; text-overflow: ellipsis; }
.q-title { color: var(--text); font-weight: 500; }
.q-artist, .stats { color: var(--text-2); font-size: .8125rem; white-space: nowrap; }

/* =============================================================
   BARRA SUPERIOR
   ============================================================= */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1040;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1rem;
  background: var(--bg-bar);
}
.topbar > .container-xl { flex: 1; }   /* admin.php reutiliza esta barra */

.topbar-left { display: flex; align-items: center; gap: .25rem; flex: 0 0 auto; }
.topbar-center { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; }
.topbar-right { flex: 0 0 auto; display: flex; align-items: center; gap: .5rem; }

.brand-lockup { display: inline-flex; align-items: center; gap: .3rem; line-height: 1; padding: .25rem .4rem; }
.brand-mark { flex: none; color: var(--accent); }   /* el trazo usa currentColor */
.brand {
  font-family: var(--font-display);
  font-size: 1.75rem; font-weight: 400; letter-spacing: .02em; line-height: 1;
  padding-bottom: .1em;          /* la gótica tiene descendentes largos */
  color: #dbeaff;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand {
    background: var(--chrome);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    filter: drop-shadow(0 0 8px rgba(139, 52, 255, .45));
  }
}
.brand-mark { filter: drop-shadow(0 0 5px rgba(139, 52, 255, .55)); }

/* Buscador: la barra pastilla característica de YouTube */
.searchbar {
  display: flex; align-items: center; gap: .5rem;
  width: min(640px, 100%);
  height: 40px; padding: 0 1rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: 40px;
  transition: border-color .12s, background-color .12s;
}
.searchbar:focus-within { border-color: var(--accent); background: #121212; }
.searchbar-icon { color: var(--text-2); font-size: 1rem; flex: none; }
.searchbar-input {
  flex: 1; min-width: 0; height: 100%;
  background: none; border: 0; color: var(--text); font-size: .9375rem; font-family: inherit;
}
.searchbar-input::placeholder { color: var(--text-2); }
.searchbar-input:focus { outline: none; }
.searchbar-input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }

/* =============================================================
   BOTONES
   ============================================================= */
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; padding: 0;
  background: none; border: 0; border-radius: 50%;
  color: var(--text); font-size: 1.15rem; cursor: pointer;
  transition: background-color .12s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { background: var(--surface-3); }
.icon-btn.lg { width: 48px; height: 48px; font-size: 1.6rem; }

/* Botón de play: la misma placa con marco de neón que el ícono del sitio.
   El "marco degradado" es el truco de doble fondo (padding-box + border-box). */
.play-btn {
  border-radius: 30%;
  border: 3px solid transparent;
  background:
    radial-gradient(120% 130% at 32% 22%, #241f36, #0a0812 65%) padding-box,
    conic-gradient(from 200deg, var(--violet, #8b34ff), var(--cyan), var(--magenta), var(--violet, #8b34ff)) border-box;
  color: #fff;
  box-shadow: 0 0 16px rgba(139, 52, 255, .55), 0 0 4px rgba(53, 214, 255, .4);
  transition: transform .12s, box-shadow .12s;
}
.play-btn i { filter: drop-shadow(0 0 4px rgba(53, 214, 255, .7)); }
.play-btn:hover { transform: scale(1.05); box-shadow: 0 0 22px rgba(139, 52, 255, .7), 0 0 6px rgba(53, 214, 255, .55); }
.play-btn:active { transform: scale(.97); }

/* Pastillas: la forma estándar de los botones de YouTube */
.pill-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  height: 36px; padding: 0 .9rem;
  background: var(--surface-2); border: 0; border-radius: 18px;
  color: var(--text); font-family: inherit; font-size: .875rem; font-weight: 500; cursor: pointer;
  transition: background-color .12s;
}
.pill-btn:hover { background: var(--surface-3); }
.pill-btn.solid { background: var(--accent); color: var(--accent-ink); }
.pill-btn.solid:hover { filter: brightness(1.15); }
.pill-btn.ghost { background: none; border: 1px solid var(--line); }
.pill-btn.ghost:hover { background: var(--surface-2); }

/* Clases que ya usan app.js y admin.php */
.btn-violet, .btn-cyan {
  border: 0; border-radius: 18px; font-weight: 500; padding: .45rem 1rem;
  color: var(--accent-ink); background: var(--accent);
}
.btn-violet:hover, .btn-cyan:hover { filter: brightness(1.15); color: var(--accent-ink); }
.btn-cyan { background: var(--surface-2); color: var(--text); }
.btn-cyan:hover { background: var(--surface-3); color: var(--text); }
.btn-outline-light, .btn-outline-danger {
  border-radius: 18px; font-weight: 500; padding: .45rem 1rem;
}
.btn-sm { padding: .3rem .8rem; font-size: .8125rem; }

/* =============================================================
   MENÚ LATERAL + ESTRUCTURA
   ============================================================= */
.shell { display: flex; align-items: flex-start; }

.sidebar {
  position: fixed; top: var(--bar-h); bottom: 0; left: 0; z-index: 1035;
  width: var(--side-w); padding: .75rem .75rem 1.5rem;
  background: var(--bg-bar); overflow-y: auto; overscroll-behavior: contain;
}
.side-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.side-link {
  display: flex; align-items: center; gap: 1.5rem; width: 100%;
  padding: .625rem .75rem;
  background: none; border: 0; border-radius: var(--radius-sm);
  color: var(--text); font-family: inherit; font-size: .875rem; text-align: left; cursor: pointer;
  transition: background-color .12s;
}
.side-link i { font-size: 1.35rem; line-height: 1; }
.side-link:hover { background: var(--surface-2); }
.side-link.active { background: var(--surface-2); font-weight: 500; }
.side-sep { border-color: var(--line); opacity: 1; margin: .75rem .25rem; }
.side-note { color: var(--text-2); font-size: .75rem; padding: 0 .75rem; margin: 0; }

.content { flex: 1; min-width: 0; margin-left: var(--side-w); padding: 1.5rem 1.5rem 4rem; }

.scrim { position: fixed; inset: var(--bar-h) 0 0; z-index: 1034; background: rgba(0, 0, 0, .5); }
.scrim[hidden] { display: none; }

/* =============================================================
   BANNER DE PORTADA
   La imagen se ve completa, nunca recortada: es la portada del sitio.
   Para cambiarla, reemplaza assets/img/banner.jpg (y banner-sm.jpg).
   ============================================================= */
.banner {
  max-width: 1754px; margin: 0 auto 1.5rem;   /* mismo ancho que el reproductor: los bordes cuadran */
  border-radius: var(--radius); overflow: hidden;
  background: #07060f;
  box-shadow: 0 0 50px rgba(139, 52, 255, .22);
}
.banner img {
  display: block; width: 100%; height: auto;
  max-height: 520px; object-fit: cover; object-position: center;   /* tope para pantallas muy anchas */
}

/* =============================================================
   PÁGINA DE REPRODUCCIÓN (watch)
   ============================================================= */
.watch {
  display: grid; grid-template-columns: minmax(0, 1fr) 402px; gap: 1.5rem;
  max-width: 1754px; margin: 0 auto;
}
.watch-main { min-width: 0; }
.watch-side { min-width: 0; }

.screen { background: #000; border-radius: var(--radius); overflow: hidden; }
.screen iframe { border: 0; }

.local-screen { position: absolute; inset: 0; background: #000; }
.local-screen video,
.local-screen img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.local-screen img { object-fit: cover; filter: brightness(.55); }

/* Cubre el botón rojo propio de YouTube (aparece cuando el video está
   cargado pero en pausa) con nuestro ícono. app.js lo oculta al reproducir
   y lo vuelve a mostrar al pausar; un clic aquí también reproduce/pausa. */
.screen-overlay {
  display: grid; place-items: center;
  width: 100%; height: 100%; z-index: 2;
  background: radial-gradient(120% 120% at 50% 50%, rgba(139, 52, 255, .12), transparent 62%);
  border: 0; padding: 0; cursor: pointer;
}
.screen-overlay[hidden] { display: none; }
.screen-overlay i {
  display: grid; place-items: center;
  width: clamp(64px, 12vw, 96px); height: clamp(64px, 12vw, 96px);
  border-radius: 30%;
  border: 3px solid transparent;
  background:
    radial-gradient(120% 130% at 32% 22%, #241f36, #0a0812 65%) padding-box,
    conic-gradient(from 200deg, var(--violet), var(--cyan), var(--magenta), var(--violet)) border-box;
  color: #fff; font-size: clamp(28px, 5vw, 42px);
  box-shadow: 0 0 26px rgba(139, 52, 255, .55), 0 0 8px rgba(53, 214, 255, .4);
  transition: transform .15s, box-shadow .15s;
}
.screen-overlay:hover i {
  transform: scale(1.06);
  box-shadow: 0 0 34px rgba(139, 52, 255, .7), 0 0 10px rgba(53, 214, 255, .55);
}

.now { padding: 1rem 0 .5rem; }
.now h1 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.now-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-top: .75rem;
}
.now-who { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.now-who p { margin: 0; font-size: .875rem; font-weight: 500; color: var(--text); }

.avatar {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-2); font-size: 1rem;
}

/* Barra de ecualizador cuando algo está sonando */
.now.is-playing .avatar { background: var(--accent-soft); color: var(--accent); }

/* Reacciones: pastilla partida, como el like/dislike de YouTube */
.reactions { display: flex; align-items: center; background: var(--surface-2); border-radius: 18px; }
.react-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  height: 36px; padding: 0 1rem;
  background: none; border: 0; color: var(--text);
  font-family: inherit; font-size: .875rem; font-weight: 500; cursor: pointer;
  transition: background-color .12s;
}
.react-btn.like { border-radius: 18px 0 0 18px; border-right: 1px solid var(--surface-3); }
.react-btn.sad { border-radius: 0 18px 18px 0; }
.react-btn:hover { background: var(--surface-3); }
.react-btn.is-on { color: var(--accent); }
.react-btn.sad.is-on { color: var(--warn); }

/* =============================================================
   CONTROLES (deck)
   ============================================================= */
.deck { background: var(--surface); border-radius: var(--radius); overflow: hidden; }

.progress-line {
  position: relative; height: 4px; background: var(--surface-3); cursor: pointer;
  transition: height .1s;
}
.progress-line:hover, .progress-line:focus-visible { height: 8px; }
.progress-line .fill {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: var(--accent); border-radius: 0 2px 2px 0;
}
.progress-line .fade-zone {
  position: absolute; top: 0; right: 0; bottom: 0; width: 0;
  background: repeating-linear-gradient(90deg, rgba(255, 179, 0, .45) 0 6px, transparent 6px 12px);
}

.deck-row {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .75rem 1rem;
}
.transport { display: flex; align-items: center; gap: .25rem; }
.time { color: var(--text-2); font-size: .8125rem; font-variant-numeric: tabular-nums; }

.vol { display: flex; align-items: center; gap: .5rem; margin: 0; color: var(--text-2); }
.vol .form-range { width: 96px; }
.form-range { height: 1rem; }
.form-range::-webkit-slider-runnable-track { height: 3px; background: var(--surface-3); border-radius: 2px; }
.form-range::-moz-range-track { height: 3px; background: var(--surface-3); border-radius: 2px; }
.form-range::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4.5px; background: var(--text); }
.form-range::-moz-range-thumb { width: 12px; height: 12px; background: var(--text); border: 0; }

/* Medidor de salida: muestra el fade out en vivo */
.fader { display: flex; align-items: center; gap: .5rem; min-width: 110px; }
.fader-track { flex: 1; height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.fader-knob {
  width: calc(var(--lvl, 0) * 100%); height: 100%;
  background: var(--accent); border-radius: 2px;
  transition: width .1s linear, background-color .15s;
}
.fader.is-fading .fader-knob { background: var(--warn); }
.fader-label {
  min-width: 2ch; color: var(--text-2); font-size: .75rem;
  font-variant-numeric: tabular-nums; text-align: right;
}
.fader.is-fading .fader-label { color: var(--warn); }

.fade-ctrl { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.fade-ctrl-text { color: var(--text-2); font-size: .8125rem; white-space: nowrap; }
.form-check-input { background-color: var(--surface-3); border-color: var(--surface-3); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { box-shadow: none; border-color: var(--accent); }

/* =============================================================
   FORMULARIOS
   ============================================================= */
.form-control, .form-select {
  background-color: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); font-size: .875rem;
}
.form-control:focus, .form-select:focus {
  background-color: var(--bg); border-color: var(--accent); color: var(--text); box-shadow: none;
}
.form-control::placeholder { color: var(--text-2); }
.form-label { color: var(--text-2); font-size: .8125rem; margin-bottom: .35rem; }
.form-select-sm { width: auto; }

/* =============================================================
   COMENTARIOS
   ============================================================= */
.comments-box { margin-top: 1.5rem; }
.comment-form { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: 1.5rem; }
.comment-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .5rem; }
.comment-fields .form-control {
  background-color: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding-left: 0;
}
.comment-fields .form-control:focus { background-color: transparent; border-bottom-color: var(--text); }
.comment-fields textarea { resize: vertical; min-height: 40px; }
.comment-send { display: flex; justify-content: flex-end; }

.comment {
  display: grid; grid-template-columns: 40px minmax(0, 1fr);
  column-gap: .75rem; padding: .75rem 0;
}
.comment::before {
  content: ''; grid-column: 1; grid-row: 1 / span 2;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-2);
}
.comment header, .comment p { grid-column: 2; }
.comment header { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.comment header strong { font-size: .8125rem; font-weight: 500; }
.comment header time { color: var(--text-2); font-size: .75rem; }
.comment p { margin: .2rem 0 0; font-size: .875rem; white-space: pre-wrap; overflow-wrap: anywhere; }

/* =============================================================
   COLA (a continuación)
   ============================================================= */
.queue-panel { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.queue-head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .75rem 1rem .25rem;
}
.queue-tools { display: flex; gap: .15rem; }
.queue-hint { padding: 0 1rem .5rem; margin: 0; }
.queue-scroll { max-height: min(60vh, 560px); overflow-y: auto; }
.queue-empty { padding: 0 1rem 1rem; margin: 0; }

.queue { list-style: none; margin: 0; padding: 0 0 .5rem; }
.q-item {
  display: flex; align-items: center; gap: .25rem;
  padding: .25rem .5rem .25rem .25rem;
  transition: background-color .12s;
}
.q-item:hover { background: var(--surface-2); }
.q-item.is-current { background: var(--accent-soft); }
.drag { display: grid; place-items: center; width: 24px; color: var(--text-2); cursor: grab; flex: none; }
.turn {
  width: 22px; flex: none; text-align: center;
  color: var(--text-2); font-size: .75rem; font-variant-numeric: tabular-nums;
}
.q-item.is-current .turn { color: var(--accent); }
.q-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem;
  background: none; border: 0; padding: .35rem .25rem; text-align: left; cursor: pointer;
}
.q-main .q-title { font-size: .875rem; white-space: nowrap; }
.q-item .icon-btn { width: 32px; height: 32px; font-size: .85rem; }
.drag-ghost { opacity: .35; }
.drag-chosen { background: var(--surface-2); }

/* =============================================================
   CHIPS / SEGMENTOS
   ============================================================= */
.chips-bar { margin-bottom: 1.25rem; }
.seg { display: flex; gap: .5rem; flex-wrap: wrap; }
.seg button {
  height: 32px; padding: 0 .75rem;
  background: var(--surface-2); border: 0; border-radius: var(--radius-sm);
  color: var(--text); font-family: inherit; font-size: .875rem; font-weight: 500;
  white-space: nowrap; cursor: pointer; transition: background-color .12s;
}
.seg button:hover { background: var(--surface-3); }
.seg button.is-on { background: var(--text); color: var(--bg); }

.col-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem;
}
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.versus-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2rem; }

/* =============================================================
   LISTAS DE RANKING
   ============================================================= */
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.rank li { display: flex; align-items: center; gap: .5rem; border-radius: var(--radius-sm); padding: .25rem; }
.rank li:hover { background: var(--surface-2); }
.rank-n {
  width: 24px; flex: none; text-align: center;
  color: var(--text-2); font-size: .8125rem; font-variant-numeric: tabular-nums;
}
.row-btn {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: .75rem;
  background: none; border: 0; padding: .25rem; text-align: left; cursor: pointer;
}
.row-btn img { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; }
.rank .body { min-width: 0; display: flex; flex-direction: column; }
.rank .q-title { font-size: .8125rem; line-height: 1.3; white-space: nowrap; }
.rank .q-artist { font-size: .75rem; }
.metric {
  flex: none; display: flex; flex-direction: column; align-items: flex-end;
  color: var(--text); font-size: .8125rem; font-weight: 500; font-variant-numeric: tabular-nums;
  padding-right: .25rem;
}
.metric small { color: var(--text-2); font-size: .6875rem; font-weight: 400; }

.how { margin-top: 1rem; }
.how summary { color: var(--text-2); font-size: .8125rem; cursor: pointer; }
.how p { color: var(--text-2); font-size: .8125rem; margin: .5rem 0 0; }

/* =============================================================
   VERSUS
   ============================================================= */
.duel {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .75rem;
  background: var(--surface); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem;
}
.duel-side {
  display: flex; flex-direction: column; gap: .2rem; min-width: 0;
  background: var(--surface-2); border: 2px solid transparent; border-radius: var(--radius-sm);
  padding: .75rem; color: var(--text); font-family: inherit; text-align: center; cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
.duel-side:hover { background: var(--surface-3); }
.duel-side.is-mine { border-color: var(--accent); background: var(--accent-soft); }
.duel-name { font-size: .9375rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.duel-votes { color: var(--text-2); font-size: .75rem; }
.vs {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; color: #dbeaff;
  line-height: 1;
}
.duel-bar { grid-column: 1 / -1; display: flex; height: 4px; border-radius: 2px; overflow: hidden; background: var(--surface-2); }
.duel-bar span:first-child { background: var(--accent); }
.duel-bar span:last-child { background: var(--cyan); }

/* =============================================================
   EXPLORAR: cuadrícula de videos
   ============================================================= */
.song-grid {
  display: grid; gap: 1.5rem 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.song-card { display: flex; flex-direction: column; min-width: 0; }
.song-card img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius); background: var(--surface-2);
}
.song-card .info { padding: .75rem .25rem .5rem; min-width: 0; }
.song-card .q-title {
  font-size: .9375rem; line-height: 1.35; white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.song-card .q-artist, .song-card .stats { display: block; margin-top: .15rem; }
.song-card .actions { display: flex; gap: .5rem; padding: 0 .25rem; }
.song-card .actions .btn { flex: 1; font-size: .8125rem; }
@media (hover: hover) {
  .song-card .actions { opacity: 0; transition: opacity .12s; }
  .song-card:hover .actions, .song-card:focus-within .actions { opacity: 1; }
}

.tag {
  display: inline-block; margin-left: .4rem; padding: .05rem .4rem;
  background: var(--accent-soft); border-radius: 4px;
  color: var(--accent); font-size: .6875rem; font-weight: 500; vertical-align: middle;
}

/* =============================================================
   AVISO FLOTANTE (toast)
   ============================================================= */
#toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 1080;
  transform: translate(-50%, 1rem);
  max-width: min(420px, calc(100vw - 2rem));
  padding: .75rem 1rem;
  background: #f1f1f1; color: #0f0f0f; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =============================================================
   PANEL ADMIN (admin.php usa la misma hoja)
   ============================================================= */
.admin-box { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; }
.admin-song {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem; border-radius: var(--radius-sm);
}
.admin-song:hover { background: var(--surface-2); }
.admin-song img { border-radius: 6px; object-fit: cover; flex: none; }
.alert { border: 0; border-radius: var(--radius-sm); font-size: .875rem; }

/* =============================================================
   RESPONSIVE
   ============================================================= */
/* Menú compacto: en YouTube el lateral se encoge antes de desaparecer */
@media (max-width: 1400px) {
  .watch { grid-template-columns: minmax(0, 1fr) 360px; }
}

@media (max-width: 1099px) {
  /* El lateral pasa a ser un cajón que se abre con el botón de la barra */
  .sidebar { transform: translateX(-100%); transition: transform .18s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.001); }
  .content { margin-left: 0; padding: 1.25rem 1rem 4rem; }
  .watch { display: flex; flex-direction: column; gap: 0; }
  .watch-main { display: contents; }
  .screen { order: 1; }
  .now { order: 2; }
  .deck { order: 3; }
  .watch-side { order: 4; margin-top: 1.5rem; }
  .comments-box { order: 5; }
  .queue-scroll { max-height: none; }
  .cols-3, .versus-layout { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}

@media (min-width: 1100px) {
  /* En escritorio el botón del menú lo esconde */
  body.nav-open .sidebar { transform: translateX(-100%); }
  body.nav-open .content { margin-left: 0; }
  .scrim { display: none; }
}

@media (max-width: 860px) {
  .pill-text { display: none; }
  .pill-btn { padding: 0 .6rem; }
  .brand { display: none; }
}

@media (max-width: 640px) {
  :root { --radius: 0px; }
  .topbar { padding: 0 .5rem; gap: .5rem; }
  .content { padding: .75rem .75rem 4rem; }
  .screen { margin: 0 -.75rem; border-radius: 0; }
  .banner { margin: -.75rem -.75rem 1rem; border-radius: 0; box-shadow: none; }
  .now h1 { font-size: 1.05rem; }
  .now-row { align-items: flex-start; }
  .deck { border-radius: var(--radius-sm); }
  .fade-ctrl { margin-left: 0; }
  .song-grid { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .queue-panel, .duel, .admin-box { border-radius: var(--radius-sm); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
/* ============================================================
   Selector de color del tema (botón de paleta en la barra superior)
   ============================================================ */
.theme-picker { position: relative; }
.theme-pop {
  position: absolute; top: calc(100% + .5rem); right: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .6rem; box-shadow: 0 12px 32px rgba(0,0,0,.45);
}
.theme-pop[hidden] { display: none; }
.theme-swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent;
  background: var(--sw); cursor: pointer; padding: 0;
}
.theme-swatch.is-on { border-color: #fff; box-shadow: 0 0 0 2px var(--sw); }

/* ============================================================
   Mini reproductor incrustado en la pantalla del video, detrás
   del ícono de configuración (⚙). Minimalista: solo el ícono se
   ve por defecto; el panel completo aparece al hacer clic.
   ============================================================ */
.screen-gear {
  position: absolute; top: .6rem; right: .6rem; z-index: 3;
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
  background: rgba(12, 11, 18, .55); color: #fff; backdrop-filter: blur(4px);
  cursor: pointer; transition: background .15s, color .15s, transform .15s;
}
.screen-gear:hover { background: rgba(12, 11, 18, .8); }
.screen-gear.is-on { background: var(--accent); color: var(--accent-ink); transform: rotate(35deg); }

.deck.deck-onscreen {
  position: absolute; inset: auto 0 0 0; top: auto; width: 100%; height: auto;
  z-index: 4; background: rgba(12, 11, 18, .92); backdrop-filter: blur(8px);
  border-radius: 0; padding-top: .25rem;
}
.deck.deck-onscreen[hidden] { display: none; }

/* ============================================================
   Perfil público de artista (artista.php) y panel del artista
   ============================================================ */
.artist-banner { height: 220px; border-radius: var(--radius); overflow: hidden; margin-bottom: -48px; }
.artist-banner img { width: 100%; height: 100%; object-fit: cover; }
.artist-head { display: flex; align-items: flex-end; gap: 1.25rem; flex-wrap: wrap; padding: 0 .5rem 1rem; }
.artist-avatar-lg {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--bg); background: var(--surface-2); flex: none;
}
