:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

html, body {
  background-color: #09090B;
  color: #E4E4E7;
  font-family: 'Cormorant Garamond', serif;
  overscroll-behavior-y: none;
  min-height: 100dvh;
  margin: 0;
}

/* ==================== MODO NATIVO (IPHONE REAL) ==================== */
#iphone-15-frame {
  width: 100%;
  min-height: 100dvh;
  background-color: #09090B;
  position: relative;
}

#iphone-15-screen {
  width: 100%;
  min-height: 100dvh;
  position: relative;
}

.pc-simulator-badge,
.iphone-dynamic-island,
.iphone-home-indicator {
  display: none;
}

/* ==================== SIMULADOR IPHONE 15 NO PC (393 × 852) ==================== */
@media (min-width: 520px) {
  body {
    background: radial-gradient(circle at 50% 35%, #18181f 0%, #060608 78%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 14px;
    overflow: hidden;
  }

  .pc-simulator-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #A1A1AA;
  }

  #iphone-15-frame {
    width: 393px;
    height: min(852px, calc(100vh - 54px));
    min-height: unset;
    border-radius: 54px;
    border: 10px solid #1f1f26;
    box-shadow:
      0 0 0 2px #3e3e48,
      0 32px 90px -10px rgba(0, 0, 0, 0.92),
      inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    transform: translateZ(0);
    --safe-top: 52px;
    --safe-bottom: 28px;
  }

  #iphone-15-screen {
    width: 100%;
    height: 100%;
    min-height: unset;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
  }

  #iphone-15-screen::-webkit-scrollbar {
    display: none;
  }

  .iphone-dynamic-island {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    position: fixed;
    top: 11px;
    left: 50%;
    transform: translateX(-50%);
    width: 118px;
    height: 32px;
    background: #000000;
    border-radius: 999px;
    z-index: 45;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  .iphone-dynamic-island::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #253352 0%, #090d16 70%);
    border: 1px solid rgba(255, 255, 255, 0.12);
  }

  .iphone-home-indicator {
    display: block;
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 132px;
    height: 5px;
    border-radius: 999px;
    background: rgba(228, 228, 231, 0.35);
    z-index: 45;
    pointer-events: none;
  }
}

.film-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.sigil-card {
  position: relative;
  background: linear-gradient(180deg, rgba(24, 24, 27, 0.72) 0%, rgba(12, 12, 15, 0.92) 100%);
  border: 1px solid rgba(228, 228, 231, 0.14);
  transition: border-color 0.35s ease, transform 0.25s ease, box-shadow 0.35s ease;
}

.sigil-card:hover {
  border-color: rgba(228, 228, 231, 0.38);
  box-shadow: 0 12px 32px -12px rgba(228, 228, 231, 0.12);
}

.sigil-card::before,
.sigil-card::after {
  content: '';
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
  z-index: 15;
}

.sigil-card::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid rgba(228, 228, 231, 0.55);
  border-left: 1px solid rgba(228, 228, 231, 0.55);
}

.sigil-card::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 1px solid rgba(228, 228, 231, 0.55);
  border-right: 1px solid rgba(228, 228, 231, 0.55);
}

.btn-chrome {
  background: linear-gradient(135deg, #F4F4F5 0%, #D4D4D8 50%, #A1A1AA 100%);
  color: #09090B;
  font-weight: 600;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.btn-chrome:active {
  transform: scale(0.98);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

input, select, textarea {
  font-size: 16px !important;
}

.sheet-enter {
  animation: sheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sheetSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0.4;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.carousel-img {
  transition: opacity 0.2s ease-in-out;
}

.canvas-container {
  margin: 0 auto !important;
  touch-action: pan-y;
}

#header-brand-block {
  transition: max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, margin-top 0.25s ease;
  max-height: 140px;
  opacity: 1;
  overflow: hidden;
}

#header-brand-block.brand-collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  margin-top: 0 !important;
  pointer-events: none;
}

/* ==================== PALCO DO ALTAR EM TELA CHEIA ==================== */
#iphone-15-screen.altar-fullscreen {
  overflow: hidden !important;
}

#iphone-15-screen.altar-fullscreen > header,
#iphone-15-screen.altar-fullscreen > nav,
#iphone-15-screen.altar-fullscreen > #ios-install-banner {
  display: none !important;
}

#view-altar.altar-is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 35;
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
  height: 100%;
  display: block !important;
  background-color: #FFFFFF;
}

#view-altar.altar-is-fullscreen.altar-dark-bg {
  background-color: #09090B;
}

#view-altar.altar-is-fullscreen #altar-stage-row {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#view-altar.altar-is-fullscreen #altar-stage-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

#view-altar.altar-is-fullscreen #altar-top-bar {
  position: absolute;
  top: max(10px, var(--safe-top));
  left: 10px;
  right: 10px;
  z-index: 25;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(9, 9, 11, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

#view-altar.altar-is-fullscreen #altar-side-toolbar {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

#view-altar.altar-is-fullscreen #altar-stage-hint {
  display: none !important;
}

#view-altar.altar-is-fullscreen #altar-bottom-drawer {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: max(10px, var(--safe-bottom));
  z-index: 25;
  background: rgba(9, 9, 11, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}