/* ============ Luz Submersa ============ */
:root {
  --noite: #04070b;
  --agua: #08131c;
  --ambar: #f0b768;
  --ambar-claro: #f7dcb0;
  --verde-agua: #8fe3cd;
  --goiaba: #f08c8c;
  --papel: #efe5d1;
  --tinta: #2a2019;
  --vermelho: #b7261d;
  --texto: #e8e1d3;
  --texto-fraco: rgba(232, 225, 211, .58);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --script: "Snell Roundhand", "Segoe Script", "Brush Script MT", "Apple Chancery", cursive;
  --topo: env(safe-area-inset-top, 0px);
  --base: env(safe-area-inset-bottom, 0px);
  --esq: env(safe-area-inset-left, 0px);
  --dir: env(safe-area-inset-right, 0px);
  --suave: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; background: var(--noite); color: var(--texto);
  font-family: var(--serif); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overflow: hidden;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 1px solid var(--ambar); outline-offset: 4px;
}
[hidden] { display: none !important; }

#lago { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }
#fundo-simples { display: none; }

/* ---------- botões ---------- */
.bt-texto {
  font-size: .78rem; letter-spacing: .22em; text-transform: lowercase; font-variant: small-caps;
  color: var(--texto-fraco); padding: .7rem .5rem; transition: color .3s;
}
.bt-texto:hover, .bt-texto:focus-visible { color: var(--texto); }
.bt-linha {
  position: relative; font-size: 1rem; letter-spacing: .06em; padding: .8rem .2rem; color: var(--texto);
}
.bt-linha::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .45rem; height: 1px;
  background: currentColor; opacity: .45; transform-origin: left; transition: transform .5s var(--suave), opacity .3s;
}
.bt-linha:hover::after, .bt-linha:focus-visible::after { opacity: .9; }
.bt-linha.discreto { color: var(--texto-fraco); }

/* ---------- entrada ---------- */
.tela { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; }
#inicio { background: radial-gradient(ellipse at 50% 70%, #0a1722 0%, var(--noite) 70%); transition: opacity 1.4s var(--suave); }
#inicio.saindo { opacity: 0; pointer-events: none; }
.inicio-para { margin: 0; font-style: italic; color: var(--texto-fraco); letter-spacing: .08em; }
.inicio-nome { margin: .1em 0 1.6em; font-family: var(--script); font-weight: 400; font-size: clamp(3rem, 14vw, 5.5rem); color: var(--ambar-claro); line-height: 1.1; }
.inicio-botoes { display: flex; flex-direction: column; gap: .4rem; align-items: center; }
.inicio-nota { position: absolute; bottom: calc(1.6rem + var(--base)); margin: 0; font-size: .8rem; font-style: italic; color: rgba(232,225,211,.35); }

/* ---------- abertura ---------- */
#abertura { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.abertura-toque {
  position: absolute; left: 0; right: 0; bottom: calc(42vh + var(--base)); margin: 0; text-align: center;
  font-style: italic; letter-spacing: .3em; color: var(--texto-fraco); opacity: 0; transition: opacity 2s;
}
.abertura-toque.visivel { opacity: 1; animation: respirar 4s ease-in-out infinite; }
@keyframes respirar { 50% { opacity: .35; } }
.abertura-titulo { position: absolute; left: 0; right: 0; top: 22vh; text-align: center; padding: 0 2rem; opacity: 0; transition: opacity 2.4s; }
.abertura-titulo.visivel { opacity: 1; }
.abertura-titulo h2 { margin: 0 0 .7rem; font-weight: 400; font-size: clamp(1.6rem, 7vw, 2.6rem); letter-spacing: .32em; text-transform: uppercase; color: var(--ambar-claro); }
.abertura-titulo p { margin: 0; font-style: italic; color: var(--texto-fraco); line-height: 1.7; }
#bt-pular { position: absolute; right: calc(1rem + var(--dir)); top: calc(.8rem + var(--topo)); pointer-events: auto; opacity: 0; transition: opacity 1s; }
#abertura.ativa #bt-pular { opacity: 1; }

/* ---------- HUD ---------- */
#hud {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; justify-content: space-between; align-items: center;
  padding: 0 calc(1.1rem + var(--dir)) calc(.5rem + var(--base)) calc(1.1rem + var(--esq));
  opacity: 0; pointer-events: none; transition: opacity 1.2s;
}
body.hub #hud { opacity: 1; pointer-events: auto; }
#hud-recado { font-style: italic; font-size: .85rem; color: var(--ambar-claro); text-align: center; flex: 1; padding: 0 .5rem; opacity: .85; }
#bt-som[aria-pressed="false"] { text-decoration: line-through; }

#bt-final {
  position: fixed; left: 50%; top: calc(1.2rem + var(--topo)); transform: translateX(-50%); z-index: 16;
  color: var(--ambar-claro); font-style: italic; animation: respirar 3.5s ease-in-out infinite;
}

/* ---------- rótulos ---------- */
#rotulos { position: fixed; inset: 0; z-index: 10; pointer-events: none; opacity: 0; transition: opacity 1.5s; }
body.hub #rotulos { opacity: 1; }
.rotulo {
  position: absolute; left: 0; top: 0; pointer-events: auto; white-space: nowrap;
  display: flex; align-items: center; gap: .45rem; padding: .55rem .4rem;
  font-size: .74rem; letter-spacing: .18em; font-variant: small-caps; color: rgba(232,225,211,.5);
  transition: color .3s, opacity .6s; will-change: transform;
}
.rotulo::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--ambar); box-shadow: 0 0 8px var(--ambar); opacity: .7; }
.rotulo.visto::before { background: var(--texto-fraco); box-shadow: none; }
.rotulo:hover, .rotulo:focus-visible, .rotulo.ativo { color: var(--texto); }
.rotulo.escondido { opacity: 0; pointer-events: none; }

/* ---------- véu ---------- */
#veu { position: fixed; inset: 0; z-index: 60; background: #000; opacity: 0; pointer-events: none; transition: opacity .45s ease; }
#veu.ativo { opacity: 1; pointer-events: auto; }

#aviso {
  position: fixed; left: 50%; top: calc(1rem + var(--topo)); transform: translate(-50%, -8px); z-index: 70;
  font-style: italic; font-size: .9rem; color: var(--ambar-claro); opacity: 0; transition: opacity .5s, transform .5s;
  pointer-events: none; text-align: center; max-width: 88vw;
}
#aviso.visivel { opacity: 1; transform: translate(-50%, 0); }

/* ---------- salas (estrutura comum) ---------- */
#salas { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.sala {
  position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  pointer-events: auto; opacity: 0; visibility: hidden; transition: opacity .6s var(--suave), visibility 0s .6s;
  padding: calc(3.6rem + var(--topo)) calc(1.3rem + var(--dir)) calc(3rem + var(--base)) calc(1.3rem + var(--esq));
}
.sala.aberta { opacity: 1; visibility: visible; transition: opacity .6s var(--suave), visibility 0s; }
.sala-topo { position: fixed; top: 0; left: 0; right: 0; z-index: 5; padding: calc(.4rem + var(--topo)) calc(1rem + var(--dir)) 0 calc(1rem + var(--esq)); pointer-events: none; }
.sala-topo .bt-texto { pointer-events: auto; }
.sala-titulo { margin: .2rem 0 .4rem; font-weight: 400; font-size: clamp(1.5rem, 6vw, 2.2rem); letter-spacing: .04em; }
.sala-dica { margin: 0 0 1.8rem; font-style: italic; color: var(--texto-fraco); max-width: 34rem; line-height: 1.6; }
.falta { font-family: ui-monospace, Menlo, monospace; font-size: .72rem; color: #ffb4a8; background: rgba(120, 20, 10, .35); padding: .35rem .5rem; display: inline-block; margin: .3rem 0; }

/* ---------- câmara escura ---------- */
.sala-camara { background: radial-gradient(ellipse at 50% 0%, #3b0907 0%, #160202 55%, #070000 100%); color: #f3c9c2; transition: opacity .6s, background 1.2s; }
.sala-camara.luz-acesa { background: radial-gradient(ellipse at 50% 0%, #6b625a 0%, #2b2724 60%, #121110 100%); color: var(--texto); }
.sala-camara .sala-dica { color: rgba(243, 201, 194, .6); }
.varal { position: relative; display: flex; gap: 1.1rem; overflow-x: auto; padding: 1.6rem .4rem 1.4rem; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.varal::before { content: ""; position: absolute; left: 0; right: 0; top: 1.2rem; height: 1px; background: rgba(243, 201, 194, .35); min-width: 100%; }
.papel-foto {
  position: relative; flex: 0 0 auto; width: 92px; height: 116px; scroll-snap-align: center;
  background: #4a100c; box-shadow: 0 6px 18px rgba(0,0,0,.5); transform: rotate(var(--r, 0deg)); transform-origin: 50% -10px;
  transition: transform .4s var(--suave); overflow: hidden;
}
.papel-foto:hover, .papel-foto:focus-visible { transform: rotate(0deg) translateY(3px); }
.papel-foto::before { content: ""; position: absolute; top: -6px; left: 50%; width: 10px; height: 22px; margin-left: -5px; background: #7a4a2c; border-radius: 2px; z-index: 2; }
.papel-foto img { width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.papel-foto.revelada img { opacity: 1; }
.papel-foto.sem-arquivo { outline: 1px dashed rgba(255,180,168,.5); }
.papel-foto .num { position: absolute; bottom: 6px; right: 8px; font-size: .7rem; color: rgba(243,201,194,.5); }
.bandeja { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-top: .6rem; }
.bandeja canvas { max-width: 100%; touch-action: none; box-shadow: 0 20px 60px rgba(0,0,0,.6); cursor: crosshair; }
.bandeja .legenda { min-height: 1.5em; margin: .4rem 0 0; font-style: italic; text-align: center; max-width: 30rem; }
.bandeja-acoes { display: flex; gap: 1.4rem; }

/* ---------- sótão ---------- */
.sala-sotao {
  background:
    radial-gradient(ellipse at 50% 18%, rgba(255, 196, 120, .22), transparent 60%),
    repeating-linear-gradient(90deg, #1c130d 0 46px, #20160f 46px 47px, #1a110b 47px 92px),
    #160f0a;
}
.mesa { position: relative; display: flex; flex-wrap: wrap; gap: 1.6rem 1.2rem; justify-content: center; max-width: 46rem; margin: 0 auto; padding: 1rem 0 2rem; }
.envelope {
  position: relative; width: 156px; height: 104px; transform: rotate(var(--r, 0deg)); transition: transform .4s var(--suave);
  background: linear-gradient(160deg, #e9dcc3, #d4c3a3); box-shadow: 0 10px 22px rgba(0,0,0,.45); perspective: 600px;
}
.envelope:hover, .envelope:focus-visible { transform: rotate(0) translateY(-4px); }
.envelope .aba {
  position: absolute; inset: 0 0 auto 0; height: 58%; transform-origin: top; transition: transform .7s var(--suave);
  background: linear-gradient(170deg, #ddcfb3, #cbb995); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.envelope .lacre {
  position: absolute; left: 50%; top: 40%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c2402f, #7d140c 70%); box-shadow: 0 2px 4px rgba(0,0,0,.4), inset 0 0 0 3px rgba(0,0,0,.12);
  color: rgba(255, 220, 200, .55); font-family: var(--script); font-size: .95rem; line-height: 30px; text-align: center; transition: opacity .4s;
}
.envelope .quando { position: absolute; left: 0; right: 0; bottom: 8px; font-family: var(--script); font-size: .92rem; color: #5b4632; text-align: center; padding: 0 .4rem; line-height: 1.1; }
.envelope.aberto .lacre { opacity: .35; }
.envelope.abrindo .aba { transform: rotateX(180deg); }

.carta { position: fixed; inset: 0; z-index: 8; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: calc(3.8rem + var(--topo)) 1rem calc(3rem + var(--base)); background: rgba(10, 6, 3, .72); opacity: 0; transition: opacity .5s; }
.carta.visivel { opacity: 1; }
.papel {
  position: relative; width: min(34rem, 100%); padding: 2.4rem 1.8rem 2rem; color: var(--tinta);
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .27  0 0 0 0 .18  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23f)'/></svg>"),
    linear-gradient(175deg, #f4ecdc, #e6d8bd);
  box-shadow: 0 30px 80px rgba(0,0,0,.6); transform: translateY(30px) rotate(-.6deg); transition: transform .8s var(--suave);
}
.carta.visivel .papel { transform: translateY(0) rotate(-.6deg); }
.papel .carta-quando { margin: 0 0 1.4rem; font-size: .78rem; letter-spacing: .2em; font-variant: small-caps; color: #8a6f55; }
.papel .carta-texto { font-size: 1.08rem; line-height: 1.75; white-space: pre-line; }
.papel .carta-assinatura { margin: 1.6rem 0 0; font-family: var(--script); font-size: 1.5rem; color: #4a3424; text-align: right; }
.papel .bt-texto { color: #8a6f55; margin-top: 1.2rem; }

/* ---------- casa de barcos ---------- */
.sala-cinema { background: radial-gradient(ellipse at 50% 30%, #12202b 0%, #070b10 60%, #030507 100%); }
.tela-cinema { position: relative; max-width: 46rem; margin: 0 auto 1.4rem; aspect-ratio: 16 / 10; background: #000; box-shadow: 0 0 80px rgba(143, 227, 205, .08), 0 0 0 1px rgba(255,255,255,.04); display: flex; align-items: center; justify-content: center; }
.tela-cinema video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.tela-cinema .vazia { color: var(--texto-fraco); font-style: italic; padding: 1rem; text-align: center; }
.abas { display: flex; gap: 1.2rem; justify-content: center; margin-bottom: 1rem; }
.abas button[aria-selected="true"] { color: var(--ambar-claro); }
.lista { list-style: none; margin: 0 auto; padding: 0; max-width: 34rem; }
.lista li { border-top: 1px solid rgba(255,255,255,.07); }
.item-midia { display: flex; width: 100%; align-items: center; gap: .9rem; padding: .95rem .2rem; text-align: left; }
.item-midia .n { font-size: .75rem; color: var(--texto-fraco); width: 1.6rem; }
.item-midia .t { flex: 1; }
.item-midia .s { font-size: .8rem; color: var(--texto-fraco); font-style: italic; }
.item-midia.tocando .t { color: var(--ambar-claro); }
.player { display: flex; align-items: center; gap: .8rem; max-width: 34rem; margin: .4rem auto 1rem; }
.player input[type=range] { flex: 1; accent-color: var(--ambar); }
.player .tempo { font-size: .75rem; color: var(--texto-fraco); font-variant-numeric: tabular-nums; min-width: 5.5em; text-align: right; }
.player .vol { width: 80px; flex: 0 0 auto; }
.nota-lista { text-align: center; font-style: italic; color: var(--texto-fraco); font-size: .9rem; margin: 1.2rem auto; max-width: 30rem; }

/* ---------- maré ---------- */
.sala-mare { background: linear-gradient(180deg, #0b1620 0%, #0a1219 100%); }
.mare-cena { position: relative; max-width: 34rem; margin: 0 auto; touch-action: pan-x; }
.capitulo { position: relative; padding: 1.4rem 0 1.6rem; transition: filter .6s, opacity .6s; }
.capitulo .quando { font-size: .72rem; letter-spacing: .2em; font-variant: small-caps; color: var(--ambar); }
.capitulo h3 { margin: .2rem 0 .4rem; font-weight: 400; font-size: 1.3rem; }
.capitulo p { margin: 0; line-height: 1.65; color: var(--texto); }
.capitulo img { display: block; max-width: 100%; margin-top: .8rem; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.capitulo.submerso { filter: blur(5px) saturate(.4); opacity: .3; }
.mare-agua {
  position: absolute; left: -2rem; right: -2rem; bottom: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(60, 140, 150, .38), rgba(8, 30, 40, .72));
  border-top: 1px solid rgba(143, 227, 205, .45); transition: height .15s linear;
}
.mare-agua::before {
  content: ""; position: absolute; left: 0; right: 0; top: -7px; height: 8px; opacity: .55;
  background: radial-gradient(ellipse 18px 5px at 50% 100%, rgba(143,227,205,.6), transparent 70%) 0 0 / 36px 8px repeat-x;
  animation: maresia 6s linear infinite;
}
@keyframes maresia { to { background-position: 36px 0; } }
.mare-controle { position: sticky; bottom: calc(.6rem + var(--base)); display: flex; align-items: center; gap: .8rem; max-width: 34rem; margin: 1.6rem auto 0; padding: .7rem 1rem; background: rgba(4, 10, 15, .85); z-index: 3; }
.mare-controle label { font-size: .75rem; letter-spacing: .15em; font-variant: small-caps; color: var(--texto-fraco); }
.mare-controle input { flex: 1; accent-color: var(--verde-agua); }

/* ---------- farol ---------- */
.sala-farol { background: #04080d; overflow-x: hidden; }
.farol-cena { position: relative; height: 52vh; min-height: 300px; margin: 0 -1.3rem 1rem; overflow: hidden; background: linear-gradient(180deg, #03060b 0%, #0b1622 61.5%, #0f1f2c 62%, #060d13 100%); }
.farol-torre { position: absolute; left: 12%; bottom: 0; width: 22px; margin-left: -4px; height: 42%; background: linear-gradient(90deg, #3e3d3a, #77746d 45%, #3e3d3a); clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%); }
.farol-torre::before { content: ""; position: absolute; left: 50%; top: -6px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--ambar-claro); box-shadow: 0 0 24px 8px rgba(247, 220, 176, .6); }
.facho { position: absolute; left: calc(12% + 7px); bottom: 42%; width: 400vmax; height: 400vmax; transform: translate(-50%, 50%); pointer-events: none;
  background: conic-gradient(from 0deg at 50% 50%, rgba(247, 220, 176, .24), rgba(247, 220, 176, 0) 8deg, rgba(247,220,176,0) 352deg, rgba(247,220,176,.24)); }
.horizonte { position: absolute; left: 0; right: 0; top: 62%; height: 1px; }
.sonho { position: absolute; transform: translate(-50%, -100%); padding: .5rem; text-align: center; font-size: .9rem; color: var(--texto); opacity: .25; transition: opacity .3s; }
.sonho::after { content: ""; display: block; width: 6px; height: 6px; margin: .4rem auto 0; border-radius: 50%; background: var(--ambar-claro); box-shadow: 0 0 12px var(--ambar-claro); }
.sonho-aberto { max-width: 32rem; margin: 0 auto 2rem; min-height: 3rem; text-align: center; line-height: 1.7; font-style: italic; }
.garrafa { max-width: 32rem; margin: 0 auto; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,.08); }
.garrafa h3 { margin: 0 0 .3rem; font-weight: 400; font-size: 1.15rem; }
.garrafa p { margin: 0 0 .8rem; font-style: italic; color: var(--texto-fraco); }
.garrafa textarea { width: 100%; min-height: 110px; padding: .9rem; resize: vertical; font: inherit; font-size: 16px; color: var(--tinta); background: var(--papel); border: 0; }
.garrafa.foi textarea { animation: deriva 2.4s var(--suave) forwards; }
@keyframes deriva { to { transform: translate(40vw, 10px) rotate(8deg) scale(.3); opacity: 0; } }

/* ---------- céu (constelação) ---------- */
.sala-ceu { background: radial-gradient(ellipse at 50% 120%, #0f2030 0%, #03050a 60%); padding-left: 0; padding-right: 0; overflow: hidden; }
.sala-ceu .sala-cabeca { position: relative; z-index: 2; padding: 0 1.3rem; pointer-events: none; }
.sala-ceu canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.ceu-rodape { position: absolute; left: 0; right: 0; bottom: calc(1rem + var(--base)); z-index: 2; text-align: center; padding: 0 1.4rem; }
.ceu-mensagem { font-style: italic; line-height: 1.6; margin: 0 auto .6rem; max-width: 26rem; color: var(--ambar-claro); opacity: 0; transition: opacity 2s; }
.ceu-mensagem.visivel { opacity: 1; }

/* ---------- segredo ---------- */
.sala-segredo { background: radial-gradient(ellipse at 50% 80%, #0d2229 0%, #02060a 70%); display: flex; flex-direction: column; align-items: center; }

/* ---------- memória (voz) ---------- */
.memoria {
  position: fixed; left: 50%; bottom: calc(3.6rem + var(--base)); z-index: 32; width: min(30rem, calc(100vw - 2rem));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .6s, transform .6s var(--suave);
  padding: 1.2rem 1.3rem 1rem; background: rgba(4, 12, 16, .88); border-top: 1px solid rgba(143,227,205,.35);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.memoria.visivel { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.memoria h3 { margin: 0 0 .2rem; font-weight: 400; font-size: 1.05rem; color: var(--verde-agua); }
.memoria .legenda { margin: 0 0 .6rem; font-style: italic; color: var(--texto-fraco); }
.memoria .acoes { display: flex; justify-content: flex-end; }

/* ---------- mapa ---------- */
.mapa {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 35; width: min(22rem, 88vw); overflow-y: auto;
  padding: calc(1rem + var(--topo)) calc(1.4rem + var(--dir)) calc(2rem + var(--base)) 1.4rem;
  background: rgba(4, 8, 12, .94); border-left: 1px solid rgba(255,255,255,.06);
  transform: translateX(102%); transition: transform .5s var(--suave); visibility: hidden;
}
.mapa.aberto { transform: none; visibility: visible; }
.mapa h2 { font-weight: 400; font-size: 1.2rem; margin: 1rem 0 .3rem; }
.mapa h3 { font-weight: 400; font-size: .74rem; letter-spacing: .2em; font-variant: small-caps; color: var(--texto-fraco); margin: 1.6rem 0 .4rem; }
.mapa ul { list-style: none; margin: 0; padding: 0; }
.mapa li button { display: flex; width: 100%; justify-content: space-between; align-items: baseline; padding: .6rem 0; text-align: left; border-bottom: 1px solid rgba(255,255,255,.05); }
.mapa li button .st { font-size: .75rem; font-style: italic; color: var(--texto-fraco); }
.mapa .dica-segredo { font-style: italic; font-size: .88rem; color: var(--ambar-claro); margin: .6rem 0 0; }
.mapa .ajuste { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0; font-size: .92rem; }
.mapa select, .mapa input[type=range] { font: inherit; color: var(--texto); background: #0c141b; border: 1px solid rgba(255,255,255,.1); padding: .25rem; accent-color: var(--ambar); }
.mapa .progresso-texto { font-style: italic; color: var(--texto-fraco); font-size: .88rem; margin: .2rem 0 0; }

/* ---------- pedras ---------- */
.hud-pedras { position: fixed; inset: 0; z-index: 12; pointer-events: none; opacity: 0; transition: opacity .8s; }
.hud-pedras.visivel { opacity: 1; }
.hud-pedras .palavra { position: absolute; left: 0; right: 0; top: calc(3.4rem + var(--topo)); text-align: center; font-size: clamp(1.3rem, 6vw, 2rem); letter-spacing: .35em; padding-left: .35em; }
.hud-pedras .palavra span { color: rgba(232,225,211,.18); transition: color .5s, text-shadow .5s; }
.hud-pedras .palavra span.acesa { color: var(--ambar-claro); text-shadow: 0 0 14px rgba(240,183,104,.7); }
.hud-pedras .instrucao { position: absolute; left: 0; right: 0; bottom: calc(5rem + var(--base)); text-align: center; font-style: italic; color: var(--texto-fraco); padding: 0 2rem; }
.hud-pedras .mensagem { position: absolute; left: 0; right: 0; top: calc(6.6rem + var(--topo)); text-align: center; font-style: italic; color: var(--texto); padding: 0 2rem; line-height: 1.6; opacity: 0; transition: opacity 1.5s; }
.hud-pedras .mensagem.visivel { opacity: 1; }
.hud-pedras .bt-texto { position: absolute; left: calc(1rem + var(--esq)); top: calc(.4rem + var(--topo)); pointer-events: auto; }
.hud-pedras .jogar { position: absolute; left: 50%; bottom: calc(2rem + var(--base)); transform: translateX(-50%); pointer-events: auto; }

/* ---------- final ---------- */
.texto-final { position: fixed; inset: 0; z-index: 25; background: linear-gradient(180deg, transparent 45%, rgba(2,4,8,.72) 80%); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 2rem 1.6rem calc(4rem + var(--base)); text-align: center; pointer-events: none; }
.texto-final p { margin: 0 0 .8rem; max-width: 28rem; line-height: 1.7; font-style: italic; opacity: 0; transition: opacity 2s; white-space: pre-line; }
.texto-final p.visivel { opacity: 1; }
.texto-final .assinatura { font-family: var(--script); font-style: normal; font-size: 1.5rem; color: var(--ambar-claro); }
.texto-final button { pointer-events: auto; opacity: 0; transition: opacity 1.5s; }
.texto-final button.visivel { opacity: 1; }

/* ---------- modo de edição ---------- */
.selo-edicao { position: fixed; right: calc(.4rem + var(--dir)); bottom: calc(2.9rem + var(--base)); max-width: 46vw; line-height: 1.3; text-align: right; z-index: 80; font-family: ui-monospace, Menlo, monospace; font-size: .62rem; color: #ffcfc7; background: rgba(110, 20, 10, .6); padding: .2rem .5rem; pointer-events: none; }

/* ---------- sem 3D ---------- */
body.sem-3d #lago { display: none; }
body.sem-3d #fundo-simples {
  display: block; position: fixed; inset: 0;
  background:
    radial-gradient(circle at 72% 18%, rgba(240,235,215,.9) 0 2.2%, rgba(240,235,215,.12) 2.6%, transparent 9%),
    radial-gradient(ellipse at 50% 64%, rgba(240,183,104,.12), transparent 40%),
    linear-gradient(180deg, #020309 0%, #0e1b27 58%, #08131c 60%, #03070a 100%);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; }
}

/* ---------- o bonequinho guia ---------- */
#guia { position: fixed; left: calc(.5rem + var(--esq)); bottom: calc(2.9rem + var(--base)); z-index: 36; width: 82px; pointer-events: none; opacity: 0; transform: translateY(12px); transition: opacity .8s, transform .8s var(--suave), bottom .5s var(--suave); }
#guia.visivel { opacity: 1; transform: none; }
body.memoria-aberta #guia { bottom: calc(12.5rem + var(--base)); }
body.em-sala #guia { bottom: calc(.6rem + var(--base)); width: 70px; }
.guia-boneco { display: block; width: 100%; padding: 0; pointer-events: auto; }
.guia-boneco svg { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 50% 96%; animation: respiro 3.4s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
@keyframes respiro { 50% { transform: scale(1.012, 1.03); } }
.guia-boneco.pulo svg { animation: pulinho .55s var(--suave), respiro 3.4s ease-in-out .55s infinite; }
@keyframes pulinho { 0% { transform: translateY(0) scale(1, 1); } 25% { transform: translateY(0) scale(1.08, .9); } 55% { transform: translateY(-14px) scale(.96, 1.05); } 100% { transform: translateY(0) scale(1, 1); } }
.g-cabeca { transform-box: view-box; transform-origin: 100px 158px; transition: transform .9s var(--suave); }
.g-braco-d { transform-box: view-box; transform-origin: 152px 166px; }
.g-braco-d.aceno { animation: aceno 1.3s ease-in-out; }
@keyframes aceno { 15%, 45%, 75% { transform: rotate(-150deg); } 30%, 60% { transform: rotate(-120deg); } 100% { transform: rotate(0); } }
.guia-balao {
  position: absolute; left: 62px; bottom: 92px; width: max-content; max-width: min(250px, 66vw);
  padding: .65rem .85rem; background: var(--papel); color: var(--tinta); font-size: .93rem; line-height: 1.45;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); opacity: 0; transform: translateY(6px) scale(.97); transform-origin: 0 100%;
  transition: opacity .35s, transform .35s var(--suave); pointer-events: none;
}
.guia-balao::after { content: ""; position: absolute; left: 10px; bottom: -8px; border: 8px solid transparent; border-top-color: var(--papel); border-bottom: 0; border-left-width: 0; }
.guia-balao.visivel { opacity: 1; transform: none; }
.guia-balao.vazio { display: none; }
.guia-balao p { margin: 0; }
.rotulo.fora { opacity: 0; pointer-events: none; }

.envelope .quando.longo { font-size: .8rem; bottom: 5px; }

/* dentro das salas o bonequinho fica no canto direito, longe dos controles */
body.em-sala #guia { left: auto; right: calc(.4rem + var(--dir)); }
body.em-sala .guia-balao { left: auto; right: 54px; transform-origin: 100% 100%; }
body.em-sala .guia-balao::after { left: auto; right: 10px; border-left-width: 8px; border-right-width: 0; }
body.em-sala .mare-controle { margin-right: 76px; }
body.em-sala .selo-edicao { right: auto; left: calc(.4rem + var(--esq)); }
.player { flex-wrap: wrap; }
.player .vol { width: 70px; }

.ouvir-cap { margin-top: .6rem; color: var(--ambar-claro); padding-left: 0; }

/* ---------- marcadores dos lugares (no lugar dos nomes espalhados) ---------- */
.rotulo { padding: 14px; gap: 0; font-size: .74rem; }
.rotulo::before { display: none; }
.rotulo .ponto {
  position: relative; width: 7px; height: 7px; border-radius: 50%;
  background: #ffe2b0; box-shadow: 0 0 10px 2px rgba(255, 210, 150, .55);
}
.rotulo .ponto::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 1px solid rgba(255, 226, 176, .45); animation: marco 3.2s ease-out infinite;
}
@keyframes marco { 0% { transform: scale(.5); opacity: .9; } 70%, 100% { transform: scale(1.6); opacity: 0; } }
.rotulo.visto .ponto { background: rgba(232, 225, 211, .6); box-shadow: 0 0 6px rgba(232, 225, 211, .3); }
.rotulo.visto .ponto::after { animation: none; opacity: 0; }
.rotulo .nome {
  position: absolute; left: 50%; bottom: calc(100% - 4px); transform: translate(-50%, 4px);
  white-space: nowrap; letter-spacing: .18em; font-variant: small-caps; color: var(--texto);
  opacity: 0; transition: opacity .3s, transform .3s var(--suave); pointer-events: none;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}
.rotulo.ativo .nome, .rotulo:focus-visible .nome { opacity: 1; transform: translate(-50%, 0); }
.rotulo.escolhido .ponto { background: #fff3dc; box-shadow: 0 0 16px 5px rgba(255, 220, 170, .8); }
.rotulo.escolhido .ponto::after { animation-duration: 1.6s; }

#cartao {
  position: fixed; left: 50%; bottom: calc(4.2rem + var(--base)); z-index: 17;
  transform: translate(-50%, 14px); opacity: 0; transition: opacity .4s, transform .5s var(--suave);
  min-width: min(17rem, 80vw); max-width: 86vw; text-align: center; padding: 1rem 1.6rem .4rem;
  background: linear-gradient(180deg, rgba(8, 14, 20, .82), rgba(4, 8, 12, .9));
  border-top: 1px solid rgba(255, 226, 176, .35);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
#cartao.visivel { opacity: 1; transform: translate(-50%, 0); }
.cartao-dica { margin: 0; font-size: .74rem; letter-spacing: .2em; font-variant: small-caps; color: var(--ambar); }
.cartao-nome { margin: .15rem 0 .2rem; font-weight: 400; font-size: 1.6rem; letter-spacing: .02em; color: var(--ambar-claro); }
.cartao-fechar { position: absolute; right: .3rem; top: .1rem; font-size: .66rem; }
body:not(.hub) #cartao { display: none; }
body.memoria-aberta #cartao { display: none; }

.abertura-titulo .abertura-sub { font-family: var(--script); font-style: normal; font-size: clamp(1.6rem, 7vw, 2.4rem); color: var(--ambar-claro); margin: -.2rem 0 1rem; line-height: 1.2; }
.inicio-para { font-size: .95rem; }
