/* =========================
   BASE / RESET
========================= */
html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
  font-family: Arial, sans-serif;
  background: #000;
}

body {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* =========================
   THREE.JS CANVAS AREA
========================= */
#app {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: transparent;
}

canvas {
  display: block;
  background: transparent !important;
}

/* =========================
   PAINEL (BASE DESKTOP)
========================= */
#panel {
  position: fixed;
  top: 20px;
  left: 20px;

  width: min(260px, 85vw);
  max-height: calc(100vh - 40px);

  display: flex;
  flex-direction: column;

  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);

  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);

  overflow: hidden;
  z-index: 1000;
}

#panel h2 {
  margin: 10px 0;
  text-align: center;
  font-size: 22px;
}

/* =========================
   SCROLL AREA
========================= */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 10px;

  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scroll-area::-webkit-scrollbar {
  width: 6px;
}

.scroll-area::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
}

/* =========================
   SECTIONS
========================= */
.section h3 {
  margin: 0;
  font-size: 14px;
  cursor: pointer;

  padding: 6px;
  border-radius: 6px;

  position: sticky;
  top: 0;

  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.section h3:hover {
  background: rgba(0,0,0,0.05);
}

/* items collapse */
.items {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.section.active .items {
  display: flex;
}

/* =========================
   BOTÕES
========================= */
#panel button {
  width: 100%;
  max-width: 220px;
  align-self: center;

  padding: 7px 10px;
  font-size: 13px;

  border: 1px solid #d0d0d0;
  border-radius: 8px;

  background: white;
  cursor: pointer;

  transition: 0.2s;
}

#panel button:hover {
  transform: scale(1.03);
  background: #f2f2f2;
}

#panel button.active {
  background: #2d2d2d;
  color: white;
}

/* =========================
   UI CONTROLS
========================= */
#ui-controls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  gap: 12px;

  z-index: 9999;
  background: transparent;
}

#ui-controls button {
  width: 84px;
  height: 84px;

  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.12);
  background: white;

  cursor: pointer;

  font-size: 20px;
  font-weight: 600;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;

  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

#ui-controls button:hover {
  transform: scale(1.08);
  background: #f5f5f5;
}

#ui-controls button:active {
  transform: scale(0.94);
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* =========================
   LOGOS
========================= */
#branding-logos {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

#branding-logos img {
  width: 180px;
  height: auto;
}

#branding-bottom {
  position: fixed;
  bottom: 10px;
  right: 20px;

  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;

  z-index: 1000;
}

#branding-bottom img {
  width: 160px;
  height: auto;
}

#branding-text {
  font-size: 18px;
  opacity: 0.75;
  white-space: nowrap;
}

/* =========================
   📱 TABLET / MOBILE GRANDE
========================= */
@media (max-width: 1024px) and (orientation: portrait) {

  #panel {
    width: min(280px, 35vw);
    left: 12px;
    top: 12px;
    max-height: 65vh;
  }

  #panel h2 {
    font-size: 16px;
  }

  #panel button {
    font-size: 12px;
  }

  #ui-controls button {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  #branding-logos img {
    width: 110px;
  }

  #branding-bottom img {
    width: 80px;
  }

  #branding-text {
    font-size: 8px;
  }
}

/* =========================
   📱 MOBILE PEQUENO
========================= */
@media (max-width: 480px) {

#panel {
  width: 35vw;
  left: 10px;
  top: 10px;
  transform: none;
}

  #panel h2 {
    font-size: 16px;
  }

  #panel button {
    font-size: 12px;
    padding: 6px;
  }

  #ui-controls button {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
    #branding-logos img {
    width: 120px;
  }

  #branding-bottom img {
    width: 80px;
  }

  #branding-text {
    font-size: 8px;
  }
}