:root{
  --bg:#0b1020;
  --panel:#121a33;
  --panel2:#0f1630;
  --text:#e9eefc;
  --muted:#9fb0e6;
  --accent:#35ffb5;
  --danger:#ff4d6d;
  --gold:#ffd166;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
  --radius: 18px;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:
    radial-gradient(900px 420px at 50% 18%, rgba(70,110,255,.22), transparent 60%),
    radial-gradient(800px 420px at 20% 70%, rgba(53,255,181,.10), transparent 62%),
    radial-gradient(800px 420px at 80% 70%, rgba(255,209,102,.10), transparent 62%),
    linear-gradient(180deg, #070a14 0%, #0b1020 55%, #070a14 100%);
}

.app{
  width: min(60vw, 1200px);
  max-width: 1200px;
  margin: 22px auto;
  padding: 14px;
}

@media (max-width: 1100px){
  .app{ width: 96vw; }
}

.topbar{
  display:flex;
  gap: 14px;
  align-items:center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.08);
}

.brand{
  display:flex;
  gap: 12px;
  align-items:center;
}

.logo{
  width:44px; height:44px;
  display:grid; place-items:center;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  font-size: 24px;
}

.title{ font-weight:800; letter-spacing:.4px; font-size: 18px;}
.subtitle{ color:var(--muted); font-size: 13px; margin-top:2px;}

.stats{
  display:flex;
  gap: 12px;
  align-items:stretch;
}

.stat{
  min-width: 140px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.08);
}

.label{ color:var(--muted); font-size: 12px; margin-bottom:6px;}
.value{ font-size: 18px; font-weight: 800; display:flex; align-items:center; gap:10px;}

.tiny{
  width:30px; height:30px;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,.10);
  color: var(--text);
  cursor:pointer;
}
.tiny:hover{ background: rgba(255,255,255,.16); }

.cabinet{
  max-width: 1150px;
  margin: 16px auto 0;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow);
}

.reelWindow{
  position:relative;
  border-radius: 26px;
  padding: 18px;
  overflow:hidden;

  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.30));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 24px 70px rgba(0,0,0,.55);

  max-width: 1100px;
  margin: 0 auto;
}

.reelWindow::before{
  content:"";
  position:absolute;
  inset: 10px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.10);
  pointer-events:none;
  z-index: 0;
}

.shine{
  position:absolute;
  inset:0;
  background: radial-gradient(600px 260px at 50% 0%, rgba(255,255,255,.12), transparent 60%);
  pointer-events:none;
  z-index: 0;
}

.grid{
  position: relative;
  z-index: 1;
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;

  background-image:
    linear-gradient(to right, transparent calc(20% - 1px), rgba(255,255,255,.18) 20%, transparent calc(20% + 1px)),
    linear-gradient(to right, transparent calc(40% - 1px), rgba(255,255,255,.18) 40%, transparent calc(40% + 1px)),
    linear-gradient(to right, transparent calc(60% - 1px), rgba(255,255,255,.18) 60%, transparent calc(60% + 1px)),
    linear-gradient(to right, transparent calc(80% - 1px), rgba(255,255,255,.18) 80%, transparent calc(80% + 1px));
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border-radius: 18px;
  padding: 6px;
}

.cell{
  height: 98px;
  border-radius: 16px;
  display:grid;
  place-items:center;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.10);
  font-size: 44px;
  position:relative;
  transform: translateZ(0);
}
.cell .small{
  position:absolute;
  bottom:8px;
  right:10px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
  font-weight: 700;
}

/* Under-reels UI aligned to reel width */
.controls, .rules{
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.controls{
  margin-top: 12px;
  display:flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.spin{
  padding: 14px 22px;
  border-radius: 16px;
  border: none;
  cursor:pointer;
  font-weight: 900;
  letter-spacing: 1px;
  font-size: 18px;
  background: linear-gradient(180deg, var(--accent), #14d7ff);
  color: #041018;
  box-shadow: 0 14px 34px rgba(20,215,255,.25);
}
.spin:disabled{ opacity:.55; cursor:not-allowed; }

.msg{
  color: var(--muted);
  font-weight: 600;
  max-width: 60%;
  text-align: center;
}

.rules{
  margin-top: 10px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  justify-content: center;
}
.rule{
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.08);
}
.badge{
  display:inline-grid;
  place-items:center;
  width:22px; height:22px;
  border-radius: 8px;
  background: rgba(255,255,255,.10);
  margin-right: 6px;
}

/* Modals */
.modal{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.90);
  display:grid;
  place-items:center;
  padding: 18px;
}
.hidden{ display:none; }

.modalCard{
  width:min(720px, 96vw);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.modalHeader{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.modalTitle{ font-weight: 900; letter-spacing:.4px; }

.closeBtn{
  width:36px;height:36px;
  border:none;
  border-radius: 12px;
  background: rgba(255,255,255,.10);
  color: var(--text);
  cursor:pointer;
}
.closeBtn:hover{ background: rgba(255,255,255,.16); }

.modalBody{ padding: 16px; }

.modalFooter{
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display:flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn{
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
  color: var(--text);
  cursor:pointer;
  font-weight: 800;
}
.btn:hover{ background: rgba(255,255,255,.14); }

.gridMini{
  display:grid;
  gap: 10px;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 10px;
}
.pick{
  height: 92px;
  border-radius: 18px;
  display:grid;
  place-items:center;
  font-size: 34px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.12);
  cursor:pointer;
}
.pick:hover{ background: rgba(255,255,255,.12); }

/* Force wheel modal to be solid */
#modal.modal{
  background: rgba(0,0,0,.96) !important;
}

/* Wheel modal card (the popup itself) */
#modal .modalCard{
  background: #0b1020 !important;   /* solid */
  opacity: 1 !important;
  backdrop-filter: none !important;
}

/* Make sure inner sections don’t reintroduce transparency */
#modal .modalHeader,
#modal .modalBody,
#modal .modalFooter{
  background: transparent !important;
}

/* Login modal */
#loginModal.modal{
  background: rgba(0,0,0,.70);
  backdrop-filter: none;
}

/* Wheel UI */
.wheelWrap{
  display:grid;
  place-items:center;
  gap: 12px;
  padding: 6px 0 0;
}

.wheel{
  width: 320px;
  height: 320px;
  border-radius: 999px;
  position: relative;
  transition: transform 2.6s cubic-bezier(.2,.8,.2,1);
  display: grid;
  place-items: center;
}

/* Wheel visual */
#modal .wheel{
  border: 10px solid rgba(255,255,255,.22);
  background: conic-gradient(
    from -90deg,
    rgba(255,255,255,.20) 0deg 45deg,
    rgba(0,0,0,.18) 45deg 90deg,
    rgba(255,255,255,.20) 90deg 135deg,
    rgba(0,0,0,.18) 135deg 180deg,
    rgba(255,255,255,.20) 180deg 225deg,
    rgba(0,0,0,.18) 225deg 270deg,
    rgba(255,255,255,.20) 270deg 315deg,
    rgba(0,0,0,.18) 315deg 360deg
  );
}

#modal .wheel::before{
  content:"";
  position:absolute;
  inset: 0;
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 10px rgba(255,255,255,.06),
    inset 0 0 35px rgba(255,255,255,.08);
  pointer-events:none;
}

/* Labels */
#modal .wheelLabel{
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 13px;
  color: rgba(255,255,255,.95);
  text-shadow: 0 2px 10px rgba(0,0,0,.55);
  font-weight: 800;
}

/* Pointer (points DOWN) */
#modal .pointer{
  position: relative;
  width: 0; height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 30px solid var(--gold);
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.55));
  margin: 0 auto;
  z-index: 3;
}
#modal .pointer::after{
  content:"";
  position:absolute;
  left: -3px;
  top: -16px;
  width: 6px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255,209,102,.95);
  box-shadow: 0 8px 16px rgba(0,0,0,.45);
}

/* Winning wedge overlay */
#modal .wheelWinWedge{
  position:absolute;
  inset: -10px;
  border-radius: 999px;
  pointer-events:none;
  z-index: 2;
  opacity: 0;
  transition: opacity .18s ease;
  transform-origin: 50% 50%;
  transform: rotate(0deg);
  mix-blend-mode: normal;
}
#modal .wheelWinWedge.show{ opacity: 1; }

@keyframes wheelWinPulse {
  0% { box-shadow: 0 0 0 rgba(53,255,181,0); transform: scale(1); }
  50% { box-shadow: 0 0 26px rgba(53,255,181,.28); transform: scale(1.01); }
  100% { box-shadow: 0 0 0 rgba(53,255,181,0); transform: scale(1); }
}
#modal .wheel.winPulse{ animation: wheelWinPulse .6s ease-in-out 1; }

@keyframes prizePop {
  0% { transform: translateY(4px); opacity: .2; }
  100% { transform: translateY(0); opacity: 1; }
}
#modal .wheelPrize{
  font-weight: 900;
  color: rgba(255,255,255,.92);
  animation: prizePop .28s ease-out 1;
}

/* Winning symbol highlight */
.cell.win{
  outline: 3px solid rgba(53,255,181,.85);
  box-shadow: 0 0 18px rgba(53,255,181,.25);
  transform: translateZ(0) scale(1.02);
}
@keyframes winPulse {
  0% { box-shadow: 0 0 10px rgba(53,255,181,.15); }
  50% { box-shadow: 0 0 22px rgba(53,255,181,.35); }
  100% { box-shadow: 0 0 10px rgba(53,255,181,.15); }
}
.cell.win{ animation: winPulse 0.7s ease-in-out 2; }



