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

/* Hide mobile mode buttons by default on desktop devices */
@media screen and (min-width: 1025px) {
  .mobile-mode-buttons {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }
}

/* Show mobile mode buttons on tablets and mobile */
@media screen and (max-width: 1024px) {
  .mobile-mode-buttons {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    left: auto !important;
    pointer-events: auto !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
  }
}

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

body {
  min-height: 100vh;
  overflow: hidden;
  position: relative;  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0;
}

/* Site header */
.site-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 50px !important;
  background: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 1rem !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  z-index: 1000 !important;
  transition: background-color 0.3s ease, color 0.3s ease !important;  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;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.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 {
  position: relative !important;
  z-index: 1000 !important;
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
  max-width: 100% !important;
  overflow: visible !important;
  justify-content: flex-end !important;
}

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

.header-nav .instagram-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: white;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header-nav .instagram-link:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.header-nav .instagram-link svg {
  width: 16px;
  height: 16px;
}

/* User menu removed */

.header-nav .login-btn, .header-nav .logout-btn {
  padding: 0.4rem 0.8rem;
  background: #efca44;
  color: #333;
  border: none;
  border-radius: 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
  position: relative;
}

.header-nav .login-btn:hover, .header-nav .logout-btn:hover {
  background: #e6b63a;
}

.header-nav .user-welcome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1002;
  flex-wrap: wrap;
  max-width: 100%;
  font-size: 0.8rem;
  color: #333;
}

.header-nav .user-welcome .logout-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
}

/* Removed old auth-section styles - now handled in header-nav */

/* Login and Logout Button Styles */
.login-btn, .logout-btn, .settings-btn {
  padding: 0.4rem 0.8rem;
  background: #efca44;
  color: #333;
  border: none;
  border-radius: 0.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* Login Dropdown Styles */
.login-dropdown {
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  z-index: 10000 !important;
  max-height: 80vh !important;
  overflow-y: auto !important;
  min-width: 300px !important;
  background: white !important;
  border: 1px solid #ddd !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
  padding: 1rem !important;
  margin-top: 0.5rem !important;
}

.login-dropdown .auth-tabs {
  display: flex !important;
  margin-bottom: 16px !important;
  border-bottom: 1px solid #eee !important;
}

.login-dropdown .auth-tab {
  flex: 1 !important;
  padding: 8px !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  border-bottom: 2px solid transparent !important;
  transition: all 0.3s ease !important;
}

.login-dropdown .auth-tab.active {
  border-bottom-color: #007bff !important;
  color: #007bff !important;
}

.login-dropdown .auth-tab-content {
  display: none !important;
}

.login-dropdown .auth-tab-content.active {
  display: block !important;
}

.login-btn:hover, .logout-btn:hover, .settings-btn:hover {
  background: #e6b63a;
}

.login-btn:active, .logout-btn:active, .settings-btn:active {
  background: #d9a62f;
}

.settings-btn {
  background: #4CAF50;
  color: white;
}

.settings-btn:hover {
  background: #45a049;
}

.settings-btn:active {
  background: #3d8b40;
}

.user-welcome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1002;
  flex-wrap: wrap;
  max-width: 100%;  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #333;
}

.logout-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
}

/* Login Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(2px);
}

.modal-content {
  background: white;
  padding: 0;
  border-radius: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 400px;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 1.5rem;
  overflow-x: hidden;
  position: relative;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #333;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  font-size: 0.9rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #efca44;
  box-shadow: 0 0 0 2px rgba(239, 202, 68, 0.2);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.login-submit-btn, .cancel-btn {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.login-submit-btn {
  background: #efca44;
  color: #333;
}

.login-submit-btn:hover {
  background: #e6b63a;
}

.cancel-btn {
  background: #f5f5f5;
  color: #666;
}

.cancel-btn:hover {
  background: #e0e0e0;
}

.error-message {
  background: #ffe6e6;
  color: #d32f2f;
  padding: 0.75rem;
  border-radius: 0.25rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  border-left: 3px solid #d32f2f;
}

.success-message {
  background: #e8f5e8;
  color: #2e7d32;
  padding: 0.75rem;
  border-radius: 0.25rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  border-left: 3px solid #4caf50;
}

.settings-submit-btn {
  background: #4CAF50;
  color: white;
}

.settings-submit-btn:hover {
  background: #45a049;
}

/* Viewer Panel Layout */
.viewer-panel {
  min-height: calc(100vh - 50px);
  max-height: calc(100vh - 50px);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0;
  max-width: none;
  width: 100%;
  height: calc(100vh - 50px);
  margin-left: 320px;
  margin-top: 50px;
  padding-right: 2rem; /* Add padding to prevent model from being too far right */
  margin: 0; /* Remove default margins */
  padding: 0; /* Remove default padding */
}

/* Ensure desktop layout has proper margin */
@media screen and (min-width: 1025px) {
  .viewer-panel {
    margin-left: 0 !important; /* Remove left margin since color selector is fixed */
    padding-right: 0 !important; /* Remove padding to eliminate gap */
    width: 100% !important; /* Full width */
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 0 !important; /* Ensure no gap between elements */
    margin-top: 50px !important;
  }
  
  .viewer {
    width: calc(100% - 320px - 4rem) !important; /* Adjust width to account for color selector and right padding */
    max-width: calc(100% - 320px - 4rem) !important; /* Adjust max-width */
    height: 100% !important;
    min-height: 70vh !important; /* Ensure model has good size on desktop */
    order: 2 !important;
    flex: 1 !important;
    margin-left: 0 !important; /* No left margin since we're adjusting width */
    margin-right: 0 !important; /* No right margin */
    padding-left: 0 !important; /* No left padding */
    padding-right: 4rem !important; /* Add right padding to bring model closer to color circles */
    position: absolute !important; /* Position absolutely */
    left: 320px !important; /* Start exactly where color selector ends */
  }
  
  .color-selector-panel {
    position: fixed !important;
    left: 0 !important;
    top: 50px !important;
    width: 320px !important;
    height: calc(100vh - 50px) !important;
    order: 1 !important;
    margin-right: 0 !important; /* Ensure no right margin */
    padding-right: 0 !important; /* Ensure no right padding */
    box-sizing: border-box !important; /* Ensure padding is included in width */
  }
}

.right-column {
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;  display: flex;
  flex-direction: column;
  flex: 0.4;
  align-items: center;
  justify-content: flex-start;
  padding-right: 0.5rem;
  order: 1;
  min-width: 0;
  max-width: 100%;
  max-height: 100vh;
  overflow: hidden;
}

.viewer {
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 0;
  overflow: hidden;
  transform-origin: center center;
  order: 2;
  min-height: 60vh; /* Ensure minimum height for model visibility */
}

/* Model viewer lighting consistency */
model-viewer {
  --exposure: 0.5 !important;
  --shadow-intensity: 0.2 !important;
  --shadow-softness: 0.4 !important;
  --environment-image: neutral !important;
}

/* Color Selector Panel - Left Side */
.color-selector-panel {
  width: 320px;
  height: 100vh;
  background: white;
  border-radius: 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 100;
  position: fixed;
  left: 0;
  top: 50px;
  order: 1;
  overflow-y: auto;
  pointer-events: none;
  padding-bottom: 2rem; /* Ensure color picker has space at bottom */
}

.color-selector-panel * {
  pointer-events: auto;
}

/* Mode Selection Buttons */
.mode-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  justify-content: center;
  /* Center the group and avoid stretching edge-to-edge */
  width: 100%;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
  /* Nudge slightly left for visual balance */
  transform: translateX(-8px);
}

.mode-btn {
  /* Keep buttons uniform without over-stretching */
  flex: 1 1 auto;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  color: #495057;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  font-size: 0.9rem;
}

.mode-btn:hover {
  background: #e9ecef;
  border-color: #dee2e6;
}

.mode-btn.active {
  background: #007bff;
  border-color: #007bff;
  color: white;
}

.mode-btn span {
  font-size: 0.9rem;
  font-weight: 600;
}

/* Dynamic Color Swatches */
.dynamic-swatch {
  width: 40px;
  height: 40px;
  border: 2px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: auto;
  z-index: 10;
  box-sizing: border-box;
}

.dynamic-swatch::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.1) 100%);
  pointer-events: none;
}

.dynamic-swatch:hover {
  transform: scale(1.02);
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  background-color: rgba(0, 123, 255, 0.05);
}

.dynamic-swatch:active {
  transform: scale(0.98);
}

.dynamic-swatch.selected {
  border-color: #007bff;
  border-width: 3px;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
  background-color: rgba(0, 123, 255, 0.1);
}

.color-name {
  font-size: 0.7rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  user-select: none;
  text-align: center;
  line-height: 1.2;
}

/* Color Swatches Container */
#dynamicSwatches {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.6rem;
  justify-content: center;
  margin: 0.5rem 0;
  flex: 1;
  overflow: visible;
  padding: 0.5rem;
  align-items: center;
  pointer-events: auto;
  z-index: 10;
}



/* Rarity Display Above Tabs */
.rarity-display-above-tabs {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1002;
  text-align: center;
  font-size: 1.1rem;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.rarity-display-above-tabs:empty {
  display: none;
}

/* Mobile Tab Navigation */
.mobile-tab-nav {
  display: none; /* Hidden by default, shown in media query */
  position: fixed;
  top: 80px; /* Below header */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  flex-direction: row;
  gap: 0.75rem;
  padding: 0.75rem;
}

.mobile-tab-btn {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  transition: all 0.3s ease;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  min-height: 50px;
  min-width: 80px;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  margin-bottom: 0;
}

.mobile-tab-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
}

.mobile-tab-btn.active {
  background: #efca44;
  color: #000;
  border-color: #efca44;
  transform: translateY(-4px);
}

/* Mobile Tab Content */
.mobile-tab-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.mobile-tab-content:not(.active) {
  display: none !important;
}

.mobile-tab-content.active {
  display: flex !important;
  width: 100%;
}

/* Ensure mobile tab content overrides any conflicting color-selector rules */
.color-selector.mobile-tab-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  z-index: 1002 !important;
}

.color-selector.mobile-tab-content:not(.active) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.color-selector.mobile-tab-content.active {
  display: flex !important;
  width: 100%;
  z-index: 1002 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Selectors Panel */
.selectors-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  max-width: 300px;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 100;
  flex: 1;
  padding: 0.5rem;
  width: 100%;
  max-width: min(300px, 100%);
  box-sizing: border-box;
}

/* 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: 0.75rem;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  margin-bottom: 0.5rem;
}

/* Remove white background on auth pages */
.auth-viewer-panel .color-wheel-container,
.auth-viewer-panel .size-color-selector,
.auth-viewer-panel .color-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
  min-height: 0;
  flex-shrink: 0;  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.selector-label {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.75rem;
  color: #333;
  grid-column: 1 / -1;
}

.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;
}



/* 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 - all styles unified above */

/* Available Colors Section */
.color-selector {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
  margin-bottom: 0;
  box-sizing: border-box;
  position: relative;
  min-height: 0;
  flex-shrink: 0;
  max-width: 100%;
  width: 100%;
  flex: 1;
  pointer-events: none !important;
}

.color-selector * {
  pointer-events: auto !important;
}

.color-selector .selector-header {
  grid-column: 1 / -1;
  margin-bottom: 0.25rem;
}

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

.both-swatch,
.head-swatch,
.body-swatch {
  width: 45px;
  height: 45px;
  border: 2px solid #eee;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  justify-self: center;
  align-self: center;
}

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

/* Authenticity page styles */
.authenticity-content {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 50px);
  padding: 2rem 1rem;
}

.auth-container {
  max-width: 1200px;
  width: 100%;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 2rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

/* Center auth container h2 */
.auth-container h2 {
  text-align: center;
  margin-bottom: 2rem;
}

/* Auth Viewer Panel */
.auth-viewer-panel {
  min-height: calc(100vh - 50px);
  max-height: calc(100vh - 50px);
  overflow: hidden;
  position: relative;  display: flex;
  align-items: flex-start;
  gap: 2rem;
  max-width: 1200px;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  margin-bottom: 6rem;
  overflow: visible;
}

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

.auth-section {
  margin-bottom: 2rem;
}

.auth-section h3 {
  color: #444;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 500;
  border-bottom: 2px solid #efca44;
  padding-bottom: 0.5rem;
}

/* Certificate styles */
.certificate {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border: 2px solid #efca44;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(239, 202, 68, 0.2);
  position: relative;
  overflow: hidden;
}

.certificate::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #efca44, #f1d96a, #efca44);
  z-index: -1;
  border-radius: 0.75rem;
}

.certificate-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.cert-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 1rem;
  border: 2px solid #efca44;
}

.cert-title h4 {
  margin: 0;
  color: #333;
  font-size: 1.2rem;
  font-weight: 600;
}

.cert-title p {
  margin: 0.25rem 0 0;
  color: #666;
  font-size: 0.9rem;
}

.certificate-body .cert-text {
  text-align: center;
  font-size: 1rem;
  color: #444;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

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

.cert-field {
  display: flex;
  flex-direction: column;
}

.cert-field label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.cert-field span {
  color: #333;
  font-weight: 600;
}

.cert-signature {
  text-align: center;
  margin-top: 1rem;
}

.cert-signature p {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.signature-line {
  border-top: 1px solid #333;
  display: inline-block;
  padding-top: 0.5rem;
  font-weight: 600;
  color: #333;
  min-width: 200px;
}

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.feature-card h4 {
  margin: 0.5rem 0;
  color: #333;
  font-size: 1rem;
  font-weight: 600;
}

.feature-card p {
  margin: 0;
  color: #666;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Collection stats */
.collection-stats {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(239, 202, 68, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #efca44;
  margin-bottom: 0.25rem;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
}

/* Action buttons */
.auth-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.auth-button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: all 0.3s ease;
}

.auth-button.primary {
  background: #efca44;
  color: #333;
}

.auth-button.primary:hover {
  background: #e6b63a;
  transform: translateY(-1px);
}

.auth-button.secondary {
  background: transparent;
  color: #333;
  border: 2px solid #efca44;
}

.auth-button.secondary:hover {
  background: #efca44;
  transform: translateY(-1px);
}

/* Size Color Selector */
.size-color-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
  min-height: 0;
  flex-shrink: 0;  max-width: 22rem;
  width: 100%;
  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;
}

/* Remove white background on auth pages */
.auth-viewer-panel .size-color-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
  min-height: 0;
  flex-shrink: 0;  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Remove white backgrounds on mobile */
.size-color-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
  min-height: 0;
  flex-shrink: 0;  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.size-color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
  margin-top: 0.5rem;
}

.size-color-swatch {
  width: 100px;
  height: 100px;
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.size-color-swatch:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.size-color-swatch.selected {
  border-color: #efca44;
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(239, 202, 68, 0.3);
}

/* Size-specific styling with color combinations */
.size-color-swatch.jumbo {
  border-width: 4px;
  background: linear-gradient(-45deg, #6A4A34 50%, #FFB6C1 50%);
}

.size-color-swatch.large {
  border-width: 3px;
  background: linear-gradient(-45deg, #2A2A2A 50%, #9CAF88 50%);
}

.size-color-swatch.regular {
  border-width: 2px;
  background: #FB8B5B;
}

/* DARK MODE STYLES */
[data-theme="dark"] {
  background-color: #121212;
  color: #ffffff;
}

[data-theme="dark"] .site-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 50px !important;
  background: #1e1e1e !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 1rem !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
  z-index: 1000 !important;
  transition: background-color 0.3s ease, color 0.3s ease !important;
  color: #ffffff;
  border-bottom: 1px solid #333;
}

[data-theme="dark"] .site-header .header-nav a {
  color: #ffffff;
}

[data-theme="dark"] .site-header .header-nav a:hover {
  color: #efca44;
}

[data-theme="dark"] .site-header .header-nav .instagram-link {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: white;
}

[data-theme="dark"] .site-header .header-nav .instagram-link:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(220, 39, 67, 0.4);
}

[data-theme="dark"] .viewer-panel {
  background: #121212;
}

@media screen and (max-width: 768px) {
  [data-theme="dark"] .viewer-panel {
    background: #121212;
  }
  
  [data-theme="dark"] .viewer {
    background: transparent;
  }
}

/* Dark mode for tablet portrait layout */
@media screen and (max-width: 768px) and (orientation: portrait) {
  [data-theme="dark"] .viewer-panel {
    background: #121212 !important;
  }
  
  [data-theme="dark"] .color-selector-panel {
    background: rgba(30, 30, 30, 0.95) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(80, 80, 80, 0.6) !important;
  }
  
  [data-theme="dark"] .viewer {
    background: transparent !important;
    border: 1px solid rgba(80, 80, 80, 0.6) !important;
  }
  
  [data-theme="dark"] .mobile-mode-buttons {
    background: rgba(30, 30, 30, 0.95) !important;
    border: 1px solid rgba(80, 80, 80, 0.6) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
  }
}

[data-theme="dark"] .selectors-panel {
  background: rgba(30, 30, 30, 0.95);
  border: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Dark theme: ensure left color selector panel does not stay white */
[data-theme="dark"] .color-selector-panel {
  background: rgba(30, 30, 30, 0.95) !important;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4) !important;
  border-right: 1px solid rgba(80, 80, 80, 0.6) !important;
}

[data-theme="dark"] .color-selector {
  background: rgba(40, 40, 40, 0.9) !important;
  border: 1px solid rgba(80, 80, 80, 0.6) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .color-selector .selector-header {
  color: #ffffff !important;
}

[data-theme="dark"] .color-selector .selector-label {
  color: #ffffff !important;
}

[data-theme="dark"] .selector-header {
  color: #ffffff !important;
}

[data-theme="dark"] .selector-label {
  color: #ffffff !important;
}

[data-theme="dark"] .mode-toggle {
  background: rgba(60, 60, 60, 0.8) !important;
  color: #ffffff !important;
  border: 1px solid #444 !important;
}

[data-theme="dark"] .mode-toggle:hover {
  background: rgba(80, 80, 80, 0.9) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .mode-toggle svg {
  color: #ffffff !important;
}

[data-theme="dark"] .color-mode-container {
  background: rgba(40, 40, 40, 0.8) !important;
  border: 1px solid #444 !important;
}
[data-theme="dark"] .color-wheel-container {
  background: rgba(40, 40, 40, 0.9) !important;
  border: 1px solid rgba(80, 80, 80, 0.6) !important;
}
[data-theme="dark"] .color-wheel canvas {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .system-color-picker {
  background: rgba(40, 40, 40, 0.1) !important;
}

[data-theme="dark"] .mobile-mode-buttons {
  background: rgba(30, 30, 30, 0.95) !important;
  border: 1px solid #444 !important;
}

[data-theme="dark"] .mode-btn {
  background: rgba(60, 60, 60, 0.8) !important;
  color: #ffffff !important;
  border: 1px solid rgba(80, 80, 80, 0.6) !important;
}

[data-theme="dark"] .mode-btn:hover {
  background: rgba(80, 80, 80, 0.9) !important;
}

[data-theme="dark"] .mode-btn.active {
  background: #efca44 !important;
  color: #000000 !important;
  border-color: #efca44 !important;
}

[data-theme="dark"] .dynamic-swatch {
  border-color: #555 !important;
  /* Keep the original color background - don't override it */
}

[data-theme="dark"] .dynamic-swatch:hover {
  border-color: #efca44 !important;
  /* Add subtle overlay while keeping original color */
  background-color: rgba(239, 202, 68, 0.1) !important;
}

[data-theme="dark"] .dynamic-swatch.selected {
  border-color: #efca44 !important;
  /* Add subtle overlay while keeping original color */
  background-color: rgba(239, 202, 68, 0.2) !important;
}

[data-theme="dark"] .color-name {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
}

[data-theme="dark"] .rarity-display-above-tabs {
  background: rgba(30, 30, 30, 0.95) !important;
  color: #ffffff !important;
  border: 1px solid #444 !important;
}

[data-theme="dark"] .login-dropdown {
  background: #1e1e1e !important;
  border: 1px solid #444 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .login-dropdown .auth-tabs {
  border-bottom: 1px solid #444 !important;
}

[data-theme="dark"] .login-dropdown .auth-tab {
  color: #cccccc !important;
}

[data-theme="dark"] .login-dropdown .auth-tab.active {
  color: #efca44 !important;
  border-bottom-color: #efca44 !important;
}

[data-theme="dark"] .login-btn, 
[data-theme="dark"] .logout-btn, 
[data-theme="dark"] .settings-btn {
  background: #efca44 !important;
  color: #000000 !important;
}

[data-theme="dark"] .login-btn:hover, 
[data-theme="dark"] .logout-btn:hover, 
[data-theme="dark"] .settings-btn:hover {
  background: #e6b63a !important;
}

[data-theme="dark"] .site-title a {
  color: #ffffff !important;
}

[data-theme="dark"] .site-title a:hover {
  color: #efca44 !important;
}

[data-theme="dark"] .mobile-tab-btn {
  background: rgba(30, 30, 30, 0.9);
  border: 1px solid #444;
  color: #fff;
}

[data-theme="dark"] .mobile-tab-btn:hover {
  background: rgba(30, 30, 30, 1);
}

[data-theme="dark"] .mobile-tab-btn.active {
  background: #efca44;
  color: #000;
  border-color: #efca44;
}

[data-theme="dark"] .selector-label {
  color: #ffffff;
}

[data-theme="dark"] .modal-content {
  background: #1e1e1e;
  color: #ffffff;
}

[data-theme="dark"] .modal-header {
  border-bottom: 1px solid #333;
}

[data-theme="dark"] .form-group input {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #ffffff;
}

[data-theme="dark"] .form-group input:focus {
  border-color: #efca44;
  box-shadow: 0 0 0 2px rgba(239, 202, 68, 0.2);
}

[data-theme="dark"] .form-group label {
  color: #ffffff;
}

[data-theme="dark"] .certificate {
  background: #1e1e1e;
  border: 1px solid #333;
  color: #ffffff;
}

[data-theme="dark"] .cert-title h4,
[data-theme="dark"] .cert-title p {
  color: #ffffff;
}

[data-theme="dark"] .cert-field label {
  color: #cccccc;
}

[data-theme="dark"] .cert-field span {
  color: #ffffff;
}

[data-theme="dark"] .auth-button.primary {
  background: #efca44;
  color: #000;
}

[data-theme="dark"] .auth-button.secondary {
  background: #333;
  color: #ffffff;
  border: 1px solid #555;
}

[data-theme="dark"] .auth-button.secondary:hover {
  background: #444;
}

/* TABLET: behave like mobile (use mobile layout up to 1024px) */
@media screen and (max-width: 1024px) and (min-width: 769px) {
  .viewer-panel {
    flex-direction: column !important;
    align-items: stretch !important;
    margin-top: 50px !important;
    height: calc(100vh - 50px) !important;
    padding: 0 !important;
    gap: 0 !important;
    position: relative !important;
    background: #f8f9fa !important;
    margin-left: 0 !important;
    padding-right: 0 !important;
  }

  .viewer {
    width: 100% !important;
    height: 100% !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    order: 1 !important;
    flex: 1 !important;
    background: transparent !important;
    min-height: 60vh !important;
  }

  .color-selector-panel {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto 1rem auto !important;
    height: auto !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    display: none !important; /* hidden by default like mobile */
  }

  /* Show selector panel on tablet when toggled */
  .color-selector-panel.mobile-active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto 1rem auto !important;
    height: auto !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  }

  /* Ensure mode buttons are visible on tablet */
  .mobile-mode-buttons {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.75rem !important;
    margin: 0.5rem auto !important;
    width: 100% !important;
    max-width: 300px !important;
  }
  
  .mobile-mode-buttons .mode-btn {
    flex: 1 !important;
    max-width: 80px !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    border: 2px solid #e0e0e0 !important;
    background: #fff !important;
    color: #333 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
  }
  
  .mobile-mode-buttons .mode-btn.active {
    background: #007bff !important;
    color: #fff !important;
    border-color: #007bff !important;
  }
  
  .mobile-mode-buttons .mode-btn:hover {
    border-color: #007bff !important;
    transform: translateY(-1px) !important;
  }

  .selectors-panel {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    max-height: 60vh !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    padding: 1rem !important;
    gap: 0.75rem !important;
  }
}

/* MOBILE LAYOUT */
@media screen and (max-width: 768px) {
  body {
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding: 0;
    height: 100vh;
    overflow: hidden;
  }
  
  /* Make auth pages fully scrollable on mobile */
  body {
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    overflow-y: auto !important;
    height: auto !important;
  }
  
  .authenticity-content {
    min-height: calc(100vh - 50px);
    padding-bottom: 2rem;
  }
  
  .auth-container {
    margin-bottom: 2rem;
  }
  
  /* Viewer Panel Layout */
  .viewer-panel {
    flex-direction: column;
    align-items: stretch;
    margin-top: 50px;
    height: calc(100vh - 50px);
    padding: 0;
    gap: 0;
    position: relative;
    background: #f8f9fa;
    margin-left: 0;
    pointer-events: none;
    padding-right: 0; /* Remove padding on mobile */
  }
  
  /* Portrait mode: horizontal layout with color selector to the left */
  @media screen and (max-width: 768px) and (orientation: portrait) {
    .viewer-panel {
      flex-direction: row !important;
      align-items: flex-start !important;
      gap: 0.5rem !important;
      padding: 0.5rem !important;
      margin-top: 70px !important; /* Extra space for buttons above */
    }
    
    .mobile-mode-buttons {
      position: absolute !important;
      top: -60px !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
      z-index: 1002 !important;
      background: rgba(255, 255, 255, 0.95) !important;
      backdrop-filter: blur(10px) !important;
      border-radius: 12px !important;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
      padding: 0.5rem !important;
      margin: 0 !important;
      display: flex !important;
      visibility: visible !important;
      opacity: 1 !important;
      width: auto !important;
      max-width: 300px !important;
    }
    
    .mobile-mode-buttons .mode-btn {
      flex: 1 !important;
      max-width: 80px !important;
      padding: 0.5rem 0.75rem !important;
      font-size: 0.9rem !important;
      font-weight: 500 !important;
      border-radius: 8px !important;
      border: 2px solid #e0e0e0 !important;
      background: #fff !important;
      color: #333 !important;
      cursor: pointer !important;
      transition: all 0.2s ease !important;
    }
    
    .mobile-mode-buttons .mode-btn.active {
      background: #007bff !important;
      color: #fff !important;
      border-color: #007bff !important;
    }
    
    .mobile-mode-buttons .mode-btn:hover {
      border-color: #007bff !important;
      transform: translateY(-1px) !important;
    }
    
    .color-selector-panel {
      order: 1 !important;
      flex: 0 0 200px !important;
      width: 200px !important;
      max-width: 200px !important;
      height: calc(100vh - 100px) !important;
      margin: 0 !important;
      position: relative !important;
      left: auto !important;
      top: auto !important;
      display: block !important;
      border-radius: 12px !important;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
      overflow-y: auto !important;
    }
    
    .viewer {
      order: 2 !important;
      flex: 1 !important;
      width: auto !important;
      height: calc(100vh - 100px) !important;
      margin: 0 !important;
      border-radius: 12px !important;
    }
    
    /* Portrait mode: vertical color selector layout */
    .color-selector-panel {
      display: flex !important;
      flex-direction: column !important;
      align-items: center !important;
      gap: 1rem !important;
      padding: 1rem !important;
    }
    
    .color-selector {
      display: flex !important;
      flex-direction: column !important;
      align-items: center !important;
      gap: 1rem !important;
      width: 100% !important;
      max-width: 200px !important;
      padding: 0.5rem !important;
    }
    
    /* Override mobile horizontal layout for portrait */
    .color-selector-panel .color-selector {
      flex-direction: column !important;
      align-items: center !important;
      justify-content: flex-start !important;
    }
    
    #dynamicSwatches {
      display: flex !important;
      flex-direction: column !important;
      gap: 0.5rem !important;
      width: 100% !important;
      max-width: 180px !important;
      align-items: center !important;
      overflow-y: auto !important;
      padding: 0.5rem !important;
    }
    
    /* Override mobile flex layout for portrait vertical */
    .color-selector-panel #dynamicSwatches {
      display: flex !important;
      flex-direction: column !important;
      flex-wrap: nowrap !important;
      justify-content: flex-start !important;
      align-items: center !important;
    }
    
    .dynamic-swatch {
      width: 50px !important;
      height: 50px !important;
      font-size: 0.7rem !important;
    }
    
    .system-color-picker {
      display: flex !important;
      flex-direction: column !important;
      align-items: center !important;
      gap: 0.5rem !important;
      margin-top: 0.5rem !important;
    }
    
    .native-color-input {
      width: 50px !important;
      height: 50px !important;
      min-width: 50px !important;
      min-height: 50px !important;
    }
  }
  
  .viewer-panel * {
    pointer-events: auto;
  }
  
  /* Ensure smooth transition from tablet to mobile */
  .color-selector-panel {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto 1rem auto !important;
    height: auto !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    display: none !important; /* Hidden by default on mobile */
  }
  
  /* Portrait mode: show color selector panel by default */
  @media screen and (max-width: 768px) and (orientation: portrait) {
    .color-selector-panel {
      display: block !important;
      margin: 0 !important;
    }
  }
  
  .viewer {
    width: 100%;
    height: 100%;
    margin-bottom: 0;
    border-radius: 0;
    order: 1;
    flex: 1;
    background: transparent;
    min-height: 60vh;
  }
  
  .right-column {
    position: fixed;
    top: 140px; /* Below floating tabs (80px + 60px for tab height) */
    left: 0;
    width: 100%;
    height: calc(100vh - 140px);
    overflow: visible;
    align-items: center;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    order: 2;
    max-height: none;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
  }
  
  .right-column.open {
    transform: translateY(0);
  }
  
  /* Rarity Display Above Tabs - Mobile */
  .rarity-display-above-tabs {
    top: 60px;
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
    max-width: 90vw;
    word-wrap: break-word;
  }

  /* Mobile Tab Navigation - Always Visible */
  .mobile-tab-nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1001 !important;
    transform: translateX(-50%);
    position: fixed !important;
    top: 80px !important;
    left: 50% !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    padding: 0.5rem !important;
  }
  
  /* Mobile Selectors Panel */
  .selectors-panel {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    width: 100%;
    height: auto;
    min-height: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
    transform: none;
    transition: none;
    z-index: auto;
    padding: 1rem;
    border-radius: 12px;
    max-height: 60vh;
    flex: 1;
    
    /* Vertical stack layout */
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    align-items: center !important;
  }
  
  /* Mobile color selector adjustments */
  .color-selector {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
  
  /* Mobile fixed color selector panel */
  .color-selector-panel {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0 auto 1rem auto;
    height: auto;
    left: auto;
    top: auto;
    border-radius: 12px;
    display: none; /* Hidden by default on mobile */
  }
  
  /* Mobile mode buttons - always visible */
  .mobile-mode-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem auto;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    /* Center the group and constrain width */
    width: 100%;
    max-width: 320px;
    /* Nudge slightly left for visual balance */
    transform: translateX(-8px);
  }
  
  /* Hide desktop mode buttons on mobile */
  .color-selector-panel .mode-buttons {
    display: none !important;
  }
  
  /* Show color selector panel when mode is selected */
  .color-selector-panel.mobile-active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
    /* Hide mobile mode buttons on desktop */
@media screen and (min-width: 1025px) {
  .mobile-mode-buttons {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
  }
}

/* Desktop-specific adjustments */
@media screen and (min-width: 1025px) {
  .system-color-picker {
    margin-bottom: 1.5rem; /* More space on desktop */
  }
  
  .color-selector-panel {
    padding-bottom: 2.5rem; /* Ensure color picker has plenty of space */
  }
  
  .mobile-mode-buttons {
    display: none !important; /* Ensure mobile buttons are hidden on desktop */
  }
}
  
  /* Mobile mode buttons */
  .mode-buttons {
    margin-bottom: 0.75rem;
    width: 100%;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .mode-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    min-width: 80px;
  }
  
  .color-swatches {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    width: 100%;
    padding-left: 0.5rem;
  }
  
  /* Mobile dynamic swatches - horizontal layout */
  .dynamic-swatch {
    height: 35px;
    width: 35px;
    font-size: 0.65rem;
    flex-shrink: 0;
  }
  
  #dynamicSwatches {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.3rem !important;
    padding: 0.25rem 0.5rem !important;
    overflow: visible !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Mobile layout: Custom color selector to the right of color circles */
  .color-selector {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 0.5rem !important;
  }
  
  /* Color swatches container */
  .color-swatches {
    flex: 1 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.4rem !important;
    justify-content: space-between !important;
    align-items: center !important;
    overflow: visible !important;
    padding: 0 0.5rem !important;
  }
  
  /* System color picker - positioned to the right */
  .system-color-picker {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    padding: 0.25rem !important;
    border: none !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    min-width: 50px !important;
  }
  
  /* Custom color input - smaller on mobile */
  .native-color-input {
    width: 35px !important;
    height: 35px !important;
    min-width: 35px !important;
    min-height: 35px !important;
    max-width: 35px !important;
    max-height: 35px !important;
  }
  
  /* Custom color input with gradient border on mobile */
  .custom-color-input {
    padding: 2px !important;
  }
  
  .custom-color-input::before {
    top: 2px !important;
    left: 2px !important;
    right: 2px !important;
    bottom: 2px !important;
  }
  
  /* Color picker label styles removed - no longer needed */
  
  /* Mobile system color picker - smaller and beneath color circles */
  .system-color-picker {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding: 0.5rem !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    position: relative !important;
    z-index: 1 !important;
  }
  
  /* Mobile native color input - smaller */
  .native-color-input {
    width: 35px !important;
    height: 35px !important;
    min-width: 35px !important;
    min-height: 35px !important;
    max-width: 35px !important;
    max-height: 35px !important;
  }
  
  /* Mobile color picker label - smaller */
  .color-picker-label {
    padding: 0.3rem 0.5rem !important;
    font-size: 0.7rem !important;
    gap: 0.3rem !important;
  }
  
  .color-picker-label svg {
    width: 18px !important;
    height: 18px !important;
  }
  
  .color-picker-label span {
    font-size: 0.65rem !important;
  }
  
  .color-name {
    font-size: 0.8rem;
  }
  
  .head-swatch,
  .body-swatch,
  .both-swatch {
    width: 40px;
    height: 40px;
    z-index: 1003;
    position: relative;
  }
  
  .selectors-panel.open {
    transform: none;
  }

  /* Hide desktop menu toggle since we have mobile tabs */
  .menu-toggle {
    display: none;
  }
  
  /* Secret container at top */
  .secret-container {
    order: 1;
    margin-bottom: 0.5rem;
  }
  
  .secret-swatch {
    width: 35px;
    height: 35px;
  }
  
  /* Mobile color containers - smaller and more compact */
  .color-wheel-container:first-of-type,
  .color-wheel-container:last-of-type {
    order: 2;
    width: 100%;
    max-width: min(320px, 100%);
    overflow: visible;
    padding: 0.75rem;
    margin-bottom: 0;
    background: rgba(255,255,255,0.9) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    border-radius: 0.75rem !important;
  }
  
  /* Available colors container */
  .color-selector {
    width: 100%;
    max-width: min(320px, 100%);
    overflow: visible;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255,255,255,0.95) !important;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15) !important;
    border-radius: 1rem !important;
    border: 2px solid rgba(0, 0, 0, 0.1);
  }
  
  /* Mobile mode control - respect JavaScript active states */
  .mode-wheel {
    display: flex !important; /* Show on mobile for system picker */
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .system-color-picker {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 0.5rem;
  margin-bottom: 1rem; /* Add bottom margin to prevent cutoff */
  position: relative;
  z-index: 1;    width: 100%;
    max-width: 200px;
  }
  
  .native-color-input {
    width: 50px;
    height: 50px;
    /* Ensure perfect circle on mobile */
    aspect-ratio: 1;
    min-width: 50px;
    min-height: 50px;
    max-width: 50px;
    max-height: 50px;
    box-sizing: border-box;
  }
  
  .color-picker-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;    padding: 1rem;
    font-size: 0.9rem;
  }
  
  .mode-swatches {
    display: grid;
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .mode-swatches:not(.active) {
    display: none; /* Hide when slider is active */
  }
  
  /* Mobile color slider shows when active */
  .mobile-color-slider {
    display: none;
  }
  
  .mobile-color-slider.active {
    display: block;
  }
  
  /* Mobile swatches - consistent sizing */
  .head-swatch,
  .body-swatch,
  .both-swatch {
    width: 38px !important;
    height: 38px !important;
    border: 2px solid #ddd !important;
    border-radius: 50% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    justify-self: center !important;
    align-self: center !important;
  }

  /* Make color selector grid more compact with 3 columns */
  .color-selector {
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: auto repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  .color-selector .selector-header {
    grid-column: 1 / -1 !important;
    margin-bottom: 0.2rem !important;
  }

  .color-selector .selector-label {
    grid-column: 1 / -1 !important;
    margin-bottom: 0.3rem !important;
  }
  
  /* Compact headers and labels */
  .selector-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 0.2rem !important;
    width: 100% !important;
  }
  
  .selector-label {
    font-size: 0.65rem !important;
    margin: 0 !important;
    text-align: left !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  /* Mobile toggle - revert to normal */
  .mode-toggle {
    width: 24px !important;
    height: 24px !important;
    background: #f0f0f0 !important;
    border: 1px solid #ddd !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
  }
  
  .mode-toggle:hover {
    background: #e0e0e0 !important;
    transform: rotate(45deg) !important;
  }
  
  .mode-toggle svg {
    width: 12px !important;
    height: 12px !important;
    color: #666 !important;
    display: block !important;
  }
  
  /* Container adjustments */
  .color-mode-container {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  /* Header adjustments */
  .site-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 50px !important;
  background: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 1rem !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  z-index: 1000 !important;
  transition: background-color 0.3s ease, color 0.3s ease !important;    padding: 0 0.5rem;
    height: 50px;
    flex-wrap: nowrap;
    justify-content: space-between;
  }
  
  .site-header .logo img {
    width: 32px;
    height: 32px;
  }
  
  .site-title {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    margin-right: 0.5rem;
  }
  
  /* Mobile header layout */
  .header-left {
    gap: 0.5rem;
  }
  
  .theme-toggle {
    transform: scale(0.8);
  }
  
  .header-nav {
  position: relative !important;
  z-index: 1000 !important;
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
  max-width: 100% !important;
  overflow: visible !important;  position: relative;
  max-width: 100%;
  overflow: visible;    gap: 0.5rem;
  }
  
  .header-nav .login-btn, .header-nav .logout-btn, .settings-btn {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
  }
  
  .header-nav .user-welcome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1002;
  flex-wrap: wrap;
  max-width: 100%;    font-size: 0.7rem;
    gap: 0.3rem;
  }

  /* Compact header: hide verbose items and show user menu */
  #colorwayLimitDisplay,
  #colorwayRequestBtn,
  .collection-link,
  .logout-btn,
  .user-menu {
    display: none !important;
  }
  .settings-btn { display: none !important; }
  
  .header-nav .user-welcome .logout-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.6rem;
  }
  
  /* Mobile modal adjustments */
  .modal-content {
    width: 95%;
    margin: 1rem;
  }
  
  .modal-header {
    padding: 0.75rem 1rem;
  }
  
  .modal-header h3 {
    font-size: 1rem;
  }
  
  .modal-body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;    padding: 1rem;
  }
  
  .form-group input {
    padding: 0.6rem;
  }
  
  .form-actions {
    gap: 0.75rem;
    margin-top: 1rem;
  }
  
  .login-submit-btn, .cancel-btn {
    padding: 0.6rem;
    font-size: 0.8rem;
  }
  
  .header-nav {
  position: relative !important;
  z-index: 1000 !important;
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
  max-width: 100% !important;
  overflow: hidden !important;  position: relative;
  max-width: 100%;
  overflow: hidden;    margin-right: 0.5rem;
  }
  
  .header-nav a {
    font-size: 0.75rem;
    margin: 0 0.15rem;
    padding: 0.3rem;
  }
  
  /* Authenticity page mobile styles */
  .authenticity-content {
    padding: 1rem 0.5rem;
  }
  
  .auth-container {
    padding: 1.5rem;
    margin-top: 0.5rem;
  }
  
  .auth-container h2 {
    font-size: 1.4rem;
  }
  
  /* Auth Viewer Panel Mobile */
  .auth-viewer-panel {
  min-height: calc(100vh - 50px);
  max-height: calc(100vh - 50px);
  overflow: hidden;
  position: relative;    flex-direction: column;
    align-items: stretch;
    height: auto;
    min-height: auto;
    gap: 1rem;
    margin-bottom: 4rem;
    overflow: visible;
  }
  
  .auth-viewer {
    width: 100%;
    height: 30vh;
    min-height: 250px;
    border-radius: 0.5rem;
  }
  
  .auth-viewer-panel .right-column {
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;    flex: none;
    width: 100%;
  }
  
  /* Auth selectors panel on mobile */
  .auth-viewer-panel .selectors-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  max-width: 300px;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 100;    position: static !important;
    transform: none !important;
    height: auto !important;
    max-height: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0.5rem !important;
    z-index: auto !important;
    
    /* Single column for mobile */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
  }

  /* Ensure viewer area is not pushed off-screen on mobile */
  .viewer-panel {
    padding-left: 0 !important;
    margin-left: 0 !important;
  }

  /* Make viewer container take full width on mobile */
  .viewer-container {
    width: 100% !important;
    margin: 0 !important;
  }

  /* Ensure the model-viewer element fills available width on mobile */
  model-viewer.auth-viewer {
    display: block;
    max-width: 100% !important;
  }
  
  /* Mobile size-color selector */
  .auth-viewer-panel .size-color-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
  min-height: 0;
  flex-shrink: 0;    width: 100% !important;
    max-width: 100% !important;
    padding: 0.75rem !important;
    margin-bottom: 0 !important;
  }
  
  .auth-viewer-panel .size-color-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.75rem !important;
  }
  
  .auth-viewer-panel .size-color-swatch {
    width: 70px !important;
    height: 70px !important;
    border-width: 2px !important;
  }
  
  .certificate-header {
    flex-direction: column;
    text-align: center;
  }
  
  .cert-logo {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
  
  .cert-details {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .collection-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .auth-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .auth-button {
    width: 100%;
    max-width: 250px;
  }
  
  /* Remove scroll bar from login dropdown on mobile */
  .login-dropdown {
    overflow-y: visible !important;
    max-height: none !important;
  }
}

/* DESKTOP LAYOUT */
@media screen and (min-width: 1025px) {
  /* Hide mobile toggle button */
  .menu-toggle {
    display: none !important;
  }

  /* Hide mobile tab navigation on desktop */
  .mobile-tab-nav {
    display: none !important;
  }

  
  /* Restore desktop wheel/swatch behavior */
  .mode-wheel {
    display: flex;
  }
  
  .mode-wheel:not(.active) {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
  }
  
  .mode-wheel.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
  }
  
  .mode-swatches {
    position: absolute;
    opacity: 0;
    transform: translateX(-50%) scale(0.9);
    pointer-events: none;
  }
  
  .mode-swatches.active {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    pointer-events: auto;
  }
  
  /* Desktop secret positioning */
  .selectors-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    width: 320px;
    height: calc(100vh - 100px);
    overflow: visible;
    position: fixed;
    left: 1rem;
    top: 70px;
    z-index: 100;
    padding: 1.5rem;
  }
  
  .secret-container {
    justify-self: center;
    margin: 0 1rem 0 8rem;
  }
  
  /* Show all color selectors on desktop */
  .selectors-panel > .color-selector {
    display: flex !important;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    position: relative;
    min-height: 0;
    flex-shrink: 0;
    max-width: 100%;
    width: 100%;
    margin-bottom: 1rem;
    height: 180px; /* Fixed height to fit 3 selectors + secret container */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  /* On desktop, show full user-welcome and hide compact menu */
  .user-menu { display: none !important; }
  #colorwayLimitDisplay,
  #colorwayRequestBtn,
  .collection-link,
  .logout-btn {
    display: inline-flex;
  }
  
  /* Override any mobile tab content rules on desktop */
  .selectors-panel > .color-selector.mobile-tab-content {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .selectors-panel > .color-selector.mobile-tab-content:not(.active) {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .selectors-panel > .color-selector.mobile-tab-content.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Force all color selectors to be visible on desktop regardless of mobile tab state */
  .selectors-panel .color-selector {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .selectors-panel .color-selector:not(.active) {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .selectors-panel .color-selector.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .selectors-panel > .color-wheel-container {
    display: flex !important;
  }
  /* On desktop, show full user-welcome and hide compact menu */
  .user-menu { display: none !important; }
  #colorwayLimitDisplay,
  #colorwayRequestBtn,
  .collection-link,
  .logout-btn {
    display: inline-flex;
  }
  
  /* Adjust viewer panel layout for fixed selectors panel */
  .viewer-panel {
    padding-left: 340px; /* 320px panel width + 20px gap */
  }
  
  .right-column {
    display: none !important; /* Hide the right column on desktop since selectors are fixed */
  }
  
  .viewer {
    flex: 1;
    width: 100%;
    margin-left: 0;
  }
}

/* About page styles */
.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0 auto;
  padding: 2rem;
  max-width: 800px;
  width: 90%;
  box-sizing: border-box;
}

.about-content h2 {
  color: #333;
  font-size: 1.5rem;
  margin: 1.5rem 0 0.5rem;
}

.small-viewer {
  width: 300px;
  height: 300px;
  margin: 1.5rem 0;
}

.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;
}

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

.gate-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(255,255,255,0.15);
  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;
  box-sizing: border-box;
}

.gate-box input::placeholder {
  text-align: center;
}

.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;
  box-sizing: border-box;
}

.gate-box button:hover {
  background: #3355cc;
}

.error-msg {
  color: #ff4d4d;
  font-size: 0.9rem;
  min-height: 1.2rem;
  margin-top: 0.5rem;
}

/* Collection link styling */
.collection-link {
  color: #efca44;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  transition: background-color 0.3s ease;
}

.collection-link:hover {
  background-color: rgba(239, 202, 68, 0.1);
  text-decoration: none;
}

[data-theme="dark"] .collection-link {
  color: #efca44;
}

/* Mobile Color Slider */
  .mobile-color-slider {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.9) !important;
    border-radius: 1rem !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1) !important;
    display: none;
  }
  
  .mobile-color-slider.active {
    display: block;
  }

.slider-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slider-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #333;
}  .color-slider {
    width: 100%;
    height: 30px;
    border-radius: 15px;
    border: none;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
  }

.color-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #ddd;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.color-slider::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #ddd;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hue-slider {
  background: linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
}

.saturation-slider {
  background: linear-gradient(90deg, #808080, #ff0000);
}

.lightness-slider {
  background: linear-gradient(90deg, #000000, #808080, #ffffff);
}

.color-preview {
  width: 100%;
  height: 40px;
  border-radius: 20px;
  border: 2px solid #ddd;
  margin-top: 1rem;
}

/* Hide mobile color slider on desktop */
.mobile-color-slider {
  display: none !important;
}

/* Mobile-specific styles - color picker styles removed */

/* Dark mode toggle slider styles */
.theme-toggle {
  width: 40px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-slider {
  width: 36px;
  height: 18px;
  background: #ccc;
  border-radius: 9px;
  position: relative;
  transition: background 0.3s;
  display: flex;
  align-items: center;
}

.toggle-slider.dark {
  background: #222;
}

.toggle-knob {
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  left: 2px;
  top: 1px;
  transition: left 0.3s, background 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-slider.dark .toggle-knob {
  left: 18px;
  background: #efca44;
}

/* Color Circle Styles */
.default-color-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #ddd;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  display: inline-block;
  margin: 0.25rem;
  position: relative;
}

/* Center color panel contents and adjust headings */
.color-selector-panel .mode-buttons {
  display: none !important; /* Remove buttons above color circles */
}

.selectors-panel,
.selectors-panel .color-selector {
  align-items: center !important;
  text-align: center !important;
}

.selectors-panel .secret-container,
.selectors-panel .system-color-picker,
.selectors-panel .color-swatches {
  margin-left: auto !important;
  margin-right: auto !important;
}

.selectors-panel .color-swatches {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
}

.selectors-panel .selector-label {
  font-size: 1rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
  color: #333 !important;
}

[data-theme="dark"] .selectors-panel .selector-label {
  color: #ffffff !important;
}

.default-color-circle:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.default-color-circle.selected {
  border-color: #efca44;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(239, 202, 68, 0.3);
}

.default-color-circle.selected::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  background: #efca44;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px #fff;
}

/* Quick paint panel theme */
[data-theme="dark"] #quickPaintPanel {
  background: #1e1e1e !important;
  border-left: 1px solid #444 !important;
}
[data-theme="dark"] #quickPaintPanel strong { color: #fff !important; }
[data-theme="dark"] #quickPaintPanel label { color: #ccc !important; }

/* Color circles container */
.color-circles-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
  max-width: 300px;
}

/* Dark mode adjustments */
.dark-mode .default-color-circle {
  border-color: #555;
}

.dark-mode .default-color-circle.selected::after {
  box-shadow: 0 0 0 2px #2c2c2c;
}

/* Color Wheel Toggle Styles */
.selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  grid-column: 1 / -1;
  margin-bottom: 0.5rem;
}

.mode-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: #666;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-toggle:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
}

.mode-toggle svg {
  width: 16px;
  height: 16px;
}

.color-swatches {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.4rem;
  width: 100%;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.mode-swatches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  transition: opacity 0.3s ease;
}

.mode-swatches.active {
  opacity: 1;
  pointer-events: auto;
}

.mode-swatches:not(.active) {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.mode-wheel {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  width: 100%;
  max-width: 120px;
  margin: 0 auto;
}

.mode-wheel.active {
  opacity: 1;
  pointer-events: auto;
}

/* System Color Picker Styles */
.system-color-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem;
  border: none;
  margin: 0.5rem 0;
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.native-color-input {
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: none;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  /* Ensure perfect circle */
  aspect-ratio: 1;
  min-width: 45px;
  min-height: 45px;
  max-width: 45px;
  max-height: 45px;
  box-sizing: border-box;
}

/* Custom color input with gradient rotating border */
.custom-color-swatch-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.25rem;
}

.custom-color-input {
  position: relative;
  background: conic-gradient(from 0deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3, #54a0ff, #ff6b6b);
  background-size: 100% 100%;
  animation: rotate-gradient 3s linear infinite;
  border-radius: 50%;
  padding: 3px;
  box-sizing: border-box;
  border: none;
  outline: none;
  overflow: hidden;
  margin: 0;
}

.custom-color-input::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.custom-color-input::-webkit-color-swatch-wrapper {
  position: relative;
  z-index: 2;
  border-radius: 50%;
  border: none;
  padding: 0;
  outline: none;
}

.custom-color-input::-webkit-color-swatch {
  border-radius: 50%;
  border: none;
  outline: none;
}

.custom-color-input::-moz-color-swatch {
  border-radius: 50%;
  border: none;
  outline: none;
}

@keyframes rotate-gradient {
  0% {
    background: conic-gradient(from 0deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3, #54a0ff, #ff6b6b);
  }
  100% {
    background: conic-gradient(from 360deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3, #54a0ff, #ff6b6b);
  }
}

.native-color-input:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.native-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
  border: 2px solid #eee;
  /* Ensure perfect circle */
  aspect-ratio: 1;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.native-color-input::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
  /* Ensure perfect circle */
  aspect-ratio: 1;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.native-color-input::-moz-color-swatch {
  border: none;
  border-radius: 50%;
  /* Ensure perfect circle */
  aspect-ratio: 1;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

/* Color picker label styles removed - no longer needed */

/* Color picker label hover and span styles removed - no longer needed */
