/* FRENTE CENA 16 — palco visual canônico para Cenas sem exploração ativa. */
.scene-canonical-stage { position: relative; }
.scene-location-card--canonical:not(.scene-location-card--exploration) {
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.scene-location-card--canonical:not(.scene-location-card--exploration) .scene-presentation {
  padding: 0 !important;
  overflow: visible;
}
.scene-location-card--canonical:not(.scene-location-card--exploration) .scene-presentation-grid {
  position: relative;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.scene-location-card--canonical:not(.scene-location-card--exploration) .scene-location-description[hidden],
.scene-location-card--canonical:not(.scene-location-card--exploration) .scene-presentation-story[hidden] {
  display: none !important;
}

.scene-location-card--canonical:not(.scene-location-card--exploration) .scene-presentation-media {
  display: flex;
  justify-content: center;
  width: 100%;
  border: 0;
  background: #101419;
}
.scene-location-card--canonical:not(.scene-location-card--exploration) .scene-presentation-media .scene-hero-media {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.scene-location-card--canonical:not(.scene-location-card--exploration) .scene-presentation-media .scene-social-image-stage {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
}
.scene-location-card--canonical:not(.scene-location-card--exploration) .scene-presentation-media .scene-hero-media img {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  border-radius: 0;
  box-shadow: none;
}

.scene-canonical-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.scene-canonical-toolbar button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #252b31;
  color: #f4cf72;
  box-shadow: 0 4px 12px rgba(0,0,0,.24);
  cursor: pointer;
  font-size: 0;
  line-height: 0;
}
.scene-canonical-toolbar button::before {
  content: "📜";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 17px;
  line-height: 1;
  transform: none;
}
.scene-canonical-toolbar button:hover,
.scene-canonical-toolbar button:focus-visible {
  background: #313940;
  box-shadow: 0 5px 14px rgba(0,0,0,.28);
  outline: none;
}

.scene-canonical-story {
  position: fixed;
  top: 50%;
  left: calc(50vw + 130px);
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  z-index: 110;
  width: min(720px, calc(100vw - 316px));
  max-height: min(70vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(125,23,48,.25);
  border-radius: 14px;
  background: linear-gradient(180deg, #fffaf1, #f3e3c2);
  color: #3d2c24;
  box-shadow: 0 22px 64px rgba(16,12,10,.38);
}
.scene-canonical-story[hidden] { display: none !important; }
.scene-canonical-story header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  border-bottom: 1px solid rgba(125,23,48,.16);
  background: rgba(255,250,241,.96);
  backdrop-filter: blur(5px);
}

.scene-canonical-story header span {
  color: #8e263d;
  font: 800 .62rem/1 Arial, sans-serif;
  letter-spacing: .14em;
}
.scene-canonical-story header h4 {
  margin: 5px 0 0;
  font: 700 1.25rem/1.18 Georgia, serif;
  color: #2d201d;
}
.scene-canonical-story header button,
.scene-canonical-story footer button {
  border: 1px solid rgba(125,23,48,.22);
  border-radius: 9px;
  background: #fff9ee;
  color: #7d1730;
  cursor: pointer;
}
.scene-canonical-story header button { width: 34px; height: 34px; flex: none; }
.scene-canonical-story__body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 18px 22px 22px;
}
.scene-canonical-story__body h5 {
  margin: 0 0 12px;
  color: #7d1730;
  font: 800 .72rem/1 Arial, sans-serif;
  letter-spacing: .11em;
}
.scene-canonical-story__body .scene-rich-content { line-height: 1.65; }

.scene-canonical-story footer { display: none; }

@media (max-width: 760px) {
  .scene-location-card--canonical:not(.scene-location-card--exploration) .scene-presentation {
    padding: 0 8px 10px;
  }
  .scene-location-card--canonical:not(.scene-location-card--exploration) .scene-presentation-grid {
    border-radius: 11px;
  }
  .scene-canonical-toolbar { top: 12px; right: 12px; }
  .scene-canonical-story {
    top: 50%;
    left: 50vw;
    right: auto;
    bottom: auto;
    width: min(720px, calc(100vw - 28px));
    max-height: min(76vh, 720px);
  }
}

@media (min-width: 921px) {
  .app-shell.sidebar-is-collapsed .scene-canonical-story {
    left: 50vw;
    width: min(720px, calc(100vw - 56px));
  }
}

@media (max-width: 600px) {
  .scene-canonical-story {
    top: calc(50% + 34px);
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 112px);
    border-radius: 12px;
  }
  .scene-canonical-story header { padding: 12px 13px; }
  .scene-canonical-story header h4 { font-size: 1.08rem; }
  .scene-canonical-story__body { padding: 15px 16px 18px; }
}

/* FRENTE CENA 16 — controle do pergaminho no canto da imagem. */
.scene-location-card--canonical:not(.scene-location-card--exploration) .scene-hero-media::after {
  display: none !important;
  content: none !important;
}
.scene-location-card--canonical:not(.scene-location-card--exploration) .scene-canonical-toolbar {
  top: 18px;
  right: 18px;
}

/* O cabeçalho principal permanece visível também durante a exploração. */
body.scene-exploration-active .app-workspace > .app-topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 70 !important;
}

/* O lançador de Cenas fica centralizado pela viewport em qualquer largura. */
body.scene-quick-navigation-ready .app-workspace > .scene-quick-navigation .scene-quick-navigation__launcher {
  top: 26px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
}

@media (max-width: 920px) {
  body.scene-quick-navigation-ready .app-workspace > .scene-quick-navigation .scene-quick-navigation__launcher {
    top: 24px !important;
  }
}

@media (max-width: 760px) {
  .scene-location-card--canonical:not(.scene-location-card--exploration) .scene-canonical-toolbar {
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 560px) {
  body.scene-quick-navigation-ready .app-workspace > .scene-quick-navigation .scene-quick-navigation__launcher {
    top: 20px !important;
  }
}

/* FRENTE CENA 16 — a Cena rola por trás do cabeçalho sticky. */
body:has(.scene-location-card--canonical) .app-workspace > .app-topbar {
  z-index: 120 !important;
  background: #fffaf3 !important;
  isolation: isolate;
}
body:has(.scene-location-card--canonical) .scene-visual-context,
body:has(.scene-location-card--canonical) .scene-canonical-stage,
body:has(.scene-location-card--canonical) .scene-presentation-grid {
  position: relative;
  z-index: 0;
}
body:has(.scene-location-card--canonical) .scene-canonical-toolbar {
  z-index: 2;
}

/* FRENTE CENA 20 — mantém o lançador/painel de Cenas acima do cabeçalho sticky. */
body.scene-quick-navigation-ready .app-workspace > .scene-quick-navigation {
  z-index: 130 !important;
}

/* TABLET PORTRAIT — Galaxy Tab S7 FE / faixa 701–920px.
   O lançador de Cenas não pode permanecer centralizado sobre o título. */
@media (min-width:701px) and (max-width:920px){
  body.scene-quick-navigation-ready .app-workspace > .scene-quick-navigation .scene-quick-navigation__launcher{
    top:17px!important;
    left:auto!important;
    right:86px!important;
    width:62px!important;
    height:62px!important;
    transform:none!important;
  }
  body.scene-quick-navigation-ready .app-workspace > .scene-quick-navigation .scene-quick-navigation__launcher-icon{
    width:60px!important;
    height:60px!important;
  }
}

/* MOBILE — o corvo/Cenas também sai do centro do título. */
@media (max-width:700px){
  body.scene-quick-navigation-ready .app-workspace > .scene-quick-navigation .scene-quick-navigation__launcher{
    top:14px!important;
    left:auto!important;
    right:76px!important;
    width:54px!important;
    height:54px!important;
    transform:none!important;
  }
  body.scene-quick-navigation-ready .app-workspace > .scene-quick-navigation .scene-quick-navigation__launcher-icon{
    width:52px!important;
    height:52px!important;
  }
}
@media (max-width:420px){
  body.scene-quick-navigation-ready .app-workspace > .scene-quick-navigation .scene-quick-navigation__launcher{
    top:13px!important;
    right:72px!important;
    width:50px!important;
    height:50px!important;
  }
  body.scene-quick-navigation-ready .app-workspace > .scene-quick-navigation .scene-quick-navigation__launcher-icon{
    width:48px!important;
    height:48px!important;
  }
}
