:root {
  color-scheme: dark;
  --bg: #12131a;
  --panel: #1c1e29;
  --line: #2c2f40;
  --text: #f2f3f7;
  --muted: #9a9fb5;
  --accent: #ffc857;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 30% 20%, #23263a, var(--bg) 60%);
  color: var(--text);
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
  align-items: start;
}

/* Grid items default to min-width auto, which lets the 1000px canvas widen
   the column beyond the viewport. */
.stage,
.panel {
  min-width: 0;
}

h1 {
  line-height: 1.1;
  margin: 0 0 1rem;
  text-align: center;
  letter-spacing: 0.04em;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.wheel-wrap {
  position: relative;
  width: min(100%, 70vh);
  margin: 0 auto;
  aspect-ratio: 1;
}

#wheel {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  box-shadow: 0 0 0 8px var(--panel), 0 0 0 10px var(--line), 0 30px 60px rgb(0 0 0 / 0.5);
}

.pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 40px solid var(--accent);
  filter: drop-shadow(0 4px 4px rgb(0 0 0 / 0.5));
}

#spin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 6px solid var(--panel);
  border-radius: 50%;
  background: var(--accent);
  color: #1a1a1a;
  font-size: clamp(0.9rem, 2.4vw, 1.4rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.15s;
}

#spin:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.06);
}

#spin:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

#result {
  min-height: 2.5rem;
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
}

#result.win {
  color: var(--accent);
  animation: pop 0.5s ease-out;
}

@keyframes pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}

.panel {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

form {
  display: flex;
  gap: 0.5rem;
}

input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

button {
  font: inherit;
}

form button,
.ghost {
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #1a1a1a;
  font-weight: 600;
  cursor: pointer;
}

.ghost {
  width: 100%;
  margin-top: 1rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

ul {
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

li .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

li span.label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

li button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
}

li button:hover {
  color: #ff6b6b;
}

.check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 800px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    padding: 1rem;
  }

  .wheel-wrap {
    width: min(100%, 60vh);
  }
}
