:root {
  --bg: #fff7ed;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #ea580c;
  --accent-dark: #c2410c;
  --pink: #db2777;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.wrap { max-width: 1020px; margin: 0 auto; padding: 0 20px; }

.site-header {
  background: linear-gradient(135deg, #ea580c, #db2777);
  color: #fff;
  padding: 28px 0 22px;
}
.brand {
  color: #fff;
  text-decoration: none;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.brand .dot { color: #fde68a; }
.tagline { margin: 4px 0 0; opacity: 0.92; font-size: 15px; }

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-top: 24px;
  padding-bottom: 24px;
  align-items: start;
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.4px; }
.intro { margin: 0 0 18px; color: var(--muted); font-size: 15px; }

.field-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

textarea, input[type="text"] {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { resize: vertical; min-height: 150px; }
textarea:focus, input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { background: #f3f4f6; }
.btn.danger { color: #b91c1c; border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.item-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.item-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffedd5;
  border: 1px solid #fed7aa;
  color: #7c2d12;
  border-radius: 999px;
  padding: 5px 6px 5px 12px;
  font-size: 14px;
  font-weight: 500;
}
.item-list .remove {
  border: none;
  background: #fff;
  color: #b91c1c;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.item-list .remove:hover { background: #fee2e2; }
.item-list .empty { color: var(--muted); font-size: 14px; }

.wheel-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.wheel-wrap {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1 / 1;
}
#wheel {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}
.pointer {
  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: 30px solid #dc2626;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
  z-index: 2;
}
.hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 3px solid #dc2626;
  border-radius: 50%;
  z-index: 1;
}

.btn.spin {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 14px 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ea580c, #db2777);
  border: none;
  color: #fff;
  box-shadow: 0 6px 18px rgba(219, 39, 119, 0.4);
}
.btn.spin:hover { filter: brightness(1.07); background: linear-gradient(135deg, #ea580c, #db2777); }
.btn.spin:disabled { opacity: 0.55; box-shadow: none; }

.status { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 0 26px;
  color: var(--muted);
  font-size: 13px;
  background: #fff;
}
.site-footer a { color: var(--accent); }

/* ---- Pop-up pemenang ---- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
  animation: modalFade 0.25s ease both;
}
.modal[hidden] { display: none; }
@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-card {
  background: #fff;
  border-radius: 18px;
  padding: 32px 28px;
  text-align: center;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  animation: modalPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.7) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-label { margin: 0; color: #92400e; font-size: 16px; font-weight: 600; }
.modal-name {
  margin: 6px 0 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #7c2d12;
  word-break: break-word;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
  flex-wrap: wrap;
}
.btn.primary {
  background: linear-gradient(135deg, #ea580c, #db2777);
  border: none;
  color: #fff;
}
.btn.primary:hover { filter: brightness(1.07); background: linear-gradient(135deg, #ea580c, #db2777); }
