#fft-rocky-widget,
#fft-rocky-widget * {
  box-sizing: border-box;
}

.fft-rocky-widget {
  --rocky-navy: #071a33;
  --rocky-blue: #102b4e;
  --rocky-gold: #d4b266;
  --rocky-cream: #fffaf0;
  --rocky-white: #ffffff;
  --rocky-green: #22a06b;
  font-family: 'Source Sans 3', 'Noto Sans SC', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.fft-rocky-launcher-wrap {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 99990;
  display: flex;
  align-items: center;
  gap: 10px;
  filter: drop-shadow(0 14px 22px rgba(4, 18, 37, 0.2));
  animation: fft-rocky-arrive 360ms ease-out both;
}

.fft-rocky-prompt {
  max-width: 190px;
  padding: 9px 13px;
  border: 1px solid rgba(10, 34, 64, 0.12);
  border-radius: 14px 14px 4px 14px;
  color: var(--rocky-navy);
  background: var(--rocky-white);
  box-shadow: 0 9px 24px rgba(4, 18, 37, 0.16);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.fft-rocky-launcher {
  position: relative;
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0;
  border: 2px solid var(--rocky-gold);
  border-radius: 50%;
  color: var(--rocky-navy);
  background: linear-gradient(145deg, var(--rocky-cream), #eef3f9);
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.92),
    0 13px 30px rgba(4, 18, 37, 0.3);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.fft-rocky-launcher:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 1),
    0 17px 34px rgba(4, 18, 37, 0.34);
}

.fft-rocky-launcher:focus-visible,
.fft-rocky-loading-close:focus-visible {
  outline: 4px solid rgba(212, 178, 102, 0.55);
  outline-offset: 4px;
}

.fft-rocky-launcher img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transform: scale(1.18) translateY(3px);
  transform-origin: 50% 72%;
  animation: fft-rocky-launcher-idle 5.8s ease-in-out 800ms infinite;
}

.fft-rocky-online-dot {
  position: absolute;
  right: 4px;
  bottom: 7px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--rocky-white);
  border-radius: 50%;
  background: var(--rocky-green);
}

.fft-rocky-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(460px, 100vw);
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-left: 1px solid rgba(10, 34, 64, 0.12);
  border-radius: 18px 0 0 18px;
  color: var(--rocky-navy);
  background: var(--rocky-white);
  box-shadow: -24px 0 70px rgba(4, 18, 37, 0.24);
}

.fft-rocky-dialog::backdrop {
  background: rgba(4, 18, 37, 0.52);
  backdrop-filter: blur(2px);
}

.fft-rocky-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  opacity: 0;
  background: var(--rocky-white);
  transition: opacity 140ms ease;
}

.fft-rocky-frame.is-ready {
  opacity: 1;
}

.fft-rocky-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 28px;
  color: #536076;
  background:
    radial-gradient(circle at 50% 36%, rgba(212, 178, 102, 0.16), transparent 15rem),
    #f8fafc;
  text-align: center;
}

.fft-rocky-loading[hidden] {
  display: none;
}

.fft-rocky-loading img {
  width: 132px;
  height: 132px;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(4, 18, 37, 0.16));
  animation: fft-rocky-loading-float 1.8s ease-in-out infinite;
}

.fft-rocky-loading p {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.fft-rocky-loading-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #e1e6ee;
  border-radius: 11px;
  color: #536076;
  background: var(--rocky-white);
  font: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.fft-rocky-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.fft-rocky-scroll-lock {
  overflow: hidden !important;
}

@keyframes fft-rocky-arrive {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fft-rocky-launcher-idle {
  0%, 68%, 100% {
    transform: scale(1.18) translateY(3px) rotate(0deg);
  }
  76% {
    transform: scale(1.2) translateY(-1px) rotate(-1.4deg);
  }
  84% {
    transform: scale(1.2) translateY(-1px) rotate(1.4deg);
  }
  92% {
    transform: scale(1.18) translateY(2px) rotate(0deg);
  }
}

@keyframes fft-rocky-loading-float {
  0%, 100% { transform: translateY(0) rotate(-0.5deg); }
  50% { transform: translateY(-7px) rotate(0.5deg); }
}

@media (max-width: 560px) {
  .fft-rocky-launcher-wrap {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    gap: 7px;
  }

  .fft-rocky-launcher {
    width: 68px;
    height: 68px;
  }

  .fft-rocky-prompt {
    max-width: 142px;
    padding: 8px 10px;
    font-size: 12.5px;
  }

  .fft-rocky-online-dot {
    right: 2px;
    bottom: 5px;
    width: 14px;
    height: 14px;
  }

  .fft-rocky-dialog {
    width: 100vw;
    border-left: 0;
    border-radius: 0;
  }
}

@media (max-width: 350px) {
  .fft-rocky-prompt {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fft-rocky-launcher-wrap {
    animation: none;
  }

  .fft-rocky-launcher,
  .fft-rocky-frame {
    transition: none;
  }

  .fft-rocky-launcher img,
  .fft-rocky-loading img {
    animation: none;
  }
}

@media print {
  .fft-rocky-widget {
    display: none !important;
  }
}
