/* ═══ WARP — transição entre câmaras ═══ */

body.warp-active { overflow: hidden; }

.warp {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--preto);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
}

.warp.warp--active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.warp__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.warp__scan {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(186, 23, 189, .12) 2px,
    rgba(186, 23, 189, .12) 3px
  );
  animation: warp-scan 1.2s linear infinite;
  pointer-events: none;
}

.warp.warp--active .warp__scan { opacity: 1; }

@keyframes warp-scan {
  to { background-position: 0 48px; }
}

.warp__flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, var(--warp-accent, #BA17BD) 0%, transparent 55%);
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
}

.warp.warp--flash .warp__flash {
  animation: warp-flash .35s ease-out forwards;
}

@keyframes warp-flash {
  0%   { opacity: 0; transform: scale(.6); }
  30%  { opacity: .55; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(1.4); }
}

.warp__stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
}

.warp.warp--active .warp__stage {
  animation: warp-chroma .1s steps(2) infinite;
}

@keyframes warp-chroma {
  0%   { filter: drop-shadow(2px 0 rgba(186, 23, 189, .35)) drop-shadow(-2px 0 rgba(108, 181, 27, .25)); }
  100% { filter: drop-shadow(-2px 0 rgba(186, 23, 189, .35)) drop-shadow(2px 0 rgba(108, 181, 27, .25)); }
}

.warp__reactor {
  position: relative;
  width: min(68vw, 200px);
  height: min(68vw, 200px);
}

.warp__ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.warp__ring-bg {
  stroke: rgba(45, 21, 34, .85);
  stroke-width: 4;
}

.warp__ring-fill {
  stroke: var(--warp-accent, #BA17BD);
  stroke-width: 5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px var(--warp-accent, #BA17BD));
}

.warp__bio {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 16px var(--warp-accent, #BA17BD));
  animation: warp-bio-spin 1.4s linear infinite;
}

@keyframes warp-bio-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.warp__status {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(.75rem, 3.5vw, .95rem);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--warp-accent, #BA17BD);
  text-shadow: 0 0 20px var(--warp-accent, #BA17BD);
  text-align: center;
  min-height: 1.2em;
}

.warp__status.is-glitch {
  animation: warp-glitch .12s steps(2) infinite;
}

@keyframes warp-glitch {
  0%   { transform: translate(0, 0); opacity: 1; }
  50%  { transform: translate(2px, -1px); opacity: .85; }
  100% { transform: translate(-1px, 1px); opacity: 1; }
}

.warp__dest {
  font-family: 'Inter', sans-serif;
  font-size: clamp(.62rem, 2.8vw, .72rem);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(239, 222, 238, .55);
  text-align: center;
  max-width: 280px;
  line-height: 1.35;
}

/* Views */
.views { position: relative; z-index: 2; }

.view {
  display: none;
}

.view.view--active {
  display: block;
}

/* Excursões: iframe precisa de display:block para carregar no iOS */
#view-excursions {
  display: block;
}

#view-excursions[hidden] {
  display: block !important;
}

#view-excursions:not(.view--active) {
  visibility: hidden;
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

#view-excursions.view--active {
  visibility: visible;
  z-index: auto;
  pointer-events: auto;
}

/* Stub — em construção */
.gate--stub .gate__head { margin-bottom: 4px; }

.stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 16px;
  background: rgba(45, 21, 34, .55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(239, 222, 238, .08);
  text-align: center;
}

.stub__bio {
  width: min(42vw, 120px);
  filter: drop-shadow(0 0 20px rgba(186, 23, 189, .7));
  animation: stub-pulse 2.5s ease-in-out infinite;
}

@keyframes stub-pulse {
  0%, 100% { transform: scale(1); opacity: .92; }
  50%      { transform: scale(1.06); opacity: 1; }
}

.stub__tag {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.4rem, 7vw, 1.75rem);
  letter-spacing: .22em;
  color: var(--stub-accent, var(--roxo));
  text-shadow: 0 0 24px var(--stub-accent, var(--roxo));
}

.stub__msg {
  font-size: .68rem;
  letter-spacing: .06em;
  line-height: 1.45;
  color: rgba(239, 222, 238, .45);
  max-width: 260px;
}

.stub__hint {
  font-family: 'Bebas Neue', sans-serif;
  font-size: .58rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(239, 222, 238, .22);
}

.pulse--back {
  margin-bottom: 6px;
  cursor: pointer;
  border: none;
  width: 100%;
  font: inherit;
  text-align: left;
}

.pulse--back .pulse__idx {
  color: var(--branco);
  text-shadow: none;
}

/* ═══ EXCURSÕES — planilha em tela cheia ═══ */
.sheet-screen {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  background: var(--preto);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.sheet-screen__bar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 0 6px;
  background: rgba(6, 4, 4, .92);
  border-bottom: 1px solid rgba(108, 181, 27, .2);
}

.sheet-screen__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--verde);
  font-size: 1.25rem;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sheet-screen__back:active {
  opacity: .7;
}

.sheet-screen__label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: .95rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(239, 222, 238, .75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-screen__clip {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  --sheet-crop-top: 50px;
  --sheet-crop-bottom: 42px;
}

/* Desktop: cabeçalho do Google é mais baixo — recorte menor */
@media (hover: hover) and (pointer: fine) {
  .sheet-screen__clip {
    --sheet-crop-top: 30px;
  }
}

@media (min-width: 900px) {
  .sheet-screen__clip {
    --sheet-crop-top: 28px;
  }
}

.sheet-screen__frame {
  position: absolute;
  top: calc(-1 * var(--sheet-crop-top));
  left: 0;
  width: 100%;
  height: calc(100% + var(--sheet-crop-top) + var(--sheet-crop-bottom));
  border: 0;
  background: #fff;
}

body.sheet-view-active .hazard-tape,
body.sheet-view-active #fx-layer,
body.sheet-view-active .chamber {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .warp.warp--active .warp__stage,
  .warp__bio,
  .stub__bio { animation: none !important; }
  .warp__canvas { display: none; }
}
