/* === General Styles === */
body {
  margin: 0;
  overflow: hidden;
  font-family: Arial, sans-serif;
  background-color: #f3f3f3;
}

canvas {
  display: block;
}

/* === UI Container === */
.ui {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px;
  z-index: 10;
  background: transparent;
  flex-wrap: wrap;
}

/* === Buttons === */
button {
  margin: 6px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: linear-gradient(to right, #0f3057, #2c6975);
  color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
  min-width: 140px;
  max-width: 300px;
  width: auto;
}

button:hover {
  transform: translateY(-2px);
  background: linear-gradient(to right, #2c6975, #0f3057);
}

#door-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(70%);
}

/* === Color Picker === */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.color {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  border: 2px solid white;
  box-shadow: 0 0 2px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.color:hover {
  transform: scale(1.1);
  border-color: #888;
}

/* === Info Button === */
.info-btn {
  all: unset;
  cursor: pointer;
  font-size: 40px;
  color: #0f3057;
  margin-left: 40px;
}

.info-btn:hover {
  background: none;
}

/* === About Panel === */
#about-panel {
  display: none;
  position: fixed;
  top: 10%;
  left: 5%;
  width: 65%;
  background: white;
  padding: 24px;
  border-radius: 12px;
  z-index: 9999;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: #222;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#about-panel h3 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #111;
}

/* === Loader Overlay === */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #eae3dd;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Spinner Icon Animation */
.spinner-icon {
  display: inline-block;
  font-size: 3rem;
  color: #0f3057;
  animation: spin 1s linear infinite;
}

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

/* === Responsive Adjustments (Mobile) === */
@media (max-width: 900px) {
  .ui {
    left: 0;
    transform: none; /* Remove center offset for full-width */
    width: 100vw;
    padding: 10px;
    box-sizing: border-box;
  }

  .ui-row {
    display: flex;
    gap: 8px;
    width: 100%;
    padding: 0;
  }

  .ui-row button {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 12px 0 !important;
    font-size: 16px !important;
    width: auto !important;
  }

  .color-picker {
    flex-wrap: nowrap; /* Override default wrap on mobile */
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
  }

  .color-picker .color {
    width: 37px;
    height: 37px;
  }

  .color-picker .info-btn {
    margin: 0;
    padding: 0;
    font-size: 32px;
    flex: 0 0 auto;
  }

#about-panel {
  font-size: 14px;
  width: 90%;
  max-width: none;
  padding: 16px; 
  box-sizing: border-box;
}


  #about-panel h3 {
    font-size: 20px;
  }

  #about-panel p {
    font-size: 14px;
  }
}
