/* Find Goode Guy (js/host/find/). Sized from the game's picture (--sw). */

#s-find {
  font-size: calc(var(--sw) * 0.0118);
}

/* what shows when (the section's data-state) */
.fd-titlecard,
.fd-results,
.fd-askcard,
.fd-clock,
.fd-banner,
.fd-scores {
  display: none;
}
#s-find[data-state='title'] .fd-titlecard,
#s-find[data-state='results'] .fd-results {
  display: flex;
}
#s-find:is([data-state='intro'], [data-state='play'], [data-state='found']) :is(.fd-askcard, .fd-banner, .fd-scores) {
  display: flex;
}
#s-find[data-state='play'] .fd-clock {
  display: flex;
}
/* (a line of text with bold bits in it: its spaces kept) */
#s-find:is([data-state='intro'], [data-state='play'], [data-state='found']) .fd-banner {
  display: block;
}

.fd-spots,
.fd-marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* (a layer of their own, under the cards and the HOME menu) */
.fd-spots {
  z-index: 0;
}
.wbtn.fd-spot {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0;
  border: none;
  border-radius: 45% 45% 30% 30%;
  background: none;
  box-shadow: none;
  opacity: 0;
  transition: none;
  pointer-events: auto;
}
.wbtn.fd-spot.focused {
  transform: none;
  box-shadow: none;
}
#s-find:not([data-state='play']) .fd-spot {
  pointer-events: none;
}
/* (the D-pad's pick: a ring at their feet, as nothing else shows it) */
#s-find[data-state='play'] .wbtn.fd-spot.focused {
  opacity: 1;
  background: radial-gradient(ellipse at 50% 96%, rgba(92, 200, 242, 0.55) 0 14%, transparent 15%);
}
.fd-dark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.fd-dark[hidden] {
  display: none;
}
.fd-wrong {
  position: absolute;
  transform: translate(-50%, -110%);
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  background: #fff;
  border: 0.18em solid var(--pc);
  color: #e8473f;
  font-size: 1.6em;
  font-weight: 900;
  line-height: 1.75em;
  text-align: center;
  box-shadow: 0 0.2em 0.5em rgba(0, 0, 0, 0.25);
  animation: fd-wrong 0.9s ease-out forwards;
}
@keyframes fd-wrong {
  0% {
    transform: translate(-50%, -110%) scale(0.4);
  }
  20% {
    transform: translate(-50%, -110%) scale(1.15);
  }
  30% {
    transform: translate(-50%, -110%) scale(1);
  }
  100% {
    transform: translate(-50%, -160%) scale(1);
    opacity: 0;
  }
}

/* the cards (title, results) */
.fd-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 46%;
  padding: 1.6em 2.2em 1.8em;
  border-radius: 1.8em;
  background: rgba(255, 255, 255, 0.95);
  border: 0.2em solid #dfe4ea;
  box-shadow: var(--shadow);
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.fd-logo {
  display: flex;
  align-items: center;
  gap: 0.25em;
  font-size: 3.3em;
  font-weight: 900;
  color: #fff;
  -webkit-text-stroke: 0.09em #2a6f99;
  paint-order: stroke fill;
  text-shadow: 0 0.06em 0 #2a6f99;
  line-height: 1.1;
}
.fd-logo svg {
  width: 1.15em;
  height: 1.15em;
  -webkit-text-stroke: 0;
}
.fd-logo b {
  color: #ffd76a;
}
.fd-logo.small {
  font-size: 1.8em;
}
.fd-card p {
  margin: 0.6em 0 0;
  font-size: 1.15em;
  font-weight: 700;
  color: #5f666f;
  line-height: 1.45;
}
.fd-card .fd-how {
  font-weight: 900;
  color: #2a6f99;
}
.fd-card .fd-need {
  color: #b5541c;
}
.fd-card [hidden] {
  display: none;
}
.fd-buttons {
  display: flex;
  gap: 1em;
  margin-top: 1.3em;
}

/* the round's card */
.fd-askcard {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  min-width: 26em;
  padding: 1.1em 2em 1.3em;
  border-radius: 1.8em;
  background: #fff;
  border: 0.22em solid #5cc8f2;
  box-shadow: 0 0.8em 2.4em rgba(20, 40, 70, 0.3);
  flex-direction: column;
  align-items: center;
  gap: 0.3em;
  transition: left 0.5s cubic-bezier(0.3, 0.9, 0.3, 1), top 0.5s cubic-bezier(0.3, 0.9, 0.3, 1), transform 0.5s cubic-bezier(0.3, 0.9, 0.3, 1), min-width 0.5s, padding 0.5s;
  animation: fd-card-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes fd-card-in {
  from {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0;
  }
}
.fd-round {
  font-size: 0.95em;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.fd-target {
  width: 12em;
  height: 12em;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #ffffff, #e9f6fd 60%, #d5ecf8);
  border: 0.2em solid #e2eef6;
  transition: width 0.5s, height 0.5s;
}
.fd-target[hidden],
.fd-icon[hidden] {
  display: none;
}
.fd-icon svg {
  width: 13em;
  height: 7em;
  transition: width 0.5s, height 0.5s;
}
.fd-ask {
  font-size: 2.2em;
  font-weight: 900;
  color: #3b4049;
  white-space: nowrap;
  transition: font-size 0.5s;
}
/* playing: up in the corner, small */
#s-find:is([data-state='play'], [data-state='found']) .fd-askcard {
  left: 1.4%;
  top: 2.4%;
  transform: none;
  min-width: 0;
  padding: 0.55em 1.1em 0.7em;
  flex-direction: row;
  gap: 0.7em;
  animation: none;
}
#s-find:is([data-state='play'], [data-state='found']) .fd-target {
  width: 5em;
  height: 5em;
}
#s-find:is([data-state='play'], [data-state='found']) .fd-icon svg {
  width: 6em;
  height: 3.2em;
}
#s-find:is([data-state='play'], [data-state='found']) .fd-ask {
  font-size: 1.35em;
}
#s-find:is([data-state='play'], [data-state='found']) .fd-round {
  display: none;
}
#s-find.dark .fd-askcard {
  border-color: #ffd21f;
}

/* the clock: a bar that runs down, and the seconds */
.fd-clock {
  position: absolute;
  left: 50%;
  top: 3.2%;
  transform: translateX(-50%);
  width: 24%;
  height: 2.6em;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 0.18em solid #dfe4ea;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.fd-clock i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: calc(var(--left, 1) * 100%);
  background: linear-gradient(180deg, #8ee0a8, #36b864);
}
.fd-clock.hurry i {
  background: linear-gradient(180deg, #ffb07a, #ef6a2a);
  animation: pulse 0.5s ease-in-out infinite;
}
.fd-clock span {
  position: relative;
  width: 100%;
  text-align: center;
  font-size: 1.3em;
  font-weight: 900;
  color: #2f3f35;
  text-shadow: 0 0.05em 0 rgba(255, 255, 255, 0.7);
}

.fd-banner {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%) scale(0.6);
  padding: 0.35em 1.3em 0.45em;
  border-radius: 999px;
  background: #fff;
  border: 0.2em solid var(--pc, #ffd21f);
  box-shadow: 0 0.5em 1.4em rgba(0, 0, 0, 0.25);
  font-size: 2.3em;
  font-weight: 900;
  color: #3b4049;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s, transform 0.45s cubic-bezier(0.2, 1.5, 0.4, 1);
  pointer-events: none;
}
.fd-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.fd-banner b {
  color: var(--pc);
}

/* everyone's finds, along the bottom */
.fd-scores {
  position: absolute;
  left: 50%;
  bottom: 2.8%;
  transform: translateX(-50%);
  gap: 1em;
}
.fd-score {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.3em 1em 0.3em 0.3em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  border: 0.18em solid var(--pc);
  box-shadow: var(--shadow);
  font-weight: 900;
  transition: transform 0.25s, opacity 0.25s;
}
.fd-score img {
  width: 2.6em;
  height: 2.6em;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 35%, #fff, #e5f2fa);
}
.fd-score span {
  max-width: 7em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4a5058;
}
.fd-score b {
  min-width: 1.6em;
  padding: 0.05em 0.45em;
  border-radius: 999px;
  background: var(--pc);
  color: #fff;
  text-align: center;
  font-size: 1.15em;
}
.fd-score.up {
  animation: fd-up 0.6s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes fd-up {
  40% {
    transform: scale(1.18);
  }
}
.fd-score.locked {
  opacity: 0.55;
}

/* the results */
.fd-results h2 {
  margin: 0.3em 0 0;
  font-size: 2.3em;
  font-weight: 900;
  color: #3b4049;
}
.fd-results > p {
  margin-top: 0.2em;
}
.fd-res-list {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  width: 100%;
  margin-top: 1em;
}
.fd-res-row {
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.35em 1em 0.35em 0.35em;
  border-radius: 999px;
  background: #f3f6f9;
  border: 0.15em solid #e2e7ec;
  font-weight: 900;
  font-size: 1.15em;
}
.fd-res-row.first {
  background: #fff7d6;
  border-color: #f0c419;
}
.fd-res-row img {
  width: 2.6em;
  height: 2.6em;
  border-radius: 50%;
  background: #fff;
  border: 0.15em solid var(--pc);
}
.fd-res-name {
  flex: 1;
  text-align: left;
}
.fd-res-score {
  color: #6b737c;
  font-size: 0.9em;
}
