:root {
  --bg: #0e0a1a;
  --panel: #1a1330;
  --panel2: #241a3a;
  --ink: #f4f0ff;
  --muted: #a99bd0;
  --accent: #ffe066;
  --hot: #ff2e63;
  --line: rgba(255,255,255,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(124,92,255,0.35), transparent 60%),
    radial-gradient(800px 500px at 0% 110%, rgba(255,46,99,0.25), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

.app { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }

/* header */
.hdr { text-align: center; padding: 14px 0 10px; }
.title {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(38px, 9vw, 76px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, #ffe066, #ff8fd0 40%, #7c9cff 75%, #5eead4);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgba(124,92,255,0.4));
  animation: rise 0.7s cubic-bezier(.2,.8,.2,1) both;
}
.tagline {
  color: var(--muted); font-size: 14px; margin-top: 8px;
  letter-spacing: 0.06em; text-transform: uppercase;
  animation: rise 0.7s .1s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* tabs */
.tabs {
  display: flex; gap: 10px; justify-content: center;
  margin: 18px 0 22px; animation: rise 0.7s .2s cubic-bezier(.2,.8,.2,1) both;
}
.tab {
  font-family: inherit; font-weight: 800; font-size: 16px;
  padding: 13px 26px; border-radius: 16px; cursor: pointer;
  border: 2px solid var(--line); background: var(--panel); color: var(--muted);
  transition: transform .15s, background .2s, color .2s, box-shadow .2s;
}
.tab:hover { transform: translateY(-2px); }
.tab.on {
  color: #140e26;
  background: linear-gradient(135deg, var(--accent), #ff8fd0);
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(255,143,208,0.35);
  transform: scale(1.04);
}

.panel {
  background: rgba(26,19,48,0.7);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

/* ---------- spinner ---------- */
.spin-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 26px; }
.wheel-col { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.wheel-holder { width: 100%; max-width: 440px; aspect-ratio: 1; position: relative; }
.wheel-canvas { width: 100%; height: 100%; display: block;
  filter: drop-shadow(0 12px 30px rgba(0,0,0,0.4)); }

.result-card {
  font-size: clamp(20px, 4vw, 30px); font-weight: 600;
  padding: 12px 24px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,224,102,0.18), rgba(255,143,208,0.18));
  border: 1px solid var(--line); text-align: center;
}
.result-card b { color: var(--accent); }
.result-placeholder { color: var(--muted); font-size: 15px; letter-spacing: 0.04em; height: 44px; display:flex; align-items:center; }
.pop { animation: pop .45s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.spin-btn {
  font-family: 'Fraunces', serif; font-weight: 900; font-size: 24px;
  letter-spacing: 0.04em; color: #140e26;
  padding: 16px 54px; border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, #ffe066, #ff8c42);
  box-shadow: 0 10px 30px rgba(255,140,66,0.4);
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.spin-btn:hover:not(:disabled) { transform: translateY(-3px) scale(1.03); box-shadow: 0 16px 40px rgba(255,140,66,0.55); }
.spin-btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.spin-btn:disabled { filter: grayscale(0.5) brightness(0.7); cursor: not-allowed; }

/* options */
.opts-col { background: var(--panel2); border-radius: 18px; padding: 18px; border: 1px solid var(--line); }
.opts-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.opts-head h3 { font-weight: 800; font-size: 18px; }
.count { background: var(--hot); color: #fff; font-size: 12px; padding: 2px 9px; border-radius: 999px; margin-left: 6px; }
.opts-actions { display: flex; gap: 6px; }
.mini-btn { font-family: inherit; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; transition: .2s; }
.mini-btn:hover { color: var(--ink); border-color: var(--muted); }
.mini-btn.danger:hover { color: var(--hot); border-color: var(--hot); }

.add-row { display: flex; gap: 8px; margin-bottom: 14px; }
.opt-input {
  flex: 1; font-family: inherit; font-size: 15px; padding: 11px 14px;
  border-radius: 12px; border: 1px solid var(--line);
  background: rgba(0,0,0,0.25); color: var(--ink); outline: none; transition: border .2s;
}
.opt-input:focus { border-color: var(--accent); }
.add-btn {
  font-family: inherit; font-weight: 800; padding: 0 20px; border-radius: 12px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #3ddc97, #22a2ff); color: #06121a; transition: transform .15s;
}
.add-btn:hover { transform: translateY(-2px); }

.opt-list { list-style: none; display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.opt-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  background: rgba(0,0,0,0.2); border-radius: 11px; animation: rise .3s both; }
.swatch { width: 16px; height: 16px; border-radius: 5px; flex-shrink: 0; }
.opt-label { flex: 1; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-btn { background: transparent; border: none; color: var(--muted); font-size: 22px; line-height: 1;
  cursor: pointer; padding: 0 4px; transition: color .2s, transform .15s; }
.rm-btn:hover { color: var(--hot); transform: scale(1.2); }
.empty-note { color: var(--muted); font-size: 14px; text-align: center; padding: 20px; }

/* ---------- whiteboard ---------- */
.board-wrap { display: flex; flex-direction: column; gap: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  background: var(--panel2); padding: 14px; border-radius: 16px; border: 1px solid var(--line); }
.tool-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.palette { gap: 6px; }
.swatch-btn { width: 30px; height: 30px; border-radius: 9px; cursor: pointer; padding: 0;
  transition: transform .15s, box-shadow .2s; }
.swatch-btn:hover { transform: translateY(-2px); }
.swatch-btn.active { box-shadow: 0 0 0 3px var(--accent), 0 4px 12px rgba(0,0,0,0.4); transform: scale(1.1); }
.color-pick { position: relative; width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.color-pick span { color: #fff; font-weight: 900; font-size: 18px; text-shadow: 0 1px 3px #000; pointer-events: none; }
.color-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.tool-lbl { color: var(--muted); font-size: 13px; font-weight: 700; }
.slider { accent-color: var(--accent); width: 120px; }
.brush-preview { border-radius: 50%; display: inline-block; flex-shrink: 0; }

.tool-btn { font-family: inherit; font-weight: 700; font-size: 14px; padding: 9px 14px; border-radius: 11px;
  border: 1px solid var(--line); background: rgba(0,0,0,0.2); color: var(--ink); cursor: pointer; transition: .2s; }
.tool-btn:hover { border-color: var(--muted); transform: translateY(-1px); }
.tool-btn.active { background: linear-gradient(135deg, var(--accent), #ff8c42); color: #140e26; border-color: transparent; }
.tool-btn.primary { background: linear-gradient(135deg, #3ddc97, #22a2ff); color: #06121a; border-color: transparent; }

.canvas-holder { width: 100%; }
.draw-canvas {
  width: 100%; height: 62vh; min-height: 340px; display: block;
  border-radius: 16px; background: #fffdf7; touch-action: none; cursor: crosshair;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

/* footer */
.ftr { text-align: center; margin-top: 26px; }
.ftr a { color: var(--muted); font-size: 13px; text-decoration: none; letter-spacing: 0.05em;
  border-bottom: 1px dashed var(--muted); padding-bottom: 2px; transition: color .2s; }
.ftr a:hover { color: var(--accent); border-color: var(--accent); }

/* responsive */
@media (max-width: 780px) {
  .spin-wrap { grid-template-columns: 1fr; }
  .opts-col { order: 2; }
  .panel { padding: 16px; }
  .draw-canvas { height: 55vh; }
  .toolbar { gap: 12px; }
}
</style>