/* ─── Wrapper (height set inline from settings) ───────────────── */
.rr3d-wrapper {
  position: relative;
  background: transparent;
  --rr3d-accent: #e8533a;
  --rr3d-card-bg: #0a0e18;
  --rr3d-text: #ffffff;
  --rr3d-solution: #4caf79;
}

/* ─── Sticky container ────────────────────────────────────────── */
.rr3d-sticky {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

/* ─── Canvas ──────────────────────────────────────────────────── */
.rr3d-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  z-index: 1;
}

/* ─── Central guide lines ─────────────────────────────────────── */
.rr3d-orbit {
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(31vw, 360px);
  aspect-ratio: 1;
  border: 1px dashed rgba(120, 151, 205, 0.34);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}
.rr3d-node {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2f6cff;
  box-shadow: 0 0 12px rgba(47, 108, 255, 0.58);
}
.rr3d-node--top { left: 50%; top: -5px; transform: translateX(-50%); }
.rr3d-node--left { left: 9%; top: 26%; }
.rr3d-node--right { right: 9%; top: 26%; }
.rr3d-node--bottom { left: 50%; bottom: -5px; transform: translateX(-50%); }

.rr3d-connector {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, rgba(47, 108, 255, 0), rgba(47, 108, 255, 0.36), rgba(47, 108, 255, 0));
  transform-origin: center;
  z-index: 2;
  pointer-events: none;
}
.rr3d-connector--tl { left: 23%; top: 22%; width: 18%; transform: rotate(31deg); }
.rr3d-connector--bl { left: 23%; top: 56%; width: 18%; transform: rotate(-29deg); }
.rr3d-connector--tr { right: 23%; top: 22%; width: 18%; transform: rotate(-31deg); }
.rr3d-connector--br { right: 23%; top: 56%; width: 18%; transform: rotate(29deg); }
.rr3d-connector--bc { left: 50%; top: 62%; width: 1px; height: 10%; transform: translateX(-50%); }

/* ─── Comparison cards ────────────────────────────────────────── */
.rr3d-label {
  position: absolute;
  box-sizing: border-box;
  width: min(21vw, 310px);
  min-height: 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(4, 10, 17, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(130, 150, 178, 0.28);
  color: var(--rr3d-text);
  pointer-events: none;
  opacity: 1;
  z-index: 10;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}
.rr3d-card--active {
  border-color: rgba(61, 121, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(61, 121, 255, 0.45), 0 0 18px rgba(47, 108, 255, 0.26), inset 0 0 16px rgba(47, 108, 255, 0.06);
}
.rr3d-card--tl { left: 2.4%; top: 3%; }
.rr3d-card--bl { left: 3%; top: 47%; }
.rr3d-card--tr { right: 2.4%; top: 3%; }
.rr3d-card--br { right: 3%; top: 47%; }
.rr3d-card--bc {
  left: 50%;
  bottom: 1.5%;
  width: min(20vw, 290px);
  padding: 14px 16px;
  transform: translateX(-50%);
}
.rr3d-card--bc.rr3d-card--active { transform: translateX(-50%) translateY(-2px); }
.rr3d-card:not(.rr3d-card--bc).rr3d-card--active { transform: translateY(-2px); }

.rr3d-card-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: radial-gradient(circle at 35% 25%, #244bc1, #143389 72%);
  box-shadow: 0 10px 22px rgba(18, 47, 141, 0.32);
}
.rr3d-card-icon svg {
  width: 35px;
  height: 35px;
  stroke: #ffffff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rr3d-problem-title {
  max-width: 190px;
  margin: 0;
  color: var(--rr3d-text);
  font-size: clamp(17px, 1.2vw, 22px);
  font-weight: 800;
  line-height: 1.08;
  text-transform: uppercase;
}
.rr3d-card-rule {
  display: block;
  width: 36px;
  height: 2px;
  margin: 11px 0 13px;
  background: #2f79ff;
}
.rr3d-compare-group strong {
  display: block;
  margin-bottom: 4px;
  color: #f06a60;
  font-size: 13px;
  font-weight: 800;
}
.rr3d-compare-group p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.34;
}
.rr3d-card-divider {
  display: block;
  width: 68px;
  height: 1px;
  margin: 9px 0;
  background: rgba(255, 255, 255, 0.22);
}
.rr3d-compare-group--reign strong {
  color: #2f79ff;
}
.rr3d-card--bc .rr3d-card-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 9px;
}
.rr3d-card--bc .rr3d-card-icon svg {
  width: 28px;
  height: 28px;
}
.rr3d-card--bc .rr3d-problem-title {
  font-size: clamp(15px, 1vw, 19px);
}
.rr3d-card--bc .rr3d-card-rule {
  margin: 8px 0 10px;
}
.rr3d-card--bc .rr3d-compare-group strong {
  font-size: 12px;
}
.rr3d-card--bc .rr3d-compare-group p {
  font-size: 11px;
  line-height: 1.28;
}
.rr3d-card--bc .rr3d-card-divider {
  margin: 7px 0;
}

/* ─── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .rr3d-orbit,
  .rr3d-connector {
    display: none;
  }
  .rr3d-label {
    width: calc(50vw - 18px);
    min-height: 126px;
    padding: 10px;
    border-radius: 12px;
  }
  .rr3d-card--tl { left: 8px; top: 8px; }
  .rr3d-card--tr { right: 8px; top: 8px; }
  .rr3d-card--bl { left: 8px; top: 154px; }
  .rr3d-card--br { right: 8px; top: 154px; }
  .rr3d-card--bc {
    left: 50%;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: min(320px, calc(100vw - 16px));
    padding: 9px 10px;
  }
  .rr3d-card-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 8px;
  }
  .rr3d-card-icon svg {
    width: 24px;
    height: 24px;
  }
  .rr3d-problem-title {
    max-width: none;
    font-size: 12px;
    line-height: 1.08;
  }
  .rr3d-card-rule {
    width: 28px;
    height: 2px;
    margin: 7px 0;
  }
  .rr3d-compare-group strong {
    margin-bottom: 2px;
    font-size: 11px;
  }
  .rr3d-compare-group p {
    font-size: 10px;
    line-height: 1.25;
  }
  .rr3d-card-divider {
    width: 46px;
    margin: 6px 0;
  }
}

@media (max-width: 420px) {
  .rr3d-label {
    min-height: 116px;
    padding: 8px;
  }
  .rr3d-card--bl,
  .rr3d-card--br {
    top: 136px;
  }
  .rr3d-card-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 6px;
  }
  .rr3d-card-icon svg {
    width: 21px;
    height: 21px;
  }
  .rr3d-problem-title {
    font-size: 11px;
  }
  .rr3d-compare-group strong,
  .rr3d-compare-group p {
    font-size: 9px;
  }
}
