/* ============================================================
   Boos & Booze — spooky Halloween party invitation and RSVP
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Special+Elite&display=swap');

:root {
  --ink: #06040c;
  --night-1: #0e0819;
  --night-2: #170c26;
  --night-3: #241033;
  --night-4: #33121f;

  --pumpkin: #ff7a1a;
  --pumpkin-soft: #ffa855;
  --pumpkin-deep: #c14a05;
  --slime: #8dff5e;
  --slime-deep: #3f9e21;
  --blood: #a5121c;
  --bone: #f3ead6;
  --moon: #ffeec7;
  --ghost: #c9d4ff;
  --violet: #7b2ff7;
  --violet-soft: #b98cff;

  --fog: rgba(160, 140, 200, 0.09);
  --panel: rgba(14, 8, 24, 0.82);
  --panel-edge: rgba(255, 122, 26, 0.28);

  --display: 'Creepster', 'Papyrus', fantasy;
  --body: 'Special Elite', 'Courier New', ui-monospace, monospace;

  --glow-pumpkin: 0 0 12px rgba(255, 122, 26, 0.55), 0 0 34px rgba(255, 122, 26, 0.22);
  --glow-slime: 0 0 12px rgba(141, 255, 94, 0.5), 0 0 30px rgba(141, 255, 94, 0.18);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100%;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ============================================================
   Background scene — fixed, decorative, never interactive
   ============================================================ */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 45% at 78% 8%, rgba(255, 238, 199, 0.16), transparent 70%),
    radial-gradient(ellipse 90% 60% at 20% 100%, rgba(123, 47, 247, 0.16), transparent 70%),
    linear-gradient(180deg, var(--ink) 0%, var(--night-1) 26%, var(--night-2) 55%, var(--night-3) 80%, var(--night-4) 100%);
}

/* --- moon --- */
.moon {
  position: absolute;
  top: 1.5vh;
  right: 4vw;
  width: clamp(80px, 11vw, 160px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, #fffaf0 0%, var(--moon) 45%, #e6cf9c 78%, #cbb07c 100%);
  box-shadow:
    0 0 40px rgba(255, 238, 199, 0.5),
    0 0 120px rgba(255, 238, 199, 0.28),
    0 0 240px rgba(255, 214, 140, 0.14);
  animation: moon-breathe 9s ease-in-out infinite;
}
.moon::before,
.moon::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(150, 124, 84, 0.3);
}
.moon::before { width: 22%; height: 22%; top: 24%; left: 22%; }
.moon::after  { width: 14%; height: 14%; top: 58%; left: 55%; box-shadow: -1.6em 0.2em 0 -0.35em rgba(150,124,84,0.24); }

@keyframes moon-breathe {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.1); }
}

/* --- stars --- */
.star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.7;
  animation: twinkle 3.4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.7); }
  50%      { opacity: 0.95; transform: scale(1.35); }
}

/* --- drifting fog --- */
.fog {
  position: absolute;
  left: -50%;
  width: 200%;
  height: 44vh;
  background: radial-gradient(ellipse 42% 58% at 50% 50%, var(--fog), transparent 72%);
  filter: blur(14px);
}
.fog.f1 { bottom: -8vh;  animation: fog-drift 46s linear infinite; }
.fog.f2 { bottom: 12vh;  opacity: 0.7; animation: fog-drift 71s linear infinite reverse; }
.fog.f3 { top: 26vh;     opacity: 0.45; height: 30vh; animation: fog-drift 92s linear infinite; }

@keyframes fog-drift {
  from { transform: translateX(-14%); }
  to   { transform: translateX(14%); }
}

/* --- horizon: hills, fence, graves --- */
.horizon {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: min(38vh, 340px);
}
.horizon svg { width: 100%; height: 100%; display: block; }

/* --- bats --- */
.bat {
  position: absolute;
  width: 34px;
  color: #120a1f;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8));
  animation: bat-fly linear infinite;
}
.bat svg { width: 100%; height: auto; display: block; }
.bat .wing-l, .bat .wing-r { animation: bat-flap 0.34s ease-in-out infinite; }
.bat .wing-l { transform-origin: 50px 26px; }
.bat .wing-r { transform-origin: 50px 26px; }

@keyframes bat-flap {
  0%, 100% { transform: scaleY(1)   skewX(0deg); }
  50%      { transform: scaleY(0.35) skewX(6deg); }
}
@keyframes bat-fly {
  from { transform: translate(-12vw, 0) scale(0.85); }
  35%  { transform: translate(30vw, -6vh) scale(1); }
  70%  { transform: translate(72vw, 4vh) scale(0.9); }
  to   { transform: translate(114vw, -3vh) scale(0.8); }
}

/* ============================================================
   The haunted tree + owl
   ============================================================ */

.tree {
  position: absolute;
  bottom: 0;
  left: -3vw;
  width: clamp(190px, 22vw, 320px);
  filter: drop-shadow(0 0 26px rgba(0, 0, 0, 0.75));
}
.tree svg { width: 100%; height: auto; display: block; }

.tree-bark { fill: #0b0712; stroke: #1d1428; stroke-width: 1.5; }

/* eyes set into the trunk hollows */
.tree-eye { transform-box: fill-box; transform-origin: center; }
.tree-eye .sclera { fill: #fff8e2; }
.tree-eye .iris   { fill: var(--pumpkin); }
.tree-eye .pupil  { fill: #1a0c00; }
.tree-eye .lid    { fill: #0b0712; }

.tree-eye.blink-a { animation: eye-blink 5.2s ease-in-out infinite; }
.tree-eye.blink-b { animation: eye-blink 5.2s ease-in-out 0.12s infinite; }
.tree-eye.blink-c { animation: eye-blink 7.9s ease-in-out 1.6s infinite; }
.tree-eye.blink-d { animation: eye-blink 7.9s ease-in-out 1.72s infinite; }

@keyframes eye-blink {
  0%, 88%, 100% { transform: scaleY(1); }
  92%           { transform: scaleY(0.06); }
  96%           { transform: scaleY(1); }
}

.tree-glow { filter: drop-shadow(0 0 6px rgba(255, 122, 26, 0.9)); }

/* --- owl --- */
.owl { animation: owl-bob 4.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.owl-body   { fill: #2a1f16; stroke: #443327; stroke-width: 1.2; }
.owl-belly  { fill: #4a382a; }
.owl-head   { animation: owl-turn 8.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 92%; }
.owl-eye    { fill: var(--moon); }
.owl-pupil  { fill: #100a04; }
.owl-lid    { fill: #2a1f16; animation: owl-wink 4.1s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
.owl-beak   { fill: var(--pumpkin); }
.owl-wing   { fill: #21180f; animation: owl-wing 4.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 80% 12%; }
.owl-foot   { stroke: var(--pumpkin-deep); stroke-width: 2.4; stroke-linecap: round; fill: none; }

@keyframes owl-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-3px) rotate(-1.2deg); }
}
@keyframes owl-turn {
  0%, 44%, 100% { transform: rotate(0deg) translateX(0); }
  56%, 78%      { transform: rotate(9deg) translateX(2px); }
}
@keyframes owl-wink {
  0%, 82%, 100% { transform: scaleY(0); }
  88%, 92%      { transform: scaleY(1); }
}
@keyframes owl-wing {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(-13deg); }
}

/* ============================================================
   Dangling spiders
   ============================================================ */

.spider {
  position: absolute;
  top: 0;
  width: 54px;
  transform-origin: 50% -40vh;
  animation: spider-drop 1.4s cubic-bezier(0.22, 1, 0.36, 1) both,
             spider-sway 6s ease-in-out infinite 1.4s;
}
.spider .thread { stroke: rgba(230, 235, 255, 0.4); stroke-width: 1; }
.spider .body   { fill: #0a0610; stroke: #241a33; stroke-width: 1.2; }
.spider .leg    { stroke: #0a0610; stroke-width: 3.4; stroke-linecap: round; fill: none; }
.spider .s-eye  { fill: var(--blood); }
.spider svg { width: 100%; height: auto; display: block; overflow: visible; }

.spider .legs-l { animation: legs-wiggle 1.7s ease-in-out infinite; transform-box: fill-box; transform-origin: 100% 50%; }
.spider .legs-r { animation: legs-wiggle 1.7s ease-in-out 0.25s infinite; transform-box: fill-box; transform-origin: 0% 50%; }

@keyframes legs-wiggle {
  0%, 100% { transform: rotate(-4deg) scaleX(1); }
  50%      { transform: rotate(4deg) scaleX(0.93); }
}
@keyframes spider-drop {
  from { transform: translateY(-62vh); }
  to   { transform: translateY(0); }
}
@keyframes spider-sway {
  0%, 100% { rotate: -3.5deg; translate: 0 0; }
  50%      { rotate: 3.5deg;  translate: 0 -18px; }
}

/* ============================================================
   Dancing skeleton
   ============================================================ */

.skeleton {
  position: absolute;
  bottom: 0;
  right: 0.5vw;
  width: clamp(110px, 13vw, 200px);
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.12));
  animation: skele-groove 2.4s ease-in-out infinite;
}
.skeleton svg { width: 100%; height: auto; display: block; }

.bone      { fill: var(--bone); stroke: #b9ad93; stroke-width: 1; }
.bone-line { stroke: var(--bone); stroke-width: 6; stroke-linecap: round; fill: none; }
.socket    { fill: #0a0610; }
.socket-spark { fill: var(--slime); animation: socket-flicker 2.9s ease-in-out infinite; }

.sk-head { animation: skele-nod 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.sk-jaw  { animation: skele-chatter 0.5s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0%; }
.sk-arm-l { animation: skele-arm-l 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 92% 8%; }
.sk-arm-r { animation: skele-arm-r 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 8% 8%; }
.sk-leg-l { animation: skele-leg 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 70% 0%; }
.sk-leg-r { animation: skele-leg 2.4s ease-in-out 1.2s infinite; transform-box: fill-box; transform-origin: 30% 0%; }
.sk-dice  { animation: skele-dice 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

@keyframes skele-groove {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-9px) rotate(1.5deg); }
}
@keyframes skele-nod {
  0%, 100% { transform: rotate(-5deg); }
  50%      { transform: rotate(5deg); }
}
@keyframes skele-chatter {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(2.5px) rotate(3deg); }
}
@keyframes skele-arm-l {
  0%, 100% { transform: rotate(14deg); }
  50%      { transform: rotate(-46deg); }
}
@keyframes skele-arm-r {
  0%, 100% { transform: rotate(-38deg); }
  50%      { transform: rotate(10deg); }
}
@keyframes skele-leg {
  0%, 100% { transform: rotate(-6deg); }
  50%      { transform: rotate(7deg); }
}
@keyframes skele-dice {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-14px) rotate(180deg); }
}
@keyframes socket-flicker {
  0%, 100% { opacity: 1; }
  45%      { opacity: 0.25; }
  55%      { opacity: 0.9; }
}

/* ============================================================
   Roaming white eyes that open, watch, blink out, and reappear
   ============================================================ */

.eyes-layer { position: absolute; inset: 0; }

.floater {
  position: absolute;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 700ms ease;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.45));
}
.floater.open { opacity: 1; }

.floater .ball {
  width: var(--eye-w, 26px);
  height: var(--eye-h, 15px);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #ffffff 0%, #f3f6ff 58%, #b9c2dd 100%);
  position: relative;
  animation: lid-flutter 2.6s ease-in-out infinite;
}
.floater .ball::after {
  content: '';
  position: absolute;
  width: 42%;
  height: 72%;
  border-radius: 50%;
  background: #0a0610;
  top: 14%;
  left: 29%;
  box-shadow: inset 0 0 0 2px rgba(90, 100, 130, 0.5);
}
.floater .ball:last-child { animation-delay: 0.08s; }

@keyframes lid-flutter {
  0%, 84%, 100% { transform: scaleY(1); }
  90%           { transform: scaleY(0.08); }
  94%           { transform: scaleY(1); }
}

/* ============================================================
   Page content
   ============================================================ */

.page {
  position: relative;
  z-index: 2;
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 64px) clamp(16px, 4vw, 32px) 120px;
}

/* --- hero --- */
.hero { text-align: center; margin-bottom: clamp(32px, 6vw, 60px); }

.kicker {
  font-size: clamp(0.72rem, 2.4vw, 0.9rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--violet-soft);
  margin: 0 0 14px;
  text-shadow: 0 0 14px rgba(185, 140, 255, 0.5);
}

.title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 13vw, 7.4rem);
  line-height: 0.9;
  margin: 0;
  letter-spacing: 0.02em;
  background: linear-gradient(178deg, #ffd9a1 0%, var(--pumpkin) 42%, var(--pumpkin-deep) 78%, #7a2a00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 122, 26, 0.45)) drop-shadow(0 3px 0 rgba(0, 0, 0, 0.6));
  animation: title-flicker 7s ease-in-out infinite;
}
.title .amp { display: inline-block; color: transparent; font-size: 0.72em; vertical-align: 0.12em; }

@keyframes title-flicker {
  0%, 100%   { filter: drop-shadow(0 0 22px rgba(255,122,26,0.45)) drop-shadow(0 3px 0 rgba(0,0,0,0.6)); }
  48%        { filter: drop-shadow(0 0 34px rgba(255,122,26,0.7))  drop-shadow(0 3px 0 rgba(0,0,0,0.6)); }
  50%        { filter: drop-shadow(0 0 8px  rgba(255,122,26,0.3))  drop-shadow(0 3px 0 rgba(0,0,0,0.6)); }
  52%        { filter: drop-shadow(0 0 30px rgba(255,122,26,0.65)) drop-shadow(0 3px 0 rgba(0,0,0,0.6)); }
}

.tagline {
  font-size: clamp(1rem, 3.4vw, 1.35rem);
  color: var(--slime);
  margin: 18px 0 0;
  text-shadow: var(--glow-slime);
}

.lede {
  max-width: 62ch;
  margin: 26px auto 0;
  color: #ded4c0;
}

/* --- panels --- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 16px;
  padding: clamp(20px, 4vw, 34px);
  margin: 0 0 clamp(26px, 5vw, 42px);
  backdrop-filter: blur(9px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 40% at 50% 0%, rgba(255, 122, 26, 0.09), transparent 70%);
}

.panel > * { position: relative; }

.panel-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 5.4vw, 2.5rem);
  color: var(--pumpkin-soft);
  margin: 0 0 6px;
  letter-spacing: 0.02em;
  text-shadow: 0 0 18px rgba(255, 122, 26, 0.4);
}
.panel-sub { margin: 0 0 22px; color: #b9ae99; font-size: 0.95rem; }

/* --- how-it-works steps --- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.step {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.step-num {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--ink);
  background: radial-gradient(circle at 35% 30%, var(--pumpkin-soft), var(--pumpkin) 55%, var(--pumpkin-deep));
  box-shadow: var(--glow-pumpkin);
}
.step h3 { margin: 2px 0 4px; font-size: 1.02rem; color: var(--bone); font-weight: 400; letter-spacing: 0.02em; }
.step p  { margin: 0; font-size: 0.92rem; color: #b9ae99; line-height: 1.55; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 22px;
}
.detail {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(123, 47, 247, 0.1);
  border: 1px solid rgba(185, 140, 255, 0.22);
}
.detail dt {
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--violet-soft);
  margin-bottom: 5px;
}
.detail dd { margin: 0; font-size: 0.98rem; color: var(--bone); }

/* ============================================================
   Calendar
   ============================================================ */

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 18px;
  font-size: 0.82rem;
  color: #b9ae99;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.swatch.open     { background: rgba(255, 122, 26, 0.16); border: 1px solid var(--pumpkin); }
.swatch.picked   { background: linear-gradient(160deg, var(--pumpkin), var(--pumpkin-deep)); }
.swatch.sealed   { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255,255,255,0.1); }

.dow-row, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: clamp(5px, 1.2vw, 10px);
}
.dow-row { margin-bottom: 8px; }
.dow {
  text-align: center;
  font-size: clamp(0.6rem, 2vw, 0.74rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a7f6c;
  padding-bottom: 4px;
}
.dow.hot { color: var(--pumpkin); }

.cell {
  position: relative;
  aspect-ratio: 1 / 1.06;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: var(--body);
  color: #6f6659;
  font-size: clamp(0.85rem, 2.9vw, 1.15rem);
  padding: 0;
  overflow: hidden;
}
.cell.blank { border: none; background: none; }

.cell.sealed { cursor: not-allowed; }
.cell.sealed::after {
  content: '';
  position: absolute;
  left: 22%;
  right: 22%;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
  transform: rotate(-24deg);
}

.cell.open {
  cursor: pointer;
  color: var(--pumpkin-soft);
  background: rgba(255, 122, 26, 0.13);
  border-color: rgba(255, 122, 26, 0.62);
  box-shadow: inset 0 0 18px rgba(255, 122, 26, 0.12);
  transition: transform 160ms ease, box-shadow 220ms ease, background 220ms ease;
}
.cell.open:hover,
.cell.open:focus-visible {
  transform: translateY(-3px) scale(1.04);
  background: rgba(255, 122, 26, 0.24);
  box-shadow: var(--glow-pumpkin);
  outline: none;
}
.cell.open:focus-visible { border-color: var(--slime); }

.cell.picked {
  color: #2a0f00;
  font-weight: 700;
  background: linear-gradient(160deg, var(--pumpkin-soft) 0%, var(--pumpkin) 45%, var(--pumpkin-deep) 100%);
  border-color: #ffd9a1;
  box-shadow: var(--glow-pumpkin), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: pick-pop 340ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pick-pop {
  0%   { transform: scale(0.86) rotate(-4deg); }
  60%  { transform: scale(1.09) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.cell .dnum { line-height: 1; }
.cell .dtag {
  font-size: clamp(0.46rem, 1.7vw, 0.6rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}
.cell .votes {
  position: absolute;
  top: 4px;
  right: 5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  background: var(--slime-deep);
  color: #eafce2;
  border: 1px solid var(--slime);
  box-shadow: 0 0 8px rgba(141, 255, 94, 0.5);
}
.cell .votes.on { display: inline-flex; }

.cell.locked { pointer-events: none; }
.cell.locked.open:not(.picked) { opacity: 0.55; }

/* ============================================================
   Form
   ============================================================ */

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--pumpkin-soft);
}
.field input {
  font-family: var(--body);
  font-size: 1.02rem;
  color: var(--bone);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 122, 26, 0.3);
  border-radius: 10px;
  padding: 13px 15px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.field input::placeholder { color: #6b6153; }
.field input:focus {
  outline: none;
  border-color: var(--slime);
  box-shadow: var(--glow-slime);
}
.field .hint { font-size: 0.76rem; color: #8a7f6c; }

.consent {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-top: 20px;
  font-size: 0.86rem;
  color: #b9ae99;
}
.consent input {
  margin: 3px 0 0;
  width: 18px;
  height: 18px;
  accent-color: var(--pumpkin);
  flex: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
}

.btn {
  font-family: var(--display);
  font-size: clamp(1.15rem, 3.6vw, 1.5rem);
  letter-spacing: 0.06em;
  color: #2a0f00;
  background: linear-gradient(165deg, #ffd9a1 0%, var(--pumpkin) 45%, var(--pumpkin-deep) 100%);
  border: 1px solid #ffe3ba;
  border-radius: 12px;
  padding: 13px 30px;
  cursor: pointer;
  box-shadow: var(--glow-pumpkin), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 150ms ease, filter 180ms ease;
}
.btn:hover:not(:disabled) { transform: translateY(-2px) scale(1.02); filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--slime); outline-offset: 3px; }

.pick-count { font-size: 0.9rem; color: #b9ae99; }
.pick-count b { color: var(--slime); }

.msg {
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 0.93rem;
  display: none;
}
.msg.on { display: block; }
.msg.err {
  background: rgba(165, 18, 28, 0.2);
  border: 1px solid rgba(255, 90, 100, 0.45);
  color: #ffc9cd;
}
.msg.ok {
  background: rgba(63, 158, 33, 0.16);
  border: 1px solid rgba(141, 255, 94, 0.4);
  color: #dcffcb;
}

/* --- sealed / thank-you state --- */
.sealed-note { display: none; }
.sealed-note.on { display: block; }
.sealed-note .big {
  font-family: var(--display);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  color: var(--slime);
  margin: 0 0 10px;
  text-shadow: var(--glow-slime);
}

/* ============================================================
   Tally / results
   ============================================================ */

.tally { display: grid; gap: 10px; }
.tally-row {
  display: grid;
  grid-template-columns: minmax(96px, 132px) 1fr auto;
  gap: 12px;
  align-items: center;
  font-size: 0.9rem;
}
.tally-row .lab { color: #b9ae99; white-space: nowrap; }
.tally-row .bar-wrap {
  height: 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.tally-row .bar {
  height: 100%;
  width: 0;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(90deg, var(--slime-deep), var(--slime));
  box-shadow: 0 0 12px rgba(141, 255, 94, 0.45);
  transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
.tally-row .n { color: var(--bone); min-width: 2.4em; text-align: right; }
.tally-row.lead .lab { color: var(--pumpkin); }
.tally-row.lead .bar { background: linear-gradient(90deg, var(--pumpkin-deep), var(--pumpkin-soft)); box-shadow: var(--glow-pumpkin); }

.leader {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 12px;
  text-align: center;
  background: rgba(255, 122, 26, 0.1);
  border: 1px dashed rgba(255, 122, 26, 0.5);
}
.leader .lbl {
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--pumpkin-soft);
}
.leader .val {
  font-family: var(--display);
  font-size: clamp(1.5rem, 5vw, 2.3rem);
  color: var(--bone);
  margin-top: 6px;
  text-shadow: 0 0 20px rgba(255, 122, 26, 0.45);
}
.leader .note { font-size: 0.82rem; color: #b9ae99; margin-top: 6px; }

/* --- footer --- */
.foot {
  text-align: center;
  font-size: 0.8rem;
  color: #6f6659;
  margin-top: 44px;
  line-height: 1.9;
}
.foot .bats { font-size: 1.3rem; letter-spacing: 0.5em; display: block; margin-bottom: 8px; }

/* ============================================================
   Responsive + motion preferences
   ============================================================ */

@media (max-width: 620px) {
  body { font-size: 16px; }
  .tree { width: 190px; left: -30px; opacity: 0.75; }
  .skeleton { width: 108px; right: -6px; opacity: 0.85; }
  .step { grid-template-columns: 38px 1fr; gap: 11px; }
  .step-num { width: 38px; height: 38px; font-size: 1.2rem; }
  .tally-row { grid-template-columns: 84px 1fr auto; font-size: 0.8rem; }

  /* A seven-column month view is width-starved on a phone, so claw back every
     pixel of chrome and buy the tap target back in height instead. */
  .page { padding-left: 10px; padding-right: 10px; }
  .panel { padding: 16px 12px; border-radius: 13px; }
  .dow-row, .cal-grid { gap: 4px; }
  .cell {
    border-radius: 9px;
    aspect-ratio: 1 / 1.26;
    font-size: 1rem;
  }
  /* The column headers already say Fri/Sat — no need to repeat it in every cell. */
  .cell .dtag { display: none; }
  .cell .votes {
    top: 2px;
    right: 2px;
    min-width: 15px;
    height: 15px;
    font-size: 0.55rem;
    border-radius: 8px;
  }
  .cal-legend { font-size: 0.76rem; gap: 6px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .spider { transform: translateY(0); }
  .floater { opacity: 1; }
}

/* ============================================================
   Late additions: starfield container + spider silk
   ============================================================ */

.starfield { position: absolute; inset: 0; }

/* Each spider hangs from a thread that always runs off the top of the screen. */
.spider::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 1px;
  height: 130vh;
  background: linear-gradient(180deg, rgba(230, 235, 255, 0) 0%, rgba(230, 235, 255, 0.32) 30%, rgba(230, 235, 255, 0.5) 100%);
}

/* ============================================================
   Blackout nights — still selectable, but visibly uncertain
   ============================================================ */

.swatch.iffy {
  background: repeating-linear-gradient(135deg,
    rgba(165, 18, 28, 0.55) 0 4px, rgba(30, 12, 16, 0.75) 4px 8px);
  border: 1px solid #ff6b74;
}

.cell.open.blackout {
  color: #ffb3b8;
  background:
    repeating-linear-gradient(135deg,
      rgba(165, 18, 28, 0.28) 0 6px, rgba(20, 8, 12, 0.45) 6px 12px);
  border-color: rgba(255, 107, 116, 0.72);
  box-shadow: inset 0 0 18px rgba(165, 18, 28, 0.22);
}
.cell.open.blackout:hover,
.cell.open.blackout:focus-visible {
  background:
    repeating-linear-gradient(135deg,
      rgba(165, 18, 28, 0.45) 0 6px, rgba(20, 8, 12, 0.5) 6px 12px);
  box-shadow: 0 0 12px rgba(255, 107, 116, 0.5), 0 0 30px rgba(165, 18, 28, 0.25);
}
.cell.open.blackout .dtag { color: #ff8d95; letter-spacing: 0.1em; }

/* Picked, but still flagged: keep the warning stripes over the orange fill. */
.cell.open.blackout.picked {
  color: #3a0a0c;
  background:
    repeating-linear-gradient(135deg,
      rgba(120, 10, 18, 0.42) 0 6px, rgba(255, 168, 85, 0) 6px 12px),
    linear-gradient(160deg, var(--pumpkin-soft) 0%, var(--pumpkin) 45%, var(--pumpkin-deep) 100%);
  border-color: #ff9aa1;
  box-shadow: 0 0 12px rgba(255, 122, 26, 0.5), inset 0 0 0 1px rgba(165, 18, 28, 0.55);
}

.tally-row.iffy .lab { color: #ff8d95; }
.tally-row.iffy .bar {
  background:
    repeating-linear-gradient(135deg,
      rgba(20, 8, 12, 0.45) 0 5px, rgba(20, 8, 12, 0) 5px 10px),
    linear-gradient(90deg, #6d0f16, #d8434f);
  box-shadow: 0 0 10px rgba(216, 67, 79, 0.4);
}

.iffy-note {
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  color: #ffc9cd;
  background: rgba(165, 18, 28, 0.16);
  border: 1px solid rgba(255, 107, 116, 0.4);
}
.iffy-note strong { color: #ff8d95; }

/* ============================================================
   Sound: the toggle, and the shudder that goes with the laugh
   ============================================================ */

.sfx-toggle {
  font-family: var(--body);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--slime);
  background: rgba(63, 158, 33, 0.14);
  border: 1px solid rgba(141, 255, 94, 0.42);
  border-radius: 999px;
  padding: 7px 15px 7px 30px;
  cursor: pointer;
  position: relative;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.sfx-toggle::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--slime);
  box-shadow: 0 0 8px rgba(141, 255, 94, 0.85);
}
.sfx-toggle:hover { background: rgba(63, 158, 33, 0.24); }
.sfx-toggle:focus-visible { outline: 2px solid var(--slime); outline-offset: 3px; }

.sfx-toggle.off {
  color: #8a7f6c;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
}
.sfx-toggle.off::before { background: #5c5346; box-shadow: none; }

.sfx-warn {
  margin: 12px 0 0;
  font-size: 0.79rem;
  color: #8a7f6c;
  font-style: italic;
}

/* A short, small shudder — enough to feel the laugh, not enough to be nauseating. */
body.cackling .page,
body.cackling .scene { animation: cackle-shudder 1.9s ease-in-out; }

body.cackling::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 50%, transparent 42%, rgba(165, 18, 28, 0.42) 100%);
  animation: cackle-vignette 1.9s ease-out;
}

@keyframes cackle-shudder {
  0%, 100%                { transform: translate3d(0, 0, 0); }
  4%, 12%, 20%, 28%       { transform: translate3d(-4px, 1px, 0); }
  8%, 16%, 24%            { transform: translate3d(4px, -1px, 0); }
  34%, 46%, 58%           { transform: translate3d(-2px, 1px, 0); }
  40%, 52%, 64%           { transform: translate3d(2px, -1px, 0); }
  72%, 84%                { transform: translate3d(-1px, 0, 0); }
  78%, 90%                { transform: translate3d(1px, 0, 0); }
}
@keyframes cackle-vignette {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  body.cackling .page,
  body.cackling .scene { animation: none; }
  body.cackling::after { display: none; }
}

/* ============================================================
   The invite gate
   ============================================================ */

.gate-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding-bottom: clamp(24px, 5vw, 64px);
}

.gate-card {
  max-width: 620px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 18px;
  padding: clamp(28px, 5vw, 46px);
  backdrop-filter: blur(9px);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.gate-lock {
  width: clamp(76px, 15vw, 108px);
  margin: 0 auto 18px;
  filter: drop-shadow(0 0 16px rgba(255, 122, 26, 0.5));
  animation: lock-rattle 5.5s ease-in-out infinite;
}
.gate-lock svg { width: 100%; height: auto; display: block; }

@keyframes lock-rattle {
  0%, 84%, 100% { transform: rotate(0deg); }
  87%           { transform: rotate(-5deg); }
  90%           { transform: rotate(5deg); }
  93%           { transform: rotate(-3deg); }
  96%           { transform: rotate(0deg); }
}

.gate-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 8vw, 3.6rem);
  line-height: 1;
  margin: 0 0 18px;
  background: linear-gradient(178deg, #ffd9a1 0%, var(--pumpkin) 45%, var(--pumpkin-deep) 82%, #7a2a00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 122, 26, 0.4));
}

.gate-card .lede { margin-left: auto; margin-right: auto; }

.gate-hint {
  margin: 26px 0 22px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(123, 47, 247, 0.1);
  border: 1px solid rgba(185, 140, 255, 0.24);
}
.gate-hint-label {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--violet-soft);
  margin-bottom: 7px;
}
.gate-hint code {
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: clamp(0.68rem, 2.5vw, 0.86rem);
  color: var(--slime);
  word-break: break-all;
}

.gate-foot {
  margin: 0;
  font-size: 0.84rem;
  color: #8a7f6c;
  line-height: 1.7;
}

/* Invite status pills on the organiser page */
.inv-state {
  align-self: center;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.inv-state.ok   { color: #dcffcb; background: rgba(63,158,33,.22); border: 1px solid rgba(141,255,94,.45); }
.inv-state.wait { color: #ffdcb0; background: rgba(255,122,26,.16); border: 1px solid rgba(255,168,85,.4); }
.inv-state.rev  { color: #ffc9cd; background: rgba(165,18,28,.2);  border: 1px solid rgba(255,107,116,.42); }

/* ============================================================
   ACT ONE — the butler
   ============================================================ */

.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 40px) clamp(16px, 4vw, 32px);
  transition: opacity 650ms ease, transform 650ms ease;
}
.stage.curtain { opacity: 0; transform: scale(1.04); pointer-events: none; }

.stage-inner {
  display: grid;
  grid-template-columns: minmax(180px, 300px) minmax(0, 1fr);
  gap: clamp(16px, 4vw, 48px);
  align-items: center;
  max-width: 1000px;
  width: 100%;
}

.butler { width: 100%; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.7)); }
.butler svg { width: 100%; height: auto; display: block; }

/* --- the figure's palette --- */
.bt-shadow   { fill: rgba(0, 0, 0, 0.55); }
.bt-cloth    { fill: #14101c; }
.bt-coat     { fill: #0f0b16; stroke: #241b33; stroke-width: 1.2; }
.bt-shoe     { fill: #07050c; }
.bt-shirt    { fill: #e8e2d4; }
.bt-vest     { fill: #1b1526; }
.bt-vest-line{ stroke: #3a2f4d; stroke-width: 1; fill: none; }
.bt-button   { fill: #5e4c7a; }
.bt-lapel    { fill: #1a1326; }
.bt-collar   { fill: #f1ebdd; }
.bt-bow      { fill: #0b0811; stroke: #2a2038; stroke-width: 1; }
.bt-bow-knot { fill: #150f20; }
.bt-neck     { fill: #93a08c; }
.bt-skin     { fill: #a8b49f; stroke: #7d8a76; stroke-width: 1.2; }
.bt-hollow   { fill: #8b9782; opacity: 0.75; }
.bt-hair     { fill: #16121d; }
.bt-brow     { stroke: #16121d; stroke-width: 3.2; stroke-linecap: round; fill: none; }
.bt-socket   { fill: #3d4438; }
.bt-nose     { fill: #7f8b78; }
.bt-lips     { fill: #5d3f47; }
.bt-glove    { fill: #f1ebdd; stroke: #c7bfad; stroke-width: 1; }
.bt-glove-line { stroke: #c7bfad; stroke-width: 1; fill: none; stroke-linecap: round; }
.bt-metal    { fill: #b9a36a; }
.bt-metal-s  { stroke: #b9a36a; stroke-width: 4; fill: none; stroke-linecap: round; }
.bt-wax      { fill: #efe6cf; }

.bt-eye {
  fill: #b9ff6b;
  filter: drop-shadow(0 0 5px rgba(141, 255, 94, 0.95));
  animation: bt-glow 3.6s ease-in-out infinite;
}
.bt-pupil { fill: #0a1204; }
#btEyes { transform-box: fill-box; transform-origin: center; animation: bt-blink 6.4s ease-in-out infinite; }

@keyframes bt-glow {
  0%, 100% { opacity: 1; }
  45%      { opacity: 0.68; }
}
@keyframes bt-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%           { transform: scaleY(0.08); }
  97%           { transform: scaleY(1); }
}

/* --- candle flames --- */
.bt-flame {
  fill: #ffcf6b;
  filter: drop-shadow(0 0 7px rgba(255, 184, 77, 0.9));
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.bt-flame.f-a { animation: bt-flicker 1.5s ease-in-out infinite; }
.bt-flame.f-b { animation: bt-flicker 1.9s ease-in-out 0.3s infinite; }
.bt-flame.f-c { animation: bt-flicker 1.7s ease-in-out 0.7s infinite; }

@keyframes bt-flicker {
  0%, 100% { transform: scale(1) skewX(0deg); opacity: 1; }
  30%      { transform: scale(1.16, 0.9) skewX(5deg); opacity: 0.9; }
  60%      { transform: scale(0.9, 1.12) skewX(-5deg); opacity: 1; }
}

/* --- posture, driven per line of dialogue --- */
.bt-figure {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}
.bt-figure.pose-idle    { transform: rotate(0deg) translateY(0); }
.bt-figure.pose-bow     { transform: rotate(-7deg) translateY(6px); }
.bt-figure.pose-present { transform: rotate(2deg) translateY(-3px); }

#btHead { transform-box: fill-box; transform-origin: 50% 100%; animation: bt-sway 7s ease-in-out infinite; }
@keyframes bt-sway {
  0%, 100% { transform: rotate(-1.6deg); }
  50%      { transform: rotate(1.6deg); }
}

#btArmL { transform-box: fill-box; transform-origin: 82% 12%; animation: bt-hold 6s ease-in-out infinite; }
@keyframes bt-hold {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(-2.4deg); }
}

#btArmR {
  transform-box: fill-box;
  transform-origin: 88% 8%;
  transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}
.bt-figure.pose-present #btArmR { transform: rotate(-16deg); }

/* mouth moves only while a line is being spoken */
#btMouth { transform-box: fill-box; transform-origin: 50% 20%; }
.butler.talking #btMouth { animation: bt-talk 0.26s steps(2, end) infinite; }
@keyframes bt-talk {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(2.6); }
}

/* --- speech --- */
.speech {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 16px;
  padding: clamp(20px, 3.5vw, 32px);
  backdrop-filter: blur(9px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  min-height: clamp(210px, 32vh, 280px);
  display: flex;
  flex-direction: column;
}
.speech-who {
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--violet-soft);
  margin: 0 0 14px;
}
.speech-line {
  font-size: clamp(1.02rem, 2.5vw, 1.3rem);
  line-height: 1.6;
  color: var(--bone);
  margin: 0 0 18px;
  flex: 1;
  min-height: 4.8em;
}

.speech-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; }

.btn-ghost {
  background: rgba(255, 122, 26, 0.14);
  color: var(--pumpkin-soft);
  border: 1px solid rgba(255, 122, 26, 0.55);
  box-shadow: none;
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  padding: 10px 24px;
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 122, 26, 0.26); filter: none; }

.link-skip {
  background: none;
  border: none;
  color: #8a7f6c;
  font-family: var(--body);
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 4px;
}
.link-skip:hover { color: var(--slime); }

/* ============================================================
   ACT TWO — the invitation
   ============================================================ */

.invite-page.arriving { animation: arrive 800ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes arrive {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

.detail.hi {
  background: rgba(255, 122, 26, 0.13);
  border-color: rgba(255, 168, 85, 0.45);
}
.detail.hi dt { color: var(--pumpkin-soft); }
.detail dd strong { color: var(--bone); }

.map-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--slime);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.map-link:hover { color: var(--bone); }

/* --- yes / no --- */
.choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}
.choice-btn {
  font-family: var(--body);
  text-align: left;
  padding: 20px 22px;
  border-radius: 14px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--bone);
  display: grid;
  gap: 4px;
  transition: transform 160ms ease, box-shadow 220ms ease, background 220ms ease, border-color 220ms ease;
}
.choice-btn:hover { transform: translateY(-3px); }
.choice-icon { font-size: 1.9rem; line-height: 1; }
.choice-label { font-size: 1.12rem; }
.choice-sub { font-size: 0.82rem; color: #8a7f6c; }

.choice-btn.yes:hover, .choice-btn.yes.on {
  background: rgba(255, 122, 26, 0.2);
  border-color: var(--pumpkin);
  box-shadow: var(--glow-pumpkin);
}
.choice-btn.yes.on .choice-label { color: var(--pumpkin-soft); }
.choice-btn.no:hover, .choice-btn.no.on {
  background: rgba(123, 47, 247, 0.18);
  border-color: var(--violet-soft);
  box-shadow: 0 0 12px rgba(185, 140, 255, 0.4);
}
.choice-btn.no.on .choice-label { color: var(--violet-soft); }
.choice-btn:focus-visible { outline: 2px solid var(--slime); outline-offset: 3px; }

#rsvpForm { margin-top: 26px; }

.field select {
  font-family: var(--body);
  font-size: 1.02rem;
  color: var(--bone);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 122, 26, 0.3);
  border-radius: 10px;
  padding: 13px 15px;
}
.field select:focus { outline: none; border-color: var(--slime); box-shadow: var(--glow-slime); }

.yes-only[hidden] { display: none; }
.yes-only { margin-top: 16px; }

/* --- guest list --- */
.guestlist { display: flex; flex-wrap: wrap; gap: 9px; }
.guest-chip {
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 0.88rem;
  color: #ffd9a1;
  background: rgba(255, 122, 26, 0.14);
  border: 1px solid rgba(255, 168, 85, 0.4);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 780px) {
  .stage-inner { grid-template-columns: 1fr; gap: 10px; justify-items: center; }
  .butler { width: min(58vw, 230px); }
  .speech { min-height: 0; width: 100%; }
  .speech-line { min-height: 6em; }
}

@media (prefers-reduced-motion: reduce) {
  .bt-figure, #btArmR { transition: none; }
}

/* A white cuff reads as an arm ending; a bare glove read as a floating blob. */
.bt-cuff { fill: #e8e2d4; }

/* The scenery tree occupies the same corner as the butler, so it steps aside
   while he has the stage. */
body.act-one .tree,
body.act-one .skeleton { opacity: 0; transition: opacity 500ms ease; }
body.act-one .spider { opacity: 0.5; }

.butler { width: min(100%, 250px); margin: 0 auto; }
@media (max-height: 720px) {
  .butler { width: min(100%, 200px); }
  .stage { align-items: start; padding-top: clamp(12px, 3vh, 28px); }
}

/* A class that sets `display` outranks the UA rule for [hidden], so anything
   toggled with .hidden in JS has to opt back out explicitly. Without this the
   hidden stage still reserved a full viewport and pushed the invitation
   off-screen. */
.stage[hidden],
.choice[hidden] { display: none !important; }

/* Organiser stat tiles */
.rsvp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.stat-card {
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.stat-card.ok   { background: rgba(63,158,33,.16);  border-color: rgba(141,255,94,.4); }
.stat-card.wait { background: rgba(255,122,26,.14); border-color: rgba(255,168,85,.4); }
.stat-card.rev  { background: rgba(123,47,247,.16); border-color: rgba(185,140,255,.4); }
.stat-value {
  font-family: var(--display);
  font-size: 2.2rem;
  line-height: 1;
  color: var(--bone);
}
.stat-label {
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #b9ae99;
  margin-top: 7px;
}

/* The particulars read better in three wider columns than four narrow ones. */
.invite-page .detail-grid { grid-template-columns: repeat(auto-fit, minmax(236px, 1fr)); }

/* Add-to-calendar buttons inside the When card */
.cal-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.cal-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--body);
  font-size: 0.8rem;
  line-height: 1.2;
  color: var(--bone);
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 168, 85, 0.45);
  transition: background 180ms ease, border-color 180ms ease, transform 150ms ease;
}
.cal-btn:hover {
  background: rgba(255, 122, 26, 0.22);
  border-color: var(--pumpkin);
  transform: translateY(-2px);
}
.cal-btn:focus-visible { outline: 2px solid var(--slime); outline-offset: 3px; }
.cal-ico { font-size: 0.95rem; }
.cal-note {
  margin: 10px 0 0;
  font-size: 0.74rem;
  color: #8a7f6c;
  font-style: italic;
}

/* The address doubles as a "navigate here" button */
.addr-link {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--bone);
  text-decoration: none;
  border-radius: 10px;
  padding: 8px 12px 8px 10px;
  margin: -4px 0 0 -10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 168, 85, 0.35);
  transition: background 180ms ease, border-color 180ms ease, transform 150ms ease;
}
.addr-link:hover {
  background: rgba(255, 122, 26, 0.22);
  border-color: var(--pumpkin);
  transform: translateY(-2px);
}
.addr-link:focus-visible { outline: 2px solid var(--slime); outline-offset: 3px; }
.addr-pin { font-size: 1.05rem; line-height: 1.3; }
.addr-text { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,168,85,.5); }
.addr-hint {
  display: block;
  margin-top: 8px;
  font-size: 0.72rem;
  color: #8a7f6c;
  font-style: italic;
}

/* Plus-one question: two plain buttons instead of a dropdown */
.plusone { display: flex; flex-wrap: wrap; gap: 10px; }
.po-btn {
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--bone);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 170ms ease, border-color 170ms ease, color 170ms ease;
}
.po-btn:hover { background: rgba(255, 122, 26, 0.16); }
.po-btn.on {
  color: var(--pumpkin-soft);
  background: rgba(255, 122, 26, 0.22);
  border-color: var(--pumpkin);
  box-shadow: var(--glow-pumpkin);
}
.po-btn:focus-visible { outline: 2px solid var(--slime); outline-offset: 3px; }
#extraWrap[hidden] { display: none; }
#extraWrap { margin-top: 16px; }

/* 21+ notices */
.detail.age {
  background: rgba(165, 18, 28, 0.18);
  border-color: rgba(255, 107, 116, 0.5);
}
.detail.age dt { color: #ff8d95; }
.age-note {
  margin: 0 0 22px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  color: #ffc9cd;
  background: rgba(165, 18, 28, 0.16);
  border: 1px solid rgba(255, 107, 116, 0.42);
}
.age-note strong { color: #ff8d95; }

/* ============================================================
   Barnabas loses his composure about October
   ============================================================ */

.bt-figure.pose-celebrate {
  animation: bt-jump 0.66s cubic-bezier(0.3, 0, 0.4, 1) infinite;
}
@keyframes bt-jump {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  14%      { transform: translateY(5px) scale(1.04, 0.93); }   /* crouch */
  42%      { transform: translateY(-30px) scale(0.97, 1.06); } /* up */
  58%      { transform: translateY(-28px) scale(0.98, 1.04); }
  82%      { transform: translateY(3px) scale(1.05, 0.94); }   /* land */
}

/* Both arms go up and wave. The left one is still holding a lit candelabra,
   which is entirely the point. */
.bt-figure.pose-celebrate #btArmL {
  animation: bt-wave-l 0.33s ease-in-out infinite;
}
.bt-figure.pose-celebrate #btArmR {
  animation: bt-wave-r 0.33s ease-in-out infinite;
  transition: none;
}
@keyframes bt-wave-l {
  0%, 100% { transform: rotate(-4deg); }
  50%      { transform: rotate(-38deg); }
}
@keyframes bt-wave-r {
  0%, 100% { transform: rotate(4deg); }
  50%      { transform: rotate(36deg); }
}

.bt-figure.pose-celebrate #btHead {
  animation: bt-head-shake 0.33s ease-in-out infinite;
}
@keyframes bt-head-shake {
  0%, 100% { transform: rotate(-5deg); }
  50%      { transform: rotate(5deg); }
}

/* candles can barely cope */
.bt-figure.pose-celebrate .bt-flame { animation-duration: 0.22s; }

/* the shadow pulls in as he leaves the ground */
.bt-figure.pose-celebrate ~ .bt-shadow,
.butler:has(.pose-celebrate) .bt-shadow {
  animation: bt-shadow-jump 0.66s cubic-bezier(0.3, 0, 0.4, 1) infinite;
}
@keyframes bt-shadow-jump {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  42%      { transform: scale(0.72); opacity: 0.3; }
}
.bt-shadow { transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: reduce) {
  .bt-figure.pose-celebrate,
  .bt-figure.pose-celebrate #btArmL,
  .bt-figure.pose-celebrate #btArmR,
  .bt-figure.pose-celebrate #btHead,
  .butler:has(.pose-celebrate) .bt-shadow { animation: none; }
}
