:root {
  --gsh-navy: #071b35;
  --gsh-blue: #0d4f89;
  --gsh-sky: #24b9ec;
  --gsh-gold: #e2b842;
  --gsh-cream: #fff8df;
}

.ggh-speed-guide,
.ggh-speed-guide * {
  box-sizing: border-box;
}

.ggh-speed-guide {
  --gsh-look-x: 0px;
  --gsh-look-y: 0px;
  --gsh-tilt-x: 0deg;
  --gsh-tilt-y: 0deg;
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 2147482000;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  width: min(356px, calc(100vw - 22px));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.32;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(120px, 14px, 0) scale(.88);
  transform-origin: bottom right;
  transition: opacity .28s ease, transform .38s cubic-bezier(.2,.8,.25,1);
}

.ggh-speed-guide.is-ready {
  opacity: 1;
  transform: none;
  animation: gsh-sprint-in .82s cubic-bezier(.18,.8,.22,1.16) both;
}

.gsh-panel {
  position: relative;
  flex: 1 1 252px;
  width: 252px;
  min-width: 0;
  max-width: 252px;
  pointer-events: auto;
  opacity: 1;
  transform: translate3d(0,0,0) scale(1);
  transform-origin: right bottom;
  transition:
    opacity .24s ease,
    transform .3s cubic-bezier(.2,.8,.25,1.2),
    width .3s ease,
    max-width .3s ease,
    flex-basis .3s ease,
    visibility 0s linear 0s;
}

.ggh-speed-guide.is-panel-hidden .gsh-panel {
  flex-basis: 0;
  width: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(22px, 10px, 0) scale(.74);
  transition:
    opacity .2s ease,
    transform .25s ease,
    width .3s ease,
    max-width .3s ease,
    flex-basis .3s ease,
    visibility 0s linear .3s;
}

.gsh-bubble {
  position: relative;
  display: block;
  min-height: 101px;
  padding: 14px 39px 13px 16px;
  overflow: hidden;
  color: var(--gsh-navy);
  background:
    radial-gradient(circle at 91% 5%, rgba(255,225,120,.56), transparent 33%),
    linear-gradient(145deg, rgba(255,255,255,.985), rgba(247,250,254,.965));
  border: 1px solid rgba(11,58,99,.15);
  border-radius: 18px 18px 6px 18px;
  box-shadow: 0 15px 36px rgba(7,27,53,.21), inset 0 1px 0 #fff;
  text-decoration: none;
  isolation: isolate;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform .2s ease, box-shadow .2s ease;
}

.gsh-bubble::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.88) 46%, transparent 70%);
  transform: translateX(-130%);
  animation: gsh-scan 6.5s ease-in-out 2.2s infinite;
}

.gsh-bubble::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: 18px;
  width: 18px;
  height: 18px;
  background: #f9fbff;
  border-right: 1px solid rgba(11,58,99,.15);
  border-bottom: 1px solid rgba(11,58,99,.15);
  transform: rotate(-45deg);
}

.gsh-bubble:hover,
.gsh-bubble:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgba(7,27,53,.27), 0 0 0 3px rgba(226,184,66,.2);
  outline: none;
}

.ggh-speed-guide.is-reopened .gsh-bubble {
  animation: gsh-bubble-pop .52s cubic-bezier(.17,.8,.3,1.35) both;
}

.gsh-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  color: #58697b;
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: .085em;
  text-transform: uppercase;
}

.gsh-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #20b868;
  box-shadow: 0 0 0 3px rgba(32,184,104,.14);
  animation: gsh-online 2.2s ease-in-out infinite;
}

.gsh-question {
  display: block;
  color: var(--gsh-navy);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.015em;
}

.gsh-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  color: #176a48;
  font-size: 12.5px;
  font-weight: 820;
}

.gsh-action svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.gsh-close {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 3;
  display: grid;
  width: 29px;
  height: 29px;
  padding: 0;
  place-items: center;
  color: #5d6d7d;
  background: rgba(237,242,247,.93);
  border: 1px solid rgba(7,27,53,.08);
  border-radius: 50%;
  font: 800 18px/1 Arial, sans-serif;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.gsh-close:hover,
.gsh-close:focus-visible {
  color: #fff;
  background: var(--gsh-navy);
  outline: 3px solid rgba(226,184,66,.32);
  transform: rotate(7deg) scale(1.04);
}

.gsh-mascot-button {
  position: relative;
  display: block;
  flex: 0 0 90px;
  width: 90px;
  height: 106px;
  padding: 0;
  pointer-events: auto;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 48%;
  cursor: pointer;
  filter: drop-shadow(0 11px 12px rgba(7,27,53,.22));
  transform-origin: 50% 100%;
  animation: gsh-idle-walk 7.8s ease-in-out 1.1s infinite;
  -webkit-tap-highlight-color: transparent;
}

.gsh-mascot-button:focus-visible {
  outline: 4px solid rgba(226,184,66,.72);
  outline-offset: 3px;
}

.gsh-mascot-shell {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: 50% 82%;
  transition: transform .18s cubic-bezier(.2,.8,.25,1.2), filter .2s ease;
}

.gsh-mascot-button:hover .gsh-mascot-shell,
.gsh-mascot-button.is-curious .gsh-mascot-shell {
  transform:
    perspective(360px)
    translate3d(var(--gsh-look-x), var(--gsh-look-y), 0)
    rotateY(var(--gsh-tilt-y))
    rotateX(var(--gsh-tilt-x))
    scale(1.055);
  filter: saturate(1.12) brightness(1.07);
}

.gsh-orbit {
  position: absolute;
  inset: 13px 1px 1px;
  border: 1.5px solid rgba(36,185,236,.27);
  border-right-color: rgba(226,184,66,.9);
  border-radius: 50%;
  animation: gsh-orbit 3.6s linear infinite;
  transition: filter .2s ease, animation-duration .2s ease;
}

.gsh-mascot-button:hover .gsh-orbit,
.gsh-mascot-button.is-curious .gsh-orbit {
  animation-duration: 1.35s;
  filter: drop-shadow(0 0 7px rgba(36,185,236,.5));
}

.gsh-orbit::before,
.gsh-orbit::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gsh-gold);
  box-shadow: 0 0 10px rgba(226,184,66,.9);
}

.gsh-orbit::before { top: 5px; right: 10px; }
.gsh-orbit::after {
  bottom: 8px;
  left: 5px;
  background: var(--gsh-sky);
  box-shadow: 0 0 10px rgba(36,185,236,.9);
}

.gsh-mascot {
  position: absolute;
  inset: 0;
  display: block;
  width: 90px;
  height: 90px;
  object-fit: contain;
  transform: translateY(10px);
  transform-origin: 50% 74%;
  transition: filter .2s ease;
  animation: gsh-breathe 2.8s ease-in-out infinite;
}

.gsh-mascot-button::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 29px;
  width: 43px;
  height: 22px;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(ellipse at center, rgba(116,227,255,.42), transparent 68%);
  filter: blur(2px);
  transition: opacity .18s ease;
  pointer-events: none;
}

.gsh-mascot-button:hover::after,
.gsh-mascot-button.is-curious::after { opacity: 1; }

.gsh-shadow {
  position: absolute;
  right: 6px;
  bottom: 2px;
  width: 68px;
  height: 10px;
  border-radius: 50%;
  background: rgba(7,27,53,.22);
  filter: blur(5px);
  animation: gsh-shadow 2.1s ease-in-out infinite;
}

.gsh-speed-lines {
  position: absolute;
  right: 67px;
  bottom: 26px;
  width: 48px;
  height: 29px;
  opacity: .68;
  background:
    linear-gradient(90deg, transparent, rgba(226,184,66,.94)) 0 2px / 40px 2px no-repeat,
    linear-gradient(90deg, transparent, rgba(36,185,236,.92)) 6px 13px / 42px 2px no-repeat,
    linear-gradient(90deg, transparent, rgba(7,27,53,.56)) 14px 24px / 31px 2px no-repeat;
  animation: gsh-lines 1.4s ease-in-out infinite;
  pointer-events: none;
}

.gsh-spark {
  position: absolute;
  z-index: 4;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0;
  background: #fff3a5;
  box-shadow: 0 0 9px rgba(255,219,77,.95);
  pointer-events: none;
}
.gsh-spark-one { top: 14px; left: 7px; }
.gsh-spark-two { top: 3px; right: 10px; background: #8fe9ff; box-shadow: 0 0 9px rgba(61,205,242,.95); }
.gsh-spark-three { right: 0; bottom: 28px; width: 5px; height: 5px; }

.gsh-mascot-button.is-reacting .gsh-mascot-shell {
  animation: gsh-friendly-hop .82s cubic-bezier(.2,.8,.3,1.2) both;
}

.gsh-mascot-button.is-reacting .gsh-spark {
  animation: gsh-spark-burst .72s ease-out both;
}
.gsh-mascot-button.is-reacting .gsh-spark-two { animation-delay: .08s; }
.gsh-mascot-button.is-reacting .gsh-spark-three { animation-delay: .14s; }

.ggh-speed-guide.is-jumping .gsh-mascot-button {
  animation: gsh-jump .9s cubic-bezier(.22,.75,.26,1) both;
}

.ggh-speed-guide.is-jumping .gsh-shadow {
  animation: gsh-jump-shadow .9s ease both;
}

.gsh-hint {
  position: absolute;
  right: 4px;
  bottom: 101px;
  z-index: 5;
  padding: 5px 8px;
  color: #fff;
  background: rgba(7,27,53,.93);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(5px) scale(.94);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.ggh-speed-guide.is-panel-hidden .gsh-mascot-button:hover + .gsh-hint,
.ggh-speed-guide.is-panel-hidden .gsh-mascot-button:focus-visible + .gsh-hint {
  opacity: 1;
  transform: none;
}

@keyframes gsh-sprint-in {
  0% { opacity: 0; transform: translate3d(145px,16px,0) scale(.8) rotate(4deg); }
  58% { opacity: 1; transform: translate3d(-10px,-2px,0) scale(1.025) rotate(-1deg); }
  80% { transform: translate3d(4px,0,0) scale(.995); }
  100% { opacity: 1; transform: none; }
}

@keyframes gsh-bubble-pop {
  0% { opacity: .2; transform: translate3d(16px,7px,0) scale(.78); }
  72% { opacity: 1; transform: translate3d(-2px,-1px,0) scale(1.025); }
  100% { opacity: 1; transform: none; }
}

@keyframes gsh-scan {
  0%, 60% { transform: translateX(-135%); }
  79%, 100% { transform: translateX(140%); }
}

@keyframes gsh-online {
  0%,100% { box-shadow: 0 0 0 3px rgba(32,184,104,.14); }
  50% { box-shadow: 0 0 0 6px rgba(32,184,104,0); }
}

@keyframes gsh-orbit { to { transform: rotate(360deg); } }

@keyframes gsh-idle-walk {
  0%,100% { transform: translate3d(0,0,0) rotate(0); }
  18% { transform: translate3d(-6px,-2px,0) rotate(-1.2deg); }
  36% { transform: translate3d(-10px,0,0) rotate(.4deg); }
  58% { transform: translate3d(-4px,-3px,0) rotate(1.1deg); }
  78% { transform: translate3d(2px,0,0) rotate(0); }
}

@keyframes gsh-breathe {
  0%,100% { transform: translateY(10px) scale(1); }
  50% { transform: translateY(8px) scale(1.018); }
}

@keyframes gsh-shadow {
  0%,100% { transform: scaleX(1); opacity: .72; }
  50% { transform: scaleX(.86); opacity: .5; }
}

@keyframes gsh-lines {
  0%,100% { transform: translateX(6px) scaleX(.88); opacity: .32; }
  50% { transform: translateX(-4px) scaleX(1.08); opacity: .8; }
}

@keyframes gsh-friendly-hop {
  0%,100% { transform: translate3d(var(--gsh-look-x),var(--gsh-look-y),0) rotate(0) scale(1); }
  30% { transform: translate3d(calc(var(--gsh-look-x) - 3px),calc(var(--gsh-look-y) + 3px),0) rotate(-4deg) scale(.98,1.03); }
  57% { transform: translate3d(calc(var(--gsh-look-x) + 2px),calc(var(--gsh-look-y) - 9px),0) rotate(5deg) scale(1.055); }
  78% { transform: translate3d(var(--gsh-look-x),calc(var(--gsh-look-y) - 2px),0) rotate(-2deg) scale(1.02); }
}

@keyframes gsh-spark-burst {
  0% { opacity: 0; transform: scale(.2) translate(0,0); }
  38% { opacity: 1; transform: scale(1.15) translate(-5px,-7px); }
  100% { opacity: 0; transform: scale(.45) translate(-10px,-15px); }
}

@keyframes gsh-jump {
  0%,100% { transform: translate3d(0,0,0) rotate(0); }
  18% { transform: translate3d(-3px,3px,0) scaleY(.93) scaleX(1.04); }
  48% { transform: translate3d(-12px,-38px,0) rotate(-6deg) scale(1.03); }
  72% { transform: translate3d(-3px,-13px,0) rotate(3deg); }
  88% { transform: translate3d(0,2px,0) scaleY(.95) scaleX(1.03); }
}

@keyframes gsh-jump-shadow {
  0%,100% { transform: scaleX(1); opacity: .68; }
  48% { transform: scaleX(.5); opacity: .24; }
}

@media (max-width: 680px) {
  .ggh-speed-guide {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    gap: 6px;
    width: min(310px, calc(100vw - 16px));
  }

  .gsh-panel {
    flex-basis: 220px;
    width: 220px;
    max-width: 220px;
  }

  .gsh-bubble {
    min-height: 92px;
    padding: 12px 35px 11px 13px;
    border-radius: 16px 16px 5px 16px;
  }

  .gsh-status { margin-bottom: 4px; font-size: 9.5px; }
  .gsh-question { font-size: 13.5px; }
  .gsh-action { margin-top: 6px; font-size: 11.5px; }
  .gsh-action svg { width: 15px; height: 15px; }

  .gsh-mascot-button {
    flex-basis: 78px;
    width: 78px;
    height: 96px;
  }

  .gsh-mascot { width: 78px; height: 78px; transform: translateY(12px); }
  .gsh-orbit { inset: 16px 0 2px; }
  .gsh-speed-lines { right: 57px; bottom: 23px; width: 39px; transform: scale(.82); transform-origin: right center; }
  .gsh-shadow { right: 5px; width: 58px; height: 9px; }
  .gsh-hint { bottom: 91px; }
}

@media (max-width: 360px) {
  .ggh-speed-guide { width: calc(100vw - 12px); }
  .gsh-panel { flex-basis: 202px; width: 202px; max-width: 202px; }
  .gsh-question { font-size: 12.8px; }
  .gsh-action { font-size: 10.8px; }
}

@media (prefers-reduced-motion: reduce) {
  .ggh-speed-guide,
  .ggh-speed-guide.is-ready,
  .gsh-bubble::before,
  .gsh-status::before,
  .gsh-mascot-button,
  .gsh-mascot,
  .gsh-orbit,
  .gsh-shadow,
  .gsh-speed-lines,
  .gsh-mascot-button.is-reacting .gsh-mascot-shell,
  .gsh-mascot-button.is-reacting .gsh-spark {
    animation: none !important;
    transition-duration: .01ms !important;
  }

  .ggh-speed-guide.is-ready { opacity: 1; transform: none; }
}

@media print {
  .ggh-speed-guide { display: none !important; }
}
