/* Estilos compartidos por todas las secciones (discos, juegos…). */
:root {
  --bg: #0b0b0c;
  --fg: #f2f0ea;
  --muted: #9a978f;
  --panel: #141416;
  --line: #26262a;
  --accent: #ff5a36;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: Inter, system-ui, sans-serif; }
body { overflow-x: hidden; }
button { font: inherit; }

/* Barra superior */
.top {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 10; width: max-content; max-width: calc(100vw - 32px);
  transition: opacity .4s ease;
}
/* Barra en reposo: casi invisible hasta pasar el mouse por encima. */
.top.idle { opacity: .12; }
.top.idle:hover { opacity: 1; }
/* En pantallas táctiles no hay "pasar por encima": queda tenue pero visible. */
@media (hover: none) { .top.idle { opacity: .45; } }
.pill {
  display: flex; align-items: center; gap: 10px; margin: 0 auto; width: max-content; max-width: 100%;
  padding: 5px 5px 5px 14px; border-radius: 999px;
  background: rgba(11,11,12,.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 14px; white-space: nowrap;
}
.pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); flex: none; }
.pill .count { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.pill .summary { font-weight: 500; color: var(--fg); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pill .summary:empty { display: none; }
#toggle {
  border: 0; border-radius: 999px; padding: 7px 14px; cursor: pointer;
  background: #fff; color: #111; font-weight: 700; font-size: 13px; flex: none;
}
#toggle.active { background: var(--accent); }

/* Botones de presentación (scroll automático, pantalla completa) */
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; flex: none;
  background: rgba(255,255,255,.08); color: var(--fg); cursor: pointer;
  display: grid; place-items: center;
}
.icon-btn:hover { background: rgba(255,255,255,.18); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn[aria-pressed="true"] { background: var(--accent); color: #111; }
.icon-btn[hidden] { display: none; }
body.presentando.sin-cursor, body.presentando.sin-cursor * { cursor: none !important; }

/* Marca + sección actual: abre el desplegable de secciones */
.marca {
  display: flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--fg);
  padding: 4px 8px 4px 0; border-radius: 999px; cursor: pointer; font-size: 14px; flex: none;
}
.marca .nombre { font-weight: 800; letter-spacing: .01em; }
.marca .nombre em { font-style: normal; color: var(--accent); }
.marca .sep { color: var(--muted); }
.marca b { font-weight: 600; }
.marca .chev { width: 14px; height: 14px; color: var(--muted); transition: transform .2s; }
.marca[aria-expanded="true"] .chev { transform: rotate(180deg); }
.marca:hover b, .marca:hover .chev { color: var(--accent); }
.pill .summary { border: 0; background: rgba(255,90,54,.14); color: var(--fg); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: 13px; max-width: 34vw; }
.pill .summary:hover { background: rgba(255,90,54,.26); }
.herramientas { display: flex; align-items: center; gap: 6px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.12); }
#mas-btn { display: none; }
#toggle::before {
  content: ''; display: inline-block; width: 13px; height: 13px; margin: 0 6px -2px 0; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='6' r='2.2' fill='none' stroke='%23000' stroke-width='2.2'/%3E%3Ccircle cx='10' cy='12' r='2.2' fill='none' stroke='%23000' stroke-width='2.2'/%3E%3Ccircle cx='18' cy='18' r='2.2' fill='none' stroke='%23000' stroke-width='2.2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='6' r='2.2' fill='none' stroke='%23000' stroke-width='2.2'/%3E%3Ccircle cx='10' cy='12' r='2.2' fill='none' stroke='%23000' stroke-width='2.2'/%3E%3Ccircle cx='18' cy='18' r='2.2' fill='none' stroke='%23000' stroke-width='2.2'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Desplegable de secciones y menú "más" (celular) */
.secciones-panel, .mas-panel {
  margin-top: 8px; background: rgba(20,20,22,.96); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 18px; padding: 8px; max-height: calc(100vh - 90px); overflow-y: auto;
}
.secciones-panel { width: min(600px, calc(100vw - 32px)); display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.secciones-panel[hidden], .mas-panel[hidden] { display: none; }
.secciones-panel a {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px;
  color: var(--fg); text-decoration: none; border: 1px solid transparent;
}
.secciones-panel a:hover { background: rgba(255,255,255,.06); }
.secciones-panel a[aria-current="page"] { border-color: var(--accent); background: rgba(255,90,54,.10); }
.secciones-panel .mini {
  width: 46px; height: 46px; flex: none; border-radius: 8px; overflow: hidden; background: #222226;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
}
.secciones-panel .mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.secciones-panel a > span:last-child { display: grid; min-width: 0; }
.secciones-panel b { font-size: 14px; }
.secciones-panel small { font-size: 12px; color: var(--muted); white-space: normal; }
.mas-panel { width: min(280px, calc(100vw - 32px)); margin-left: auto; display: grid; }
.mas-panel button {
  text-align: left; padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--fg); cursor: pointer; font-size: 14px;
}
.mas-panel button:hover { background: rgba(255,255,255,.06); }

/* Celular: sección + "más" + Filtros; el resto va al menú "más" */
@media (max-width: 640px) {
  .pill { gap: 6px; padding-left: 12px; }
  .marca .nombre, .marca .sep, .pill .count, .pill .summary, .herramientas { display: none; }
  #mas-btn { display: grid; }
  .secciones-panel { grid-template-columns: 1fr; }
}

/* Primera visita: tres pasos */
#bienvenida {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 11;
  width: min(460px, calc(100vw - 32px)); display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 14px 14px 18px; border-radius: 16px; font-size: 14px; line-height: 1.5;
  background: rgba(20,20,22,.96); border: 1px solid var(--accent); backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0,0,0,.5); transition: opacity .35s, transform .35s;
}
#bienvenida.fuera { opacity: 0; transform: translate(-50%, 12px); }
#bienvenida ol { margin: 0; padding-left: 18px; flex: 1; }
#bienvenida li::marker { color: var(--accent); font-weight: 800; }
#bienvenida button { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }

/* Panel de filtros */
.filters {
  margin-top: 8px; width: min(680px, calc(100vw - 32px));
  background: rgba(20,20,22,.94); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px 18px;
  max-height: calc(100vh - 90px); overflow-y: auto;
}
.filters[hidden] { display: none; }
.filters h3 { margin: 14px 0 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.filters h3:first-child { margin-top: 0; }
.filters h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--fg);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.chip:hover { border-color: #555; }
.chip.on { background: var(--fg); color: #111; border-color: var(--fg); }
/* Género oculto */
.chip.off { background: rgba(255,90,54,.14); border-color: var(--accent); color: var(--accent); text-decoration: line-through; }
.years { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.years input {
  width: 84px; background: #0b0b0c; color: var(--fg); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; font: inherit; font-variant-numeric: tabular-nums;
}
.swatch {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); padding: 0;
}
.swatch.on { border-color: var(--fg); outline: 2px solid var(--bg); outline-offset: -4px; }
/* Color excluido: tachado en diagonal con el naranja de la marca. */
.swatch.off { position: relative; border-color: var(--accent); opacity: .7; }
.swatch.off::after {
  content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px;
  background: var(--accent); transform: rotate(45deg); border-radius: 2px;
}
.swatch.any { background: conic-gradient(#e53935, #fb8c00, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935); }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; font-size: 12px; color: var(--muted); }
.actions button { border: 1px solid var(--line); background: transparent; color: var(--fg); border-radius: 999px; padding: 7px 14px; cursor: pointer; flex: none; }

/* Cuadrícula */
#grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile, 170px), 1fr));
  gap: 2px;
}
@media (max-width: 600px) { #grid { grid-template-columns: repeat(3, 1fr); } }
.cover {
  position: relative; aspect-ratio: var(--ratio, 1); overflow: hidden; cursor: pointer;
  background: #19191b; border: 0; padding: 0; display: block; width: 100%;
}
.cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transform: scale(1.04);
  transition: opacity .5s ease, transform .6s ease;
}
.cover img.on { opacity: 1; transform: scale(1); }
.cover .info {
  position: absolute; inset: auto 0 0 0; padding: 28px 10px 9px;
  background: linear-gradient(transparent, rgba(0,0,0,.88));
  text-align: left; color: #fff; opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.cover:hover .info, .cover:focus-visible .info { opacity: 1; }
.cover:hover img.on { transform: scale(1.05); }
.info b { display: block; font-size: 13px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info span { display: block; font-size: 12px; color: #cfccc4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#sentinel { height: 1px; }
#status { text-align: center; color: var(--muted); padding: 32px 16px 48px; font-size: 13px; }
#grid:empty + #sentinel + #status { padding-top: 120px; }

/* Ficha */
dialog {
  border: 1px solid var(--line); border-radius: 18px; padding: 0;
  background: var(--panel); color: var(--fg);
  width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
}
dialog::backdrop { background: rgba(0,0,0,.75); backdrop-filter: blur(6px); }
.sheet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sheet .art { background: #000; display: flex; align-items: center; justify-content: center; }
.sheet .art img { width: 100%; aspect-ratio: var(--ratio, 1); object-fit: contain; display: block; }
.sheet .meta { padding: 24px; overflow-y: auto; max-height: min(560px, calc(100vh - 32px)); }
@media (max-width: 720px) {
  .sheet { grid-template-columns: 1fr; }
  .sheet .art img { max-height: 55vh; }
  .sheet .meta { max-height: none; }
}
.meta h2 { margin: 0 0 4px; font-size: 24px; line-height: 1.15; font-weight: 800; padding-right: 30px; }
.meta .sub { font-size: 16px; color: var(--accent); font-weight: 500; }
.meta .facts { margin: 12px 0 16px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.links a {
  font-size: 12px; font-weight: 500; text-decoration: none; color: var(--fg);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
}
.links a:hover { border-color: var(--accent); color: var(--accent); }
.links a.primary { background: var(--accent); border-color: var(--accent); color: #111; }
.links a.primary:hover { color: #111; filter: brightness(1.1); }
.close {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 18px; cursor: pointer; z-index: 2;
}
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.desc { font-size: 14px; line-height: 1.6; color: #d8d5cd; margin: 0 0 14px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

/* Lista de temas (discos) */
ol.tracks { list-style: none; margin: 0; padding: 0; font-size: 13px; }
ol.tracks li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
ol.tracks .n { width: 20px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
ol.tracks .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ol.tracks .d { color: var(--muted); font-variant-numeric: tabular-nums; }
ol.tracks button {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--fg); cursor: pointer; font-size: 10px; flex: none;
}
ol.tracks button:disabled { opacity: .25; cursor: default; }
ol.tracks button.playing { background: var(--accent); border-color: var(--accent); color: #111; }

/* Popup "?" */
#help { font-weight: 800; font-size: 15px; }
#ayuda { width: min(640px, calc(100vw - 32px)); }
.ayuda { padding: 28px 28px 24px; overflow-y: auto; max-height: calc(100vh - 40px); font-size: 14px; line-height: 1.6; color: #d8d5cd; }
.ayuda h2 { margin: 0; font-size: 28px; font-weight: 800; color: var(--fg); letter-spacing: .02em; }
.ayuda .lema { margin: 2px 0 14px; color: var(--accent); font-weight: 500; }
.ayuda h3 { margin: 22px 0 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ayuda p { margin: 0 0 10px; }
.ayuda a { color: var(--accent); }
.ayuda ul.trucos { margin: 0; padding-left: 18px; }
.ayuda ul.trucos li { margin-bottom: 8px; }
.ayuda .fuentes { font-size: 12px; color: var(--muted); }
kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 5px; text-align: center;
  font: 600 12px/1.5 Inter, system-ui, sans-serif; color: var(--fg);
  background: #26262a; border: 1px solid #3a3a40; box-shadow: 0 1px 0 #3a3a40;
}
.cafecito {
  display: inline-block; margin-top: 2px; padding: 9px 16px; border-radius: 999px; text-decoration: none;
  background: #f5c542; color: #2b2102 !important; font-weight: 700;
}
.cafecito:hover { filter: brightness(1.06); }

/* Avisito (velocidad, sorpresa) */
#aviso {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 10px); z-index: 20;
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(11,11,12,.85); color: var(--fg); border: 1px solid rgba(255,255,255,.1);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
#aviso.on { opacity: 1; transform: translate(-50%, 0); }

/* Botón "Compartir" del popup */
.compartir {
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
  border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 13px; cursor: pointer;
}
.compartir:hover { background: var(--accent); color: #111; }
#aviso { z-index: 2147483647; }   /* que se vea también encima del popup */

/* Radio */
#radio-btn { font-size: 15px; }
#radio-btn.sonando { background: var(--accent); color: #111; }
#radio-btn.pendiente { box-shadow: 0 0 0 2px var(--accent) inset; }
.radio-panel {
  margin: 8px 0 0 auto; width: min(340px, calc(100vw - 32px));
  background: rgba(20,20,22,.96); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 18px; padding: 14px; max-height: calc(100vh - 90px); overflow-y: auto;
}
.radio-panel[hidden] { display: none; }
.radio-panel h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.radios { display: grid; gap: 4px; }
.radio-item {
  display: grid; text-align: left; gap: 1px; padding: 8px 10px; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--fg);
}
.radio-item:hover { border-color: var(--line); }
.radio-item.on { border-color: var(--accent); background: rgba(255,90,54,.10); }
.radio-item b { font-size: 13px; }
.radio-item span { font-size: 12px; color: var(--muted); }
#ahora {
  position: fixed; left: 12px; bottom: 12px; z-index: 9; display: flex; align-items: center; gap: 10px;
  max-width: min(360px, calc(100vw - 24px)); padding: 8px 12px 8px 8px; border-radius: 12px; cursor: pointer;
  background: rgba(11,11,12,.88); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(12px);
}
#ahora[hidden] { display: none; }
#ahora img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; }
#ahora div { display: grid; min-width: 0; }
#ahora small { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
#ahora b, #ahora span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ahora b { font-size: 13px; }
#ahora span { font-size: 12px; color: var(--muted); }
#ahora { transition: opacity .4s ease; }
#ahora.idle { opacity: .12; }
#ahora.idle:hover { opacity: 1; }
@media (hover: none) { #ahora.idle { opacity: .45; } }

.volumen { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; font-size: 13px; }
.volumen input { flex: 1; accent-color: var(--accent); }

/* Sección abierta dentro de otra página para que la radio no se corte al cambiar. */
body.con-marco { margin: 0; overflow: hidden; }
#marco { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.ayuda ul.fuentes { margin: 0 0 10px; padding-left: 18px; }
.ayuda ul.fuentes li { margin-bottom: 4px; }

/* Filtros en acordeón: cada grupo plegado muestra lo elegido; uno abierto por vez. */
.acordeon { margin-top: 14px; border-top: 1px solid var(--line); }
.grupo { border-bottom: 1px solid var(--line); }
.grupo .cabecera {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 2px;
  background: none; border: 0; color: var(--fg); cursor: pointer; text-align: left; font-size: 14px;
}
.grupo .cabecera > span:first-child { font-weight: 600; flex: none; }
.grupo .cabecera small { color: var(--muted); font-weight: 400; }
.grupo .elegido { flex: 1; min-width: 0; text-align: right; color: var(--accent); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grupo .elegido.vacio { color: var(--muted); }
.grupo .cabecera .chev { width: 14px; height: 14px; color: var(--muted); flex: none; transition: transform .2s; }
.grupo.abierto .cabecera .chev { transform: rotate(180deg); }
.grupo .cuerpo { display: none; padding: 2px 0 14px; }
.grupo.abierto .cuerpo { display: block; }
.buscar-opcion {
  width: 100%; margin: 2px 0 10px; padding: 8px 12px; border-radius: 10px; font: inherit; font-size: 13px;
  background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--fg); outline: none;
}
.buscar-opcion:focus { border-color: var(--accent); }
.chips .chip[hidden] { display: none; }

/* Compartir la tapa (X e Instagram), al pie de la ficha */
.compartir-tapa { display: flex; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.compartir-tapa:empty { display: none; }
.compartir-tapa a, .compartir-tapa button {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid var(--line); color: var(--fg); padding: 0;
}
.compartir-tapa a:hover, .compartir-tapa button:hover { border-color: var(--accent); color: var(--accent); }
.compartir-tapa svg { width: 18px; height: 18px; }
