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

body {
  background: radial-gradient(ellipse at 50% 110%, #0d1b3e 0%, #080820 55%, #040410 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: Georgia, serif;
  overflow: hidden;
  /* mata o zoom por toque-duplo do iOS (Safari ignora user-scalable=no) sem
     tirar o pinch-zoom próprio do livro, que é tratado nos handlers de touch */
  touch-action: manipulation;
}

/* ---- Loading overlay ---- */
#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 110%, #0d1b3e 0%, #080820 55%, #040410 100%);
  transition: opacity 0.8s ease;
}
#loading-overlay.done { opacity: 0; pointer-events: none; }

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 24px 20px;
}

/* Capa com perspectiva 3D flutuante */
.loading-cover-wrap { perspective: 700px; }
.loading-cover {
  width: clamp(130px, 32vw, 195px);
  border-radius: 10px;
  display: block;
  box-shadow:
    -6px 10px 36px rgba(0,0,0,0.8),
    0 0 0 1px rgba(255,255,255,0.07);
  transform: rotateY(-10deg) rotateX(3deg);
  animation: coverFloat 5s ease-in-out infinite;
}
@keyframes coverFloat {
  0%, 100% { transform: rotateY(-10deg) rotateX(3deg) translateY(0px); }
  50%       { transform: rotateY(-10deg) rotateX(3deg) translateY(-10px); }
}

/* Títulos */
.loading-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}
.loading-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: clamp(2rem, 7vw, 3.2rem);
  font-weight: 400;
  color: #fff;
  text-shadow: 0 2px 28px rgba(190, 160, 255, 0.35);
  line-height: 1.05;
}
.loading-subtitle {
  font-style: italic;
  font-size: clamp(0.82rem, 2vw, 1rem);
  color: rgba(255,255,255,0.48);
  font-family: Georgia, serif;
}

/* Barra de progresso */
.loading-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.loading-bar {
  width: clamp(140px, 38vw, 200px);
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
#loading-fill {
  height: 100%;
  width: 5%;
  background: linear-gradient(90deg, #7b2fbe, #e91e8c, #2196f3, #7b2fbe);
  background-size: 300% 100%;
  animation: shimmer 2s linear infinite;
}
@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.loading-status {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.32);
  font-family: system-ui, sans-serif;
  letter-spacing: 0.05em;
}

/* ---- App layout ---- */
#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 100vh;
  opacity: 0;
  transition: opacity 0.8s ease;
}
#app.ready { opacity: 1; }

/* ---- Título ---- */
#book-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 0;
  flex-shrink: 0;
  width: 100%;
}
#book-title h1 { flex: 1; text-align: center; }
#book-title h1 {
  font-size: clamp(0.7rem, 1.8vw, 1rem);
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.06em;
  line-height: 1.4;
}
#book-title h1 span {
  display: block;
  font-style: italic;
  font-size: 0.88em;
  color: rgba(255,255,255,0.35);
}

/* ---- Flipbook container ---- */
#flipbook-container {
  position: relative;          /* âncora do zoom-wrapper absoluto */
  flex: 1;
  width: 100%;
  overflow: hidden;
  cursor: grab;
  min-height: 0;
}
#flipbook-container:active { cursor: grabbing; }

/* Zoom wrapper — absoluto em 0,0 + origin 0 0: SÓ o translate/scale do JS posiciona
   (evita o conflito entre o flex-center do container e o centramento via translate). */
#zoom-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
  pointer-events: none;
}

/* Ícones das páginas precisam de pointer-events explícito */
.page-icon { pointer-events: auto; }

#flipbook { touch-action: none; }

/* Impede seleção de texto/imagem na área do livro */
#flipbook-container, #zoom-wrapper, .page, .page img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  draggable: false;
}

/* ---- Controls ---- */
#controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 6px 8px 10px;
  color: #fff;
  flex-shrink: 0;
}

#controls > button {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
#controls > button:hover { background: rgba(255,255,255,0.25); }

#page-indicator {
  font-size: 0.82rem;
  opacity: 0.6;
  min-width: 54px;
  text-align: center;
}

#zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  border-left: 1px solid rgba(255,255,255,0.15);
  padding-left: 12px;
}
#zoom-controls button {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 1rem;
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}
#zoom-controls button:hover { background: rgba(255,255,255,0.22); }
#zoom-indicator { font-size: 0.68rem; opacity: 0.5; min-width: 34px; text-align: center; }

#extra-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 1px solid rgba(255,255,255,0.15);
  padding-left: 12px;
}
#extra-controls button,
#extra-controls a {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 1rem;
  width: 34px; height: 34px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
#extra-controls button:hover,
#extra-controls a:hover { background: rgba(255,255,255,0.22); }

/* ---- Ícones nas páginas (topo direito — fora da zona de fold) ---- */
.page-icon {
  position: absolute;
  width: clamp(38px, 11vw, 52px);
  height: clamp(38px, 11vw, 52px);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  box-shadow: 0 2px 12px rgba(0,0,0,0.55);
  z-index: 30;
  transition: transform 0.2s;
  touch-action: none;
  pointer-events: auto;
}
.page-icon:hover { transform: scale(1.12); }
.icon-libras { background: #0077b6; color: #fff; top: 8px;  right: 8px; }
.icon-audio  { background: #f77f00; color: #fff; top: clamp(52px, 15vw, 70px);  right: 8px; }
.icon-ar     { background: #7b2d8b; color: #fff; top: clamp(96px, 29vw, 130px); right: 8px; }

/* ---- Overlays ---- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.overlay.hidden { display: none; }

.overlay-content {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  max-width: 90vw;
  max-height: 80vh;
}
.overlay-close {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 10;
}
#video-libras { display: block; max-width: 90vw; max-height: 75vh; }

.overlay-audio {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(247,127,0,0.95);
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  z-index: 150;
}
.overlay-audio.hidden { display: none; }
#btn-audio-close { background: none; border: none; color: #fff; font-size: 1rem; cursor: pointer; }

/* ---- Página do flipbook ---- */
/* Elementos internos do StPageFlip — fundo transparente para não vazar branco */
[class^="stf__"] { background: transparent !important; }

.page {
  position: relative;
  overflow: hidden;
  /* fundo opaco (não transparente): evita "piscar" o fundo escuro atrás durante
     a virada no Android. NÃO pôr transform aqui — o StPageFlip controla o da página. */
  background: #fffdf7;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: high-quality;
  image-rendering: -webkit-optimize-contrast;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

/* ---- Versão ---- */
#app-version {
  position: fixed;
  bottom: 4px;
  right: 8px;
  color: rgba(255,255,255,0.2);
  font-size: 0.58rem;
  z-index: 999;
  pointer-events: none;
  font-family: monospace;
  letter-spacing: 0.05em;
}

/* ---- Fullscreen — controlado por JS via html.is-fullscreen ---- */
html.is-fullscreen body {
  overflow: hidden;
}
html.is-fullscreen #app {
  height: 100vh;
  opacity: 1;
}

/* ---- Responsivo ---- */
@media (max-width: 700px) {
  #app {
    gap: 0;
    height: 100dvh;
  }
  #book-title h1  { display: none; }   /* esconde só o título; mantém o botão de acessibilidade */
  #book-title     { justify-content: center; padding: 8px 10px 2px; }
  /* Botão de acessibilidade em DESTAQUE no mobile (maior + brilho pulsante) */
  .btn-access {
    font-size: 0.98rem;
    font-weight: 700;
    padding: 12px 22px;
    background: #0091d6;
    box-shadow: 0 2px 14px rgba(0,145,214,0.5), 0 0 0 0 rgba(0,145,214,0.55);
    animation: a11yPulse 2.4s ease-out infinite;
  }
  #zoom-controls  { display: none; }
  #extra-controls { display: none; }

  #controls {
    padding: 8px 0 10px;
    gap: 12px;
  }
  #controls > button {
    padding: 10px 28px;
    font-size: 1.5rem;
    border-radius: 10px;
  }
  #page-indicator { font-size: 0.82rem; }

}

/* =========================================================================
   Acessibilidade: skip link, sr-only, foco visível
   ========================================================================= */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed;
  top: -60px; left: 12px;
  z-index: 2000;
  background: #fff; color: #080820;
  padding: 10px 16px; border-radius: 0 0 8px 8px;
  font-family: system-ui, sans-serif; font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 3px solid #6cb6ff;
  outline-offset: 2px;
  border-radius: 6px;
}

/* =========================================================================
   Botão e painel de acessibilidade
   ========================================================================= */
.btn-access {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #0077b6;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-family: system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
}
.btn-access:hover { background: #0096d6; }
.btn-access:active { transform: scale(0.97); }
/* pulso que chama atenção pro botão de acessibilidade (usado no mobile) */
@keyframes a11yPulse {
  0%   { box-shadow: 0 2px 14px rgba(0,145,214,0.5), 0 0 0 0 rgba(0,145,214,0.5); }
  70%  { box-shadow: 0 2px 14px rgba(0,145,214,0.5), 0 0 0 12px rgba(0,145,214,0); }
  100% { box-shadow: 0 2px 14px rgba(0,145,214,0.5), 0 0 0 0 rgba(0,145,214,0); }
}

.access-panel {
  position: fixed; inset: 0;
  z-index: 300;
  background: rgba(4, 4, 16, 0.78);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.access-panel.hidden { display: none; }

.access-box {
  position: relative;
  background: #fbfaf7;
  color: #1a1a2e;
  border-radius: 18px;
  padding: 26px 22px 22px;
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6);
}
.access-box .overlay-close { color: #1a1a2e; background: rgba(0,0,0,0.08); }
.access-box .overlay-close:hover { background: rgba(0,0,0,0.16); }
.access-box h2 { font-size: 1.25rem; color: #0a3a5c; margin-bottom: 4px; padding-right: 36px; }
.access-intro {
  font-size: 0.9rem; color: #555; margin-bottom: 16px;
  font-family: system-ui, sans-serif;
}
.access-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.access-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 2px solid #e3e0d8;
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.access-item:hover { border-color: #0096d6; background: #f0f9ff; }
.access-item:active { transform: scale(0.99); }
.ai-icon { font-size: clamp(1.4rem, 4.5vw, 1.8rem); flex-shrink: 0; width: 38px; text-align: center; }
.ai-text { display: flex; flex-direction: column; gap: 2px; }
.ai-label { font-size: 1rem; font-weight: 600; color: #1a1a2e; }
.ai-desc  { font-size: 0.82rem; color: #666; line-height: 1.35; }

.access-purchase {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  padding: 13px;
  background: #f77f00;
  color: #fff;
  border-radius: 12px;
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.2s;
}
.access-purchase:hover { background: #ff9417; }

/* =========================================================================
   Overlays (vídeo / texto simples)
   ========================================================================= */
.overlay-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #0a1430;
  color: #fff;
}
.overlay-bar h2 { font-size: 1rem; flex: 1; font-family: system-ui, sans-serif; font-weight: 600; }
.overlay-bar .overlay-close { position: static; }

.overlay-video-content, .overlay-simple-content {
  width: min(94vw, 900px);
  max-height: 90vh;
  background: #0a1430;
  display: flex;
  flex-direction: column;
}
/* Libras: overlay maior para aproveitar a tela ao máximo */
#overlay-arvideo .overlay-content {
  width: min(98vw, 1280px);
  max-height: 95vh;
}
.video-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-wrap iframe,
.video-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; }

/* Botão de animação (AR no web) */
#ar-controls {
  display: flex;
  align-items: center;
  border-left: 1px solid rgba(255,255,255,0.15);
  padding-left: 12px;
}
.btn-ar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #7b2d8b, #0077b6);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-family: system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s, filter 0.2s;
}
.btn-ar:hover { filter: brightness(1.12); }
.btn-ar:active { transform: scale(0.97); }

.overlay-simple-content { background: #fbfaf7; color: #1a1a2e; }
.simple-body {
  overflow-y: auto;
  padding: 22px 24px 30px;
  font-family: Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.7;
}
.simple-body .simple-sub { font-style: italic; color: #0a3a5c; margin-bottom: 16px; }
.simple-body p { margin-bottom: 14px; }
.btn-read {
  background: #0077b6;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-family: system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.btn-read[aria-pressed="true"] { background: #c1121f; }

/* =========================================================================
   Player de áudio — dark luxury
   ========================================================================= */
.overlay-audioplayer-content {
  width: min(94vw, 440px);
  background: linear-gradient(165deg, #1c0e45 0%, #0e0a26 48%, #08101e 100%);
  border: 1px solid rgba(130, 100, 255, 0.18);
  box-shadow: 0 40px 120px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,255,255,0.07);
  border-radius: 26px;
  overflow: hidden;
}

.audioplayer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 0 20px;
}

.audioplayer-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(160, 130, 255, 0.75);
  font-family: system-ui, sans-serif;
  font-weight: 600;
}

.audioplayer-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8b68ff;
  box-shadow: 0 0 8px rgba(139, 104, 255, 0.9);
  flex-shrink: 0;
  animation: audioPulse 2s ease-in-out infinite;
}

@keyframes audioPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(0.8); }
}

/* Fechar do audioplayer: circular, sobrepõe o padrão .overlay-close */
.audioplayer-header .overlay-close {
  position: static;
  width: 30px;
  height: 30px;
  min-width: 30px;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  color: rgba(255,255,255,0.55);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.audioplayer-header .overlay-close:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

.audio-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px 22px 22px;
  color: #fff;
  text-align: center;
}

.audio-cover-wrap {
  position: relative;
  margin-bottom: 2px;
}
.audio-cover-wrap::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 28px;
  background: radial-gradient(ellipse, rgba(100, 65, 255, 0.5) 0%, transparent 72%);
  filter: blur(10px);
  pointer-events: none;
}

.audio-cover {
  width: clamp(120px, 44vw, 190px);
  height: clamp(120px, 44vw, 190px);
  border-radius: 18px;
  object-fit: cover;
  display: block;
  position: relative;
  box-shadow: 0 22px 64px rgba(0,0,0,0.7),
              0 0 0 1px rgba(255,255,255,0.1),
              0 0 48px rgba(90, 60, 220, 0.22);
}

.audio-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.audio-title {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: system-ui, sans-serif;
  color: #fff;
  letter-spacing: -0.01em;
}

.audio-desc {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.42);
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  max-width: min(100%, 300px);
}

.audio-player-wrap { width: 100%; }
#audio-player { width: 100%; accent-color: #8b68ff; }

/* Botão "Ver no YouTube" */
.audio-yt {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #cc0000;
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.86rem;
  font-family: system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.audio-yt:hover { background: #aa0000; }
.audio-yt:active { transform: scale(0.97); }
.yt-logo { width: 26px; height: 18px; flex-shrink: 0; display: block; }
.audio-yt.hidden { display: none; }

/* YouTube botão full-width dentro do audioplayer */
#overlay-audioplayer .audio-yt { width: 100%; justify-content: center; }

/* ---- QR: seção base (usada no arvideo e video overlays) ---- */
.qr-mobile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.qr-mobile p {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.4);
  font-family: system-ui, sans-serif;
}
.qr-mobile img {
  width: 112px;
  height: 112px;
  border-radius: 8px;
  background: #fff;
  padding: 5px;
  display: block;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.15s, box-shadow 0.15s;
}
.qr-mobile img:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,0,0,0.6);
}
.qr-mobile.hidden { display: none; }

/* ---- QR card horizontal (audioplayer) ---- */
#overlay-audioplayer .qr-mobile {
  width: 100%;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 10px 12px;
}
.qr-mobile-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  flex: 1;
}
.qr-mobile-text span {
  font-size: 0.77rem;
  color: rgba(255,255,255,0.48);
  font-family: system-ui, sans-serif;
  line-height: 1.45;
}
.qr-mobile-text span:first-child { font-size: 1.2rem; line-height: 1; }
#overlay-audioplayer .qr-mobile img {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 8px;
  padding: 4px;
}

/* =========================================================================
   Lightbox do QR code (z-index acima dos overlays normais)
   ========================================================================= */
.overlay-qr-bg { z-index: 400; }
.qr-lightbox-content {
  position: relative;
  background: #0c1535;
  border-radius: 20px;
  padding: 28px 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 90vmin;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
}
.qr-lightbox-img {
  width: min(70vmin, 360px);
  height: min(70vmin, 360px);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  display: block;
  object-fit: contain;
}
.qr-lightbox-label {
  color: rgba(255,255,255,0.65);
  font-family: system-ui, sans-serif;
  font-size: 0.88rem;
  text-align: center;
  max-width: min(100%, 280px);
}

/* =========================================================================
   Overlay CAA (PDF embutido)
   ========================================================================= */
.overlay-caa-content {
  width: min(96vw, 1000px);
  height: min(92vh, 800px);
  display: flex;
  flex-direction: column;
  background: #0a1430;
  border-radius: 12px;
  overflow: hidden;
}
.caa-wrap {
  flex: 1;
  min-height: 0;
  background: #f3f4f8;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.caa-page {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  height: auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  background: #fff;
}
.caa-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: #0a1430;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.caa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0077b6;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-family: system-ui, sans-serif;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}
.caa-btn:hover { background: #0096d6; }
.caa-btn:active { transform: scale(0.97); }

.video-yt-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  padding: 14px 12px;
  background: #0a1430;
}

/* =========================================================================
   Mobile pequeno — 480px e abaixo
   ========================================================================= */
@media (max-width: 480px) {
  /* Access panel: padding menor para caber em 320px */
  .access-box {
    padding: 18px 12px 14px;
  }
  .access-box h2 { font-size: 1.1rem; }
  .access-item { padding: 12px 12px; gap: 10px; }

  /* Linguagem simples: fonte menor em mobile */
  .simple-body {
    font-size: 1rem;
    padding: 16px 14px 20px;
  }

  /* QR card no audioplayer: empilha verticalmente em tela pequena */
  #overlay-audioplayer .qr-mobile {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  #overlay-audioplayer .qr-mobile img {
    width: 96px;
    height: 96px;
  }
  .qr-mobile-text { text-align: center; }

  /* video-yt-wrap: gap menor */
  .video-yt-wrap { gap: 12px; padding: 10px 8px; }

  /* overlay-bar em mobile */
  .overlay-bar { gap: 8px; }
  .overlay-bar h2 { font-size: 1rem; }
}

/* =========================================================================
   Movimento reduzido
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
