* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'IBM Plex Mono', monospace;
  background: #5c4a3a;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

#toolbar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}

.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.2s ease;
  position: relative;
}

.tool-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.tool-btn.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
  box-shadow: 0 0 16px rgba(120, 180, 255, 0.3), inset 0 0 8px rgba(120, 180, 255, 0.1);
}

.tool-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.8;
  font-family: 'IBM Plex Mono', monospace;
}

.tool-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  margin: 0 6px;
}

#color-picker {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 30px;
  z-index: 100;
}

#color-picker.visible {
  display: flex;
}

.color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.color-dot:hover {
  transform: scale(1.2);
}

.color-dot.active {
  border-color: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.4);
}

#trash-can {
  position: fixed;
  top: 30px;
  right: 30px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  border: 2px dashed rgba(255,255,255,0.25);
  border-radius: 16px;
  color: rgba(255,255,255,0.5);
  z-index: 99;
  transition: all 0.3s ease;
}

#trash-can.hidden {
  display: none;
}

#trash-can.hover {
  background: rgba(192, 57, 43, 0.3);
  border-color: rgba(192, 57, 43, 0.6);
  color: #e74c3c;
  transform: scale(1.15);
}

#footer {
  position: fixed;
  bottom: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  font-family: 'IBM Plex Mono', monospace;
  z-index: 101;
  pointer-events: none;
}

#footer a {
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  pointer-events: auto;
}

#footer a:hover {
  color: rgba(255,255,255,0.6);
}

@media (max-width: 600px) {
  #toolbar {
    bottom: 16px;
    padding: 6px 10px;
    gap: 2px;
  }
  .tool-btn {
    padding: 8px 10px;
  }
  .tool-label {
    font-size: 7px;
  }
  #color-picker {
    bottom: 76px;
  }
  #trash-can {
    top: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
  }
}