/* Debug state indicator for development mode */
.debug-state-indicator {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 6px;
  font-size: 0.75rem;
  background-color: #334155;
  color: white;
  border-radius: 4px;
  z-index: 10;
}

/* State-specific styles that can be applied when state changes */
[data-single-page-flow-state-value="looking"] .debug-state-indicator {
  background-color: #0ea5e9;
}

[data-single-page-flow-state-value="question-displayed"] .debug-state-indicator {
  background-color: #10b981;
}

[data-single-page-flow-state-value="question-feedback"] .debug-state-indicator {
  background-color: #f59e0b;
}

[data-single-page-flow-state-value="waiting-for-feedback"] .debug-state-indicator {
  background-color: #8b5cf6;
}

[data-single-page-flow-state-value="waiting-for-question"] .debug-state-indicator {
  background-color: #ec4899;
}

/* "Your partner:" reveal on /play (MatchRevealHelper, owner 2026-11-29). Every delay is
   rendered into --reveal-delay; the animations start when the looking section is shown
   (a hidden element does not animate). .is-revealed (MatchRevealController) shows the
   finished screen at once for a match the player has already seen. */
.match-reveal-emoji,
.match-reveal-letter,
.match-reveal-after,
.match-reveal-wisp {
  animation-delay: var(--reveal-delay, 0s);
  animation-fill-mode: both;
}

/* Each shared desire pops in with a small overshoot. */
.match-reveal-emoji {
  display: inline-block;
  animation-name: match-reveal-pop;
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes match-reveal-pop {
  0%   { opacity: 0; transform: scale(0); }
  60%  { opacity: 1; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

/* The name sits on a strip of paper tape, the quiz's name-tag tape (quiz.css .quiz-tape,
   --q-tape), which is there from the first frame: only the letters on it are revealed.
   The tape is a ::before behind the letters, so its torn-edge clip-path never clips the
   smoke wisps rising off them. */
/* One tag per partner, each on its own line under "Your partner:", centred. A trio's
   second tag leans the other way, as two tags stuck on by hand would. */
.match-reveal-names { display: block; }
.match-reveal-line { display: block; margin-top: 8px; }
.match-reveal-line + .match-reveal-line { margin-top: 10px; }
.match-reveal-name {
  position: relative;
  display: inline-block;
  padding: 4px 14px 2px;
  transform: rotate(-2deg);
  isolation: isolate;
}
.match-reveal-line:nth-child(even) .match-reveal-name { transform: rotate(1.5deg); }
/* The emoji row is the <summary> of what the desires mean: no disclosure triangle. */
.match-reveal-desires > summary { list-style: none; }
.match-reveal-desires > summary::-webkit-details-marker { display: none; }

/* The "&" between a trio's names, off the tape. */
.match-reveal-joiner { white-space: pre; }
.match-reveal-name::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(90deg, rgb(0 0 0 / 0.025) 0 2px, transparent 2px 5px),
    #F1E6C8;
  -webkit-clip-path: polygon(0 6%, 3% 0, 7% 7%, 11% 1%, 15% 6%, 100% 0, 98% 30%, 100% 62%, 97% 100%, 60% 96%, 4% 100%, 1% 70%, 3% 38%);
  clip-path: polygon(0 6%, 3% 0, 7% 7%, 11% 1%, 15% 6%, 100% 0, 98% 30%, 100% 62%, 97% 100%, 60% 96%, 4% 100%, 1% 70%, 3% 38%);
}

.match-reveal-word { white-space: nowrap; }
.match-reveal-letter { display: inline-block; position: relative; }
.match-reveal-cell { display: inline-block; position: relative; }

/* Developing photo: each letter comes into focus out of a blur. */
.match-reveal-develop .match-reveal-letter {
  animation-name: match-reveal-develop;
  animation-duration: 0.8s;
  animation-timing-function: ease-out;
}
@keyframes match-reveal-develop {
  0%   { opacity: 0; filter: blur(8px); transform: translateY(4px); }
  100% { opacity: 1; filter: blur(0); transform: none; }
}

/* Smoke (the group shares the physical desire): each letter condenses out of a
   drifting haze while two wisps curl up off it and dissolve. */
.match-reveal-smoke .match-reveal-letter {
  animation-name: match-reveal-condense;
  animation-duration: 1.1s;
  animation-timing-function: ease-out;
}
@keyframes match-reveal-condense {
  0%   { opacity: 0; filter: blur(10px); transform: translate(-4px, 7px) skewX(-10deg); }
  45%  { opacity: 0.55; filter: blur(4px); transform: translate(1px, 2px) skewX(4deg); }
  100% { opacity: 1; filter: blur(0); transform: none; }
}
.match-reveal-wisp {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(70, 60, 56, 0.85) 0%, rgba(70, 60, 56, 0.45) 45%, rgba(70, 60, 56, 0) 72%);
  filter: blur(3px);
  pointer-events: none;
  animation-name: match-reveal-wisp;
  animation-duration: 1.6s;
  animation-timing-function: ease-out;
}
.match-reveal-wisp-b {
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  animation-name: match-reveal-wisp-b;
  animation-duration: 1.9s;
}
@keyframes match-reveal-wisp {
  0%   { opacity: 0; transform: translate(0, 6px) scale(0.6); }
  25%  { opacity: 0.9; }
  100% { opacity: 0; transform: translate(var(--drift, 0px), -34px) scale(2.4, 3); }
}
@keyframes match-reveal-wisp-b {
  0%   { opacity: 0; transform: translate(0, 4px) scale(0.5); }
  30%  { opacity: 0.7; }
  100% { opacity: 0; transform: translate(calc(var(--drift, 0px) * -1.3), -26px) scale(2.2, 2.6) rotate(25deg); }
}

/* The instruction (and the deeper-than-last-time wave) arrive once the name is whole. */
.match-reveal-after {
  animation-name: match-reveal-arrive;
  animation-duration: 0.6s;
  animation-timing-function: ease-out;
}
span.match-reveal-after { display: inline-block; }
@keyframes match-reveal-arrive {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* A question's plain text: read by screen readers while its letters form (hidden like
   Tailwind's sr-only), shown in their place once the reveal is over. */
.match-reveal-plain {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.match-reveal.is-revealed .match-reveal-plain {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}
.match-reveal.is-revealed .match-reveal-text { display: none; }

/* Already seen, or the player asked for less motion: show the finished screen. */
.match-reveal.is-revealed .match-reveal-emoji,
.match-reveal.is-revealed .match-reveal-letter,
.match-reveal.is-revealed .match-reveal-after {
  animation: none;
}
.match-reveal.is-revealed .match-reveal-wisp { display: none; }
@media (prefers-reduced-motion: reduce) {
  .match-reveal .match-reveal-emoji,
  .match-reveal .match-reveal-letter,
  .match-reveal .match-reveal-after {
    animation: none;
  }
  .match-reveal .match-reveal-wisp { display: none; }
  .match-reveal .match-reveal-text { display: none; }
  .match-reveal .match-reveal-plain {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }
}
