/* ========================================
   ALIANZAS — Partners / Mundos orbitando
   ======================================== */

.bb-alliances { position: relative; }
.bb-alliances::before {
  content: ''; position: absolute; top: -12%; left: 20%; width: 500px; height: 400px;
  background: radial-gradient(ellipse, rgba(181,101,29,0.06) 0%, transparent 60%);
  border-radius: 999px; filter: blur(80px); pointer-events: none;
}
.bb-alliances::after {
  content: ''; position: absolute; bottom: 5%; right: -5%; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(208,138,71,0.05) 0%, transparent 60%);
  border-radius: 999px; filter: blur(80px); pointer-events: none;
}

/* ---------- GRID ---------- */
.bb-alliances__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 56px 40px;
  max-width: 1000px;
  margin: 0 auto;
}

/* ---------- EACH WORLD ---------- */
.bb-world {
  text-align: center;
  position: relative;
}

/* --- Orbit container (holds rings + dots) --- */
.bb-world__orbit {
  position: relative;
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1;
  margin: 0 auto 24px;
  overflow: visible;
}

/* --- Logo circle (fills most of the orbit, like team photos) --- */
.bb-world__logo {
  position: absolute;
  top: 50%; left: 50%;
  width: 83%;
  height: 83%;
  transform: translate(-50%, -50%) scale(1);
  border-radius: 50%;
  background: #111;
  border: 1px solid rgba(181,101,29,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 2;
  transition: transform 500ms var(--bb-ease), border-color 500ms var(--bb-ease), box-shadow 500ms var(--bb-ease);
}
.bb-world__logo img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  filter: grayscale(0.3) brightness(0.85);
  transition: filter 500ms var(--bb-ease);
}
.bb-world:nth-child(2) .bb-world__logo img,
.bb-world:nth-child(3) .bb-world__logo img,
.bb-world:nth-child(4) .bb-world__logo img,
.bb-world:nth-child(5) .bb-world__logo img,
.bb-world:nth-child(8) .bb-world__logo img,
.bb-world:nth-child(9) .bb-world__logo img,
.bb-world:nth-child(10) .bb-world__logo img {
  width: 104%;
  height: 104%;
}
.bb-world:nth-child(6) .bb-world__logo img {
  width: 65%;
  height: 65%;
}
.bb-world:hover .bb-world__logo {
  transform: translate(-50%, -50%) scale(1.05);
  border-color: rgba(181,101,29,0.5);
  box-shadow: 0 0 30px rgba(181,101,29,0.15), 0 0 60px rgba(181,101,29,0.06);
}
.bb-world:hover .bb-world__logo img {
  filter: grayscale(0) brightness(1);
}

/* --- Ring inner (dashed, clockwise) — hugs logo like equipo --- */
.bb-world__ring-inner {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  border: 1px dashed rgba(181,101,29,0.25);
  animation: bb-orbit 36s linear infinite;
  pointer-events: none;
}
.bb-world__ring-inner::after {
  content: '';
  position: absolute;
  top: -3px; left: 50%;
  width: 6px; height: 6px;
  margin-left: -3px;
  background: var(--bb-copper);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(181,101,29,0.5);
}

/* --- Ring outer (solid, counter-clockwise) — outermost like equipo --- */
.bb-world__ring-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(181,101,29,0.15);
  animation: bb-orbit-reverse 54s linear infinite;
  pointer-events: none;
}
.bb-world__ring-outer::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 50%;
  width: 5px; height: 5px;
  margin-left: -2.5px;
  background: var(--bb-copper);
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(181,101,29,0.4);
}

/* Stagger animation start per item */
.bb-world:nth-child(2) .bb-world__ring-inner  { animation-delay: -4s; }
.bb-world:nth-child(2) .bb-world__ring-outer  { animation-delay: -8s; }
.bb-world:nth-child(3) .bb-world__ring-inner  { animation-delay: -9s; }
.bb-world:nth-child(3) .bb-world__ring-outer  { animation-delay: -17s; }
.bb-world:nth-child(4) .bb-world__ring-inner  { animation-delay: -14s; }
.bb-world:nth-child(4) .bb-world__ring-outer  { animation-delay: -26s; }
.bb-world:nth-child(5) .bb-world__ring-inner  { animation-delay: -20s; }
.bb-world:nth-child(5) .bb-world__ring-outer  { animation-delay: -35s; }
.bb-world:nth-child(6) .bb-world__ring-inner  { animation-delay: -25s; }
.bb-world:nth-child(6) .bb-world__ring-outer  { animation-delay: -12s; }
.bb-world:nth-child(7) .bb-world__ring-inner  { animation-delay: -31s; }
.bb-world:nth-child(7) .bb-world__ring-outer  { animation-delay: -42s; }
.bb-world:nth-child(8) .bb-world__ring-inner  { animation-delay: -7s; }
.bb-world:nth-child(8) .bb-world__ring-outer  { animation-delay: -20s; }
.bb-world:nth-child(9) .bb-world__ring-inner  { animation-delay: -16s; }
.bb-world:nth-child(9) .bb-world__ring-outer  { animation-delay: -48s; }
.bb-world:nth-child(10) .bb-world__ring-inner { animation-delay: -2s; }
.bb-world:nth-child(10) .bb-world__ring-outer { animation-delay: -30s; }
.bb-world:nth-child(11) .bb-world__ring-inner { animation-delay: -28s; }
.bb-world:nth-child(11) .bb-world__ring-outer { animation-delay: -6s; }
.bb-world:nth-child(12) .bb-world__ring-inner { animation-delay: -12s; }
.bb-world:nth-child(12) .bb-world__ring-outer { animation-delay: -38s; }

/* Hover: accelerate orbits */
.bb-world:hover .bb-world__ring-inner {
  animation-duration: 8s;
}
.bb-world:hover .bb-world__ring-outer {
  animation-duration: 12s;
}

/* --- Name & category (matches equipo typography) --- */
.bb-world__name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  color: var(--bb-fg-1);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  transition: color 400ms var(--bb-ease);
}
.bb-world__cat {
  font-family: 'Inter Tight', sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--bb-copper);
  transition: color 400ms var(--bb-ease);
}
.bb-world:hover .bb-world__name { color: var(--bb-copper-lo); }
.bb-world:hover .bb-world__cat  { color: var(--bb-copper-lo); }

/* ---------- KEYFRAMES ---------- */
@keyframes bb-orbit {
  to { transform: rotate(360deg); }
}
@keyframes bb-orbit-reverse {
  to { transform: rotate(-360deg); }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .bb-alliances__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 48px 32px;
  }
  .bb-world__orbit { max-width: 200px; }
  .bb-world__name { font-size: 15px; }
}

@media (max-width: 640px) {
  .bb-alliances__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px 20px;
  }
  .bb-world__orbit { max-width: 160px; }
  .bb-world__name { font-size: 14px; }
  .bb-world__ring-inner { animation-duration: 50s; }
  .bb-world__ring-outer { animation-duration: 72s; }
  .bb-world__ring-inner::after { width: 5px; height: 5px; margin-left: -2.5px; top: -2.5px; }
  .bb-world__ring-outer::after { width: 4px; height: 4px; margin-left: -2px; bottom: -2px; }
  .bb-alliances::before, .bb-alliances::after { display: none; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .bb-world__ring-inner,
  .bb-world__ring-outer {
    animation: none;
  }
  .bb-world__logo img { transition: none; }
  .bb-world__logo { transition: none; }
  .bb-world__name, .bb-world__cat { transition: none; }
}
