/* Stick figures: the module's own styles (load with the figures scripts). Uses the site's fonts (Lora, Quicksand). */

/* the recorder: live scene (film bars, a soft spotlight), REC badge, the 3-2-1 countdown */
[data-stage-wrap] { border-radius: 10px; transition: padding .5s ease, background-color .5s; }
[data-stage-wrap]::before, [data-stage-wrap]::after { content: ''; position: absolute; left: 0; right: 0; height: 0; background: #262322; transition: height .5s ease; z-index: 1; pointer-events: none; }
[data-stage-wrap]::before { top: 0; border-radius: 10px 10px 0 0; }
[data-stage-wrap]::after { bottom: 0; border-radius: 0 0 10px 10px; }
[data-stage-wrap].is-live { padding: 14px 0; background: radial-gradient(ellipse 45% 55% at 50% 78%, rgba(255, 255, 255, .95), rgba(73, 59, 55, .07) 75%); }
[data-stage-wrap].is-live::before, [data-stage-wrap].is-live::after { height: 12px; }
[data-stage-wrap].is-replay [data-stage] { filter: grayscale(.35) sepia(.15); }
.stage-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .45rem; border-radius: 6px; background: #262322; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.rec-dot { display: inline-block; width: .55rem; height: .55rem; margin-right: .25rem; border-radius: 9999px; background: currentColor; }
.rec-dot.is-blinking { animation: rec-blink 1s steps(2, start) infinite; }
.stage-badge .rec-dot { margin-right: 0; }
@keyframes rec-blink { to { visibility: hidden; } }
.stage-count { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.stage-count span { font-family: 'Lora', serif; font-weight: 700; font-size: 3.5rem; color: #262322; animation: stage-count 1s ease-out both; }
@keyframes stage-count { 0% { opacity: 0; transform: scale(1.8); } 25% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(.7); } }

/* the props popup (hover the sofa button, or tap it; choosing something shuts it) */
.fig-props { display: inline-block; }
.fig-props-menu { display: none; position: absolute; z-index: 20; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: 248px; padding: 6px; background: #fff; border: 1px solid rgba(73, 59, 55, .15); border-radius: 14px; box-shadow: 0 14px 34px -14px rgba(73, 59, 55, .4); grid-template-columns: repeat(4, 1fr); gap: 1px; }
.fig-props.is-open .fig-props-menu { display: grid; } /* (open: Figures.propsOpen — set by hovering or tapping, kept over redraws) */
.fig-props-menu::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 8px; } /* (keeps it open on the way down) */
.fig-props-menu button { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding: 4px 2px; border-radius: 10px; border: 0; background: none; cursor: pointer; opacity: .28; font: 600 10px Quicksand, sans-serif; color: #493B37; }
.fig-props-menu button img { display: block; }
.fig-props-menu button:hover { background: rgba(246, 185, 59, .2); opacity: .8; }
.fig-props.is-open button.rounded-full { border-color: #6C265C; background: rgba(246, 185, 59, .2); color: #6C265C; } /* (the popup open: the button as on hover) */
.fig-props-menu button.is-out { opacity: 1; }

/* spicy on for both: the flame filled */
.flame-on svg { fill: currentColor; }

/* the props popup: a prop that's out can get a colour (a dot in its corner — the bed: frame and bedding) */
.fig-props-group { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-start; gap: 4px; padding: 6px 6px; border-radius: 8px; cursor: pointer; font: 700 9px Quicksand, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: rgba(73, 59, 55, .5); }
.fig-props-group:hover { background: rgba(246, 185, 59, .15); }
.fig-prop-item { position: relative; display: block; height: 100%; } /* (the labels in a row all on one line, at the bottom) */
.fig-tints { position: absolute; top: 3px; right: 3px; display: flex; gap: 3px; }
.fig-tint { position: relative; width: 10px; height: 10px; border-radius: 9999px; cursor: pointer; overflow: hidden; box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(73, 59, 55, .2); }
.fig-tint input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
@media (pointer: coarse) { .fig-tint { width: 15px; height: 15px; } }
.fig-prop-item > button { width: 100%; height: 100%; }
.fig-props-x { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; color: rgba(73, 59, 55, .5); z-index: 1; }
.fig-props-x:hover { background: rgba(246, 185, 59, .2); }
.fig-props-x + .fig-props-group { margin-right: 26px; }
.fig-pulse { display: inline-flex; animation: fig-pulse 1.1s ease-in-out infinite; color: #E4572E; } /* (the other one wants spicy: the flame calls) */
@keyframes fig-pulse { 0%, 100% { transform: scale(1); opacity: .55; } 50% { transform: scale(1.3); opacity: 1; } }
/* The buttons fade away while the mouse isn't over the stage (only where there is a mouse; touch: always there).
   They stay while something in them is open or being typed into. */
@media (hover: hover) {
  .fig-box [data-buttons] { opacity: 0; transition: opacity .35s ease .4s; }
  .fig-box:hover [data-buttons], .fig-box:focus-within [data-buttons], .fig-box [data-buttons]:has(.is-open) { opacity: 1; transition-delay: 0s; }
}
.fig-props.is-down .fig-props-menu { bottom: auto; top: calc(100% + 6px); } /* (no room above: below the button) */
.fig-props.is-down .fig-props-menu::after { top: auto; bottom: 100%; }
@media (max-width: 639px) { .fig-props-menu { width: min(280px, 88vw) !important; left: auto !important; right: -2.5rem !important; transform: none !important; } }
.fig-out { position: absolute; z-index: 3; width: 72px; cursor: pointer; } /* (beside the stage, left and right: tap to walk out that way) */
@media (max-width: 1180px) {
  .fig-out { width: 18px; }
  .fig-out[data-out="-1"] { left: 0 !important; }
  .fig-out[data-out="1"] { left: auto !important; right: 0 !important; }
}

/* games (the button beside Save): the list in a small popup; while a game is on, its line above the buttons */
.fig-games { display: inline-block; }
.fig-games.is-open .fig-props-menu { display: grid; }
.fig-games-menu { width: 150px; grid-template-columns: 1fr; }
.fig-games-menu button { padding: 8px 6px; font-size: 11px; }
.fig-playing > :not(.fig-props), .fig-hide { display: none !important; } /* (a game on: the buttons away — hiding the treat: just the props) */
