/* Build Your Solar System v3 — additions on top of builder2.css */
.rb3 .rb-progress { grid-template-columns: repeat(5, 1fr); }
.rb3 .rb-progress::before { left: 10%; right: 10%; }
.r3-brands { grid-template-columns: repeat(5, 1fr) !important; gap: 8px !important; }
.r3-brands .rb-brand-art { height: 62px; padding: 8px 6px 6px; gap: 4px; }
.r3-brands .rb-brand-name { font-size: 15px; padding: 0 10px; }
.r3-brands .rb-brand-sub { font-size: 11px; padding: 0 10px; }
.r3-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.r3-count { display: grid; gap: 2px; justify-items: start; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: rgba(255, 255, 255, .03); color: var(--text); text-align: left; transition: all .25s var(--ease); }
.r3-count b { font-size: 15px; }
.r3-count span { font-family: var(--ff-display); font-weight: 700; color: var(--gold); font-size: 17px; }
.r3-count:hover { border-color: var(--gold); transform: translateY(-2px); }
.r3-count.on { border-color: var(--orange); background: rgba(255, 122, 24, .16); box-shadow: 0 0 0 3px rgba(255, 122, 24, .18); }
.r3-stack { display: grid; gap: 10px; }
.r3-sub { margin-top: 4px; }
.r3-note { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.rb-pill.on .r3-note { color: var(--gold); }
.r3-incl { border-style: dashed; }
.r3-incl-ic { width: 64px; height: 64px; flex: none; display: grid; place-items: center; font-size: 28px; border-radius: 12px; background: rgba(255, 181, 46, .12); }
.r3-badge { justify-self: start; font-size: 12px; font-weight: 700; color: #5ef09a; background: rgba(94, 240, 154, .12); border: 1px solid rgba(94, 240, 154, .4); padding: 3px 10px; border-radius: 999px; }
.rb3 .rb-card { min-height: 420px; }
@media (max-width: 1100px) { .r3-brands { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 680px) {
  .r3-counts { grid-template-columns: repeat(2, 1fr); }
  .rb3 .rb-card { min-height: 0; }
}

/* =========================================================
   RS INSTALLATION STORY — AI 3D scene with camera moves
   ========================================================= */
.r3-scene { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #8cc6f0; }
.r3-cam { position: absolute; inset: 0; transform-origin: var(--ox, 50%) var(--oy, 50%); transform: scale(var(--s, 1.06));
  transition: transform 1.4s cubic-bezier(.22, 1, .36, 1), transform-origin 1.4s cubic-bezier(.22, 1, .36, 1); will-change: transform; }
.r3-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rb3:not(.night) .r3-img { animation: r3Breathe 9s ease-in-out infinite alternate; }
@keyframes r3Breathe { to { filter: saturate(1.12) brightness(1.04); } }

/* night */
.r3-night { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.6s ease;
  background: linear-gradient(180deg, #06103a 0%, #141a4d 45%, #2a2350 100%); mix-blend-mode: multiply; }
.rb3.night .r3-night { opacity: .82; }
.r3-stars { position: absolute; left: 0; right: 0; top: 0; height: 22%; opacity: 0; transition: opacity 1.6s ease 0.4s; pointer-events: none;
  background-image: radial-gradient(1.5px 1.5px at 12% 30%, #fff, transparent), radial-gradient(1px 1px at 28% 60%, #fff, transparent), radial-gradient(1.5px 1.5px at 44% 20%, #fff, transparent),
    radial-gradient(1px 1px at 63% 45%, #fff, transparent), radial-gradient(1.5px 1.5px at 78% 18%, #fff, transparent), radial-gradient(1px 1px at 90% 55%, #fff, transparent); }
.rb3.night .r3-stars { opacity: 1; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .5; } }
.r3-win { position: absolute; border-radius: 3px; pointer-events: none; opacity: 0; transition: opacity 1.2s ease 0.6s;
  background: radial-gradient(ellipse at center, rgba(255, 214, 140, .95), rgba(255, 170, 70, .55) 60%, rgba(255, 150, 40, 0) 100%); mix-blend-mode: screen; box-shadow: 0 0 30px 10px rgba(255, 180, 80, .35); }
.rb3.night .r3-win { opacity: 1; }

/* panels: roof glow + sparkles */
.r3-roofglow { position: absolute; left: 15%; top: 18%; width: 66%; height: 16%; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .6s;
  background: radial-gradient(ellipse, rgba(255, 230, 150, .55), rgba(255, 200, 80, 0) 70%); mix-blend-mode: screen; }
.rb3.r3-panels-on .r3-roofglow { opacity: 1; animation: r3Glow 2.2s ease-in-out infinite; }
@keyframes r3Glow { 50% { opacity: .45; } }
.r3-spark, .r3-bolt { position: absolute; width: 2.4%; aspect-ratio: 1; transform: translate(-50%, -50%) scale(0); pointer-events: none;
  background: radial-gradient(circle, #fff 0 18%, rgba(255, 236, 160, .9) 30%, rgba(255, 200, 80, 0) 70%);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
.rb3.r3-panels-on .r3-spark { animation: r3Spark 1.8s ease-in-out infinite; animation-delay: var(--d); }
.rb3.r3-struct-on .r3-bolt { animation: r3Spark 1.1s ease-in-out infinite; animation-delay: var(--d); background: radial-gradient(circle, #fff 0 20%, rgba(140, 220, 255, .95) 34%, rgba(80, 180, 255, 0) 70%); }
@keyframes r3Spark { 0%, 100% { transform: translate(-50%, -50%) scale(0) rotate(0); } 40% { transform: translate(-50%, -50%) scale(1.3) rotate(45deg); } 60% { transform: translate(-50%, -50%) scale(.9) rotate(60deg); } }

/* wiring: glowing energy line from roof to inverter */
.r3-wire { position: absolute; pointer-events: none; opacity: 0; transition: opacity .6s; filter: drop-shadow(0 0 4px #ffd34d); }
.r3-wire.h { left: 46%; top: 32.6%; width: 9.6%; height: .5%; background: repeating-linear-gradient(90deg, #ffd34d 0 8px, transparent 8px 16px); background-size: 32px 100%; animation: r3FlowH .6s linear infinite; }
.r3-wire.v { left: 55.4%; top: 32.6%; width: .5%; height: 20.8%; background: repeating-linear-gradient(180deg, #ffd34d 0 8px, transparent 8px 16px); background-size: 100% 32px; animation: r3FlowV .6s linear infinite; }
.rb3.r3-wire-on .r3-wire { opacity: 1; }
@keyframes r3FlowH { to { background-position: 32px 0; } }
@keyframes r3FlowV { to { background-position: 0 32px; } }

/* inverter on the wall */
.r3-inv { position: absolute; left: 52.8%; top: 53.2%; width: 5.2%; height: 7.6%; border-radius: 4px; background: linear-gradient(160deg, #ffffff, #dfe5ee); border: 1px solid #aeb8c8;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35); display: grid; place-items: center; align-content: center; gap: 6%; opacity: 0; transform: translateY(-30%) scale(.6); transition: opacity .5s, transform .6s cubic-bezier(.3, 1.5, .5, 1); }
.r3-inv.on { opacity: 1; transform: none; }
.r3-inv-brand { font: 800 clamp(3px, .58vw, 6.5px)/1 "Sora", sans-serif; color: #1f2a44; letter-spacing: 0; max-width: 92%; overflow: hidden; white-space: nowrap; }
.r3-led { width: 50%; height: 14%; border-radius: 2px; background: #2b2f36; transition: background .4s .3s, box-shadow .4s .3s; }
.r3-inv.on .r3-led { background: #45f08a; box-shadow: 0 0 6px #45f08a; }
.r3-burst { position: absolute; inset: -60%; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 220, 120, .6) 30%, rgba(255, 200, 80, 0) 65%); }
.r3-inv.pop .r3-burst { animation: r3Burst .8s ease-out; }
@keyframes r3Burst { 0% { opacity: 1; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.4); } }

/* labels on the scene */
.r3-chip { position: absolute; left: 47%; top: 10.5%; transform: translateX(-50%); padding: .6% 1.6%; border-radius: 999px; background: rgba(5, 9, 20, .72); color: #fff;
  font: 700 clamp(7px, 1.1vw, 12px)/1.2 "Poppins", sans-serif; white-space: nowrap; border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(4px); transition: opacity .4s; }
.r3-chip:empty { opacity: 0; }
.r3-meter { position: absolute; left: 4%; bottom: 4%; z-index: 3; display: grid; gap: 2px; padding: 10px 14px; border-radius: 14px; background: rgba(5, 9, 20, .78); border: 1px solid rgba(255, 255, 255, .18);
  color: #fff; font-size: 12px; opacity: 0; transform: translateY(12px); transition: opacity .6s .8s, transform .6s .8s; backdrop-filter: blur(6px); }
.rb3.night .r3-meter { opacity: 1; transform: none; }
.r3-meter b { font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: .18em; color: #45f08a; text-shadow: 0 0 8px rgba(69, 240, 138, .7); }
.r3-meter small { color: #ffd34d; font-weight: 600; }
.rb3 .rb-empty { top: auto; bottom: 5%; }
@media (prefers-reduced-motion: reduce) { .r3-cam { transition: none; } }
/* inverter on the wall takes each brand's colours */
.r3-inv[data-brand="HAVELLS"] { background: linear-gradient(160deg, #ff3b30, #c81e1e); border-color: #9e1414; }
.r3-inv[data-brand="HAVELLS"] .r3-inv-brand { color: #fff; }
.r3-inv[data-brand="POLYCAB"] .r3-inv-brand { color: #3a3f4a; }
.r3-inv[data-brand="POLYCAB"] .r3-led { box-shadow: 0 0 0 1px #e8452b; }
.r3-inv[data-brand="TATA"] .r3-inv-brand { color: #1a4fa0; }
.r3-inv[data-brand="WAAREE"] .r3-inv-brand { color: #1fa33a; }
.rb3 .rb-pimg { object-fit: contain; }
.r3-inv { container-type: inline-size; }
.r3-inv-brand { font-size: 17cqw; max-width: none; overflow: visible; letter-spacing: -.02em; }
/* placement inside the website's calculator section */
.builder3-wrap { margin: 60px 0; padding: 48px 0 8px; border-top: 1px solid var(--line); }
