:root {
  color-scheme: dark;
  --bg: #080b16;
  --panel: #121a2b;
  --line: #283650;
  --text: #f7f8ff;
  --muted: #aab4c8;
  --pink: #ff3e9d;
  --cyan: #26d9ff;
  --gold: #ffd45a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 20% 0, #18284a 0, transparent 42%), var(--bg);
  color: var(--text);
  font: 16px system-ui, Arial, sans-serif;
}

.top,
.tvhead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px max(18px, calc((100% - 980px) / 2));
  border-bottom: 1px solid var(--line);
  background: #080b16ef;
}

.top img {
  width: 60px;
  height: 52px;
  object-fit: cover;
  border-radius: 9px;
}

.top b,
.tvhead b {
  display: block;
  letter-spacing: .08em;
}

.top small,
.tvhead small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  margin-left: auto;
  border: 1px solid #287f76;
  color: #8af4d6;
  padding: 6px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.wrap {
  max-width: 900px;
  margin: auto;
  padding: 24px 16px 50px;
}

.welcome {
  padding: 16px 2px 22px;
}

.eyebrow {
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: .2em;
  font-weight: 900;
}

.welcome h1 {
  font-size: clamp(32px, 7vw, 54px);
  line-height: 1.02;
  margin: 8px 0;
}

.welcome em {
  font-style: normal;
  color: var(--gold);
}

.welcome p:last-child,
.muted {
  color: var(--muted);
}

.card {
  background: linear-gradient(145deg, #151f34, #0e1524);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin: 14px 0;
  box-shadow: 0 12px 32px #0003;
}

.room {
  display: flex;
  align-items: center;
  gap: 18px;
}

.room small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.room strong {
  font-size: 25px;
  letter-spacing: .12em;
}

.room #qr {
  background: white;
  padding: 7px;
  border-radius: 8px;
  margin-left: auto;
  min-width: 82px;
  min-height: 82px;
}

.room #qr img {
  display: block;
}

.secondary {
  background: #25344e;
}

h2 {
  font-size: 19px;
  margin: 0 0 14px;
}

/* --------------------------------
   BOTONES KARAOKE Y VIDEOS
-------------------------------- */

.mode-switch {
  display: flex !important;
  gap: 10px !important;
  margin: 15px 0 !important;
  position: relative !important;
  z-index: 20 !important;
  isolation: isolate;
  pointer-events: auto !important;
}

.mode-switch button {
  flex: 1;
  min-height: 48px;
  position: relative !important;
  z-index: 21 !important;
  display: block !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#modeKaraoke,
#modeVideos {
  pointer-events: auto !important;
  position: relative !important;
  z-index: 22 !important;
}

#modeKaraoke:focus,
#modeVideos:focus {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

#modeKaraoke[aria-pressed="true"] {
  background: linear-gradient(135deg, #ec4899, #9333ea) !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

#modeVideos[aria-pressed="true"] {
  background: linear-gradient(135deg, #0284c7, #2563eb) !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

#modeKaraoke[aria-pressed="false"],
#modeVideos[aria-pressed="false"] {
  background: #25344e;
  color: #ffffff;
  opacity: .7;
}

/* --------------------------------
   FORMULARIO Y BUSQUEDA
-------------------------------- */

.search form {
  display: flex;
  gap: 8px;
}

input {
  width: 100%;
  min-width: 0;
  background: #080e1b;
  border: 1px solid #34425d;
  border-radius: 11px;
  color: white;
  padding: 14px;
  font-size: 16px;
}

button {
  border: 0;
  border-radius: 11px;
  padding: 12px 16px;
  background: linear-gradient(100deg, #e82f91, #8b4dff);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  opacity: .5;
}

.results {
  margin-top: 12px;
}

.song {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.thumb {
  width: 112px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: #202b40;
}

.songinfo {
  flex: 1;
  min-width: 0;
}

.songinfo b {
  display: block;
  font-size: 14px;
}

.songinfo small {
  color: var(--muted);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-head p {
  margin: 0;
}

.queue {
  padding-left: 25px;
}

.queue li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.queue small {
  display: block;
  color: var(--muted);
}

footer {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  padding: 18px;
}

a {
  color: var(--cyan);
}

/* --------------------------------
   PANTALLA DEL TELEVISOR
-------------------------------- */

.tvbody {
  height: 100vh;
  overflow: hidden;
  background: #05060b;
}

.tvhead {
  padding: 10px 22px;
}

.tvhead img {
  height: 48px;
  width: 72px;
  object-fit: cover;
  border-radius: 6px;
}

.tvmain {
  height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(250px, 1fr);
  gap: 16px;
  padding: 16px;
}

.tvmain #player {
  width: 100%;
  height: 100%;
  background: #000;
  min-height: 300px;
}

.tvmain aside {
  background: #10182a;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  overflow: auto;
}

.tvmain aside h1 {
  font-size: 17px;
  color: var(--gold);
}

.tvmain li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.tvmain #tvStatus {
  color: var(--muted);
  font-size: 12px;
}

/* --------------------------------
   DISPOSITIVOS MOVILES
-------------------------------- */

@media (max-width: 620px) {

  .room {
    flex-wrap: wrap;
  }

  .room #qr {
    margin-left: auto;
  }

  .search form {
    flex-direction: column;
  }

  .song {
    align-items: flex-start;
  }

  .thumb {
    width: 94px;
  }

  .song button {
    padding: 10px;
  }

  .tvmain {
    grid-template-columns: 1fr;
    grid-template-rows: 65% 35%;
    padding: 8px;
    gap: 8px;
  }

  .tvmain aside {
    padding: 10px;
  }

  .tvmain aside h1 {
    font-size: 13px;
  }

  .tvmain li {
    padding: 5px;
    font-size: 12px;
  }

  .tvhead {
    padding: 8px;
  }

  .tvhead img {
    width: 54px;
    height: 40px;
  }
}