@import url('https://fonts.googleapis.com/css2?family=League+Spartan:wght@500;700;800;900&family=Montserrat:wght@400;500;700&display=swap');
/* ==========================================================================
   1. GLOBAL RESET & SCROLL PREVENT
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  font-family: 'Montserrat', sans-serif;
  overflow: hidden; /* Strict lock to prevent page scrolling */
  background-color: #000;
}

/* ==========================================================================
   2. SCREEN BASE WRAPPERS (STRICT VIEWPORT LIMITS)
   ========================================================================== */
.app-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: none; 
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 130px 6% 30px 6%; /* Top padding leaves clear space for headers */
  z-index: 1;
  overflow: hidden;
}

.app-screen.active {
  display: flex;
}

/* Background Color Themes */
.bg-emerald { background-color: #0d7c66; }
.bg-terracotta { background-color: #cb5a43; }
.bg-pink { background-color: #cd7091; }

/* ==========================================================================
   3. PERFECT HEADER BORDERS (EXACTLY 7 REPEATING IMAGES, NO CLASHING)
   ========================================================================== */
.pixel-border-row {
  position: absolute;
  top: 15px;
  left: 3%;
  width: 94%;
  height: 110px; 
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
  pointer-events: none;
  overflow: visible; /* Prevents the outer edge images from being cut off */
}

.fish-border::before, 
.butterfly-border::before, 
.flowers-top-border::before {
  content: "";
  width: 100%;
  height: 100%;
  display: block;
  background-repeat: no-repeat;
}

/* ==========================================================================
   DYNAMIC SCALING FOR DESKTOP & TABLETS
   ========================================================================== */

/* 1. Large Screens (Desktops & Large Laptops) */
@media (min-width: 1200px) {
  .fish-border::before {
    background-size: 135px auto; /* Big, tight spacing */
  }
  .butterfly-border::before, 
  .flowers-top-border::before {
    background-size: 140px auto;
  }
}

/* 2. Medium Screens (Small Laptops & Tablets) */
@media (max-width: 1199px) and (min-width: 769px) {
  .pixel-border-row {
    height: 85px; /* Shorter header height for smaller screens */
    top: 12px;
  }
  .fish-border::before, 
  .butterfly-border::before, 
  .flowers-top-border::before {
    background-size: contain; /* fits fully within the row's height, no more top/bottom clipping */
  }
}

/* Screen 1 & 4: Fishes (4 Green, 3 Yellow Alternating) */
.fish-border::before {
  background-image: 
    url('assets/borderfish1.png'), 
    url('assets/borderfish2.png'), 
    url('assets/borderfish1.png'), 
    url('assets/borderfish2.png'), 
    url('assets/borderfish1.png'), 
    url('assets/borderfish2.png'), 
    url('assets/borderfish1.png'); 
  background-repeat: no-repeat;
  background-size: 155px auto;
  background-position: 
    0% center,
    16.66% center,
    33.33% center,
    50% center,
    66.66% center,
    83.33% center,
    100% center;
}

/* Screen 2 & 5: Butterflies (7 Alternating Butterflies) */
.butterfly-border::before {
  background-image: 
    url('assets/borderbutterfly1.png'),
    url('assets/borderbutterfly2.png'),
    url('assets/borderbutterfly1.png'),
    url('assets/borderbutterfly2.png'),
    url('assets/borderbutterfly1.png'),
    url('assets/borderbutterfly2.png'),
    url('assets/borderbutterfly1.png');
  background-repeat: no-repeat;
  background-size: 155px auto;
  background-position: 
    0% center,
    16.66% center,
    33.33% center,
    50% center,
    66.66% center,
    83.33% center,
    100% center;
}

/* Screen 6: Flowers (7 Alternating Yellow & Purple Flowers) */
.flowers-top-border::before {
  background-image: 
    url('assets/borderflower1.png'), 
    url('assets/borderflower2.png'), 
    url('assets/borderflower1.png'), 
    url('assets/borderflower2.png'), 
    url('assets/borderflower1.png'), 
    url('assets/borderflower2.png'), 
    url('assets/borderflower1.png');
  background-repeat: no-repeat;
  background-size: 155px auto;
  background-position: 
    0% center,
    16.66% center,
    33.33% center,
    50% center,
    66.66% center,
    83.33% center,
    100% center;
}

/* ==========================================================================
   4. LAYOUT DESIGN SYSTEM (NEVER OUT-OF-BOUNDS)
   ========================================================================== */
.screen-content {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: calc(100vh - 160px); /* Strictly locks heights so elements can't overflow screen */
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 5;
}

.split-layout {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.left-column {
  flex: 1;
  max-width: 55%; /* Description matches the header width exactly */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.right-column {
  flex: 1;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ==========================================================================
   5. TYPOGRAPHY
   ========================================================================== */
.title-main {
  font-family: 'League Spartan', sans-serif;
  font-size: 8rem; /* Massive, fits screen size proportions */
  font-weight: 900;
  color: #ffffff; /* White title text */
  margin-bottom: 10px;
  line-height: 1;
  letter-spacing: -2px;
  white-space: nowrap;
}

.title-heading {
  font-family: 'League Spartan', sans-serif;
  font-size: 6rem; /* Massive header */
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 25px;
  line-height: 1.0;
  white-space: nowrap;
}

.subtitle-text {
  font-size: 1.65rem;
  font-weight:400;
  color: #ffffff; /* White description text to match title exactly */
  line-height: 1.5;
  margin-bottom: 35px;
}

.body-text {
  font-size: 1.55rem;
  font-weight: 400;
  color: #ffffff;
  line-height: 1.5;
  margin-bottom: 35px;
}

/* ==========================================================================
   6. PILLED BUTTONS & INTERACTIVE COMPONENT SHAPES
   ========================================================================== */
.btn {
  border: none;
  font-family: 'League Spartan', sans-serif;
  font-weight: 900;
  cursor: pointer;
  border-radius: 100px; /* Perfect pill shape */
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn:hover {
  transform: scale(1.05);
}

.btn-large {
  padding: 22px 65px;
  font-size: 1.8rem;
  min-width: 280px;
}

.btn-terracotta { background-color: #cc543a; color: white; }
.btn-purple { background-color: #c483b4; color: white; }
.btn-green-dark { background-color: #006b54; color: white; }

/* ==========================================================================
   7. SPECIFIC SCREENS COMPONENT DESIGN
   ========================================================================== */

/* --- SCREEN 3: QUIZ (RESTORED PERFECT GRID & DROPDOWN SIZES) --- */
.question-layout {
  justify-content: flex-start;
  padding: 10px 0;
}

.questions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; 
  column-gap: 80px;
  row-gap: 30px;
  width: 100%;
  align-items: flex-start; 
}

.form-item {
  display: flex;
  flex-direction: column;
}

/* Keeps ALL questions perfectly aligned as equal blocks */
.full-width-q {
  grid-column: span 1; 
  width: 100%;
}

.q-label {
  color: white;
  font-family: 'League Spartan', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.2;
  min-height: 85px; /* Adjust this height so it easily fits your longest question text */
}

/* Uniform, aligned dropdown sizing */
.custom-select {
  background-color: #fff9e6;
  border: none;
  padding: 18px 24px;
  border-radius: 100px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem;
  color: #aa6580;
  font-weight: 700;
  outline: none;
  width: 100%;
  height: 85px; /* Fixed height forces absolute consistency */
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* Question screen footer positioning layout */
.question-footer {
  width: 100%;
  height: 100px;
  margin-top: 30px;
  position: relative; 
  display: flex;
  justify-content: right; 
  align-items: center;
}

.calculate-btn {
  padding: 40px 60px;
  font-size: 1.5rem;
  z-index: 10;
  margin-bottom: 150px; /* Nudges the button 150px upward on desktop */
}

/* --- SCREEN 4: RESULTS SCREEN --- */
.center-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  height: 100%;
}

.result-title {
  font-family: 'League Spartan', sans-serif;
  font-size: 2.5rem;
  color: white;
  margin-bottom: 5px;
}

.big-score-display {
  font-family: 'League Spartan', sans-serif;
  font-size: 8.5rem;
  font-weight: 800;
  color: white;
  margin: 5px 0;
}

.score-ranking-box {
  margin-bottom: 20px;
}

.rank-badge {
  font-family: 'League Spartan', sans-serif;
  font-size: 2rem;
  color: white;
  font-weight: 800;
  margin-bottom: 5px;
}

.rank-desc {
  font-size: 1.5rem;
  color: white;
}

.tips-trigger-btn {
  padding: 22px 55px;
  font-size: 1.6rem;
  z-index: 10;
  width: 450px;          /* 1. Forces them to be the EXACT same length */
  margin-bottom: 15px;   /* 2. Puts a clean 15px gap between them so they aren't stuck! */
}

/* --- SCREEN 5: TIPS SCREEN (3/4 WIDTH TEXTBOX & FIXED BUTTONS) --- */
.wide-left {
  max-width: 100% !important; 
}

.small-heading {
  font-size: 3.5rem; 
  margin-bottom: 20px;
}

.canva-tips-container {
  background-color: #fff8eb;
  color: #ca5d48;
  border-radius: 20px;
  padding: 25px;
  font-size: 1.3rem;
  line-height: 1.6;
  font-weight: 600;
  text-align: left;
  max-height: 350px;
  overflow-y: auto;
  margin-bottom: 30px;
  width: 900px;
}

.action-btn-row {
  display: flex;
  justify-content: space-between; 
  align-items: center;
  width: 100%;                    
  gap: 0px;                       
  margin-left: 0px;               
  margin-top: 30px;               
}

/* Restores large fat button shapes */
.btn-half {
  max-width: 280px;               
  width: 100%;
  padding: 22px 0; 
  font-size: 1.5rem;
  border-radius: 100px; 
  text-align: center;
}

.action-btn-row #backScore {
  order: 1; 
  margin-left: 10px; 
}

.action-btn-row #lastButton {
  order: 2;
  margin-right: 10px; 
}

/* --- SCREEN 6: THANK YOU SCREEN --- */
.custom-thank-layout {
  padding: 0 10%;
}

.thank-title {
  font-family: 'League Spartan', sans-serif;
  font-size: 7rem;
  color: white;
  margin-bottom: 15px;
}

.thank-body {
  font-size: 1.7rem;
  line-height: 1.6;
  color: white;
  margin-bottom: 35px;
  max-width: 800px;
}

.final-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 380px;
  z-index: 10;
}

.final-stacked-btn {
  padding: 22px 0;
  font-size: 1.7rem;
}


/* ==========================================================================
   9. CONSOLIDATED MOBILE STYLES (UNDER 768PX SCREEN WIDTH ONLY)
   ========================================================================== */
@media (max-width: 768px) {
  
  /* 1. Global Screen Padding & Perfect Vertical Centering */
  .app-screen {
    padding: 20px 6% !important; /* Balanced padding */
    justify-content: center !important; /* FIXED: Centers content vertically on all pages */
    overflow-y: auto !important; /* Allow scrolling on mobile screens */
  }

  .screen-content {
    height: auto !important; /* Allow mobile screen content to expand vertically */
    margin: auto 0 !important; /* Helps force perfect vertical centering */
  }

  /* 2. REMOVE HEADER BORDERS ON MOBILE ONLY */
  .pixel-border-row, 
  .fish-border::before, 
  .butterfly-border::before, 
  .flowers-top-border::before {
    display: none !important; /* Completely hides the headers on mobile */
  }

  /* 3. Stacking & Centering Layouts */
  .split-layout {
    flex-direction: column !important; /* Stacks layout elements vertically */
    justify-content: center !important;
    gap: 20px !important;
  }

  .left-column {
    max-width: 100% !important; /* Takes full width on mobile */
    text-align: center !important;
    align-items: center !important;
  }

  /* 4. Reduced Sizing for Titles, Emojis, & Descriptions */
  .title-main {
    font-size: 3.2rem !important; /* Shrunk from 8rem */
    white-space: normal !important;
  }
  /* Injects Seedling Emoji to Home Title on Mobile Only */
  .title-main::after {
    content: " 🌱";
  }

  #introScreen .title-heading {
    font-size: 2.2rem !important; /* Shrunk from 6rem */
    white-space: normal !important;
  }
  /* Injects Cherry Blossom Emoji to Intro Title on Mobile Only */
  #introScreen .title-heading::after {
    content: " 🌸";
  }

  /* FIXED: Shrinks "Tips and more!" Title & Injects Dizzy Star Emoji */
  .small-heading {
    font-size: 2.0rem !important; /* Shrunk from 3.5rem */
    margin-bottom: 15px !important;
  }
  .small-heading::after {
    content: " 💫";
  }

  /* Injects Jellyfish Emoji to Thank You Title on Mobile Only */
  .thank-title {
    font-size: 3rem !important;
  }
  .thank-title::after {
    content: " 🪼";
  }

  /* REDUCED: Home page description text size */
  .subtitle-text {
    font-size: 1.05rem !important; /* Shrunk from 1.65rem */
    margin-bottom: 25px !important;
    text-align: center !important;
  }

  /* REDUCED: Intro page description text size */
  .body-text {
    font-size: 1.05rem !important; /* Shrunk from 1.55rem */
    margin-bottom: 25px !important;
    text-align: center !important;
  }

  /* 5. Buttons Layouts & Scaling */
  .btn {
    width: 85% !important; /* Keeps mobile buttons within viewport boundaries */
    max-width: 320px !important;
    padding: 16px 0 !important;
    font-size: 1.2rem !important;
  }

  .btn-large {
    min-width: unset !important;
  }

  .tips-trigger-btn {
    width: 85% !important;
    max-width: 320px !important;
    padding: 16px 0 !important;
    font-size: 1.1rem !important;
  }

  /* 6. Quiz Grid & Select Dropdowns */
  .questions-grid {
    grid-template-columns: 1fr !important; /* Stacks questions in 1 column */
    row-gap: 15px !important;
  }

  .q-label {
    font-size: 1.2rem !important;
    min-height: unset !important;
    margin-bottom: 5px !important;
  }

  .custom-select {
    height: 48px !important; /* Slimmer inputs for mobile */
    font-size: 0.85rem !important; /* Decreased font size so "select one..." text fits */
    padding: 10px 15px !important;
  }

  .question-footer {
    height: auto !important; 
    justify-content: center !important; /* Center the button on mobile */
    margin-top: 20px !important;
  }

  .calculate-btn {
    margin-bottom: 0 !important; 
    padding: 16px 30px !important;
    font-size: 1.1rem !important;
    width: 85% !important;
  }

  /* 7. Tips Screen Adjustments & TextBox Text Styling */
  .canva-tips-container {
    width: 100% !important; /* Fits dynamically on mobile */
    max-height: 220px !important;
    font-size: 1.05rem !important; /* Cleaner font size inside the box */
    text-align: left !important; /* Clean, standard left alignment inside the tips box */
  }

  /* FIXED: Stacks "Back to Score" and "Next" perfectly on top of each other */
  .action-btn-row {
    display: flex !important;
    flex-direction: column !important; /* Stack vertically */
    align-items: center !important;
    width: 100% !important;
    gap: 12px !important; /* Clear spacing between the buttons */
    margin-top: 15px !important;
  }

  /* FIXED: Forces both buttons to have identical width, height, and balanced text on mobile */
  .btn-half {
    max-width: 320px !important; /* Matches main screen buttons */
    width: 85% !important; /* Spans exact same width */
    font-size: 1.1rem !important; /* Ensures BACK TO SCORE fits perfectly */
    padding: 16px 0 !important; /* Matches main button heights */
    margin: 0 !important; /* Resets desktop margin offsets */
  }

  /* 8. Thank You Screen Adjustments */
  .thank-body {
    font-size: 1.05rem !important;
    margin-bottom: 25px !important;
  }

  .final-buttons-stack {
    width: 100% !important;
    align-items: center !important;
  }

  .final-stacked-btn {
    width: 85% !important;
  }

  /* 9. Pixel Art Removals */
  .pixel-art {
    display: none !important; 
  }
  /* ==========================================================================
     10. NEW: FORCE QUESTIONS & RESULTS TO START FROM THE TOP ON MOBILE
     ========================================================================== */
  #questionScreen,
  #resultScreen {
    justify-content: flex-start !important;
    padding-top: 40px !important; /* Gap at the top */
  }
   
  #questionScreen .screen-content,
  #resultScreen .screen-content,
  #resultScreen .center-layout {
    margin: 0 !important;
    justify-content: flex-start !important;
  }
}

/* ==========================================================================
   GLOBAL DESKTOP SCROLLING & QUESTION SCREEN TOP-ALIGNMENT
   ========================================================================== */

/* 1. Enable vertical scrolling on ALL screens so content is never cut off */
.app-screen {
  overflow-y: auto !important;
}

/* 2. Top-align ONLY the Questions Screen */
#questionScreen {
  justify-content: flex-start !important;
}

#questionScreen .screen-content {
  justify-content: flex-start !important;
  height: auto !important; /* Lets questions expand vertically and scroll smoothly */
  padding-bottom: 60px; /* Gives nice breathing room at the bottom */
}
