:root{
  --bg:#080d1a;
  --panel:#111a2e;
  --panel2:#151f36;
  --text:#f4f7fb;
  --muted:#9ba8bd;
  --gold:#ffc83d;
  --gold2:#ff9f1c;
  --danger:#ff3b5c;
  --line:rgba(255,255,255,.12);
}

*{box-sizing:border-box}

html,body{
  margin:0;
  min-height:100%;
  background:
    radial-gradient(circle at 20% 10%, rgba(77,123,255,.22), transparent 28%),
    radial-gradient(circle at 80% 30%, rgba(255,80,130,.16), transparent 30%),
    linear-gradient(135deg,#070b16,#0b1020 48%,#11182b);
  color:var(--text);
  font-family:Inter,Segoe UI,Arial,sans-serif;
  overflow-x:hidden;
}

.app{
  min-height:100vh;
  display:grid;
  grid-template-columns:minmax(520px,1fr) 420px;
  gap:24px;
  padding:24px;
}

.wheel-panel{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-height:calc(100vh - 48px);
  border:1px solid var(--line);
  border-radius:28px;
  background:rgba(10,16,31,.62);
  box-shadow:0 25px 80px rgba(0,0,0,.38);
  overflow:hidden;
}

.wheel-panel:before{
  content:"";
  position:absolute;
  inset:auto auto -260px -220px;
  width:520px;
  height:520px;
  border-radius:50%;
  background:rgba(255,200,61,.09);
  filter:blur(20px);
}

.wheel-wrap{
  position:relative;
  width:min(78vh,820px);
  height:min(78vh,820px);
  display:grid;
  place-items:center;
  filter:drop-shadow(0 30px 45px rgba(0,0,0,.48));
}

#wheel{
  width:100%;
  height:100%;
  border-radius:50%;
  background:#fff;
}

.spin-center{
  position:absolute;
  width:150px;
  height:150px;
  border-radius:50%;
  border:8px solid rgba(255,255,255,.9);
  background:linear-gradient(180deg,var(--gold),var(--gold2));
  color:#111;
  font-weight:900;
  font-size:28px;
  letter-spacing:1px;
  cursor:pointer;
  box-shadow:
    inset 0 -8px 0 rgba(0,0,0,.13),
    0 14px 30px rgba(0,0,0,.38);
  transition:transform .15s ease, filter .15s ease;
  z-index:5;
}

.spin-center:hover{transform:scale(1.04)}
.spin-center:disabled{filter:grayscale(.65);cursor:not-allowed}

.pointer{
  position:absolute;
  top:28px;
  left:50%;
  transform:translateX(-50%);
  width:0;
  height:0;
  border-left:34px solid transparent;
  border-right:34px solid transparent;
  border-top:70px solid var(--danger);
  filter:drop-shadow(0 8px 10px rgba(0,0,0,.45));
  z-index:8;
}

.pointer:after{
  content:"";
  position:absolute;
  left:-18px;
  top:-64px;
  width:36px;
  height:36px;
  border-radius:50%;
  background:#fff;
}

.winner-box{
  margin-top:18px;
  min-height:46px;
  padding:12px 24px;
  border-radius:999px;
  background:rgba(255,255,255,.09);
  border:1px solid var(--line);
  font-size:20px;
  font-weight:800;
}

.side-panel{
  min-height:calc(100vh - 48px);
}

.card{
  height:100%;
  border:1px solid var(--line);
  border-radius:28px;
  padding:24px;
  background:linear-gradient(180deg,rgba(21,31,54,.96),rgba(12,18,34,.96));
  box-shadow:0 25px 80px rgba(0,0,0,.3);
}

h1{
  margin:0 0 8px;
  font-size:34px;
}

.muted{
  margin:0 0 18px;
  color:var(--muted);
}

textarea{
  width:100%;
  height:calc(100vh - 260px);
  min-height:360px;
  resize:none;
  border:1px solid var(--line);
  outline:none;
  border-radius:18px;
  padding:16px;
  background:#08101f;
  color:var(--text);
  font:15px/1.45 Consolas,monospace;
}

textarea:focus{
  border-color:rgba(255,200,61,.7);
  box-shadow:0 0 0 4px rgba(255,200,61,.12);
}

.actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:14px;
}

.btn{
  border:0;
  border-radius:14px;
  padding:14px 18px;
  background:linear-gradient(180deg,var(--gold),var(--gold2));
  color:#111;
  font-weight:900;
  cursor:pointer;
}

.btn.secondary{
  background:#2d68ff;
  color:white;
}

.btn.ghost{
  background:rgba(255,255,255,.1);
  color:white;
  border:1px solid var(--line);
}

.info{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-top:16px;
  color:var(--muted);
}

.info b{color:white}

.modal{
  position:fixed;
  inset:0;
  display:grid;
  place-items:center;
  background:rgba(0,0,0,.62);
  backdrop-filter:blur(8px);
  z-index:50;
}

.hidden{display:none}

.modal-card{
  width:min(92vw,520px);
  padding:38px;
  text-align:center;
  border-radius:30px;
  background:linear-gradient(180deg,#17223c,#10182b);
  border:1px solid var(--line);
  box-shadow:0 35px 120px rgba(0,0,0,.55);
}

.cup{font-size:68px}
.modal-title{color:var(--muted);font-size:20px;margin-top:8px}
.modal-winner{
  margin:14px 0 28px;
  font-size:42px;
  font-weight:1000;
  overflow-wrap:anywhere;
}

#confetti{
  pointer-events:none;
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  z-index:60;
}

@media(max-width:1050px){
  .app{grid-template-columns:1fr}
  .side-panel{min-height:auto}
  textarea{height:300px;min-height:300px}
  .wheel-panel{min-height:680px}
  .wheel-wrap{width:min(88vw,720px);height:min(88vw,720px)}
}

@media(max-width:620px){
  .app{padding:12px}
  .wheel-panel,.card{border-radius:20px}
  .wheel-panel{min-height:520px}
  .spin-center{width:108px;height:108px;font-size:20px;border-width:6px}
  .pointer{top:18px;border-left-width:24px;border-right-width:24px;border-top-width:54px}
  .winner-box{font-size:16px}
}
