/* ============================================================
   MM-Play — Spin Wheel app
   Tema pastel soft profesional
   ============================================================ */
:root {
  --bg: #f4f1fb;
  --surface: #ffffff;
  --surface-2: #faf8ff;
  --text: #3b3a52;
  --text-soft: #6b6a82;
  --muted: #9b9ab2;
  --line: #ece9f6;
  --line-soft: #f1eef9;
  --lavender: #a78bfa;
  --lavender-deep: #8b5cf6;
  --pink: #f7a8c4;
  --mint: #7dd3c0;
  --sky: #9bc4e2;
  --butter: #ffe08a;
  --peach: #ffb5a7;
  --shadow-sm: 0 2px 8px rgba(91, 80, 145, .06);
  --shadow: 0 10px 30px rgba(91, 80, 145, .10);
  --shadow-lg: 0 20px 50px rgba(91, 80, 145, .18);
  --radius: 18px;
  --radius-lg: 26px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, #efe6ff 0%, transparent 60%),
    radial-gradient(1000px 500px at 110% 10%, #ffe4f1 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* topbar */
.sw-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px;
  background: rgba(244, 241, 251, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.sw-back {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 13.5px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-soft);
  box-shadow: var(--shadow-sm); transition: .18s;
}
.sw-back:hover { color: var(--lavender-deep); border-color: var(--lavender); }
.sw-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; }
.sw-brand .dot { width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, var(--mint), var(--sky)); display: grid; place-items: center; color: #fff; font-size: 15px; }
.sw-tickets { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--text-soft); background: var(--surface); border: 1px solid var(--line); padding: 8px 14px; border-radius: 20px; }
.sw-tickets b { color: var(--lavender-deep); }

/* layout */
.sw-wrap {
  max-width: 900px; margin: 0 auto; padding: 36px 24px 60px;
  display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: start;
}
.sw-stage { display: grid; place-items: center; }

/* wheel */
.wheel-stage { position: relative; width: 340px; height: 340px; }
#wheel { width: 340px; height: 340px; display: block; filter: drop-shadow(0 16px 30px rgba(91,80,145,.22)); cursor: pointer; }
.spin-btn {
  position: absolute; inset: 0; margin: auto; width: 86px; height: 86px; border-radius: 50%;
  background: linear-gradient(135deg, #fff, #f3e9ff); color: var(--lavender-deep);
  font-weight: 800; font-size: 14px; letter-spacing: .5px;
  box-shadow: 0 8px 22px rgba(139,92,246,.4), inset 0 -3px 8px rgba(139,92,246,.15);
  border: 4px solid #fff; transition: .15s; z-index: 5;
}
.spin-btn:hover:not(:disabled) { transform: scale(1.05); }
.spin-btn:disabled { opacity: .55; cursor: not-allowed; }
.spin-btn span { display: block; }
.wheel-stage::before {
  content: ""; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent;
  border-top: 26px solid var(--lavender-deep); z-index: 6;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.2));
}

/* side panel */
.sw-side { display: flex; flex-direction: column; gap: 18px; }
.sw-side h2 { font-size: 18px; letter-spacing: -.3px; }
.prize-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prize-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line-soft); font-size: 13px; font-weight: 600;
  transition: .18s;
}
.prize-item:hover { border-color: var(--lavender); transform: translateY(-2px); }
.prize-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.prize-item .p-val { margin-left: auto; color: var(--muted); font-size: 11.5px; font-weight: 700; }

.spin-result {
  background: linear-gradient(135deg, #f7f3ff, #fdf0f6); border: 1px dashed var(--lavender);
  border-radius: var(--radius); padding: 22px; text-align: center;
  animation: popIn .4s ease;
}
@keyframes popIn { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.sr-emoji { font-size: 44px; display: block; margin-bottom: 6px; }
.spin-result p { font-size: 13px; color: var(--muted); font-weight: 600; }
.spin-result h3 { font-size: 22px; color: var(--lavender-deep); margin: 4px 0 16px; }

.sw-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.sw-stats > div {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; text-align: center; box-shadow: var(--shadow-sm);
}
.sw-stats span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.sw-stats b { font-size: 18px; font-weight: 800; color: var(--lavender-deep); }

/* player badge */
.player-badge {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.player-badge > span:first-child { font-size: 20px; }
.player-badge > span:nth-child(2) { flex: 1; font-weight: 700; font-size: 14.5px; color: var(--text); }
.btn-change-name {
  padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-soft);
  transition: .18s;
}
.btn-change-name:hover { color: var(--lavender-deep); border-color: var(--lavender); }

/* modal input nama */
.name-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(59, 58, 82, .75);
  backdrop-filter: blur(8px); display: grid; place-items: center; padding: 20px;
}
.name-modal {
  background: var(--surface); border-radius: var(--radius-lg); padding: 36px 32px;
  box-shadow: var(--shadow-lg); max-width: 420px; width: 100%; text-align: center;
  animation: modalSlide .35s ease;
}
@keyframes modalSlide { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.name-modal-icon { font-size: 56px; display: block; margin-bottom: 12px; }
.name-modal h2 { font-size: 24px; margin-bottom: 8px; color: var(--text); }
.name-modal p { font-size: 14px; color: var(--text-soft); margin-bottom: 24px; }
.name-modal input, .name-modal textarea {
  width: 100%; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--line);
  font-family: var(--font); font-size: 15px; font-weight: 600; color: var(--text);
  background: var(--surface-2); margin-bottom: 18px; transition: .18s;
  resize: vertical;
}
.name-modal input:focus, .name-modal textarea:focus { outline: none; border-color: var(--lavender); background: #fff; }
.name-modal input::placeholder, .name-modal textarea::placeholder { color: var(--muted); font-weight: 500; }
.name-modal { max-width: 480px; }

/* participant header */
.participant-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.participant-header h2 { font-size: 16px; font-weight: 700; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 12px; font-weight: 700; font-size: 14.5px;
  transition: .18s; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--lavender), var(--lavender-deep));
  color: #fff; box-shadow: 0 8px 20px rgba(139, 92, 246, .35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(139, 92, 246, .45); }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 80px);
  background: #2d2a45; color: #fff; padding: 12px 22px; border-radius: 14px;
  font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lg); z-index: 100;
  opacity: 0; transition: .3s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* responsive */
@media (max-width: 760px) {
  .sw-wrap { grid-template-columns: 1fr; gap: 28px; justify-items: center; }
  .wheel-stage { width: 280px; height: 280px; }
  #wheel { width: 280px; height: 280px; }
  .spin-btn { width: 72px; height: 72px; font-size: 12px; }
  .prize-list { grid-template-columns: 1fr; }
  .sw-side { width: 100%; }
}
