* {
  box-sizing: border-box;
}

:root {
  --user-accent: #f5c518;

  --bg: #080808;
  --bg-2: #0f0f0f;
  --panel: #141414;
  --panel-2: #1c1c1c;
  --card: #111111;
  --card-2: #191919;

  --text: #f5f5f0;
  --muted: rgba(245, 245, 240, 0.62);
  --muted-2: rgba(245, 245, 240, 0.42);

  --border: rgba(255, 255, 255, 0.09);
  --border-strong: color-mix(in srgb, var(--user-accent) 45%, transparent);

  --danger: #ff5c5c;
  --success: #4ade80;

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --body-bg:
    radial-gradient(circle at top right, color-mix(in srgb, var(--user-accent) 10%, transparent), transparent 28%),
    radial-gradient(circle at top left, rgba(255,255,255,0.035), transparent 24%),
    linear-gradient(180deg, #050505 0%, #0b0b0b 42%, #121212 100%);
}

html {
  scroll-behavior: smooth;
}

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 14px;
  background: var(--body-bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ocultar restos arcade del HTML antiguo */
.arcade-scene,
.machine-top,
.arcade-side,
.controls-deco,
.frame-corner,
.screen-topbar,
.theme-toggle-btn {
  display: none !important;
}

/* Layout */
.wrap {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
}

.arcade-machine {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 8px 24px;
}

/* Panel superior */
.panel,
.arcade-panel-shell {
  position: relative;
  padding: 0;
  margin-bottom: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.panel-head {
  width: 100%;
  margin-bottom: 12px;
}

.top-actions,
.top-actions-inline {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-action-btn,
.guide-action-btn,
.btn,
.btn-sec,
.btn-add,
.btn-pag,
.guide-close,
.search-clear,
.scroll-top-btn {
  font-family: inherit;
}

.top-action-btn {
  appearance: none;
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #111;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.18s ease;
  white-space: nowrap;
}

.top-action-btn:hover {
  border-color: var(--user-accent);
  color: var(--user-accent);
  background: #050505;
  transform: translateY(-1px);
}

.top-actions-inline .icon-only,
.games-toggle-btn {
  flex: 0 0 46px;
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  font-size: 16px;
}

/* Selector de color */
.theme-color-picker {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border: 2px solid #111;
  border-radius: 999px;
  padding: 4px;
  background: #111;
  cursor: pointer;
}

.theme-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.theme-color-picker::-webkit-color-swatch {
  border: 0;
  border-radius: 999px;
}

.theme-color-picker::-moz-color-swatch {
  border: 0;
  border-radius: 999px;
}

/* Tabs */
.tabs-shell {
  padding: 5px;
  border-radius: 999px;
  background: #111;
  border: 1px solid var(--border);
}

.tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 1;
  min-width: 74px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.18s ease;
  white-space: nowrap;
}

.tab.active {
  background: var(--user-accent);
  color: #111;
}

.tab:hover:not(.active) {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

/* Buscador */
.controls-zone {
  display: block;
  margin-bottom: 18px;
}

.search-sticky,
.arcade-search-panel {
  position: sticky;
  top: 8px;
  z-index: 60;
  padding: 8px;
  border-radius: 24px;
  background: rgba(17, 17, 17, 0.92);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.search-header-line {
  display: none;
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #111;
  font-size: 15px;
  pointer-events: none;
}

#buscador {
  width: 100%;
  min-height: 54px;
  padding: 0 48px 0 44px;
  border: 1px solid transparent;
  border-radius: 18px;
  outline: none;
  background: #fff;
  color: #111;
  font-size: 15px;
  font-weight: 800;
  transition: 0.18s ease;
}

#buscador::placeholder {
  color: #777;
}

#buscador:focus {
  border-color: var(--user-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--user-accent) 22%, transparent);
}

.search-clear {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #111;
  font-size: 20px;
  cursor: pointer;
}

.search-clear.visible {
  display: inline-flex;
}

/* Catálogo */
.catalogo-visor,
.arcade-screen-frame,
.screen-inner {
  position: relative;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

.lista {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  width: 100%;
  padding-bottom: calc(34px + var(--safe-bottom));
}

.letra,
.acordeon-header,
.acordeon-contenido,
.empty-state,
.loading-state,
.inline-loader {
  grid-column: 1 / -1;
}

@media (min-width: 760px) {
  .lista,
  .acordeon-contenido.abierto {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1120px) {
  .lista,
  .acordeon-contenido.abierto {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Acordeones */
.acordeon-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 800;
  text-align: center;

  border: 1px solid color-mix(in srgb, var(--user-accent) 35%, transparent);
  border-radius: 16px;

  background: color-mix(in srgb, var(--user-accent) 8%, rgba(0,0,0,0.65));
  box-shadow:
    0 0 18px color-mix(in srgb, var(--user-accent) 12%, transparent),
    inset 0 0 0 1px rgba(255,255,255,0.02);

  transition: all 0.25s ease;
}

.acordeon-header:hover {
  border-color: color-mix(in srgb, var(--user-accent) 55%, transparent);
  box-shadow:
    0 0 24px color-mix(in srgb, var(--user-accent) 18%, transparent);
}

.acordeon-header span {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 14px;
  font-weight: 800;

  background: var(--user-accent);
  color: #111827;

  box-shadow:
    0 6px 18px color-mix(in srgb, var(--user-accent) 30%, transparent);
}

.acordeon-contenido {
  display: none;
  margin-top: 4px;
}

.acordeon-contenido.abierto {
  display: grid;
  gap: 18px;
  animation: fadeDown 0.2s ease;
}

.menu-gif,
.topbar-gif {
  height: 25px;
  width: auto;
  border-radius: 6px;
  object-fit: contain;
}

/* Letras */
.letra {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 10px;
  color: #fff;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.letra::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

/* Tarjetas */
.item,
.item-card {
  height: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  transition: 0.18s ease;
}

.item:hover,
.item-card:hover {
  transform: translateY(-4px);
  border-color: var(--user-accent);
  background: #070707;
}

.item-main-visual {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
}

.item-poster-wrap {
  width: 100%;
}

.poster-icon,
.poster-grande {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--user-accent);
  font-size: 30px;
}

.poster-img,
.poster-grande img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.poster-clickable {
  cursor: zoom-in;
}

.item-contenido {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.item-top {
  display: flex;
  align-items: center;
  margin-bottom: 7px;
}

.nombre,
.nombre-grande {
  color: #fff;
  font-size: 17px;
  line-height: 1.28;
  font-weight: 950;
  letter-spacing: -0.02em;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.subinfo,
.subinfo-grande {
  margin-top: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
}

mark.hl {
  background: var(--user-accent);
  color: #111;
  border-radius: 5px;
  padding: 0 4px;
}

/* Tags */
.tag,
.tag-red {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--user-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--user-accent) 35%, transparent);
  color: var(--user-accent);
  font-size: 10px;
  font-weight: 900;
}

/* Botones */
.acciones-principales,
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.acciones-principales {
  margin-top: auto;
}

.acciones-principales .btn,
.acciones-principales .btn-sec,
.acciones-principales .btn-add {
  width: 100%;
}

.btn,
.btn-sec,
.btn-add,
.btn-pag,
.guide-action-btn {
  appearance: none;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  text-decoration: none;
  transition: 0.18s ease;
  white-space: nowrap;
}

.btn,
.guide-action-btn.primary {
  background: var(--user-accent);
  color: #111;
}

.btn:hover,
.guide-action-btn.primary:hover {
  filter: brightness(1.08);
}

.btn-sec,
.btn-add,
.btn-pag,
.guide-action-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
}

.btn-sec:hover,
.btn-add:hover,
.btn-pag:hover:not(:disabled),
.guide-action-btn:hover {
  background: rgba(255,255,255,0.14);
}

.btn-add.activo {
  background: #fff;
  color: #111;
}

.btn-pag:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Episodios */
.episodios {
  display: none;
  padding: 0 12px 12px;
  background: rgba(255,255,255,0.035);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.episodios.abierto {
  display: block;
  animation: fadeDown 0.2s ease;
}

.bloque-episodio {
  margin-top: 12px;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.bloque-episodio-head {
  padding: 12px 14px;
  background: rgba(255,255,255,0.045);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.bloque-episodio-titulo {
  display: flex;
  gap: 8px;
  color: rgba(255,255,255,0.88);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
  word-break: break-word;
}

.episodio {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.episodio:last-child {
  border-bottom: 0;
}

.episodio-nombre {
  display: flex;
  gap: 9px;
  min-width: 0;
  flex: 1;
  color: rgba(255,255,255,0.84);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.episodio .btn,
.episodio .btn-sec,
.episodio .btn-add {
  min-height: 34px;
  padding: 0 12px;
  font-size: 11px;
}

/* Estados */
.estado {
  text-align: center;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.paginacion {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-bottom: 8px;
}

.info-pag {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  padding: 0 6px;
}

.empty-state,
.loading-state {
  border-radius: 22px;
  padding: 30px 18px;
  text-align: center;
  color: var(--text);
  font-weight: 850;
  background: var(--card);
  border: 1px solid var(--border);
}

.aviso-espera,
.arcade-alert {
  margin: 14px 0 10px;
  padding: 13px 15px;
  border-radius: 18px;
  background: rgba(17,17,17,0.95);
  border: 1px solid color-mix(in srgb, var(--user-accent) 35%, transparent);
  color: var(--user-accent);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 850;
}

/* Loader */
.inline-loader {
  width: 100%;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0 18px;
}

.inline-loader-box {
  width: min(100%, 560px);
  padding: 28px 22px;
  text-align: center;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--user-accent) 20%, transparent);
}

.inline-loader-ring {
  display: none;
}

.inline-loader-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 38px;
  background: color-mix(in srgb, var(--user-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--user-accent) 25%, transparent);
  animation: inlinePopcornFloat 1.8s ease-in-out infinite;
}

.inline-loader-title {
  color: #fff;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.2;
  margin-bottom: 8px;
}

.inline-loader-subtitle {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.inline-loader-bar {
  width: 100%;
  max-width: 360px;
  height: 9px;
  margin: 0 auto 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}

.inline-loader-bar-fill {
  width: 14%;
  height: 100%;
  border-radius: inherit;
  background: var(--user-accent);
  transition: width 0.35s ease;
}

.inline-loader-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.inline-loader-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  animation: inlineLoaderDots 1.2s infinite ease-in-out;
}

.inline-loader-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.inline-loader-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

/* Toasts */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(16px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 14px;
  border-radius: 15px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  background: #111;
  border: 1px solid color-mix(in srgb, var(--user-accent) 22%, transparent);
  animation: toastIn 0.22s ease;
}

.toast.success {
  border-color: rgba(74,222,128,0.35);
}

.toast.error {
  border-color: rgba(255,92,92,0.45);
}

/* Botón subir */
.scroll-top-btn {
  position: fixed;
  right: 16px;
  bottom: calc(18px + var(--safe-bottom));
  width: 48px;
  height: 48px;
  border: 1px solid color-mix(in srgb, var(--user-accent) 35%, transparent);
  border-radius: 999px;
  background: #111;
  color: var(--user-accent);
  font-size: 20px;
  font-weight: 950;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: 0.2s ease;
  z-index: 9999;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Modales */
body.guide-open,
body.games-open,
body.poster-expanded {
  overflow: hidden;
}

.guide-overlay,
.games-overlay,
.poster-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.poster-lightbox {
  z-index: 100000;
}

.guide-overlay.visible,
.games-overlay.visible,
.poster-lightbox.abierto {
  display: block;
}

.guide-backdrop,
.games-backdrop,
.poster-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(6px);
}

.guide-modal,
.games-modal,
.bloqueo-card {
  position: relative;
  z-index: 2;
  width: min(92vw, 920px);
  max-height: calc(100dvh - 24px);
  margin: 4vh auto 0;
  overflow: hidden;
  border-radius: 28px;
  background: #111;
  border: 1px solid color-mix(in srgb, var(--user-accent) 20%, transparent);
}

.guide-modal {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
}

.games-modal {
  width: min(92vw, 520px);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}

.guide-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.035);
}

.guide-kicker {
  color: var(--user-accent);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.guide-title {
  margin: 0;
  color: #fff;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.guide-close {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.guide-content,
.games-content {
  overflow-y: auto;
  max-height: calc(100dvh - 130px);
  padding: 20px;
}

.games-content {
  flex: 1;
  max-height: none;
}

.guide-section + .guide-section {
  margin-top: 18px;
}

.guide-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.guide-section-head h3,
.guide-subtitle,
.bloqueo-titulo {
  margin: 0;
  color: #fff;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.guide-section-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--user-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--user-accent) 20%, transparent);
}

.guide-card,
.game-card {
  padding: 18px;
  border-radius: 20px;
  color: rgba(255,255,255,0.86);
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.09);
}

.guide-card p {
  margin: 0 0 12px;
  line-height: 1.6;
}

.guide-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.guide-warning,
.guide-note {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--user-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--user-accent) 22%, transparent);
  color: #fff;
}

.guide-warning.soft {
  margin-top: 0;
  margin-bottom: 14px;
}

.guide-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* Juegos */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.game-card {
  cursor: pointer;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.18s ease;
}

.game-card:hover {
  transform: translateY(-2px);
  border-color: var(--user-accent);
}

.game-icon {
  font-size: 1.7rem;
}

.game-name {
  color: #fff;
  font-weight: 900;
}

.games-note {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Bloqueos */
.bloqueo-usuario,
.bloqueo-webapp {
  width: 100%;
  max-width: 780px;
  margin: 40px auto;
  padding: 16px;
}

.bloqueo-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 30px 22px;
  text-align: center;
}

.bloqueo-icono {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 14px;
}

.bloqueo-titulo {
  font-size: 24px;
  margin-bottom: 10px;
}

.bloqueo-texto {
  max-width: 540px;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* Lightbox poster */
.poster-lightbox-content {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 720px);
  max-height: 90vh;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

#posterLightboxImg {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
}

.poster-close-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  z-index: 2;
}

/* Móvil */
@media (max-width: 768px) {
  body {
    padding: 8px;
  }

  .arcade-machine {
    padding: 0 0 18px;
  }

  .top-actions {
    gap: 7px;
  }

  .top-action-btn {
    min-height: 42px;
    font-size: 12px;
  }

  .top-actions-inline .icon-only,
  .games-toggle-btn,
  .theme-color-picker {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    height: 42px;
  }

  .tab {
    min-width: 68px;
    min-height: 36px;
    font-size: 12px;
    padding: 0 8px;
  }

  .search-sticky,
  .arcade-search-panel {
    border-radius: 20px;
  }

  #buscador {
    min-height: 48px;
    font-size: 13px;
  }

  .lista,
  .acordeon-contenido.abierto {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .item-main-visual {
    grid-template-columns: 82px 1fr;
    gap: 12px;
    padding: 12px;
  }

  .item-poster-wrap {
    width: 82px;
  }

  .poster-icon,
  .poster-grande {
    width: 82px;
    height: 122px;
    aspect-ratio: auto;
    border-radius: 14px;
  }

  .nombre,
  .nombre-grande {
    font-size: 12px;
  }

  .subinfo,
  .subinfo-grande {
    font-size: 12px;
  }

  .acordeon-header {
    font-size: 12px;
  }

  .episodio {
    flex-direction: column;
    align-items: stretch;
  }

  .meta {
    justify-content: flex-start;
  }

  .paginacion {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .info-pag {
    grid-column: 1 / -1;
    text-align: center;
    order: -1;
  }

  .btn-pag {
    width: 100%;
  }

  .guide-modal,
  .games-modal {
    width: calc(100% - 14px);
    max-height: calc(100dvh - 14px);
    border-radius: 22px;
  }

  .guide-topbar {
    padding: 18px 16px 14px;
  }

  .guide-content,
  .games-content {
    padding: 14px;
  }

  .guide-title {
    font-size: 22px;
  }

  .guide-actions {
    flex-direction: column;
  }

  .guide-action-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .top-action-btn {
    font-size: 11px;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }
}

/* Animaciones */
@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes inlinePopcornFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.03);
  }
}

@keyframes inlineLoaderDots {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.45;
  }
  40% {
    transform: scale(1.15);
    opacity: 1;
  }
}


.theme-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.theme-overlay.visible {
  display: block;
}

.theme-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
}

.theme-modal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 420px);
  transform: translate(-50%, -50%);
  background: #101010;
  border: 1px solid color-mix(in srgb, var(--user-accent) 45%, transparent);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
}

.theme-content {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.theme-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 800;
}

.theme-option input[type="color"] {
  width: 54px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

body.theme-open {
  overflow: hidden;
}


.theme-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.theme-actions .guide-action-btn {
  width: 100%;
}