html,
body {
  width: 100%;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: #3a3a3e;
}

#renderCanvas {
  width: 100%;
  height: 100%;
  display: block;
  font-size: 0;
  cursor: grab;
}

#fps {
  position: absolute;
  text-align: center;
  font-size: 24px;
  color: greenyellow;
  top: 15px;
  left: 10px;
  width: 60px;
  height: 20px;
}
#forward,
#home,
#backwards {
  display: none;
  font-family: "Finger Paint", cursive;
  font-size: 13px; /* Adjust as needed */
  letter-spacing: 1px;
}
.show-controls #forward,
.show-controls #home,
.show-controls #backwards {
  display: block;
}
#forward {
  position: absolute;
  z-index: 1;
  bottom: 5%;
  left: 150px;
  background: #232325;
  color: #f8f8fa;
  height: 40px;
  width: 100px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

#home {
  position: absolute;
  z-index: 1;
  bottom: 5%;
  right: 30px;
  background: #232325;
  color: #f8f8fa;
  height: 40px;
  width: 160px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

#backwards {
  position: absolute;
  z-index: 1;
  bottom: 5%;
  left: 30px;
  background: #232325;
  height: 40px;
  width: 100px;
  color: #f8f8fa;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Optional hover effects */
#forward:hover,
#home:hover,
#backwards:hover {
  background: #3a3a3e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#forward:active,
#home:active,
#backwards:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
#musicplay {
  position: absolute;
  z-index: 1;
  bottom: 5%;
  right: 30px;
  background: #333;
  height: 50px;
  width: 100px;
  color: white;
  border-radius: 20px;
}
.art-popup {
  display: none;
  position: absolute;
  top: 50%;
  right: 5%;
  width: 37%;
  padding: 20px;
  background: white;
  border-radius: 20px;
  transform: translateY(-50%);
  z-index: 1100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Finger Paint font for h2 */
.art-popup h2 {
  font-family: "Montserrat", sans-serif;
  font-weight: 600; /* Semi-bold - adjust as needed */
  font-size: 32px;
  margin-top: 10px;
  margin-bottom: 20px;
  color: #222;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Avenir font for paragraphs */
.art-popup p {
  font-family:
    "Nunito Sans", "Avenir", "Arial", sans-serif; /* Fallback chain */
  font-size: 13px; /* As requested */
  line-height: 1.6;
  color: #333;
  margin-bottom: 15px;
  font-weight: 400;
  transition: min-height 0.3s ease;
}

/* Avenir font for info class with size 11px */
.art-popup .info {
  font-family: "Nunito Sans", "Avenir", "Arial", sans-serif;
  font-size: 11px !important; /* As requested */
  color: #a84611;
  display: block;
  margin-bottom: 5px;
  font-weight: 600; /* Slightly bolder for emphasis */
  letter-spacing: 0.3px;
}

/* Close button */
.art-popup .close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #eee;
  border-radius: 50%;
  cursor: pointer;
  padding: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
}

.art-popup .close-btn img {
  width: 16px;
  height: 16px;
  display: block;
}

.art-popup .close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(1.1) rotate(90deg);
  border-color: #ccc;
}

.art-popup .close-btn:active {
  transform: scale(0.95) rotate(90deg);
}

/* Action button */
.art-popup .action-btn {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: #232325;
  color: white;
  border: none;
  border-radius: 25px;
  padding: 12px 24px;
  cursor: pointer;
  font-size: 14px;
  font-family: "Nunito Sans", "Avenir", "Arial", sans-serif;
  font-weight: 600;
  z-index: 10;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  text-decoration: none;
}

.art-popup .action-btn.btn-action-1 {
  right: 240px;
}

.art-popup .action-btn.btn-action-2 {
  right: 15px;
}

.hidden{
  display: none;
}

.popup-content,
.popup-shopinfo {
  margin-bottom: 0px;
  margin-top: 0px;
  min-height: 35vh;
  max-height: 40vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.popup-content::-webkit-scrollbar,
.popup-shopinfo::-webkit-scrollbar {
  -webkit-appearance: none;
  width: 6px;
}

.popup-content::-webkit-scrollbar-thumb,
.popup-shopinfo::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

.popup-content::-webkit-scrollbar-track,
.popup-shopinfo::-webkit-scrollbar-track {
  background-color: rgba(0, 0, 0, 0.05);
}

.shopinfo-btn{
  background: #232325;
  color: white;
  border: 0;
  border-radius: 25px;
  padding: 12px 24px;
  cursor: pointer;
  font-size: 14px;
  font-family: "Nunito Sans", "Avenir", "Arial", sans-serif;
  font-weight: 600;
  z-index: 10;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  text-decoration: none;
  margin-bottom: 5px;
  /*margin-right: 50px;*/

  /*display: block;
  width: 45%;*/
  flex: 1 1 40%;
  text-align: center;
  padding: 10px;
  box-sizing: border-box;
}


/***Media for pop-ups*/
@media (orientation: landscape) and  (max-width: 900px) {

  #forward, #home, #backwards{
    font-size: 10px;
  }

  .art-popup{
    max-height: 70vh;
  }

  .art-popup h2{
    font-size: 16px;
    margin-bottom: 5px
  }

  .art-popup .action-btn, .shopinfo-btn{
    font-size: 10px;
  }

  .popup-content,
  .popup-shopinfo {
    min-height: 50vh;
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .art-popup .action-btn.btn-action-1 {
    right: 200px;
  }
}

@media  (orientation: portrait) and  (max-width: 768px){
  #forward, #home, #backwards{
    font-size: 10px;
  }

  .art-popup{
    width: 77%;
    max-height: 85vh;
  }

  .art-popup h2{
    font-size: 16px;
    margin-bottom: 5px
  }

  .art-popup .action-btn, .shopinfo-btn{
    font-size: 10px;
  }

  .popup-content,
  .popup-shopinfo {
    min-height: 65vh;
    max-height: 65vh;
    overflow-y: auto;
    overflow-x: hidden;
  }

  #backwards{
    left: 5px !important;
  }

  #forward{
    left: 110px !important;
  }

  #home{
    right: 5px !important;
  }
}


/****end Media*/


.no-decoration{
  text-decoration: none;
}

.art-popup .action-btn:hover, .art-popup .shopinfo-btn:hover {
  background: #3a3a3e;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.art-popup .action-btn:active, .art-popup .shopinfo-btn:hover {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* ===== Rotate Phone Popup ===== */
#renderCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  z-index: 0;
}
.rotate-popup {
  position: absolute;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.95);
  width: min(80vw, 500px);
  height: auto;
  max-height: 80vh;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
  border-radius: 20px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.rotate-image {
  max-width: 30vw;
  max-height: 20vh;
  margin-bottom: 20px;
}

.rotate-text {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(16px, 4vw, 20px);
  line-height: 1.4;
  color: #222;
}

.rotate-popup .close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}
.rotate-popup .close-btn img {
  width: 20px;
  height: 20px;
  display: block;
}
.rotate-popup .close-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.2);
  transition: all 0.2s ease;
}

.help-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1000; /* Higher z-index for better visibility */
  transform: translate3d(0, 0, 0); /* Hardware acceleration */
}

.help-btn img {
  width: 32px; /* Default for desktop */
  height: 32px;
  transition: transform 0.2s ease;
  pointer-events: none; /* Prevents image from interfering with button click */
}

.help-btn:hover img {
  transform: scale(1.1);
}

.help-btn:active img {
  transform: scale(0.95);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .help-btn {
    top: 15px;
    right: 15px;
  }

  .help-btn img {
    width: 32px; /* Slightly larger for mobile touch targets */
    height: 32px;
  }
}

/* Help Panel - Show only your image with transparent background */
.help-panel {
  position: fixed;
  z-index: 9999;
  background: transparent !important; /* Fully transparent */
  display: none; /* Hidden by default */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 0; /* Remove border radius if not needed */
  box-shadow: none; /* Remove shadow if not needed */
  overflow: visible;
  pointer-events: none; /* Allow clicks through panel except close button */
}

/* When panel is active/visible */
.help-panel.active {
  display: block;
  pointer-events: auto; /* Re-enable clicks when active */
}

/* Your help panel image - preserve its original design */
.help-panel > img {
  width: auto;
  height: auto;
  max-width: min(60vw, 586.5px); /* Half of original values */
  max-height: min(60vh, 343.5px); /* Half of original values */
  display: block;
  object-fit: contain; /* Keep aspect ratio */
  border-radius: 0;
}

/* Close button positioned relative to the image */
.help-panel-close {
  position: absolute;
  top: 30px;
  right: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 10;
  pointer-events: auto; /* Ensure close button is clickable */
  transition: all 0.2s ease;
}

.help-panel-close img {
  width: 32px;
  height: 32px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.help-panel-close:hover {
  transform: scale(1.1);
}

.help-panel-close:active {
  transform: scale(0.95);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .help-panel > img {
    max-width: 95vw;
    max-height: 85vh;
  }

  .help-panel-close {
    top: 10px;
    right: 10px;
  }

  .help-panel-close img {
    width: 28px;
    height: 28px;
  }
}

/* For very small screens */
@media (max-width: 480px) {
  .help-panel > img {
    max-width: 98vw;
    max-height: 80vh;
  }

  .help-panel-close {
    top: 8px;
    right: 8px;
  }

  .help-panel-close img {
    width: 24px;
    height: 24px;
  }
}

#customLoadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.loading-container {
  text-align: center;
}

.logo {
  width: 250px;
  height: auto;
  margin-bottom: 30px;
  filter: brightness(0) invert(1);
}

.spinner-container {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin: 0 auto;
}

.loading-label {
  color: white;
  margin-top: 15px;
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-family: monospace;
}

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


/* Set the width and height of the scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

/* Set the background color of the scrollbar */
::-webkit-scrollbar-track {
  background-color: #f1f1f1;
}

/* Set the color of the scrollbar thumb */
::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 5px;
}

/* Keep the scrollbar always visible */
::-webkit-scrollbar-thumb:vertical {
  min-height: 50px;
}