/* ============================================================================
   INTEGRAÇÃO — Lamplight UI aplicada ao motor do jogo.
   Carrega DEPOIS de hidden-hearts.css. Cola o design hh-* na engine:
   troca de telas (.screen/.active), ambiente dos menus, sistema de
   personagens da cena (herdado do estilo antigo), caixa de diálogo com
   escolhas, e as telas que o mock não cobria (age gate, configurações,
   histórico, lightbox) repintadas na mesma identidade âmbar.
   ============================================================================ */

/* ---------- reset + base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; overflow: hidden;
  background: var(--hh-bg); color: var(--hh-text);
  font-family: var(--hh-sans); -webkit-font-smoothing: antialiased;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--hh-amber);
  outline-offset: 3px;
}

/* Base acessível também para tablets e telas híbridas com toque. */
.screen button, .overlay button, .lightbox button { min-width: 44px; min-height: 44px; }

/* ---------- troca de telas (mecânica da engine: .screen.active) ---------- */
.screen { display: none; position: absolute; inset: 0; z-index: 1; }
.screen.active { display: flex; }

/* ---------- fundo ambiente dos menus (camada fixa por trás de tudo) --------
   A tela de jogo pinta seu próprio cenário opaco por cima, então este backdrop
   só aparece nos menus (título, seleção, saves, galeria, age gate, modais). */
.hh-backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--hh-bg); }
.hh-title-backdrop {
  position: absolute; inset: -18px; z-index: 0;
  background-position: center; background-size: cover;
  opacity: 0; transform: scale(1.025);
  filter: blur(8px) brightness(.42) saturate(1.08);
  transition: opacity 1.15s ease, transform 1.8s ease;
  will-change: opacity, transform;
}
.hh-title-backdrop.is-active { opacity: 1; transform: scale(1.01); }
.hh-title-backdrop[data-char-id="maya"] { filter: blur(8px) brightness(.78) saturate(1.08); }
body.no-anim .hh-title-backdrop { transition-duration: .01ms; }

/* ============================================================================
   TELA DE JOGO — o palco preenche a janela inteira (sem letterbox 16:9 do mock)
   ============================================================================ */
#screen-game { padding: 0; }
#screen-game .hh-stage {
  width: 100%; height: 100%; max-height: none; aspect-ratio: auto; margin: 0;
}

/* Fundo em DUAS camadas (crossfade + zoom leve) — mecânica original preservada.
   IDs #bg-a/#bg-b e a classe .bg-layer continuam controlados pela engine. */
.bg-layer {
  position: absolute; inset: 0; z-index: 0; opacity: 0;
  background-size: cover;
  background-position: var(--bg-position, 50% 50%);
  background-color: #12100c;
  filter: blur(1px) brightness(.71) saturate(1.05);
  transition: opacity .6s ease, transform .9s ease, background-position .45s ease;
  transform: scale(var(--bg-zoom, 1));
}
.bg-layer.on   { opacity: 1; }
.bg-layer.zoom { transform: scale(calc(var(--bg-zoom, 1) + .06)); }
.bg-layer.empty{ background-color: #12100c; }

/* vídeo de cena */
.scene-video {
  display: none; position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1; background: #000;
}

/* Cena íntima (engine liga .is-intimate quando node.nsfw): "fade to black"
   literário — o cenário afunda na penumbra sob a narração. Sem mídia, é o quarto
   no escuro; quando existir .scene-video, o vídeo entra por cima contido pela
   mesma penumbra. Nunca é uma tela preta vazia (o texto e o quarto seguem lá). */
/* !important: o `.bg-layer` traz um filter próprio e uma transição de filter; sem
   o !important o valor da penumbra não vence a resolução do filtro na camada
   compositada. Como é um override deliberado do "modo cena", é o lugar certo. */
.hh-stage.is-intimate {
  --hh-intimate-frame-x: clamp(18px, 4.2vw, 88px);
  --hh-intimate-frame-top: clamp(76px, 10.5vh, 112px);
  --hh-intimate-frame-bottom: 5.4%;
}
.hh-stage.is-intimate .bg-layer { filter: blur(3px) brightness(.26) saturate(.9) !important; }
.hh-stage.is-intimate .scene-video {
  top: var(--hh-intimate-frame-top); right: auto; bottom: auto; left: 50%;
  width: auto;
  height: calc(100% - var(--hh-intimate-frame-top) - var(--hh-intimate-frame-bottom));
  max-width: calc(100% - var(--hh-intimate-frame-x) - var(--hh-intimate-frame-x));
  transform: translateX(-50%);
  object-fit: contain;
  background: #050403;
  border: 1px solid var(--hh-line-strong);
  border-radius: var(--hh-radius);
  box-shadow: 0 22px 64px rgba(0,0,0,.48), inset 0 0 0 1px rgba(240,200,150,.06);
  filter: brightness(.94) contrast(1.02) saturate(1.02);
}
.hh-stage.is-intimate .hh-spot { opacity: .3; }
.hh-stage.is-intimate .hh-motes { opacity: .5; }
.hh-motes { opacity: .32; }

/* ---------- PERSONAGENS NA CENA (sistema herdado do motor: 3 camadas) --------
   .sprite-slot = posição/entrada/saída · .sprite-breathe = respiração
   · .sprite-bob = balanço da fala. A engine depende destas classes tal e qual. */
.sprites { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.sprite-slot {
  position: absolute; bottom: 0; opacity: 1; transform: translate(-50%, 0);
  transition: opacity .45s ease, transform .45s ease, left .5s ease, filter .35s ease;
}
.sprite-slot.pos-left   { left: 24%; --enter-dx: -60px; --enter-dy: 0px; }
.sprite-slot.pos-center { left: 50%; --enter-dx: 0px;   --enter-dy: 18px; }
.sprite-slot.pos-right  { left: 76%; --enter-dx: 60px;  --enter-dy: 0px; }
.sprite-slot.enter-from,
.sprite-slot.exiting { opacity: 0; transform: translate(calc(-50% + var(--enter-dx)), var(--enter-dy)); }
.sprite-slot.dim { filter: brightness(.58) saturate(.85); }
.sprite-slot img {
  display: block; max-height: 88vh; max-width: 46vw; object-fit: contain;
  filter: drop-shadow(0 26px 34px rgba(0,0,0,.5)); transition: opacity .17s ease;
}
.sprite-slot img.swap { opacity: 0; }
.sprite-breathe { transform-origin: bottom center; animation: breathe 4.2s ease-in-out infinite; }
.sprite-bob { transform-origin: bottom center; }
.sprite-bob.talking { animation: talkbob .52s cubic-bezier(.28,.84,.42,1) 1; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
@keyframes talkbob { 0%{transform:scaleY(1);} 28%{transform:scaleY(1.04);} 55%{transform:scaleY(.99);} 78%{transform:scaleY(1.015);} 100%{transform:scaleY(1);} }

/* Movimento desligado (⚙ Settings → body.no-anim) */
body.no-anim .sprite-breathe,
body.no-anim .sprite-bob.talking,
body.no-anim .hh-dialog__adv.ready,
body.no-anim .hh-bond.changed .hh-bond__dot,
body.no-anim .hh-bg,
body.no-anim .hh-mote,
body.no-anim .hh-spot { animation: none; }
body.no-anim .bg-layer,
body.no-anim .sprite-slot,
body.no-anim .hh-card__inner,
body.no-anim .hh-bond__feedback,
body.no-anim .sprite-slot img { transition-duration: .01ms; }

/* ---------------------------------------------------------------------------
   MOVIMENTO REDUZIDO — preferência do sistema operacional.
   O toggle do ⚙ é uma escolha dentro do jogo; isto aqui é a preferência que a
   pessoa já declarou no sistema, e ela vale por padrão. Quem quiser as
   animações mesmo assim pode religá-las no ⚙ (body.force-anim vence).
   Cobre o que de fato incomoda: respiração contínua dos sprites, poeira
   flutuando, o zoom do crossfade e o pulso do vínculo.
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  body:not(.force-anim) .sprite-breathe,
  body:not(.force-anim) .sprite-bob.talking,
  body:not(.force-anim) .hh-dialog__adv.ready,
  body:not(.force-anim) .hh-dialog__adv.show,
  body:not(.force-anim) .hh-bond.changed .hh-bond__dot,
  body:not(.force-anim) .hh-bg,
  body:not(.force-anim) .hh-mote,
  body:not(.force-anim) .hh-sprite--stack img,
  body:not(.force-anim) .hh-spot { animation: none !important; }
  body:not(.force-anim) .bg-layer,
  body:not(.force-anim) .sprite-slot,
  body:not(.force-anim) .sprite-slot img,
  body:not(.force-anim) .hh-card__inner,
  body:not(.force-anim) .hh-bond__feedback,
  body:not(.force-anim) .hh-id__panel { transition-duration: .01ms !important; }
  /* o zoom lento do fundo é o efeito mais reportado como enjoativo */
  body:not(.force-anim) .bg-layer.zoom { transform: scale(var(--bg-zoom, 1)) !important; }
  /* a cartela ainda aparece — ela informa; só deixa de deslizar */
  body:not(.force-anim) .hh-card { transition-duration: .15s !important; }
}

/* ---------- HUD: linha de identidade + badge 18+ ---------- */
.hh-id__row { display: flex; align-items: center; gap: 9px; }
.hh-nsfw {
  display: none; font-family: var(--hh-cond); font-size: 10px; letter-spacing: .14em;
  color: var(--hh-danger); border: 1px solid var(--hh-danger-line);
  padding: 1px 7px; border-radius: 999px; background: transparent; cursor: help;
}
.hh-nsfw.on { display: inline-block; }
.hh-scene-mode {
  display: none; font-family: var(--hh-cond); font-size: 9px; letter-spacing: .13em;
  color: #c9b9e8; border: 1px solid rgba(201,185,232,.48);
  padding: 1px 7px; border-radius: 999px;
}
.hh-scene-mode.on { display: inline-block; }

/* Cutaway e sonho são estados narrativos, não filtros de conteúdo. O rótulo
   declara a mudança de câmera; a luz apenas a torna legível sem competir com o texto. */
.hh-stage.pov-aria .hh-id__mark { box-shadow: 0 0 0 1px rgba(181,101,118,.45), 0 0 22px rgba(181,101,118,.2); }
.hh-stage.is-dream .hh-vignette { opacity: .72; }
.hh-stage.is-dream .hh-spot { opacity: .55; filter: hue-rotate(22deg); }
.hh-stage.is-intimate.is-dream .bg-layer { filter: blur(4px) brightness(.3) saturate(.72) hue-rotate(12deg) !important; }

/* Estado "ligado" de Auto e Hide UI (a engine alterna .on) */
.hh-controls button.on { color: var(--hh-amber); }

/* modo "só a cena" (Hide UI): some com HUD e caixa; o palco vira área de clique
   para trazer tudo de volta (engine: setUiHidden → .ui-hidden no #game-stage) */
.hh-controls, .hh-id, .hh-nav, .hh-dialog { transition: opacity .25s ease, visibility 0s; }
.hh-stage.ui-hidden .hh-controls,
.hh-stage.ui-hidden .hh-id,
.hh-stage.ui-hidden .hh-nav,
.hh-stage.ui-hidden .hh-dialog {
  opacity: 0; visibility: hidden; pointer-events: none; transition-delay: 0s, .25s;
}
.hh-stage.ui-hidden { cursor: pointer; }

/* o ponto ao lado do nome segue a cor de quem fala (a engine seta a cor no #speaker) */
.hh-dialog__speaker i { background: currentColor; }

/* chip "Continue" some quando não há save recente */
.hh-resume[hidden] { display: none; }

/* ---------- CAIXA DE DIÁLOGO: narração, escolhas, avançar ---------- */
.hh-dialog { z-index: 6; }
.hh-dialog__speaker.is-hidden { display: none; }
/* narração: sem nome, itálico, fio de luz neutro */
.hh-dialog.narration::before { background: linear-gradient(90deg, transparent, rgba(240,200,150,.30), transparent); }
.hh-dialog.narration .hh-dialog__text { font-style: italic; color: var(--hh-text); }
.hh-dialog__text { min-height: 1.7em; white-space: pre-wrap; }
/* clicar na caixa avança quando há próxima cena (a engine liga .advanceable) */
.hh-dialog.advanceable { cursor: pointer; }

/* a "seta" de avançar só aparece quando há continuação e o texto terminou */
.hh-dialog__adv { opacity: 0; animation: none; transition: opacity .2s ease; }
.hh-dialog__adv.show  { opacity: .8; }
.hh-dialog__adv.ready { opacity: 1; animation: hh-advNudge 1.9s ease-in-out infinite; }

/* escolhas e botões de fim de rota, no lugar do #actions */
.hh-dialog__actions { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.hh-dialog__actions:empty { margin-top: 0; }

/* ADULT_VIDEO_TEXTLESS:START
   Vídeos 18+ explícitos ocupam o palco sem descrição superficial por cima.
   Nós lineares avançam ao clicar no palco; quando há decisão, somente os
   botões permanecem, sem a moldura de diálogo. */
.hh-stage.is-adult-video-only { cursor: pointer; }
.hh-stage.is-adult-video-only .hh-dialog { display: none; }
.hh-stage.is-adult-video-choice .hh-dialog {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.hh-stage.is-adult-video-choice .hh-dialog::before,
.hh-stage.is-adult-video-choice .hh-dialog__speaker,
.hh-stage.is-adult-video-choice .hh-dialog__text,
.hh-stage.is-adult-video-choice .hh-dialog__adv { display: none; }
.hh-stage.is-adult-video-choice .hh-dialog__actions { margin-top: 0; }
/* ADULT_VIDEO_TEXTLESS:END */
.hh-choice {
  text-align: left; cursor: pointer; font-family: var(--hh-serif); font-weight: 600;
  font-size: 17px; line-height: 1.3; color: var(--hh-text);
  background: rgba(20,14,9,.42); border: 1px solid var(--hh-line-strong);
  border-radius: var(--hh-radius-sm); padding: 12px 16px;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.hh-choice:hover { border-color: var(--hh-amber); color: var(--hh-amber); background: rgba(30,20,12,.6); }
.hh-choice.is-selected, .hh-choice.is-selected:hover {
  border-color: var(--hh-amber); color: var(--hh-amber);
  background: rgba(181,101,118,.18); transform: translateX(3px);
}
.hh-choice__text { display: block; }
.hh-choice__prediction {
  display: flex; align-items: center; gap: 7px; margin-bottom: 5px;
  font-family: var(--hh-cond); font-size: 9px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: #75d9dc;
}
.hh-choice__prediction::before {
  content: ""; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%;
  background: #75d9dc; box-shadow: 0 0 9px rgba(117,217,220,.8);
}
.hh-choice--predicted { border-color: rgba(117,217,220,.48); }
.hh-choice--predicted:hover { border-color: #75d9dc; }
.hh-choice__requirement { display: block; margin-top: 4px; font-family: var(--hh-cond); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--hh-text-faint); }
/* Preço da escolha, derivado do `resourceOps` (ver `choiceCostLabel`). Mesmo
   registro da linha de exigência: é informação de contrato, não prosa. Quando o
   saldo não cobre, muda de cor E de texto — a dívida nunca é só uma cor. */
.hh-choice__cost {
  display: block; margin-top: 4px;
  font-family: var(--hh-cond); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--hh-text-faint);
}
.hh-choice__cost.is-debt { color: rgba(226, 150, 138, .95); }
/* Compromisso contrafactual da alternativa: declara o que muda se ela for
   escolhida, sem mostrar flags, pontos ou afirmar que um risco vai acontecer. */
.hh-choice__commitment {
  display: block; margin-top: 8px; padding-top: 7px;
  border-top: 1px solid rgba(232, 197, 142, .16);
  font-family: var(--hh-cond); font-size: clamp(12px, .65vw, 14px); font-weight: 400;
  line-height: 1.48; letter-spacing: .025em; color: var(--hh-text-mut);
}
.hh-choice__commitment::before {
  content: "IF CHOSEN"; display: block; margin-bottom: 3px;
  font-size: clamp(9px, .5vw, 10px); font-weight: 700; line-height: 1.2;
  letter-spacing: .16em; color: var(--hh-text-faint);
}
.hh-choice--locked, .hh-choice--locked:hover, .hh-choice[aria-disabled="true"] {
  cursor: not-allowed; color: var(--hh-text-mut); border-color: var(--hh-line);
  background: transparent; opacity: .72;
}
.hh-advance {
  align-self: flex-end; cursor: pointer; font-family: var(--hh-cond);
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  color: #1a1109; background: var(--hh-amber); border: 1px solid transparent;
  border-radius: var(--hh-radius-sm); padding: 10px 20px;
}
.hh-advance:hover { filter: brightness(1.06); }

/* ============================================================================
   LAYOUT DAS TELAS DE MENU  (cabeçalho fixo + área que rola)
   ============================================================================ */
.hh-screen { position: absolute; inset: 0; display: flex; flex-direction: column; }
.hh-screen__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 5% 44px; display: flex; }
.hh-screen__scroll > * { margin: auto; width: 100%; }

/* grid genérico volta ao fluxo normal (o mock usava posição absoluta) */
.hh-screen__scroll .hh-grid { position: static; inset: auto; max-width: 1120px; margin: 0 auto; width: 100%; }
.hh-grid--3    { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.hh-grid--auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* cabeçalho: bloco à direita (só os botões — as contagens moram na coluna do
   título, em .hh-head__stats). Antes elas dividiam a aside com os botões e
   eram as primeiras a quebrar linha em tela estreita. */
.hh-head__aside { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px 14px; }
.hh-head__count { font-family: var(--hh-cond); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--hh-text-mut); }
/* Linha de progresso da tela, embaixo do título: uma leitura só, em vez de
   fichas soltas competindo com os botões. O ponto separador é do CSS, então
   uma contagem oculta (`hidden`) não deixa pontuação órfã. */
.hh-head__stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 7px; }
.hh-head__stats > .hh-head__count + .hh-head__count::before {
  content: "·"; margin-right: 12px; color: var(--hh-text-faint);
}
.hh-head__stats > .hh-head__count[hidden] { display: none; }

/* ---------- changelog: conteúdo estático em duas trilhas ---------- */
.hh-changelog {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px;
  width: 100%; max-width: 1120px; margin: 0 auto;
}
/* (Aqui havia um degradê de 145px no topo do changelog, para mascarar o texto
   que passava por baixo do cabeçalho flutuante. Com a barra no fluxo não passa
   nada por baixo dela — o degradê só escureceria o começo do conteúdo.) */
.hh-changelog__about {
  grid-column: 1 / -1; padding: 26px 28px;
  background: linear-gradient(120deg, rgba(45,29,18,.82), rgba(20,14,9,.68));
  border: 1px solid var(--hh-line); border-radius: var(--hh-radius);
  box-shadow: var(--hh-shadow-panel);
}
.hh-changelog__section {
  min-width: 0; padding: 24px;
  background: rgba(20,14,9,.62); border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius); box-shadow: var(--hh-shadow-panel);
}
.hh-changelog__heading { display: flex; align-items: center; gap: 10px; padding-bottom: 17px; border-bottom: 1px solid var(--hh-line); }
.hh-changelog__heading h2 {
  margin: 0; font-family: var(--hh-serif); font-size: 25px; color: var(--hh-text-hi);
}
.hh-changelog__mark { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.hh-changelog__mark--about { background: var(--hh-text-hi); box-shadow: 0 0 10px rgba(239,230,216,.35); }
.hh-changelog__mark--released { background: var(--hh-amber); box-shadow: 0 0 10px rgba(240,199,141,.55); }
.hh-changelog__mark--planned { border: 1px solid var(--hh-amber); }
.hh-changelog__about-copy {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
  padding-top: 18px;
}
.hh-changelog__about-copy p {
  margin: 0; color: var(--hh-text); font-size: 15px; line-height: 1.72;
}
.hh-changelog__about-copy p + p { padding-left: 24px; border-left: 1px solid var(--hh-line); }
.hh-changelog__list { display: grid; gap: 16px; padding-top: 18px; }
.hh-changelog__entry { padding: 18px; background: rgba(239,230,216,.035); border: 1px solid rgba(240,200,150,.14); border-radius: var(--hh-radius-sm); }
.hh-changelog__meta { display: flex; align-items: center; gap: 10px; min-height: 17px; }
.hh-changelog__version {
  font-family: var(--hh-cond); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--hh-amber);
}
.hh-changelog__date {
  font-family: var(--hh-cond); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--hh-text-mut);
}
.hh-changelog__version + .hh-changelog__date::before { content: "·"; margin-right: 10px; }
.hh-changelog__title { margin: 7px 0 0; font-family: var(--hh-serif); font-size: 20px; color: var(--hh-text-hi); }
.hh-changelog__changes { margin: 12px 0 0; padding-left: 19px; color: var(--hh-text); line-height: 1.65; }
.hh-changelog__changes li + li { margin-top: 7px; }
.hh-changelog__empty {
  margin: 0; padding: 24px 18px; text-align: center; font-family: var(--hh-serif);
  font-style: italic; color: var(--hh-text-mut); border: 1px dashed rgba(240,200,150,.18);
  border-radius: var(--hh-radius-sm);
}

/* ---------- changelog: as duas caixas ficam travadas e rolam por dentro ------
   Antes, um texto comprido em Released ou em Coming Next esticava a caixa e
   quem rolava era a TELA inteira: o About e os dois títulos subiam junto e o
   leitor perdia a referência de qual coluna está lendo.

   Agora a tela não rola. O About fica no topo, com a altura que pedir, as duas
   caixas dividem o que sobra da janela, e a rolagem mora na LISTA de dentro de
   cada uma — o cabeçalho ("Released" / "Coming Next") fica parado no lugar. */
#screen-changelog .hh-changelog {
  /* Altura DEFINIDA (e não `min-height`): sem isso a linha `1fr` seria medida
     pelo conteúdo, e a caixa voltaria a crescer com o texto. */
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
}
#screen-changelog .hh-changelog__section {
  min-height: 300px;            /* piso: sobram ~200px de lista depois do cabeçalho */
  display: flex; flex-direction: column;
  overflow: hidden;             /* a barra é da lista, e não da caixa: a borda arredondada fica limpa */
}
#screen-changelog .hh-changelog__heading { flex: none; }
#screen-changelog .hh-changelog__list {
  flex: 1; min-height: 0; overflow-y: auto;
  /* respiro para a barra não encostar no texto das entradas */
  padding-right: 12px; scrollbar-gutter: stable;
}

/* Em tela estreita a grade já vira uma coluna só (§RESPONSIVO): travar altura
   ali daria três caixinhas. Volta a rolar a página inteira. O mesmo vale para
   janela baixa, onde a altura que sobraria para cada caixa não dá duas linhas. */
@media (max-width: 720px), (max-height: 620px) {
  /* `height: auto` é o item que faz a volta funcionar. Com a altura ainda
     definida em 100%, as três linhas empilhadas eram espremidas para caber nela
     e o texto de cada caixa vazava por cima da caixa seguinte. */
  #screen-changelog .hh-changelog { height: auto; grid-template-rows: none; align-content: start; }
  #screen-changelog .hh-changelog__section { min-height: 0; overflow: visible; display: block; }
  #screen-changelog .hh-changelog__list { overflow: visible; padding-right: 0; }
}

/* ---------- cartão de personagem (seleção): arte + descrição + tags + % ---------- */
button.hh-char,
button.hh-roster {
  appearance: none;
  width: 100%;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
}
button.hh-char:hover,
button.hh-char:focus-visible,
button.hh-roster:hover,
button.hh-roster:focus-visible {
  border-color: var(--hh-amber);
}
.hh-char__art { height: 210px; flex: none; }
.hh-char { min-height: 380px; }

/* ---------- roster da galeria: proporção fixa ---------- */
.hh-roster { aspect-ratio: 4 / 5; }

/* ---------- cenas da galeria: proporção fixa ---------- */
.hh-grid--scenes { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.hh-scene { aspect-ratio: 4 / 3; }

/* ---------- SAVES: 4 slots em grade + banner de status ---------- */
.hh-grid--slots { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.hh-slot { min-height: 230px; }
.saves-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 1120px; margin: 0 auto 18px; width: 100%;
  background: var(--hh-panel-soft); border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius); padding: 13px 18px;
  font-size: 13.5px; line-height: 1.55; color: var(--hh-text-mut);
}
.saves-banner span { flex: 1; min-width: 240px; }
.saves-banner .btn { flex: none; margin-left: auto; }
.saves-file { display: flex; gap: 10px; }

/* ============================================================================
   BOTÕES GENÉRICOS (.btn*) repintados em âmbar — usados no age gate e modais
   ============================================================================ */
.btn {
  font-family: var(--hh-cond); font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer; border: 1px solid transparent; border-radius: var(--hh-radius-sm);
  padding: 11px 20px; color: var(--hh-text); background: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, filter .15s ease;
}
.btn-primary { background: var(--hh-amber); border-color: transparent; color: #1a1109; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-outline { border-color: var(--hh-line-strong); }
.btn-outline:hover { border-color: var(--hh-amber); color: var(--hh-amber); }
.btn-ghost { color: var(--hh-text-mut); }
.btn-ghost:hover { color: var(--hh-text); }
.btn-back { border: 1px solid var(--hh-line-strong); padding: 8px 15px; }
.btn-back:hover { border-color: var(--hh-amber); color: var(--hh-amber); }
.btn-danger:hover:not(:disabled) { border-color: var(--hh-danger-line); color: var(--hh-danger); }
.btn:disabled { opacity: .32; cursor: not-allowed; }

/* ============================================================================
   AGE GATE — repintado na identidade âmbar
   ============================================================================ */
#screen-age { align-items: center; justify-content: center; padding: 24px; }
.age-box {
  max-width: 460px; text-align: center; padding: 46px 38px;
  background: var(--hh-panel); border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius); box-shadow: var(--hh-shadow-panel); position: relative;
}
.age-box::before { content: ""; position: absolute; top: 0; left: 30px; right: 30px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(240,199,141,.85), transparent); }
.age-box .eyebrow { font-family: var(--hh-cond); font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: rgba(240,200,150,.7); margin-bottom: 14px; }
.age-box .logo { font-family: var(--hh-display); font-weight: 800; font-size: 2.4rem; color: var(--hh-text-hi); margin-bottom: 18px; }
.age-warn { color: var(--hh-text-mut); line-height: 1.7; margin-bottom: 28px; font-size: .95rem; }
.age-buttons { display: flex; flex-direction: column; gap: 10px; }
.exit-msg { display: flex; align-items: center; justify-content: center; height: 100vh; color: var(--hh-text-mut); text-align: center; padding: 24px; }

/* ============================================================================
   MODAIS (Configurações / Histórico) e LIGHTBOX — repintados
   ============================================================================ */
.overlay { display: none; position: fixed; inset: 0; z-index: 45; background: rgba(12,8,5,.82);
  align-items: center; justify-content: center; padding: 24px; }
.overlay.open { display: flex; }
.overlay-box {
  background: var(--hh-panel); border: 1px solid var(--hh-line); border-radius: var(--hh-radius);
  width: min(620px, 100%); max-height: 84vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--hh-shadow-panel);
}

/* Avisos de conteúdo são uma camada do jogo, não falas do narrador. O cartão
   mantém a mesma paleta e tipografia, mas troca a caixa horizontal de diálogo
   por um painel vertical, central e deliberadamente editorial. */
.hh-content-modal {
  z-index: 52;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 38%, rgba(181,101,118,.16), transparent 42%),
    rgba(8,6,5,.88);
  backdrop-filter: blur(8px);
}
.hh-content-card {
  position: relative;
  width: min(560px, 100%);
  overflow: hidden;
  padding: 42px 44px 34px;
  border: 1px solid rgba(240,199,141,.3);
  border-radius: calc(var(--hh-radius) + 4px);
  background:
    linear-gradient(145deg, rgba(255,255,255,.025), transparent 38%),
    var(--hh-panel);
  box-shadow: 0 26px 80px rgba(0,0,0,.58), inset 0 1px rgba(255,255,255,.025);
  text-align: center;
}
.hh-content-card::before,
.hh-content-card::after {
  content: "";
  position: absolute;
  top: 22px;
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240,199,141,.42));
}
.hh-content-card::before { left: 20px; }
.hh-content-card::after { right: 20px; transform: scaleX(-1); }
.hh-content-card__topline {
  position: absolute;
  inset: 0 18% auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--hh-amber), transparent);
  box-shadow: 0 0 20px rgba(240,199,141,.32);
}
.hh-content-card__mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 20px;
  border: 1px solid rgba(240,199,141,.48);
  border-radius: 50%;
  color: var(--hh-amber);
  font-family: var(--hh-display);
  font-size: 1.25rem;
  letter-spacing: .04em;
  box-shadow: inset 0 0 0 5px rgba(240,199,141,.035), 0 0 28px rgba(181,101,118,.12);
}
.hh-content-card__kicker {
  margin: 0 0 10px;
  color: var(--hh-amber);
  font-family: var(--hh-cond);
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.hh-content-card h2 {
  margin: 0;
  color: var(--hh-text-hi);
  font-family: var(--hh-display);
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  font-weight: 500;
  line-height: 1.12;
}
.hh-content-card__copy {
  max-width: 440px;
  margin: 18px auto 0;
  color: var(--hh-text);
  font-size: .96rem;
  line-height: 1.72;
  white-space: pre-line;
}
.hh-content-card__actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 28px;
}
.hh-content-action {
  min-height: 48px;
  padding: 11px 16px;
  border: 1px solid rgba(240,199,141,.5);
  border-radius: 8px;
  background: rgba(240,199,141,.1);
  color: var(--hh-text-hi);
  font-family: var(--hh-cond);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.hh-content-action:hover,
.hh-content-action:focus-visible {
  border-color: var(--hh-amber);
  background: rgba(240,199,141,.18);
  transform: translateY(-1px);
}
.hh-content-action--quiet {
  border-color: var(--hh-line);
  background: transparent;
  color: var(--hh-text);
}
.hh-content-card__foot {
  min-height: 1em;
  margin: 16px 0 0;
  color: var(--hh-text-faint);
  font-size: 11px;
  line-height: 1.5;
}
.overlay-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--hh-line); }
.overlay-head h2 { font-family: var(--hh-display); font-weight: 600; font-size: 1.2rem; color: var(--hh-text-hi); margin-right: auto; }
.overlay-box--checkpoints { width: min(720px, 100%); }
#checkpoint-modal .overlay-head > div:first-child { min-width: 0; margin-right: auto; }
.hh-checkpoint__kicker {
  margin-bottom: 4px; font-family: var(--hh-cond); font-size: 10px; line-height: 1;
  letter-spacing: .2em; text-transform: uppercase; color: var(--hh-amber);
}
.hh-checkpoint__route { margin-top: 5px; color: var(--hh-text-mut); font-size: 12px; line-height: 1.35; }
.hh-checkpoint-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  padding: 18px 22px 22px; overflow-y: auto;
}
.hh-checkpoint {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 78px; padding: 13px 14px; text-align: left; cursor: pointer;
  color: var(--hh-text); background: rgba(240,199,141,.045);
  border: 1px solid rgba(240,199,141,.17); border-radius: var(--hh-radius-sm);
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.hh-checkpoint:hover {
  color: var(--hh-text-hi); background: rgba(240,199,141,.1);
  border-color: rgba(240,199,141,.42); transform: translateY(-1px);
}
.hh-checkpoint:focus-visible { outline: 2px solid var(--hh-amber); outline-offset: 2px; }
.hh-checkpoint:disabled { cursor: default; opacity: 1; transform: none; }
.hh-checkpoint.is-current { background: rgba(240,199,141,.1); border-color: var(--hh-amber); }
.hh-checkpoint__number {
  font-family: var(--hh-display); font-size: 22px; color: rgba(240,199,141,.62);
}
.hh-checkpoint__body { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.hh-checkpoint__title {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--hh-display); font-size: 15px; font-weight: 600; color: var(--hh-text-hi);
}
.hh-checkpoint__meta {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; color: var(--hh-text-mut);
}
.hh-checkpoint__status {
  font-family: var(--hh-cond); font-size: 9px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--hh-amber);
}
.set-group { padding: 22px; overflow-y: auto; }
#settings-modal .overlay-box { overflow-y: auto; }
#settings-modal .overlay-head { position: sticky; top: 0; z-index: 2; background: var(--hh-bg); }
#settings-modal .set-group { flex: none; overflow: visible; }
.set-group h3 { font-family: var(--hh-cond); font-size: 12px; text-transform: uppercase; letter-spacing: .18em; color: var(--hh-amber); margin-bottom: 14px; }
.set-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.set-preset { padding: 7px 13px; font-size: 11px; }
.set-preset.on { border-color: var(--hh-amber); color: var(--hh-amber); background: rgba(240,199,141,.12); }
#speed-slider, #auto-slider, #music-slider, #sfx-slider { width: 100%; accent-color: var(--hh-amber-2); cursor: pointer; }
#speed-slider:disabled { opacity: .35; cursor: not-allowed; }
.set-range-label { display: flex; justify-content: space-between; gap: 16px; margin: 18px 0 8px; font-family: var(--hh-cond); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--hh-text-mut); }
.set-range-label span { color: var(--hh-text); }
.set-scale { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--hh-text-mut); margin: 8px 0 20px; }
.set-scale #speed-value { color: var(--hh-text); }
.set-check { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; line-height: 1.5; cursor: pointer; }
.set-check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--hh-amber-2); flex: none; }
.set-hint { color: var(--hh-text-mut); font-size: 12.5px; line-height: 1.6; margin-top: 16px; }

/* ---- Apagar todo o progresso -------------------------------------------------
   A seção destrutiva fica visualmente à parte do resto das configurações (linha
   avermelhada em cima) para ninguém tropeçar nela procurando o volume. O título
   segue o âmbar de todas as outras seções — quem avisa do perigo é a linha
   vermelha e o botão, não o cabeçalho. */
.set-group--danger { border-top: 1px solid var(--hh-danger-line); }

#reset-modal .overlay-box { border-color: var(--hh-danger-line); }
#reset-modal .overlay-head h2 { color: var(--hh-danger); }
.reset-lead { line-height: 1.7; font-size: .95rem; color: var(--hh-text); }
.reset-lead b { color: var(--hh-danger); }
.reset-list {
  list-style: none; margin: 18px 0 0; padding: 16px 18px;
  background: rgba(200,96,74,.07); border: 1px solid var(--hh-danger-line);
  border-radius: var(--hh-radius-sm);
  display: flex; flex-direction: column; gap: 9px;
  font-size: .9rem; line-height: 1.5; color: var(--hh-text-mut);
}
.reset-list li { position: relative; padding-left: 18px; }
.reset-list li::before { content: "✕"; position: absolute; left: 0; top: 0; font-size: 11px; color: var(--hh-danger); }
.reset-ack { margin-top: 20px; }
.reset-ack input { accent-color: var(--hh-danger); }
.reset-actions { margin-top: 18px; }
.btn-danger--solid { border-color: var(--hh-danger-line); color: var(--hh-danger); }
.btn-danger--solid:hover:not(:disabled) { background: rgba(200,96,74,.18); }

/* ---- Desbloquear a galeria com código ---------------------------------------
   O campo consulta o Worker; nenhum segredo ou atalho de dono vem no jogo. */
.code-form { display: flex; gap: 10px; margin-top: 18px; }
.code-input {
  flex: 1; min-width: 0; padding: 12px 16px;
  font-family: var(--hh-cond); font-size: 16px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--hh-text-hi); background: rgba(20,14,9,.55);
  border: 1px solid var(--hh-line-strong); border-radius: var(--hh-radius-sm);
}
.code-input::placeholder { letter-spacing: .18em; color: var(--hh-text-faint); }
.code-input:focus { outline: none; border-color: var(--hh-amber); background: rgba(30,20,12,.7); }
.code-input:disabled { opacity: .65; cursor: wait; }
.code-form .btn { flex: none; padding: 12px 22px; }
.code-form[aria-busy="true"] .btn { cursor: wait; }
.code-msg { min-height: 20px; margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--hh-text-mut); }
.code-msg--ok { color: var(--hh-amber); }
.code-msg--bad { color: var(--hh-danger); }

.log-list { padding: 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.log-item { border-left: 2px solid var(--hh-line-strong); padding-left: 14px; }
.log-item.narration { border-left-color: transparent; }
.log-name { font-family: var(--hh-serif); font-weight: 600; font-size: 1rem; margin-bottom: 4px; color: var(--hh-amber); }
.log-text { line-height: 1.65; font-size: .95rem; white-space: pre-wrap; color: var(--hh-text); }
.log-item.narration .log-text { font-style: italic; color: var(--hh-text-mut); }
.log-item.choice { border-left-color: var(--hh-amber); background: rgba(181,101,118,.08); padding: 10px 12px 10px 14px; border-radius: 0 8px 8px 0; }
.log-item.observation { border-left-color: #75d9dc; background: rgba(97,199,201,.08); padding: 10px 12px 10px 14px; border-radius: 0 8px 8px 0; }
.log-item.observation .log-choice-label { color: #75d9dc; }
.log-item.observation .log-text { font-family: var(--hh-serif); font-style: italic; color: var(--hh-text); }
.log-choice-label { margin-bottom: 4px; font-family: var(--hh-cond); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--hh-amber); }
.log-item.choice .log-text { font-family: var(--hh-serif); font-weight: 600; }
.log-empty { color: var(--hh-text-mut); }

/* Household terminal: a financial object that belongs to the game's world,
   with a strong cash hierarchy and a chapter-based transaction timeline. */
.overlay-box--statement {
  position: relative; width: min(980px, 100%); max-height: min(88vh, 820px);
  overflow: hidden; border-color: rgba(117, 217, 220, .25);
  background:
    radial-gradient(circle at 16% 4%, rgba(117, 217, 220, .08), transparent 30%),
    linear-gradient(145deg, rgba(39, 17, 23, .98), rgba(18, 13, 11, .99) 58%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .62), inset 0 0 0 1px rgba(240, 199, 141, .04);
}
.overlay-box--statement::before {
  content: ""; position: absolute; inset: 0 12% auto; z-index: 2; height: 2px;
  background: linear-gradient(90deg, transparent, #75d9dc 36%, var(--hh-amber) 72%, transparent);
}
.hh-statement__head { flex: 0 0 auto; background: rgba(13, 9, 8, .48); }
.hh-statement__head .btn-back { margin-left: auto; }
.hh-statement__head p { margin: 4px 0 0; font-size: 11px; color: var(--hh-text-faint); }
.hh-statement__kicker, .hh-statement__eyebrow {
  display: block; font-family: var(--hh-cond); font-size: 9px;
  letter-spacing: .2em; text-transform: uppercase; color: #75d9dc;
}
.hh-statement__kicker { margin-bottom: 4px; }
.hh-statement__terminal {
  display: grid; grid-template-columns: minmax(270px, .82fr) minmax(390px, 1.35fr);
  flex: 1 1 auto; min-height: 0; overflow: hidden;
}
.hh-statement__summary {
  display: flex; flex-direction: column; gap: 13px; min-width: 0; padding: 24px;
  border-right: 1px solid rgba(240, 199, 141, .12);
  background: linear-gradient(180deg, rgba(85, 24, 40, .22), rgba(12, 10, 9, .2));
}
.hh-statement__cash {
  position: relative; min-height: 190px; padding: 24px 22px 20px; overflow: hidden;
  border: 1px solid rgba(240, 199, 141, .3); border-radius: 11px;
  background:
    linear-gradient(130deg, rgba(181, 101, 118, .15), transparent 48%),
    rgba(16, 12, 10, .72);
  box-shadow: inset 0 0 34px rgba(0, 0, 0, .28);
}
.hh-statement__cash::after {
  content: ""; position: absolute; right: -32px; bottom: -55px; width: 150px; height: 150px;
  border: 1px solid rgba(117, 217, 220, .15); border-radius: 50%; box-shadow: 0 0 0 18px rgba(117, 217, 220, .025);
}
.hh-statement__cash::before {
  content: ""; position: absolute; top: 50%; right: 22px; z-index: 1; transform: translateY(-50%);
  width: 43px; height: 31px; border: 1px solid rgba(240, 199, 141, .72); border-radius: 7px;
  background:
    linear-gradient(90deg, transparent 30%, rgba(56, 36, 20, .65) 31% 33%, transparent 34% 66%, rgba(56, 36, 20, .65) 67% 69%, transparent 70%),
    linear-gradient(transparent 43%, rgba(56, 36, 20, .65) 44% 47%, transparent 48%),
    linear-gradient(135deg, #d5ac6d, #f0c78d 46%, #aa7541);
  box-shadow: inset 0 0 0 2px rgba(255, 232, 186, .12), 0 4px 12px rgba(0, 0, 0, .25);
}
.hh-statement__cash-label { display: block; margin-top: 18px; font-family: var(--hh-serif); font-size: 15px; color: var(--hh-text-mut); }
.hh-statement__cash-value {
  display: block; margin-top: 2px; font-family: var(--hh-cond); font-size: clamp(38px, 4.6vw, 57px);
  font-weight: 500; letter-spacing: -.035em; line-height: 1; color: var(--hh-text-hi);
}
.hh-statement__available {
  position: absolute; left: 22px; bottom: 18px; font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--hh-text-faint);
}
.hh-statement__available::before {
  content: ""; display: inline-block; width: 18px; height: 1px; margin: 0 8px 3px 0; background: #75d9dc;
}
.hh-statement__accounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hh-statement__account {
  min-width: 0; padding: 14px 15px; border: 1px solid rgba(117, 217, 220, .2);
  border-radius: 9px; background: rgba(17, 14, 12, .72);
}
.hh-statement__account.is-debt { border-color: rgba(226, 150, 138, .22); }
.hh-statement__account span, .hh-statement__flow-values span {
  display: block; overflow: hidden; font-family: var(--hh-cond); font-size: 8px;
  letter-spacing: .13em; text-transform: uppercase; text-overflow: ellipsis; white-space: nowrap; color: var(--hh-text-faint);
}
.hh-statement__account b { display: block; margin-top: 5px; font-family: var(--hh-cond); font-size: 18px; font-weight: 500; color: #75d9dc; }
.hh-statement__account.is-debt b { color: rgba(226, 150, 138, .98); }
.hh-statement__flow {
  margin-top: auto; padding: 16px 17px 14px; border-top: 1px solid rgba(240, 199, 141, .22);
  border-bottom: 1px solid rgba(240, 199, 141, .1); background: rgba(7, 6, 5, .24);
}
.hh-statement__flow .hh-statement__eyebrow { color: var(--hh-amber); }
.hh-statement__flow-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 13px; }
.hh-statement__flow-values b { display: block; margin-top: 4px; font-family: var(--hh-cond); font-size: 17px; font-weight: 500; color: #75d9dc; }
.hh-statement__flow-values .is-outgoing b { color: rgba(226, 150, 138, .98); }
.hh-statement__net { margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--hh-line); font-size: 10px; color: var(--hh-text-mut); text-align: right; }
.hh-statement__timeline { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: rgba(11, 9, 8, .46); }
.hh-statement__timeline-head {
  display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto;
  padding: 19px 24px 14px; border-bottom: 1px solid var(--hh-line);
}
.hh-statement__timeline-head h3 { margin: 0; font-family: var(--hh-serif); font-size: 17px; font-weight: 500; color: var(--hh-text-hi); }
.hh-statement__timeline-head span { font-family: var(--hh-cond); font-size: 8px; letter-spacing: .14em; text-transform: uppercase; color: var(--hh-text-faint); }
.hh-statement__timeline-head i { display: inline-block; width: 5px; height: 5px; margin: 0 6px 1px 0; border-radius: 50%; background: #75d9dc; box-shadow: 0 0 8px rgba(117, 217, 220, .75); }
.hh-statement__list { flex: 1 1 auto; min-height: 0; padding: 0 24px 18px; overflow-y: auto; }
.hh-statement__chapter { position: relative; padding-top: 17px; }
.hh-statement__chapter-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; padding-left: 18px; }
.hh-statement__chapter-head span { font-family: var(--hh-cond); font-size: 8px; letter-spacing: .16em; text-transform: uppercase; color: var(--hh-amber); }
.hh-statement__chapter-head b { overflow: hidden; font-family: var(--hh-serif); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; color: var(--hh-text-mut); }
.hh-statement__event {
  position: relative; display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 0 13px;
  padding: 11px 4px 11px 14px; border-radius: 7px; outline: none; transition: background .18s ease;
}
.hh-statement__event::before { content: ""; position: absolute; left: 18px; top: 0; bottom: 0; width: 1px; background: rgba(240, 199, 141, .14); }
.hh-statement__event:hover, .hh-statement__event:focus-visible { background: rgba(181, 101, 118, .08); }
.hh-statement__event-dot { position: relative; z-index: 1; width: 7px; height: 7px; margin-top: 15px; border: 2px solid #75d9dc; border-radius: 50%; background: #17100f; }
.hh-statement__event-body { min-width: 0; }
.hh-statement__meta { font-family: var(--hh-cond); font-size: 8px; letter-spacing: .14em; text-transform: uppercase; color: var(--hh-text-faint); }
.hh-statement__memo { margin-top: 3px; overflow: hidden; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; color: var(--hh-text); }
.hh-statement__amount { align-self: center; padding-left: 10px; font-family: var(--hh-cond); font-size: 15px; font-weight: 600; color: #75d9dc; white-space: nowrap; }
.hh-statement__amount.is-negative { color: rgba(226, 150, 138, .98); }
.hh-statement__event-after { max-height: 0; margin-top: 0; overflow: hidden; font-size: 9px; opacity: 0; color: var(--hh-text-faint); transition: max-height .18s ease, margin .18s ease, opacity .18s ease; }
.hh-statement__event:hover .hh-statement__event-after, .hh-statement__event:focus-visible .hh-statement__event-after { max-height: 18px; margin-top: 3px; opacity: 1; }
.hh-statement__closing {
  display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto;
  padding: 15px 24px; border-top: 1px solid rgba(117, 217, 220, .18);
  background: linear-gradient(90deg, rgba(117, 217, 220, .06), rgba(240, 199, 141, .04));
}
.hh-statement__closing span { font-family: var(--hh-cond); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--hh-text-faint); }
.hh-statement__closing b { font-family: var(--hh-cond); font-size: 20px; font-weight: 500; color: var(--hh-text-hi); }
.hh-statement__empty { margin: 24px 0; padding: 38px 24px; border: 1px dashed var(--hh-line); border-radius: 8px; color: var(--hh-text-mut); line-height: 1.6; text-align: center; }

.lightbox { display: none; position: fixed; inset: 0; z-index: 50; background: rgba(10,7,4,.94);
  flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 30px; }
.lightbox.open { display: flex; }
.lightbox-media img, .lightbox-media video {
  max-width: min(92vw, 1100px); max-height: 78vh; border-radius: 10px; border: 1px solid var(--hh-line-strong); display: block;
}
/* Lembrança de texto: quando a cena ainda não tem mídia, a galeria mostra a
   própria narração da cena, apresentada como página de um livro. */
.lightbox-scene {
  max-width: min(88vw, 60ch); padding: 34px 30px; text-align: center;
  border: 1px solid var(--hh-line-strong); border-radius: 12px;
  background: linear-gradient(180deg, rgba(30,22,15,.5), rgba(18,13,9,.5));
}
.lightbox-scene__chap {
  font-family: var(--hh-cond); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--hh-amber); margin-bottom: 16px;
}
.lightbox-scene__text {
  font-family: var(--hh-serif); font-style: italic; font-size: 1.28rem; line-height: 1.7;
  color: var(--hh-text); margin: 0;
}
.lightbox-caption { color: var(--hh-text); font-family: var(--hh-serif); font-size: 1.1rem; text-align: center; }
.lightbox-close {
  position: absolute; top: 18px; right: 22px; cursor: pointer;
  background: none; border: 1px solid var(--hh-line-strong); color: var(--hh-text);
  border-radius: var(--hh-radius-sm); padding: 9px 16px; font-size: 12px; letter-spacing: .14em;
  font-family: var(--hh-cond); text-transform: uppercase;
}
.lightbox-close:hover { border-color: var(--hh-amber); color: var(--hh-amber); }

/* ---------- encerramento de rota ---------- */
#screen-ending { align-items: center; justify-content: center; overflow-y: auto; padding: 36px 5%; }
.hh-ending {
  position: relative; width: min(1060px, 100%); margin: auto; padding: 38px;
  border: 1px solid var(--hh-line); border-radius: var(--hh-radius);
  background: var(--hh-panel); box-shadow: var(--hh-shadow-panel); text-align: center;
}
.hh-ending::before { content: ""; position: absolute; top: 0; left: 12%; right: 12%; height: 2px; background: linear-gradient(90deg, transparent, var(--hh-amber), transparent); }
.hh-ending__eyebrow { font-family: var(--hh-cond); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--hh-amber); }
.hh-ending__title { margin: 8px 0 12px; font-family: var(--hh-display); font-size: clamp(38px, 5vw, 66px); line-height: 1; color: var(--hh-text-hi); }
.hh-ending__summary { max-width: 62ch; margin: 0 auto; font-family: var(--hh-serif); font-size: 19px; line-height: 1.65; color: var(--hh-text); }
.hh-ending__stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 24px; margin-top: 18px; font-family: var(--hh-cond); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--hh-text-mut); }
.hh-ending__rule { width: 120px; height: 1px; margin: 25px auto 20px; background: var(--hh-line-strong); }
.hh-ending__collection-title { font-family: var(--hh-cond); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--hh-text-mut); }
.hh-ending__cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 13px; text-align: left; }
.hh-ending-card { position: relative; min-height: 150px; padding: 16px; border: 1px solid var(--hh-line); border-radius: var(--hh-radius-sm); background: var(--hh-panel-soft); }
.hh-ending-card.is-current { border-color: var(--hh-amber); }
.hh-ending-card.is-locked { opacity: .68; }
.hh-ending-card__route { font-family: var(--hh-cond); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--hh-amber); }
.hh-ending-card__title { margin: 8px 0 7px; font-family: var(--hh-serif); font-size: 20px; color: var(--hh-text-hi); }
.hh-ending-card__summary { font-size: 11.5px; line-height: 1.5; color: var(--hh-text-mut); }
.hh-ending-card__current { position: absolute; right: 10px; bottom: 9px; font-family: var(--hh-cond); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--hh-amber); }
.hh-ending__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hh-ending__hint { margin-top: 13px; font-size: 11.5px; color: var(--hh-text-faint); }

/* ---------- toast do jogo ---------- */
.game-toast {
  position: fixed; top: 74px; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: var(--hh-amber); color: #1a1109; padding: 10px 18px; border-radius: 999px;
  font-family: var(--hh-cond); font-weight: 600; letter-spacing: .06em; font-size: 13px;
  opacity: 0; transition: opacity .3s ease, transform .3s ease; pointer-events: none; z-index: 60;
}
.game-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- modelo comportamental da Maya ---------- */
.hh-maya-model[hidden] { display: none; }
.hh-maya-model { width: min(340px, calc(100vw - 48px)); margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(117,217,220,.2); }
.hh-maya-model__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-family: var(--hh-cond); font-size: 10.5px; line-height: 1.35; letter-spacing: .14em; text-transform: uppercase; color: #75d9dc; }
.hh-maya-model__head b { min-width: 20px; text-align: right; font-weight: 600; }
.hh-maya-model__list { display: grid; gap: 9px; margin-top: 11px; }
.hh-maya-model__entry, .hh-maya-model__empty { margin: 0; padding-left: 11px; border-left: 2px solid rgba(117,217,220,.5); font-family: var(--hh-serif); font-size: clamp(13px, 1vw, 15px); line-height: 1.5; color: var(--hh-text); }
.hh-maya-model__entry.is-guarded { border-left-color: rgba(220,184,126,.62); }
.hh-maya-model__entry.is-alert { border-left-color: rgba(210,133,132,.72); }
.hh-maya-model__entry.is-neutral, .hh-maya-model__empty { border-left-color: rgba(210,210,205,.32); color: var(--hh-text-mut); }
.hh-maya-model__hint { margin: 11px 0 0; font-family: var(--hh-cond); font-size: 9.5px; line-height: 1.4; letter-spacing: .1em; text-transform: uppercase; color: var(--hh-text-faint); }

.maya-observation {
  position: fixed; top: 126px; left: 50%; z-index: 59;
  width: min(480px, calc(100vw - 32px)); padding: 13px 16px 14px 18px;
  transform: translate(-50%, -10px); opacity: 0; visibility: hidden;
  pointer-events: none; border: 1px solid rgba(117,217,220,.48);
  border-left-width: 3px; border-radius: var(--hh-radius-sm);
  background: linear-gradient(135deg, rgba(11,27,28,.96), rgba(15,15,14,.96));
  box-shadow: 0 14px 38px rgba(0,0,0,.42), 0 0 24px rgba(97,199,201,.09);
  transition: opacity .26s ease, transform .26s ease, visibility 0s linear .26s;
}
.maya-observation.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.maya-observation--guarded { border-color: rgba(220,184,126,.62); }
.maya-observation--alert { border-color: rgba(210,133,132,.72); }
.maya-observation--neutral { border-color: rgba(210,210,205,.42); }
.maya-observation__label { display: block; margin-bottom: 5px; font-family: var(--hh-cond); font-size: 9px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: #75d9dc; }
.maya-observation--guarded .maya-observation__label { color: #dcb87e; }
.maya-observation--alert .maya-observation__label { color: #d28584; }
.maya-observation--neutral .maya-observation__label { color: var(--hh-text-mut); }
.maya-observation p { margin: 0; font-family: var(--hh-serif); font-size: 14px; line-height: 1.45; color: var(--hh-text-hi); }

/* ============================================================================
   RESPONSIVO
   ============================================================================ */
@media (max-width: 720px) {
  .hh-id.is-open { z-index: 30; }
  .hh-title-logo__1, .hh-title-logo__2 { font-size: 15vw; }
  .hh-controls { gap: 10px; font-size: 12px; }
  .hh-head__title { font-size: 28px; }
  .hh-head { padding: 26px 4% 14px; }
  .hh-screen__scroll { padding: 22px 4% 32px; }
  .hh-changelog { grid-template-columns: 1fr; gap: 18px; }
  .hh-changelog__about { padding: 20px; }
  .hh-changelog__about-copy { grid-template-columns: 1fr; gap: 15px; }
  .hh-changelog__about-copy p + p { padding: 15px 0 0; border-left: 0; border-top: 1px solid var(--hh-line); }
  .hh-changelog__section { padding: 20px; }
  .hh-dialog { width: 92%; padding: 18px 20px 16px; }
  .hh-dialog__text { font-size: 16px; }
}

/* ============================================================================
   REFINO v2 — aproximação do design de referência
   ============================================================================ */

/* ---------- MENU PRINCIPAL: distribuição vertical simétrica + escala ---------
   Coluna esquerda com space-evenly: o espaço do topo, entre título e régua,
   entre régua e menu, e até a base ficam todos IGUAIS. A régua fica exatamente
   no meio entre o título e os botões. Tudo escala com a resolução via clamp. */
.hh-title-col {
  position: absolute; left: 5.7%; top: 0; bottom: 0; z-index: 6;
  width: min(54%, 760px);
  display: flex; flex-direction: column; justify-content: space-evenly; align-items: flex-start;
  pointer-events: none;
}
.hh-title-col > * { pointer-events: auto; }
/* devolve ao fluxo o que o base posicionava de forma absoluta */
.hh-title-col .hh-title-logo,
.hh-title-col .hh-title-rule,
.hh-title-col .hh-menu { position: static; left: auto; top: auto; margin: 0; }

.hh-title-logo__kicker { font-size: clamp(11px, 1vw, 15px); letter-spacing: .42em; margin-bottom: clamp(8px, 1vw, 14px); }
.hh-title-logo__1, .hh-title-logo__2 { font-size: clamp(46px, 8vw, 104px); }
.hh-title-rule { width: clamp(92px, 12vw, 168px); }
.hh-menu { gap: clamp(9px, 1.2vw, 18px); }
.hh-menu__item { align-items: baseline; }
.hh-menu__n { font-size: clamp(10px, 1vw, 13px); width: clamp(18px, 2vw, 28px); }
.hh-menu__label { font-size: clamp(20px, 2.5vw, 34px); }

/* chip Resume mais alto, para não encostar no título */
.hh-resume { top: 3%; }
.hh-title-credit {
  position: absolute; left: 5.7%; bottom: 2.6%; z-index: 6;
  font-family: var(--hh-cond); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: rgba(239,230,216,.4);
}

/* ---------- VITRINE de personagens no título (fade rotativo) ---------- */
.hh-title-cast { position: absolute; right: 0; top: 0; bottom: 0; z-index: 5; width: 60%; overflow: hidden; pointer-events: none; }
.hh-sprite--stack { position: absolute; inset: 0; width: 100%; height: 100%; }
.hh-sprite--stack img {
  position: absolute; right: 8%; bottom: 0; left: auto; top: auto; transform: none;
  height: 94%; width: auto; max-width: 70%;
  object-fit: contain; object-position: bottom center;
  opacity: 0; transition: opacity 1.4s ease;
  filter: drop-shadow(0 26px 40px rgba(0,0,0,.55));
}
.hh-sprite--stack img.is-active { opacity: 1; }
body.no-anim .hh-sprite--stack img { transition-duration: .01ms; }

/* ---------- CHARACTER SELECT: cards grandes, até 3 por linha, largura cheia --- */
.hh-head__sub { font-family: var(--hh-serif); font-style: italic; font-size: clamp(14px,1.3vw,18px); color: var(--hh-text-mut); margin-top: 5px; }
.hh-grid--chars {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px; max-width: 1240px;
}
.hh-char { min-height: 500px; }
.hh-char__art { height: clamp(220px, 20vw, 300px); }
.hh-char__name { font-size: clamp(24px, 2vw, 30px); }
.hh-char__desc { font-size: 13px; }
/* personagem futura: "coming soon" sem cadeado */
.hh-char--soon { cursor: default; }
.hh-char--soon .hh-char__art { filter: grayscale(.35) brightness(.5); }
.hh-char--soon .hh-char__name, .hh-char--soon .hh-char__desc { color: var(--hh-text-mut); }
.hh-badge--soon { background: rgba(20,14,9,.72); color: var(--hh-amber); border: 1px solid var(--hh-line-strong); }
.hh-progress__locked { margin-top: auto; font-family: var(--hh-cond); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--hh-text-faint); }

/* Placeholders de personagens futuros preservam a ficha dos cards existentes;
   os valores desconhecidos aparecem como "?" sem antecipar conteúdo. */
.hh-char--future .hh-char__art { filter: none; background: var(--accent); }
.hh-char--future .hh-char__art img {
  opacity: .82; mix-blend-mode: luminosity;
}

/* ---------- GALLERY: até 4 por linha, cards maiores, afinidade ---------- */
.hh-grid--gallery {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px; max-width: 1400px;
}
.hh-roster { aspect-ratio: 3 / 4; }
.hh-roster__body h3 { font-size: clamp(22px, 1.7vw, 28px); }

/* barra de progresso em corações (preenchimento contínuo) + número */
.hh-affline { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.hh-heartbar { position: relative; display: inline-block; line-height: 1; font-size: 16px; letter-spacing: 3px; }
.hh-heartbar__base, .hh-heartbar__fill { white-space: nowrap; }
.hh-heartbar__base { color: rgba(239,230,216,.18); }
.hh-heartbar__fill { position: absolute; left: 0; top: 0; overflow: hidden; width: var(--pct, 0%); color: var(--hh-amber); }
.hh-affline__num { font-family: var(--hh-cond); font-size: 12px; letter-spacing: .1em; color: rgba(240,199,141,.9); }

/* ---------- SAVES: 6 slots, 3 por linha, cards maiores ---------- */
.hh-grid--slots { grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 1320px; }
.hh-slot { min-height: 300px; }
.hh-slot__thumb { height: 152px; }
.hh-slot__title { font-size: 21px; }
.hh-slot__body { padding: 15px 17px 16px; }
.hh-btn { font-size: 12px; padding: 9px 16px; }
.hh-iconbtn { width: 38px; height: 37px; font-size: 15px; }
@media (max-width: 980px) { .hh-grid--slots { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .hh-grid--slots { grid-template-columns: 1fr; } }

/* ---------- BARRA DE ROLAGEM no estilo da interface ---------- */
.hh-screen__scroll, .set-group, .log-list, .hh-statement__list, .hh-changelog__list { scrollbar-width: thin; scrollbar-color: rgba(240,199,141,.55) transparent; }
.hh-screen__scroll { scrollbar-gutter: stable both-edges; }
.hh-screen__scroll::-webkit-scrollbar, .set-group::-webkit-scrollbar, .log-list::-webkit-scrollbar, .hh-statement__list::-webkit-scrollbar, .hh-changelog__list::-webkit-scrollbar { width: 11px; }
.hh-screen__scroll::-webkit-scrollbar-track, .set-group::-webkit-scrollbar-track, .log-list::-webkit-scrollbar-track, .hh-statement__list::-webkit-scrollbar-track, .hh-changelog__list::-webkit-scrollbar-track { background: rgba(20,14,9,.35); border-radius: 999px; }
.hh-screen__scroll::-webkit-scrollbar-thumb, .set-group::-webkit-scrollbar-thumb, .log-list::-webkit-scrollbar-thumb, .hh-statement__list::-webkit-scrollbar-thumb, .hh-changelog__list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--hh-amber), var(--hh-amber-2));
  border-radius: 999px; border: 2px solid rgba(20,14,9,.35);
}
.hh-screen__scroll::-webkit-scrollbar-thumb:hover { background: var(--hh-amber); }

/* ---------- GAMEPLAY: botões e caixa de diálogo um pouco maiores ---------- */
.hh-controls { font-size: clamp(13px, 1.05vw, 16px); gap: 18px; }
.hh-nav button { width: 40px; height: 40px; font-size: 18px; }
.hh-dialog { width: min(960px, 88%); padding: 26px 34px 24px; }
.hh-dialog__text { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.72; padding-bottom: 30px; }
.hh-dialog__speaker { font-size: clamp(22px, 1.8vw, 28px); }
.hh-choice { font-size: clamp(16px, 1.3vw, 19px); padding: 14px 18px; }
.hh-advance { font-size: 14px; padding: 12px 24px; }

/* ---------- botão Continue: respiração sutil (idle), como os sprites ---------- */
@keyframes hh-advBreathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.hh-dialog__adv.show  { opacity: .85; animation: hh-advBreathe 2.8s ease-in-out infinite; }
.hh-dialog__adv.ready { opacity: 1;   animation: hh-advBreathe 2.6s ease-in-out infinite; }
body.no-anim .hh-dialog__adv.show, body.no-anim .hh-dialog__adv.ready { animation: none; }

/* ---------- RESPONSIVO extra ---------- */
@media (max-width: 720px) {
  .hh-title-col { width: 88%; }
  .hh-grid--chars, .hh-grid--gallery { grid-template-columns: 1fr; }
}

/* ============================================================================
   REFINO v3 — tamanhos dos cards + vitrine do título (feedback + prints)
   ============================================================================ */

/* Telas de menu: conteúdo alinhado ao TOPO, logo abaixo do cabeçalho, e rola
   (com barra vertical) quando não couber — em vez de centralizar na vertical.
   A barra do topo é uma faixa de verdade: fundo próprio, filete embaixo e o
   respiro dela mora no seu PADDING (não num deslocamento que o conteúdo tinha
   de compensar). */
.hh-head {
  /* Respiro IGUAL em cima e embaixo. O 40/17 de antes era herança do tempo em
     que a barra flutuava com `top: 44px` — como faixa, isso jogava o texto para
     baixo e o colava no filete. */
  padding: 22px 5%;
  border-bottom: 1px solid var(--hh-line);
  background: linear-gradient(180deg, rgba(20,14,9,.95) 58%, rgba(20,14,9,.78));
  backdrop-filter: blur(7px);
}
.hh-screen__scroll { display: block; padding: 26px 5% 52px; }
.hh-screen__scroll > * { margin: 0 auto; width: 100%; }
/* cards alinhados à ESQUERDA, na mesma reta do começo do título (não centralizados).
   As CENAS da galeria pessoal ficam de fora: elas continuam centralizadas. */
.hh-screen__scroll .hh-grid--chars { margin-left: auto; margin-right: auto; }
.hh-screen__scroll .hh-grid--gallery { margin-left: 0; margin-right: auto; }

/* ---------- CHARACTER SELECT: cards no tamanho do print (3 colunas fixas) ----
   Aria e Noir ocupam as 2 primeiras colunas; a 3ª fica livre (como no print).
   O prefixo .hh-screen__scroll vence a regra genérica de max-width dos grids. */
.hh-screen__scroll .hh-grid--chars {
  grid-template-columns: repeat(3, 1fr);
  gap: 22px; max-width: 1040px;
}
@media (min-width: 1180px) {
  .hh-screen__scroll .hh-grid--chars {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px; max-width: 1600px;
  }
}
.hh-char { min-height: 500px; height: auto; }
.hh-char__art { height: 248px; }
.hh-char__name { font-size: 26px; }
.hh-char__desc { font-size: 12.5px; }

/* ---------- GALLERY (lista de personagens): 3 por linha, proporção do print --- */
.hh-screen__scroll .hh-grid--gallery {
  grid-template-columns: repeat(3, 1fr);
  gap: 22px; max-width: 1040px;
}
.hh-roster { aspect-ratio: 3 / 4; }
.hh-roster__body h3 { font-size: 23px; }

/* ---------- GALLERY pessoal (cenas): 4 por linha, cenas maiores, com rolagem -- */
.hh-screen__scroll .hh-grid--scenes {
  grid-template-columns: repeat(4, 1fr);
  gap: 18px; max-width: 1280px;
}
.hh-scene { aspect-ratio: 4 / 3; }
.hh-scene figcaption { font-size: 15px; }

/* Créditos no rodapé da galeria: acompanham a largura e o alinhamento do grid
   de cada tela (personagens à esquerda, cenas centralizadas). O seletor tem o
   prefixo .hh-screen__scroll para vencer a regra genérica `> * { margin:0 auto }`. */
/* Os finais acompanham a mesma coluna do grid de cenas. O grid de dentro de
   cada bloco já herda `.hh-screen__scroll .hh-grid--scenes` (4 por linha), mas
   sem margem automática: ali ele preenche o bloco inteiro. */
.hh-screen__scroll .hh-endings { max-width: 1280px; margin: 40px auto 0; }
.hh-screen__scroll .hh-endblock__grid { max-width: none; margin: 15px 0 0; }

.hh-screen__scroll .hh-credits { margin: 36px auto 0; }
.hh-screen__scroll #gallery-credits { max-width: 1040px; margin-left: 0; margin-right: auto; }
.hh-screen__scroll #gallery-char-credits { max-width: 1280px; }

/* ---------- VITRINE DO TÍTULO: central, grande e RESPIRANDO (como no jogo) ----
   ENQUADRAMENTO: cada arte foi cortada pela ilustradora num nível diferente — a
   Noir gótica é um plano da coxa para cima, a Maya e os cosplays são corpo
   inteiro. Encaixar o PNG na caixa (`object-fit: contain`) normalizava a TELA do
   arquivo, não a PERSONAGEM: quem vinha de corpo inteiro aparecia pequena.

   Agora a caixa dá só a ALTURA de referência (`height:100%; width:auto` — o
   width nunca manda, então o resultado independe da proporção da janela), e o
   enquadramento de cada arte vem de duas variáveis que o engine escreve a
   partir de ART_FRAMING (ver engine.js):
     --hh-fit-s  escala uniforme (não distorce: é a mesma nos dois eixos), tirada
                 da medida olho→queixo para todas ficarem com a MESMA cabeça;
     --hh-fit-y  deslocamento vertical que alinha a LINHA DOS OLHOS de todas
                 elas à da Noir gótica, deixando cabelo/chapéu sobrar por cima.
   Sem as variáveis o <img> cai no comportamento antigo (escala 1, sem desvio).
   As mesmas duas variáveis enquadram o retrato do card de personagem, com outro
   alvo de cabeça — a caixa do card é baixa e larga. */
.hh-title-cast { position: absolute; left: 0; right: 0; top: 0; bottom: 0; width: 100%; z-index: 5; overflow: hidden; pointer-events: none; }
.hh-sprite--stack { position: absolute; left: 56%; top: auto; bottom: 0; transform: translateX(-50%); width: 46%; height: 86%; }
.hh-sprite--stack img {
  position: absolute; left: 50%; right: auto; top: 0; bottom: auto;
  height: 100%; width: auto; max-width: none;
  object-fit: contain;   /* com width:auto a caixa já tem a proporção do PNG: nunca deforma */
  opacity: 0; transition: opacity 1.4s ease;
  transform-origin: top center;   /* a cabeça fica firme; a respiração cresce para baixo */
  transform: translate(-50%, var(--hh-fit-y, 0%)) scale(var(--hh-fit-s, 1));
  animation: title-breathe 4.2s ease-in-out infinite;   /* mesma respiração dos sprites do jogo */
  filter: drop-shadow(0 26px 40px rgba(0,0,0,.55));
}
@keyframes title-breathe {
  0%, 100% { transform: translate(-50%, var(--hh-fit-y, 0%)) scale(var(--hh-fit-s, 1)); }
  50%      { transform: translate(-50%, var(--hh-fit-y, 0%)) scale(calc(var(--hh-fit-s, 1) * 1.02)); }
}
.hh-sprite--stack img.is-active { opacity: 1; }
body.no-anim .hh-sprite--stack img { animation: none; transition-duration: .01ms; }

/* responsivo dos grids */
@media (max-width: 900px) {
  .hh-screen__scroll .hh-grid--chars,
  .hh-screen__scroll .hh-grid--gallery { grid-template-columns: repeat(2, 1fr); }
  .hh-grid--scenes { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 620px) {
  .hh-screen__scroll .hh-grid--chars,
  .hh-screen__scroll .hh-grid--gallery { grid-template-columns: 1fr; }
  .hh-grid--scenes { grid-template-columns: repeat(2, 1fr); }
  .hh-title-cast { opacity: .4; }
}

/* ============================================================================
   MOBILE RETRATO — composição própria, sem miniaturizar o palco desktop
   ============================================================================ */
@media (max-width: 720px) and (orientation: portrait) {
  html, body { width: 100%; height: 100%; min-height: 100dvh; overflow: hidden; }
  #screen-game .hh-stage { width: 100%; height: 100dvh; min-height: 100dvh; }
  .screen button, .overlay button, .lightbox button { min-width: 44px; min-height: 44px; }
  .hh-stage.is-intimate {
    --hh-intimate-frame-x: 10px;
    --hh-intimate-frame-top: calc(max(10px, env(safe-area-inset-top)) + 148px);
    --hh-intimate-frame-bottom: 0px;
  }
  .hh-stage.is-intimate .scene-video {
    width: calc(100% - var(--hh-intimate-frame-x) - var(--hh-intimate-frame-x));
    height: auto;
    max-width: none;
  }

  .hh-id {
    top: max(10px, env(safe-area-inset-top)); left: 50%; right: auto;
    width: calc(100% - 24px); transform: translateX(-50%);
    align-items: flex-start; justify-content: center; gap: 9px;
  }
  .hh-id__body { position: static; min-width: 0; text-align: center; }
  .hh-id__row, .hh-bond, .hh-id__stats { justify-content: center; }
  .hh-id__mark { width: 34px; height: 34px; font-size: 15px; }
  .hh-id__name { font-size: 18px; }
  .hh-id__ch { max-width: calc(100vw - 86px); margin: 4px auto 0; font-size: 9.5px; letter-spacing: .13em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hh-bond { font-size: 8px; letter-spacing: .14em; margin-top: 4px; }
  .hh-id__panel {
    left: 50%; width: min(350px, calc(100vw - 24px)); min-width: 0; padding: 14px 15px 15px;
    text-align: left; transform: translate(-50%, -4px);
  }
  .hh-id:hover .hh-id__panel, .hh-id:focus-within .hh-id__panel, .hh-id.is-open .hh-id__panel { transform: translateX(-50%); }
  .hh-id__panel-row { font-size: 11px; }

  .hh-controls {
    top: calc(max(10px, env(safe-area-inset-top)) + 92px); left: 10px; right: 10px;
    justify-content: flex-end; flex-wrap: nowrap; gap: 4px;
    font-size: 10px; letter-spacing: .08em;
  }
  .hh-controls__sep { display: none; }
  .hh-controls button { min-width: 44px; min-height: 44px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; }
  .hh-controls .hh-hideui { min-width: 58px; }
  .hh-hideui { gap: 4px; }
  .hh-hideui__icon { width: 14px; height: 10px; }

  .hh-dialog {
    left: 0; right: 0; bottom: 0; transform: none;
    width: 100%; max-height: 54dvh; overflow-y: auto;
    border-radius: var(--hh-radius) var(--hh-radius) 0 0;
    padding: 18px 18px calc(17px + env(safe-area-inset-bottom));
  }
  .hh-dialog::before { left: 18px; right: 18px; }
  .hh-dialog__speaker { margin-bottom: 7px; font-size: 21px; }
  .hh-dialog__text { min-height: auto; padding-bottom: 25px; font-size: 17px; line-height: 1.62; }
  .hh-dialog__actions { gap: 8px; margin-top: 11px; }
  .hh-choice { min-height: 48px; padding: 12px 14px; font-size: 16px; line-height: 1.35; }
  .hh-choice__commitment { margin-top: 7px; padding-top: 6px; font-size: 10.5px; line-height: 1.42; }
  body:has(.hh-maya-model:not([hidden])) .hh-choice__commitment { font-size: 12px; line-height: 1.5; }
  .hh-advance { min-height: 44px; font-size: 12px; padding: 10px 17px; }
  .hh-dialog__adv { right: 18px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  /* A faixa à esquerda dos controles já fica livre. Usá-la para voltar/avançar
     evita que os botões flutuem sobre rostos e sobre as telas online. */
  .hh-nav {
    left: 12px;
    top: calc(max(10px, env(safe-area-inset-top)) + 92px);
    bottom: auto;
  }
  .hh-nav button { width: 44px; height: 44px; }

  .sprite-slot img { max-width: 100vw; max-height: 78dvh; }
  .sprite-slot.pos-left { left: 30%; }
  .sprite-slot.pos-right { left: 70%; }
  .game-toast { top: calc(max(10px, env(safe-area-inset-top)) + 132px); width: max-content; max-width: calc(100vw - 24px); text-align: center; }
  .maya-observation { top: calc(max(10px, env(safe-area-inset-top)) + 144px); width: calc(100vw - 24px); }
  .hh-maya-model { width: min(285px, calc(100vw - 54px)); }

  /* Retrato: a identidade em cima, os botões numa linha própria embaixo — em
     vez de os dois disputarem a mesma linha e o cabeçalho invadir as cenas. */
  .hh-head { padding: calc(18px + env(safe-area-inset-top)) 4% 13px; align-items: flex-start; gap: 12px; }
  .hh-head__title { font-size: 27px; }
  .hh-head__aside { width: 100%; gap: 8px; justify-content: flex-start; }
  .hh-screen__scroll { padding: 18px 4% calc(30px + env(safe-area-inset-bottom)); }
  .hh-screen__scroll .hh-grid--chars,
  .hh-screen__scroll .hh-grid--gallery,
  .hh-grid--slots { grid-template-columns: 1fr; max-width: 100%; }
  .hh-screen__scroll .hh-grid--scenes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 100%; }
  .hh-char { min-height: 485px; }
  .hh-char__art { height: 235px; }
  .hh-roster { aspect-ratio: 4 / 5; }

  .hh-title-col { left: 6%; width: 88%; }
  .hh-title-logo__1, .hh-title-logo__2 { font-size: clamp(54px, 17vw, 74px); }
  .hh-title-cast { opacity: .28; }
  .hh-sprite--stack { left: 67%; width: 82%; height: 78%; }
  .hh-resume { left: 6%; max-width: 88%; }
  .hh-resume__where { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hh-patreon { right: 4%; bottom: calc(3% + env(safe-area-inset-bottom)); }

  .overlay { padding: 0; align-items: stretch; }
  .overlay-box { width: 100%; max-height: 100dvh; min-height: 100dvh; border-radius: 0; }
  .hh-content-modal { padding: 18px; align-items: center; }
  .hh-content-card {
    width: 100%;
    padding: 34px 22px 26px;
    border-radius: var(--hh-radius);
  }
  .hh-content-card__mark { width: 54px; height: 54px; margin-bottom: 16px; }
  .hh-content-card__actions { grid-template-columns: 1fr; margin-top: 22px; }
  .overlay-head { padding-top: calc(16px + env(safe-area-inset-top)); }
  .set-group, .log-list { padding-left: 18px; padding-right: 18px; }
  .hh-statement__head p { display: none; }
  .hh-statement__terminal { grid-template-columns: 1fr; overflow-y: auto; }
  .hh-statement__summary { flex: 0 0 auto; padding: 16px 18px 18px; border-right: 0; border-bottom: 1px solid var(--hh-line); }
  .hh-statement__cash { min-height: 150px; padding: 19px 18px; }
  .hh-statement__cash-label { margin-top: 11px; }
  .hh-statement__cash-value { font-size: clamp(38px, 13vw, 52px); }
  .hh-statement__available { left: 18px; bottom: 15px; }
  .hh-statement__account { padding: 11px 12px; }
  .hh-statement__flow { margin-top: 0; }
  .hh-statement__timeline { flex: 0 0 auto; min-height: 360px; }
  .hh-statement__timeline-head { padding: 17px 18px 13px; }
  .hh-statement__list { flex: 0 0 auto; max-height: 42vh; padding: 0 14px 14px 18px; }
  .hh-statement__event { grid-template-columns: 9px minmax(0, 1fr) auto; padding-right: 2px; }
  .hh-statement__event-after { max-height: 18px; margin-top: 3px; opacity: .58; }
  .hh-statement__closing { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
  .hh-checkpoint-list { grid-template-columns: 1fr; padding: 16px 18px calc(24px + env(safe-area-inset-bottom)); }
  .hh-checkpoint { min-height: 72px; }
  .lightbox { padding: calc(58px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)); }
  .lightbox-scene { max-width: 100%; padding: 25px 20px; }
  .lightbox-scene__text { font-size: 1.08rem; }

  #screen-ending { display: none; padding: calc(14px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom)); align-items: flex-start; }
  #screen-ending.active { display: flex; }
  .hh-ending { padding: 28px 18px; }
  .hh-ending__title { font-size: 42px; }
  .hh-ending__summary { font-size: 17px; }
  .hh-ending__cards { grid-template-columns: 1fr; }
  .hh-ending-card { min-height: 128px; }
  .hh-ending__actions { flex-direction: column; }
  .hh-ending__actions .btn { width: 100%; }
}

@media (max-width: 340px) and (orientation: portrait) {
  .hh-screen__scroll .hh-grid--scenes { grid-template-columns: 1fr; }
  .hh-controls { left: 4px; right: 4px; gap: 1px; font-size: 9px; }
  .hh-controls .hh-hideui { min-width: 44px; }
  .hh-hideui__label { display: none; }
  .hh-nav { left: 4px; gap: 0; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .screen button, .overlay button, .lightbox button { min-width: 44px; min-height: 44px; }
  .hh-stage.is-intimate {
    --hh-intimate-frame-x: 10px;
    --hh-intimate-frame-top: 60px;
    --hh-intimate-frame-bottom: 2%;
  }
  .hh-id { top: 8px; left: 10px; }
  .hh-controls { top: 8px; right: 10px; gap: 4px; font-size: 10px; }
  .hh-controls button { min-width: 44px; min-height: 44px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }
  .hh-controls .hh-hideui { min-width: 58px; }
  .hh-dialog { bottom: 2%; max-height: 62vh; overflow-y: auto; padding: 14px 20px; }
  .hh-dialog__text { font-size: 16px; line-height: 1.5; padding-bottom: 20px; }
  .hh-dialog__speaker { font-size: 19px; }
  .hh-nav { left: 10px; bottom: 3%; }
  .hh-nav button { width: 44px; height: 44px; }
}

/* ============================================================================
   ROTA DA MAYA — recursos no HUD e escala dos três retratos
   ----------------------------------------------------------------------------
   Nada aqui é global: os seletores de retrato usam `src$` nos três arquivos da
   Maya, e o bloco de recursos só existe quando o personagem declara `hudStats`.
   Aria e Noir permanecem exatamente como estavam.
   ============================================================================ */

/* Recursos declarados pelo personagem (caixa, dívida, janelas livres, trabalho).
   PERMANENTE, logo abaixo do vínculo, no mesmo registro tipográfico dele: uma
   tira de linha única, condensada e em caixa alta, que se lê de relance e não
   vira planilha sobre a cena.

   Morou no painel de hover e não podia continuar lá. Nesta rota ficar sem
   dinheiro custa o apartamento e ficar sem janela fecha escolhas — um recurso
   que decide o final não pode depender de o jogador descobrir que existe um
   painel escondido. O painel continua com capítulo, momento, rota e progresso,
   que são consulta, não decisão. */
.hh-id__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 13px;
  margin-top: 7px;
  font-family: var(--hh-cond);
  font-size: clamp(10.5px, .58vw, 12px);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hh-id__stats[hidden] { display: none; }
.hh-id__stat { display: inline-flex; align-items: baseline; gap: 6px; }
.hh-id__stat > span { color: var(--hh-text-faint); }
.hh-id__stat > b {
  display: inline-flex; align-items: baseline; gap: 7px;
  font-weight: 500; letter-spacing: .1em; color: var(--hh-text-mut);
}
/* O delta é texto ("up $500" / "down 1"), nunca só cor — a mudança precisa ser
   legível por leitor de tela e em monocromático. */
.hh-id__stat-delta {
  font-style: normal;
  font-size: .82em;
  letter-spacing: .02em;
  color: rgba(97, 199, 201, .95);
}
.hh-id__stat-delta.is-down { color: rgba(226, 150, 138, .95); }
.hh-id__stat.is-changed > span,
.hh-id__stat.is-changed > b { color: var(--hh-text); }
.screen .hh-id__statement {
  align-self: baseline; border: 0; border-bottom: 1px solid rgba(117, 217, 220, .5);
  margin-left: 2px; padding: 0; background: transparent; color: #75d9dc;
  font: inherit; font-size: .82em; letter-spacing: .08em; text-transform: uppercase;
  display: inline; width: auto; min-width: 0; height: auto; min-height: 0; line-height: inherit;
  white-space: nowrap; cursor: pointer;
}
.screen .hh-id__statement:hover, .screen .hh-id__statement:focus-visible { color: var(--hh-text-hi); border-bottom-color: currentColor; }

@media (prefers-reduced-motion: no-preference) {
  .hh-id__stat.is-changed { animation: hh-stat-pulse .9s ease-out; }
}
@keyframes hh-stat-pulse {
  0%   { background: rgba(97, 199, 201, .16); }
  100% { background: transparent; }
}

/* Retrato do card de personagem.
   Aqui existiam três regras que davam --hh-title-scale às formas da Maya para
   corrigir um desalinhamento; eram inertes (as classes .hh-card__portrait /
   .hh-title__portrait não existem no DOM, e nada consumia a variável), então o
   problema real nunca foi tocado: as artes têm CORTES diferentes — busto fechado
   (Aria), plano da coxa para cima (Noir), corpo inteiro (Maya) — e o
   `background-size: cover` normaliza a tela do arquivo, não a personagem. Lado
   a lado, a cabeça da Maya saía com metade do tamanho da da Aria.

   A correção usa as mesmas duas variáveis da vitrine (--hh-fit-s / --hh-fit-y,
   escritas pelo engine), mas com outra regra de encaixe: aqui o desenho VISÍVEL
   é ajustado à altura da caixa e ancorado pelo topo, para não cortar a cabeça
   nem deixar faixa da cor de destaque entre a personagem e o rodapé. O overflow
   fica porque a arte transborda em largura. O gradiente do ::after e os selos
   continuam por cima: ambos vêm depois do <img>, que fica em z-index 0. */
.hh-char__art { overflow: hidden; }
.hh-char__art img {
  position: absolute; left: 50%; top: 0; z-index: 0;
  height: 100%; width: auto; max-width: none;
  transform-origin: top center;   /* a cabeça fica firme; a escala cresce para baixo */
  transform: translate(-50%, var(--hh-fit-y, 0%)) scale(var(--hh-fit-s, 1));
}
.hh-screen__scroll .hh-char--future .hh-char__art img {
  left: 50%; top: -10%; width: auto; height: 170%; max-width: none;
  object-fit: contain; object-position: center;
  transform: translateX(-50%); transform-origin: center top;
}
.hh-screen__scroll .hh-char--future[data-char-id="future_01"] .hh-char__art img {
  top: -15%; height: 190%;
}
.hh-screen__scroll .hh-char--future[data-char-id="future_02"] .hh-char__art img {
  top: 2%; height: 170%;
}

@media (max-width: 640px) {
  /* No telefone a tira quebra em duas linhas em vez de empurrar o HUD para
     dentro da cena. Continua permanente: é o único lugar onde o saldo existe. */
  .hh-id__stats { margin-top: 6px; gap: 3px 10px; font-size: 10px; line-height: 1.35; letter-spacing: .1em; }
  .hh-id__stat { gap: 5px; }
}

/* GALLERY CHAPTER LIBRARY · generated by implement-gallery-chapter-library.mjs */
#screen-gallery-char .hh-gallery-library { overflow: hidden; }
.hh-gallery-library__shell {
  display: grid;
  grid-template-columns: clamp(250px, 27vw, 390px) minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
}
.hh-gallery-library__character {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 46px) clamp(20px, 2.5vw, 38px) 28px;
  background:
    radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 48%),
    linear-gradient(180deg, rgba(22,15,11,.98), rgba(12,9,8,.98));
  border-right: 1px solid var(--hh-line-strong);
}
.hh-gallery-library__character::before,
.hh-gallery-library__character::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .46;
}
.hh-gallery-library__character::before { top: 20px; }
.hh-gallery-library__character::after { bottom: 20px; }
.hh-gallery-library__kicker {
  position: relative;
  z-index: 2;
  font-family: var(--hh-cond);
  font-size: 12px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--hh-amber);
}
.hh-gallery-library__portrait-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 220px;
  margin: 8px -10px 0;
  overflow: hidden;
}
.hh-gallery-library__portrait-wrap::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  height: 8%;
  background: linear-gradient(to bottom, transparent 0%, transparent 45%, rgba(12,9,8,.34) 84%, rgba(12,9,8,.92) 100%);
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 55%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 55%, #000 100%);
  pointer-events: none;
}
#gallery-char-portrait[data-character="aria"],
#gallery-char-portrait[data-character="noir"] {
  top: 18%;
}
.hh-gallery-library__portrait {
  position: absolute;
  left: 50%;
  top: 8%;
  display: block;
  height: 82%;
  width: auto;
  max-width: none;
  transform-origin: top center;
  transform: translate(-50%, var(--hh-fit-y, 0%)) scale(var(--hh-fit-s, 1));
  filter: drop-shadow(0 22px 32px rgba(0,0,0,.58));
}
#screen-gallery .hh-roster__art {
  overflow: hidden;
  background-image: none;
}
#screen-gallery .hh-roster__art img {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: auto;
  max-width: none;
  transform-origin: top center;
  transform: translate(-50%, var(--hh-fit-y, 0%)) scale(var(--hh-fit-s, 1));
}
.hh-gallery-library__identity { position: relative; z-index: 2; text-align: center; margin-top: -8px; }
.hh-gallery-library__name {
  margin: 0;
  font-family: var(--hh-serif);
  font-size: clamp(34px, 3.6vw, 58px);
  font-weight: 500;
  line-height: 1;
  color: var(--hh-text-hi);
  text-shadow: 0 3px 22px rgba(0,0,0,.7);
}
.hh-gallery-library__count {
  display: block;
  margin-top: 15px;
  font-family: var(--hh-cond);
  font-size: 11px;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 72%, var(--hh-text));
}
.hh-gallery-library__actions {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px 14px;
  margin-top: 22px;
}
.hh-gallery-library__content {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(28px, 3vw, 46px) clamp(24px, 4vw, 64px) 52px;
  scrollbar-width: thin;
  scrollbar-color: rgba(240,199,141,.55) transparent;
}
.hh-gallery-library__content::-webkit-scrollbar { width: 11px; }
.hh-gallery-library__content::-webkit-scrollbar-track { background: rgba(20,14,9,.35); border-radius: 999px; }
.hh-gallery-library__content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--hh-amber), var(--hh-amber-2));
  border-radius: 999px;
  border: 2px solid rgba(20,14,9,.35);
}
.hh-gallery-chapters { width: 100%; max-width: 1500px; margin: 0 auto; }
.hh-gallery-chapter + .hh-gallery-chapter { margin-top: 38px; }
.hh-gallery-chapter__head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 15px;
}
.hh-gallery-chapter__head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--hh-line-strong), transparent);
}
.hh-gallery-chapter__title {
  margin: 0;
  font-family: var(--hh-cond);
  font-size: clamp(15px, 1.35vw, 20px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--hh-text-hi);
}
#screen-gallery-char .hh-gallery-chapter__grid {
  position: static;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 240px));
  justify-content: start;
  gap: 16px;
  width: 100%;
  max-width: none;
  margin: 0;
}
#screen-gallery-char .hh-gallery-chapter__grid .hh-scene { aspect-ratio: 16 / 9; }
#screen-gallery-char .hh-gallery-chapter__grid .hh-scene__art {
  object-fit: cover;
  object-position: center;
}
#screen-gallery-char .hh-gallery-chapter__grid .hh-scene figcaption {
  right: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#screen-gallery-char #gallery-char-credits { max-width: 1500px; margin: 42px auto 0; }

@media (max-width: 1120px) {
  .hh-gallery-library__shell { grid-template-columns: 250px minmax(0, 1fr); }
  #screen-gallery-char .hh-gallery-chapter__grid { grid-template-columns: repeat(auto-fill, minmax(180px, 230px)); }
}
@media (max-width: 760px) {
  #screen-gallery-char .hh-gallery-library { overflow: auto; }
  .hh-gallery-library__shell { display: block; height: auto; min-height: 100%; }
  .hh-gallery-library__character {
    min-height: 410px;
    padding: calc(22px + env(safe-area-inset-top)) 5% 24px;
    border-right: 0;
    border-bottom: 1px solid var(--hh-line-strong);
  }
  .hh-gallery-library__portrait-wrap { min-height: 245px; max-height: 310px; margin-top: 2px; }
  .hh-gallery-library__name { font-size: 38px; }
  .hh-gallery-library__content { overflow: visible; padding: 28px 4% calc(38px + env(safe-area-inset-bottom)); }
  .hh-gallery-chapter + .hh-gallery-chapter { margin-top: 31px; }
  #screen-gallery-char .hh-gallery-chapter__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 460px) {
  #screen-gallery-char .hh-gallery-chapter__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hh-gallery-library__portrait-wrap { min-height: 220px; }
}

