/* Telling Yok what it does not have (tasks/kotu.js). A small round nothing
   with a face, three words at a time, and the good news crossing the room. */

.kotu {
  margin-top: 1.2em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9em;
  width: 100%;
}

.kotu-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
}

/* yok itself. There is no body worth drawing, which is the joke, so what it
   has instead is an expression. Pink is the planet's own map colour. */
.kotu-yok {
  position: relative;
  width: 5.2em;
  height: 5.2em;
  border-radius: 50%;
  border: 1px solid rgba(201, 140, 168, 0.45);
  background: radial-gradient(circle at 50% 38%, rgba(201, 140, 168, 0.16), rgba(201, 140, 168, 0.03) 70%);
  box-shadow: 0 0 26px rgba(201, 140, 168, 0.18);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.kotu-eye {
  position: absolute;
  top: 40%;
  width: 0.38em;
  height: 0.52em;
  border-radius: 50%;
  background: rgba(243, 234, 216, 0.75);
  transition: height 0.25s ease, background 0.25s ease;
}
.kotu-eye.left { left: 32%; }
.kotu-eye.right { right: 32%; }
/* The mouth is one arc, and which edge of the box carries it decides which way
   it bends: the top edge is a frown, the bottom edge is a smile. Both are
   declared and only their colours change, so the turn is a fade rather than a
   flip. Frowning by default: it has been like this since the day the gezegen
   opened. */
.kotu-mouth {
  position: absolute;
  left: 50%;
  top: 60%;
  width: 1.5em;
  height: 0.62em;
  transform: translateX(-50%);
  transform-origin: 50% 50%;
  border-top: 2px solid rgba(243, 234, 216, 0.6);
  border-bottom: 2px solid transparent;
  border-radius: 50%;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

/* Good news. It brightens, lifts, and the mouth turns the right way up. */
.kotu-yok.happy {
  transform: translateY(-4px) scale(1.04);
  border-color: rgba(201, 140, 168, 0.9);
  box-shadow: 0 0 40px rgba(201, 140, 168, 0.4);
  animation: kotu-bounce 0.7s ease;
}
.kotu-yok.happy .kotu-mouth {
  border-top-color: transparent;
  border-bottom-color: rgba(232, 193, 106, 0.95);
}
.kotu-yok.happy .kotu-eye { height: 0.22em; background: rgba(232, 193, 106, 0.95); }
@keyframes kotu-bounce {
  30% { transform: translateY(-12px) scale(1.07); }
  60% { transform: translateY(-1px) scale(1.02); }
}

/* And the other kind. A flinch, and the light goes out of it. */
.kotu-yok.hurt {
  animation: kotu-flinch 0.55s ease;
  border-color: rgba(201, 140, 168, 0.25);
  box-shadow: none;
}
.kotu-yok.hurt .kotu-mouth { transform: translateX(-50%) scaleY(1.45) translateY(0.06em); }
@keyframes kotu-flinch {
  20% { transform: translateX(-6px); }
  45% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
}

.kotu-name {
  font-family: var(--serif);
  font-size: clamp(0.9rem, 2.4vw, 1.1rem);
}

/* The sentence stands there the whole time with a hole in it, and the word the
   experiencer taps flies INTO the hole. It is the thing being built, not a
   caption that arrives afterwards, so it never blinks in and out. */
.kotu-said {
  min-height: 1.7em;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  color: var(--cream);
  text-align: center;
  /* Plain inline flow, NOT flex. A flex gap puts space between every child,
     and the children here include a root and its own suffix: gezegende would
     come out as "gezegen de". The template's own spaces are the only spacing
     this line is allowed to have. */
  line-height: 1.7;
}

/* The hole. It breathes gently while it is empty, so the eye knows where the
   word is going before it is thrown. */
.kotu-slot {
  display: inline-block;
  min-width: 4.6em;
  text-align: center;
  border-bottom: 1px dashed rgba(232, 193, 106, 0.45);
  transition: min-width 0.35s cubic-bezier(0.3, 1.3, 0.5, 1), border-color 0.3s ease;
  animation: kotu-wait 2.4s ease-in-out infinite;
}
@keyframes kotu-wait {
  0%, 100% { border-bottom-color: rgba(232, 193, 106, 0.28); }
  50%      { border-bottom-color: rgba(232, 193, 106, 0.6); }
}

/* Filled. The word arrives already gold and the right size, so the flying copy
   vanishes underneath it without a seam, and the line settles into one piece. */
.kotu-slot.filled {
  min-width: 0;
  border-bottom-color: transparent;
  animation: kotu-land 0.5s cubic-bezier(0.25, 1.5, 0.5, 1);
}
@keyframes kotu-land {
  0%   { transform: scale(1.45); opacity: 0.2; }
  55%  { transform: scale(0.95); opacity: 1; }
  100% { transform: scale(1); }
}

/* Refused: the hole flinches and stays empty. The sentence is not finished,
   which is the whole of the correction. */
.kotu-slot.refused { animation: kotu-refused 0.5s ease; }
@keyframes kotu-refused {
  0%, 100% { transform: translateX(0); border-bottom-color: rgba(232, 193, 106, 0.45); }
  20%  { transform: translateX(-5px); border-bottom-color: rgba(201, 140, 168, 0.9); }
  50%  { transform: translateX(5px); border-bottom-color: rgba(201, 140, 168, 0.9); }
  80%  { transform: translateX(-2px); }
}

/* What is left to hand over. Dots, not a number: this is a favour with an end
   to it, not a score. */
.kotu-tally {
  display: flex;
  gap: 0.4em;
}
.kotu-dot {
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  border: 1px solid rgba(243, 234, 216, 0.28);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.kotu-dot.given {
  background: rgba(232, 193, 106, 0.85);
  border-color: rgba(232, 193, 106, 0.85);
}

.kotu-gate { margin-top: 0.6em; }
.pill.kotu-pill { display: inline-flex; align-items: center; gap: 0.45em; }
.kotu-pic { font-size: 1.15em; line-height: 1; }
/* A word that broke on the way over stays on the floor, out of the way. The
   round does not restart: the other two are still there to choose from. */
.pill.kotu-broke { opacity: 0.22; border-style: dashed; }

/* The word crossing the room, from the pill that was tapped to yok. */
.kotu-flying {
  position: fixed;
  z-index: 90;
  font-family: var(--serif);
  /* The SAME size the sentence is set in, or the word visibly resizes as it
     lands and the handover to the slot stops being invisible. */
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  color: var(--gold);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: kotu-fly 0.66s cubic-bezier(0.35, 0, 0.25, 1) forwards;
}
@keyframes kotu-fly {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  70%  { opacity: 1; }
  /* It arrives at full size and dissolves exactly where the slot's own word
     appears, so the handover between the two is invisible. */
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); opacity: 0; }
}
/* Unless it was the wrong one, in which case it never arrives. */
.kotu-flying.breaks {
  color: rgba(201, 140, 168, 0.9);
  animation: kotu-break 0.8s cubic-bezier(0.4, 0, 0.3, 1) forwards;
}
@keyframes kotu-break {
  0%   { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
  70%  { transform: translate(calc(-50% + var(--dx) * 0.8), calc(-50% + var(--dy) * 0.8)) scale(1.05) rotate(-8deg); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx) * 0.9), calc(-50% + var(--dy) * 0.9 + 40px)) scale(0.6) rotate(-40deg); opacity: 0; }
}

/* A picture over a word in the air (b.fly `e`). It sits ABOVE the word and is
   never the control: the word is still the thing that gets scanned. */
.fly-word.fly-pictured { display: flex; flex-direction: column; align-items: center; gap: 0.08em; }
/* The picture is appended before the word is rendered into the same element,
   so DOM order puts it first and plain `column` stands it on top. */
.fly-emoji { font-size: 1.35em; line-height: 1; opacity: 0.9; order: -1; }

@media (prefers-reduced-motion: reduce) {
  .kotu-yok.happy, .kotu-yok.hurt { animation: none; }
  .kotu-flying { animation-duration: 0.45s; }
}
