:root{
  color-scheme:light;
  --ink:#281b42;
  --muted:#6f6681;
  --violet:#6743dc;
  --violet-deep:#5131c2;
  --outline:#e3ddf3;
  font-family:Inter,"Segoe UI",system-ui,-apple-system,sans-serif;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;min-height:100vh;color:var(--ink);font:14px/1.55 Inter,"Segoe UI",system-ui,sans-serif;
  background:radial-gradient(ellipse 65% 45% at 90% 5%,#e9e0ff 0%,transparent 85%),
  radial-gradient(ellipse 45% 35% at 0% 95%,#fff0df 0%,transparent 95%),#f7f5ff;
}
button,textarea,input{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed}
:focus-visible{outline:3px solid #e69b1b;outline-offset:3px}
[hidden]{display:none!important}
.wrap{width:min(1050px,calc(100% - 40px));margin:0 auto;padding:26px 0 22px}
.brand{display:inline-flex;align-items:center;gap:10px;font-size:21px;letter-spacing:-.75px;font-weight:850}
.brand .mark{display:grid;place-items:center;width:40px;height:40px;border-radius:13px;background:var(--violet);color:#fff;font-size:25px;box-shadow:0 9px 20px #6543dc30}
.accent{color:var(--violet)}
.intro{text-align:center;max-width:680px;margin:32px auto 25px}
.eyebrow{font-size:10px;letter-spacing:1.7px;color:var(--violet);font-weight:850}
.intro h1{font-size:clamp(36px,5.5vw,59px);font-weight:850;letter-spacing:-2.5px;line-height:1.12;margin:10px 0}
.intro h1 span{color:var(--violet)}
.intro>p{font-size:15px;color:var(--muted);margin:0}
.picker{display:grid;grid-template-columns:minmax(0,1.04fr) minmax(0,.96fr);gap:15px;align-items:stretch}
.input-side,.result-side{min-width:0;border:1px solid var(--outline);background:#fff;border-radius:23px;box-shadow:0 18px 55px #483e7b0c;padding:25px}
.section-heading{display:flex;gap:10px;align-items:flex-start;justify-content:space-between;margin-bottom:14px}
.section-heading h2{font-size:17px;letter-spacing:-.6px;font-weight:800;line-height:1.4;margin:0 0 3px}
.section-heading p{margin:0;font-size:11px;color:var(--muted)}
.counter{flex-shrink:0;background:#f2efff;border-radius:35px;padding:5px 10px;font-size:11px;color:#6045c1;font-weight:850;white-space:nowrap}
textarea{display:block;width:100%;min-height:250px;max-height:390px;resize:vertical;border:1px solid #ddd7f0;border-radius:14px;background:#fdfcff;color:var(--ink);padding:15px;outline:none;line-height:1.9;font-size:13px}
textarea::placeholder{color:#ab9eca}
textarea:focus{border-color:#946ff5;box-shadow:0 0 0 3px #8062e819}
.input-footer{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:space-between;margin-top:15px}
.check-row{display:inline-flex;align-items:center;gap:9px;font-size:12px;font-weight:750;cursor:pointer}
.check-row input{position:absolute;opacity:0;width:1px;height:1px}
.switch{display:block;position:relative;flex-shrink:0;width:33px;height:20px;background:#d6d0e4;border-radius:15px;transition:background .18s ease}
.switch:after{content:"";position:absolute;width:14px;height:14px;border-radius:50%;top:3px;left:3px;background:#fff;box-shadow:0 1px 3px #0002;transition:transform .18s ease}
.check-row input:checked+.switch{background:var(--violet)}
.check-row input:checked+.switch:after{transform:translateX(13px)}
.check-row input:focus-visible+.switch{outline:3px solid #e69b1b;outline-offset:3px}
.text-button,.reset{background:transparent;border:0;color:var(--violet);font-size:12px;font-weight:800;padding:6px}
.text-button:hover,.reset:hover{text-decoration:underline}
.privacy{font-size:11px;color:var(--muted);margin:12px 0 0}
.result-side{display:flex;flex-direction:column;background:linear-gradient(145deg,#f2eefe,#fff 75%);border-color:#ded4f8}
.winner-heading{display:flex;justify-content:space-between;gap:8px;align-items:center}
.sparkle{color:#a88bec;font-size:19px}
.result-stage{display:flex;flex:1;min-height:245px;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:12px 0 14px}
.winner-symbol{display:grid;place-items:center;width:64px;height:64px;background:#f9db89;color:#84500c;border-radius:50%;font-size:31px;box-shadow:0 6px 0 #f3c35d;transform:rotate(-12deg);margin-bottom:22px}
.result-hint{margin:0 0 6px;font-size:11px;text-transform:uppercase;letter-spacing:1.2px;color:var(--muted);font-weight:850}
.winner{max-width:100%;font-size:clamp(32px,4.4vw,52px);font-weight:850;letter-spacing:-1.9px;line-height:1.18;overflow-wrap:anywhere;color:var(--violet);min-height:60px}
.winner.reveal{animation:reveal .3s cubic-bezier(.18,.85,.35,1.25)}
.result-subtitle{font-size:12px;color:var(--muted);margin:12px 0 0}
.pick-button{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:54px;border:0;border-radius:13px;color:white;background:var(--violet);box-shadow:0 10px 24px #6743dc2b;font-size:14px;font-weight:850;transition:transform .14s ease,background .14s ease}
.pick-button:hover:not(:disabled){transform:translateY(-2px);background:var(--violet-deep)}
.pick-button:active:not(:disabled){transform:translateY(0)}
.pick-button:disabled{background:#b1a7cf;box-shadow:none}
.arrow{font-size:17px;font-weight:500}
.draw-status{text-align:center;color:var(--muted);font-size:11px;margin:10px 0 0;min-height:20px}
.reset{align-self:center;margin:4px auto -8px}
footer{margin-top:19px;text-align:center;font-size:11px;color:var(--muted)}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;white-space:nowrap;clip:rect(0,0,0,0);border:0}
@keyframes reveal{from{opacity:.2;transform:translateY(8px) scale(.92)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:780px){
 .wrap{width:calc(100% - 28px);padding-top:18px}
 .intro{margin:27px auto 22px}
 .picker{grid-template-columns:1fr}
 .input-side,.result-side{padding:20px}
 textarea{min-height:180px;max-height:280px}
 .result-stage{min-height:210px}
}
@media(max-width:380px){
 .wrap{width:calc(100% - 18px)}
 .intro h1{font-size:36px;letter-spacing:-1.6px}
 .intro>p{font-size:13px}
 .input-side,.result-side{padding:16px}
 .section-heading{flex-wrap:wrap}
 .result-stage{min-height:188px}
}
@media(prefers-reduced-motion:reduce){.winner.reveal{animation:none}html{scroll-behavior:auto}}


/* The pointer stays fixed while the wheel spins beneath it. */
.wheel-frame{position:relative;isolation:isolate;width:min(100%,390px);aspect-ratio:1;margin:16px auto 6px;padding:8px;flex:none}
.wheel-disc{position:absolute;inset:8px;border:8px solid #fff;border-radius:50%;overflow:hidden;background:#ebe3ff;box-shadow:0 5px 0 #d6c6f5,0 10px 32px #5942a43d;transform:rotate(0deg);will-change:transform}
.wheel-disc canvas{width:100%;height:100%;display:block;border-radius:50%}
.wheel-pointer{position:absolute;z-index:5;left:50%;top:-4px;transform:translateX(-50%);width:0;height:0;border-left:17px solid transparent;border-right:17px solid transparent;border-top:35px solid #2e164f;filter:drop-shadow(0 2px 2px #2e164f40)}
.wheel-pointer::before{content:"";position:absolute;top:-38px;left:-6px;width:12px;height:14px;background:#fff;border:3px solid #2e164f;border-radius:5px}
.wheel-hub{position:absolute;z-index:4;top:50%;left:50%;transform:translate(-50%,-50%);display:grid;place-items:center;width:42px;height:42px;border:6px solid #fff;border-radius:50%;background:#442395;color:white;font-size:19px;box-shadow:0 2px 10px #27134e55;pointer-events:none}
.wheel-note{font-size:11px;line-height:1.5;color:var(--muted);text-align:center;min-height:18px;margin:7px 0 10px}
.result-stage{flex:none;min-height:100px;padding:8px 0 18px}
.result-hint{font-size:10px}
.result-subtitle{margin:7px 0 0}
.winner{font-size:clamp(24px,3.1vw,35px);min-height:40px;line-height:1.25}
.pick-button{min-height:56px;font-size:16px}
@media(max-width:780px){.wheel-frame{width:min(100%,390px);margin-top:15px}.result-stage{min-height:89px}}
@media(max-width:380px){.wheel-frame{width:min(100%,320px)}.wheel-pointer{border-left-width:13px;border-right-width:13px;border-top-width:29px}.result-stage{min-height:80px}.winner{font-size:27px}}
@media(prefers-reduced-motion:reduce){.wheel-disc{will-change:auto}}

/* Ordered draw history and site links */
.history-panel,.other-tools,.feedback-panel{border:1px solid var(--outline);background:#fff;border-radius:23px;padding:24px;margin-top:18px;box-shadow:0 14px 40px #483e7b0a}
.panel-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.panel-heading h2,.feedback-panel h2{font-size:20px;font-weight:850;letter-spacing:-.7px;margin:4px 0 2px;line-height:1.3}
.panel-heading p,.feedback-panel p{font-size:12px;color:var(--muted);margin:4px 0;line-height:1.6}
.kicker{font-size:10px;color:var(--violet);font-weight:850;letter-spacing:1.4px}
.quiet-button{flex-shrink:0;border:1px solid #e2d9f4;border-radius:10px;padding:9px 12px;background:#f9f6ff;color:var(--violet);font-weight:800;font-size:11px}
.quiet-button:hover{background:#f0eaff}
.empty-history{padding:22px;margin:0;color:var(--muted);font-size:12px;border:1px dashed #e0d7f1;border-radius:12px;text-align:center}
.history-list{list-style:none;counter-reset:none;max-height:360px;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:#b3a2e8 #f5f1ff;padding:0;margin:0;display:grid;gap:7px}
.history-list li{display:flex;align-items:center;gap:12px;min-width:0;padding:10px 12px;border:1px solid #e9e2f5;border-radius:10px;background:#fcfaff}
.history-list li:nth-child(2n){background:#f7f3ff}
.history-list li:last-child{border-color:#b9a3eb;background:#f1eaff}
.history-position{display:grid;place-items:center;min-width:39px;min-height:30px;border-radius:8px;background:#ede6ff;color:#6243b8;font-size:11px;font-weight:900}
.history-value{overflow-wrap:anywhere;min-width:0;font-size:13px;font-weight:750;color:var(--ink)}
.history-panel .counter{display:inline-flex;align-items:center;vertical-align:middle;margin-left:5px;letter-spacing:0;font-family:Inter,"Segoe UI",system-ui,sans-serif;font-weight:800}
.other-tools{background:linear-gradient(145deg,#fff,#f9f6ff)}
.tool-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.tool-grid a{display:flex;align-items:center;gap:10px;min-width:0;text-decoration:none;color:var(--ink);padding:12px;border:1px solid #e5def3;background:#fff;border-radius:12px;transition:border-color .16s ease,transform .16s ease}
.tool-grid a:hover{border-color:#9278e3;transform:translateY(-2px);box-shadow:0 5px 16px #6743dc1c}
.tool-icon{display:grid;place-items:center;flex-shrink:0;width:34px;height:34px;border-radius:10px;color:var(--violet);background:#eee7ff;font-size:20px}
.tool-grid a>span:nth-child(2){min-width:0;flex:1}
.tool-grid strong{display:block;font-size:12px;line-height:1.4}
.tool-grid small{display:block;font-size:10px;color:var(--muted);line-height:1.45;margin-top:3px}
.tool-arrow{color:#846cbe;font-size:16px}
.feedback-panel{display:flex;flex-direction:column;align-items:flex-start;background:#f4efff;border-color:#dbcef7}
.feedback-action{display:inline-flex;align-items:center;justify-content:center;background:var(--violet);color:#fff;border:0;border-radius:11px;padding:12px 19px;margin-top:10px;font-size:12px;font-weight:850}
.feedback-action:hover{background:var(--violet-deep)}
footer{margin-bottom:75px}
@media(max-width:780px){.history-panel,.other-tools,.feedback-panel{padding:19px}.tool-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:410px){.panel-heading{align-items:flex-start;flex-wrap:wrap}.tool-grid{grid-template-columns:1fr}.history-panel,.other-tools,.feedback-panel{padding:15px}.history-list li{padding:9px}.panel-heading h2,.feedback-panel h2{font-size:18px}}
