/* ============================================================
   El Compa Jukebox — Estilos compartidos (cliente, TV, panel)
   Paleta: beige/crema cálido + rojo vino + naranja dorado +
   verde lima (coherente con "Tacos El Compa · Sabor a México").
   Tipografía grande legible, ambiente claro y acogedor.
   ============================================================ */
:root {
  --bg: #f5e8d0;            /* beige crema cálido */
  --bg-2: #fff6e6;          /* crema suave para inputs/hover */
  --card: #fffcf3;          /* tarjeta casi blanca cálida */
  --line: #e6d3b0;          /* beige tostado (bordes) */
  --text: #40291d;          /* marrón oscuro lectura */
  --muted: #8a6b52;         /* marrón medio */
  --marron: #4a3222;        /* marrón titulos/acento oscuro */
  --rojo: #a82229;          /* rojo vino */
  --rojo-dark: #8c1c22;
  --naranja: #eaa717;       /* naranja dorado */
  --lima: #7fb32d;          /* verde lima fresco */
  --danger: #b3352e;
  --ok: #5f9e2f;
  --shadow: 0 6px 18px rgba(90, 60, 30, .14);
  --r: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: linear-gradient(160deg, #f7ecd6 0%, #f0e0c2 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--rojo-dark); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }

/* ---------- Layout general ---------- */
.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.center-page { align-items: center; justify-content: center; text-align: center; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 18px; position: sticky; top: 0; z-index: 20;
  background: rgba(250, 240, 220, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; letter-spacing: .5px; color: var(--marron); }
.brand .accent { color: var(--rojo); }
.sub { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ---------- Footer marca Fast Data Systems ---------- */
footer.fds {
  margin-top: auto;
  text-align: center;
  padding: 1.2rem 1rem 1.4rem;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}
.fds-credit {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
  opacity: .9;
  transition: opacity .2s;
}
.fds-credit:hover { opacity: 1; }
.fds-logo { width: 18px; height: 18px; display: inline-block; flex: none; }
.fds-brand { font-weight: 800; letter-spacing: .6px; white-space: nowrap; }
.fds-brand .fw { color: var(--marron); }
.fds-brand .d { color: var(--rojo-dark); }
.fds-yr { margin-top: 3px; font-size: 11px; color: var(--muted); opacity: .85; display:block; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 14px;
}
.card h3 { font-size: 16px; margin-bottom: 10px; color: var(--marron); display:flex; align-items:center; gap:8px; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 15px;
  transition: filter .15s, transform .06s ease; color: #fff;
  background: var(--naranja);
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--rojo), var(--rojo-dark)); }
.btn.warn { background: #c77a12; }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--marron); }
.btn.small { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .like { font-size: 16px; }

/* ---------- Inputs ---------- */
input[type=text], input[type=password], input[type=search] {
  width: 100%; padding: 13px 15px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  font-size: 16px; outline: none;
}
input:focus { border-color: var(--rojo); }
.row { display: flex; gap: 10px; align-items: center; }
.row .grow { flex: 1; }

/* ---------- Listas de canciones / fila ---------- */
.queue { list-style: none; }
.queue li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 6px; border-bottom: 1px solid var(--line);
  animation: slidein .2s ease;
}
@keyframes slidein { from { opacity: 0; transform: translateY(6px);} to { opacity:1; transform:none;} }
.thumb {
  width: 52px; height: 40px; border-radius: 8px; object-fit: cover;
  background: var(--bg-2); flex: none;
}
.queue .meta { flex: 1; min-width: 0; }
.queue .meta b { display: block; font-size: 14px; color: var(--marron); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue .meta span { color: var(--muted); font-size: 12px; }
.votes {
  display:inline-flex; align-items:center; gap:4px; color: var(--rojo);
  font-weight: 800; font-size: 14px; white-space: nowrap;
}

/* ---------- Chip "mesa" ---------- */
.mesa-chip {
  display:inline-block; background: var(--lima); color:#fff;
  border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight:700;
}

/* ---------- Buscador resultado ---------- */
.result-item { display:flex; align-items:center; gap:10px; padding:8px 4px; cursor:pointer; border-radius:10px; }
.result-item:hover { background: var(--bg-2); }

/* ---------- Estructura vacía ---------- */
.empty { text-align:center; color: var(--muted); padding: 34px 10px; font-size: 15px; }
.spinner {
  width: 26px; height: 26px; margin: 20px auto; border: 3px solid var(--line);
  border-top-color: var(--rojo); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg);} }

/* ---------- Overlay / toasts ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(60, 30, 20, .5); z-index: 40;
  display:flex; align-items:center; justify-content:center; padding: 18px;
}
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--rojo-dark); color:#fff; padding: 11px 18px; border-radius: 12px;
  z-index: 60; font-weight: 600; max-width: 90vw; box-shadow: var(--shadow);
  animation: slideup .2s ease;
}
@keyframes slideup { from { opacity:0; transform: translate(-50%, 10px);} to { opacity:1; transform: translate(-50%,0);} }

/* ---------- Reproductor TV ---------- */
.tv-body { background:#000; overflow:hidden; }
#tv-player-holder { width:100vw; height:100vh; position:fixed; inset:0; }
#tv-now {
  position: fixed; left:0; right:0; bottom:18px; z-index: 10;
  text-align:center; color:#fff; text-shadow: 0 2px 8px rgba(0,0,0,.8);
  font-size: 15px; padding: 0 16px; pointer-events:none;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
}
#tv-now b { font-size: 17px; }
.tv-hold {
  width:100vw; height:100vh; display:flex; align-items:center; justify-content:center;
  flex-direction: column; gap: 18px; color:#fff; background:#000;
}
.tv-hold .big-note { font-size: 20px; opacity:.7; }

/* ---------- Grid de abajo en panel ---------- */
.stats { display:grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap:10px; margin-bottom:14px; }
.stat { background: var(--card); border:1px solid var(--line); border-radius:12px; padding:12px; text-align:center; }
.stat b { font-size:26px; display:block; color: var(--rojo-dark); }
.stat span { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.5px; }

@media (max-width: 600px) {
  .btn { padding: 11px 14px; }
  .thumb { width: 46px; height: 34px; }
}
