/* Estilos de la aplicación del mural */
  :root { --fg: #f4f1ea; --accent: #e9b44c; --ui: rgba(14,14,18,.78); }
  * { box-sizing: border-box; }
  html, body { margin: 0; height: 100%; background: #000; color: var(--fg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
  button { font: inherit; }
  [hidden] { display: none !important; }

  /* ---------- barra superior ---------- */
  #topbar { position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 30;
    display: flex; align-items: center; gap: 10px; padding: 0 14px;
    background: linear-gradient(rgba(0,0,0,.75), rgba(0,0,0,0)); pointer-events: none; }
  #topbar > * { pointer-events: auto; }
  #title { font-size: 15px; font-weight: 600; letter-spacing: .02em; margin-right: auto;
    background: none; border: 0; color: var(--fg); padding: 6px 4px; cursor: pointer; text-align: left; }
  .chip { background: var(--ui); color: var(--fg); border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px; padding: 7px 14px; font-size: 14px; cursor: pointer; }
  .chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
  :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
  /* Pantalla táctil: sin selección de texto, sin llamadas de menú, sin zoom */
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
    touch-action: none; overscroll-behavior: none; }
  input { -webkit-user-select: text; user-select: text; }
  @media (hover: hover) {
    .chip:hover { border-color: var(--accent); }
    .arrow:hover { color: var(--accent); }
    .hot:hover { background: rgba(233,180,76,.12); box-shadow: 0 0 0 2px rgba(233,180,76,.7); }
    .hot:hover::after { opacity: 1; }
    #indice li button:hover { background: rgba(233,180,76,.15); }
  }

  /* ---------- mural ---------- */
  #mural { position: fixed; inset: 0; overflow: hidden; background: #000; touch-action: none; cursor: grab; }
  #mural.dragging { cursor: grabbing; }
  #world { position: absolute; left: 0; top: 0; width: 4629px; height: 1080px; transform-origin: 0 0; }
  #world img { position: absolute; left: 0; top: 2px; width: 4629px; height: 1080px;
    user-select: none; -webkit-user-drag: none; pointer-events: none; }
  .hot { position: absolute; background: transparent; border: 0; padding: 0; margin: 0; border-radius: 8px; cursor: pointer;
    -webkit-tap-highlight-color: transparent; }
  .hot:focus-visible { background: rgba(233,180,76,.12); box-shadow: 0 0 0 3px rgba(233,180,76,.8); }
  .hot::after { content: attr(data-name); position: absolute; left: 50%; bottom: calc(100% + 6px);
    transform: translateX(-50%); white-space: nowrap; background: var(--ui); color: var(--fg);
    padding: 4px 9px; border-radius: 6px; font-size: 13px; pointer-events: none;
    opacity: 0; transition: opacity .2s; }
  .hot:focus-visible::after, .hot.tocado::after { opacity: 1; }
  .hot.tocado { background: rgba(233,180,76,.2); box-shadow: 0 0 0 3px rgba(233,180,76,.9); }

  .arrow { position: fixed; top: 50%; transform: translateY(-50%); z-index: 20; width: 56px; height: 96px;
    border: 0; border-radius: 12px; background: var(--ui); color: var(--fg); font-size: 34px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; user-select: none; touch-action: none; }
  #arrowL { left: 12px; } #arrowR { right: 12px; }

  /* ---------- escena ---------- */
  body.en-escena #topbar { display: none; }
  #escena { position: fixed; inset: 0; background: #0b0b0e; overflow: hidden;
    display: flex; flex-direction: column; }
  #fondo { position: absolute; inset: -60px; background-size: cover; background-position: center;
    filter: blur(48px) saturate(.9) brightness(.32); transform: scale(1.08); }
  .cuerpo { position: relative; flex: 1; min-height: 0; display: grid;
    grid-template-columns: minmax(0, 44fr) minmax(0, 56fr); gap: 4vw; padding: 6vh 5vw 2vh; }
  .galeria { position: relative; min-height: 0; border-radius: 22px; overflow: hidden;
    background: #000; box-shadow: 0 24px 70px rgba(0,0,0,.55); }
  /* Cada foto se ve entera (sin recorte), sobre un fondo difuminado de la misma foto */
  .diapo { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
  .diapo.activa { opacity: 1; }
  .diapo .fondo-foto { position: absolute; inset: -30px; background-size: cover; background-position: center;
    filter: blur(28px) brightness(.45); transform: scale(1.1); }
  .diapo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
  .galeria.banda { background-repeat: repeat-x; background-size: auto 100%; background-position: 0 0;
    animation: banda 41.667s linear infinite; }
  @keyframes banda { from { background-position: 0 0; } to { background-position: var(--dx, -1920px) 0; } }
  .info { position: relative; min-height: 0; display: flex; flex-direction: column; }
  #sNombre { margin: 0; font-size: clamp(40px, 4.2vw, 72px); font-weight: 700; line-height: 1.05; letter-spacing: -.01em; }
  #sAnios { margin: .35em 0 0; font-size: clamp(20px, 1.6vw, 28px); color: rgba(244,241,234,.6); font-variant-numeric: tabular-nums; }
  .transcripcion { position: relative; flex: 1; min-height: 0; margin-top: 4vh; overflow: hidden; cursor: grab; touch-action: none;
    -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
    mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent); }
  .lineas { position: absolute; left: 0; right: 0; top: 0; transition: transform .4s cubic-bezier(.2,.7,.2,1); }
  .lineas.arrastrando { transition: none; }
  .frase { margin: 0 0 .7em; font-size: clamp(22px, 1.8vw, 30px); line-height: 1.5; color: rgba(244,241,234,.32);
    border-radius: 10px; padding: .15em .3em; transition: color .4s ease; }
  .frase.activa { color: var(--fg); }
  .progreso { flex: 0 0 auto; height: 6px; margin-top: 2.5vh; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; }
  .progreso i { display: block; height: 100%; width: 0; background: var(--accent); }
  .barra { position: relative; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 2vh 5vw 3vh; }
  .btn { min-height: 64px; padding: 0 26px; border-radius: 16px; font: inherit; font-size: 20px;
    background: rgba(255,255,255,.08); color: var(--fg); border: 1px solid rgba(255,255,255,.16); cursor: pointer; }
  .btn.primario { background: var(--accent); color: #111; border-color: transparent; font-weight: 600; }
  .btn:active, .chip-rel:active { transform: scale(.98); }
  .relacionados { margin-left: auto; display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
  .chip-rel { min-height: 64px; padding: 0 22px; border-radius: 16px; font: inherit; font-size: 20px;
    background: rgba(233,180,76,.14); color: var(--fg); border: 1px solid rgba(233,180,76,.55); cursor: pointer; }
  @media (hover: hover) {
    .btn:hover { background: rgba(255,255,255,.16); }
    .btn.primario:hover { background: #f0c469; }
    .chip-rel:hover { background: rgba(233,180,76,.28); }
    .frase:hover { color: rgba(244,241,234,.7); }
  }
  @media (max-width: 900px) {
    .cuerpo { grid-template-columns: 1fr; grid-template-rows: 40% 1fr; gap: 2.5vh; }
  }

  /* ---------- índice ---------- */
  #indice { position: fixed; top: 56px; right: 14px; bottom: 14px; width: min(380px, calc(100vw - 28px));
    background: rgba(12,12,16,.96); border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
    z-index: 40; display: flex; flex-direction: column; overflow: hidden; }
  #indice header { padding: 14px; display: flex; gap: 8px; align-items: center; }
  #indice input { flex: 1; padding: 9px 11px; border-radius: 8px; border: 1px solid rgba(255,255,255,.2);
    background: #1b1b21; color: var(--fg); font: inherit; }
  #indice ul { list-style: none; margin: 0; padding: 0 8px 14px; overflow: auto; }
  #indice li button { width: 100%; text-align: left; background: none; border: 0; color: var(--fg);
    padding: 9px 10px; border-radius: 8px; cursor: pointer; }
  #indice li button:active { background: rgba(233,180,76,.25); }
  #indice li button:hover { background: rgba(233,180,76,.15); }
  #indice small { opacity: .6; margin-left: 6px; }

  /* ---------- aviso ---------- */
  #toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50;
    background: rgba(20,20,24,.94); border: 1px solid rgba(233,180,76,.6); border-radius: 10px;
    padding: 10px 14px; font-size: 14px; max-width: min(640px, calc(100vw - 24px)); }
