/* =========================================================================
   The Druid Circle — Approved Interactive Mobile-First Intro Cinema
   Strictly scoped to .stage.in-intro, #introPhoneWrap, #iosNotif, #introSubtitle, #introWelcomeCard
   Zero interference with live /druid main Circle, .mobile-tabbar, .rc-thumb-deck, or Runestone!
   ========================================================================= */

.stage.in-intro .dock,
.stage.in-intro .city-phone {
  display: none !important;
}

.stage.in-intro .scene-layer {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  height: 100vh;
  background-size: cover !important;
  image-rendering: pixelated;
}
@supports (height: 100dvh) {
  .stage.in-intro .scene-layer { height: 100dvh !important; }
}

.stage.in-intro #emberCanvas {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  z-index: 6 !important;
}

.stage.in-intro .topbar {
  background: linear-gradient(180deg, rgba(4, 8, 9, 0.72), transparent);
  border-bottom: none;
  z-index: 50;
}

/* Ramparts smooth mobile pan & Wilderness mobile stillness */
#scene-ramparts {
  background-position: 50% 50%;
}
#scene-wilderness {
  background-position: 50% 50%;
}
@media (max-width: 820px) {
  #scene-city { background-position: 50% 12%; }
  #scene-wilderness { background-position: 68% 50% !important; }
}

/* Beat 4: 2.5D Parallax Spooky Walk-In Scene */
#scene-walkin {
  overflow: hidden;
  background: #040709;
}
@keyframes walkinFarPush {
  0%   { transform: translate3d(0, 0, 0) scale(1.00); }
  100% { transform: translate3d(0, 0, 0) scale(1.16); }
}
@keyframes walkinMidPinesPush {
  0%   { transform: translate3d(0, 0, 0) scale(1.00); opacity: 1; }
  75%  { opacity: 0.90; }
  100% { transform: translate3d(0, 0, 0) scale(1.62); opacity: 0.55; }
}
@keyframes walkinFgArchPush {
  0%   { transform: translate3d(0, 0, 0) scale(1.00); opacity: 1; }
  68%  { opacity: 0.92; }
  100% { transform: translate3d(0, 0, 0) scale(2.18); opacity: 0; }
}
#scene-walkin #walkBg,
#scene-walkin #walkMidPines,
#scene-walkin #walkFgArch {
  position: absolute; inset: -3%; width: 106%; height: 106%;
  object-fit: cover; object-position: 50% 54%;
  transform-origin: 50% 54%; will-change: transform, opacity;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  image-rendering: pixelated; pointer-events: none; user-select: none;
  transform: translate3d(0, 0, 0) scale(1.00);
}
#scene-walkin #walkBg       { z-index: 1; }
#scene-walkin #walkMidPines { z-index: 2; }
#scene-walkin #walkFgArch   { z-index: 3; }
#scene-walkin.active #walkBg       { animation: walkinFarPush      7.6s cubic-bezier(0.22, 0.08, 0.24, 1) forwards; }
#scene-walkin.active #walkMidPines { animation: walkinMidPinesPush 7.6s cubic-bezier(0.22, 0.08, 0.24, 1) forwards; }
#scene-walkin.active #walkFgArch   { animation: walkinFgArchPush   7.6s cubic-bezier(0.22, 0.08, 0.24, 1) forwards; }
#scene-walkin .walk-pine-band {
  position: absolute; top: -10%; bottom: -10%; width: 34%;
  pointer-events: none; z-index: 4; will-change: transform, opacity;
}
#scene-walkin #walkPineLeft {
  left: -6%;
  background:
    radial-gradient(ellipse 70% 40% at 15% 18%, rgba(4, 10, 8, 0.42) 55%, transparent 72%),
    radial-gradient(ellipse 80% 42% at 10% 46%, rgba(3, 8, 7, 0.46) 58%, transparent 75%),
    radial-gradient(ellipse 85% 44% at 12% 76%, rgba(2, 6, 5, 0.48) 60%, transparent 78%),
    linear-gradient(90deg, rgba(2, 5, 5, 0.45) 0%, rgba(4, 9, 8, 0.25) 48%, transparent 100%);
}
#scene-walkin #walkPineRight {
  right: -6%;
  background:
    radial-gradient(ellipse 70% 40% at 85% 20%, rgba(4, 10, 8, 0.42) 55%, transparent 72%),
    radial-gradient(ellipse 80% 42% at 90% 48%, rgba(3, 8, 7, 0.46) 58%, transparent 75%),
    radial-gradient(ellipse 85% 44% at 88% 78%, rgba(2, 6, 5, 0.48) 60%, transparent 78%),
    linear-gradient(270deg, rgba(2, 5, 5, 0.45) 0%, rgba(4, 9, 8, 0.25) 48%, transparent 100%);
}
#scene-walkin #walkVignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(ellipse at 50% 54%, rgba(255,155,60,0.04) 0%, rgba(4,8,9,0.22) 56%, rgba(2,4,5,0.82) 100%);
}

/* Real iOS-Style Drop-Down Push Notification (Mobile Opening Beat) */
#iosNotif {
  position: fixed;
  top: calc(max(10px, env(safe-area-inset-top)) + 44px);
  left: 12px; right: 12px;
  z-index: 62;
  display: none;
  align-items: flex-start; gap: 11px;
  padding: 12px 14px; border-radius: 16px;
  background: rgba(16, 22, 30, 0.94);
  border: 1px solid rgba(232, 187, 94, 0.45);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.72);
  transform: translateY(-145%); opacity: 0; pointer-events: none;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}
@media (max-width: 820px) {
  #iosNotif { display: flex; }
}
#iosNotif.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
#iosNotif .notif-icon {
  flex: 0 0 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #12241b, #09120e);
  border: 1px solid rgba(232, 187, 94, 0.6);
  display: flex; align-items: center; justify-content: center;
  color: #f8d88a; font-size: 16px; font-weight: 700;
}
#iosNotif .notif-content { flex: 1; min-width: 0; }
#iosNotif .notif-top {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px; color: #96adbe; margin-bottom: 3px; letter-spacing: 0.04em;
}
#iosNotif .notif-app { color: #e8bb5e; font-weight: 700; text-transform: uppercase; }
#iosNotif .notif-msg {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-size: 13px; line-height: 1.38; color: #f1f5f9;
}

/* Interactive Cyberpunk iPhone (Desktop 9:19.5 silhouette; Mobile full-bleed 4th-wall takeover!) */
#introPhoneWrap {
  position: fixed;
  right: 5.5%; bottom: 9%;
  width: min(318px, 27vw);
  height: min(610px, 78vh);
  z-index: 36;
  display: none;
  transform: translateY(130%); opacity: 0; pointer-events: none;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.55s ease;
}
#introPhoneWrap.active { display: block; }
#introPhoneWrap.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
#introPhoneWrap.dropped { transform: translateY(135%) rotate(5deg); opacity: 0; pointer-events: none; }

#introPhoneWrap .ic-chassis {
  position: relative;
  width: 100%; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(180deg, #0b121c 0%, #05080f 100%);
  border: 2.5px solid rgba(232, 187, 94, 0.48);
  border-radius: 34px;
  padding: 46px 16px 26px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.9), 0 0 0 5px #090e13, 0 0 28px rgba(88, 213, 255, 0.14);
  font-family: var(--font-mono);
}
#introPhoneWrap .ic-chassis::before {
  content: "";
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 72px; height: 18px; border-radius: 10px;
  background: #020406; border: 1px solid rgba(255,255,255,0.08);
}
#introPhoneWrap .ic-chassis::after {
  content: "";
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 4px; border-radius: 3px;
  background: rgba(230, 240, 245, 0.28);
}
#introPhoneWrap .ic-notch {
  position: absolute; top: 14px; left: 16px; right: 16px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 9px; color: #7ca8be; pointer-events: none;
}
#introPhoneWrap .ic-prompt {
  font-size: 13px; font-weight: 700; color: #eaf6ff; line-height: 1.35; margin-bottom: 10px;
}
#introPhoneWrap .ic-input-row {
  display: flex; gap: 6px; margin-bottom: 9px;
}
#icTickerInput {
  flex: 1; min-width: 0;
  background: #0d1826; color: #fff;
  border: 1px solid rgba(88, 213, 255, 0.55);
  border-radius: 8px; padding: 10px 11px;
  font: 700 14px/1.1 var(--font-mono);
  outline: none;
}
#icTickerInput:focus { border-color: #e8bb5e; box-shadow: 0 0 0 2px rgba(232,187,94,0.22); }
#icBtnCheck {
  background: linear-gradient(180deg, #58d5ff, #2794c4);
  color: #031018; border: none; border-radius: 8px;
  padding: 0 13px; font: 800 12px/1 var(--font-mono); cursor: pointer;
}
#introPhoneWrap .ic-pills {
  display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px;
}
#introPhoneWrap .ic-pill {
  background: rgba(88, 213, 255, 0.08); border: 1px solid rgba(88, 213, 255, 0.28);
  color: #9ddcf4; border-radius: 6px; padding: 4px 8px; font-size: 10.5px; cursor: pointer;
}
#introPhoneWrap .ic-pill:hover { border-color: #e8bb5e; color: #f8d88a; }
#introPhoneWrap .ic-pill.major { border-color: rgba(74, 222, 128, 0.35); color: #86efac; }

#icVenueRows { display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
#icVenueRows .ic-vrow {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(15, 24, 38, 0.9); border: 1px solid rgba(88,213,255,0.18);
  font-size: 11px; color: #dce8f2; opacity: 0.50; transition: all 0.22s ease;
}
#icVenueRows .ic-vrow.checking { opacity: 1; border-color: #58d5ff; box-shadow: 0 0 12px rgba(88,213,255,0.18); }
#icVenueRows .ic-vrow.miss { opacity: 1; border-color: rgba(248, 113, 113, 0.55); background: rgba(45, 14, 18, 0.72); }
#icVenueRows .ic-vrow.hit { opacity: 1; border-color: rgba(74, 222, 128, 0.65); background: rgba(14, 42, 28, 0.78); }
#icVenueRows .ic-vstatus { font-weight: 700; font-size: 10.5px; }
#icVenueRows .ic-vrow.miss .ic-vstatus { color: #f87171; }
#icVenueRows .ic-vrow.hit .ic-vstatus { color: #4ade80; }
#icVenueRows .ic-vrow a { color: #4ade80; text-decoration: none; font-weight: 700; }

#icOutcomeBox {
  margin-top: 10px; padding: 10px; border-radius: 8px;
  display: none; font-size: 11.5px; line-height: 1.45;
}
#icOutcomeBox.listed {
  display: block; background: rgba(16, 40, 29, 0.94);
  border: 1px solid rgba(74, 222, 128, 0.55); color: #dcfce7;
}
#icOutcomeBox.unlisted {
  display: block; background: rgba(46, 20, 14, 0.94);
  border: 1px solid rgba(232, 187, 94, 0.6); color: #fef3c7;
}
#icOutcomeBox .ic-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
#icOutcomeBox button {
  font: 700 10.5px/1.2 var(--font-mono); padding: 7px 10px; border-radius: 7px; cursor: pointer;
  border: 1px solid rgba(232,187,94,0.5); background: rgba(20, 28, 24, 0.95); color: #f8d88a;
}
#icOutcomeBox button.go-wild {
  background: linear-gradient(180deg, #e8bb5e, #c89636); color: #09100d; border-color: #f8d88a;
}

@media (max-width: 820px) {
  #introPhoneWrap {
    inset: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100vw !important; height: 100dvh !important;
    z-index: 54;
    transform: translateY(0) scale(1);
    transition: transform 1.05s cubic-bezier(0.32, 0, 0.2, 1), opacity 0.82s ease;
  }
  #introPhoneWrap.open { transform: translateY(0) scale(1); opacity: 1; }
  #introPhoneWrap.dropped { transform: translateY(112%) scale(0.94); opacity: 0; }
  #introPhoneWrap .ic-chassis {
    border-radius: 0; border: none; box-shadow: none;
    padding: max(96px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, #070d16 0%, #04070c 100%);
  }
  #introPhoneWrap .ic-chassis::before,
  #introPhoneWrap .ic-chassis::after,
  #introPhoneWrap .ic-notch { display: none; }
  #introPhoneWrap .ic-prompt { font-size: 16px; margin-bottom: 14px; }
  #icVenueRows .ic-vrow { padding: 11px 12px; font-size: 13px; }
  #icVenueRows .ic-vstatus { font-size: 12px; }
}

/* Cinematic Narrator Subtitle Bar (Intro Beats I-IV) */
#introSubtitle {
  position: fixed;
  left: 50%; bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(760px, 92vw);
  text-align: center;
  padding: 12px 22px; border-radius: 11px;
  background: rgba(6, 10, 12, 0.90);
  border: 1px solid rgba(232, 187, 94, 0.44);
  font-family: var(--font-serif, Georgia, serif);
  font-size: clamp(15px, 1.55vw, 20px); line-height: 1.42;
  color: #f4efe3;
  z-index: 46;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, left 0.35s ease;
}
#introSubtitle.city-left { left: 34%; max-width: min(560px, 56vw); }
#introSubtitle.show { opacity: 1; pointer-events: auto; }
#introSubtitle em { color: #f8d88a; font-style: italic; }
#introSubtitle .ic-sub-row { margin-top: 10px; display: flex; justify-content: center; }
#introSubtitle .ic-sub-btn {
  font: 700 12px/1 var(--font-mono); padding: 9px 16px; border-radius: 8px; cursor: pointer;
  background: linear-gradient(180deg, #e8bb5e, #c89636); color: #09100d;
  border: 1px solid #f8d88a; letter-spacing: 0.03em;
}
@media (max-width: 820px) {
  #introSubtitle,
  #introSubtitle.city-left {
    left: 50% !important; width: 92vw; max-width: 92vw !important;
    font-size: 15px; padding: 12px 15px;
  }
}

/* First-Arrival Arch-Druid RPG Portrait Welcome Card (hands off cleanly into live /druid Circle!) */
#introWelcomeCard {
  position: fixed;
  left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  width: min(920px, 94vw);
  display: none;
  align-items: stretch; gap: 14px;
  padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(11, 18, 15, 0.96), rgba(6, 10, 9, 0.98));
  border: 2px solid rgba(232, 187, 94, 0.72);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.90), inset 0 0 24px rgba(232, 187, 94, 0.08);
  z-index: 64;
  transform: translate(-50%, 0);
}
#introWelcomeCard.show { display: flex; }
#introWelcomeCard .iw-portrait {
  flex: 0 0 92px; height: 92px; border-radius: 10px; overflow: hidden;
  border: 2px solid #d7a84f; background: #0a1014;
}
#introWelcomeCard .iw-portrait img {
  width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated;
}
#introWelcomeCard .iw-body {
  flex: 1; display: flex; flex-direction: column; justify-content: space-between; min-width: 0;
}
#introWelcomeCard .iw-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.09em;
  color: #e8bb5e; text-transform: uppercase; margin-bottom: 6px;
}
#introWelcomeCard .iw-badge {
  font-size: 10px; color: #4ade80; background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.4); border-radius: 5px; padding: 2px 7px;
}
#introWelcomeCard .iw-text {
  font-family: var(--font-serif, Georgia, serif);
  font-size: clamp(14px, 1.35vw, 17.5px); line-height: 1.44; color: #f5f2e8;
}
#introWelcomeCard .iw-actions {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
#introWelcomeCard .iw-btn {
  font: 700 11.5px/1.2 var(--font-mono); padding: 9px 14px; border-radius: 7px; cursor: pointer;
  border: 1px solid rgba(232,187,94,0.45); background: rgba(18, 28, 24, 0.96); color: #e2ebe5;
}
#introWelcomeCard .iw-btn.primary {
  background: linear-gradient(180deg, #e8bb5e, #c89636); color: #09100d; border-color: #f8d88a;
}
@media (max-width: 820px) {
  #stage.intro-welcome-open {
    --m-hero-h: clamp(295px, 44dvh, 415px);
    --m-hero-bottom: calc(var(--m-topbar-clear) + var(--m-hero-h));
  }
  #stage.intro-welcome-open .dock,
  #stage.intro-welcome-open #dock {
    display: none !important;
  }
  #introWelcomeCard {
    position: relative;
    left: auto; right: auto; bottom: auto;
    width: auto; transform: none;
    margin: 6px 10px 16px;
    padding: 12px 13px; gap: 10px;
    z-index: 64;
  }
  #introWelcomeCard .iw-portrait { flex: 0 0 68px; height: 68px; }
  #introWelcomeCard .iw-text { font-size: 14px; }
}

.stage.in-intro .scene-vignette {
  position: fixed !important;
  inset: 0 !important;
  height: 100dvh !important;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(3, 6, 8, 0.52) 100%) !important;
}

/* Hide main Circle dock while Arch-Druid Welcome modal is open (zero double dialogue boxes!) */
#stage.intro-welcome-open .dock,
#stage.intro-welcome-open #dock {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Desktop-only 1-Click Live iPhone Preview Toggle (hidden on real phones <= 820px!) */
@media (max-width: 820px) {
  #btnMobilePreview { display: none !important; }
}
#mobilePreviewOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  background: radial-gradient(ellipse at center, rgba(8, 16, 14, 0.96), rgba(2, 4, 5, 0.99));
  backdrop-filter: blur(10px);
}
#mobilePreviewOverlay.open { display: flex; }
#mobilePreviewOverlay .mp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(399px, 94vw);
}
#mobilePreviewOverlay .mp-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #e8bb5e;
}
#mobilePreviewOverlay .mp-bezel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(393px, 94vw);
  height: min(832px, 88vh);
  border-radius: 38px;
  border: 3px solid rgba(232, 187, 94, 0.50);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.94), 0 0 0 8px #0a0f12;
  overflow: hidden;
  background: #040709;
}
#mobilePreviewOverlay .mp-notch-bar {
  height: 20px;
  flex: 0 0 20px;
  background: #030608;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#mobilePreviewOverlay .mp-speaker {
  width: 64px;
  height: 6px;
  border-radius: 99px;
  background: #141a1e;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
#mobilePreviewFrame {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  border: none;
  display: block;
  background: #040709;
}
