/* ===========================================
   GIZMO SCENES — Background Theme Presets
   Pure CSS scene backdrops for GIZMO stage.
   Switch with: body.setAttribute('data-scene', 'jungle')
   =========================================== */

/* ========== SCENE TRANSITION ========== */
body {
  transition: background 1s ease;
}
body::before {
  transition: background 1s ease, opacity 1s ease;
}
.stage {
  transition: background 1s ease, box-shadow 1s ease;
}
.stage-gradient {
  transition: background 1s ease, opacity 1s ease;
}

/* ========== SCENE: AURORA (DEFAULT) ========== */
/* Default is already in gizmo.html — no override needed */

/* ========== SCENE: JUNGLE CANOPY ========== */
body[data-scene="jungle"] {
  background: radial-gradient(circle at 40% 50%, #0d2b1a, #061208 70%);
}
body[data-scene="jungle"]::before {
  background:
    radial-gradient(circle at 75% 15%, rgba(120, 200, 80, 0.3), transparent 45%),
    radial-gradient(circle at 20% 75%, rgba(60, 180, 120, 0.2), transparent 35%),
    radial-gradient(circle at 50% 30%, rgba(255, 220, 100, 0.15), transparent 40%);
  opacity: 0.8;
}
body[data-scene="jungle"] .stage {
  background: linear-gradient(160deg, rgba(10, 40, 20, 0.9), rgba(5, 15, 8, 0.95));
  box-shadow: inset 0 0 60px rgba(40, 120, 60, 0.15), 0 30px 80px rgba(0, 0, 0, 0.8);
}
body[data-scene="jungle"] .stage-gradient {
  background:
    radial-gradient(circle at 45% 10%, rgba(255, 240, 140, 0.5), transparent 45%),
    radial-gradient(circle at 70% 80%, rgba(50, 160, 90, 0.35), transparent 50%);
}
body[data-scene="jungle"] .perch {
  background: linear-gradient(90deg, #3a2510 0%, #5c3a1e 30%, #4a2f15 60%, #3a2510 100%);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.1);
}
body[data-scene="jungle"] .perch-moss {
  background: radial-gradient(ellipse, #3a7a3a, #2d5c2d);
  opacity: 0.7;
}
/* Dappled light overlay */
body[data-scene="jungle"] .stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 200, 0.08) 0%, transparent 15%),
    radial-gradient(circle at 60% 15%, rgba(255, 255, 200, 0.06) 0%, transparent 12%),
    radial-gradient(circle at 80% 35%, rgba(255, 255, 200, 0.05) 0%, transparent 10%),
    radial-gradient(circle at 40% 45%, rgba(255, 255, 200, 0.04) 0%, transparent 18%);
  pointer-events: none;
  z-index: 1;
  animation: dappledLight 12s ease-in-out infinite alternate;
}
@keyframes dappledLight {
  0% { opacity: 0.6; transform: translate(0, 0); }
  100% { opacity: 1; transform: translate(5px, -3px); }
}

/* ========== SCENE: LIVING ROOM ========== */
body[data-scene="livingroom"] {
  background: radial-gradient(circle at 35% 40%, #3a2e24, #1a1510 70%);
}
body[data-scene="livingroom"]::before {
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 220, 150, 0.4), transparent 50%),
    radial-gradient(circle at 15% 70%, rgba(200, 160, 100, 0.15), transparent 35%);
  opacity: 0.7;
}
body[data-scene="livingroom"] .stage {
  background: linear-gradient(160deg, rgba(45, 35, 25, 0.9), rgba(20, 15, 10, 0.95));
  box-shadow: inset 0 0 50px rgba(200, 150, 80, 0.1), 0 30px 80px rgba(0, 0, 0, 0.7);
}
body[data-scene="livingroom"] .stage-gradient {
  background:
    radial-gradient(circle at 65% 20%, rgba(255, 230, 170, 0.6), transparent 50%),
    radial-gradient(circle at 30% 70%, rgba(180, 140, 80, 0.2), transparent 45%);
}
/* Window light rectangles */
body[data-scene="livingroom"] .stage::after {
  content: '';
  position: absolute;
  top: 5%;
  right: 10%;
  width: 35%;
  height: 65%;
  background: linear-gradient(180deg,
    rgba(255, 240, 200, 0.08) 0%,
    rgba(255, 240, 200, 0.04) 50%,
    transparent 100%);
  transform: perspective(300px) rotateY(-5deg);
  pointer-events: none;
  z-index: 1;
  border-radius: 4px;
}
body[data-scene="livingroom"] .perch {
  background: linear-gradient(90deg, #654321 0%, #8b6914 30%, #7a5a2f 60%, #654321 100%);
  border-radius: 8px;
}

/* ========== SCENE: SUNSET BRANCH ========== */
body[data-scene="sunset"] {
  background: linear-gradient(180deg, #1a0a2e 0%, #4a1942 25%, #c2185b 50%, #ff6f00 75%, #ffab40 100%);
}
body[data-scene="sunset"]::before {
  background:
    radial-gradient(circle at 50% 55%, rgba(255, 200, 50, 0.4), transparent 50%),
    radial-gradient(circle at 30% 40%, rgba(255, 100, 150, 0.25), transparent 45%);
  opacity: 0.6;
}
body[data-scene="sunset"] .stage {
  background: linear-gradient(180deg, rgba(30, 10, 50, 0.7) 0%, rgba(100, 30, 50, 0.5) 50%, rgba(200, 100, 30, 0.4) 100%);
  box-shadow: inset 0 0 60px rgba(255, 150, 50, 0.15);
}
body[data-scene="sunset"] .stage-gradient {
  background:
    radial-gradient(circle at 50% 60%, rgba(255, 200, 80, 0.5), transparent 55%),
    radial-gradient(circle at 40% 30%, rgba(255, 100, 100, 0.3), transparent 40%);
}
/* Lens flare */
body[data-scene="sunset"] .beam.left {
  background: radial-gradient(circle at 50% 50%, rgba(255, 200, 100, 0.4), transparent 60%);
}
body[data-scene="sunset"] .perch {
  background: linear-gradient(90deg, #1a1a1a, #2d2d2d, #1a1a1a);
  box-shadow: 0 2px 20px rgba(255, 150, 50, 0.3);
}

/* ========== SCENE: NIGHT SKY ========== */
body[data-scene="night"] {
  background: radial-gradient(circle at 50% 30%, #0a1628, #040810 70%);
}
body[data-scene="night"]::before {
  background:
    radial-gradient(circle at 80% 15%, rgba(200, 220, 255, 0.15), transparent 30%),
    radial-gradient(circle at 20% 25%, rgba(100, 150, 255, 0.08), transparent 25%);
  opacity: 0.8;
}
body[data-scene="night"] .stage {
  background: linear-gradient(160deg, rgba(8, 15, 30, 0.95), rgba(4, 8, 16, 0.98));
  box-shadow: inset 0 0 40px rgba(60, 100, 200, 0.08);
}
body[data-scene="night"] .stage-gradient {
  background:
    radial-gradient(circle at 75% 10%, rgba(200, 220, 255, 0.3), transparent 40%),
    radial-gradient(circle at 25% 20%, rgba(100, 130, 200, 0.15), transparent 35%);
}
/* Stars */
body[data-scene="night"] .stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 12%, rgba(255,255,255,0.9) 1px, transparent 1px),
    radial-gradient(circle at 35% 8%, rgba(255,255,255,0.7) 1px, transparent 1px),
    radial-gradient(circle at 55% 18%, rgba(255,255,255,0.6) 1px, transparent 1px),
    radial-gradient(circle at 72% 6%, rgba(255,255,255,0.8) 1px, transparent 1px),
    radial-gradient(circle at 88% 22%, rgba(255,255,255,0.5) 1px, transparent 1px),
    radial-gradient(circle at 25% 25%, rgba(255,255,255,0.4) 1px, transparent 1px),
    radial-gradient(circle at 48% 5%, rgba(255,255,255,0.7) 1px, transparent 1px),
    radial-gradient(circle at 65% 28%, rgba(255,255,255,0.5) 1px, transparent 1px),
    radial-gradient(circle at 82% 14%, rgba(255,255,255,0.6) 1px, transparent 1px),
    radial-gradient(circle at 10% 20%, rgba(255,255,255,0.4) 1px, transparent 1px),
    radial-gradient(circle at 42% 15%, rgba(200,220,255,0.6) 1px, transparent 1px),
    radial-gradient(circle at 92% 8%, rgba(200,220,255,0.5) 1px, transparent 1px);
  pointer-events: none;
  z-index: 1;
  animation: starTwinkle 4s ease-in-out infinite alternate;
}
@keyframes starTwinkle {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}
/* Moon glow */
body[data-scene="night"] .beam.right {
  background: radial-gradient(circle at 50% 30%, rgba(200, 220, 255, 0.2), transparent 50%);
}

/* ========== SCENE: RAINY DAY ========== */
body[data-scene="rainy"] {
  background: radial-gradient(circle at 40% 40%, #2a3040, #151a24 70%);
}
body[data-scene="rainy"]::before {
  background:
    radial-gradient(circle at 60% 30%, rgba(150, 180, 220, 0.2), transparent 50%),
    radial-gradient(circle at 30% 60%, rgba(120, 150, 200, 0.15), transparent 40%);
  opacity: 0.6;
}
body[data-scene="rainy"] .stage {
  background: linear-gradient(160deg, rgba(30, 38, 50, 0.92), rgba(15, 20, 30, 0.96));
  box-shadow: inset 0 0 50px rgba(100, 140, 200, 0.08);
}
body[data-scene="rainy"] .stage-gradient {
  background:
    radial-gradient(circle at 50% 20%, rgba(160, 190, 230, 0.25), transparent 50%),
    radial-gradient(circle at 35% 70%, rgba(100, 130, 180, 0.15), transparent 40%);
}
/* Rain streaks */
body[data-scene="rainy"] .stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(95deg,
      transparent 0px,
      transparent 40px,
      rgba(180, 200, 230, 0.04) 40px,
      rgba(180, 200, 230, 0.04) 41px
    ),
    repeating-linear-gradient(97deg,
      transparent 0px,
      transparent 60px,
      rgba(180, 200, 230, 0.03) 60px,
      rgba(180, 200, 230, 0.03) 61px
    );
  pointer-events: none;
  z-index: 1;
  animation: rainFall 0.8s linear infinite;
}
@keyframes rainFall {
  0% { transform: translateY(-20px); }
  100% { transform: translateY(20px); }
}
/* Fog overlay */
body[data-scene="rainy"] .parallax.layer-front {
  background: linear-gradient(180deg, rgba(150, 170, 200, 0.1) 0%, transparent 50%, rgba(150, 170, 200, 0.05) 100%);
  opacity: 0.5;
  animation: fogDrift 15s ease-in-out infinite alternate;
}
@keyframes fogDrift {
  0% { transform: translateX(-10px); }
  100% { transform: translateX(10px); }
}

/* ========== SCENE: PLAYGROUND ========== */
body[data-scene="playground"] {
  background: radial-gradient(circle at 50% 60%, #1a3050, #0a1525 70%);
}
body[data-scene="playground"]::before {
  background:
    radial-gradient(circle at 70% 25%, rgba(255, 100, 100, 0.2), transparent 40%),
    radial-gradient(circle at 20% 65%, rgba(100, 200, 255, 0.2), transparent 40%),
    radial-gradient(circle at 50% 45%, rgba(255, 220, 100, 0.15), transparent 35%);
  opacity: 0.8;
}
body[data-scene="playground"] .stage {
  background: linear-gradient(160deg, rgba(20, 40, 65, 0.85), rgba(10, 20, 35, 0.92));
  box-shadow: inset 0 0 50px rgba(100, 180, 255, 0.1);
}
body[data-scene="playground"] .stage-gradient {
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 180, 100, 0.4), transparent 45%),
    radial-gradient(circle at 70% 60%, rgba(100, 200, 255, 0.3), transparent 40%);
}
body[data-scene="playground"] .perch {
  background: linear-gradient(90deg, #d4a04a, #e8b84a, #d4a04a);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(200, 150, 50, 0.3);
}

/* ========== SCENE: BEACH ========== */
body[data-scene="beach"] {
  background: linear-gradient(180deg, #0a2e4a 0%, #1a5a7a 40%, #c8a882 70%, #e8d4b0 100%);
}
body[data-scene="beach"]::before {
  background:
    radial-gradient(circle at 60% 15%, rgba(255, 240, 200, 0.3), transparent 45%),
    radial-gradient(circle at 30% 50%, rgba(80, 180, 220, 0.2), transparent 40%);
  opacity: 0.7;
}
body[data-scene="beach"] .stage {
  background: linear-gradient(180deg, rgba(10, 35, 55, 0.8) 0%, rgba(20, 60, 80, 0.6) 50%, rgba(120, 100, 70, 0.5) 100%);
  box-shadow: inset 0 0 40px rgba(80, 180, 220, 0.1);
}
body[data-scene="beach"] .stage-gradient {
  background:
    radial-gradient(circle at 55% 25%, rgba(255, 240, 180, 0.5), transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(80, 180, 220, 0.3), transparent 45%);
}
/* Wave animation */
body[data-scene="beach"] .stage::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -10%;
  width: 120%;
  height: 15%;
  background: linear-gradient(180deg, transparent, rgba(80, 180, 220, 0.1) 50%, rgba(80, 180, 220, 0.15));
  border-radius: 50% 50% 0 0;
  pointer-events: none;
  z-index: 1;
  animation: waveSurge 4s ease-in-out infinite;
}
@keyframes waveSurge {
  0%, 100% { transform: translateY(5px) scaleY(0.8); }
  50% { transform: translateY(-3px) scaleY(1.1); }
}
body[data-scene="beach"] .perch {
  background: linear-gradient(90deg, #a08060, #c0a080, #a08060);
  border-radius: 6px;
}

/* ========== SCENE PICKER UI ========== */
.scene-picker,
.scene-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  padding: 8px 0;
}

.scene-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
}

.scene-thumb:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.scene-thumb.active {
  border-color: rgba(100, 200, 255, 0.7);
  box-shadow: 0 0 12px rgba(100, 200, 255, 0.3);
}

.scene-thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
}

/* Thumbnail preview colors */
.scene-thumb[data-scene="aurora"] {
  background: linear-gradient(135deg, #1a2540, #0a0e18);
}
.scene-thumb[data-scene="jungle"] {
  background: linear-gradient(135deg, #0d2b1a, #2a5a30);
}
.scene-thumb[data-scene="livingroom"] {
  background: linear-gradient(135deg, #3a2e24, #8b6914);
}
.scene-thumb[data-scene="sunset"] {
  background: linear-gradient(135deg, #4a1942, #ff6f00);
}
.scene-thumb[data-scene="night"] {
  background: linear-gradient(135deg, #0a1628, #1a2a4a);
}
.scene-thumb[data-scene="rainy"] {
  background: linear-gradient(135deg, #2a3040, #4a5a70);
}
.scene-thumb[data-scene="playground"] {
  background: linear-gradient(135deg, #1a3050, #3a5a80);
}
.scene-thumb[data-scene="beach"] {
  background: linear-gradient(135deg, #1a5a7a, #c8a882);
}
