/* ==========================================================================
   BLOCKFIT: COZY PUZZLE - OFFICIAL WEBSITE DESIGN SYSTEM
   Standard: "Cozy Studio" Tactile 3D Toy Aesthetic System
   Palette: Warm Cream Notebook, Chocolate Outlines (#3E1820), 3D Drop Slabs
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@600;700&family=Nunito:wght@700;800;900;1000&family=Outfit:wght@600;700;800;900&display=swap');

:root {
  /* Canvas & Notebook Colors */
  --bg-cream: #FFF9EC;
  --bg-grid-line: #EDE6D2;
  --bg-margin-rule: #FFB3BA;
  
  /* Universal Contour */
  --chocolate: #3E1820;
  --chocolate-rgb: 62, 24, 32;
  --chocolate-soft: #633640;
  --text-muted: #8C7A82;
  --text-light: #B4A4AB;
  
  /* Tactile Slabs & Panels */
  --panel-bg: #FFFDF8;
  --panel-cream: #FFF5E1;
  --panel-slab: #DED0B8;
  --panel-slab-dark: #CBB99E;
  
  /* Primary CTA (Emerald Green) */
  --green-base: #4ADE80;
  --green-slab: #16A34A;
  --green-rim: #86EFAC;
  
  /* Secondary Accent (Warm Gold / Yellow) */
  --gold-base: #FFE55C;
  --gold-slab: #D4B830;
  --gold-rim: #FFF08A;
  
  /* Peach Accent */
  --peach-base: #FFB3BA;
  --peach-slab: #E28B93;
  --peach-rim: #FFD1D6;
  
  /* Sky Blue Accent */
  --sky-base: #70C5FF;
  --sky-slab: #2B7EC4;
  --sky-rim: #B0DDFF;
  
  /* Royal Purple Accent */
  --purple-base: #BA78FF;
  --purple-slab: #8B36DF;
  --purple-rim: #DFBAFF;
  
  /* Orange / Fire Accent */
  --orange-base: #FFA742;
  --orange-slab: #D66A10;
  --orange-rim: #FFCB8E;
  
  /* Physics & Elevation */
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --depth-sm: 2px;
  --depth-md: 4px;
  --depth-lg: 6px;
  --depth-xl: 8px;
  
  /* Typography */
  --font-main: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Fredoka', 'Outfit', var(--font-main);
  
  /* Container Widths */
  --max-width: 1220px;
}

/* Base Reset & Notebook Canvas */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  color: var(--chocolate);
  background-color: var(--bg-cream);
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-cream);
  color: var(--chocolate);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Notebook Graph Paper Texture */
.notebook-canvas {
  background-color: var(--bg-cream);
  background-image: 
    linear-gradient(to right, var(--bg-grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--bg-grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center top;
  min-height: 100vh;
  position: relative;
}

/* Notebook top perforation and spiral binder header */
.notebook-binder-strip {
  width: 100%;
  height: 14px;
  background: repeating-linear-gradient(
    90deg,
    #F3E8D0,
    #F3E8D0 20px,
    #D7C8AC 20px,
    #D7C8AC 24px,
    var(--bg-cream) 24px,
    var(--bg-cream) 44px
  );
  border-bottom: 2px solid var(--chocolate);
  opacity: 0.65;
}

/* Selection */
::selection {
  background: var(--gold-base);
  color: var(--chocolate);
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   COZY STUDIO REUSABLE 3D COMPONENTS
   ========================================================================== */

/* 1. Juicy Button (Tactile 3D Toy Button) */
.juicy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-main);
  font-weight: 900;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: 2.5px solid var(--chocolate);
  border-radius: 14px;
  padding: 0.75rem 1.4rem;
  position: relative;
  user-select: none;
  transition: transform 0.12s var(--spring-bounce), box-shadow 0.12s var(--spring-bounce);
  outline: none;
  white-space: nowrap;
}

/* Inset Highlight Rim */
.juicy-btn::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  right: 6px;
  height: 40%;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

/* Colors & Depth Variants */
.juicy-btn-green {
  background: var(--green-base);
  color: var(--chocolate);
  box-shadow: 0 var(--depth-md) 0 var(--green-slab), 0 6px 12px rgba(22, 163, 74, 0.25);
}
.juicy-btn-green:hover {
  transform: translateY(-2px);
  box-shadow: 0 var(--depth-lg) 0 var(--green-slab), 0 8px 16px rgba(22, 163, 74, 0.3);
}
.juicy-btn-green:active {
  transform: translateY(var(--depth-md));
  box-shadow: 0 0 0 var(--green-slab);
}

.juicy-btn-gold {
  background: var(--gold-base);
  color: var(--chocolate);
  box-shadow: 0 var(--depth-md) 0 var(--gold-slab), 0 6px 12px rgba(212, 184, 48, 0.25);
}
.juicy-btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 var(--depth-lg) 0 var(--gold-slab), 0 8px 16px rgba(212, 184, 48, 0.3);
}
.juicy-btn-gold:active {
  transform: translateY(var(--depth-md));
  box-shadow: 0 0 0 var(--gold-slab);
}

.juicy-btn-peach {
  background: var(--peach-base);
  color: var(--chocolate);
  box-shadow: 0 var(--depth-md) 0 var(--peach-slab), 0 6px 12px rgba(226, 139, 147, 0.25);
}
.juicy-btn-peach:hover {
  transform: translateY(-2px);
  box-shadow: 0 var(--depth-lg) 0 var(--peach-slab), 0 8px 16px rgba(226, 139, 147, 0.3);
}
.juicy-btn-peach:active {
  transform: translateY(var(--depth-md));
  box-shadow: 0 0 0 var(--peach-slab);
}

.juicy-btn-sky {
  background: var(--sky-base);
  color: var(--chocolate);
  box-shadow: 0 var(--depth-md) 0 var(--sky-slab);
}
.juicy-btn-sky:hover {
  transform: translateY(-2px);
  box-shadow: 0 var(--depth-lg) 0 var(--sky-slab);
}
.juicy-btn-sky:active {
  transform: translateY(var(--depth-md));
  box-shadow: 0 0 0 var(--sky-slab);
}

.juicy-btn-ivory {
  background: var(--panel-bg);
  color: var(--chocolate);
  box-shadow: 0 var(--depth-md) 0 var(--panel-slab);
}
.juicy-btn-ivory:hover {
  background: #FFFDF4;
  transform: translateY(-2px);
  box-shadow: 0 var(--depth-lg) 0 var(--panel-slab);
}
.juicy-btn-ivory:active {
  transform: translateY(var(--depth-md));
  box-shadow: 0 0 0 var(--panel-slab);
}

.juicy-btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  border-radius: 10px;
  box-shadow: 0 var(--depth-sm) 0 var(--panel-slab);
}
.juicy-btn-sm:active {
  transform: translateY(var(--depth-sm));
  box-shadow: 0 0 0 transparent;
}

.juicy-btn-lg {
  padding: 0.95rem 2rem;
  font-size: 1.15rem;
  border-radius: 18px;
  box-shadow: 0 var(--depth-lg) 0 var(--green-slab), 0 10px 24px rgba(22, 163, 74, 0.28);
}
.juicy-btn-lg:hover {
  transform: translateY(-2px);
  box-shadow: 0 var(--depth-xl) 0 var(--green-slab), 0 12px 28px rgba(22, 163, 74, 0.35);
}
.juicy-btn-lg:active {
  transform: translateY(var(--depth-lg));
  box-shadow: 0 0 0 var(--green-slab);
}

/* 2. Juicy Panel (3D Tactile Slab Card) */
.juicy-panel {
  background: var(--panel-bg);
  border: 2.8px solid var(--chocolate);
  border-radius: 22px;
  box-shadow: 0 var(--depth-lg) 0 var(--panel-slab), 0 12px 28px rgba(62, 24, 32, 0.08);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--spring-bounce), box-shadow 0.2s var(--spring-bounce);
}

.juicy-panel-hoverable:hover {
  transform: translateY(-3px);
  box-shadow: 0 var(--depth-xl) 0 var(--panel-slab), 0 16px 36px rgba(62, 24, 32, 0.12);
}

.juicy-panel-gold {
  background: #FFFDF0;
  box-shadow: 0 var(--depth-lg) 0 var(--gold-slab), 0 12px 28px rgba(212, 184, 48, 0.15);
}

.juicy-panel-peach {
  background: #FFF8F8;
  box-shadow: 0 var(--depth-lg) 0 var(--peach-slab), 0 12px 28px rgba(226, 139, 147, 0.15);
}

.juicy-panel-sky {
  background: #F3FAFF;
  box-shadow: 0 var(--depth-lg) 0 var(--sky-slab), 0 12px 28px rgba(112, 197, 255, 0.15);
}

/* Highlight line inside panel */
.juicy-panel::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  pointer-events: none;
}

/* 3. Juicy Pill Badge */
.juicy-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  font-family: var(--font-main);
  font-weight: 900;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1.8px solid var(--chocolate);
  border-radius: 999px;
  box-shadow: 0 var(--depth-sm) 0 var(--chocolate);
  background: var(--gold-base);
  color: var(--chocolate);
  position: relative;
  user-select: none;
}

.badge-green  { background: var(--green-base); box-shadow: 0 2px 0 var(--green-slab); }
.badge-gold   { background: var(--gold-base); box-shadow: 0 2px 0 var(--gold-slab); }
.badge-peach  { background: var(--peach-base); box-shadow: 0 2px 0 var(--peach-slab); }
.badge-sky    { background: var(--sky-base); box-shadow: 0 2px 0 var(--sky-slab); }
.badge-purple { background: var(--purple-base); color: #FFF; box-shadow: 0 2px 0 var(--purple-slab); }
.badge-ivory  { background: #FFFDF8; box-shadow: 0 2px 0 var(--panel-slab); }

/* 3D Toy Icon & Emoji Replacements - Perfectly Sized & Equalized */
.emoji-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  filter: drop-shadow(0 2px 3px rgba(62, 24, 32, 0.16));
  flex-shrink: 0;
}

.emoji-img-sm {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  filter: drop-shadow(0 1px 2px rgba(62, 24, 32, 0.15));
  flex-shrink: 0;
}

.emoji-img-md {
  width: 28px;
  height: 28px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  filter: drop-shadow(0 2px 4px rgba(62, 24, 32, 0.18));
  flex-shrink: 0;
}

.emoji-img-lg {
  width: 36px;
  height: 36px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  filter: drop-shadow(0 3px 5px rgba(62, 24, 32, 0.22));
  flex-shrink: 0;
}

.stat-icon-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  margin-bottom: 0.35rem;
  filter: drop-shadow(0 2px 4px rgba(62, 24, 32, 0.16));
}

.bullet-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  margin-top: 1px;
  filter: drop-shadow(0 2px 4px rgba(62, 24, 32, 0.14));
}

.sound-icon-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(62, 24, 32, 0.18));
}

.code-thumb-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(62, 24, 32, 0.15));
}

.modal-header-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
  filter: drop-shadow(0 2px 4px rgba(62, 24, 32, 0.18));
}

/* 4. Raised Juicy Tab Group */
.juicy-tab-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1.5rem 0;
  justify-content: center;
}

.juicy-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 0.92rem;
  border: 2px solid var(--chocolate);
  border-radius: 12px;
  background: var(--panel-bg);
  color: var(--text-muted);
  box-shadow: 0 2px 0 var(--panel-slab);
  cursor: pointer;
  transition: all 0.12s var(--spring-bounce);
}

.juicy-tab-btn:hover {
  color: var(--chocolate);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 var(--panel-slab);
}

.juicy-tab-btn.active {
  background: var(--gold-base);
  color: var(--chocolate);
  font-weight: 900;
  box-shadow: 0 4px 0 var(--gold-slab);
  transform: translateY(-2px);
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 249, 236, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2.5px solid var(--chocolate);
  padding: 0.75rem 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 2px 0;
}

.nav-brand-img {
  height: 54px;
  width: auto;
  max-width: 175px;
  object-fit: contain;
  filter: drop-shadow(0 3px 0 rgba(62, 24, 32, 0.18));
  transition: transform 0.2s var(--spring-bounce), filter 0.2s ease;
}

.nav-brand:hover .nav-brand-img {
  transform: scale(1.08) rotate(-2deg);
  filter: drop-shadow(0 5px 8px rgba(62, 24, 32, 0.25));
}

.footer-brand-logo {
  display: inline-block;
  text-decoration: none;
  margin-bottom: 0.6rem;
}

.footer-brand-img {
  height: 78px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(62, 24, 32, 0.18));
  transition: transform 0.2s var(--spring-bounce), filter 0.2s ease;
}

.footer-brand-logo:hover .footer-brand-img {
  transform: scale(1.06) rotate(-1.5deg);
  filter: drop-shadow(0 6px 12px rgba(62, 24, 32, 0.25));
}

/* Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  list-style: none;
}

.nav-link {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--chocolate);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 12px;
  transition: all 0.15s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link .emoji-img {
  width: 22px;
  height: 22px;
}

.nav-link:hover {
  background: rgba(255, 229, 92, 0.4);
  color: var(--chocolate);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sound-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  padding: 0;
  background: var(--peach-base);
  box-shadow: 0 3px 0 var(--peach-slab);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sound-toggle-btn .emoji-img {
  width: 26px;
  height: 26px;
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  padding: 0;
  background: var(--gold-base);
  box-shadow: 0 3px 0 var(--gold-slab);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  padding: 3.5rem 0 4.5rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  z-index: 2;
}

.hero-badge-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3.4rem;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--chocolate);
}

.hero-title-highlight {
  position: relative;
  display: inline-block;
  color: var(--chocolate);
  z-index: 1;
}

.hero-title-highlight::before {
  content: '';
  position: absolute;
  bottom: 6px;
  left: -4px;
  right: -4px;
  height: 18px;
  background: var(--gold-base);
  border-radius: 8px;
  z-index: -1;
  transform: rotate(-1.2deg);
}

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--chocolate-soft);
  max-width: 540px;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 0.5rem;
}

.google-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.google-play-btn svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.btn-text-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.btn-sub {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
}

.btn-main {
  font-size: 1.15rem;
  font-weight: 900;
}

/* Hero Stats Ribbon */
.hero-stats-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  width: 100%;
  margin-top: 1.5rem;
}

.stat-chip {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--panel-bg);
  border: 2px solid var(--chocolate);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--panel-slab);
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--chocolate);
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-transform: uppercase;
}

/* Hero Visual Showcase */
.hero-visual-col {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-diorama-card {
  width: 100%;
  max-width: 440px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  background: linear-gradient(180deg, #FFFDF8 0%, #FFF5E1 100%);
  border: 3px solid var(--chocolate);
  border-radius: 28px;
  box-shadow: 0 8px 0 var(--panel-slab), 0 20px 40px rgba(62, 24, 32, 0.12);
}

.hero-main-diorama {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(62, 24, 32, 0.18));
  animation: floatDiorama 6s ease-in-out infinite;
}

@keyframes floatDiorama {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

/* Floating Badges around Hero */
.floating-mini-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  background: var(--panel-bg);
  border: 2px solid var(--chocolate);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--panel-slab), 0 8px 16px rgba(0,0,0,0.06);
  z-index: 5;
  animation: floatBob 4s ease-in-out infinite;
}

.floating-mini-card img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.float-top-left {
  top: -15px;
  left: -20px;
  animation-delay: 0.3s;
}

.float-bottom-right {
  bottom: -15px;
  right: -15px;
  animation-delay: 1.2s;
}

@keyframes floatBob {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

/* ==========================================================================
   INTERACTIVE IN-BROWSER PUZZLE SECTION
   ========================================================================== */
.puzzle-demo-section {
  padding: 4.5rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.4rem;
  color: var(--chocolate);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-desc {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Puzzle Stage Container */
.puzzle-stage-panel {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem;
  background: var(--panel-bg);
  border: 3px solid var(--chocolate);
  border-radius: 26px;
  box-shadow: 0 8px 0 var(--panel-slab), 0 20px 40px rgba(62, 24, 32, 0.08);
}

.puzzle-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px dashed #E0D4BE;
}

.level-picker-wrap {
  display: flex;
  gap: 6px;
}

.puzzle-board-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

/* Board Cavity (Wooden Inset Grid) */
.board-frame {
  background: #EFE4CE;
  border: 3px solid var(--chocolate);
  border-radius: 20px;
  padding: 16px;
  box-shadow: inset 0 4px 8px rgba(62, 24, 32, 0.15), 0 4px 0 #D4C3A3;
  display: flex;
  justify-content: center;
  align-items: center;
}

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(4, 56px);
  grid-template-rows: repeat(4, 56px);
  gap: 6px;
  user-select: none;
}

.grid-cell {
  width: 56px;
  height: 56px;
  background: #E3D5BC;
  border: 2px solid rgba(62, 24, 32, 0.35);
  border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(62, 24, 32, 0.2);
  transition: all 0.15s ease;
  position: relative;
  cursor: pointer;
}

.grid-cell.highlight-valid {
  background: #BBF7D0;
  border-color: #16A34A;
  box-shadow: inset 0 0 8px rgba(74, 222, 128, 0.6);
}

.grid-cell.highlight-invalid {
  background: #FECDD3;
  border-color: #E11D48;
}

/* Filled Toy Block Cell */
.grid-cell.filled {
  border: 2.5px solid var(--chocolate);
  border-radius: 12px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), 0 2px 0 rgba(0,0,0,0.2);
}

/* Block Drawer (Trays) */
.blocks-drawer {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--chocolate);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blocks-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  min-height: 120px;
  padding: 1rem;
  background: #FDF9EE;
  border: 2px dashed #DCCEB4;
  border-radius: 16px;
  align-items: center;
  justify-content: center;
}

/* Polyomino Block Toy Representation */
.toy-block {
  display: inline-grid;
  gap: 3px;
  cursor: pointer;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 12px;
  transition: transform 0.12s var(--spring-bounce), filter 0.15s ease;
  position: relative;
  touch-action: none;
}

.toy-block:hover {
  transform: scale(1.06) translateY(-2px);
}

.toy-block.selected {
  border: 2.5px dashed var(--chocolate);
  background: rgba(255, 229, 92, 0.35);
  transform: scale(1.1) translateY(-4px);
  filter: drop-shadow(0 6px 12px rgba(62, 24, 32, 0.18));
}

.toy-block-unit {
  width: 28px;
  height: 28px;
  border: 2px solid var(--chocolate);
  border-radius: 7px;
  position: relative;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), 0 2px 0 rgba(0,0,0,0.15);
}

/* Block Unit Color Variations */
.unit-gold   { background: var(--gold-base);   box-shadow: inset 0 2px 0 #FFF08A, 0 2px 0 var(--gold-slab); }
.unit-green  { background: var(--green-base);  box-shadow: inset 0 2px 0 #86EFAC, 0 2px 0 var(--green-slab); }
.unit-sky    { background: var(--sky-base);    box-shadow: inset 0 2px 0 #B0DDFF, 0 2px 0 var(--sky-slab); }
.unit-purple { background: var(--purple-base); box-shadow: inset 0 2px 0 #DFBAFF, 0 2px 0 var(--purple-slab); }
.unit-peach  { background: var(--peach-base);  box-shadow: inset 0 2px 0 #FFD1D6, 0 2px 0 var(--peach-slab); }
.unit-orange { background: var(--orange-base); box-shadow: inset 0 2px 0 #FFCB8E, 0 2px 0 var(--orange-slab); }

/* Win Overlay Banner */
.puzzle-win-overlay {
  display: none;
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: #ECFDF5;
  border: 2.5px solid #059669;
  border-radius: 18px;
  box-shadow: 0 4px 0 #047857;
  text-align: center;
  animation: popIn 0.3s var(--spring-bounce);
}

.puzzle-win-overlay.active {
  display: block;
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   FEATURES TABS SECTION (COZY STUDIO STANDARD)
   ========================================================================== */
.features-section {
  padding: 4.5rem 0;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 245, 225, 0.6) 100%);
}

.feature-tab-content-panel {
  margin-top: 2rem;
  padding: 2.5rem;
  background: var(--panel-bg);
  border: 3px solid var(--chocolate);
  border-radius: 26px;
  box-shadow: 0 8px 0 var(--panel-slab), 0 20px 40px rgba(62, 24, 32, 0.08);
}

.tab-pane {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.tab-pane.active {
  display: grid;
  animation: fadeInPane 0.25s ease-out;
}

@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-text-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tab-heading {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.1rem;
  color: var(--chocolate);
  line-height: 1.15;
}

.tab-desc {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--chocolate-soft);
  line-height: 1.6;
}

.feature-bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--chocolate);
}

.bullet-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.tab-visual-col {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.tab-visual-img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(62, 24, 32, 0.15));
}

/* ==========================================================================
   MAGICAL BOOSTERS GRID
   ========================================================================== */
.boosters-section {
  padding: 4.5rem 0;
}

.boosters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.booster-card {
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  cursor: pointer;
}

.booster-icon-wrap {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-cream);
  border: 2px solid var(--chocolate);
  border-radius: 20px;
  box-shadow: 0 4px 0 var(--panel-slab);
  transition: transform 0.2s var(--spring-bounce);
}

.booster-card:hover .booster-icon-wrap {
  transform: scale(1.12) rotate(4deg);
}

.booster-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.booster-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--chocolate);
}

.booster-desc {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ==========================================================================
   INTERACTIVE SOUNDBOARD SECTION
   ========================================================================== */
.soundboard-section {
  padding: 4.5rem 0;
  background: #FFF7E6;
  border-top: 2.5px solid var(--chocolate);
  border-bottom: 2.5px solid var(--chocolate);
}

.soundboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

.sound-card {
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.sound-play-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2.5px solid var(--chocolate);
  background: var(--gold-base);
  box-shadow: 0 3px 0 var(--gold-slab);
  font-size: 1.3rem;
  transition: transform 0.12s var(--spring-bounce);
  overflow: hidden;
}

.sound-card:hover .sound-icon-img {
  transform: scale(1.15) rotate(3deg);
  transition: transform 0.2s var(--spring-bounce);
}

.sound-card:active .sound-play-icon {
  transform: scale(0.92);
}

.sound-title {
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--chocolate);
}

.sound-hint {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* ==========================================================================
   LEVEL EDITOR SHOWCASE & COMMUNITY CODES
   ========================================================================== */
.community-section {
  padding: 4.5rem 0;
}

.community-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.code-card-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.code-share-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--panel-bg);
  border: 2px solid var(--chocolate);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--panel-slab);
  transition: transform 0.15s ease;
}

.code-share-card:hover {
  transform: translateX(4px);
}

.code-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.code-preview-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid var(--chocolate);
  background: #FFF5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.code-name {
  font-weight: 900;
  font-size: 1rem;
  color: var(--chocolate);
}

.code-author {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.code-tag {
  font-family: monospace;
  font-weight: 800;
  font-size: 1rem;
  background: #F3E8D0;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--chocolate);
  color: var(--chocolate);
}

/* ==========================================================================
   DOWNLOAD CTA SECTION
   ========================================================================== */
.download-section {
  padding: 5rem 0 6rem;
  position: relative;
}

.cta-banner-panel {
  padding: 3.5rem;
  background: linear-gradient(135deg, #FFFDF8 0%, #FFF5E1 100%);
  border: 3.5px solid var(--chocolate);
  border-radius: 32px;
  box-shadow: 0 10px 0 var(--panel-slab), 0 24px 50px rgba(62, 24, 32, 0.12);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.cta-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cta-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.8rem;
  line-height: 1.1;
  color: var(--chocolate);
}

.cta-desc {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--chocolate-soft);
  line-height: 1.6;
}

.cta-visual-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.cta-visual-img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(62, 24, 32, 0.2));
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: #F8F1DF;
  border-top: 2.5px solid var(--chocolate);
  padding: 3rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-desc {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
  max-width: 320px;
}

.footer-col-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--chocolate);
  margin-bottom: 1rem;
}

.footer-link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-link {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--chocolate-soft);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--chocolate);
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1.5px dashed #DCCEB4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ==========================================================================
   MODAL DIALOGS (COZY STUDIO STANDARD)
   ========================================================================== */
.cozy-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(62, 24, 32, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.cozy-modal-backdrop.active {
  display: flex;
}

.cozy-modal-card {
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--panel-bg);
  border: 3.5px solid var(--chocolate);
  border-radius: 26px;
  box-shadow: 0 10px 0 var(--panel-slab), 0 24px 60px rgba(0, 0, 0, 0.25);
  padding: 2rem;
  position: relative;
  animation: modalPop 0.25s var(--spring-bounce);
}

@keyframes modalPop {
  from { transform: scale(0.88); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px dashed #E0D4BE;
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--chocolate);
}

.modal-corner-close {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  padding: 0;
  background: var(--peach-base);
  box-shadow: 0 2px 0 var(--peach-slab);
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  border: 2.5px solid var(--chocolate);
  line-height: 1;
}

.modal-corner-close:hover {
  transform: scale(1.08);
}

.modal-corner-close:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 transparent;
}

.modal-dismiss-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 900;
  border-radius: 14px;
  cursor: pointer;
}

.modal-body {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--chocolate-soft);
  line-height: 1.6;
}

.modal-body h4 {
  font-family: var(--font-display);
  color: var(--chocolate);
  margin: 1.2rem 0 0.4rem;
  font-size: 1.15rem;
}

/* ==========================================================================
   CONFETTI CANVAS
   ========================================================================== */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content {
    align-items: center;
  }
  .hero-subtitle {
    margin: 0 auto;
  }
  .hero-title {
    font-size: 2.8rem;
  }
  .hero-cta-group {
    justify-content: center;
  }
  .hero-stats-ribbon {
    grid-template-columns: repeat(2, 1fr);
  }
  .puzzle-board-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .tab-pane {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .tab-text-col {
    align-items: center;
  }
  .boosters-grid,
  .soundboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .community-grid,
  .cta-banner-panel {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .cta-content {
    align-items: center;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-brand-img {
    height: 44px;
    max-width: 135px;
  }
  .footer-brand-img {
    height: 64px;
    max-width: 190px;
  }
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .hero-title {
    font-size: 2.3rem;
  }
  .puzzle-grid {
    grid-template-columns: repeat(4, 46px);
    grid-template-rows: repeat(4, 46px);
  }
  .grid-cell {
    width: 46px;
    height: 46px;
  }
  .boosters-grid,
  .soundboard-grid {
    grid-template-columns: 1fr;
  }
  .cta-banner-panel {
    padding: 2rem 1.5rem;
  }
  .cta-title {
    font-size: 2.1rem;
  }
}
