:root {
  --bg-color: #050505;
  --text-main: rgba(255, 255, 255, 0.9);
  --text-muted: rgba(255, 255, 255, 0.5);
  --surface-color: rgba(20, 20, 20, 0.6);
  --surface-border: rgba(255, 255, 255, 0.1);
  --accent-color: #3b82f6;
  /* Modern Blue */
  --danger-color: #ef4444;
  /* Modern Red */
  --font-family: 'Inter', sans-serif;
  --transition-speed: 0.3s;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-color);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: var(--font-family);
  color: var(--text-main);
}

#ui {
  position: absolute;
  top: 30px;
  left: 30px;
  z-index: 10;
  background: var(--surface-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  width: 300px;
  transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
}

#ui.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
}

h1 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin: 0 0 20px 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

h1::before {
  content: '';
  display: block;
  width: 4px;
  height: 14px;
  background: var(--accent-color);
  border-radius: 2px;
}

.control-group {
  margin-bottom: 24px;
}

.label {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
  display: block;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Segmented Control */
.segmented-control {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 10px;
  position: relative;
  gap: 4px;
}

.mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-family: var(--font-family);
}

.mode-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.mode-btn:hover:not(.active) {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

/* Button Group */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Main Action Button */
#killSun {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #ff4d4d 0%, #cc0000 100%);
  border: none;
  color: white;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 14px;
  letter-spacing: 0.5px;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
  position: relative;
  overflow: hidden;
}

#killSun:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.8);
  box-shadow: none;
  transform: none !important;
}

#killSun::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

#killSun:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4);
}

#killSun:hover::after {
  opacity: 1;
}

#killSun:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* Restart Button */
#restartBtn {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

#restartBtn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

#restartBtn:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.02);
}

canvas {
  display: block;
}