.recinto-gallery {
  --recinto-edge: max(clamp(1rem, 4.5vw, 4rem), calc((100% - 1420px) / 2));
}

.recinto-display {
  position: relative;
  isolation: isolate;
  min-width: 0;
  margin: 0;
  border-bottom: 1px solid var(--edge);
  background: var(--ink);
}

.recinto-stage {
  position: relative;
  height: clamp(28rem, calc(100vh - 68px), 56rem);
  height: clamp(28rem, calc(100svh - 68px), 56rem);
  background: radial-gradient(ellipse at 61% 49%, #36565b, #172d31 59%, #0f1d21);
}

.recinto-stage img,
.recinto-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.recinto-stage img {
  z-index: 1;
  object-fit: contain;
}

.recinto-stage img[src$="/fpv-puerto.webp"] {
  object-fit: cover;
  object-position: 63% 52%;
}

.recinto-stage canvas {
  touch-action: pan-y;
  cursor: grab;
}

.recinto-cut {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #0a151a;
  opacity: 0;
  pointer-events: none;
}

.recinto-gallery[data-fpv-mode="inspect"] canvas {
  touch-action: none;
}

.recinto-stage canvas:active {
  cursor: grabbing;
}

.recinto-display:has([data-fpv-pan][aria-pressed="true"]) canvas {
  touch-action: none;
  cursor: move;
}

.recinto-stage canvas:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: -4px;
}

.recinto-display::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4, 15, 20, 0.89), rgba(4, 15, 20, 0.48) 23%, transparent 53%),
    linear-gradient(0deg, rgba(4, 15, 20, 0.9), transparent 29%);
}

.recinto-caption {
  position: absolute;
  z-index: 2;
  inset: clamp(1.4rem, 7vw, 6rem) auto auto var(--recinto-edge);
  max-width: min(34vw, 24rem);
  margin: 0;
  color: #fff;
  pointer-events: none;
}

.recinto-caption h1,
.recinto-caption h2,
.recinto-caption p {
  margin: 0;
}

.recinto-caption h1 {
  font-size: clamp(0.98rem, 1.55vw, 1.35rem);
  font-weight: 620;
  line-height: 1.2;
}

.recinto-caption h2 {
  margin: 0.08em 0 0.2em;
  font-size: clamp(1.8rem, 4.6vw, 4.15rem);
  line-height: 0.97;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.recinto-caption .recinto-count {
  margin-top: clamp(0.55rem, 1.5vw, 1.1rem);
  color: var(--aqua);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.recinto-caption p:not(.recinto-count) {
  max-width: 32ch;
  font-size: clamp(0.83rem, 1.3vw, 1.03rem);
  line-height: 1.35;
  color: #ecf5f6;
}

.recinto-caption .recinto-status:not(:empty) {
  margin-top: 0.45rem;
  font-size: 0.83rem;
}

.recinto-toolbar {
  position: absolute;
  z-index: 2;
  inset: auto var(--recinto-edge) clamp(0.75rem, 2.1vw, 1.75rem);
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  pointer-events: none;
}

.recinto-fpv-controls,
.recinto-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.recinto-fpv-controls {
  min-width: 0;
  justify-content: end;
  gap: 0.4rem 0.7rem;
}

.recinto-actions button {
  pointer-events: auto;
}

#recinto-gestos {
  flex-basis: 100%;
  margin: 0;
  text-align: end;
  color: #ecf5f6;
  font-size: 0.79rem;
  line-height: 1.3;
}

.recinto-gallery [hidden] {
  display: none;
}

.recinto-gallery-details {
  display: grid;
  grid-template-columns: minmax(10rem, 0.8fr) minmax(0, 2fr);
  align-items: start;
  gap: 1.1rem clamp(1.5rem, 4vw, 5rem);
  padding-block: clamp(1.6rem, 4vw, 3.4rem);
}

.recinto-gallery-intro h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  line-height: 1.1;
}

.recinto-gallery-intro p {
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.recinto-selection h3 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  line-height: 1.3;
}

.recinto-selection h3:not(:first-child) {
  margin-top: 0.95rem;
}

.recinto-paints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.recinto-gallery button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid #648286;
  border-radius: 0.4rem;
  background: var(--slab);
  color: var(--paper);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.25;
  cursor: pointer;
}

.recinto-toolbar button {
  background: #14282e;
}

.recinto-gallery button:not(:disabled):hover {
  border-color: var(--aqua);
}

.recinto-gallery button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--aqua);
  border-color: var(--aqua);
  font-weight: 650;
}

.recinto-gallery button:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 3px;
}

.recinto-gallery button:disabled {
  cursor: default;
  opacity: 0.6;
}

@media (max-width: 790px) {
  .recinto-gallery-details {
    grid-template-columns: minmax(0, 1fr);
  }

  .recinto-toolbar,
  .recinto-fpv-controls {
    justify-content: start;
  }

  #recinto-gestos {
    text-align: start;
  }
}

@media (max-width: 560px) {
  .recinto-stage {
    height: clamp(32rem, 68vh, 44rem);
    height: clamp(32rem, 68svh, 44rem);
  }

  .recinto-display::after {
    background: linear-gradient(180deg, rgba(4, 15, 20, 0.92), transparent 43%, transparent 57%, rgba(4, 15, 20, 0.96));
  }

  .recinto-caption {
    max-width: min(100% - 2 * var(--recinto-edge), 25rem);
  }

  .recinto-toolbar {
    gap: 0.45rem;
  }

  .recinto-fpv-controls {
    width: 100%;
  }

  #recinto-gestos {
    font-size: 0.75rem;
  }
}
