/* Production Final Gift — approved visual grammar from final-lab.
   Scoped so Finding, composer, and chat chrome stay untouched. */

.gift-root {
  position: relative;
  margin: 0;
}

.gift-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--gold, #c9a56a);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.gift-kicker svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  filter: drop-shadow(0 0 5px rgba(223, 192, 137, 0.9));
}

.gift-root .gift-surface {
  position: relative;
  overflow: hidden;
  padding: 20px 18px 14px;
  border-radius: 30px;
  background:
    radial-gradient(88% 78% at 6% 0%, rgba(255, 226, 164, 0.58), transparent 56%),
    radial-gradient(78% 68% at 100% 10%, rgba(186, 160, 220, 0.42), transparent 58%),
    radial-gradient(70% 48% at 50% 100%, rgba(255, 248, 236, 0.5), transparent 62%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.97), rgba(247, 239, 228, 0.94));
  box-shadow:
    0 18px 44px rgba(90, 68, 48, 0.07),
    0 0 0 1px rgba(255, 255, 255, 0.82) inset,
    0 0 64px rgba(240, 215, 168, 0.28);
}

.gift-root .bloom {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(28px);
}

.gift-root .bloom.gold {
  top: -18%;
  left: -12%;
  width: 58%;
  height: 42%;
  background: rgba(240, 215, 168, 0.42);
}

.gift-root .bloom.lavender {
  top: -8%;
  right: -14%;
  width: 54%;
  height: 38%;
  background: rgba(186, 160, 220, 0.32);
}

.gift-root .insight-found {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--display, "Cormorant Garamond", Palatino, Georgia, serif);
  font-size: 1.36rem;
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.22;
}

.gift-root .portrait {
  position: relative;
  display: none;
  min-height: 488px;
  isolation: isolate;
}

.gift-root .field {
  position: absolute;
  inset: 56px 18px 72px;
  z-index: 0;
  border-radius: 48%;
  background: radial-gradient(circle at 50% 46%, rgba(255, 248, 236, 0.55), transparent 68%);
  filter: blur(8px);
  pointer-events: none;
}

.gift-root .unknown-field {
  position: absolute;
  top: 96px;
  right: 4px;
  z-index: 0;
  width: 168px;
  height: 210px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 52% 42%, rgba(196, 178, 226, 0.16), rgba(244, 238, 230, 0.02) 58%, transparent 74%);
  filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 820ms ease;
}

.gift-root .world {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gift-root .handoff {
  position: absolute;
  left: 50%;
  top: -8px;
  z-index: 5;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #fff8ea;
  opacity: 0;
  box-shadow: 0 0 14px 4px rgba(240, 215, 168, 0.7);
  pointer-events: none;
}

.gift-root.is-handoff .handoff {
  animation: gift-handoff 420ms ease 1 both;
}

.gift-root .memory {
  position: absolute;
  z-index: 2;
  top: 0;
  max-width: 118px;
  color: #9a9186;
  font-size: 0.5rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 0;
}

.gift-root .memory b {
  display: block;
  margin-top: 3px;
  color: #7a7268;
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.28;
}

.gift-root .memory.is-first { left: 0; }
.gift-root .memory.is-changed { right: 0; text-align: right; }

.gift-root .now-insight {
  position: absolute;
  left: 58px;
  right: 58px;
  z-index: 3;
  margin: 0;
  color: var(--ink, #2b261f);
  font-family: var(--display, "Cormorant Garamond", Palatino, Georgia, serif);
  font-size: 1.32rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.16;
  text-align: center;
  opacity: 0;
}

.gift-root .now-insight em {
  display: block;
  margin-bottom: 5px;
  color: var(--gold, #c9a56a);
  font-family: var(--sans, Outfit, "Segoe UI", sans-serif);
  font-size: 0.52rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.7;
}

.gift-root .now-insight span { display: block; }

.gift-root .still-open {
  position: absolute;
  z-index: 3;
  margin: 0;
  color: #9a9186;
  font-size: 0.48rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
}

.gift-root .still-open b {
  display: block;
  margin-top: 2px;
  color: #8a8176;
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.28;
}

.gift-root .thought {
  position: absolute;
  z-index: 2;
  width: 118px;
  margin-left: -59px;
  text-align: center;
  opacity: 0;
  transition: opacity 360ms ease;
}

.gift-root .thought .name {
  display: block;
  color: var(--ink, #2b261f);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.22;
}

.gift-root .sphere {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 7px;
  border-radius: 50%;
}

.gift-root .thought.is-major .sphere { width: 52px; height: 52px; }
.gift-root .thought.is-pivot .sphere { width: 56px; height: 56px; }
.gift-root .thought.is-near .sphere { width: 34px; height: 34px; }
.gift-root .thought.is-far .sphere { width: 48px; height: 48px; }
.gift-root .thought.is-soft .sphere { width: 40px; height: 40px; }

.gift-root .thought.is-gold .sphere {
  background: radial-gradient(circle at 34% 30%, #fffaf0 0%, #f3dcab 28%, #d4b06a 70%, #c49a4e 100%);
  box-shadow:
    0 0 16px 5px rgba(240, 215, 168, 0.48),
    0 0 36px 10px rgba(223, 192, 137, 0.22),
    inset 0 -8px 14px rgba(160, 110, 40, 0.1);
}

.gift-root .thought.is-lavender .sphere {
  background: radial-gradient(circle at 34% 30%, #faf5ff 0%, #ccbae8 30%, #8f6fbe 74%, #6d5a96 100%);
  box-shadow:
    0 0 16px 5px rgba(196, 178, 226, 0.44),
    0 0 36px 12px rgba(143, 111, 190, 0.22),
    inset 0 -8px 14px rgba(70, 50, 110, 0.14);
}

.gift-root .thought.is-cool .sphere {
  background: radial-gradient(circle at 34% 30%, #f7f4fb 0%, #c5b7d8 34%, #8a7aa4 78%);
  box-shadow:
    0 0 14px 4px rgba(186, 170, 210, 0.32),
    inset 0 -8px 14px rgba(70, 58, 92, 0.12);
}

.gift-root .possibility {
  display: block;
  position: relative;
  width: 62px;
  height: 62px;
  margin: 0 auto 8px;
}

.gift-root .possibility-haze {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 42% 36%,
    rgba(250, 245, 255, 0.2) 0%,
    rgba(196, 178, 226, 0.1) 46%,
    transparent 76%
  );
  filter: blur(5px);
  opacity: 0.16;
}

.gift-root .possibility-rim {
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: conic-gradient(
    from 198deg,
    rgba(186, 160, 220, 0) 0deg,
    rgba(201, 184, 226, 0.62) 32deg,
    rgba(186, 160, 220, 0.22) 86deg,
    rgba(186, 160, 220, 0) 128deg,
    rgba(186, 160, 220, 0) 232deg,
    rgba(196, 178, 226, 0.42) 278deg,
    rgba(186, 160, 220, 0) 328deg
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.55px), #000 calc(100% - 1.35px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 1.55px), #000 calc(100% - 1.35px));
  opacity: 0.2;
}

.gift-root .possibility::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  box-shadow: inset 0 0 14px rgba(196, 178, 226, 0.1);
  opacity: 0;
}

.gift-root .thought.is-unknown .name {
  color: #6a6174;
  font-weight: 400;
}

.gift-root .arc,
.gift-root .tension,
.gift-root .branch,
.gift-root .probe-path {
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

.gift-root .open-path {
  fill: none;
  stroke: rgba(139, 122, 168, 0.28);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-dasharray: 1.8 9;
  opacity: 0;
}

.gift-root .open-path.is-fade {
  stroke-dasharray: none;
  stroke-width: 1.2;
}

.gift-root .traveler { opacity: 0; }
.gift-root .traveler-core {
  fill: #fff8ea;
  filter: drop-shadow(0 0 2.4px rgba(255, 248, 234, 1)) drop-shadow(0 0 6px rgba(240, 215, 168, 0.9));
}
.gift-root .traveler-halo { fill: rgba(240, 215, 168, 0.5); }
.gift-root .traveler-tail { fill: rgba(255, 248, 234, 0.5); }

.gift-root .glint {
  position: absolute;
  top: 42%;
  left: 50%;
  z-index: 6;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  background: #fff8ea;
  opacity: 0;
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%);
  filter: drop-shadow(0 0 10px rgba(240, 215, 168, 1));
  pointer-events: none;
}

.gift-reading {
  margin: 18px 8px 0;
  color: #8a8176;
  font-size: 0.74rem;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
}

.gift-root[data-composition="loop"] .now-insight { top: 178px; left: 78px; right: 78px; font-size: 1.18rem; }
.gift-root[data-composition="tension-branch"] .now-insight { top: 408px; left: 22px; right: 22px; font-size: 1.16rem; }
.gift-root[data-composition="held-unknown"] .now-insight,
.gift-root[data-composition="trigger-path"] .now-insight,
.gift-root[data-composition="path"] .now-insight { top: 328px; left: 28px; right: 28px; font-size: 1.2rem; }

.gift-root[data-composition="loop"] .still-open { left: 10px; bottom: 6px; width: 132px; text-align: left; }
.gift-root[data-composition="tension-branch"] .still-open { right: 4px; bottom: 4px; width: 138px; text-align: right; }
.gift-root[data-composition="held-unknown"] .still-open,
.gift-root[data-composition="trigger-path"] .still-open,
.gift-root[data-composition="path"] .still-open { right: 2px; bottom: 8px; width: 146px; text-align: right; }

.gift-root.is-found .portrait,
.gift-root.is-travel .portrait { display: none; }
.gift-root.is-found .insight-found,
.gift-root.is-travel .insight-found { display: block; }
.gift-root:not(.is-found):not(.is-travel) .insight-found { display: none; }
.gift-root:not(.is-found):not(.is-travel) .portrait { display: block; }

.gift-root.is-enter .memory,
.gift-root.is-handoff .memory,
.gift-root.is-certainty .memory,
.gift-root.is-thinking .memory,
.gift-root.is-problems .memory,
.gift-root.is-uncertainty .memory,
.gift-root.is-return .memory,
.gift-root.is-tension .memory,
.gift-root.is-branch .memory,
.gift-root.is-split .memory,
.gift-root.is-known .memory,
.gift-root.is-probe .memory,
.gift-root.is-lookable .memory,
.gift-root.is-now .memory,
.gift-root.is-glint .memory { opacity: 0.58; }

.gift-root.is-settled .memory { opacity: 0.2; }

.gift-root.is-certainty .thought.is-certainty,
.gift-root.is-thinking .thought.is-certainty,
.gift-root.is-problems .thought.is-certainty,
.gift-root.is-uncertainty .thought.is-certainty,
.gift-root.is-return .thought.is-certainty,
.gift-root.is-enter .thought.is-certainty,
.gift-root.is-now .thought.is-certainty,
.gift-root.is-glint .thought.is-certainty,
.gift-root.is-settled .thought.is-certainty,
.gift-root.is-thinking .thought.is-thinking,
.gift-root.is-problems .thought.is-thinking,
.gift-root.is-uncertainty .thought.is-thinking,
.gift-root.is-return .thought.is-thinking,
.gift-root.is-now .thought.is-thinking,
.gift-root.is-glint .thought.is-thinking,
.gift-root.is-settled .thought.is-thinking,
.gift-root.is-problems .thought.is-problems,
.gift-root.is-uncertainty .thought.is-problems,
.gift-root.is-return .thought.is-problems,
.gift-root.is-now .thought.is-problems,
.gift-root.is-glint .thought.is-problems,
.gift-root.is-settled .thought.is-problems,
.gift-root.is-uncertainty .thought.is-uncertainty,
.gift-root.is-return .thought.is-uncertainty,
.gift-root.is-now .thought.is-uncertainty,
.gift-root.is-glint .thought.is-uncertainty,
.gift-root.is-settled .thought.is-uncertainty { opacity: 1; }

.gift-root.is-settled .thought.is-problems { opacity: 0.86; }

.gift-root.is-tension .thought.is-fear,
.gift-root.is-branch .thought.is-fear,
.gift-root.is-split .thought.is-fear,
.gift-root.is-now .thought.is-fear,
.gift-root.is-glint .thought.is-fear,
.gift-root.is-settled .thought.is-fear,
.gift-root.is-tension .thought.is-yes,
.gift-root.is-branch .thought.is-yes,
.gift-root.is-split .thought.is-yes,
.gift-root.is-now .thought.is-yes,
.gift-root.is-glint .thought.is-yes,
.gift-root.is-settled .thought.is-yes,
.gift-root.is-branch .thought.is-relief,
.gift-root.is-split .thought.is-relief,
.gift-root.is-now .thought.is-relief,
.gift-root.is-glint .thought.is-relief,
.gift-root.is-settled .thought.is-relief,
.gift-root.is-now .thought.is-resentment,
.gift-root.is-glint .thought.is-resentment,
.gift-root.is-settled .thought.is-resentment { opacity: 1; }

.gift-root.is-known .thought.is-held,
.gift-root.is-probe .thought.is-held,
.gift-root.is-lookable .thought.is-held,
.gift-root.is-now .thought.is-held,
.gift-root.is-glint .thought.is-held,
.gift-root.is-settled .thought.is-held,
.gift-root.is-known .thought.is-h0,
.gift-root.is-probe .thought.is-h0,
.gift-root.is-lookable .thought.is-h0,
.gift-root.is-now .thought.is-h0,
.gift-root.is-glint .thought.is-h0,
.gift-root.is-settled .thought.is-h0 { opacity: 1; }

.gift-root.is-known .thought.is-unknown { opacity: 0.55; }
.gift-root.is-probe .thought.is-unknown { opacity: 0.72; }
.gift-root.is-lookable .thought.is-unknown,
.gift-root.is-now .thought.is-unknown,
.gift-root.is-glint .thought.is-unknown,
.gift-root.is-settled .thought.is-unknown { opacity: 1; }

.gift-root.is-known .unknown-field { opacity: 0.16; }
.gift-root.is-probe .unknown-field { opacity: 0.3; }
.gift-root.is-lookable .unknown-field,
.gift-root.is-now .unknown-field,
.gift-root.is-glint .unknown-field { opacity: 0.4; }

.gift-root.is-settled .unknown-field {
  opacity: 0.52;
  background:
    radial-gradient(
      ellipse 68% 62% at 48% 42%,
      rgba(186, 160, 220, 0.22) 0%,
      rgba(196, 178, 226, 0.08) 36%,
      rgba(244, 238, 230, 0) 74%
    );
  filter: blur(32px);
}

.gift-root.is-lookable .possibility-rim,
.gift-root.is-now .possibility-rim,
.gift-root.is-glint .possibility-rim,
.gift-root.is-settled .possibility-rim {
  opacity: 0.78;
  filter: drop-shadow(0 0 8px rgba(186, 160, 220, 0.26));
}

.gift-root.is-lookable .possibility-haze,
.gift-root.is-now .possibility-haze,
.gift-root.is-glint .possibility-haze,
.gift-root.is-settled .possibility-haze {
  opacity: 0.58;
  transform: scale(1.06);
}

.gift-root.is-lookable .possibility::after,
.gift-root.is-now .possibility::after,
.gift-root.is-glint .possibility::after,
.gift-root.is-settled .possibility::after { opacity: 1; }

.gift-root.is-now .now-insight,
.gift-root.is-glint .now-insight,
.gift-root.is-settled .now-insight { opacity: 1; }

.gift-root.is-settled .now-insight em { opacity: 0.22; }

.gift-root.is-now .still-open,
.gift-root.is-glint .still-open { opacity: 0.32; }
.gift-root.is-settled .still-open { opacity: 0.46; }

.gift-root.is-now .open-path,
.gift-root.is-glint .open-path,
.gift-root.is-settled .open-path { opacity: 0.55; }

.gift-root.is-now .gift-reading,
.gift-root.is-glint .gift-reading { opacity: 0.28; }
.gift-root.is-settled .gift-reading,
.gift-root.is-now ~ .gift-reading,
.gift-root.is-settled ~ .gift-reading { opacity: 0.42; }

.gift-root.is-now .gift-reading,
.gift-root.is-glint .gift-reading,
.gift-root.is-settled .gift-reading {
  /* reading sits outside portrait; parent scene class lives on gift-root */
}

.gift-root.is-now + .gift-reading,
.gift-root.is-settled + .gift-reading {
  opacity: 0.42;
}

.gift-root.is-now .arc,
.gift-root.is-glint .arc,
.gift-root.is-settled .arc,
.gift-root.is-now .tension,
.gift-root.is-glint .tension,
.gift-root.is-settled .tension,
.gift-root.is-now .branch,
.gift-root.is-glint .branch,
.gift-root.is-settled .branch,
.gift-root.is-now .probe-path,
.gift-root.is-glint .probe-path,
.gift-root.is-settled .probe-path,
.gift-root.is-return .arc,
.gift-root.is-lookable .probe-path {
  stroke-dashoffset: 0;
  opacity: 1;
}

.gift-root.is-glint .glint { animation: gift-glint 420ms ease 1 both; }

.gift-root.is-settled .thought.is-gold .sphere,
.gift-root.is-settled .thought.is-lavender .sphere,
.gift-root.is-settled .thought.is-cool .sphere {
  animation: gift-orb-breathe 8.8s ease-in-out infinite;
}

.gift-root.is-settled .thought.is-unknown.is-attend .possibility-rim {
  animation: gift-attend-rim 760ms ease 1 both;
}

@keyframes gift-handoff {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  35% { opacity: 1; transform: translateY(36px) scale(1); }
  100% { opacity: 0; transform: translateY(92px) scale(0.4); }
}

@keyframes gift-glint {
  0% { opacity: 0; transform: scale(0.4); }
  35% { opacity: 1; transform: scale(1.18); }
  100% { opacity: 0; transform: scale(0.8); }
}

@keyframes gift-orb-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.06); }
}

@keyframes gift-attend-rim {
  0% { opacity: 0.4; }
  42% { opacity: 0.86; }
  100% { opacity: 0.78; }
}

@media (max-width: 370px) {
  .gift-root .thought { width: 104px; margin-left: -52px; }
  .gift-root .thought .name { font-size: 0.68rem; }
  .gift-root .now-insight { font-size: 1.12rem; left: 42px; right: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .gift-root .glint,
  .gift-root .handoff,
  .gift-root .sphere { animation: none !important; }
  .gift-root .arc,
  .gift-root .tension,
  .gift-root .branch,
  .gift-root .probe-path { stroke-dashoffset: 0; opacity: 1; }
}
