/* O ESTÚDIO. One frame, one conveyor: all 23 faces, all the same size,
   crawling slowly clockwise around the center plate where QEVR lives with
   his playground. The chip size is solved from the viewport so a 4K monitor
   just gets bigger faces — never mismatched ones. A hand over the frame
   holds the crawl still; reduced motion turns it off.

   On a phone there are no side strips and the page NEVER scrolls: one strip
   of faces up top, one down below, each swipeable sideways and drifting
   slowly on its own; the playground sits between them. */

:root { --face-name: 20px; --chip-gap: 3px; --band-w: 160px; --band-h: 180px; --chip-w: 110px; --strip-h: 130px; }

.studio {
  height: 100svh; padding-top: var(--bar); overflow: hidden;
  max-width: var(--wrap); margin-inline: auto;
}
.frame { position: relative; height: 100%; }

/* ---------- desktop: the conveyor lane and the plate it frames ---------- */

.lane { position: absolute; inset: 0; }
/* opaque backing for each horizontal band: the side columns pass BEHIND it,
   so they never peek through the row gaps — only in the open middle bands */
.lane__cover { position: absolute; left: 0; right: 0; height: var(--band-h); z-index: 1; background: var(--ground); pointer-events: none; }
.lane__cover--top { top: 0; }
.lane__cover--bottom { bottom: 0; }
.strip { display: none; }

.face {
  border: 0; padding: 0; background: var(--ground);
  color: inherit; font: inherit; cursor: pointer;
  display: grid; grid-template-rows: minmax(0, 1fr) var(--face-name);
}
.lane .face { position: absolute; top: 0; left: 0; will-change: transform; }
.face__art { display: grid; place-items: center; min-height: 0; min-width: 0; overflow: hidden; }
.face canvas { display: block; image-rendering: pixelated; }
.face__name {
  display: block; height: var(--face-name); padding: 0 4px; overflow: hidden;
  color: var(--qevr-muted); font-size: 9.5px; line-height: var(--face-name);
  letter-spacing: .1em; text-align: center;
  text-overflow: ellipsis; white-space: nowrap;
}
.face[aria-pressed="true"] { outline: 2px solid var(--brand); outline-offset: -2px; }
.face[aria-pressed="true"] .face__name { background: var(--brand); color: var(--qevr-ink); font-weight: 700; }
.face:hover, .face:focus-visible { outline: 2px solid var(--qevr-light); outline-offset: -2px; }
.face:hover .face__name, .face:focus-visible .face__name { background: var(--qevr-light); color: var(--qevr-ink); }

/* ---------- the center cell: his playground ---------- */

.plate {
  position: absolute; z-index: 3;
  top: var(--band-h); bottom: var(--band-h);
  left: var(--band-w); right: var(--band-w);
  min-width: 0; min-height: 0; overflow: hidden;
  border: var(--rule) solid var(--qevr-hair); background: var(--qevr-ink);
  display: flex; align-items: center; justify-content: center;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(12px, 2vh, 24px) clamp(16px, 2.5vw, 40px);
}
.stage__art { display: grid; place-items: center; min-width: 0; min-height: 0; flex: none; }

.plate__panel { display: flex; flex-direction: column; gap: clamp(12px, 2vh, 20px); min-width: 0; width: min(46%, 380px); }
.stage__name {
  color: var(--brand); font-weight: 700;
  font-size: clamp(22px, 2.6vw, 36px); letter-spacing: .04em; line-height: 1.08;
  word-break: break-word;
}

/* two pairs up top, the action pair full-width below: six chips across a
   46%-wide panel squeezed SE MEXE onto two lines (walk finding, 2026-08-27) */
.stage__controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.stage__controls .ctlrow:last-child { grid-column: 1 / -1; }
.ctlrow { display: flex; width: 100%; }
.stage__controls .ctl { min-width: 0; min-height: 44px; padding: 9px 8px; white-space: nowrap; }

.stage__meta {
  padding-top: 8px;
  color: var(--qevr-muted); font-size: 9px; line-height: 1.4; letter-spacing: .1em;
}
.stage__meta-title { display: block; color: var(--brand); font-weight: 700; letter-spacing: .2em; margin-bottom: 3px; }

/* Round 2 preview: this room has one destination-language action. Dock it in
   a reserved header slot so the old hanging switch cannot cover a face chip. */
html.is-next .bar__nav { margin-right: 44px; }
html.is-next .frame { overflow: hidden; }
html.is-next .switches {
  top: env(safe-area-inset-top, 0px);
  height: calc(var(--bar) - env(safe-area-inset-top, 0px));
  padding: 0; flex-direction: row; z-index: var(--z-header);
}
html.is-next .switches button {
  width: 44px; height: 100%; min-height: 44px; padding: 0;
  border-top: 0; border-bottom: 0;
}

@media (min-width: 721px) and (max-width: 1072px) {
  .stage__controls { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- phone: two swipeable strips, the playground between them,
     and the page itself never scrolls ---------- */

@media (max-width: 720px) {
  .studio { height: 100svh; overflow: hidden; }
  .frame { display: flex; flex-direction: column; height: 100%; }
  .lane { display: none; }

  .strip {
    display: flex; gap: var(--chip-gap); flex: none;
    height: var(--strip-h);
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .strip::-webkit-scrollbar { display: none; }
  .strip .face { flex: none; width: var(--chip-w); height: 100%; }
  .strip--bottom {
    height: calc(var(--strip-h) + env(safe-area-inset-bottom, 0px));
  }
  .strip--bottom .face {
    grid-template-rows: minmax(0, 1fr) calc(var(--face-name) + env(safe-area-inset-bottom, 0px));
  }
  .strip--bottom .face__name {
    height: calc(var(--face-name) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .plate {
    position: static; flex: 1 1 auto; min-height: 0;
    flex-direction: column; gap: 8px; padding: 10px 16px 12px;
    margin: var(--chip-gap) 0;
  }
  .plate__panel { width: 100%; align-items: center; text-align: center; gap: 8px; }
  .stage__name { font-size: clamp(19px, 6vw, 26px); margin-top: 2px; }
  .stage__controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; width: 100%; }
  .stage__controls .ctlrow:last-child { grid-column: 1 / -1; }
  .stage__controls .ctl { padding: 7px 4px; font-size: 8.5px; }
  .stage__meta { width: 100%; padding-top: 6px; font-size: 7.5px; letter-spacing: .06em; text-align: center; }
}

@media (max-height: 719px) and (min-width: 721px) {
  .plate { padding-block: 8px; }
  .stage__name { font-size: 24px; }
  .stage__controls .ctl { padding-block: 8px; }
}

/* ---------- seventh voice: galeria additions ---------- */

/* long labels wrap instead of cutting the joke */
.face__name {
  white-space: normal; text-overflow: clip;
  font-size: 8.5px; line-height: 10px;
  display: flex; align-items: center; justify-content: center;
}

/* the stage name is drawn in his own cells, so it glitches with him */
.stage__name canvas { display: block; image-rendering: pixelated; max-width: 100%; }

/* the hung face credits its maker: a name, never a number */
.stage__credit { color: var(--qevr-light); font-weight: 700; font-size: clamp(13px, 1.4vw, 18px); letter-spacing: .06em; }
.stage__credit small { display: block; color: var(--qevr-muted); font-weight: 400; font-size: 9px; letter-spacing: .18em; margin-top: 3px; }
.stage__credit:empty { display: none; }

@media (min-width: 2200px) {
  .plate__panel { width: min(42%, 720px); }
  .stage__controls .ctl { font-size: 14px; min-height: 56px; }
}
