:root {
  --card-bg: var(--surface);
  --card-border: var(--border);
  --card-shadow: var(--shadow);
}

.picker-panel {
  max-width: 980px;
  margin: 0 auto;
}

.calc-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-header h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.card-header p {
  margin: 0;
  color: var(--muted);
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 700;
  color: var(--muted);
}

.controls {
  display: grid;
  gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.field-label {
  font-weight: 600;
  color: var(--muted);
}

.field input {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
}

.input-wrapper {
  position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.input-wrapper input {
  width: 140px;
  padding-right: 65px; /* suffix 공간 확보 */
  text-align: center;
}

.input-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
}

.field-hint {
  color: var(--muted);
  font-size: 0.85rem;
  display: none;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.draw-display {
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 28px 18px;
  background: radial-gradient(circle at top, rgba(106, 167, 255, 0.18), rgba(15, 23, 42, 0.2));
  text-align: center;
  display: grid;
  gap: 8px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.draw-number {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 1px;
  width: clamp(120px, 20vw, 160px);
  height: clamp(120px, 20vw, 160px);
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 30%, #ffffff 0%, #f8fafc 25%, #e2e8f0 52%, #94a3b8 100%);
  box-shadow:
    inset -12px -12px 24px rgba(15, 23, 42, 0.18),
    inset 12px 12px 20px rgba(255, 255, 255, 0.7),
    0 18px 36px rgba(15, 23, 42, 0.25);
}

.draw-number.is-animate {
  animation: number-fly 520ms ease;
}

.draw-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.center-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}



.status-row {
  display: flex;
  justify-content: center;
}

.status-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.status-text.is-error {
  color: #ff6b6b;
}

.result-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.2));
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.result-label {
  font-weight: 700;
  color: var(--text);
}

.result-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 42px;
    justify-content: center;
    align-items: center;
}

/* Increased Specificity to override global button styles */
.history-list button:not(.primary-btn):not(.pill-btn):not(.segmented__btn):not(.category-chip):not(.tool-btn):not(.mode-btn):not(.ghost-btn):not(.search-clear-btn):not(.overlay-action-btn).history-chip {
  /* Green Ball Design (Scaled Down) */
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  
  /* Resetting common button properties that might leak */
  background-image: none;
  background-color: transparent;
  
  /* Radial Gradient for Sphere Effect */
  background: radial-gradient(circle at 35% 35%, #22c55e 0%, #16a34a 100%);
  
  /* Dark Green Border to match the big ball */
  border: 2px solid #14532d;
  
  /* Inner Highlight + Drop Shadow */
  box-shadow: 
    inset 4px 4px 8px rgba(255,255,255,0.4),
    0 4px 8px rgba(0,0,0,0.2);
    
  /* Text Styling */
  font-weight: 800;
  color: #fff;
  text-shadow: 1px 1px 0 #14532d;
  font-size: 1.1rem;
  
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.history-list button:not(.primary-btn):not(.pill-btn):not(.segmented__btn):not(.category-chip):not(.tool-btn):not(.mode-btn):not(.ghost-btn):not(.search-clear-btn):not(.overlay-action-btn).history-chip.is-new {
  animation: chip-pop 360ms ease;
}

.history-list button:not(.primary-btn):not(.pill-btn):not(.segmented__btn):not(.category-chip):not(.tool-btn):not(.mode-btn):not(.ghost-btn):not(.search-clear-btn):not(.overlay-action-btn).history-chip:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    inset 4px 4px 8px rgba(255,255,255,0.5),
    0 6px 12px rgba(0,0,0,0.3);
  /* Override global border-color change on hover if any */
  border-color: #14532d;
}

.history-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

html[data-theme="dark"] .result-card {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.4));
}

html[data-theme="light"] .result-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(226, 232, 240, 0.7));
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .result-label {
  color: #0f172a;
}

html[data-theme="light"] .result-sub {
  color: rgba(51, 65, 85, 0.75);
}

html[data-theme="light"] button:not(.primary-btn):not(.pill-btn):not(.segmented__btn):not(.category-chip):not(.tool-btn):not(.mode-btn):not(.ghost-btn):not(.search-clear-btn):not(.overlay-action-btn).history-chip {
  border-color: rgba(148, 163, 184, 0.5);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] button:not(.primary-btn):not(.pill-btn):not(.segmented__btn):not(.category-chip):not(.tool-btn):not(.mode-btn):not(.ghost-btn):not(.search-clear-btn):not(.overlay-action-btn).history-chip:hover {
  border-color: rgba(59, 130, 246, 0.7);
}

html[data-theme="light"] .history-empty {
  color: rgba(51, 65, 85, 0.7);
}

@keyframes number-pop {
  0% {
    transform: scale(0.95);
    opacity: 0.6;
  }
  60% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes number-fly {
  0% {
    transform: translateY(12px) scale(0.25);
    opacity: 0.2;
    filter: blur(4px);
  }
  70% {
    transform: translateY(0) scale(1.06);
    opacity: 1;
    filter: blur(0);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes chip-pop {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Game Scene Styles */
.game-scene {
  position: relative;
  width: 100%;
  height: 500px;
  background: linear-gradient(to bottom, #87ceeb 0%, #e0f7fa 100%);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
  isolation: isolate;
  margin-bottom: 20px;
  position: relative; /* Ensure it is a positioning context */
  /* Day Sky: Base Layer */
  background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 60%, #93c5fd 100%);
  /* Move transition to ::before for opacity */
}

/* Night Sky Overlay - Smoother Transition via Opacity */
.game-scene::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  /* Night Sky Gradient */
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
  z-index: 0; /* Behind other content but above main background */
  opacity: 0;
  transition: opacity 3s ease-in-out;
  pointer-events: none;
}

/* Trigger Night Overlay */
html[data-theme="dark"] .game-scene::before {
  opacity: 1;
}

.gs-sky {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1; /* Ensure sky contents sit above the ::before overlay */
}

/* Clouds - Only visible in Light Theme */
.gs-cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  filter: blur(4px);
  opacity: 0.9;
  transition: opacity 1.2s ease;
}
html[data-theme="dark"] .gs-cloud {
  opacity: 0; /* Fully invisible in dark mode */
}

.gs-cloud::after, .gs-cloud::before {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.gs-cloud-1 {
  width: 100px; height: 40px; top: 60px; left: 10%;
  animation: floatCloud 20s linear infinite;
}
.gs-cloud-1::after { width: 50px; height: 50px; top: -25px; left: 20px; content: ""; }
.gs-cloud-2 {
  width: 120px; height: 50px; top: 120px; left: 70%;
  animation: floatCloud 25s linear infinite reverse;
}
.gs-cloud-2::after { width: 60px; height: 60px; top: -30px; left: 30px; content: ""; }

@keyframes floatCloud {
  0% { transform: translateX(0); }
  50% { transform: translateX(20px); }
  100% { transform: translateX(0); }
}

/* Ground */
.gs-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 140px;
  background: linear-gradient(to bottom, #4ade80 0%, #22c55e 100%);
  border-radius: 50% 50% 0 0 / 20% 20% 0 0;
  transform: scaleX(1.5);
  z-index: 10;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
  /* transition: background 3s ease-in-out; Removed */
  /* Overlay for smooth transition */
}

/* Night Ground Overlay */
.gs-ground::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  border-radius: inherit; /* Curve matching */
  background: linear-gradient(to bottom, #166534 0%, #14532d 100%);
  opacity: 0;
  transition: opacity 3s ease-in-out;
  z-index: 1; /* Sit above ground bg, below grass blades (z-index 11) */
}

html[data-theme="dark"] .gs-ground::before {
  opacity: 1;
}

/* =========================================
   GRASS (Day Mode - Swaying)
   ========================================= */
.gs-grass {
  position: absolute;
  bottom: 0;
  width: 10px;
  height: 25px; /* Taller */
  background: #15803d; /* Darker green (contrast against #22c55e) */
  border-radius: 50% 50% 0 0;
  transform-origin: bottom center;
  opacity: 1; /* Fully visible */
  animation: grassSway 3s ease-in-out infinite alternate;
  z-index: 11;
  transition: opacity 1s ease;
}

/* Create grass clumps variations using pseudo elements */
.gs-grass::before, .gs-grass::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 8px;
  background: #166534; /* Different shade */
  border-radius: inherit;
  transform-origin: bottom center;
}
.gs-grass::before { left: -5px; transform: rotate(-12deg); height: 18px; }
.gs-grass::after { left: 5px; transform: rotate(12deg); height: 22px; }

/* Scatter Grass Randomly with Depth (varying bottom) */
.gs-grass-1 { left: 20%; bottom: 12px; height: 28px; animation-delay: 0s; }
.gs-grass-2 { left: 32%; bottom: 82px; height: 24px; animation-delay: 0.7s; }
.gs-grass-3 { left: 42%; bottom: 42px; height: 30px; animation-delay: 0.3s; }
.gs-grass-4 { left: 62%; bottom: 25px; height: 26px; animation-delay: 1.2s; }
.gs-grass-5 { left: 75%; bottom: 100px; height: 32px; animation-delay: 1.8s; }

@keyframes grassSway {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}

/* Night Mode: Grass Invisible */
html[data-theme="dark"] .gs-grass {
  animation: none; 
  opacity: 0; 
}


/* =========================================
   FIREFLIES (Night Mode - Flying)
   ========================================= */
.gs-firefly {
  position: absolute;
  width: 0; height: 0; /* Container is effectively pure position */
  opacity: 0; /* Hidden by default (Day) - Master Opacity */
  bottom: 0px; 
  pointer-events: none;
  z-index: 25; 
  transition: opacity 1s ease-in-out;
}

/* The Visible Firefly (Pseudo-element) */
.gs-firefly::before {
  content: "";
  display: block;
  position: absolute;
  width: 6px; height: 6px;
  background: #fde047; /* Yellow Glow */
  border-radius: 50%;
  box-shadow: 0 0 10px 2px rgba(253, 224, 71, 0.8);
  /* Animation always runs, visibility controlled by parent opacity */
  animation: fireflyFly var(--duration) ease-in-out infinite var(--delay);
}

/* Firefly Flight Pattern */
@keyframes fireflyFly {
  0% { transform: translate(0, 0) scale(0.8); opacity: 0; }
  20% { opacity: 1; }
  50% { transform: translate(30px, -40px) scale(1.2); }
  80% { opacity: 0.8; }
  100% { transform: translate(-20px, -80px) scale(0.5); opacity: 0; }
}

/* Specific Configs using CSS Variables */
.gs-firefly-1 { left: 40%; --duration: 5.8s; --delay: 0.5s; }
.gs-firefly-2 { left: 25%; --duration: 7.2s; --delay: 2.1s; }
.gs-firefly-3 { left: 60%; --duration: 6.5s; --delay: 1.3s; }
.gs-firefly-4 { left: 75%; --duration: 8.4s; --delay: 0.8s; }
.gs-firefly-5 { left: 65%; --duration: 6.9s; --delay: 3.2s; }

/* Active in Night Mode */
html[data-theme="dark"] .gs-firefly {
  opacity: 1; /* Fade in container */
  /* Blend mode needs to be on the specific glowing element or container? 
     Container works if it has content. Use mix-blend-mode on pseudo if needed or container.
     Let's put it on the pseudo for safety or container. Container is safe if size is 0. */
  mix-blend-mode: screen; 
}

/* Cannon */
.gs-cannon-wrapper {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Simple Cannon Design */
.gs-cannon-barrel {
  width: 80px;
  height: 100px;
  background: #f59e0b; /* Bright Orange/Yellow */
  border: 4px solid #b45309;
  border-bottom: none;
  border-radius: 12px 12px 4px 4px;
  margin-bottom: -15px;
  position: relative;
  transform-origin: bottom center;
  z-index: 2;
  box-shadow: 6px 0 0 rgba(0,0,0,0.15);
}

/* Simple Muzzle Ring */
.gs-cannon-barrel::before {
  content: "";
  position: absolute;
  top: -8px; left: -8px; right: -8px;
  height: 16px;
  background: #fbbf24;
  border: 4px solid #b45309;
  border-radius: 8px;
}

/* Simple Base */
.gs-cannon-base {
  width: 120px;
  height: 70px;
  background: #d97706;
  border: 4px solid #92400e;
  border-radius: 40px 40px 10px 10px;
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Simple Dome decoration removed for cleaner look or simplified */
.gs-cannon-dome {
  display: none;
}

/* Enhanced Trigger Button - "Protruding Switch" Design
   The element itself is the invisible touch target/container */
button:not(.primary-btn):not(.pill-btn):not(.segmented__btn):not(.category-chip):not(.tool-btn):not(.mode-btn):not(.ghost-btn):not(.search-clear-btn):not(.overlay-action-btn).gs-cannon-trigger {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: transparent; /* No housing */
  border: none;
  box-shadow: none;
  position: relative;
  z-index: 4;
  outline: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* The Red Button (Moving Part) */
button:not(.primary-btn):not(.pill-btn):not(.segmented__btn):not(.category-chip):not(.tool-btn):not(.mode-btn):not(.ghost-btn):not(.search-clear-btn):not(.overlay-action-btn).gs-cannon-trigger::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 54px; height: 54px; /* Slightly larger since no housing */
  border-radius: 50%;
  
  /* Red Gradient */
  background: radial-gradient(circle at 30% 30%, #ef4444, #b91c1c);
  
  /* 3D Height (Side of the button) */
  box-shadow: 
    0 8px 0 #7f1d1d,
    0 12px 6px rgba(0,0,0,0.4);
    
  /* Positioning */
  transform: translate(-50%, -50%) translateY(-6px);
  
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.1s;
}

/* The Gloss Highlight (Moves with button) */
button:not(.primary-btn):not(.pill-btn):not(.segmented__btn):not(.category-chip):not(.tool-btn):not(.mode-btn):not(.ghost-btn):not(.search-clear-btn):not(.overlay-action-btn).gs-cannon-trigger::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 22px; height: 14px;
  border-radius: 40%;
  background: rgba(255,255,255,0.6);
  filter: blur(0.5px);
  pointer-events: none;
  
  /* Initial Position matched to button's raised state + offset for gloss location */
  transform: translate(-50%, -50%) translateY(-6px) translate(-10px, -12px) rotate(-45deg);
  
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pressed State: Move Button and Gloss Down */
button:not(.primary-btn):not(.pill-btn):not(.segmented__btn):not(.category-chip):not(.tool-btn):not(.mode-btn):not(.ghost-btn):not(.search-clear-btn):not(.overlay-action-btn).gs-cannon-trigger:active::before {
  transform: translate(-50%, -50%) translateY(2px); /* Sink in */
  box-shadow: 
    0 0 0 #7f1d1d, /* Height Gone */
    0 0 4px rgba(0,0,0,0.5);
}

button:not(.primary-btn):not(.pill-btn):not(.segmented__btn):not(.category-chip):not(.tool-btn):not(.mode-btn):not(.ghost-btn):not(.search-clear-btn):not(.overlay-action-btn).gs-cannon-trigger:active::after {
  /* Move gloss down by same amount */
  transform: translate(-50%, -50%) translateY(2px) translate(-10px, -12px) rotate(-45deg);
}

/* Ball */
.gs-ball-wrapper {
  position: absolute;
  top: 40%; 
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  pointer-events: none;
  width: 160px;
  height: 160px;
}

.gs-ball {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 35% 35%, #22c55e 0%, #16a34a 100%);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 4px solid #14532d;
  box-shadow: 
    inset 10px 10px 20px rgba(255,255,255,0.4),
    0 10px 20px rgba(0,0,0,0.2);
  opacity: 0;
  transform: scale(0.1) translateY(300px);
}

.gs-ball-num {
  font-family: var(--font-display, sans-serif);
  font-size: 5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 2px 2px 0 #14532d;
}

/* Animations */
.gs-cannon-barrel.fire-recoil {
  animation: cannonRecoil 0.3s ease-out;
}

@keyframes cannonRecoil {
  0% { transform: scaleY(1); }
  20% { transform: scaleY(0.85); }
  50% { transform: scaleY(1.05); }
  100% { transform: scaleY(1); }
}

.gs-ball.fire-shoot {
  animation: ballShoot 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes ballShoot {
  0% {
    transform: scale(0.1) translateY(300px);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(-40px); /* Lowered from -80px to -40px */
    opacity: 1;
  }
}

.gs-status-message {
  position: absolute;
  top: 20px;
  left: 0;
  width: 100%;
  text-align: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 5;
}


/* Font Size Adjustments */
.gs-ball-num.text-md {
  font-size: 3.5rem;
}
.gs-ball-num.text-lg {
  font-size: 2.5rem;
}

/* Day/Night Celestial Bodies */

/* =========================================
   1. SUN (Day Mode) 
   ========================================= */
.gs-sun {
  position: absolute;
  top: 50px; right: 50px;
  width: 90px; height: 90px;
  background: radial-gradient(circle at 30% 30%, #fef3c7, #f59e0b);
  border-radius: 50%;
  box-shadow: 
    0 0 30px rgba(245, 158, 11, 0.5),
    0 0 60px rgba(245, 158, 11, 0.3),
    inset -10px -10px 20px rgba(217, 119, 6, 0.5); /* Depth */
  z-index: 1;
  /* Day Position: Visible */
  transform: translate(0, 0) scale(1);
  opacity: 1;
  transition: transform 2s cubic-bezier(0.68, -0.6, 0.32, 1.6), opacity 1.5s ease;
}

/* Sun Rays / Corona */
.gs-sun::before {
  content: "";
  position: absolute;
  top: -12px; left: -12px; right: -12px; bottom: -12px;
  border-radius: 50%;
  border: 3px dashed rgba(251, 191, 36, 0.6); /* Outer ring */
  animation: sunRotate 30s linear infinite;
}

.gs-sun::after {
  content: "";
  position: absolute;
  top: -6px; left: -6px; right: -6px; bottom: -6px;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 15px 5px rgba(253, 186, 116, 0.5);
  animation: sunPulse 4s ease-in-out infinite alternate;
}

@keyframes sunRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes sunPulse {
  0% { transform: scale(0.98); opacity: 0.8; }
  100% { transform: scale(1.02); opacity: 1; }
}

/* Hide Sun in Dark Mode */
html[data-theme="dark"] .gs-sun {
  /* Exit to Top-Center (Offscreen) relative to top-right position */
  /* Assuming screen center is roughly -40vw from right side */
  transform: translate(-30vw, -150px) scale(0.5); 
  opacity: 0;
  pointer-events: none;
}


/* =========================================
   2. MOON (Night Mode) 
   ========================================= */
.gs-moon {
  position: absolute;
  top: 50px; right: 40px;
  width: 90px; height: 90px;
  border-radius: 50%;
  box-shadow: -25px 15px 0 0 #f1f5f9; 
  z-index: 2;
  opacity: 0;
  /* Default Hidden State (Day): Bottom-Right Offscreen */
  transform: translate(150px, 200px) rotate(-20deg);
  transition: transform 2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 1.5s ease;
}

/* Moon Crater Details */
.gs-moon::after {
  content: "";
  position: absolute;
  top: 30px; left: 20px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(203, 213, 225, 0.0); 
  box-shadow: 
    0 0 0 4px rgba(255,255,255,0.05),
    25px -15px 0 -2px rgba(255,255,255,0.05);
  transform: rotate(20deg);
}

/* Moon Glow */
.gs-moon::before {
  content: "";
  position: absolute;
  top: -20px; left: -45px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.1), transparent 70%);
  opacity: 0;
  animation: moonGlow 3s ease-in-out infinite alternate;
}

@keyframes moonGlow {
  0% { opacity: 0.2; transform: scale(0.95); }
  100% { opacity: 0.6; transform: scale(1.05); }
}

@keyframes moonFloat {
  0% { margin-top: 0px; }
  100% { margin-top: -15px; }
}

/* Show Moon in Dark Mode */
html[data-theme="dark"] .gs-moon {
  /* Enter Position: Top Right */
  transform: translate(0, 0) rotate(-20deg);
  opacity: 1;
  /* Add float animation after entry */
  animation: moonFloat 6s ease-in-out infinite alternate 2s;
}


/* =========================================
   3. CLOUDS (Day Mode Only) 
   ========================================= */
.gs-cloud {
  position: absolute;
  /* Use 'background-color' instead of 'background' to separate color from opacity if needed, 
     but simple background is fine. */
  background: #fff;
  border-radius: 50px;
  z-index: 1;
  opacity: 0.85;
  box-shadow: 0 8px 15px rgba(0,0,0,0.05);
  /* Smooth transition for enter/exit movement */
  transition: opacity 2s ease, left 2s ease-in-out, right 2s ease-in-out; 
}

.gs-cloud::after, .gs-cloud::before {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

/* Breathing animation for clouds (Move + Breathe) */
@keyframes cloudBreathe {
  0% { transform: translateX(0) scale(1); }
  50% { transform: translateX(15px) scale(1.05); }
  100% { transform: translateX(0) scale(1); }
}

/* Cloud 1 (Left) */
.gs-cloud-1 {
  top: 100px; 
  left: 10%; /* Normal Position */
  width: 140px; height: 45px;
  /* Irregular Breathing */
  animation: cloudBreathe 6s ease-in-out infinite alternate;
}
.gs-cloud-1::after { width: 55px; height: 55px; top: -30px; left: 25px; }
.gs-cloud-1::before { width: 45px; height: 45px; top: -20px; left: 60px; }

/* Cloud 2 (Right) */
.gs-cloud-2 {
  top: 180px; 
  right: 15%; /* Position relative to right */
  left: auto;
  width: 100px; height: 35px;
  /* Different timing for irregular feel */
  animation: cloudBreathe 8s ease-in-out infinite alternate-reverse;
}
.gs-cloud-2::after { width: 40px; height: 40px; top: -20px; left: 20px; }

/* Note: @keyframes cloudDrift is removed as requested for breathing motion */

/* Hide Clouds in in Dark Mode (Exit directions) */
html[data-theme="dark"] .gs-cloud {
  opacity: 0;
}

/* Specific Exit Directions */
html[data-theme="dark"] .gs-cloud-1 {
  /* Exit Left */
  left: -30%; 
}

html[data-theme="dark"] .gs-cloud-2 {
  /* Exit Right */
  right: -30%;
}


.gs-stars {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0;
  background-image: 
    radial-gradient(white, rgba(255,255,255,.8) 2px, transparent 3px),
    radial-gradient(white, rgba(255,255,255,.5) 1px, transparent 2px),
    radial-gradient(white, rgba(255,255,255,.3) 2px, transparent 3px),
    radial-gradient(rgba(255,255,255, 0.8), rgba(255,255,255, 0.1) 1px, transparent 1px); /* More tiny stars */
  background-size: 550px 550px, 350px 350px, 250px 250px, 150px 150px;
  background-position: 0 0, 40px 60px, 130px 270px, 70px 120px;
  opacity: 0;
  display: block;
  transition: opacity 2s ease-in-out;
}

@keyframes starTwinkle {
  0% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0.6; transform: scale(1); }
}

html[data-theme="dark"] .gs-stars {
  opacity: 1;
  animation: starTwinkle 5s ease-in-out infinite alternate;
}

