/*
 * X18Reviews · /home3 · search-rank widget
 * Dark-card illustration: "vet near me" is typed, five phone-style results
 * appear, the cursor drags "Paws & Claws Vet" from #5 to #1 while its rating
 * and review count climb, then a short celebration plays.
 * Every selector is scoped under .h3-rank. Built by search-rank.js.
 */

.h3-rank {
  overflow: hidden;
}

.h3-rank .h3-rank-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  font-family: "Inter", "Inter Placeholder", sans-serif;
  font-feature-settings: "cv11" 1;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  contain: layout paint;
}

.h3-rank .h3-rank-stage *,
.h3-rank .h3-rank-stage *::before,
.h3-rank .h3-rank-stage *::after {
  box-sizing: border-box;
}

.h3-rank .h3-rank-stage svg {
  display: block;
  overflow: visible;
}

.h3-rank .h3-rank-scene {
  position: absolute;
  inset: 0;
  transform-origin: 50% 40%;
}

/* ---------- local map backdrop ---------- */

.h3-rank .h3-rank-map {
  position: absolute;
  inset: 0;
  -webkit-mask-image: radial-gradient(ellipse 62% 70% at 50% 52%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 70% at 50% 52%, #000 30%, transparent 100%);
}

.h3-rank .h3-rank-map > svg {
  position: absolute;
  left: 0;
  top: 0;
}

.h3-rank .h3-rank-pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 18px;
  margin: -18px 0 0 -7px;
  transform-origin: 50% 100%;
}

.h3-rank .h3-rank-pin.is-you {
  width: 20px;
  height: 26px;
  margin: -26px 0 0 -10px;
}

.h3-rank .h3-rank-pin svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}

.h3-rank .h3-rank-pinring {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 11px;
  margin: -5.5px 0 0 -14px;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(74, 222, 128, 0.9);
}

/* ---------- ambient win glow ---------- */

.h3-rank .h3-rank-amb {
  position: absolute;
  background: radial-gradient(closest-side, rgba(34, 197, 94, 0.32), rgba(34, 197, 94, 0.1) 55%, rgba(34, 197, 94, 0));
}

/* ---------- search pill ---------- */

.h3-rank .h3-rank-pill {
  position: absolute;
  border-radius: 999px;
}

.h3-rank .h3-rank-pill-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.h3-rank .h3-rank-pill-in {
  position: absolute;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 11px 27px rgba(0, 0, 0, 0.16), 0 36px 48px rgba(0, 0, 0, 0.14);
}

.h3-rank .h3-rank-q {
  position: absolute;
  top: 0;
  white-space: pre;
  color: #181f1f;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.h3-rank .h3-rank-q > span {
  display: inline-block;
  white-space: pre;
}

.h3-rank .h3-rank-q > .h3-rank-ph {
  position: absolute;
  left: 0;
  top: 0;
  color: rgba(2, 6, 23, 0.42);
}

.h3-rank .h3-rank-caret {
  position: absolute;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background: #16a34a;
}

.h3-rank .h3-rank-btn {
  position: absolute;
  border-radius: 50%;
  background: #181f1f;
  display: flex;
  align-items: center;
  justify-content: center;
}

.h3-rank .h3-rank-btn svg {
  width: 44%;
  height: 44%;
}

.h3-rank .h3-rank-ripple {
  position: absolute;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.85);
}

/* ---------- results ---------- */

.h3-rank .h3-rank-list {
  position: absolute;
  z-index: 0;
}

.h3-rank .h3-rank-row {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  z-index: 1;
}

.h3-rank .h3-rank-row.is-you {
  z-index: 3;
}

.h3-rank .h3-rank-lift,
.h3-rank .h3-rank-glow,
.h3-rank .h3-rank-wave,
.h3-rank .h3-rank-bg,
.h3-rank .h3-rank-dim {
  position: absolute;
  inset: 0;
  border-radius: 12px;
}

.h3-rank .h3-rank-lift {
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.6), 0 6px 12px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(34, 197, 94, 0.16);
}

.h3-rank .h3-rank-glow {
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.95), 0 0 18px 2px rgba(34, 197, 94, 0.5), 0 0 44px 8px rgba(34, 197, 94, 0.2);
}

/* .h3-rank-wave: outset + stroke are set inline (concentric ripple rings) */

.h3-rank .h3-rank-bg {
  background: #222929;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.h3-rank .h3-rank-dim {
  background: rgba(23, 31, 31, 0.5);
}

.h3-rank .h3-rank-row.is-you .h3-rank-bg {
  background: linear-gradient(90deg, #1b3b2b 0%, #1a2f27 100%);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.55);
}

/* lifted state: lighter surface + 1px top highlight (visible on the dark card) */
.h3-rank .h3-rank-hl {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), inset 0 0 0 1px rgba(134, 239, 172, 0.25);
}

.h3-rank .h3-rank-shine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 42%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 15%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 85%);
}

.h3-rank .h3-rank-in {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
}

.h3-rank .h3-rank-num {
  position: relative;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.h3-rank .h3-rank-row.is-you .h3-rank-num {
  background: rgba(74, 222, 128, 0.16);
  color: #bbf7d0;
}

.h3-rank .h3-rank-strip {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
}

.h3-rank .h3-rank-strip > span {
  display: block;
}

.h3-rank .h3-rank-win {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #22c55e;
  color: #052e16;
  font-weight: 700;
  text-align: center;
}

/* listing photo: illustrated tile underneath, the photo covers it when ready */
.h3-rank .h3-rank-thumb {
  position: relative;
  flex: none;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

.h3-rank .h3-rank-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.h3-rank .h3-rank-thumb > svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.h3-rank .h3-rank-thumb.has-photo {
  background: #2a3232 !important;
}

.h3-rank .h3-rank-thumb.has-photo > svg {
  display: none;
}

.h3-rank .h3-rank-photo {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  max-width: none;
}

.h3-rank .h3-rank-txt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.h3-rank .h3-rank-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
}

.h3-rank .h3-rank-name > b {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h3-rank .h3-rank-you,
.h3-rank .h3-rank-jump {
  flex: none;
  padding: 1.5px 6px;
  border-radius: 99px;
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.h3-rank .h3-rank-jump {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: -2px;
  padding: 1.5px 6px 1.5px 5px;
  background: #22c55e;
  color: #052e16;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.35);
}

.h3-rank .h3-rank-jump svg {
  width: 7px;
  height: 7px;
}

/* rating line: 4.6 ★★★★☆ (412), stars filled true to the rating */
.h3-rank .h3-rank-rate {
  display: flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
  letter-spacing: 0;
}

.h3-rank .h3-rank-score {
  position: relative;
  display: inline-flex;
  flex: none;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  font-variant-numeric: tabular-nums;
  transform-origin: 50% 55%;
}

/* green copy of our rating, cross-faded in with each pop (opacity only) */
.h3-rank .h3-rank-tint {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  color: #4ade80;
  opacity: 0;
}

.h3-rank .h3-rank-stars {
  display: flex;
  flex: none;
  gap: 1px;
}

.h3-rank .h3-rank-star {
  position: relative;
  flex: none;
}

.h3-rank .h3-rank-star > svg {
  position: absolute;
  left: 0;
  top: 0;
}

/* gold part of a partly filled star (width set inline from the rating) */
.h3-rank .h3-rank-star > i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
}

/* a star that fills while ours climbs: the clip window and the gold star
   slide against each other (transform only) */
.h3-rank .h3-rank-sclip {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.h3-rank .h3-rank-sclip > span {
  position: absolute;
  left: 0;
  top: 0;
}

.h3-rank .h3-rank-count {
  display: inline-flex;
  flex: none;
  color: rgba(255, 255, 255, 0.42);
  font-variant-numeric: tabular-nums;
}

.h3-rank .h3-rank-cnum {
  display: inline-flex;
}

.h3-rank .h3-rank-row.is-you .h3-rank-score {
  color: #fff;
}

.h3-rank .h3-rank-row.is-you .h3-rank-count {
  color: rgba(134, 239, 172, 0.85);
}

.h3-rank .h3-rank-plus {
  flex: none;
  margin-left: 1px;
  padding: 0 5px;
  border-radius: 99px;
  background: rgba(34, 197, 94, 0.22);
  color: #4ade80;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 15px;
  height: 15px;
  font-variant-numeric: tabular-nums;
  transform-origin: 0 50%;
}

/* right column: distance (ours hands it to the #1 badge) */
.h3-rank .h3-rank-side {
  flex: none;
  text-align: right;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.h3-rank .h3-rank-side > span {
  display: inline-block;
}

.h3-rank .h3-rank-row.is-you .h3-rank-side {
  color: rgba(134, 239, 172, 0.8);
}

.h3-rank .h3-rank-badge {
  position: absolute;
  padding: 0 9px 0 7px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 3.5px;
  background: linear-gradient(135deg, #fef08a 0%, #fbbf24 55%, #f59e0b 100%);
  color: #422006;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(251, 191, 36, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.h3-rank .h3-rank-badge svg {
  width: 12.5px;
  height: 12.5px;
}

.h3-rank .h3-rank-spark {
  position: absolute;
  left: 0;
  top: 0;
}

/* ---------- confetti ---------- */

/* lives inside the list, between the other rows (z 1) and the winner (z 3) */
.h3-rank .h3-rank-fx {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 2;
}

.h3-rank .h3-rank-cf {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 1.5px;
}

.h3-rank .h3-rank-cf.is-dot {
  border-radius: 50%;
}

/* ---------- toast ---------- */

/* top + gradient stop are set inline (lines up with the last slot) */
.h3-rank .h3-rank-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}

.h3-rank .h3-rank-toastwrap {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}

.h3-rank .h3-rank-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: #181f1f;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42), 0 3px 8px rgba(0, 0, 0, 0.22);
}

.h3-rank .h3-rank-ico {
  flex: none;
  border-radius: 50%;
  background: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.h3-rank .h3-rank-ico svg {
  width: 52%;
  height: 52%;
}

.h3-rank .h3-rank-chip {
  display: flex;
  align-items: center;
  gap: 1px;
  border-radius: 99px;
  background: #dcfce7;
  color: #15803d;
  font-weight: 700;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.h3-rank .h3-rank-chip svg {
  width: 10px;
  height: 10px;
  margin-right: 1px;
}

.h3-rank .h3-rank-odo {
  position: relative;
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}

.h3-rank .h3-rank-odo > span {
  display: block;
}

.h3-rank .h3-rank-odo > span > span {
  display: block;
  text-align: center;
}

/* ---------- side stat cards (wide layout) ---------- */

.h3-rank .h3-rank-card {
  position: absolute;
  overflow: hidden;
  border-radius: 18px;
  background: #1f2626;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 0, 0, 0.25);
  padding: 14px 15px;
}

.h3-rank .h3-rank-card-h {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
}

.h3-rank .h3-rank-card-h > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h3-rank .h3-rank-card-h .h3-rank-ico {
  width: 22px;
  height: 22px;
  background: rgba(34, 197, 94, 0.18);
}

.h3-rank .h3-rank-card-n {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-family: "Inter Display", "Inter", "Inter Placeholder", sans-serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

.h3-rank .h3-rank-card-n .h3-rank-chip {
  font-family: "Inter", "Inter Placeholder", sans-serif;
  font-size: 11px;
  height: 20px;
  padding: 0 7px 0 6px;
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
}

.h3-rank .h3-rank-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 30px;
  margin-top: 12px;
}

.h3-rank .h3-rank-bars > i {
  position: relative;
  flex: 1 1 0;
  height: 100%;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  transform-origin: 50% 100%;
}

.h3-rank .h3-rank-bars > i > b {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #4ade80, #16a34a);
}

/* ---------- cursor ---------- */

.h3-rank .h3-rank-cur {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
}

.h3-rank .h3-rank-cur > div {
  position: absolute;
}

.h3-rank .h3-rank-cur svg {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

/* ---------- compliance caption ---------- */

.h3-rank .h3-rank-cap {
  position: absolute;
  bottom: 7px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
}
