body {
  margin: 0;
  overflow: hidden;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: #fff;
}

canvas {
  background: #111;
  cursor: crosshair;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.material-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(10px);
  padding: 24px;
  width: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.material-btn {
  display: block;
  margin: 0;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.material-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.material-btn.active {
  background: rgba(0, 200, 0, 0.2);
  border-color: rgba(0, 200, 0, 0.4);
  box-shadow: 0 0 20px rgba(0, 200, 0, 0.2);
}

.material-category {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.material-category:last-of-type {
  border-bottom: none;
}

.category-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px 0;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.material-category .material-btn {
  margin-bottom: 8px;
}

.material-category .material-btn:last-child {
  margin-bottom: 0;
}

.gravity-control, .settings-control {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-control label {
  display: block;
  margin-top: 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.toggle-container {
  display: flex;
  align-items: center;
  margin-top: 16px;
  gap: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: rgba(0, 200, 0, 0.5);
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.slider {
  width: 100%;
  height: 6px;
  margin-top: 12px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  transition: opacity 0.2s;
}

.slider:hover {
  opacity: 0.9;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.1);
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Achievement styles */
.achievements-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.98);
  backdrop-filter: blur(20px);
  color: white;
  z-index: 1000;
  padding: 48px;
  overflow-y: auto;
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.achievements-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.achievements-header h3 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 16px;
}

.achievements-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 32px;
  cursor: pointer;
  padding: 8px;
  transition: all 0.2s;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievements-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: scale(1.1);
}

.achievements-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.achievement {
  background: rgba(255, 255, 255, 0.03);
  padding: 24px;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.achievement:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.05);
}

.achievement.earned {
  background: linear-gradient(45deg, rgba(0, 200, 0, 0.1), rgba(0, 200, 0, 0.05));
  border: 1px solid rgba(0, 200, 0, 0.2);
  animation: achievementEarned 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.achievement-icon {
  font-size: 32px;
  min-width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
}

.achievement-info {
  flex-grow: 1;
}

.achievement-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #fff;
}

.achievement-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.achievement-status {
  font-size: 24px;
}

.achievement.hidden {
  opacity: 0.7;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.achievement.hidden:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.achievement.hidden .achievement-icon {
  filter: blur(2px);
}

.achievement.hidden:hover .achievement-icon {
  filter: blur(0);
}

.achievement.hidden.earned {
  opacity: 1;
  background: linear-gradient(45deg, rgba(0, 200, 0, 0.1), rgba(0, 200, 0, 0.05));
  border: 1px solid rgba(0, 200, 0, 0.2);
}

/* Achievement Banner */
.achievement-banner {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 200, 0, 0.3);
  border-radius: 16px;
  padding: 20px 32px;
  color: white;
  z-index: 1001;
  transition: top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  min-width: 320px;
}

.achievement-banner.show {
  top: 24px;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 20px;
}

.banner-icon {
  font-size: 32px;
  animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.banner-text {
  flex-grow: 1;
}

.banner-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #0c0;
  margin-bottom: 6px;
  font-weight: 600;
}

.banner-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.banner-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.controls-info {
  position: fixed;
  bottom: 24px;
  left: 300px;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(10px);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 14px;
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  line-height: 1.6;
}

.controls-info.visible {
  display: block;
}

/* Add loading screen styles */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #111;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-screen img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.loading-bar-container {
  width: 80%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  z-index: 2;
  margin-bottom: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.loading-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0c0, #0f0);
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.loading-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

.loading-text {
  margin-bottom: 20px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-family: monospace;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes achievementEarned {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}