@font-face {
  font-family: Nunito;
  src: url("assets/nunito-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

.rating-page {
  color: #202124;
  background: var(--water-gradient);
  font-family: Nunito, "Segoe UI", Arial, sans-serif;
}
.bubble-field { display: none; }
.rating-page .bubble-field {
  --bubble-scale: 1;
  --bubble-rim: #e9faffb8;
  --bubble-glint: #fffdf9d4;
  --bubble-fill: #c4efff85;
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.bubble-field span {
  position: absolute;
  width: calc(var(--size) * var(--bubble-scale));
  aspect-ratio: 1;
  border: 1px solid var(--bubble-rim);
  border-radius: 50%;
  background: radial-gradient(circle at 28% 24%, var(--bubble-glint) 0 9%, transparent 12%),
    radial-gradient(circle at 43% 38%, #f7fdff34 25%, var(--bubble-fill) 100%);
  box-shadow: inset 0 0 .3rem #e4faff92;
}
.bubble-field span:nth-child(1) { top: 1.7rem; left: 7%; --size: 2.7rem; --duration: 21s; --delay: -2s; --drift: 9px; }
.bubble-field span:nth-child(2) { top: 4.7rem; left: 22%; --size: 1.05rem; --duration: 19s; --delay: -14s; --drift: -7px; }
.bubble-field span:nth-child(3) { top: 3.2rem; right: 8%; --size: 2.3rem; --duration: 23s; --delay: -8s; --drift: -8px; }
.bubble-field span:nth-child(4) { top: 1.6rem; right: 25%; --size: .9rem; --duration: 20s; --delay: -16s; --drift: 6px; }
.bubble-field span:nth-child(5) { top: 37%; left: max(-1.3rem, calc(50% - 32rem)); --size: 3.25rem; --duration: 25s; --delay: -13s; --drift: 5px; }
.bubble-field span:nth-child(6) { top: 50%; right: max(-1.1rem, calc(50% - 33rem)); --size: 2.7rem; --duration: 22s; --delay: -4s; --drift: -5px; }
.bubble-field span:nth-child(7) { bottom: 12%; left: max(-.35rem, calc(50% - 34rem)); --size: 1.65rem; --duration: 23s; --delay: -17s; --drift: 6px; }
.bubble-field span:nth-child(8) { bottom: .55rem; right: 14%; --size: 2rem; --duration: 24s; --delay: -6s; --drift: -8px; }
@media (max-width: 38rem) {
  .rating-page .bubble-field {
    --bubble-scale: 1.18;
    --bubble-rim: #f2fcffed;
    --bubble-glint: #fffefcff;
    --bubble-fill: #d4f5ffad;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .rating-page .bubble-field { position: fixed; }
  .rating-page .bubble-field span {
    top: auto;
    bottom: 0;
    animation:
      bubble-rise var(--duration) linear var(--delay) infinite,
      bubble-sway 5.5s ease-in-out var(--delay) infinite alternate;
  }
  .bubble-field span:nth-child(1) { left: clamp(-.7rem, calc(50% - 30rem), 7%); }
  .bubble-field span:nth-child(2) { left: clamp(.05rem, calc(50% - 28rem), 22%); }
  .bubble-field span:nth-child(3) { right: clamp(-.55rem, calc(50% - 30rem), 8%); }
  .bubble-field span:nth-child(4) { right: clamp(.05rem, calc(50% - 28rem), 25%); }
  .bubble-field span:nth-child(8) { right: clamp(-.7rem, calc(50% - 30rem), 14%); }
}
@media (max-width: 38rem) and (prefers-reduced-motion: no-preference) {
  .bubble-field span:nth-child(1) { left: -.7rem; }
  .bubble-field span:nth-child(2) { left: 19%; }
  .bubble-field span:nth-child(3) { right: -.55rem; }
  .bubble-field span:nth-child(4) { right: 22%; }
  .bubble-field span:nth-child(8) { right: 14%; }
}
@keyframes bubble-rise {
  from { transform: translateY(calc(100% + 1rem)); }
  to { transform: translateY(calc(-100dvh - 1rem)); }
}
@keyframes bubble-sway {
  from { translate: calc(-1 * var(--drift)) 0; }
  to { translate: var(--drift) 0; }
}
.rating-page .shell { position: relative; width: min(100% - 2rem, 52.5rem); }
.rating-page .brand-header {
  min-height: 0;
  margin-bottom: 1rem;
}
.rating-page .brand { background: var(--navy); }
.rating-page .brand img { width: clamp(11rem, 42vw, 15rem); }
.rating-gateway { text-align: center; }
.rating-heading,
.rating-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 1.375rem;
  box-shadow: 0 .45rem .75rem -.38rem #38475655;
}
.rating-heading {
  margin-bottom: clamp(1rem, 4vw, 2.25rem);
  padding: clamp(1.05rem, 3.4vw, 2rem) 1rem;
  background: linear-gradient(110deg, var(--mood-header-start, #c9bfe5), var(--mood-header-end, #efe8fc));
}
.rating-heading .outlet-name {
  margin-bottom: .48rem;
  color: #263451;
  font-size: clamp(1.5rem, 6vw, 2.4rem);
}
.rating-heading h1 { font-size: clamp(1.85rem, 5vw, 3rem); text-wrap: balance; }
.rating-heading .translation { margin: .5rem 0 0; }
.rating-card {
  display: grid;
  justify-items: center;
  gap: .85rem;
  background: #fff;
  padding: clamp(1.15rem, 4vw, 2rem) 1rem;
}
.rating-face {
  display: block;
  width: clamp(6.6rem, 20vw, 8.25rem);
  height: auto;
  overflow: visible;
}
.mood-label {
  display: grid;
  gap: .15rem;
  color: var(--mood-accent, #6f559f);
  font-size: 1.2rem;
  line-height: 1.2;
}
.mood-label span { font-size: .875rem; }
.rating-card #rating {
  --fill: 50%;
  appearance: none;
  background: transparent;
  width: min(100%, 34rem);
  min-height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
}
#rating::-webkit-slider-runnable-track {
  height: .5rem;
  border-radius: .5rem;
  background: linear-gradient(to right, var(--mood-accent, #6f559f) var(--fill), var(--mood-track, #e2daf0) var(--fill));
}
#rating::-webkit-slider-thumb {
  appearance: none;
  width: 2.125rem;
  height: 2.125rem;
  margin-top: -.8125rem;
  border-radius: 50%;
  background: var(--mood-accent, #6f559f);
}
#rating::-moz-range-track { height: .5rem; border-radius: .5rem; background: var(--mood-track, #e2daf0); }
#rating::-moz-range-progress { height: .5rem; border-radius: .5rem; background: var(--mood-accent, #6f559f); }
#rating::-moz-range-thumb { width: 2.125rem; height: 2.125rem; border: 0; border-radius: 50%; background: var(--mood-accent, #6f559f); }
.rating-hint, .rating-status {
  margin: 0;
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.35;
}
.submit-rating {
  min-height: 3rem;
  padding: .55rem 1.55rem;
  border: 0;
  border-radius: .875rem;
  background: var(--mood-accent, #6f559f);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.submit-rating small { display: block; font-size: .8125rem; font-weight: 500; }
.submit-rating:hover { box-shadow: 0 .25rem .75rem #20212426; }
.rating-page :is(#rating, .submit-rating):focus-visible {
  outline: 3px solid var(--mood-accent, #6f559f);
  outline-offset: 4px;
}
@property --pulse-size {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}
@property --blink-height {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}
@property --bounce-height {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}
.heart-beat { transform-origin: 0 0; }
#hearts { transition: --pulse-size 180ms ease-out; }
#eyes { transition: --blink-height 160ms ease-out; }
.rating-face { transition: --bounce-height 200ms ease-out; }

#hearts.is-pulsing .heart-beat {
  animation: heartbeat 1.2s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 40%, 100% { transform: scale(1); }
  12% { transform: scale(var(--pulse-size)); }
  23% { transform: scale(calc(1 + (var(--pulse-size) - 1) * .25)); }
  31% { transform: scale(calc(1 + (var(--pulse-size) - 1) * .7)); }
}
@media (prefers-reduced-motion: reduce) {
  #hearts.is-pulsing .heart-beat { animation: none; }
}

#tears { opacity: var(--tear-opacity, 0); transition: opacity 180ms ease-out; }
.tear-drop { opacity: 0; }
.is-crying .tear-drop {
  animation: tear-fall 1.7s cubic-bezier(.35, 0, .65, 1) infinite;
}
.is-crying .tear-right { animation-delay: -.85s; }
@keyframes tear-fall {
  0% { transform: translateY(0) scale(.35); opacity: 0; }
  15% { transform: translateY(2px) scale(.8); opacity: 1; }
  45% { opacity: 1; }
  85%, 100% { transform: translateY(35px) scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .is-crying .tear-drop {
    animation: none;
    transform: translateY(7px);
    opacity: 1;
  }
}

#eyes.is-blinking ellipse {
  transform-box: fill-box;
  transform-origin: center;
  animation: neutral-blink 3.2s ease-in-out infinite;
}
@keyframes neutral-blink {
  0%, 10%, 100% { transform: scaleY(1); }
  5% { transform: scaleY(var(--blink-height)); }
}
@media (prefers-reduced-motion: reduce) {
  #eyes.is-blinking ellipse { animation: none; }
}

.rating-face.is-bouncing {
  animation: happy-bounce 1.35s ease-in-out infinite;
}
@keyframes happy-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(var(--bounce-height)); }
}
@media (prefers-reduced-motion: reduce) {
  .rating-face.is-bouncing { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rating-face, #eyes, #hearts, #tears { transition: none; }
}
