:root {
  --rosa: #ff8fb3;
  --rosa-claro: #ffd6e6;
  --lilas: #c79bff;
  --dourado: #ffe6a7;
  --fundo: #07030f;
  --texto: #f6ecff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--fundo);
  color: var(--texto);
  font-family: 'Quicksand', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* vinheta cinematográfica */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(5,2,12,0.55) 100%);
}

/* grão de filme sutil — tira a chapação digital */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 20;
  background: radial-gradient(ellipse at center, rgba(30,8,50,0.42) 0%, rgba(7,3,15,0.88) 80%);
  transition: opacity 1.2s ease;
  padding: 24px;
}
.overlay.fade-out { opacity: 0; pointer-events: none; }

.intro-inner { max-width: 540px; animation: rise 1.6s ease both; }

.intro-pre {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(1rem, 4vw, 1.4rem);
  letter-spacing: 0.3em;
  text-transform: lowercase;
  color: var(--rosa-claro);
  opacity: 0.85;
  margin-bottom: 0.4em;
}
.intro-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(2.6rem, 11vw, 5rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--rosa) 0%, var(--lilas) 50%, var(--dourado) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(255,143,179,0.25);
}
.intro-sub {
  margin-top: 1.2em;
  font-size: clamp(0.95rem, 3.6vw, 1.15rem);
  line-height: 1.7;
  font-weight: 400;
  color: rgba(246,236,255,0.82);
}

.btn-enter {
  margin-top: 2.4em;
  padding: 0.85em 2.6em;
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--texto);
  background: transparent;
  border: 1px solid rgba(255,143,179,0.6);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 0 24px rgba(255,143,179,0.18);
}
.btn-enter:hover {
  background: rgba(255,143,179,0.14);
  box-shadow: 0 0 40px rgba(255,143,179,0.4);
  transform: translateY(-2px);
}

/* ---------- Girar o celular ---------- */
.rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  text-align: center;
  padding: 24px;
  background: radial-gradient(ellipse at center, rgba(30,8,50,0.6) 0%, rgba(7,3,15,0.97) 80%);
}
/* só aparece em telas de toque em modo retrato */
@media (orientation: portrait) and (pointer: coarse) {
  .rotate-overlay { display: flex; }
}
.rotate-phone {
  width: 56px;
  height: 96px;
  border: 3px solid var(--rosa-claro);
  border-radius: 13px;
  position: relative;
  box-shadow: 0 0 26px rgba(255,143,179,0.45), inset 0 0 14px rgba(255,143,179,0.22);
  transform-origin: center;
  animation: phoneTilt 2.6s cubic-bezier(.6,0,.2,1) infinite;
}
.rotate-phone::before {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: var(--rosa-claro);
  opacity: 0.75;
  transform: translateX(-50%);
}
.rotate-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(1.15rem, 5vw, 1.5rem);
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: var(--rosa-claro);
  text-shadow: 0 0 24px rgba(255,143,179,0.3);
  animation: pulseHint 3s ease-in-out infinite;
}
@keyframes phoneTilt {
  0%, 28%   { transform: rotate(0deg); }
  58%, 88%  { transform: rotate(-90deg); }
  100%      { transform: rotate(0deg); }
}

/* ---------- Dica ---------- */
.hint {
  position: fixed;
  bottom: max(32px, calc(env(safe-area-inset-bottom) + 24px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: rgba(255,214,230,0.8);
  background: rgba(20,8,35,0.4);
  padding: 0.6em 1.4em;
  border-radius: 999px;
  border: 1px solid rgba(199,155,255,0.25);
  backdrop-filter: blur(6px);
  animation: pulseHint 3s ease-in-out infinite;
  pointer-events: none;
  white-space: nowrap;
}

/* ---------- Tutorial de navegação (passo a passo) ---------- */
.tour {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: radial-gradient(ellipse at center, rgba(30,8,50,0.5) 0%, rgba(7,3,15,0.92) 80%);
  opacity: 0;
  transition: opacity 1.2s ease;
}
/* fade-in do overlay quando entra; .hidden continua controlando o display */
.tour.show { opacity: 1; }
.tour-card {
  max-width: 420px;
  width: 100%;
  background: rgba(20,8,35,0.5);
  border: 1px solid rgba(199,155,255,0.25);
  border-radius: 22px;
  padding: 30px 28px 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
  transform: translateY(22px) scale(0.96);
  opacity: 0;
  transition: transform 1.2s cubic-bezier(.2,.8,.2,1), opacity 1.2s ease;
}
.tour.show .tour-card { transform: none; opacity: 1; }
/* corpo (símbolo + texto): crossfade suave a cada troca de passo —
   o antigo sai subindo (.leaving), o novo entra de baixo (.entering→neutro) */
.tour-body {
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.2,.8,.2,1);
}
.tour-body.leaving  { opacity: 0; transform: translateY(-12px); }
.tour-body.entering { opacity: 0; transform: translateY(12px); }
.tour-step-label {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.28em;
  text-transform: lowercase;
  color: var(--rosa-claro);
  opacity: 0.7;
  margin-bottom: 0.6em;
}
.tour-glyph {
  font-size: 2.6rem;
  line-height: 1;
  letter-spacing: 0.12em;
  color: var(--rosa-claro);
  text-shadow: 0 0 26px rgba(255,143,179,0.5);
  margin-bottom: 0.45em;
  animation: pulseHint 3s ease-in-out infinite;
}
.tour-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(1.15rem, 4.5vw, 1.45rem);
  line-height: 1.55;
  letter-spacing: 0.04em;
  color: rgba(246,236,255,0.92);
  min-height: 4.8em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tour-dots {
  display: flex;
  gap: 9px;
  justify-content: center;
  margin: 16px 0 22px;
}
.tour-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,214,230,0.3);
  transition: all 0.4s ease;
}
.tour-dots span.on {
  background: var(--rosa);
  box-shadow: 0 0 10px var(--rosa);
  transform: scale(1.25);
}
.tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tour-skip {
  background: transparent;
  border: none;
  color: rgba(255,214,230,0.55);
  font-family: 'Quicksand', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 0.5em 0.4em;
  transition: color 0.3s ease;
}
.tour-skip:hover { color: rgba(255,214,230,0.9); }
.tour-next {
  padding: 0.7em 1.8em;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--texto);
  background: rgba(255,143,179,0.12);
  border: 1px solid rgba(255,143,179,0.55);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.35s ease;
  box-shadow: 0 0 20px rgba(255,143,179,0.15);
}
.tour-next:hover {
  background: rgba(255,143,179,0.22);
  box-shadow: 0 0 32px rgba(255,143,179,0.35);
  transform: translateY(-1px);
}
/* acessibilidade: quem prefere menos movimento vê só um fade curto */
@media (prefers-reduced-motion: reduce) {
  .tour, .tour-card { transition: opacity 0.25s ease; }
  .tour-card { transform: none; }
  .tour-body { transition: opacity 0.2s ease; }
  .tour-body.leaving, .tour-body.entering { transform: none; }
  .sheet-scroll { scroll-behavior: auto; }
  .lightbox[open]::backdrop, .lightbox[open] .lightbox-frame { animation: none; }
  .sheet-thumb { transition: none; }
}

/* ---------- Botões de controle (som + tela cheia) ---------- */
.mute-btn, .fs-btn {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(199,155,255,0.35);
  background: rgba(20,8,35,0.45);
  color: var(--rosa-claro);
  font-size: 1.2rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all 0.3s ease;
}
.mute-btn { right: max(18px, env(safe-area-inset-right)); }
/* tela cheia fica à esquerda do som (46px + 12px de respiro) */
.fs-btn { right: calc(max(18px, env(safe-area-inset-right)) + 58px); }
.mute-btn:hover, .fs-btn:hover { background: rgba(199,155,255,0.2); }
.mute-btn.off { opacity: 0.45; }
.fs-btn svg { display: block; }

/* ---------- Rótulos das estrelas (3D) ---------- */
.star-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px 5px 10px;
  border-radius: 999px;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(246, 236, 255, 0.78);
  background: rgba(14, 6, 26, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 18px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  transform: translateY(-6px);
  transition: color 0.4s ease, background 0.4s ease, border-color 0.4s ease, transform 0.4s cubic-bezier(.2,.8,.2,1);
  user-select: none;
}
.star-label .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor, 0 0 4px currentColor;
  flex: 0 0 auto;
}
.star-label:hover,
.star-label.active {
  color: #fff;
  background: rgba(36, 14, 56, 0.82);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-6px) scale(1.07);
}

/* ---------- Painel de memória (bottom sheet) ---------- */
.sheet {
  --accent: #ff8fb3;
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translate(-50%, 0);
  z-index: 30;
  width: min(700px, 90vw);
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;            /* a rolagem mora no .sheet-scroll, não aqui */
  padding: 26px 30px 24px;
  border-radius: 26px;
  background: linear-gradient(165deg, rgba(28, 14, 44, 0.55), rgba(12, 6, 22, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 24px 90px rgba(0, 0, 0, 0.66),
    0 0 70px color-mix(in srgb, var(--accent) 18%, transparent);
  backdrop-filter: blur(12px);
  animation: sheetUp 0.6s cubic-bezier(.2, .8, .2, 1) both;
}

/* miolo rolável: foto + título + texto. Só ele rola — o × e a navegação
   ficam ancorados. Fade só na borda de baixo e só quando há mais conteúdo
   (classe .more-below via JS). mask-image não amostra o canvas WebGL, então
   é barato — ao contrário do backdrop-filter que tiramos por performance. */
.sheet-scroll {
  flex: 1 1 auto;
  min-height: 0;               /* deixa o flex encolher e rolar de verdade */
  overflow-y: auto;
  overscroll-behavior: contain;  /* a galáxia nunca rola atrás do card */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* barra de rolagem escondida: o fade na borda de baixo é a pista de "tem mais"
     (mais limpo e não briga com o × do canto) */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sheet-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }
.sheet-scroll.more-below {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 42px), transparent 100%);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 42px), transparent 100%);
}
/* indicador de rolagem próprio: pílula lilás à direita, posicionada por JS
   (abaixo do ×, até a base do miolo). Aparece só quando dá pra rolar. Substitui
   a barra nativa, que brigava com o × — aqui controlamos a posição com precisão. */
.scroll-rail {
  position: absolute;
  right: 10px;
  width: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 4;
}
.sheet.scrollable .scroll-rail { opacity: 1; }
.scroll-thumb {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  border-radius: 99px;
  background: linear-gradient(rgba(255, 143, 179, 0.78), rgba(199, 155, 255, 0.78));
  box-shadow: 0 0 8px rgba(199, 155, 255, 0.45);
}
/* fio de acento no topo, na cor da memória */
.sheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  right: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}
@keyframes sheetUp {
  from { opacity: 0; transform: translate(-50%, 30px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.sheet-head { display: flex; align-items: flex-start; gap: 16px; padding-right: 40px; }
/* cabeçalho alinhado ao TOPO da foto (a dica não arrasta mais o bloco pra baixo) */
.sheet-heading { padding-top: 2px; }
/* fio decorativo entre a foto e o título — degradê na cor da memória, some nas
   pontas. Sutil de propósito (1px). É enfeite, então aria-hidden no HTML. */
.sheet-divider {
  flex: 0 0 auto;
  align-self: stretch;
  width: 1px;
  margin: 8px 0;
  background: linear-gradient(to bottom,
    transparent,
    color-mix(in srgb, var(--accent) 50%, transparent) 28%,
    color-mix(in srgb, var(--accent) 50%, transparent) 72%,
    transparent);
}
.sheet-thumb-wrap {
  --thumb: 92px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: var(--thumb);         /* coluna = largura da foto: a dica quebra/centra DENTRO dela */
}
/* miniatura agora é um botão: abre a foto inteira no lightbox */
.sheet-thumb {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: var(--thumb, 92px);
  height: var(--thumb, 92px);
  padding: 0;
  border-radius: 18px;
  background-color: rgba(255, 255, 255, 0.04);
  background-size: cover;
  background-position: center;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  /* glow INTERNO (inset): some o problema do brilho externo sendo cortado pelo
     overflow do miolo. A sombra escura pra baixo não incomoda (escuro no escuro). */
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent),
    inset 0 0 16px color-mix(in srgb, var(--accent) 22%, transparent);
  cursor: pointer;
  /* sem scale no hover (o overflow cortaria): em vez disso o glow interno acende
     e a foto clareia de leve — nada é cortado. */
  transition: box-shadow 0.35s ease, filter 0.35s ease;
}
.sheet-thumb:hover,
.sheet-thumb:focus-visible {
  filter: brightness(1.07);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 48%, transparent),
    inset 0 0 22px color-mix(in srgb, var(--accent) 38%, transparent);
  outline: none;
}
.sheet-thumb:focus-visible { outline: 2px solid var(--rosa-claro); outline-offset: 3px; }
/* glifo "expandir" no canto — sinalizador persistente de que dá pra tocar */
.thumb-expand {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1;
  color: #fff;
  background: rgba(10, 4, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  pointer-events: none;
}
/* dica centralizada sob a foto, contida à largura dela (quebra em ~2 linhas) */
.thumb-hint {
  width: var(--thumb);
  font-family: 'Quicksand', sans-serif;
  font-size: 0.64rem;
  letter-spacing: 0.03em;
  line-height: 1.3;
  text-align: center;
  color: rgba(199, 155, 255, 0.78);
}
.sheet-date {
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent, var(--dourado));
  opacity: 0.92;
}
.sheet-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  line-height: 1.08;
  letter-spacing: 0.005em;
  margin-top: 0.12em;   /* label coladinho ao título (formam uma unidade) */
}
/* selo da data exata: linha delicada em itálico serifado, com um ✦ */
.sheet-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 0.62em;   /* data com um respiro a mais, como uma assinatura */
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: rgba(255, 214, 230, 0.78);
}
.sheet-stamp::before {
  content: "✦";
  font-style: normal;
  font-size: 0.66em;
  color: var(--accent, var(--rosa));
  opacity: 0.95;
}
.sheet-stamp:empty { display: none; }   /* sem data → não aparece */
.sheet-text {
  margin-top: 16px;
  font-size: 1.12rem;
  line-height: 1.8;
  color: rgba(246, 236, 255, 0.84);
  white-space: pre-line; /* respeita quebras de linha (\n) escritas em memories.js */
}

.sheet-nav {
  flex: 0 0 auto;              /* ancorada no rodapé do card, nunca rola */
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.nav-btn {
  padding: 0.6em 1.3em;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--texto);
  background: color-mix(in srgb, var(--accent, #ff8fb3) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #ff8fb3) 38%, transparent);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.nav-btn:hover {
  background: color-mix(in srgb, var(--accent, #ff8fb3) 24%, transparent);
  transform: translateY(-1px);
}
.counter {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: rgba(255, 214, 230, 0.7);
}

.sheet-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 6;                 /* sempre acima do miolo rolável */
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(10, 4, 20, 0.5);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.3s ease;
}
.sheet-close:hover { background: rgba(255, 143, 179, 0.4); }

/* ---------- Lightbox: foto inteira ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;     /* o scrim mora no ::backdrop */
  overflow: hidden;
  /* centraliza a foto (e seu frame) no meio da tela */
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox:not([open]) { display: none; }
/* scrim: vinheta violeta plana (sem blur — protege a GPU). Escurece nas bordas
   e deixa a foto flutuar num poço de escuro. */
.lightbox::backdrop {
  background: radial-gradient(120% 120% at 50% 42%,
              rgba(20, 8, 38, 0.88) 0%, rgba(6, 3, 14, 0.97) 100%);
}
/* o frame abraça a foto (do tamanho dela) pra ancorar o × no canto certo */
.lightbox-frame {
  position: relative;
  display: inline-flex;
  max-width: 90svw;
  max-height: 86svh;
}
.lightbox-img {
  display: block;
  max-width: 90vw;
  max-width: 90svw;
  max-height: 86vh;
  max-height: 86svh;
  width: auto;                 /* o JS ajusta width/height p/ preencher a tela */
  height: auto;
  object-fit: contain;         /* foto inteira, nunca cortada */
  /* pixel art (Habbo) amplia com nitidez, sem borrar */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  border-radius: 10px;
  /* halo de luz de vela: faz a foto parecer querida (estático, sem custo) */
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 18px 60px rgba(0, 0, 0, 0.6),
    0 0 64px rgba(199, 155, 255, 0.20);
  touch-action: pinch-zoom;    /* pinça/duplo-toque pra dar zoom no celular */
}
/* × ancorado na QUINA (canto superior direito), por FORA da foto */
.lightbox-close {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(60%, -60%);   /* sai pra fora, hugando a quina (fora da foto) */
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;               /* alvo de toque confortável (Apple/MDN) */
  border-radius: 50%;
  border: 1px solid rgba(255, 143, 179, 0.55);
  background: rgba(8, 3, 16, 0.72);
  color: #ffe9f1;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}
.lightbox-close:hover { background: rgba(199, 155, 255, 0.32); transform: translate(60%, -60%) scale(1.08); }
/* abertura suave (curva e tempo do resto do site): o escuro junta gradualmente
   no ::backdrop e a foto floresce — nada de corte seco. */
.lightbox[open]::backdrop { animation: lbScrim 0.5s ease both; }
.lightbox[open] .lightbox-frame { animation: lbBloom 0.55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes lbScrim { from { opacity: 0; } to { opacity: 1; } }
@keyframes lbBloom {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------- utilidades ---------- */
.hidden { display: none !important; }

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulseHint {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

#loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fundo);
  color: var(--rosa-claro);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  letter-spacing: 0.2em;
  transition: opacity 0.8s ease;
}
#loader.hidden { opacity: 0; pointer-events: none; }

/* ---------- Celular em paisagem (tela baixa) ----------
   O site é forçado pra paisagem no celular, então a dimensão curta é a
   ALTURA. As fontes/margens escalam por vw (largura) e ficam grandes demais
   pro espaço vertical. Aqui recalibramos tudo por altura (vh) e compactamos.
   Fica no fim do arquivo de propósito: media query não aumenta especificidade,
   então precisa vir DEPOIS das regras base pra vencer no source order. */
/* ---------- Telas grandes: card mais generoso ---------- */
@media (min-width: 1000px) and (min-height: 680px) {
  .sheet { width: min(760px, 80vw); max-height: 64vh; padding: 30px 38px 26px; }
  .sheet-head { gap: 22px; }
  .sheet-thumb-wrap { --thumb: 108px; }
  .sheet-thumb { border-radius: 20px; }
  .sheet-title { font-size: clamp(2rem, 2.8vw, 2.6rem); }
  .sheet-text { font-size: 1.22rem; line-height: 1.84; }
}

@media (orientation: landscape) and (max-height: 540px) {
  /* Intro */
  .overlay { padding: 16px; }
  .intro-inner { max-width: min(640px, 90vw); }
  .intro-pre { font-size: clamp(0.75rem, 2.6vh, 1.1rem); letter-spacing: 0.22em; margin-bottom: 0.3em; }
  .intro-title { font-size: clamp(1.9rem, 9.5vh, 3.6rem); line-height: 1.02; }
  .intro-sub { margin-top: 0.7em; font-size: clamp(0.8rem, 3.1vh, 1.05rem); line-height: 1.45; }
  .btn-enter { margin-top: 1.2em; padding: 0.6em 2.1em; font-size: 0.85rem; letter-spacing: 0.14em; }

  /* Ficha (bottom sheet): bem mais enxuta pra sobrar galáxia.
     teto em 72vh (não 82) pra sempre sobrar céu/estrela visível acima. */
  .sheet {
    width: min(700px, 90vw);
    max-height: 72vh;
    bottom: max(8px, env(safe-area-inset-bottom));
    padding: 13px 20px 13px;
    border-radius: 18px;
  }
  .sheet-head { gap: 12px; padding-right: 34px; }
  .sheet-thumb-wrap { --thumb: 54px; }
  .sheet-thumb { border-radius: 12px; }
  .thumb-hint { display: none; }           /* em paisagem o ⤢ já sinaliza; poupa altura */
  .thumb-expand { width: 18px; height: 18px; right: 4px; bottom: 4px; font-size: 0.7rem; }
  .sheet-date { font-size: 0.6rem; letter-spacing: 0.18em; }
  .sheet-title { font-size: clamp(1.15rem, 5vh, 1.7rem); margin-top: 0.1em; }
  .sheet-stamp { font-size: 0.92rem; margin-top: 0.3em; }
  .sheet-text { margin-top: 8px; font-size: 0.96rem; line-height: 1.55; }
  .sheet-scroll.more-below {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent 100%);
            mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent 100%);
  }
  .scroll-rail { right: 7px; }
  .sheet-nav { margin-top: 8px; padding-top: 8px; }
  .nav-btn { padding: 0.45em 1em; font-size: 0.74rem; }
  .counter { font-size: 0.74rem; }
  .sheet-close { width: 30px; height: 30px; top: 8px; right: 10px; font-size: 1.2rem; }
  .lightbox-close { width: 40px; height: 40px; }

  /* Tutorial */
  .tour-card { max-width: 480px; padding: 16px 22px 14px; border-radius: 18px; }
  .tour-step-label { font-size: 0.8rem; margin-bottom: 0.3em; }
  .tour-glyph { font-size: 1.9rem; margin-bottom: 0.25em; }
  .tour-text { font-size: clamp(0.95rem, 4vh, 1.25rem); line-height: 1.4; min-height: 3.4em; }
  .tour-dots { margin: 8px 0; }
  .tour-actions { margin-top: 4px; }
  .tour-skip, .tour-next { padding: 0.45em 1.1em; font-size: 0.82rem; }
}
