:root {
  /* Premium Palette using HSL for better blending */
  --p-pink: hsl(351, 100%, 86%);
  --p-sky: hsl(214, 100%, 95%);
  --p-orange: hsl(30, 100%, 50%);
  --p-yellow: hsl(54, 100%, 65%);
  --p-cocoa: hsl(28, 48%, 21%);

  /* Surface & Background */
  --bg-main: hsl(220, 100%, 98%);
  --glass-white: rgba(255, 255, 255, 0.7);
  --surface-card: #ffffff;

  /* Elevation - Layered Shadows for "Premium" feel */
  --shadow-sm: 4px 4px 0 var(--p-cocoa);
  --shadow-md: 8px 8px 0 var(--p-cocoa);
  --shadow-lg: 16px 16px 0 var(--p-cocoa);
  --shadow-glass: 0 10px 30px rgba(75, 54, 33, 0.08);

  /* Spacing Scale (8pt Grid) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  --border-radius: 40px;
}

.hidden {
  display: none !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: "Fredoka One", "Inter", sans-serif;
  background: hsl(133.4deg 34.75% 51.96%);
  background-image: radial-gradient(
      circle at 15% 15%,
      var(--p-pink) 0%,
      transparent 45%
    ),
    radial-gradient(circle at 85% 85%, var(--p-sky) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--p-cocoa);
  overflow-x: hidden;
  line-height: 1.6;
}

h1,
h2,
h3,
.logo {
  font-family: "Fredoka One", cursive;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Shared Components */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Header & Nav */
header {
  padding: var(--space-md) 0;
  position: sticky;
  top: var(--space-md);
  z-index: 1000;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--glass-white);
  backdrop-filter: blur(20px);
  border: 3px solid var(--p-cocoa);
  border-radius: 30px;
  padding: var(--space-sm) var(--space-xl);
  box-shadow: var(--shadow-glass);
}

.logo {
  font-size: 2rem;
  color: var(--p-orange);
  -webkit-text-stroke: 1px var(--p-cocoa);
  text-shadow: 3px 3px 0 rgba(75, 54, 33, 0.1);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo span {
  color: var(--p-pink);
}

/* Buttons */
.btn {
  text-decoration: none;
  padding: var(--space-md) var(--space-xl);
  border-radius: 24px;
  font-family: "Fredoka One", cursive;
  font-size: 1.1rem;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 3px solid var(--p-cocoa);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.btn-primary {
  background-color: var(--p-orange);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background-color: var(--surface-white);
  color: var(--p-cocoa);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 2px 2px 0 var(--p-cocoa);
}

/* Hero Section */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 85vh;
  padding: var(--space-3xl) 0;
  gap: var(--space-3xl);
}

.hero-content {
  flex: 1.2;
  z-index: 10;
}

.hero-content h1 {
  font-size: 6rem;
  line-height: 0.85;
  margin-bottom: var(--space-lg);
  color: var(--p-orange);
  -webkit-text-stroke: 2px var(--p-cocoa);
  text-shadow: var(--shadow-md), 12px 12px 0 rgba(75, 54, 33, 0.05);
}

.hero-content p {
  font-size: 1.5rem;
  margin-bottom: var(--space-2xl);
  color: var(--p-cocoa);
  font-family: "Inter", sans-serif;
  font-weight: 600;
  max-width: 90%;
}

.hero-image {
  flex: 0.8;
  display: flex;
  justify-content: center;
}

.hero-image img {
  width: 100%;
  max-width: 500px;
  border-radius: 64px;
  border: 4px solid var(--p-cocoa);
  transform: perspective(1000px) rotateY(-12deg) rotateX(4deg);
  box-shadow: 24px 24px 0 var(--p-cocoa), 0 40px 80px rgba(0, 0, 0, 0.15);
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.hero-image:hover img {
  transform: perspective(1000px) rotateY(0deg) scale(1.05);
  box-shadow: 12px 12px 0 var(--p-cocoa), 0 50px 100px rgba(0, 0, 0, 0.2);
}

/* CA Box - Premium Style */
.ca-box {
  background: var(--glass-white);
  backdrop-filter: blur(10px);
  border: 3px solid var(--p-cocoa);
  box-shadow: var(--shadow-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  max-width: fit-content;
}

.ca-box code {
  font-family: "Fredoka One", cursive;
  font-size: 1.1rem;
  color: var(--p-cocoa);
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
}

/* Chibifier Lab - Premium Refinement */
.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-desc {
  font-size: 1.2rem;
  color: var(--p-cocoa);
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto;
  font-weight: 500;
}
.chibifier-container {
  position: relative;
}

.chibifier-video {
  width: 70%;
  border-radius: 20px;

  border: 3px solid #ff6ec7;
  box-shadow:
    0 0 15px rgba(255, 110, 199, 0.6),
    0 0 30px rgba(255, 110, 199, 0.4);
}

.chibifier-title {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: bold;
  margin-bottom: 16px;

  color: #333; /* or white if dark background */
}
.chibifier-container {
  background: var(--surface-card);
  border: 6px solid var(--p-cocoa); /* Thicker cartoon border */
  box-shadow: 0 16px 0 var(--p-cocoa), var(--shadow-lg); /* Layered 3D shadow */
  border-radius: 60px;
  padding: var(--space-3xl);
  max-width: 900px;
  margin: 40px auto;
  min-height: 480px;
  display: block;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chibifier-container.magic-pop {
  background: linear-gradient(-45deg, #fffafa, #f0f7ff, #fff9f0, #f5fff5);
  background-size: 400% 400%;
  animation: magicGradient 15s ease infinite;
}

.chibifier-container.magic-pop:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 24px 0 var(--p-cocoa), var(--shadow-lg);
}

@keyframes magicGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.chibifier-step {
  width: 100%;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
}

/* Upload Zone */
.upload-zone {
  width: 100%;
  height: 300px;
  border: 4px dashed var(--p-pink);
  border-radius: 40px;
  background: var(--p-sky);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.upload-zone:hover {
  border-color: var(--p-orange);
  transform: scale(0.98);
  background: white;
}

.upload-content {
  text-align: center;
  color: var(--p-cocoa);
}

.upload-icon {
  font-size: 5rem;
  display: block;
  margin-bottom: var(--space-md);
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.1));
}

.upload-content p {
  font-family: "Fredoka One", cursive;
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}

.upload-hint {
  font-size: 0.9rem;
  opacity: 0.6;
}

/* Result Layout */
.result-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  width: 100%;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  width: 100%;
  max-width: 800px;
}

.image-box {
  position: relative;
  border: 4px solid var(--p-cocoa);
  border-radius: 32px;
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow-md);
  aspect-ratio: 1/1;
}

.image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--p-cocoa);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 800;
  z-index: 10;
}

.badge-primary {
  background: var(--p-orange);
}

.magic-glow {
  box-shadow: 0 0 30px rgba(255, 107, 107, 0.3), var(--shadow-md);
  border-color: var(--p-orange);
}

.watermark {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 10px;
  border-radius: 8px;
  font-family: "Fredoka One", cursive;
  color: var(--p-orange);
  font-size: 0.7rem;
  border: 2px solid var(--p-cocoa);
}

.result-actions {
  flex: 0.8;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.btn-outline {
  background: transparent;
  border: 3px solid var(--p-cocoa);
  color: var(--p-cocoa);
}

/* Loader */
.magic-loader {
  position: relative;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wand {
  font-size: 4rem;
  animation: float 2s infinite ease-in-out;
}
.sparkles {
  position: absolute;
  font-size: 1.5rem;
  animation: sparkle 1.5s infinite;
}

#status-text {
  font-family: "Fredoka One", cursive;
  font-size: 1.5rem;
  color: var(--p-orange);
}

.progress-bar {
  width: 300px;
  height: 12px;
  background: var(--p-sky);
  border: 3px solid var(--p-cocoa);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 30%;
  background: var(--p-orange);
  transition: width 0.3s ease;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-20px) rotate(15deg);
  }
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Perfect Flexbox Grid for Gallery */
.gallery {
  padding: var(--space-3xl) 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.card-3d {
  background: #ffffff;
  border: 4px solid var(--p-cocoa);
  border-radius: 48px;
  padding: var(--space-md);
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-3d:hover {
  transform: translateY(-12px) rotate(-1deg);
  box-shadow: var(--shadow-lg);
}

.card-3d img {
  width: 100%;
  border-radius: 36px;
  margin-bottom: var(--space-md);
  border: 2px solid rgba(75, 54, 33, 0.05);
}

.card-footer {
  font-family: "Fredoka One", cursive;
  color: var(--p-orange);
  font-size: 1.3rem;
  padding: var(--space-sm);
  text-align: center;
  background: var(--p-sky);
  border-radius: 20px;
  margin-top: auto;
}

/* Feature Grid - Pixel Perfect Flex */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  padding: var(--space-3xl) 0;
}

.feature-card {
  background: var(--glass-white);
  backdrop-filter: blur(15px);
  padding: var(--space-2xl);
  border-radius: 48px;
  border: 4px solid var(--p-cocoa);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feature-card:hover {
  transform: translateY(-10px) scale(1.03);
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

.feature-card .icon-3d {
  font-size: 4.5rem;
  margin-bottom: var(--space-md);
  filter: drop-shadow(4px 4px 0 var(--p-cocoa));
}

/* Wavy Dividers */
.divider {
  width: 100%;
  height: 100px;
  background-repeat: no-repeat;
  background-size: cover;
}

.divider.wavy.reversed {
  transform: rotate(180deg);
}

/* magic-pop Component */
.magic-pop {
  background: linear-gradient(-45deg, #f7fbff, #fff5f8, #f0f7ff, #fff9f0);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  border: 6px solid var(--p-cocoa) !important;
  box-shadow: 0 20px 0 var(--p-cocoa), var(--shadow-lg);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.magic-pop:hover {
  transform: translateY(-8px) rotate(0.5deg);
  box-shadow: 0 28px 0 var(--p-cocoa), var(--shadow-lg);
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* MOBILE RESPONSIVENESS (Peak Polish) */
@media (max-width: 1024px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
    gap: var(--space-xl);
  }

  .hero-content h1 {
    font-size: 4rem;
  }

  .hero-image {
    order: -1;
  }

  .hero-image img {
    max-width: 400px;
  }

  .gallery-grid,
  .features {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-layout {
    flex-direction: column;
  }

  .result-image-wrapper {
    flex: 0 0 auto;
    width: 100%;
    max-width: 350px;
  }
}

@media (max-width: 768px) {
  :root {
    --space-3xl: 40px;
    --space-2xl: 32px;
  }

  .section-title {
    font-size: 2.8rem;
  }

  .gallery-grid,
  .features {
    grid-template-columns: 1fr;
  }

  .chibifier-container {
    padding: var(--space-lg);
    border-radius: 40px;
  }

  .upload-zone {
    height: 250px;
  }

  .nav-links {
    display: none; /* Mobile menu can be added later if needed */
  }

  nav {
    padding: var(--space-sm) var(--space-md);
  }

  .logo {
    font-size: 1.5rem;
  }

  .btn {
    width: 100%;
  }

  .ca-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: none;
  }

  .ca-box code {
    font-size: 0.8rem;
    word-break: break-all;
  }

  .monitor-header {
    padding: var(--space-sm);
  }

  .iframe-wrapper iframe {
    height: 950px; /* Maximum visibility for mobile market data */
  }
}

/* Chart Monitor - Extreme Polish */
.chart-monitor {
  background: #1a1a1a;
  border: 6px solid var(--p-cocoa);
  border-radius: 48px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), inset 0 0 50px rgba(0, 0, 0, 0.5);
  margin: var(--space-3xl) auto;
  position: relative;
  max-width: 2000px;
}

.monitor-header {
  background: var(--p-cocoa);
  padding: var(--space-md) var(--space-xl);
  display: flex;
  align-items: center;
  border-bottom: 3px solid rgba(255, 255, 255, 0.1);
}

.dots {
  display: flex;
  gap: 12px;
}

.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dot.red {
  background: #ff5f56;
  box-shadow: 0 0 10px #ff5f56;
}
.dot.yellow {
  background: #ffbd2e;
  box-shadow: 0 0 10px #ffbd2e;
}
.dot.green {
  background: #27c93f;
  box-shadow: 0 0 10px #27c93f;
}

.monitor-title {
  flex-grow: 1;
  text-align: center;
  font-family: "Fredoka One", cursive;
  color: white;
  font-size: 1rem;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  letter-spacing: 2px;
}

.iframe-wrapper {
  background: #000;
  padding: 10px;
  position: relative;
}

.iframe-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(
      90deg,
      rgba(255, 0, 0, 0.06),
      rgba(0, 255, 0, 0.02),
      rgba(0, 0, 255, 0.06)
    );
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
  opacity: 0.15;
}

.btn-copy {
  background: var(--primary-accent);
  color: var(--border-color);
  border: 2px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Fredoka One", cursive;
  font-size: 0.8rem;
  transition: background 0.2s;
}

.btn-copy:hover {
  background: var(--primary-gold);
}

/* Dexscreener Iframe */
.iframe-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  border: var(--cartoon-border);
  box-shadow: var(--cartoon-shadow);
  border-radius: 24px;
  overflow: hidden;
  margin-top: 20px;
}

.iframe-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.chart {
  padding: 80px 20px;
}

/* Animations */
.bounce {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

#bubble-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.bubble {
  position: absolute;
  bottom: -100px;
  background: rgba(253, 184, 19, 0.1);
  border: 2px solid rgba(75, 54, 33, 0.1);
  border-radius: 50%;
  animation: float 10s infinite ease-in;
}

@keyframes float {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-120vh) rotate(360deg);
    opacity: 0;
  }
}

/* Reveal on Scroll */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Cloud Decorations */
.clouds-decor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: var(--surface-white);
  border-radius: 100px;
  opacity: 0.6;
  filter: blur(20px);
}

.cloud-1 {
  width: 400px;
  height: 150px;
  top: 10%;
  left: -100px;
  animation: float 20s infinite linear;
}
.cloud-2 {
  width: 300px;
  height: 120px;
  top: 40%;
  right: -50px;
  animation: float 25s infinite linear reverse;
}
.cloud-3 {
  width: 500px;
  height: 200px;
  bottom: 10%;
  left: 20%;
  animation: float 30s infinite linear;
}

@keyframes float {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100vw);
  }
}

footer {
  padding: 60px 20px;
  text-align: center;
  border-top: var(--cartoon-border);
  background: var(--surface-white);
}

/* Mobile Tweaks */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 40px 20px;
  }
  .hero-content h1 {
    font-size: 2.5rem;
  }
  .social-links {
    display: none;
  }
}

/* Chibifier Section Styles */
#chibifier {
  padding: 100px 20px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(255, 192, 203, 0.1),
    transparent
  );
}

.section-desc {
  color: var(--text-cocoa);
  font-size: 1.2rem;
  font-weight: 500;
}

.chibifier-container {
  background: var(--surface-white);
  border: var(--cartoon-border);
  box-shadow: 15px 15px 0 var(--border-cocoa), 0 30px 60px rgba(0, 0, 0, 0.05);
  border-radius: 60px;
  padding: 80px 40px;
  max-width: 900px;
  margin: 0 auto;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column; /* keeps title above video */
  align-items: center;    /* horizontal center */
  justify-content: center; /* vertical center (if height is set) */
  text-align: center;
}

.chibifier-container:hover {
  transform: translateY(-5px);
}

.upload-zone {
  border: 3px dashed var(--border-cocoa);
  border-radius: 32px;
  background: rgba(185, 217, 235, 0.1);
}

.upload-zone:hover {
  border-color: var(--mars-orange);
  background: rgba(255, 159, 67, 0.05);
}

.loading-spinner {
  border: 8px solid #f3f3f3;
  border-top: 8px solid var(--mars-orange);
}

#status-text {
  color: var(--mars-orange);
}

.btn-link {
  color: var(--text-cocoa);
  font-weight: 600;
}

.btn-link:hover {
  color: var(--mars-orange);
}

/* Bubble Overrides */
.bubble {
  background: rgba(255, 192, 203, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset -5px -5px 10px rgba(0, 0, 0, 0.05);
}
.card-3d video {
  width: 350px;   /* adjust this value */
  height: auto;
}