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

:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card-border: #334155;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #475569;
  --radius: 14px;
  --transition: 0.18s ease;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.app {
  width: 100%;
  max-width: 460px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.25rem;
  padding: 0 2px;
}

.logo {
  width: 26px;
  height: 26px;
  color: var(--accent);
  flex-shrink: 0;
}

h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--card-border);
}

/* Section label */
.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Options */
.options-section {
  padding: 1.5rem 1.5rem 1.25rem;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.option-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.option-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.option-input::placeholder {
  color: var(--text-dim);
}

.option-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.delete-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: 7px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.delete-btn svg {
  width: 14px;
  height: 14px;
}

.delete-btn:hover:not(:disabled) {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.delete-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

/* Add button */
.add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: 1px dashed var(--card-border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.add-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.add-btn:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(129, 140, 248, 0.06);
}

.add-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Wheel */
.wheel-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.5rem 1.5rem;
}

#wheel-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

#wheel-canvas:active {
  opacity: 0.85;
}

#wheel-canvas.spinning {
  cursor: default;
}

/* Result */
.result-section.hidden {
  display: none;
}

.result-inner {
  padding: 1.25rem 1.5rem 1.5rem;
}

.result-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
}

.result-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.result-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.result-actions {
  display: flex;
  gap: 0.625rem;
}

.result-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.result-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.result-btn--remove {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
}

.result-btn--remove:hover {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.result-btn--keep {
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.28);
  color: var(--accent);
}

.result-btn--keep:hover {
  background: rgba(129, 140, 248, 0.22);
  border-color: var(--accent);
}

/* Confetti canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}
