:root {
  --navy: #14204a;
  --navy-deep: #081c45;
  --blue: #3350d0;
  --gold: #f2b93b;
  --bg: #f3f6ff;
  --card: #ffffff;
  --line: #dce3f5;
  --muted: #4a5578;
  --radius: 20px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--navy);
  line-height: 1.5;
}

a { color: var(--blue); }
.muted { color: var(--muted); font-size: 14px; margin: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header,
main,
.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
}
.brand-name { font-weight: 800; font-size: 22px; }
.brand-by { font-size: 13px; color: var(--muted); }

.site-header nav { display: flex; align-items: center; gap: 24px; font-weight: 500; }
.site-header nav a:not(.btn) { text-decoration: none; }

/* Hero */
.hero { padding: 24px 0 8px; }
.hero h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; font-weight: 800; }
.hero p { margin: 8px 0 0; font-size: 17px; color: var(--muted); }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}

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

.card-title { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.panel { display: grid; gap: 16px; min-width: 0; }

/* Roda */
.wheel-card { display: grid; justify-items: center; gap: 16px; padding: 32px 24px; }
.wheel-wrap { position: relative; width: 100%; max-width: 480px; }
#wheel { display: block; width: 100%; aspect-ratio: 1; }

.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20%;
  min-width: 64px;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 4px solid var(--navy);
  background: #fff;
  color: var(--navy);
  font: 800 clamp(12px, 3vw, 16px) 'Plus Jakarta Sans', system-ui, sans-serif;
  letter-spacing: 0.5px;
  cursor: pointer;
  padding: 0;
}
.hub:disabled { opacity: 0.6; cursor: not-allowed; }

/* Form */
.label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }

textarea {
  width: 100%;
  resize: vertical;
  padding: 12px 14px;
  border: 1.5px solid #c9d3ee;
  border-radius: 12px;
  background: #f8faff;
  color: var(--navy);
  font: 500 15px/1.6 'Plus Jakarta Sans', system-ui, sans-serif;
}

.options { display: grid; gap: 10px; border: 0; padding: 0; margin: 16px 0; font-size: 15px; }
.options label { display: flex; align-items: center; gap: 10px; }
.options input { width: 18px; height: 18px; accent-color: var(--blue); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  font: 700 15px 'Plus Jakarta Sans', system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; font-size: 17px; font-weight: 800; flex: 2 1 160px; min-height: 52px; }
.btn-outline { background: #fff; color: var(--navy); border-color: #c9d3ee; }
.btn-gold { background: var(--gold); color: var(--navy-deep); font-weight: 800; }

.site-header .btn-outline { border-color: var(--blue); color: var(--blue); }

/* Hasil */
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.results li { display: flex; justify-content: space-between; gap: 12px; }

/* Templat */
.templates { margin-top: 40px; }
.templates h2 { margin: 0 0 16px; font-size: 24px; font-weight: 800; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.template {
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--navy);
  font: 500 14px 'Plus Jakarta Sans', system-ui, sans-serif;
  cursor: pointer;
}
.template strong { font-size: 17px; font-weight: 800; }
.template span { color: var(--muted); }

/* CTA */
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--navy-deep);
  color: #fff;
}
.cta h2 { margin: 0; font-size: 22px; font-weight: 800; }
.cta p { margin: 4px 0 0; color: #c9d6ff; }

.site-footer { padding-top: 24px; padding-bottom: 48px; text-align: center; font-size: 14px; color: var(--muted); }
.site-footer p { margin: 0; }

/* Dialog pemenang */
dialog {
  border: 0;
  border-radius: 24px;
  padding: 32px 40px;
  max-width: min(92vw, 480px);
  text-align: center;
  color: var(--navy);
}
dialog::backdrop { background: rgba(8, 28, 69, 0.7); }
.dialog-label { margin: 0; font-weight: 700; color: var(--muted); }
.dialog-name { margin: 8px 0 20px; font-size: clamp(40px, 12vw, 72px); line-height: 1.1; font-weight: 800; color: var(--blue); overflow-wrap: anywhere; }
dialog .actions { justify-content: center; }
dialog .btn-primary { flex: 0 1 auto; }

.noscript { margin: 24px; padding: 16px; background: #fff4d6; border-radius: 12px; }

/* Layar penuh / proyektor */
body.fs .site-header,
body.fs .hero,
body.fs .panel,
body.fs .templates,
body.fs .cta,
body.fs .site-footer { display: none; }
body.fs .layout { grid-template-columns: 1fr; margin-top: 0; }
body.fs .wheel-card { border: 0; background: var(--navy-deep); min-height: 100vh; align-content: center; }
body.fs .wheel-wrap { max-width: min(92vw, 92vh); }
body.fs .muted { color: #c9d6ff; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
