:root {
  color-scheme: dark;
  --bg: #030303;
  --surface: rgba(10, 10, 11, 0.86);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f5f0;
  --muted: #a6a6a0;
  --signal: #e9ff70;
  --green: #54ff84;
  --danger: #ff5c7a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(115deg, rgba(233, 255, 112, 0.08), transparent 28rem),
    linear-gradient(245deg, rgba(255, 255, 255, 0.06), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

button,
input,
select { font: inherit; }

.app {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) 0 72px;
}

.hero {
  display: grid;
  justify-items: center;
  padding: 28px 0 clamp(34px, 6vw, 58px);
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 38px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 760;
}

.brand-mark {
  width: 17px;
  height: 17px;
  border: 2px solid var(--text);
  border-radius: 50%;
  box-shadow: inset 6px 0 0 var(--signal);
}

.kicker {
  margin: 0;
  color: var(--signal);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 860;
  letter-spacing: 0;
}

h1 {
  max-width: 980px;
  margin-top: 14px;
  font-size: clamp(58px, 11vw, 132px);
  line-height: 0.86;
}

h2 {
  font-size: clamp(34px, 6vw, 68px);
  line-height: 0.9;
}

.lede {
  max-width: 760px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.22;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(420px, 1.14fr);
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 70%),
    var(--surface);
  padding: clamp(18px, 4vw, 34px);
}

.controls {
  display: grid;
  align-content: start;
  gap: 16px;
}

.section-heading {
  display: grid;
  gap: 10px;
}

.option-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.option-form input,
.field select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  padding: 0 16px;
  outline: none;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--signal);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

.field option {
  background: #111113;
}

.button,
.mode,
.option-chip,
.spin-center {
  border: 0;
  cursor: pointer;
}

.button {
  display: inline-flex;
  min-height: 44px;
  width: fit-content;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 780;
  white-space: nowrap;
}

.button-light {
  border: 1px solid #eff2d6;
  background: #f5f7e9;
  color: #11120e;
}

.button-dark,
.mode {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mode {
  min-height: 38px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.mode.active {
  border-color: rgba(233, 255, 112, 0.66);
  background: rgba(233, 255, 112, 0.14);
  color: var(--signal);
}

.options-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  padding: 0 10px 0 12px;
  font-size: 13px;
  font-weight: 760;
}

.option-chip span {
  color: var(--muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wheel-panel {
  display: grid;
  gap: 16px;
  justify-items: center;
}

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

#wheel-canvas {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 34px 90px rgba(0, 0, 0, 0.48));
  transition: transform 5s cubic-bezier(0.1, 0.9, 0.12, 1);
}

.wheel-wrap.spinning #wheel-canvas {
  transition-duration: var(--spin-time, 5s);
}

.pointer {
  position: absolute;
  top: -2px;
  width: 0;
  height: 0;
  border-right: 18px solid transparent;
  border-left: 18px solid transparent;
  border-top: 34px solid var(--signal);
  filter: drop-shadow(0 0 18px rgba(233, 255, 112, 0.55));
  z-index: 2;
}

.spin-center {
  position: absolute;
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  border-radius: 50%;
  background: #f5f7e9;
  color: #11120e;
  font-size: 20px;
  font-weight: 900;
  box-shadow:
    0 0 0 10px rgba(3, 3, 3, 0.72),
    0 18px 50px rgba(0, 0, 0, 0.4);
}

.result-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  padding: 20px;
  text-align: center;
}

.result-card h2 {
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.result-card p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 720;
}

.result-card.revealed {
  border-color: rgba(233, 255, 112, 0.68);
  box-shadow: 0 0 44px rgba(233, 255, 112, 0.12);
}

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

@media (max-width: 620px) {
  .app {
    width: min(100% - 28px, 1180px);
  }

  h1 {
    font-size: clamp(46px, 16vw, 72px);
  }

  .mode-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .option-form {
    grid-template-columns: 1fr;
  }
}
