/* Global Resets and Base */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: normal;
  font-style: normal;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: calc(50px + 1rem) 0 2rem;
}

/* Viewer Panel Layout */
.viewer-panel {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  max-width: 1200px;
  width: 100%;
  height: calc(100vh - 60px);
}

.right-column {
  display: flex;
  flex-direction: column;
  flex: 0.75;
  overflow-y: auto;
}

.viewer {
  flex: 1;
  height: 100%;
  background: transparent;
  border-radius: 1rem;
  overflow: hidden;
  transform-origin: center center;
}

/* Menu Toggle Button (Mobile Only) */
.menu-toggle {
  display: none;
  position: fixed;
  top: 60px;
  left: 1rem;
  z-index: 1002;
  background: #efca44;
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

.menu-toggle img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}

/* Selectors Panel */
.selectors-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex: 1;
  padding: 10px;
  overflow-y: auto;
}

/* Secret Container */
.secret-container {
  order: -1;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.secret-swatch {
  width: 3rem;
  aspect-ratio: 1;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  background-size: 200% 200%;
  box-shadow: inset 0 0 6px rgba(255,255,255,0.8), 0 2px 8px rgba(0,0,0,0.3);
  display: none;
  background: none;
  padding: 0;
}

.secret-swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.secret-swatch.unlocked {
  display: inline-block;
  animation: chromeShift 3s ease-in-out infinite;
}

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

/* Color Wheel Containers */
.color-wheel-container {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.8);
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
}

.selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
}

.selector-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
}

.mode-toggle {
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-toggle:hover {
  background: #e0e0e0;
  transform: rotate(45deg);
}

.mode-toggle svg {
  width: 12px;
  height: 12px;
  color: #666;
}

/* Color Mode Container */
.color-mode-container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mode-wheel,
.mode-swatches {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mode-wheel {
  display: flex;
  justify-content: center;
  align-items: center;
}

.mode-wheel:not(.active) {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

.mode-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  width: 100%;
  max-width: 180px;
  opacity: 0;
  transform: scale(0.9);
  position: absolute;
  top: 0;
  left: 50%;
  transform-origin: center center;
  transform: translateX(-50%) scale(0.9);
  pointer-events: none;
}

.mode-swatches.active {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

/* Color Wheel Styles */
.color-wheel {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.color-wheel canvas {
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.color-wheel-center {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  pointer-events: none;
  z-index: 2;
}

/* Swatches */
.head-swatch,
.body-swatch {
  width: 35px;
  height: 35px;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.head-swatch:hover,
.body-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Available Colors Section */
.color-selector {
  max-width: 18rem;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto repeat(2, 1fr);
  gap: 0.25rem;
  align-items: center;
  background: rgba(255,255,255,0.8);
  padding: 0.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
}

.color-selector .selector-label {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.both-swatch {
  width: 90%;
  aspect-ratio: 1;
  border: 1px solid #eee;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  justify-self: center;
}

.both-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(0,0,0,0.2);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .viewer-panel {
    flex-direction: column;
    align-items: center;
    /* Added to ensure it takes full available height */
    height: calc(100vh - 50px); /* 50px for header */
    padding-top: 1rem; /* Space below header */
  }
  .viewer {
    height: 25vh;    /* MODIFIED - reduced from 40vh for a smaller viewer */
    width: 90%;
    margin-bottom: 0.5rem; /* Space between viewer and controls */
  }

  .right-column {
    flex: 1; /* Allow right column to take remaining space */
    width: 90%; /* Match viewer width */
    overflow-y: auto; /* Allow scrolling for controls */
    display: flex;
    flex-direction: column;
  }

  .controls-container {
    width: 100%;
    padding: 0 0.5rem; /* Padding for the form and button container */
    box-sizing: border-box;
  }

  .selectors-panel {
    position: fixed;
    bottom: 0;                    /* position at bottom of screen */
    left: 0;                      /* full width at bottom */
    right: 0;                     /* full width at bottom */
    width: 100%;                  /* full width */
    height: 50vh;                 /* reduce to 50% of viewport height */
    max-height: 300px;            /* reduce max height to 300px */
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.2); /* shadow above panel */
    overflow-y: auto;
    /* slide completely off‑screen downward: */
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
    padding: 0.75rem;             /* reduce padding */
    gap: 0.75rem;                 /* reduce gap */
    border-radius: 1rem 1rem 0 0; /* rounded top corners */
  }
  
  .color-wheel-container {
    max-width: none;              /* remove width restriction */
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    width: 100%;                  /* full width for bottom panel */
  }
  
  .color-wheel canvas {
    width: 120px !important;      /* larger wheels for bottom panel */
    height: 120px !important;
  }
  
  .color-wheel-center {
    width: 20px !important;       /* larger center indicator */
    height: 20px !important;
  }
  .selectors-panel.open {
    /* slide up into view: */
    transform: translateY(0);
  }
  .menu-toggle {
    display: flex; /* Changed to flex */
    align-items: center; /* Added */
    justify-content: center; /* Added */
    position: fixed;
    top: 60px; /* MODIFIED - Restored original position */
    left: 1rem; /* Changed from right: 1rem; */
    z-index: 1002;
    background: #efca44;
    color: #fff; /* SVG will inherit this color */
    border: none;
    width: 40px; /* Added */
    height: 40px; /* Added */
    padding: 0; /* Changed from 0.5rem */
    border-radius: 50%; /* Changed from 0.25rem */
    /* font-size: 1.25rem; Removed */
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Optional: Add shadow */
    overflow: hidden; /* Ensure image stays within bounds */
  }

  .menu-toggle img { /* Changed from .menu-toggle svg */
    width: 70%; /* Increased from 60% */
    height: 70%; /* Increased from 60% */
    object-fit: contain; /* Ensure the whole icon is visible */
    /* Removed fill: currentColor; as it's an img now */
  }
}

@media (max-width: 768px) {
  /* prevent any page scrolling */
  html, body {
    height: 100vh;
    overflow: hidden;
  }
  /* only leave space for the fixed header */
  /* body {
    padding: 50px 0 0;
  } */
  /* make viewer‐panel fill the rest of the viewport */
  .viewer-panel {
    height: 100%;
    flex-direction: column;
    align-items: stretch; /* Stretch children to fill width */
    margin-top: 50px; /* MODIFIED - push below the header */
    height: calc(100vh - 50px);   /* MODIFIED - fill remaining viewport */
    padding: 0; /* Remove padding if children handle it */
  }
  /* have the model‐viewer fill all available space */
  .viewer {
    width: 100%; /* Full width */
    height: 20vh; /* MODIFIED - Reduced height to make space for a form */
    margin-bottom: 0.5rem; /* MODIFIED - Add gap below viewer here */
    border-radius: 0; /* No border radius on mobile if full width */
  }
  /* hide selectors off‑canvas by default */
  .selectors-panel {
    transform: translateY(100%);
  }
}

@media (max-width: 768px) {
  /* remove the extra body padding so .viewer-panel can size itself */
  body {
    padding: 0;
  }

  /* ensure the fixed header (50px) doesn’t cover the top of the model */
  .viewer-panel {
    margin-top: 50px;             /* push below the header - MODIFIED */
    height: calc(100vh - 50px);   /* fill remaining viewport - MODIFIED */
  }

  /* model‑viewer already fills its container */
  .viewer {
    width: 100%;
    height: 20vh; /* MODIFIED - Reduced height to make space for a form */
    margin-bottom: 0.5rem; /* MODIFIED - Add gap below viewer here */
  }

  /* Styles for the new submission form */
  .submission-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* MODIFIED - Reduced gap */
    margin-bottom: 0.5rem; /* MODIFIED - Reduced margin */
    width: 100%; /* Ensure form takes full width available in its container */
    padding: 0.5rem; /* MODIFIED - Reduced padding */
    box-sizing: border-box;
  }

  .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem; /* MODIFIED - Reduced gap */
  }

  .submission-form label {
    font-size: 0.8rem; /* MODIFIED - Smaller font */
    margin-bottom: 0;
  }

  .submission-form input[type="text"] {
    padding: 0.4rem; /* MODIFIED - Reduced padding */
    font-size: 0.8rem; /* MODIFIED - Smaller font */
    border: 1px solid #ccc;
    border-radius: 0.25rem; /* MODIFIED - Smaller radius */
    width: 100%; /* Make input take full width of its container */
    box-sizing: border-box;
  }

  #submitBtnContainer {
    display: flex;
    justify-content: center; /* Center button on mobile */
    width: 100%;
    padding: 0 0.5rem; /* Match form padding */
    box-sizing: border-box;
    margin-top: 0.5rem; /* Space above button */
  }

  #submitBtn {
    padding: 0.5rem 1rem; /* MODIFIED - Adjusted padding */
    font-size: 0.9rem; /* MODIFIED - Adjusted font size */
    /* ... keep other submitBtn styles ... */
    width: auto; /* Allow button to size to content or be set by container */
    min-width: 120px; /* Ensure a minimum decent width */
  }
}

/* Desktop Styles for the form (outside mobile media query) */
.submission-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem; /* Slightly larger gap for desktop */
  margin-top: 1rem; /* Space above the form */
  margin-bottom: 1rem; /* Space below the form */
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.8); /* Optional: background to match selectors */
  border-radius: 0.5rem; /* Optional: rounded corners */
  box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* Optional: subtle shadow */
  max-width: 300px; /* Max width for the form on desktop */
  margin-left: auto; /* Center the form if selectors-panel is wider */
  margin-right: auto; /* Center the form */
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.submission-form label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

.submission-form input[type="text"] {
  padding: 0.6rem;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 0.3rem;
  box-sizing: border-box;
}

#submitBtnContainer {
  display: flex;
  justify-content: center; /* Center button on desktop too */
  margin-top: 1rem;
}

#submitBtn {
  background-color: #4CAF50; /* Example: Green */
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background-color 0.2s ease;
  /* text-decoration: none; /* This was a typo, remove if not needed or correct */
}

#submitBtn:hover {
  background-color: #45a049;
}


/* Gate (index.html) styles */
#gate {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;

}
.gate-box {
  display: flex;
  flex-direction: column;
  align-items: center;   /* center children horizontally */
  text-align: center;     /* center all text */
  background: rgba(255,255,255,0.15); /* low‑opacity white for the box */
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  width: 320px;
}
.gate-box h1 {
  margin-bottom: 1rem;
  font-size: 1.75rem;
}
.gate-box p {
  margin-bottom: 0.5rem;
}
.gate-box input {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  font-size: 1rem;
  text-align: center; /* Center the placeholder text */
}

/* Optional: Style the placeholder specifically */
.gate-box input::placeholder {
  text-align: center; /* Ensure centering for placeholder */
  /* You can add other styles like color, font-style here if needed */
}
.gate-box button {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  background: #4d79ff;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-bottom: 0;          /* override if you don't want extra space after button */
}
.gate-box button:hover {
  background: #3355cc;
}
.error-msg {
  color: #ff4d4d;
  font-size: 0.9rem;
  min-height: 1.2rem;
  margin-top: 0.5rem;
}
.gate-box input,
.gate-box button {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1rem;       /* ensure equal spacing */
}

/* Site header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
}

.site-header .logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.site-title {
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
}

.site-title a {
  color: inherit;
  text-decoration: none;
  display: inline-block;
}

.header-nav {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-right: 2rem;
}

.header-nav a {
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem;
}

/* Responsive header tweaks */
@media (max-width: 768px) {
  .site-header {
    padding: 0 0.5rem;
    height: 50px; /* maintain smaller header on mobile */
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
  }
  .site-header .logo {
    flex: 0 0 auto;
    margin-bottom: 0.25rem;
  }
  .site-header .logo img {
    width: 32px;
    height: 32px;
  }
  .site-title {
    flex: 1 1 auto; /* allow proper shrinking */
    font-size: 1rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0; /* required for flex children to shrink */
  }
  .header-nav {
    flex: 0 0 auto;
    width: auto; /* allow dynamic width */
    text-align: right;
    margin-bottom: 0;
  }
  .header-nav a {
    display: inline-block;
    margin: 0 0.5rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0 0.25rem;
  }
  .site-header .logo img {
    width: 28px;
    height: 28px;
  }
  .site-title {
    font-size: 0.9rem;
  }
  .header-nav a {
    font-size: 0.8rem;
    margin: 0 0.25rem;
  }
}

/* Mobile header – adjust logo size & spacing */
@media (max-width: 768px) {
  .site-header .logo {
    flex: 0 0 auto;
    margin: 0 0.5rem 0.25rem;  /* small side padding & bottom gap */
  }
  .site-header .logo img {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 480px) {
  .site-header .logo img {
    width: 28px;
    height: 28px;
  }
}

/* constrain and pad the About page content */
.about-content {
  width: 90%;
  max-width: 800px;
  padding: 1rem;
  box-sizing: border-box;
}

/* ensure h2 stands out on all screen sizes */
.about-content h2 {
  color: #333;
  font-size: 1.5rem;
  margin: 1.5rem 0 0.5rem;
}

/* Center all of the about‐page content */
.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0 auto;
  padding: 2rem;
  max-width: 800px;
}

/* Size and center the small 3D preview */
.small-viewer {
  width: 300px;
  height: 300px;
  margin: 1.5rem 0;
}

/* Rounded, colored “Return to Customizer” button */
.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: #4CAF50;
  color: #fff;
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.button:hover {
  background-color: #45a049;
}

/* ensure the nav links remain in a row */
.header-nav {
  display: flex;
  gap: 1rem;
}

/* override any mobile‐only centering */
@media (max-width: 600px) {
  .site-header, .header-nav {
    flex-wrap: nowrap;
  }
  .site-header {
    flex-wrap: nowrap;
    justify-content: space-between;  /* keep logo left, nav right */
  }
  .header-nav {
    flex-wrap: nowrap;
  }
}

/* wrap & center the mystery swatch */
.secret-container {
  display: flex;
  justify-content: center;
  margin: 0 10rem 0;
}

/* make the mystery swatch larger */
.secret-container .secret-swatch {
  width: 3rem;  /* reduced size to allow full view of all selectors */
  aspect-ratio: 1;
  padding: 0;             /* ensure img fills entire circle */
}

/* ensure the GIF fits */
.secret-container .secret-swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* lay selectors + secret side‑by‑side on desktop */
@media (min-width: 769px) {
  .selectors-panel {
    display: grid;
    grid-template-columns: 1fr auto; /* left column = selectors (still vertical), right = mystery */
    align-items: flex-start;
    gap: 2rem;
    /* margin-top: 2rem;        /* push the whole panel down below header */ /* This line is removed */
  }
  .secret-container {
    margin: 0;        /* override any auto‑margins */
    justify-self: end;/* push to the right of its grid cell */
  }

  /* keep every color-selector stacked in col 1 */
  .selectors-panel > .color-selector {
    grid-column: 1;
  }

  /* push the mystery swatch into col 2 */
  .secret-container {
    grid-column: 2;
    justify-self: end;
    align-self: center;
    margin: 0 10rem 0;       /* give it back a 2rem top‐gap */
  }
}

/* on desktop, pull the mystery swatch up into line with the selectors */
@media (min-width: 769px) {
  .secret-container {
    /* remove the extra top‐gap */
    margin: 0;
    /* align at the top of its grid cell */
    align-self: start;
    /* keep it flush to the left selectors column */
    justify-self: start;
  }
}

/* keep original stacking on smaller screens - DISABLED for new grid layout */
/*
@media (max-width: 768px) {
  .selectors-panel {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
  }
  .secret-container {
    margin: 2rem 0;
    justify-self: auto;
  }
}
*/

/* on mobile, tighten the spacing - DISABLED for new grid layout */
/*
@media (max-width: 768px) {
  .secret-container {
    margin: 1rem 0;
  }
}
*/

/* move mystery swatch to the left of the selectors on desktop */
@media (min-width: 769px) {
  .viewer-panel {
    align-items: flex-start; /* Align children (viewer and selectors-panel) to the top */
  }

  .selectors-panel {
    /* swap columns: first the secret, then the selectors stack */
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    /* margin-top: 2rem;        /* keep existing top‑gap */ /* This line is removed */
    padding-top: 0; /* Align content top with viewer */
  }
  /* place the mystery swatch in the first column */
  .secret-container {
    grid-column: 1;
    justify-self: center;      /* Changed from start to center */
    margin: 0 1rem 0 8rem;       /* add some space before the selectors, adjusted for slight right shift */
  }
  /* shift all color selectors into the second column */
  .selectors-panel > .color-selector {
    grid-column: 2;
  }
}

/* Hide the paint toggle on desktop */
@media (min-width: 769px) {
  .menu-toggle {
    display: none !important;
  }
}

/* Ensure it’s visible on mobile */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
}

/* Style for the new submit button */
#submitBtn {
  display: block; 
  margin: 1rem auto; /* Center the button and add some margin */
  padding: .5rem 7rem;
  background-color: #6196c8;
  color: #fff;
  text-decoration: none; /* Corrected typo: none instead of none */
  border-radius: 0.5rem;
  font-weight: bold;
  transition: background-color 0.3s ease;
  border: none; 
  cursor: pointer; 
  width: fit-content; /* Make button width fit its content */
  position: relative; /* Added for positioning context */
}

#submitBtn:hover {
  background-color: #a3bcd4;
}

/* COMPREHENSIVE MOBILE LAYOUT */
@media screen and (max-width: 768px) {
  /* Force the 3-column grid layout for mobile */
  .selectors-panel {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 0.5rem !important;
    align-items: start !important;
    height: 50vh !important;
    max-height: 300px !important;
    padding: 0.75rem !important;
    flex-direction: unset !important;
    overflow: hidden !important;
  }
  
  /* Secret container spans all columns at top */
  .secret-container {
    grid-column: 1 / 4 !important;
    grid-row: 1 !important;
    justify-self: center !important;
    margin: 0 0 0.5rem 0 !important;
  }
  
  /* Head color in first column */
  .color-wheel-container:first-of-type {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  /* Body color in second column */
  .color-wheel-container:last-of-type {
    grid-column: 2 !important;
    grid-row: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  /* Available colors in third column */
  .color-selector {
    grid-column: 3 !important;
    grid-row: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  /* Container adjustments */
  .color-mode-container {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  /* Hide wheels on mobile, show swatches */
  .mode-wheel {
    display: none !important;
  }
  
  .mode-swatches {
    display: grid !important;
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
    gap: 0.1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Compact swatches for mobile */
  .head-swatch, .body-swatch {
    width: 16px !important;
    height: 16px !important;
    border: 1px solid #ddd !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }
  
  /* Compact headers */
  .selector-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 0.3rem !important;
    width: 100% !important;
  }
  
  .selector-label {
    font-size: 0.7rem !important;
    margin: 0 !important;
    text-align: left !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  /* Compact toggles */
  .mode-toggle {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
  }
  
  .mode-toggle svg {
    width: 8px !important;
    height: 8px !important;
  }
  
  /* Available colors styling */
  .color-selector .both-swatch {
    width: 16px !important;
    height: 16px !important;
    margin: 0.05rem !important;
    border-radius: 50% !important;
    border: 1px solid #ddd !important;
    box-sizing: border-box !important;
    display: inline-block !important;
  }
  
  .color-selector {
    text-align: left !important;
  }
  
  /* Secret button */
  .secret-swatch {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
  }
  
  .secret-swatch img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
  }
}

/* Desktop layout - restore normal behavior */
@media screen and (min-width: 769px) {
  .mode-wheel {
    display: flex !important;
  }
  
  .mode-wheel.active {
    opacity: 1 !important;
    transform: scale(1) !important;
    pointer-events: auto !important;
  }
  
  .mode-swatches {
    position: absolute !important;
    opacity: 0 !important;
    transform: translateX(-50%) scale(0.9) !important;
    pointer-events: none !important;
  }
  
  .mode-swatches.active {
    opacity: 1 !important;
    transform: translateX(-50%) scale(1) !important;
    pointer-events: auto !important;
  }
}
