* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    position: relative; /* delete this one and one below if wonky */
    min-height: 100vh; /* Ensures the body is at least as tall as the viewport */
    background-color: #0d033a; /* New color */
    font-family: Arial, sans-serif;
    text-align: center;
}

/* Prevent horizontal scrolling */
html, body {
    overflow-x: hidden;
    width: 100%;
}


#farbackground {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  background-image: url('../images/gimp_skyrework.png'); /* Correct path */
  background-repeat: repeat-x;
  background-size: 100% 100%;
  background-position: top left;
  z-index: -1;
}

#animated-banner {
    position: absolute; /* Ensures it stays at the top */
    top: 0;
    left: 0;
    width: 100vw; /* Full width of the viewport */
    height: 477px; /* Matches the height of your GIF */
    background-image: url('../images/Starryskybg.gif'); /* Corrected path */
    background-repeat: repeat-x; /* Ensures it repeats horizontally */
    background-size: auto 100%; /* Keeps original size and prevents stretching */
    z-index: -1; /* Ensures it stays behind content */
    pointer-events: none; /* Prevents interaction issues */
}

#clouds-corner {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100vw; /* Matches the width of #mountain-tile */
    height: 525px; /* Same height as #mountain-tile */
    background-image: url('../images/Cloudscorner.png'); /* Ensure correct path */
    background-repeat: no-repeat; /* Prevents tiling */
    background-size: auto 100%; /* Keeps height fixed */
    z-index: -1; /* Places it behind #mountain-tile */
}

#clouds-corner-right {
    position: absolute;
    bottom: 0;
    right: 0; /* Flush with the right side */
    width: 100vw; /* Matches #mountain-tile */
    height: 525px; /* Same height as #mountain-tile */
    background-image: url('../images/Cloudscorner.png'); /* Same image */
    background-repeat: no-repeat; /* Prevents tiling */
    background-size: auto 100%; /* Keeps height fixed */
    transform: scaleX(-1); /* Flips the image horizontally */
    z-index: -1; /* Same layer as #clouds-corner */
}

#mountain-tile {
    position: absolute;
    bottom: 0;
    width: 100vw; /* Stretches across full width */
    height: 525px; /* Adjust as needed */
    background-image: url('../images/Mountaintile.png'); /* Ensure correct path */
    background-repeat: repeat-x; /* Tiles left to right */
    background-size: auto 100%; /* Keeps height fixed while tiling */
    z-index: -1; /* Moves it behind other content */
}

#grass-tile {
    position: absolute;
    bottom: 0;
    width: 100vw; /* Stretches across full width */
    height: 175px; /* Adjust as needed */
    background-image: url('../images/Grasstile.png'); /* Ensure correct path */
    background-repeat: repeat-x; /* Tiles left to right */
    background-size: auto 100%; /* Keeps height fixed while tiling */
}

#flower-strip {
    position: absolute;
    bottom: 0px; /* height of your grass tile */
    width: 100vw;
    height: 175px;
    background-image: url('../images/flowertile.png'); /* update if needed */
    background-repeat: repeat-x;
    background-size: auto 300px;
    pointer-events: none; /* allows interaction to pass through */
    z-index: 1; /* make sure it's above grass */
}

::selection {
    background-color: #fffbaa;
    text-shadow:
        1px 1px 0 red,
        -1px -1px 0 orange,
        1px -1px 0 yellow,
        -1px 1px 0 green,
        2px 0px 0 blue,
        -2px 0px 0 indigo,
        0px 1px 0 violet;
    color: white;
}

/* Header styling */
header {
    padding: 0; /* Removes all padding */
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 1rem;
    margin: 20px auto;
    margin-bottom: 0;
    width: 90%; /* Takes 90percent width on small screens */
    max-width: 1170px; /* Prevents it from getting too wide */
}

header a img {
    width: 300px;
    height: auto;
}

header h1 {
    font-family: "ChalkboardSE", "Comic Sans MS", Arial, sans-serif;
    font-size: 2rem;
    font-style: italic;
    color: #77d7e2;
}

.header-container {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
}

.imagecontainer {
  width: 150px;
  height: auto;
  display: inline-block;
  position: relative;
  top: 10px;  
}

.imagecontainer img {
  width: 100%;
  height: auto;
  display: block;
}

.fluffleimage {
  width: 128px;
  height: 128px;
}

.navbar-avatar-wrapper {
  width: 150px;
  height: 150px;
  position: relative;
  border: 2px solid red;
  overflow: hidden;
}

.navbar-avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fluffleimage {
  width: 90%;
  max-width: 1170px;
  margin: 0 auto;
}

/* Navbar styling */
.navbar {
     z-index: 1000; /* high value so it floats above */
    display: flex;
    width: 90%;
    max-width: 1170px;
    margin: 0 auto;
    height: 75px;
}

.navbar a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 30px;
    font-family: "ChalkboardSE", "Comic Sans MS", Arial, sans-serif;
    font-weight: bold;
    color: white;
    height: 100%;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-shadow:
        1px 1px 0 #23003e,
        -1px 1px 0 #23003e,
        1px -1px 0 #23003e,
        -1px -1px 0 #23003e,
        1px 0 0 #23003e,
        -1px 0 0 #23003e,
        0 1px 0 #23003e,
        0 -1px 0 #23003e;
}

/* Animation and hover effect */
.navbar.animate-navbar a {
  animation: fadeInScale 0.5s ease forwards;
}

.navbar.animate-navbar a:nth-child(1) { animation-delay: 0s; }
.navbar.animate-navbar a:nth-child(2) { animation-delay: 0.1s; }
.navbar.animate-navbar a:nth-child(3) { animation-delay: 0.2s; }
.navbar.animate-navbar a:nth-child(4) { animation-delay: 0.3s; }
.navbar.animate-navbar a:nth-child(5) { animation-delay: 0.4s; }
.navbar.animate-navbar a:nth-child(6) { animation-delay: 0.5s; }
.navbar.animate-navbar a:nth-child(7) { animation-delay: 0.6s; }

.navbar a:hover {
    transform: scale(1.1);
}

.navbar a:nth-child(1) { background-color: #a73234; }
.navbar a:nth-child(1):hover { background-color: #ff0000; }

.navbar a:nth-child(2) { background-color: #b0681b; }
.navbar a:nth-child(2):hover { background-color: #ff8000; }

.navbar a:nth-child(3) { background-color: #bca421; }
.navbar a:nth-child(3):hover { background-color: #ffff00; }

.navbar a:nth-child(4) { background-color: #71b331; }
.navbar a:nth-child(4):hover { background-color: #00ff00; }

.navbar a:nth-child(5) { background-color: #2636bc; }
.navbar a:nth-child(5):hover { background-color: #0000ff; }

.navbar a:nth-child(6) { background-color: #4f1eac; }
.navbar a:nth-child(6):hover { background-color: #6600ff; }

.navbar a:nth-child(7) { background-color: #9c2eb5; }
.navbar a:nth-child(7):hover { background-color: #e100ff; }

.footer-container {
    width: 90%;
    max-width: 1170px;
    margin: 0 auto;
    background-color: yellow;
    border: 2px solid black;
    text-align: center;
    padding: 20px;
}

.bottom-bumper {
    width: 1170px;
    height: 150px;
    margin: 0 auto;
    background: transparent;
    border: none;
    display: block;
}

.page-title {
    font-family: "Book Antiqua", "Times New Roman", Times, serif;
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    position: sticky;
    top: 0;
    padding: 20px 0;
    z-index: 10;
}

.fluffle-preview {
  position: relative;
  width: 128px;
  height: 128px;
  margin-top: 10px;
}

.fluffle-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

.shadow-layer {
  mix-blend-mode: multiply;
  opacity: 0.7;
}

.logo-container {
    position: relative;
    display: inline-block;
}

.main-logo {
    display: block;
    max-width: 100%;
    height: auto;
}

.moon-overlay {
    position: absolute;
    top: 40px;
    left: 230px;
    width: 75px;
    height: auto;
    pointer-events: none;
}

#user-cart-box {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    z-index: 1000;
    font-family: 'Chalkboard SE', 'Comic Sans MS', Arial, sans-serif;
}

#user-cart-box .cart-icon {
    font-size: 1.5rem;
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
}

#user-cart-box .login-link,
#user-cart-box .signup-link,
#user-cart-box .or-text {
    font-size: 1.5rem;
    color: #bfa1ff;
    font-family: 'Chalkboard SE', 'Comic Sans MS', Arial, sans-serif;
}

.auth-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-dropdown {
  position: relative;
  display: inline-block;
}

.profile-trigger {
  cursor: pointer;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;     
  right: 0;
  background: #0f0237;         
  border: 2px solid #baa2f9;   
  border-radius: 8px;
  min-width: 140px;
  margin-top: 8px;
  padding: 0;
  list-style: none;
  opacity: 0;          
  visibility: hidden;  
  transform: translateY(-10px);
  transition: all 0.25s ease;
  z-index: 1000;
}

.dropdown-menu li a {
  display: block;
  padding: 10px 14px;
  font-family: "ChalkboardSE", "Comic Sans MS", Arial, sans-serif;
  text-decoration: none;
  color: #baa2f9;
}

.dropdown-menu li a:hover {
  background: rgba(186,162,249,0.15);
}

.profile-dropdown:hover .dropdown-menu,
.profile-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 🎯 Fluffle avatar unified control */
.fluffle-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #baa2f9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  position: relative;
}

/* Ensure container doesn’t mess sizing */
.fluffle-avatar #profile-pic-container {
  width: 100%;
  height: 100%;
}

/* Force image to scale nicely inside */
.fluffle-avatar #profile-pic-container img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

.cart-icon-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.fluffle-name {
    color: #baa2f9;
    font-size: 1.2rem;
    font-weight: bold;
  }

/* Extra small phones (<480px) */
@media screen and (max-width: 480px) {
  body { font-size: 14px; }

  header h1 { font-size: 1rem; }

  header a img {
    max-height: 70px;
    width: auto;
    display: block;
  }

  .navbar a { font-size: 1rem; }

  #user-cart-box .fluffle-name {
    color: #baa2f9;
    font-size: 0.8rem;
    font-weight: bold;
  }

  .page-title { font-size: 1.25rem; }

  .imagecontainer img {
    position: relative;
    top: 17px;
  }

  .content-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  #user-cart-box .login-link,
  #user-cart-box .signup-link,
  #user-cart-box .or-text {
    font-size: 1rem;
  }

  #user-cart-box .cart-icon-img {
    width: 32px;
    height: 32px;
  }

  .fluffle-avatar {
    width: 24px;
    height: 24px;
  }

  .moon-overlay {
    width: 25px;
    height: auto;
    top: 10px;
    left: 50px;
  }
  .navbar {
    width: 100%;
    height: 50px;
}
}

/* Tablets (481px – 768px) */
@media screen and (min-width: 481px) and (max-width: 768px) {
  body { font-size: 15px; }

  header h1 { font-size: 1.3rem; }

  header a img {
    max-height: 90px;
    width: auto;
  }

  .navbar a { font-size: 0.95rem; }

  #user-cart-box .fluffle-name {
    font-size: 0.9rem;
    font-weight: bold;
  }

  .page-title { font-size: 1rem; }

  .fluffle-avatar {
    width: 48px;
    height: 48px;
  }

  .cart-icon-img {
    width: 48px;
    height: 48px;
  }
}

/* Small laptops (769px – 1200px) */
@media screen and (min-width: 769px) and (max-width: 1200px) {
  body { font-size: 16px; }

  header h1 { font-size: 1.5rem; }

  header a img {
    max-height: 120px;
    width: auto;
  }

  .navbar a { font-size: 2rem; }

  #user-cart-box .fluffle-name {
    font-size: 1rem;
    font-weight: bold;
  }

  .page-title { font-size: 1.75rem; }

  .fluffle-avatar {
    width: 24px;
    height: 24px;
  }

  .cart-icon-img {
    width: 60px;
    height: 60px;
  }
}
