* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0a0e14;
  color: #c9d1d9;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  user-select: none;
}

.sidebar {
  width: 260px;
  min-width: 260px;
  background: linear-gradient(180deg, #111820 0%, #0d1318 100%);
  border-right: 1px solid #1a2332;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  gap: 24px;
  z-index: 2;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid #1a2332;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #f6c46a 0%, #e8a020 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(246, 196, 106, 0.2);
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: #e6edf3;
  letter-spacing: -0.3px;
}

.logo-sub {
  font-size: 11px;
  color: #484f58;
  margin-top: 2px;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  color: #484f58;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}

.materials-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.material-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid #1a2332;
  border-radius: 10px;
  color: #8b949e;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.material-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.02) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.material-btn:hover {
  border-color: #2a3a4a;
  color: #c9d1d9;
}

.material-btn:hover::before {
  opacity: 1;
}

.material-btn.active {
  border-color: #2a4a7a;
  background: rgba(88, 166, 255, 0.06);
  color: #e6edf3;
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.1), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.swatch {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  flex-shrink: 0;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3);
}

.shortcut {
  margin-left: auto;
  font-size: 11px;
  color: #484f58;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-label {
  font-size: 12px;
  color: #8b949e;
  font-weight: 500;
}

.slider-value {
  font-size: 12px;
  color: #58a6ff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #1a2332;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #58a6ff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(88, 166, 255, 0.3);
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #58a6ff;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(88, 166, 255, 0.3);
}

.clear-btn {
  padding: 12px 16px;
  background: rgba(218, 54, 51, 0.08);
  border: 1px solid rgba(218, 54, 51, 0.2);
  border-radius: 10px;
  color: #f85149;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.clear-btn:hover {
  background: rgba(218, 54, 51, 0.15);
  border-color: rgba(218, 54, 51, 0.4);
  box-shadow: 0 4px 16px rgba(218, 54, 51, 0.15);
  transform: translateY(-1px);
}

.clear-btn:active {
  transform: translateY(0);
}

.pause-btn {
  padding: 12px 16px;
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 10px;
  color: #58a6ff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.pause-btn:hover {
  background: rgba(88, 166, 255, 0.15);
  border-color: rgba(88, 166, 255, 0.4);
  box-shadow: 0 4px 16px rgba(88, 166, 255, 0.15);
  transform: translateY(-1px);
}

.pause-btn:active {
  transform: translateY(0);
}

.stats-container {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #1a2332;
}

.stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.stat-label {
  color: #484f58;
  font-weight: 500;
}

.stat-value {
  color: #8b949e;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.canvas-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(88, 166, 255, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(95, 51, 243, 0.02) 0%, transparent 50%),
    #0a0e14;
}

.canvas-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 120px rgba(88, 166, 255, 0.03);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: none;
  border: 3px solid transparent;
  transition: border-color 0.2s ease;
}

canvas.erase-mode {
  border-color: #da3633;
}

.cursor {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border-width: 2px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  display: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.cursor.sand {
  border-color: #f6c46a;
  background: rgba(246, 196, 106, 0.2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 12px rgba(246, 196, 106, 0.3);
}

.cursor.water {
  border-color: #4579dd;
  background: rgba(69, 121, 221, 0.2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 12px rgba(69, 121, 221, 0.3);
}

.cursor.wall {
  border-color: #6c757d;
  background: rgba(108, 117, 125, 0.2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 12px rgba(108, 117, 125, 0.3);
}

.cursor.acid {
  border-color: #5f33f3;
  background: rgba(95, 51, 243, 0.2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 12px rgba(95, 51, 243, 0.3);
}

.cursor.erase {
  border-color: #da3633;
  background: rgba(218, 54, 51, 0.2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 12px rgba(218, 54, 51, 0.3);
}
