:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-hover: #1e222b;
  --border: #2a2f3a;
  --text: #eef0f3;
  --text-dim: #9aa1ac;
  --accent: #6c8cff;
  --danger: #ff6c6c;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-hover: #f0f1f4;
    --border: #e2e4e9;
    --text: #14161a;
    --text-dim: #5c6169;
    --accent: #3d5afe;
    --danger: #d93636;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 24px;
}

.back-link {
  display: inline-block;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.back-link:hover { color: var(--text); }

.layout {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.wheel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.wheel-wrap {
  position: relative;
  width: min(100%, 500px);
}

.wheel-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 28px solid var(--accent);
  z-index: 2;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.spin-btn {
  padding: 14px 40px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.spin-btn:hover:not(:disabled) { transform: translateY(-1px); }
.spin-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.entries-section h1 {
  margin: 0 0 20px;
  font-size: 1.4rem;
}

.add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.add-form input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
}

.add-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.add-form button {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
}

.entry-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

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

.entry-list li span.entry-text {
  flex: 1;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-remove {
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 4px;
}
.entry-remove:hover { color: var(--danger); }

.empty-hint {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 8px 2px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.overlay.hidden { display: none; }

.winner-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 40px;
  text-align: center;
  min-width: 280px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.winner-label {
  margin: 0 0 8px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.winner-name {
  margin: 0 0 24px;
  font-size: 1.8rem;
  font-weight: 700;
  word-break: break-word;
}

.winner-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.primary-btn, .secondary-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.secondary-btn {
  background: transparent;
  color: var(--text);
}
