/* ==========================================================================
   "לאיזו מפלגה שייך המועמד?" – pick the candidate's party from the logos (on top of games.css)
   ========================================================================== */

/* ---------- Start: candidate card + party chips ---------- */

.cq-hero { position: relative; width: 190px; height: 116px; margin: 4px auto 12px; }
.cq-hero__card {
  position: absolute;
  left: 50%;
  top: 4px;
  width: 84px;
  height: 104px;
  margin-left: -42px;
  display: grid;
  place-items: end center;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(170deg, #fff, #e9eef5);
  box-shadow: 0 10px 24px rgba(11, 29, 77, .2), inset 0 0 0 1px var(--line);
  animation: bob 3.2s ease-in-out infinite;
}
.cq-hero__card svg { width: 70%; height: 78%; fill: #b4bfd1; }
.cq-hero__q {
  position: absolute;
  top: -2px;
  left: calc(50% + 26px);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-bold);
  font-weight: 900;
  font-size: 20px;
  color: #fff;
  background: var(--blue-500);
  box-shadow: 0 0 0 3px #fff, 0 6px 14px rgba(37, 99, 235, .35);
  animation: bump 2.4s ease-in-out infinite;
}
.cq-hero__chip {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 14px rgba(11, 29, 77, .16), inset 0 0 0 1px var(--line);
}
.cq-hero__chip::after { content: ""; position: absolute; inset: 10px 7px; border-radius: 3px; background: var(--c); opacity: .85; }
.cq-hero__chip--a { --c: var(--blue-600); right: 0; top: 22px; transform: rotate(10deg); animation: float-a 3.4s ease-in-out infinite; }
.cq-hero__chip--b { --c: var(--true); left: 4px; top: 10px; transform: rotate(-12deg); animation: float-c 3.4s ease-in-out -1.2s infinite; }
.cq-hero__chip--c { --c: var(--false); left: 26px; bottom: 0; transform: rotate(6deg); animation: float-b 3.4s ease-in-out -2.2s infinite; }
@keyframes float-a { 50% { transform: translateY(-8px) rotate(14deg); } }
@keyframes float-b { 50% { transform: translateY(-9px) rotate(0deg); } }
@keyframes float-c { 50% { transform: translateY(-7px) rotate(-16deg); } }

/* ---------- Candidate card ---------- */

.cq-stage { display: grid; place-items: center; margin-top: 4px; }
.cq-card {
  position: relative;
  width: min(100%, 300px);
  padding: 20px 18px 16px;
  display: grid;
  justify-items: center;
  gap: 4px;
  border-radius: 20px;
  text-align: center;
  background:
    radial-gradient(circle at 50% -10%, rgba(59, 130, 246, .5), transparent 60%),
    linear-gradient(160deg, var(--navy-700), var(--navy-900));
  color: #fff;
  box-shadow: 0 16px 34px rgba(7, 20, 54, .3);
  transition: box-shadow .3s;
}
.cq-card.is-enter { animation: cq-in .55s var(--ease-spring) both; }
.cq-card.is-leave { animation: cq-out .3s ease-in both; }
@keyframes cq-in { from { opacity: 0; transform: translateX(-60px) rotate(-6deg) scale(.92); } }
@keyframes cq-out { to { opacity: 0; transform: translateX(70px) rotate(6deg) scale(.92); } }
.cq-card.is-right { box-shadow: 0 0 0 4px var(--true), 0 16px 34px rgba(22, 163, 74, .35); }
.cq-card.is-wrong { box-shadow: 0 0 0 4px var(--false), 0 16px 34px rgba(225, 37, 47, .3); animation: shake .45s ease-in-out; }

.cq-card__photo {
  position: relative;
  width: 132px;
  height: 132px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, #e9eef6, #cdd7e6);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .14), 0 10px 20px rgba(0, 0, 0, .25);
}
.cq-card__face { /* round photo window; the badge lives outside it */
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  overflow: hidden;
  border-radius: 50%;
}
.cq-card__face > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
}
.cq-card__silhouette { width: 66%; height: 78%; fill: #a9b5c9; }
.cq-card__photo::after { /* keep the silhouette inside the circle */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
  pointer-events: none;
}

/* party logo badge that pops onto the card after answering */
.cq-card__badge {
  position: absolute;
  right: -10px;
  bottom: -6px;
  width: 58px;
  height: 58px;
  padding: 5px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 3px var(--badge, #fff), 0 8px 18px rgba(0, 0, 0, .3);
  opacity: 0;
  transform: scale(0) rotate(-20deg);
}
.cq-card__badge img { width: 100%; height: 100%; object-fit: contain; }
.cq-card.is-answered .cq-card__badge { opacity: 1; transform: none; animation: badge-pop .5s var(--ease-spring); }
@keyframes badge-pop { from { opacity: 0; transform: scale(0) rotate(-20deg); } }
.cq-card.is-right .cq-card__badge { --badge: var(--true); }
.cq-card.is-wrong .cq-card__badge { --badge: #f97316; }

.cq-card__name {
  font-family: var(--font-bold);
  font-weight: 900;
  font-size: clamp(22px, 5vw, 26px);
  line-height: 1.15;
  text-wrap: balance;
}
.cq-card__name:focus { outline: none; }
.cq-card__meta { min-height: 1.4em; font-size: 15px; color: rgba(255, 255, 255, .75); }
.cq-card.is-right .cq-card__meta { color: #86efac; font-weight: 500; }
.cq-card.is-wrong .cq-card__meta { color: #fdba74; font-weight: 500; }
.cq-card .tol-stamp { top: 14px; left: 12px; font-size: 18px; }

/* ---------- Party logo options ---------- */

.cq-parties {
  --cols: 7;
  --gap: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* a short last row sits in the middle */
  gap: var(--gap);
  margin-top: 20px;
}
.cq-parties li { width: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); }
.cq-party {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  padding: 7px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 3px 0 var(--line), 0 6px 12px rgba(11, 29, 77, .06);
  cursor: pointer;
  transition: transform .14s var(--ease-spring), box-shadow .14s, border-color .14s, opacity .25s, filter .25s;
}
.cq-party img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.cq-party:hover:not(:disabled) { transform: translateY(-3px) scale(1.04); border-color: var(--blue-500); box-shadow: 0 5px 0 #c8d6f3, 0 12px 20px rgba(37, 99, 235, .16); }
.cq-party:active:not(:disabled) { transform: translateY(2px) scale(.97); box-shadow: 0 1px 0 var(--line); }
.cq-party:disabled { cursor: default; }
.cq-party:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; }
.cq-parties li { animation: rise .35s var(--ease-out) both; }

.cq-parties.is-answered .cq-party:not(.is-right):not(.is-wrong) { opacity: .35; filter: grayscale(.7); }
.cq-party.is-right { border-color: var(--true); box-shadow: 0 0 0 3px rgba(22, 163, 74, .25), 0 3px 0 #0f7a35; animation: picked .5s var(--ease-spring); z-index: 1; }
.cq-party.is-wrong { border-color: var(--false); box-shadow: 0 0 0 3px rgba(225, 37, 47, .2); animation: shake .4s ease-in-out; }
.cq-party .cq-mark {
  position: absolute;
  top: -8px;
  inset-inline-end: -8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 0 0 2px #fff;
  animation: pop-in .35s var(--ease-spring);
}
.cq-party .cq-mark svg { width: 13px; height: 13px; }
.cq-party.is-right .cq-mark { background: var(--true); }
.cq-party.is-wrong .cq-mark { background: var(--false); }

/* ---------- Result recap ---------- */

.cq-recap { display: grid; gap: 8px; margin: 22px 0 6px; text-align: start; }
.cq-recap li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--bg);
  animation: rise .4s var(--ease-out) both;
}
.cq-recap__face {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: end center;
  overflow: hidden;
  border-radius: 50%;
  background: #dde3ec;
}
.cq-recap__face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.cq-recap__face svg { width: 70%; height: 80%; fill: #b4bfd1; }
.cq-recap__face i {
  position: absolute;
  bottom: -2px;
  inset-inline-start: -2px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 0 0 2px var(--bg);
}
.cq-recap__face i svg { width: 10px; height: 10px; fill: none; }
.cq-recap li.is-right .cq-recap__face i { background: var(--true); }
.cq-recap li.is-wrong .cq-recap__face i { background: var(--false); }
.cq-recap__text { display: grid; line-height: 1.3; }
.cq-recap__text strong { font-family: var(--font-bold); font-weight: 800; font-size: 15px; color: var(--navy-800); }
.cq-recap__text span { font-size: 13px; color: var(--muted); }
.cq-recap__logo { width: 44px; height: 44px; padding: 4px; border-radius: 10px; background: #fff; border: 1px solid var(--line); object-fit: contain; }

@media (max-width: 700px) {
  .cq-parties { --cols: 4; --gap: 7px; }
  .cq-card__photo { width: 112px; height: 112px; }
}
