/* MK Quiz Live: panggung (charcoal) + tiket kertas (ivory) + lampu (#FE2200).
   Satu elemen yang diingat: tiket peserta. Sisanya tenang. */
@font-face { font-family: "Bricolage"; src: url("/fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("/fonts/jakarta.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --stage: #22201e;
  --stage-2: #2c2926;
  --stage-3: #373330;
  --stage-line: #47423d;
  --chalk: #f5efe6;
  --dust: #a89d8f;
  --paper: #f3eadb;
  --paper-2: #e9dcc6;
  --paper-line: #d6c7ae;
  --ink: #2a2420;
  --ink-2: #6f6255;
  --lamp: #fe2200;
  --lamp-deep: #d41c00;
  --ok: #2e9e6a;
  --warn: #e9a23b;
  --bad: #ff6a55;
  --display: "Bricolage", "Jakarta", system-ui, sans-serif;
  --body: "Jakarta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--stage); color: var(--chalk);
  font: 400 16px/1.55 var(--body); -webkit-font-smoothing: antialiased;
  /* lampu sorot dari atas panggung */
  background-image: radial-gradient(120% 60% at 50% -10%, rgba(254, 34, 0, .10), transparent 55%), radial-gradient(80% 40% at 50% 0%, rgba(245, 239, 230, .06), transparent 70%);
  background-repeat: no-repeat;
}
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid var(--warn); outline-offset: 3px; border-radius: 6px; }
.hidden { display: none !important; }
.wrap { max-width: 460px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 18px 48px; }

/* ---------- kepala halaman ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.mark { display: inline-flex; align-items: center; text-decoration: none; }
.mark img { height: 46px; width: auto; display: block; }
.onair { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--dust); padding: 7px 12px 7px 10px; border-radius: 999px; background: var(--stage-2); border: 1px solid var(--stage-line); }
.onair::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dust); }
.onair.live { color: var(--chalk); }
.onair.live::before { background: var(--lamp); animation: pulse 1.6s ease-in-out infinite; }
.onair.done::before { background: var(--ink-2); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(254, 34, 0, .55); } 50% { box-shadow: 0 0 0 6px rgba(254, 34, 0, 0); } }

/* ---------- tipografi ---------- */
.headline { font: 800 clamp(42px, 12.4vw, 60px)/.94 var(--display); letter-spacing: -.035em; margin: 30px 0 16px; text-wrap: balance; }
.subline { font-size: 17px; line-height: 1.5; color: #ddd4c8; margin: 0 0 26px; max-width: 34ch; }
h2 { font: 750 26px/1.08 var(--display); letter-spacing: -.02em; margin: 0 0 8px; text-wrap: balance; }
h3 { font: 700 18px/1.25 var(--display); letter-spacing: -.01em; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.quiet { color: var(--dust); }
.small { font-size: 14px; }

/* ---------- tiket ---------- */
.ticket { position: relative; color: var(--ink); filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); }
.ticket-body, .ticket-stub {
  background: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.ticket-body { border-radius: 20px 20px 0 0; padding: 18px 20px 20px; }
.ticket-stub { border-radius: 0 0 20px 20px; padding: 18px 20px 20px; position: relative; background-color: var(--lamp); color: #fff; }
/* sobekan: dua lubang setengah lingkaran + garis putus-putus */
.ticket-stub::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: 0; border-top: 2px dashed rgba(255, 255, 255, .55);
}
.ticket-stub { -webkit-mask: radial-gradient(circle 13px at 0 0, transparent 12.5px, #000 13px) top left / 51% 100% no-repeat, radial-gradient(circle 13px at 100% 0, transparent 12.5px, #000 13px) top right / 51% 100% no-repeat;
  mask: radial-gradient(circle 13px at 0 0, transparent 12.5px, #000 13px) top left / 51% 100% no-repeat, radial-gradient(circle 13px at 100% 0, transparent 12.5px, #000 13px) top right / 51% 100% no-repeat; }
.ticket-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.ticket-head { align-items: center; }
.ticket-head .t-brand { font: 700 16px/1 var(--display); letter-spacing: -.01em; display: inline-flex; gap: 9px; align-items: center; }
.ticket-head .t-brand img { width: 26px; height: 26px; display: block; }
.ticket-head .t-kind { font-size: 13px; color: var(--ink-2); }
.t-date { font: 800 38px/1 var(--display); letter-spacing: -.03em; margin: 0 0 16px; }
.t-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.t-grid div { min-width: 0; }
.t-grid.wide-first { grid-template-columns: 1.35fr 1fr 1fr; }
.t-label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 2px; }
.t-value { display: block; font: 700 21px/1.1 var(--display); letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.t-venue { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--paper-line); font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.t-venue .t-label { font-weight: 400; }
.stub-row { display: flex; align-items: center; gap: 14px; }
.count { font: 800 30px/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stub-note { font-size: 14px; color: rgba(255, 255, 255, .88); margin: 0; }

/* tiket sedang diisi (alur daftar) */
.ticket.mini { margin-top: 18px; }
.ticket.mini .ticket-body { padding: 14px 16px; }
.ticket.mini .ticket-stub { padding: 12px 16px 14px; }
.holder { display: flex; align-items: center; gap: 14px; }
.holder canvas { width: 64px; height: 64px; border-radius: 14px; flex: none; background: var(--stage); }
.holder .h-user { font: 800 24px/1.05 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.holder .h-name { font-size: 14px; color: var(--ink-2); margin-top: 3px; overflow-wrap: anywhere; }
.holder .empty { color: #b3a48e; }
.punch { display: flex; gap: 6px; }
.punch i { width: 22px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .32); transition: background .3s var(--ease); }
.punch i.on { background: #fff; }

/* ---------- urutan langkah ---------- */
.flow { list-style: none; padding: 0; margin: 30px 0 0; position: relative; }
.flow li { position: relative; padding: 0 0 20px 52px; min-height: 40px; }
.flow li::before { content: attr(data-n); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; border-radius: 50%; background: var(--stage-2); border: 1.5px solid var(--stage-line); display: grid; place-items: center; font: 700 16px/1 var(--display); color: var(--chalk); }
.flow li:not(:last-child)::after { content: ""; position: absolute; left: 17.5px; top: 36px; bottom: 2px; width: 1.5px; background: var(--stage-line); }
.flow b { display: block; font: 700 17px/1.25 var(--display); letter-spacing: -.01em; }
.flow span { color: var(--dust); font-size: 14.5px; }
.prize { margin-top: 10px; padding: 16px 18px; border-radius: 16px; border: 1.5px solid var(--stage-line); display: flex; gap: 14px; align-items: flex-start; }
.prize svg { flex: none; margin-top: 2px; }

/* ---------- tombol ---------- */
.btn {
  -webkit-appearance: none; appearance: none; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 58px; margin-top: 14px; padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--lamp); color: #fff; font: 700 18px/1 var(--display); letter-spacing: -.005em; text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 10px 24px -8px rgba(254, 34, 0, .55);
  transition: transform .12s var(--ease), background .2s, box-shadow .2s;
}
.btn:active { transform: scale(.98); background: var(--lamp-deep); }
.btn:disabled { background: var(--stage-3); color: var(--dust); box-shadow: none; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--chalk); border: 1.5px solid var(--stage-line); box-shadow: none; font-weight: 600; font-size: 16px; }
.btn.ghost:active { background: var(--stage-2); }
.btn.text { background: none; box-shadow: none; color: var(--dust); min-height: 44px; font: 600 15px/1 var(--body); margin-top: 6px; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

/* ---------- formulir ---------- */
.step { animation: stepIn .32s var(--ease); }
.step.back { animation-name: stepBack; }
@keyframes stepIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes stepBack { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.step-meta { font-size: 13.5px; color: var(--dust); margin: 26px 0 6px; }
.field { display: block; margin: 18px 0 0; }
.field > .f-label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 7px; }
.input {
  width: 100%; font-size: 18px; color: var(--chalk); background: var(--stage-2); border: 1.5px solid var(--stage-line);
  border-radius: 14px; padding: 15px 16px; outline: none; transition: border-color .15s, background .15s;
}
.input::placeholder { color: #776d62; }
.input:focus { border-color: var(--dust); background: var(--stage-3); }
.input.bad { border-color: var(--bad); }
.input-wrap { position: relative; }
.input-wrap .prefix { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--dust); font-size: 18px; pointer-events: none; }
.input-wrap .prefix + .input { padding-left: 34px; }
.f-hint:empty { min-height: 0; margin: 0; }
.f-hint { font-size: 13.5px; color: var(--dust); margin-top: 7px; min-height: 20px; display: flex; gap: 6px; align-items: center; }
.f-hint.bad { color: var(--bad); }
.f-hint.good { color: #5fd39b; }
.f-hint.good::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: #5fd39b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%2322201e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; flex: none; }

.consents { margin-top: 16px; display: grid; gap: 10px; }
.consent { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; background: var(--stage-2); border: 1.5px solid var(--stage-line); cursor: pointer; transition: border-color .15s, background .15s; }
.consent:has(input:checked) { border-color: var(--chalk); background: var(--stage-3); }
.consent input { -webkit-appearance: none; appearance: none; flex: none; width: 26px; height: 26px; margin: 0; border-radius: 8px; border: 2px solid var(--dust); display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
.consent input:checked { background: var(--lamp); border-color: var(--lamp); }
.consent input:checked::after { content: ""; width: 14px; height: 8px; border: 3px solid #fff; border-top: 0; border-right: 0; transform: translate(0, -2px) rotate(-45deg); }
.consent b { display: block; font-size: 15.5px; line-height: 1.35; }
.consent small { display: block; color: var(--dust); font-size: 13.5px; margin-top: 4px; line-height: 1.45; }
.consent .need { display: inline-block; font-size: 12px; font-weight: 700; color: #ff9b8a; margin-bottom: 4px; }
.consent .opt { display: inline-block; font-size: 12px; font-weight: 600; color: var(--dust); margin-bottom: 4px; }

.outfits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 4px; }
.outfit { -webkit-appearance: none; appearance: none; border: 2px solid var(--stage-line); background: var(--stage-2); color: var(--chalk); border-radius: 18px; padding: 8px 8px 11px; cursor: pointer; text-align: center; font: 600 14px/1.2 var(--body); transition: border-color .15s, transform .15s var(--ease); }
.outfit canvas { display: block; width: 100%; aspect-ratio: 1; border-radius: 12px; margin-bottom: 9px; }
.outfit[aria-pressed=true] { border-color: var(--lamp); transform: translateY(-2px); }
.why { margin-top: 16px; padding: 16px 18px; border-radius: 16px; background: var(--stage-2); }
.why h3 { font-size: 16px; }
.why p { color: #d8cfc2; font-size: 14.5px; margin: 0; }

.stage { position: relative; width: 100%; aspect-ratio: 1; border-radius: 24px; overflow: hidden; background: var(--stage-2); touch-action: none; user-select: none; -webkit-user-select: none; margin-top: 16px; }
.stage canvas { width: 100%; height: 100%; display: block; }
.stage .s-tip { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); font-size: 13px; font-weight: 600; color: #fff; background: rgba(34, 32, 30, .72); padding: 7px 12px; border-radius: 999px; pointer-events: none; white-space: nowrap; transition: opacity .3s; }
.stage .s-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--chalk); background: rgba(34, 32, 30, .55); font-weight: 600; }
.zoom { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--dust); }
.zoom input { flex: 1; accent-color: var(--lamp); height: 34px; }

.alert { margin-top: 14px; padding: 13px 15px; border-radius: 14px; background: rgba(255, 106, 85, .12); border: 1px solid rgba(255, 106, 85, .45); color: #ffc2b8; font-size: 15px; }
.notice { padding: 9px 14px; background: var(--warn); color: #2a1a00; font-weight: 700; font-size: 13.5px; text-align: center; }

/* ---------- tiket jadi ---------- */
.qr-box { background: #fff; border-radius: 16px; padding: 12px; box-shadow: 0 6px 18px rgba(120, 14, 0, .35); width: 100%; max-width: 280px; margin: 4px auto 0; aspect-ratio: 1; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: #8a5a00; margin-top: 6px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.status.ok { color: #1f7a50; }
.status.ok::before { background: var(--ok); }
.printed .ticket-stub { animation: print 1.1s var(--ease) .15s both; transform-origin: top; }
@keyframes print { 0% { clip-path: inset(0 0 100% 0); transform: translateY(-14px); } 70% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 0); transform: none; } }
.printed .holder { animation: settle .6s var(--ease) both; }
@keyframes settle { from { opacity: .4; transform: scale(.98); } to { opacity: 1; transform: none; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
.card { margin-top: 14px; padding: 18px; border-radius: 18px; background: var(--stage-2); border: 1px solid var(--stage-line); }
.card p { color: #d8cfc2; font-size: 14.5px; }
.saved-img { width: 100%; border-radius: 16px; display: block; margin-top: 12px; }

footer { margin-top: 36px; color: #7c7268; font-size: 13px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
