:root {
  --bg-1: #0f172a;
  --bg-2: #1e293b;
  --text: #e5eefc;
  --muted: #a6b4d0;
  --card: rgba(15, 23, 42, 0.72);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(96, 165, 250, 0.15), transparent 35%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(320px, 1fr);
  gap: 32px;
  align-items: center;
  padding: 32px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  border-radius: 28px;
  padding: 32px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #93c5fd;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

.subtitle {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1rem;
}

.controls {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  color: #08111f;
  background: linear-gradient(135deg, #fde68a, #f97316);
  box-shadow: 0 10px 25px rgba(249, 115, 22, 0.32);
}

.btn.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-card,
.result-card {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-label,
.result-label {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.wheel-area {
  position: relative;
  min-height: 640px;
  display: grid;
  place-items: center;
}

.wheel-wrap {
  position: relative;
  width: min(72vw, 560px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.pointer {
  position: absolute;
  top: calc(50% - min(36vw, 280px) - 18px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 34px solid #f8fafc;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.28));
  z-index: 4;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 10px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.28);
  position: relative;
  will-change: transform;
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.segment-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

.wheel-center {
  position: absolute;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
  background: radial-gradient(circle at top, #ffffff, #e2e8f0);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    0 12px 30px rgba(0, 0, 0, 0.28);
  z-index: 3;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wheel-center:hover {
  transform: scale(1.03);
}

.wheel-center:active {
  transform: scale(0.98);
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .wheel-area {
    min-height: auto;
    padding-bottom: 24px;
  }

  .wheel-wrap {
    width: min(88vw, 460px);
  }

  .pointer {
    top: -8px;
  }
}
