:root{
  --void:#080B1A; --deep:#111833; --twilight:#1E2A52; --dusk:#3D4A7A;
  --star:#EDEFF7; --haze:#8891B5; --danger:#ff6b6b;
}
*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto;}
}
body{
  min-height:100vh; background:var(--void); color:var(--star);
  font-family:'Inter',sans-serif;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
  animation:pageFadeIn .7s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes pageFadeIn{
  from{opacity:0; transform:translateY(10px);}
  to{opacity:1; transform:translateY(0);}
}
@media (prefers-reduced-motion: reduce){
  body{animation:none;}
}
h1,h2,.display{font-family:'Space Grotesk',sans-serif; font-weight:700; letter-spacing:-0.02em;}
label{
  display:block; font-family:'JetBrains Mono',monospace; font-size:0.68rem;
  letter-spacing:0.08em; text-transform:uppercase; color:var(--haze); margin-bottom:10px;
}
.haze{color:var(--haze); text-transform:none; letter-spacing:normal; font-weight:400;}

/* stars background — same as main site */
.stars-bg{position:fixed; inset:0; z-index:0; pointer-events:none; overflow:hidden;}
.stars-bg::before, .stars-bg::after{
  content:""; position:absolute; inset:-10%; background-repeat:repeat; will-change:transform;
}
.stars-bg::before{
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, var(--star), transparent),
    radial-gradient(1px 1px at 140px 90px, var(--haze), transparent),
    radial-gradient(1.5px 1.5px at 260px 200px, var(--star), transparent),
    radial-gradient(1px 1px at 340px 60px, var(--haze), transparent),
    radial-gradient(1.5px 1.5px at 400px 260px, var(--star), transparent),
    radial-gradient(1px 1px at 60px 220px, var(--star), transparent);
  background-size:440px 320px; opacity:0.55; animation:driftA 140s linear infinite;
}
.stars-bg::after{
  background-image:
    radial-gradient(1px 1px at 50px 50px, var(--haze), transparent),
    radial-gradient(1px 1px at 180px 140px, var(--star), transparent),
    radial-gradient(1px 1px at 300px 40px, var(--haze), transparent),
    radial-gradient(1px 1px at 380px 180px, var(--star), transparent);
  background-size:400px 400px; opacity:0.35; animation:driftB 200s linear infinite reverse;
}
@keyframes driftA{ from{transform:translate3d(0,0,0);} to{transform:translate3d(-440px,-320px,0);} }
@keyframes driftB{ from{transform:translate3d(0,0,0);} to{transform:translate3d(400px,-400px,0);} }
@media (prefers-reduced-motion: reduce){
  .stars-bg::before, .stars-bg::after{animation:none;}
}

.nav{
  position:relative; z-index:1;
  padding:20px 24px; display:flex; justify-content:space-between; align-items:center;
}
a{color:inherit; text-decoration:none;}
button{font-family:inherit; cursor:pointer;}

.nav-mark{
  font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:1rem; letter-spacing:0.02em;
  display:flex; align-items:baseline; gap:6px;
}
.nav-sub{color:var(--haze); font-weight:500; font-size:1rem;}
.nav-cta{
  font-family:'JetBrains Mono',monospace; font-size:0.7rem; letter-spacing:0.08em; text-transform:uppercase;
  border:1px solid var(--dusk); padding:9px 16px; border-radius:100px; transition:border-color .25s ease;
}
.nav-cta:hover{border-color:var(--star);}

.wrap{
  position:relative; z-index:1;
  max-width:560px; margin:0 auto; padding:8px 20px 80px;
  display:flex; flex-direction:column; gap:20px;
}

/* wheel */
.wheel-section{display:flex; flex-direction:column; align-items:center; padding:16px 0 8px;}
.wheel-stage{position:relative; width:100%; max-width:420px; aspect-ratio:1; margin-bottom:20px;}
#wheelCanvas{width:100%; height:100%; display:block; border-radius:50%; border:1px solid var(--twilight);}
.pointer{
  position:absolute; top:-2px; left:50%; transform:translateX(-50%);
  width:0; height:0; z-index:2;
  border-left:14px solid transparent; border-right:14px solid transparent;
  border-top:22px solid var(--star);
  filter:none;
}
.spin-btn{
  width:100%; max-width:280px; padding:18px; border-radius:100px; border:1px solid var(--star);
  background:var(--star); color:var(--void); font-family:'Space Grotesk',sans-serif;
  font-weight:700; font-size:1.05rem; letter-spacing:0.02em; cursor:pointer;
  transition:background .2s ease, color .2s ease, opacity .2s ease;
}
.spin-btn:hover:not(:disabled){background:var(--void); color:var(--star); border-color:var(--star);}
.spin-btn:disabled{opacity:.45; cursor:not-allowed;}
.spin-hint{
  margin-top:10px; font-size:12px; color:var(--haze); font-family:'JetBrains Mono',monospace;
  min-height:16px; text-align:center;
}

/* panels */
.panel-card{
  background:var(--deep); border:1px solid var(--twilight); border-radius:14px; padding:22px;
}
input[type="text"]{
  width:100%; padding:12px 14px; border-radius:8px; border:1px solid var(--twilight);
  background:var(--void); color:var(--star); font-family:'Inter',sans-serif; font-size:14px;
}
input[type="text"]:focus{outline:none; border-color:var(--star);}
input[type="text"]::placeholder{color:var(--haze);}

.add-row{display:flex; gap:10px;}
.add-row input[type="text"]{flex:1;}
.add-btn{flex:0 0 auto; width:auto; padding:12px 20px;}

.reset-btn{width:100%; margin-top:14px;}

.btn-row{display:flex; gap:10px; margin-top:14px;}
.btn-secondary, .btn-ghost{
  padding:12px; border-radius:8px; font-family:'Space Grotesk',sans-serif;
  font-weight:600; font-size:13px; cursor:pointer; transition:background .2s ease, color .2s ease, border-color .2s ease;
}
.btn-secondary{background:var(--star); color:var(--void); border:1px solid var(--star);}
.btn-secondary:hover{background:var(--void); color:var(--star);}
.btn-ghost{background:transparent; color:var(--haze); border:1px solid var(--dusk);}
.btn-ghost:hover{color:var(--star); border-color:var(--star);}

.active-list{display:flex; flex-direction:column; gap:8px; max-height:260px; overflow-y:auto;}
.active-item{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:9px 12px; background:var(--void); border:1px solid var(--twilight); border-radius:8px;
  font-size:13px;
}
.active-item .txt{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.remove-btn{
  flex-shrink:0; width:auto; padding:4px 9px; background:transparent; border:1px solid var(--danger);
  color:var(--danger); font-size:12px; border-radius:6px; cursor:pointer;
}
.remove-btn:hover{opacity:.8;}

.history-head{display:flex; justify-content:space-between; align-items:center; margin-bottom:10px;}
.history-head label{margin-bottom:0;}
.clear-history-btn{
  width:auto; padding:5px 11px; background:transparent; border:1px solid var(--dusk);
  color:var(--haze); font-size:11px; border-radius:6px; cursor:pointer;
  font-family:'JetBrains Mono',monospace; letter-spacing:0.04em; transition:color .2s ease, border-color .2s ease;
}
.clear-history-btn:hover{color:var(--danger); border-color:var(--danger);}

.history-list{display:flex; flex-direction:column-reverse; gap:8px; max-height:220px; overflow-y:auto;}
.history-item{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:9px 12px; background:var(--void); border:1px solid var(--twilight); border-radius:8px; font-size:13px;
}
.history-item .num{color:var(--haze); font-family:'JetBrains Mono',monospace; font-size:11px;}
.empty{color:var(--haze); font-size:13px; text-align:center; padding:16px 0; font-family:'Inter',sans-serif;}

/* modal */
.modal-overlay{
  position:fixed; inset:0; z-index:100; background:rgba(8,11,26,0.85);
  display:none; align-items:center; justify-content:center; padding:24px;
  backdrop-filter:blur(4px);
}
.modal-overlay.show{display:flex;}
.modal-card{
  width:100%; max-width:360px; background:var(--deep); border:1px solid var(--twilight);
  border-radius:14px; padding:32px 28px; text-align:center;
  position:relative; overflow:hidden;
  animation:modalPopIn .45s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes modalPopIn{
  from{opacity:0; transform:scale(.85) translateY(8px);}
  to{opacity:1; transform:scale(1) translateY(0);}
}
@media (prefers-reduced-motion: reduce){
  .modal-card{animation:none;}
}
.confetti-burst{position:absolute; inset:0; pointer-events:none; overflow:hidden;}
.confetti-piece{
  position:absolute; top:42%; left:50%; width:6px; height:6px; border-radius:1px;
  background:var(--star); opacity:0;
  animation:confettiFly .9s cubic-bezier(.15,.7,.3,1) forwards;
}
@keyframes confettiFly{
  0%{opacity:1; transform:translate(-50%,-50%) rotate(0deg) translateY(0) scale(1);}
  100%{opacity:0; transform:translate(-50%,-50%) rotate(var(--rot,180deg)) translate(var(--dx,0), var(--dy,-90px)) scale(.4);}
}
@media (prefers-reduced-motion: reduce){
  .confetti-piece{display:none;}
}
.modal-eyebrow{
  font-family:'JetBrains Mono',monospace; font-size:0.68rem; letter-spacing:0.1em;
  text-transform:uppercase; color:var(--haze); margin-bottom:12px;
}
.modal-name{
  font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:1.6rem;
  margin-bottom:24px; word-break:break-word; line-height:1.2;
}
.modal-card .btn-secondary{width:100%; margin-bottom:10px; padding:14px;}
.modal-card .btn-ghost{width:100%; padding:12px; border-radius:8px;}

@media (min-width:600px){
  .wrap{max-width:640px;}
}