/* ════════════════════════════════════════════════════
   autorretrato.css — autorretrato colectivo
════════════════════════════════════════════════════ */

/* ── Fuente ── */
@font-face { font-family: 'Bellota'; src: url('../../fonts/Bellota-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Bellota'; src: url('../../fonts/Bellota-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Bellota'; src: url('../../fonts/Bellota-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* ── Variables ── */
:root {
  --fondo: #0b0c0a;
  --tinta: #f3efe6;
  --tinta-suave: rgba(243, 239, 230, .72);
  --acento: #b8af49;
  --acento-osc: #877f28;
  --suave: cubic-bezier(.22, .61, .36, 1);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--tinta); }
body { font-family: 'Bellota', system-ui, sans-serif; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 3px; }

.boton {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .75em 1.5em;
  border: 0; background: var(--acento-osc); color: var(--tinta);
  font-weight: 700; letter-spacing: .02em; text-decoration: none;
  cursor: pointer; transition: background .3s, color .3s, opacity .3s;
}
.boton:disabled { opacity: .35; cursor: not-allowed; }
.boton-claro { background: transparent; box-shadow: inset 0 0 0 1px rgba(243, 239, 230, .4); }

/* ── Entrada ── */
.entrada { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; background: transparent; }
.entrada-fondo {
  position: fixed; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  filter: blur(10px) brightness(.42) saturate(1.15);
  transform: scale(1.08);
  opacity: 0; transition: opacity 1.6s var(--suave);
  pointer-events: none;
}
.entrada-fondo.listo { opacity: 1; }
.entrada-caja { width: min(100% - 32px, 64rem); padding: 1.6rem 0; }
.entrada h1 { margin: 0 0 1.1rem; font-size: clamp(1.7rem, 1.3rem + 2vw, 2.6rem); line-height: 1.05; }
.marca-titulo svg { display: block; height: clamp(3.4rem, 2.6rem + 2.4vw, 4.8rem); width: auto; }
.entrada-texto { color: var(--tinta-suave); font-size: clamp(.92rem, .88rem + .2vw, 1.02rem); }
.entrada-texto p { margin: 0 0 .8em; }
.logo-en-linea { color: var(--tinta); text-decoration: none; }
.logo-en-linea svg { display: inline; height: 1.32em; width: auto; vertical-align: baseline; }
.indicaciones { margin: 0; padding: 0 0 0 1.3em; list-style: none; }
.indicaciones li { position: relative; margin: 0 0 .55em; }
.indicaciones li::before {
  content: ''; position: absolute; left: -1.25em; top: .55em;
  width: .5em; height: .5em;
  background: var(--acento); clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.escuchar { margin: .9rem 0 .7rem; overflow-x: clip; }
.escuchar .frase { font-size: min(calc((100vw - 32px - 2.6rem) * 9 / 172), 20px); }
@media (min-width: 900px) {
  .entrada-texto { container-type: inline-size; display: grid; grid-template-columns: 1fr 28%; column-gap: 3%; }
  .entrada-texto > * { grid-column: 1; }
  .escuchar { position: absolute; inset-inline-start: calc(100% + 3cqw); top: 50%; translate: 0 -50%; width: 28cqw; margin: 0; }
  .escuchar .frase { font-size: calc(28cqw * 9 / 172); }
}
.avisame { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .3em; margin: .2rem 0 0 .4rem; vertical-align: baseline; }
.avisame .boton, .entrada-acciones button.boton { padding: .12em .45em .18em; font-size: inherit; font-weight: inherit; line-height: inherit; color: #000; }
.apodo { display: flex; align-items: center; gap: .55rem; color: var(--tinta-suave); }
.avisame input, .apodo input {
  flex: 0 1 15rem; width: 15rem; min-width: 0;
  padding: .55em .8em;
  border: 0; border-bottom: 1px solid rgba(243, 239, 230, .35); border-radius: 0;
  background: rgba(243, 239, 230, .06); color: var(--tinta); font: inherit;
}
.apodo input:focus, .avisame input:focus { outline: none; border-bottom-color: var(--acento); }
.avisame-estado { display: block; min-height: 1.2em; font-size: .9rem; }
.avisame-estado.ok { color: var(--acento); }
.avisame-estado.error { color: #e48a9e; }
.entrada-acciones {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 1rem 1.4rem;
  margin-top: 1.6rem;
}
.casilla { display: flex; align-items: center; gap: .55rem; cursor: pointer; }
.entrada-acciones .casilla + .boton { margin-inline-start: calc(.35em - 1.4rem); }
.casilla input { width: 1.2rem; height: 1.2rem; accent-color: var(--acento); }

/* ── Lienzo ── */
.acd { overflow: hidden; height: 100vh; height: 100dvh; touch-action: none; overscroll-behavior: none; }
.lienzo { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.lienzo.arrastrando { cursor: grabbing; }

/* ── Barra de herramientas ── */
.herramientas {
  position: fixed; z-index: 10; left: 0; top: 50%; translate: 0 -50%;
  display: flex; flex-direction: column;
  background: rgba(11, 12, 10, .55);
  backdrop-filter: blur(6px);
}
.herr {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 0; background: none; cursor: pointer;
  opacity: .75; transition: opacity .25s, background .25s;
}
.herr svg { width: 22px; height: 22px; fill: none; stroke: var(--tinta); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.herr[hidden] { display: none; }

/* ── Cabecera ── */
.acd-esquina { position: fixed; z-index: 10; text-decoration: none; transition: opacity .25s; }
.acd-esquina svg { display: block; width: auto; filter: drop-shadow(0 0 8px rgba(0, 0, 0, .7)); }
.acd-marca { top: 14px; left: 16px; opacity: .9; }
.acd-marca svg { height: 46px; }
.acd-ecoarte { top: 18px; right: 18px; color: var(--tinta); opacity: .75; }
.acd-ecoarte svg { height: 22px; }
.acd-participar { right: 16px; bottom: 16px; padding: .55em 1.1em; background: var(--acento-osc); }
.linea-tiempo:not([hidden]) ~ .acd-participar { bottom: 5.4rem; }

/* ── Pista ── */
.acd-pista {
  position: fixed; z-index: 10; left: 50%; bottom: 1.2rem; translate: -50% 0;
  margin: 0; padding: .5em 1em;
  background: rgba(11, 12, 10, .6); font-size: .9rem; color: var(--tinta-suave);
  pointer-events: none; transition: opacity 1.2s var(--suave);
}
.acd-pista.ida { opacity: 0; }
.acd-sinjs { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; }

/* ── Barra: grupos, estados ── */
.grupo { display: flex; flex-direction: column; }
.grupo[hidden] { display: none; }
.herr:disabled { opacity: .25; cursor: default; }
.herr[aria-pressed="true"], .herr[aria-expanded="true"] { opacity: 1; background: rgba(184, 175, 73, .22); }
.herr-si svg { stroke: var(--acento); stroke-width: 2.2; }

/* ── Capa de edición ── */
.capa-edicion { position: fixed; inset: 0; z-index: 5; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.capa-borde { fill: none; stroke: #fff; stroke-width: 1.2; stroke-dasharray: 5 4; }
.capa-tirador { fill: var(--fondo); stroke: #fff; stroke-width: 1.6; }
.tirador-giro { fill: var(--acento); }
.tirador-lado { fill: #fff; stroke: var(--fondo); }
.capa-varilla { stroke: #fff; stroke-width: 1.2; }
.capa-lado.reflejo { opacity: .55; }

/* ── Opacidad y mezcla ── */
.panel-flotante {
  position: fixed; z-index: 11; left: 56px; top: 50%; translate: 0 -50%;
  width: 13rem; padding: .9rem;
  background: rgba(11, 12, 10, .85); backdrop-filter: blur(6px);
  font-size: .9rem;
}
.panel-flotante[hidden] { display: none; }
.panel-fila { display: grid; gap: .3rem; margin-bottom: .8rem; color: var(--tinta-suave); }
.panel-fila input { width: 100%; accent-color: var(--acento); }
.panel-modos { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.panel-modos button { padding: .45em .4em; border: 0; background: rgba(243, 239, 230, .08); cursor: pointer; font-size: .85rem; }
.panel-modos button[aria-pressed="true"] { background: var(--acento-osc); }
.panel-una { grid-template-columns: 1fr; }
.panel-modos button:disabled { opacity: .4; cursor: progress; }
.panel-nota { margin: .8rem 0 0; color: var(--tinta-suave); font-size: .78rem; line-height: 1.4; }
.panel-nota a { color: inherit; }

/* ── Recorte con lazo ── */
.lazo { max-width: none; max-height: none; width: 100vw; height: 100dvh; margin: 0; padding: 1rem; border: 0; background: rgba(5, 5, 4, .94); color: var(--tinta); }
.lazo[open] { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: .8rem; }
.lazo::backdrop { background: rgba(0, 0, 0, .6); }
.lazo-pista { margin: 0; color: var(--tinta-suave); font-size: .95rem; }
.lazo-lienzo { max-width: 100%; max-height: 100%; align-self: center; touch-action: none; cursor: crosshair; background: repeating-conic-gradient(#222 0 25%, #2c2c2c 0 50%) 0 0 / 20px 20px; }
.lazo-botones { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }

/* ── Ficha de un aporte ── */
.ficha {
  position: fixed; z-index: 15;
  display: grid; gap: .4rem; min-width: 9rem; padding: .7rem .8rem .55rem;
  background: rgba(11, 12, 10, .9); backdrop-filter: blur(6px); font-size: .9rem;
}
.ficha[hidden] { display: none; }
.acd-firma { position: fixed; z-index: 12; margin: 0; padding: .3em .7em; background: rgba(11, 12, 10, .85); color: var(--tinta); font-size: .9rem; white-space: nowrap; pointer-events: none; }
.acd-firma[hidden] { display: none; }
.ficha-fecha { margin: 0 0 .2rem; color: var(--tinta-suave); }
.ficha-boton { padding: .5em .8em; border: 0; background: rgba(243, 239, 230, .08); cursor: pointer; text-align: start; }
.ficha-deshacer { background: var(--acento-osc); }
.ficha-reportar { justify-self: end; padding: .15em 0; background: none; color: var(--tinta-suave); font-size: .72rem; opacity: .55; text-decoration: underline dotted; text-underline-offset: .2em; }

/* ── Avisos ── */
.acd-aviso {
  position: fixed; z-index: 20; left: 50%; bottom: 4.5rem; translate: -50% 0;
  margin: 0; padding: .6em 1.1em; max-width: calc(100% - 2rem);
  background: rgba(11, 12, 10, .88); text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .4s var(--suave);
}
.acd-aviso.visible { opacity: 1; }
.acd-aviso.error { color: #e48a9e; }
.acd-aviso.visible { pointer-events: auto; }
.acd-aviso-accion { margin-left: .8em; padding: .3em .8em; border: 0; background: var(--acento-osc); cursor: pointer; }
.acd-aviso-accion[hidden] { display: none; }

/* ── Hover ── */
@media (any-hover: hover) {
  .boton:not(:disabled):hover { background: var(--tinta); color: #15140f; }
  .herr:not(:disabled):hover { opacity: 1; background: rgba(243, 239, 230, .08); }
  .panel-modos button:hover, .ficha-boton:hover { background: rgba(243, 239, 230, .18); }
  .ficha-reportar:hover { background: none; opacity: 1; }
  .acd-esquina:hover { opacity: 1; }
}

/* ── Línea de tiempo ── */
.linea-tiempo {
  position: fixed; z-index: 11; left: 64px; right: 16px; bottom: 16px;
  display: flex; align-items: center; gap: .8rem;
  padding: .45rem .9rem .45rem .45rem;
  background: rgba(11, 12, 10, .8); backdrop-filter: blur(6px);
}
.linea-tiempo[hidden] { display: none; }
.tiempo-play { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; cursor: pointer; }
.tiempo-play svg { grid-area: 1 / 1; width: 20px; height: 20px; fill: var(--tinta); stroke: var(--tinta); stroke-width: 1.6; stroke-linejoin: round; }
.tiempo-play svg:last-child { fill: none; stroke-width: 2.4; stroke-linecap: round; }
.tiempo-play svg:last-child, .tiempo-play.andando svg:first-child { display: none; }
.tiempo-play.andando svg:last-child { display: block; }
.tiempo-rango { flex: 1; min-width: 0; accent-color: var(--acento); cursor: pointer; }
.tiempo-fecha { flex: none; min-width: 11.5em; color: var(--tinta-suave); font-size: .85rem; font-variant-numeric: tabular-nums; text-align: right; }
.linea-tiempo:not([hidden]) ~ .acd-pista { display: none; }
.linea-tiempo:not([hidden]) ~ .acd-aviso { bottom: 5.6rem; }
@media (max-width: 600px) {
  .linea-tiempo { flex-wrap: wrap; gap: .2rem .6rem; }
  .tiempo-fecha { order: 3; flex-basis: 100%; min-width: 0; text-align: center; }
}

/* ── Galería y obra terminada ── */
.entrada-terminada { flex-basis: 100%; margin: 0; color: var(--tinta-suave); text-align: right; }
.entrada-galeria { margin-inline-end: auto; color: var(--tinta-suave); }
.galeria .entrada-caja { place-self: start center; }
.galeria-sub { margin: 0 0 1.6rem; color: var(--acento); font-size: 1.1rem; }
.galeria-vacia { color: var(--tinta-suave); }
.galeria-vacia a { color: var(--tinta); }
.galeria-lista { display: grid; gap: 1.8rem; margin: 0; padding: 0; list-style: none; }
.galeria-imagen { display: block; aspect-ratio: 6 / 1; background: #1d1c17; overflow: hidden; }
.galeria-imagen img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.galeria-datos { margin: .6rem 0 0; color: var(--tinta-suave); font-size: .95rem; }
.galeria-datos b { color: var(--tinta); font-weight: 500; }
@media (any-hover: hover) {
  .galeria-imagen:hover img { opacity: .85; }
}
