.bw-fab {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  width: 52px;
  overflow: visible;
}

.bw-fab-entry {
  position: fixed;
  z-index: 55;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  min-width: 88px;
  padding: 0 16px 0 10px;
  border-radius: 18px;
  border: 1px solid rgba(27, 77, 62, 0.22);
  background: rgba(255, 255, 255, 0.96);
  color: #1b4d3e;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: grab;
  touch-action: none;
  user-select: none;
  pointer-events: auto;
  transition:
    left 0.22s ease,
    top 0.22s ease,
    right 0.22s ease,
    bottom 0.22s ease,
    border-radius 0.22s ease,
    height 0.22s ease,
    padding 0.22s ease;
}

.bw-fab-entry--top {
  top: 0;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  height: calc(42px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.bw-fab-entry--bottom {
  bottom: 0;
  left: 50%;
  top: auto;
  right: auto;
  transform: translateX(-50%);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(42px + env(safe-area-inset-bottom, 0px));
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.12);
}

.bw-fab-entry--left {
  left: 0;
  top: 50%;
  right: auto;
  bottom: auto;
  transform: translateY(-50%);
  padding-left: max(10px, env(safe-area-inset-left, 0px));
  border-left: 0;
  border-radius: 0 18px 18px 0;
  box-shadow: 8px 0 18px rgba(15, 23, 42, 0.12);
}

.bw-fab-entry--right {
  right: 0;
  top: 50%;
  left: auto;
  bottom: auto;
  transform: translateY(-50%);
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-right: 0;
  border-radius: 18px 0 0 18px;
  box-shadow: -8px 0 18px rgba(15, 23, 42, 0.12);
}

.bw-fab-entry--dragging {
  transition: none;
  cursor: grabbing;
  transform: none;
  z-index: 70;
  border-radius: 18px;
  height: 42px;
  padding: 0 16px 0 10px;
}

.bw-fab-entry__icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1b4d3e;
  color: #fff;
  flex-shrink: 0;
}

.bw-fab-entry__icon .bw-fab__palm {
  width: 15px;
  height: 15px;
}

.bw-fab-entry__label {
  line-height: 1;
}

.bw-fab-entry--active {
  border-color: rgba(27, 77, 62, 0.4);
}

.bw-fab-entry--nudge:not(.bw-fab-entry--dragging) {
  animation: bw-fab-entry-pulse 1.8s ease-in-out infinite;
}

@keyframes bw-fab-entry-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.05);
  }
}

.bw-fab--from-entry .bw-fab__panel {
  position: fixed;
  right: auto;
  bottom: auto;
}

.bw-fab--from-entry.bw-fab--entry-top .bw-fab__panel {
  top: calc(48px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  transform-origin: top center;
}

.bw-fab--from-entry.bw-fab--entry-bottom .bw-fab__panel {
  top: auto;
  bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  transform-origin: bottom center;
}

.bw-fab--from-entry.bw-fab--entry-left .bw-fab__panel {
  top: 50%;
  left: max(12px, calc(env(safe-area-inset-left, 0px) + 112px));
  transform: translateY(-50%);
  transform-origin: center left;
}

.bw-fab--from-entry.bw-fab--entry-right .bw-fab__panel {
  top: 50%;
  left: auto;
  right: max(12px, calc(env(safe-area-inset-right, 0px) + 112px));
  transform: translateY(-50%);
  transform-origin: center right;
}

.bw-fab--left {
  align-items: flex-start;
}

.bw-fab--below {
  flex-direction: column-reverse;
}

.bw-fab__scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(27, 77, 62, 0.28);
  pointer-events: auto;
  cursor: pointer;
}

.bw-fab__bubble {
  pointer-events: auto;
  position: relative;
  z-index: 4;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid #1b4d3e;
  background: #fff;
  color: #1b4d3e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow: 0 4px 18px rgba(27, 77, 62, 0.28);
  transition: transform 0.18s ease, background 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
}

.bw-fab__bubble::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(27, 77, 62, 0.28);
  opacity: 0;
  pointer-events: none;
}

.bw-fab--nudge .bw-fab__bubble {
  animation: bw-fab-shake 1.4s ease-in-out infinite;
}

.bw-fab--nudge .bw-fab__bubble::after {
  animation: bw-fab-ring 2s ease-out infinite;
}

.bw-fab__bubble:hover {
  transform: scale(1.04);
}

.bw-fab--nudge .bw-fab__bubble:hover {
  animation: none;
}

.bw-fab__bubble:active {
  cursor: grabbing;
}

@keyframes bw-fab-shake {
  0%,
  100% {
    transform: translateX(0) rotate(0);
  }
  15% {
    transform: translateX(-3px) rotate(-5deg);
  }
  30% {
    transform: translateX(3px) rotate(5deg);
  }
  45% {
    transform: translateX(-2px) rotate(-3deg);
  }
  60% {
    transform: translateX(2px) rotate(3deg);
  }
  75% {
    transform: translateX(0) rotate(0);
  }
}

@keyframes bw-fab-ring {
  0% {
    opacity: 0.7;
    transform: scale(0.92);
  }
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

.bw-fab__tip {
  pointer-events: auto;
  position: absolute;
  z-index: 3;
  width: max-content;
  max-width: min(220px, calc(100vw - 28px));
  padding: 10px 12px;
  border-radius: 14px;
  background: #1b4d3e;
  color: #fff;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 500;
  border: 1px solid #163f33;
  box-shadow: 0 8px 24px rgba(27, 77, 62, 0.28);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.bw-fab__tip[hidden] {
  display: none !important;
}

.bw-fab--above .bw-fab__tip {
  bottom: calc(52px + 12px);
}

.bw-fab--below .bw-fab__tip {
  top: calc(52px + 12px);
}

.bw-fab--right .bw-fab__tip {
  right: 0;
}

.bw-fab--left .bw-fab__tip {
  left: 0;
}

.bw-fab__tip::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: #1b4d3e;
  transform: rotate(45deg);
}

.bw-fab--above.bw-fab--right .bw-fab__tip::after,
.bw-fab--above.bw-fab--left .bw-fab__tip::after {
  bottom: -4px;
}

.bw-fab--below.bw-fab--right .bw-fab__tip::after,
.bw-fab--below.bw-fab--left .bw-fab__tip::after {
  top: -4px;
}

.bw-fab--right .bw-fab__tip::after {
  right: 20px;
}

.bw-fab--left .bw-fab__tip::after {
  left: 20px;
}

.bw-fab__tip-text {
  flex: 1;
  min-width: 0;
}

.bw-fab__tip-x {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

@media (prefers-reduced-motion: reduce) {
  .bw-fab--nudge .bw-fab__bubble,
  .bw-fab--nudge .bw-fab__bubble::after {
    animation: none;
  }
}

.bw-fab--open .bw-fab__bubble {
  background: #fff;
  color: #0f172a;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
}

.bw-fab__bubble-x {
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 500;
}

.bw-fab__palm {
  width: 18px;
  height: 18px;
  display: block;
}

.bw-fab__panel {
  pointer-events: auto;
  position: absolute;
  z-index: 3;
  width: min(280px, calc(100vw - 28px));
  max-height: min(70vh, 440px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
  border-radius: 22px;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 32px -12px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: bw-fab-pop 0.18s ease-out;
  font-family: Inter, system-ui, sans-serif;
  -webkit-overflow-scrolling: touch;
}

.bw-fab--above .bw-fab__panel {
  bottom: calc(52px + 10px);
}

.bw-fab--below .bw-fab__panel {
  top: calc(52px + 10px);
}

.bw-fab--right .bw-fab__panel {
  right: 0;
}

.bw-fab--left .bw-fab__panel {
  left: 0;
}

.bw-fab__panel[hidden] {
  display: none !important;
}

@keyframes bw-fab-pop {
  from {
    opacity: 0;
    transform: scale(0.86) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.bw-fab__title {
  margin: 2px 4px 0;
  font-size: 0.8125rem;
  font-weight: 700;
}

.bw-fab__hint {
  margin: 0 4px 4px;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: #64748b;
}

.bw-fab__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.bw-fab__opt:hover:not(:disabled):not(.bw-fab__opt--current) {
  border-color: #1b4d3e55;
  background: #1b4d3e0a;
}

.bw-fab__opt--current {
  cursor: default;
  background: #1b4d3e0f;
  border-color: #1b4d3e44;
}

.bw-fab__opt-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #1b4d3e;
  font-size: 0.75rem;
  font-weight: 700;
  overflow: hidden;
  padding: 4px;
}

.bw-fab__opt-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bw-fab__opt-icon--apuesta {
  color: #b45309;
}

.bw-fab__opt-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.bw-fab__opt-text strong {
  font-size: 0.8125rem;
  font-weight: 600;
}

.bw-fab__opt-text em {
  font-style: normal;
  font-size: 0.6875rem;
  color: #64748b;
  line-height: 1.25;
}

@media (prefers-reduced-motion: reduce) {
  .bw-fab__panel {
    animation: none;
  }
  .bw-fab__bubble {
    transition: none;
  }
}
