/* Summon: one soul performs on a small stage. Page layout only; components live in felt.css. */

.theatre {
  position: relative; isolation: isolate; overflow: clip;
  padding: 26px clamp(18px, 4vw, 56px) 20px;
  background: radial-gradient(70% 55% at 22% 8%, #3a2654 0%, transparent 70%), var(--night);
}
.theatre::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0; background: var(--grain); background-size: 180px; mix-blend-mode: overlay; opacity: .2; }
.theatre::before { /* the house lights go down while a soul answers */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .6s var(--soft);
  background: radial-gradient(40% 60% at 24% 45%, transparent 0, rgba(12, 6, 20, .55) 70%);
}

/* small background props: SVG stars on threads */
.scenery { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hang-star { position: absolute; top: 0; display: flex; flex-direction: column; align-items: center; transform-origin: 50% 0; }
.hang-star .thread-line { height: var(--len); background: rgba(251, 241, 225, .3); }
.hang-star svg { width: 30px; height: 30px; margin-top: -2px; }
.hang-star.s1 { left: 3%; } .hang-star.s2 { right: 4%; }
.hang-star.s2 svg { width: 22px; height: 22px; }

.theatre-grid {
  position: relative; z-index: 2; display: grid; align-items: start;
  grid-template-columns: minmax(330px, .82fr) minmax(0, 1.18fr); gap: clamp(28px, 4vw, 72px);
  max-width: 1320px; margin: 0 auto;
}

/* ---------- the stage ---------- */
.stage {
  --gw: min(30vw, 430px); --len: 150px; --ax: .3964; --ay: .1796; --ar: .9446;
  position: sticky; top: 10px; height: min(calc(100svh - 112px), 780px); min-height: 560px;
}
.spot {
  position: absolute; left: 50%; top: -60px; width: 120%; height: calc(100% - 60px); translate: -50% 0; pointer-events: none;
  background:
    radial-gradient(48% 9% at 50% 88%, rgba(255, 214, 140, .26), transparent 70%),
    linear-gradient(rgba(255, 214, 140, .12), rgba(255, 214, 140, .03));
  clip-path: polygon(44% 0, 56% 0, 96% 92%, 4% 92%);
  opacity: .7; transition: opacity .6s var(--soft);
}
.spot::after { /* the pool of light on the boards */
  content: ""; position: absolute; left: 14%; right: 14%; bottom: 6%; height: 7%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 140, .3), transparent);
}
.puppet { position: absolute; left: 50%; top: -38px; width: 0; height: 0; transform-origin: 0 0; z-index: 2; }
.puppet-thread { position: absolute; left: -.75px; top: 0; height: calc(var(--len) + 38px); background: rgba(251, 241, 225, .5); }
.puppet .felt-ghost {
  position: absolute; width: var(--gw);
  left: calc(var(--gw) * var(--ax) * -1);
  top: calc(var(--len) + 38px - var(--gw) * var(--ar) * var(--ay));
}
.puppet .fg-shadow { display: none; }
.puppet.is-floating .puppet-thread { display: none; }
.puppet.is-floating .felt-ghost { top: 50px; }
.puppet.is-floating .fg-shadow { display: block; bottom: -10%; }
.floor {
  position: absolute; left: 2%; right: 2%; bottom: 112px; height: 54px; border-radius: 50% 50% 14px 14px / 100% 100% 14px 14px;
  background:
    radial-gradient(60% 80% at 50% 20%, rgba(255, 214, 140, .22), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(30, 14, 6, .35) 46px 48px),
    linear-gradient(#6b4424, #4a2d17);
  box-shadow: inset 0 3px 0 rgba(255, 220, 170, .18), 0 6px 0 #2e1a0c;
}
.floor::after { content: ""; position: absolute; left: 6%; right: 6%; top: 10px; border-top: 2px dashed rgba(255, 220, 160, .22); border-radius: 50%; }
.stage .meter { position: absolute; left: 0; right: 0; bottom: 0; gap: 6px; text-align: center; }
.stage .lights { margin: 0 2%; }
.stage .meter-text { font-size: 16px; }
.stage .meter-note { font-size: 14px; }

/* ---------- the script: intro, takes and the ask box ---------- */
.script { position: relative; display: flex; flex-direction: column; min-height: min(calc(100svh - 112px), 780px); padding-top: 22px; max-width: 760px; }
.intro .badge-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.price-tag { font-weight: 800; font-size: 17px; }
.intro .title { font-size: clamp(54px, 5.6vw, 92px); margin-bottom: .18em; }
.intro .lede { margin-bottom: 8px; }
.facts { margin: 0 0 4px; font-size: 18px; color: var(--lilac-text); }
.facts b { color: var(--cream); font-weight: 800; }
.rating { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 16px; font-weight: 700; color: var(--lilac-text); }
.rating svg { width: 18px; height: 18px; }
.intro .try { margin-top: 26px; }
.intro .slips { max-width: 640px; }
.other { margin: 14px 0 0; font-size: 16px; color: var(--lilac-text); }
.other .link-button { font-size: 16px; }
.script.has-takes .intro .title { font-size: clamp(40px, 3.6vw, 56px); }
.script.has-takes .intro .try, .script.has-takes .intro .facts, .script.has-takes .intro .rating, .script.has-takes .intro .lede { display: none; }
.script.has-takes .askbox .felt-input { min-height: 0; padding-bottom: 62px; }
.script.has-takes .askbox textarea { min-height: 52px; }
.take { scroll-margin-top: 18px; }

.takes { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 38px; }
.take { display: grid; gap: 18px; }
.take .asked { position: relative; z-index: 2; } /* the slip stays readable while the card drops past it */
.take .answer-text { max-width: 64ch; }
.referral { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding: 12px 16px 12px 10px; border-radius: 18px 22px 16px 20px; background: var(--cream-deep); position: relative; }
.referral::before { content: ""; position: absolute; inset: 5px; border: 2px dashed rgba(42, 27, 61, .25); border-radius: 13px 17px 11px 15px; pointer-events: none; }
.referral img { width: 84px; height: auto; margin: -6px 0; filter: drop-shadow(0 6px 6px rgba(42, 27, 61, .3)); }
.referral .who { display: grid; gap: 2px; margin-right: auto; position: relative; }
.referral .who b { font: 400 28px/1 var(--display); }
.referral .who span { font-size: 15px; color: var(--muted-ink); }
.referral .patch { position: relative; }

.dock { position: sticky; bottom: 0; z-index: 6; margin-top: auto; padding: 26px 0 16px; background: linear-gradient(rgba(42, 27, 61, 0), var(--night) 26px); }
.theatre.has-banner .dock { padding-top: 30px; }

/* no soul chosen yet: the question box comes first, results hang below it */
.script.is-search .dock { order: 1; position: static; margin-top: 8px; padding: 0; background: none; box-shadow: none; }
.script.is-search .dock::before { display: none; }
.script.is-search .results { order: 2; }
.script.is-search .browse { order: 3; }
.script.is-search .intro .title { font-size: clamp(52px, 5.2vw, 84px); }
.script.is-search .askbox .felt-input { min-height: 0; padding-bottom: 62px; }
.script.is-search .askbox textarea { min-height: 52px; }
.results { scroll-margin-top: 18px; }

/* ---------- soul search results: three souls lowered on hooks ---------- */
.results { margin-top: 30px; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rod-s { position: relative; height: 14px; margin: 8px -6px 0; border-radius: 7px; background: linear-gradient(#a06a37, #7c4f26 60%, #61391a); box-shadow: 0 3px 0 #4a2b12, 0 10px 14px rgba(0, 0, 0, .3); z-index: 1; }
.rod-s::after { content: ""; position: absolute; left: 4px; right: 4px; top: 6px; border-top: 1.5px dashed rgba(255, 220, 160, .55); }
.hooks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hooked { position: relative; }
.hooked > a { display: block; position: relative; color: inherit; text-decoration: none; padding-top: 0; border-radius: 18px; }
.hooked > a:focus-visible { outline: none; }
.hooked > a:focus-visible .rtag { outline: 3px solid var(--amber); outline-offset: 4px; }
.hooked .ring { position: absolute; left: 50%; top: -12px; margin-left: -7px; z-index: 2; }
.hooked-swing { display: block; transform-origin: 50% -6px; }
.hooked .thread-line { height: var(--len, 30px); margin: 0 auto; background: rgba(251, 241, 225, .55); }
.hooked-ghost { width: 100%; margin: -14% auto -10%; }
.hooked-ghost .fg-body img { filter: drop-shadow(0 14px 14px rgba(8, 3, 16, .55)); }
.hooked > a:focus-visible .hooked-ghost .fg-body img { filter: drop-shadow(0 0 3px var(--amber)) drop-shadow(0 0 3px var(--amber)) drop-shadow(0 14px 14px rgba(8, 3, 16, .55)); }
.rtag { position: relative; display: grid; gap: 4px; justify-items: center; text-align: center; width: 88%; margin: 0 auto; padding: 12px 12px 30px; background: var(--cream); color: var(--ink); border-radius: 18px 22px 16px 20px; box-shadow: 0 5px 0 #c7ad86, 0 10px 18px rgba(8, 3, 16, .35); rotate: -1.2deg; transition: translate .25s var(--squish); }
.hooked:nth-child(2) .rtag { rotate: 1.2deg; }
.rtag::before { content: ""; position: absolute; inset: 6px; border: 2px dashed rgba(42, 27, 61, .32); border-radius: 13px 17px 11px 15px; pointer-events: none; }
.rtag b { font: 400 30px/1 var(--display); }
.rtag .trade { font-size: 15px; color: var(--muted-ink); line-height: 1.3; }
.rtag .why { font-size: 15px; font-weight: 700; line-height: 1.35; margin-top: 4px; text-wrap: balance; }
.rtag::after { content: ""; position: absolute; left: 50%; bottom: 100%; width: 1.5px; height: 18px; background: rgba(251, 241, 225, .55); }
.rtag .match { font-size: 13px; font-weight: 800; color: var(--muted-ink); }
.rtag .go { position: absolute; left: 50%; bottom: -16px; translate: -50% 0; rotate: -3deg; white-space: nowrap; padding: 5px 13px 6px; border-radius: 12px; background: var(--coral); color: var(--ink); font: 400 21px/1 var(--display); box-shadow: 0 3px 0 var(--coral-edge); }
.hooked > a:hover .rtag { translate: 0 -3px; }

/* ---------- browse all 12 ---------- */
.browse { margin-top: 30px; }
.browse ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.tile { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; padding: 6px 10px 16px; border-radius: 22px 26px 20px 24px; background: var(--night-soft); color: var(--cream); text-decoration: none; box-shadow: 0 6px 0 var(--night-deep); transition: translate .25s var(--squish); min-height: 44px; }
.tile::before { content: ""; position: absolute; inset: 7px; border: 2px dashed rgba(251, 241, 225, .22); border-radius: 16px 20px 14px 18px; pointer-events: none; }
.tile img { width: 100%; height: auto; margin-bottom: -8%; }
.tile b { font: 400 27px/1 var(--display); }
.tile span.t { font-size: 14px; color: var(--lilac-text); line-height: 1.3; }
.tile:hover { translate: 0 -3px; }

/* ---------- the summoning: house lights down, one soul in the spotlight ---------- */
.intro, .results, .browse, .take, .dock, .scenery, .meter, .topbar { transition: opacity .55s var(--soft); }
body.is-summoning .theatre::before { opacity: 1; }
body.is-summoning .spot { opacity: 1; }
body.is-summoning .intro, body.is-summoning .take:not(.is-current), body.is-summoning .dock,
body.is-summoning .scenery, body.is-summoning .topbar, body.is-summoning .meter { opacity: .3; }
.thinking { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 800; color: var(--muted-ink); min-height: 1.6em; }
.thinking i { width: 8px; height: 8px; border-radius: 50%; background: var(--coral-ink); animation: dot 1.2s ease-in-out infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .25; translate: 0 0; } 40% { opacity: 1; translate: 0 -4px; } }

/* ---------- shorter desktops ---------- */
@media (min-width: 900px) and (max-height: 800px) {
  .stage { --gw: min(26vw, 360px); --len: 120px; min-height: 520px; }
  .intro .title { font-size: clamp(50px, 4.8vw, 76px); }
}

/* ---------- phone and narrow ---------- */
@media (max-width: 899px) {
  body.page-summon { padding-bottom: 104px; }
  .theatre { padding: 18px 16px 10px; }
  .theatre::before { background: radial-gradient(60% 30% at 50% 12%, transparent 0, rgba(12, 6, 20, .55) 70%); }
  .theatre-grid { grid-template-columns: 1fr; gap: 0; }
  .stage { --gw: 172px; --len: 22px; position: relative; top: auto; height: 252px; min-height: 0; }
  .puppet.is-floating .felt-ghost { top: 20px; left: calc(var(--gw) * -.45); }
  .floor { bottom: 74px; height: 34px; left: 18%; right: 18%; }
  .stage .meter { gap: 4px; }
  .stage .meter-text { font-size: 15px; }
  .stage .meter-text b { font-size: 24px; }
  .stage .meter-note { display: none; }
  .script { min-height: 0; padding-top: 6px; }
  .intro .title { font-size: 52px; }
  .script.has-takes .intro .title { font-size: 38px; }
  .intro .lede { font-size: 18px; }
  .facts { font-size: 17px; }
  .takes { gap: 30px; }
  .answer { padding: 26px 18px 22px; }
  .fly-bar { left: 4%; right: 4%; }

  .dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    background: var(--night-deep); box-shadow: 0 -10px 24px rgba(8, 3, 16, .5);
  }
  .dock::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; border-top: 2.4px dashed rgba(246, 181, 68, .45); }
  .askbox-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .askbox .felt-input { display: flex; align-items: flex-end; min-height: 0; padding: 0 6px 6px 0; }
  .askbox textarea { min-height: 52px; max-height: 120px; padding: 14px 16px 8px; font-size: 18px; }
  .askbox-row { position: static; padding: 0; width: auto; flex: none; }
  .askbox-hint { display: none; }
  .askbox .patch-sm { padding: 8px 14px 10px; font-size: 23px; }
  .dock .banner { margin: 6px 0 0; }

  .hooks { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 74%; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 4px 22px; scrollbar-width: none; }
  .hooks::-webkit-scrollbar { display: none; }
  .hooked { scroll-snap-align: center; }
  .browse ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .theatre::before, .spot { transition: none; }
}
