:root {
  --ponder-hand-read-good: #3478d6;
  --ponder-hand-read-street-flop: #2adfa3;
}
.phr-grade-icon[data-hand-read-grade="GOOD"] { color: var(--ponder-hand-read-good); }
.phr-feedback-overlay.is-circle-check { --phr-feedback-color: var(--ponder-hand-read-good); }
.phr-feedback-overlay {
  --phr-feedback-color: #20f7ff;
  position: fixed;
  inset: 0;
  z-index: 24000;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  animation: phrFeedbackOverlay var(--phr-feedback-duration, 1900ms) linear forwards;
}

.ponder-result-collecting { visibility: hidden !important; }
.phr-feedback-overlay.ponder-result-collecting,
.phr-feedback-overlay.ponder-result-collecting * { animation-play-state: paused !important; }

.phr-feedback-overlay.ponder-result-slot-right { inset: 0 0 0 50%; }
.phr-feedback-overlay.ponder-result-slot-center { inset: 0; }

.phr-grade-icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  align-items: center;
  justify-content: center;
  color: currentColor;
  line-height: 1;
  vertical-align: -.12em;
  filter: drop-shadow(0 0 .22em rgba(32, 247, 255, .24));
}

.phr-grade-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.phr-grade-icon-shape {
  fill: none;
  stroke: currentColor;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.phr-feedback-stage {
  display: grid;
  grid-template-rows: auto auto auto;
  justify-items: center;
  width: min(38vw, 34vh, 14rem);
  color: var(--phr-feedback-color);
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--phr-feedback-color) 34%, transparent));
}

.phr-feedback-stage svg {
  width: min(31vw, 30vh, 11.5rem);
  height: min(31vw, 30vh, 11.5rem);
  overflow: visible;
}

.phr-feedback-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  /* Keep normalized dash lengths in the SVG coordinate system at every viewport scale. */
  vector-effect: none;
}

.phr-feedback-arc { transform: rotate(-90deg); transform-origin: 80px 80px; animation: phrFeedbackDraw .58s ease-out .08s forwards; }
.phr-feedback-star { animation: phrFeedbackDraw .46s ease-out .66s forwards; }
.phr-feedback-inner { animation: phrFeedbackDraw .36s ease-out .64s forwards; }
.phr-feedback-check-short { animation: phrFeedbackDraw .18s ease-out .98s forwards; }
.phr-feedback-check-long { animation: phrFeedbackDraw .27s ease-out .62s forwards; }
.phr-feedback-triangle-one { animation: phrFeedbackDraw .34s ease-out .08s forwards; }
.phr-feedback-triangle-two { animation: phrFeedbackDraw .34s ease-out .38s forwards; }
.phr-feedback-triangle-three { animation: phrFeedbackDraw .34s ease-out .68s forwards; }
.phr-feedback-cross-one { animation: phrFeedbackDraw .4s ease-out .12s forwards; }
.phr-feedback-cross-two { animation: phrFeedbackDraw .4s ease-out .48s forwards; }

.phr-feedback-overlay.is-star .phr-feedback-stage { animation: phrFeedbackPulse .28s ease-out 1.1s both; }
.phr-feedback-overlay.is-double-circle .phr-feedback-stage { animation: phrFeedbackPulseSoft .25s ease-out 1.28s both; }
.phr-feedback-overlay.is-circle-check .phr-feedback-stage { animation: phrFeedbackPulseSoft .24s ease-out 1.38s both; }
.phr-feedback-overlay.is-triangle { --phr-feedback-color: #ffb44a; }
.phr-feedback-overlay.is-triangle .phr-feedback-stage { animation: phrFeedbackPulseSoft .23s ease-out 1.02s both; }
.phr-feedback-overlay.is-cross { --phr-feedback-color: #ff5f72; }
.phr-feedback-overlay.is-cross .phr-feedback-stage { animation: phrFeedbackPulseSoft .2s ease-out .88s both; }

.phr-feedback-reason {
  max-width: min(72vw, 28rem);
  min-height: 1.2em;
  margin-top: -.15rem;
  padding: .16rem .45rem;
  border-radius: .18rem;
  background: rgba(0, 7, 12, .62);
  color: rgba(239, 251, 255, .94);
  font-size: clamp(.7rem, 1.5vw, .98rem);
  font-weight: 850;
  line-height: 1.3;
  text-align: center;
  text-shadow: 0 0 8px rgba(0, 0, 0, .9), 0 0 10px color-mix(in srgb, var(--phr-feedback-color) 22%, transparent);
  opacity: 0;
  transform: translateY(4px);
  animation: phrFeedbackReason .34s ease-out 1.12s forwards;
}

.phr-feedback-streak {
  margin-top: .38rem;
  padding: .2rem .55rem;
  border-top: 1px solid color-mix(in srgb, var(--phr-feedback-color) 52%, transparent);
  color: rgba(226, 247, 252, .8);
  font-size: clamp(.58rem, 1.15vw, .76rem);
  font-weight: 900;
  letter-spacing: .08em;
  opacity: 0;
  animation: phrFeedbackReason .28s ease-out .85s forwards;
}

.ponder-hand-read-available-cue {
  position: relative !important;
  overflow: hidden !important;
}

.ponder-hand-read-available-cue::after {
  content: "";
  position: absolute;
  left: -45%;
  right: auto;
  bottom: 0;
  width: 42%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e9ffff 42%, #20f7ff 72%, transparent);
  box-shadow: 0 0 7px rgba(32, 247, 255, .82);
  animation: phrAvailabilitySweep .72s ease-out forwards;
  pointer-events: none;
}

.phr-intro {
  position: fixed;
  inset: 0;
  z-index: 24010;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 5, 11, .38);
  backdrop-filter: blur(2px);
}

.phr-intro-panel {
  width: min(25rem, calc(100vw - 2rem));
  padding: clamp(.8rem, 2vw, 1.2rem);
  border: 1px solid rgba(32, 247, 255, .56);
  border-radius: .55rem;
  background: linear-gradient(145deg, rgba(5, 20, 31, .98), rgba(2, 9, 17, .98));
  box-shadow: 0 0 1.6rem rgba(32, 247, 255, .16);
  color: #edfaff;
  text-align: center;
}

.phr-intro-kicker { color: #20f7ff; font-size: .68rem; font-weight: 1000; letter-spacing: .16em; }
.phr-intro-panel > strong { display: block; margin-top: .35rem; font-size: clamp(.98rem, 2.1vw, 1.3rem); }
.phr-intro-panel p { margin: .55rem auto .45rem; color: rgba(221, 237, 244, .76); font-size: clamp(.72rem, 1.45vw, .9rem); line-height: 1.55; }
.phr-intro-grades { color: #dffeff; font-size: clamp(1rem, 2.4vw, 1.35rem); letter-spacing: .34em; text-indent: .34em; text-shadow: 0 0 10px rgba(32, 247, 255, .28); }
.phr-intro-actions { display: flex; justify-content: center; gap: .55rem; margin-top: .8rem; }
.phr-intro-actions button { min-width: 6.4rem; min-height: 2.2rem; border: 1px solid rgba(170, 210, 225, .3); border-radius: .35rem; background: rgba(11, 25, 36, .86); color: #eaf8fb; font: inherit; font-size: .76rem; font-weight: 900; cursor: pointer; }
.phr-intro-actions button.is-primary { border-color: rgba(32, 247, 255, .72); background: rgba(4, 83, 99, .42); color: #eaffff; }

@keyframes phrFeedbackDraw { to { stroke-dashoffset: 0; } }
@keyframes phrFeedbackPulse { 0%, 100% { filter: drop-shadow(0 0 7px rgba(32, 247, 255, .3)); transform: scale(1); } 50% { filter: drop-shadow(0 0 13px rgba(240, 255, 255, .65)); transform: scale(1.045); } }
@keyframes phrFeedbackPulseSoft { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@keyframes phrFeedbackReason { to { opacity: 1; transform: translateY(0); } }
@keyframes phrFeedbackOverlay { 0% { opacity: 0; } 6%, 84% { opacity: 1; } 100% { opacity: 0; } }
@keyframes phrAvailabilitySweep { from { left: -45%; opacity: 0; } 16% { opacity: 1; } to { left: 104%; opacity: 0; } }

@media (max-width: 760px), (max-height: 520px) {
  .phr-feedback-stage { width: min(31vw, 32vh, 9rem); }
  .phr-feedback-stage svg { width: min(25vw, 27vh, 7.6rem); height: min(25vw, 27vh, 7.6rem); }
  .phr-feedback-reason { max-width: 66vw; font-size: clamp(.62rem, 1.65vw, .78rem); }
  .phr-intro-panel { width: min(23rem, 72vw); padding: .65rem .8rem; }
  .phr-intro-panel p { margin: .38rem auto .3rem; line-height: 1.35; }
  .phr-intro-actions { margin-top: .55rem; }
  .phr-intro-actions button { min-height: 1.9rem; }
  .phr-feedback-overlay.ponder-result-slot-right .phr-feedback-stage { width: min(46%, 8.6rem); }
  .phr-feedback-overlay.ponder-result-slot-right .phr-feedback-stage svg { width: min(23vw, 25vh, 7.2rem); height: min(23vw, 25vh, 7.2rem); }
  .phr-feedback-overlay.ponder-result-slot-right .phr-feedback-reason { max-width: 44vw; }
}

@media (prefers-reduced-motion: reduce) {
  .phr-feedback-line { stroke-dashoffset: 0 !important; animation: none !important; }
  .phr-feedback-overlay { animation-duration: 850ms !important; }
  .phr-feedback-stage { animation: none !important; }
  .phr-feedback-reason, .phr-feedback-streak { opacity: 1; transform: none; animation: none !important; }
  .ponder-hand-read-available-cue::after { animation-duration: .18s !important; }
}
