body {
  margin: 0;
  height: 100vh;
  background: linear-gradient(to top, #e0e0e0, #ffffff);
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
}


#loading-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  flex-direction: column;
  transition: opacity 0.8s ease;
  opacity: 1;
}

#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 5px solid #ccc;
  border-top-color: #FF0004;
  border-right-color: #007DFF;
  border-bottom-color: #00FF21;
  border-left-color: #FFE103;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

#loading-screen.hidden .spinner,
#loading-screen.hidden p {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

header{
	position:absolute;width:100%;backdrop-filter: blur(10px);padding:20px;z-index: 1000;
	border-bottom:1px solid rgba(0,0,0,0.15);
	display:flex;
}

.button-cluster {
   margin-left: auto;
  display: flex;
  gap: 10px; /* Optional: space between buttons */
	margin-right:40px;
}

#three-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  background: transparent;
}

#ui {
  position: absolute;
  top: 100px;
  left: -296px;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 4px 4px 34px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  width: 300px;
  cursor:pointer;
  transition: left 0.4s ease, height 0.4s ease;
  display: flex;
  flex-direction: column;
  height: 580px;
}

#ui:hover{left:-30px;}
.current-selection .label{opacity:0;transition: opacity 0.4s ease;}
#ui:hover .current-selection .label{opacity:1;}
#ui:hover .section-header{border-bottom: 1px solid #ddd;}
#ui:hover .save-section{display:block;opacity:1;transition: opacity 0.4s ease;}

.embedded #ui {top: 20px;}
.embedded header{display:none !important;}

#ui .tag {
  position: absolute;
  top: 10px;
  background: rgba(0, 0, 0, 0.8);
  right: 0;
  color: #fff;
	font-size: 10px;
  font-weight: bold;
  padding: 10px 12px;
  transform: rotate(-90deg);
  transform-origin: top right;
  z-index: 1;
  border-radius: 0 0 4px 4px;
  cursor: default;
}





.section {
	margin:10px;
}

.save-section {
  display:flex;
  opacity:0;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #ddd;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid rgba(0,0,0,0);
}

.current-selection {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: normal;
  color: black; /* Explicitly keep text black */
}


.current-selection .swatch-preview {
  width: 17px;
  height: 17px;
  border-radius: 3px;
  border: 1px solid #444;
  background-color: #fff; /* will be updated in JS */
}

.swatches {
  display: flex;
  max-height: 0;
  overflow: hidden;
  flex-wrap: wrap;
  gap: 6px;
  padding: 17px;
  opacity: 0;
  transition: max-height 0.6s ease-in-out, opacity 0.5s ease-in-out;
}

.section:hover .swatches {
	display: flex;
  	max-height: 120px; /* enough for all swatches */
	opacity: 1;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #888;
  transition: transform 0.15s;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.selected {
  outline: 2px solid #000;
  outline-offset: 1px;
  box-shadow: 0 0 0 2px #fff inset;
}



.share-layout {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 1rem;
}

.share-layout sl-qr-code {
  flex-shrink: 0;
}

.share-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}


.share-buttons sl-button::part(base) {

	font-size: 4rem;  
   border: none !important;
}

	

