:root {
  --green: #0F2319;
  --lime: #00E100;
  --mint: #46DCA5;
  --cyan: #00E6FB;
  --blue: #0091FF;
  --purple: #9664FF;
  --lemon: #E6E623;
  --pink: #FF3284;
  --red: #FF4B41;
  --orange: #FF7D00;
  --yellow: #FFBE23;
  --black: #000000;
  --white: #FFFFFF;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  /* Use small viewport height */
  margin: 0;
  background-color: #f0f0f0;
  font-family: sans-serif;
  overflow: hidden;
  /* Prevents scrollbars during scaling */
}

#crystal-matt-button {
  padding: 25px 50px;
  /* Increased padding */
  font-size: 2.5em;
  /* Increased font size */
  cursor: pointer;
  border: none;
  border-radius: 8px;
  /* Slightly increased border-radius */
  position: absolute;
  z-index: 10;
  font-family: "Carloschi", sans-serif;
  font-weight: bold;
  /* Make button text bold */
  /* Colors are set by JavaScript */
  max-width: 80vw;
  /* Limit button width */
  white-space: nowrap;
  /* Prevent text wrapping */
  overflow: hidden;
  /* Hide overflowing text if font adjustment isn't enough */
  text-overflow: ellipsis;
  /* Show ellipsis if text still overflows */
}

/* Add media query for smaller screens */
@media (max-width: 768px) {
  #crystal-matt-button {
    padding: 18px 20px; /* Slightly reduce padding further */
    font-size: 1.7em;   /* REDUCED font size further for mobile */
  }
}

#text-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100svh;
  /* Use small viewport height */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Important for scaling text */
  padding: 20px;
  /* Add some padding */
  box-sizing: border-box;
  /* Include padding in width/height */
}

#text-display {
  display: inline-block;
  /* Allows for better scaling and wrapping */
  text-align: center;
  font-weight: bold;
  color: #333;
  transition: font-size 0.5s ease-in-out, opacity 0.5s ease-in-out;
  /* Smooth scaling and fading */
  opacity: 0;
  /* Start hidden */
  line-height: 1;
  /* Adjust for tighter packing */
  will-change: font-size, opacity;
  /* Optimize for animations */
  text-transform: uppercase;
  /* Make text uppercase */
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* Specify font family */
}

/* App Header Styles */
#app-header {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  /* Vertically align image and text block */
  width: 35%;
  /* Increased width slightly */
  max-width: 550px;
  /* INCREASED max-width significantly */
  z-index: 20;
}

.header-image-wrapper {
  flex-shrink: 0;
  /* Prevent image wrapper from shrinking */
  margin-right: 15px;
  display: flex;
  /* Added to help center image if needed, though height/width should control it */
  align-items: center;
  justify-content: center;
}

#app-header img {
  /* Styles moved from #app-header img to .header-image-wrapper img if specific to img */
  height: 10svh;
  max-height: 100px;
  /* REDUCED max-height for the image itself to prevent it from becoming too large */
  width: auto;
}

#app-header .header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Center text vertically within its container */
  text-align: left;
  flex-grow: 1;
  /* Allow text to take available space */
  min-width: 0;
  /* Important for flex items to allow shrinking below content size */
  /* height: 10svh; // Removed, let content define height, align with image via parent flex */
  /* max-height: 200px; // Removed */
  overflow: visible;
  /* Changed from hidden to visible to see if text was being cut off */
}

#app-header .header-text h1 {
  margin: 0;
  font-size: 2.2vw;
  /* Adjusted vw unit */
  font-weight: bold;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke-width: 1px;
  -webkit-text-stroke-color: var(--white);
  line-height: 1.1;
  white-space: nowrap;
  /* Prevent wrapping for h1 */
}

#app-header .header-text p {
  margin: 0;
  font-size: 1.1vw;
  /* Adjusted vw unit */
  color: var(--white);
  line-height: 1.1;
  white-space: nowrap;
  /* Prevent wrapping for p */
}

/* Responsive adjustments for App Header */
@media (max-width: 768px) {
  #app-header {
    width: 80%;
    /* Increased width for mobile */
    max-width: 550px;
    /* Max width can remain, or be adjusted if needed for mobile */
    top: 15px;
    left: 15px;
  }

  .header-image-wrapper {
    margin-right: 10px;
  }

  #app-header img {
    max-height: 80px;
    /* Adjust max-height for image on mobile */
  }

  #app-header .header-text h1 {
    font-size: 4.5vw;
    /* Adjusted vw unit for mobile */
    -webkit-text-stroke-width: 0.5px;
  }

  #app-header .header-text p {
    font-size: 2.2vw;
    /* Adjusted vw unit for mobile */
  }
}