/* Toolbar height variable for easier stacking */
:root {
  --toolbar-height: 64px;
  --toolbar-gap: 8px; /* Increased for more space above footer */
}
.submenu-button input[type="file"] {
  display: none !important;
}
/* Base Styles */
html, body {
  height: 100%;
  margin: 0;
  background: #1b1b1b;
  font-family: system-ui;
}

canvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

.hud {
  position: fixed;
  left: 12px;
  bottom: 12px;
  color: #cfe7ff;
  opacity: .9;
  font: 12px/1.3 system-ui;
}

/* Notification System */
.notif-status {
  position: fixed;
  bottom: calc(var(--toolbar-height) * 2 + var(--toolbar-gap) * 2); /* always above toolbar and footer */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: auto;
  min-width: 200px; /* Matches typical toolbar width */
}

 .notif-msg {
  background: rgba(44,44,44,0.7);
  color: #FFF;
  border-radius: 20px;
  padding: 12px 20px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  box-sizing: border-box;
}

/* Header and Footer */
.bonsai-header-bar, .bonsai-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100vw;
  max-width: 100vw;
  box-sizing: border-box;
  padding: 5vmin 5vmin;
  position: fixed;
  left: 0;
  z-index: 10;
  pointer-events: none;
}

.bonsai-header-bar {
  top: 0;
  background: none;
}

.bonsai-footer-bar {
  bottom: 0;
  background: none;
  min-height: 48px; /* Ensure footer is always visible and not overlapped */
}

.bonsai-header-left, .bonsai-header-center, .bonsai-header-right,
.bonsai-footer-left, .bonsai-footer-center, .bonsai-footer-right, a {
  flex: 1;
  text-align: center;
  color: #cfe7ff;
  font-size: clamp(.8rem, 2vw, 18px);
  font-family: 'Doto', system-ui, Arial, sans-serif;
  letter-spacing: 0.04em;
  pointer-events: auto;
}
a {
  text-decoration: none;
  
}
.bonsai-header-left, .bonsai-footer-left {
  text-align: left;
}

.bonsai-header-right, .bonsai-footer-right {
  text-align: right;
}

/* Custom Toolbar Styles */
.bonsai-toolbar {
  position: fixed;
  bottom: 48px; /* Always 48px above the bottom edge on desktop */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  z-index: 1000;
  pointer-events: auto;
  gap: 8px;
}

.toolbar-section {
  display: flex;
  align-items: center;
  background: #E5E5E5;
  border-radius: 32px;
  padding: 0;
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: 64px;
  height: 64px;
}

.toolbar-section.expanded {
  background: rgba(255, 255, 255, 0.8);
  padding-right: 8px;
  width: auto;
}

.section-button {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.section-button:hover {
  transform: scale(1.05);
}

.toolbar-section.expanded .section-button {
  color: #000;
}

.section-submenu {
  display: flex;
  gap: 8px;
  max-width: 0;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  margin-left: 8px;
}

.section-submenu.expanded {
  max-width: 400px;
  opacity: 1;
}

.submenu-button {
  height: 40px;
  padding: 8px 12px;
  border-radius: 20px;
  border: none;
  background: #FFF;
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.submenu-button span {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  /* color is inherited from .submenu-button */
}

.submenu-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.submenu-button.active {
  background: #000;
  color: #FFF;
}

.submenu-button.active img {
  filter: brightness(0) invert(1);
}

.submenu-button .icon {
  width: 24px;
  height: 24px;
}

.section-button img {
  width: 40px;
  height: 40px;
}

.submenu-button img {
  width: 24px;
  height: 24px;
}

/* Responsive Design */
@media (max-width: 600px) {
  .bonsai-header-bar, .bonsai-footer-bar {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto;
    padding: 3vmin 2vmin !important;
    min-height: 32px;
  }
  .bonsai-header-center, .bonsai-header-right, .bonsai-header-left {
    width: 100%;
    text-align: center !important;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
  }
  .bonsai-header-right {
    margin-top: 2px;
    /* opacity: 0.85; */
  }
  .bonsai-footer-bar {
    justify-content: center !important;
  }
  .bonsai-footer-left {
    text-align: center !important;
    width: 100vw !important;
    flex: none !important;
  }
  .bonsai-footer-right {
    display: none !important;
  }
  .bonsai-footer-left {
    text-align: center !important;
    width: 100%;
  }
  .bonsai-toolbar {
    bottom: 48px !important; /* Always 32px above the bottom edge on mobile */
  }
  :root {
    --toolbar-height: 44px;
    --toolbar-gap: 24px; /* Increased for more space above footer on mobile */
  }
  .bonsai-footer-bar {
    min-height: 32px;
  }
  .bonsai-toolbar {
    bottom: 2%;
    gap: 4px;
    padding: 0 2vw;
    max-width: 98vw;
    overflow-x: auto;
    left: 50%;
    transform: translateX(-50%);
  }
  .toolbar-section {
    width: 44px;
    height: 44px;
    border-radius: 22px;
  }
  .toolbar-section.expanded {
    padding-right: 4px;
  }
  .section-button {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }
  .section-button img {
    width: 28px;
    height: 28px;
  }
  .section-submenu {
    gap: 4px;
    margin-left: 4px;
  }
  .submenu-button {
    height: 28px;
    padding: 4px 8px;
    border-radius: 14px;
    font-size: 10px;
  }
  .submenu-button .icon,
  .submenu-button img {
    width: 16px;
    height: 16px;
  }
  .bonsai-overlay-container {
    padding: 2.5vmin;
  }
}