/* ══════════ Undian Doorprize — desain bersama (mengikuti brand senatorhasanbasri.com) ══════════ */
:root {
  --gold: #C8A84B; --gold-light: #E8D18A; --gold-dim: #8A7030;
  --navy: #0D1E3A; --navy-mid: #1A3260; --navy-light: #2A4B8C;
  --cream: #F9F5EE; --cream-dark: #EDE8DF;
  --text: #1A1A1A; --text-muted: #5A5A5A; --text-subtle: #8A8A8A;
  --border: rgba(0,0,0,0.1);
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --ok: #1F7A4D; --warn: #B4801A; --danger: #B3261E;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans); background: var(--cream); color: var(--text);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-light); }
img { max-width: 100%; display: block; }

/* ── tombol ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 12px 20px;
  font: inherit; font-weight: 500; font-size: 15px; cursor: pointer;
  transition: transform .12s, background .18s, box-shadow .18s, opacity .18s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: var(--navy); font-weight: 600; box-shadow: 0 6px 20px rgba(200,168,75,.28); }
.btn-gold:hover:not([disabled]) { background: var(--gold-light); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover:not([disabled]) { background: var(--navy-mid); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-danger { background: #fff; border-color: rgba(179,38,30,.35); color: var(--danger); }
.btn-danger:hover { background: #FDF3F2; }
.btn-lg { padding: 16px 28px; font-size: 17px; border-radius: 12px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }

/* ── kartu ── */
.card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 22px; }
.card + .card { margin-top: 16px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.center { text-align: center; }

.note {
  border-radius: 12px; padding: 12px 14px; font-size: 14px; border: 1px solid var(--border);
  background: var(--cream); color: var(--text-muted);
}
.note.err { border-color: rgba(179,38,30,.3); background: #FDF3F2; color: var(--danger); }
.note.ok { border-color: rgba(31,122,77,.3); background: #F1F8F4; color: var(--ok); }
.note.warn { border-color: rgba(180,128,26,.35); background: #FDF8EC; color: var(--warn); }

/* ── form ── */
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; letter-spacing: .01em; }
input[type=text], input[type=tel], input[type=password], input[type=search], textarea, select {
  width: 100%; font: inherit; padding: 13px 14px; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(200,168,75,.5); outline-offset: 1px; border-color: var(--gold); }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-muted); }
.switch input { width: 18px; height: 18px; accent-color: var(--gold-dim); }

/* ══════════ HALAMAN PENDAFTARAN ══════════ */
.reg-body { background: var(--navy); min-height: 100vh; }
.reg-wrap { max-width: 520px; margin: 0 auto; padding: 22px 18px 56px; }
.reg-brand { display: flex; align-items: center; gap: 12px; color: #fff; margin-bottom: 22px; }
.reg-brand img { width: 34px; height: 34px; object-fit: contain; filter: brightness(0) invert(1); opacity: .9; }
.reg-brand div { line-height: 1.25; }
.reg-brand strong { font-family: var(--serif); font-size: 16px; display: block; }
.reg-brand small { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.reg-hero { text-align: center; color: #fff; margin-bottom: 20px; }
.reg-hero h1 { font-family: var(--serif); font-size: clamp(26px, 7.4vw, 36px); line-height: 1.15; font-weight: 700; }
.reg-hero h1 em { color: var(--gold-light); font-style: italic; }
.reg-hero p { font-size: 14px; color: rgba(255,255,255,.7); margin-top: 8px; }
.reg-chip {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(200,168,75,.14);
  color: var(--gold-light); border: 1px solid rgba(200,168,75,.35);
  padding: 6px 14px; border-radius: 999px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px;
}
.steps { display: flex; gap: 8px; margin-bottom: 16px; }
.steps i { flex: 1; height: 4px; border-radius: 99px; background: rgba(255,255,255,.16); transition: background .3s; }
.steps i.on { background: var(--gold); }
.form-card { background: #fff; border-radius: 18px; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.28); }
.form-card h2 { font-family: var(--serif); font-size: 21px; margin-bottom: 4px; }
.form-card .sub { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

.photo-zone { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.avatar-ring {
  width: min(62vw, 230px); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  border: 3px dashed rgba(13,30,58,.25); background: var(--cream);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.avatar-ring.filled { border-style: solid; border-color: var(--gold); }
.avatar-ring img { width: 100%; height: 100%; object-fit: cover; }
.avatar-ring .ph { text-align: center; color: var(--text-subtle); font-size: 13px; padding: 18px; }
.avatar-ring .ph b { display: block; font-size: 34px; margin-bottom: 6px; }
.photo-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.ticket {
  background: linear-gradient(160deg, #12264a, var(--navy)); color: #fff;
  border-radius: 18px; padding: 24px 20px; text-align: center; position: relative; overflow: hidden;
  border: 1px solid rgba(200,168,75,.35);
}
.ticket::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 50% at 80% 0%, rgba(200,168,75,.22), transparent 70%); }
.ticket .lbl { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); position: relative; }
.ticket .code { font-family: var(--serif); font-size: clamp(38px, 13vw, 54px); font-weight: 700; color: #fff; line-height: 1.05; position: relative; }
.ticket .nm { font-size: 17px; font-weight: 500; margin-top: 6px; position: relative; }
.ticket .sm { font-size: 13px; color: rgba(255,255,255,.65); position: relative; }
.ticket .foto { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); margin: 0 auto 14px; position: relative; }

.win-list { display: grid; gap: 8px; }
.win-row { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 8px 10px; }
.win-row img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.win-row div { line-height: 1.25; }
.win-row strong { font-size: 14px; color: #fff; display: block; }
.win-row small { font-size: 11.5px; color: var(--gold-light); }

/* ══════════ LAYAR UNDIAN ══════════ */
.screen-body { background: #050B18; color: #fff; overflow: hidden; height: 100vh; }
.screen { height: 100vh; display: flex; flex-direction: column; position: relative; }
.screen-bg { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% -10%, rgba(42,75,140,.55), transparent 70%),
              radial-gradient(ellipse 50% 50% at 90% 100%, rgba(200,168,75,.14), transparent 70%); }
.screen-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 26px; padding: 22px 40px; flex-wrap: nowrap; }
.screen-top .ev { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 auto; }
.screen-top .ev > div { min-width: 0; overflow: hidden; }
.screen-top .ev img { height: 40px; filter: brightness(0) invert(1); opacity: .85; flex: 0 0 auto; }
.screen-top .ev strong { font-family: var(--serif); font-size: 21px; display: block; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-top .ev small { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-top .stat { text-align: right; flex: 0 0 auto; min-width: 108px; }
.screen-top .stat b { font-family: var(--serif); font-size: 26px; color: var(--gold); display: block; line-height: 1; }
.screen-top .stat span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.screen-main { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 40px; min-height: 0; }
.screen-foot { position: relative; padding: 14px 40px 22px; }

.idle-title { font-family: var(--serif); font-size: clamp(38px, 6vw, 82px); text-align: center; line-height: 1.05; }
.idle-title em { color: var(--gold-light); font-style: italic; }
.idle-sub { text-align: center; color: rgba(255,255,255,.6); margin-top: 14px; font-size: 17px; }
.prize-strip { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 30px; }
.prize-pill { border: 1px solid rgba(200,168,75,.4); background: rgba(200,168,75,.08); border-radius: 999px; padding: 9px 18px; font-size: 15px; color: var(--gold-light); }
.prize-pill.done { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: rgba(255,255,255,.65); text-decoration: line-through; }

.spin-head { text-align: center; }
.spin-head .lbl { font-size: 15px; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
.spin-head h2 { font-family: var(--serif); font-size: clamp(28px, 4vw, 52px); margin-top: 6px; }
.spin-grid { display: grid; grid-template-columns: repeat(var(--cols, 6), 1fr); gap: 16px; margin-top: 34px; width: 100%; max-width: 1500px; }
.spin-card { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 12px 8px; text-align: center; transition: transform .12s, border-color .12s; }
.spin-card img { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; margin: 0 auto 8px; border: 2px solid rgba(200,168,75,.5); }
.spin-card span { font-size: 12.5px; color: rgba(255,255,255,.82); display: block; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.spin-card.hot { border-color: var(--gold); transform: translateY(-4px) scale(1.03); background: rgba(200,168,75,.14); }

.reveal { width: 100%; text-align: center; animation: pop .7s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes pop { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }
.reveal .pz { font-size: 15px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.reveal .pzname { font-family: var(--serif); font-size: clamp(20px, 2.4vw, 32px); color: rgba(255,255,255,.85); margin-top: 6px; }
.reveal-photo {
  width: min(34vh, 320px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; margin: 22px auto 18px;
  border: 6px solid var(--gold); box-shadow: 0 0 0 14px rgba(200,168,75,.16), 0 24px 70px rgba(0,0,0,.6);
  animation: ring 2.6s ease-out infinite;
}
@keyframes ring { 0% { box-shadow: 0 0 0 12px rgba(200,168,75,.20), 0 24px 70px rgba(0,0,0,.6); } 70% { box-shadow: 0 0 0 34px rgba(200,168,75,0), 0 24px 70px rgba(0,0,0,.6); } 100% { box-shadow: 0 0 0 12px rgba(200,168,75,0), 0 24px 70px rgba(0,0,0,.6); } }
.reveal-name { font-family: var(--serif); font-size: clamp(34px, 6.6vw, 92px); font-weight: 700; line-height: 1.02; text-wrap: balance; }
.reveal-meta { color: rgba(255,255,255,.68); font-size: clamp(15px, 1.6vw, 22px); margin-top: 10px; }
.reveal-badge { display: inline-block; margin-top: 18px; background: var(--gold); color: var(--navy); font-weight: 700; padding: 8px 20px; border-radius: 999px; font-size: clamp(13px, 1.2vw, 17px); letter-spacing: .06em; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 5; }

.screen-foot .board { display: flex; gap: 12px; align-items: center; overflow: hidden; border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; }
.screen-foot .board .ttl { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
.board-track { display: flex; gap: 10px; overflow: hidden; }
.board-item { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.06); border-radius: 999px; padding: 5px 14px 5px 5px; white-space: nowrap; }
.board-item img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.board-item b { font-size: 13px; font-weight: 500; }
.board-item i { font-size: 11px; color: var(--gold-light); font-style: normal; }
.screen-alert { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); background: rgba(179,38,30,.9); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 13px; z-index: 20; }
.audio-hint { position: fixed; right: 16px; bottom: 16px; z-index: 30; }

/* ══════════ PANEL ADMIN ══════════ */
.admin-body { background: #F2F1EC; }
.admin-top { background: var(--navy); color: #fff; padding: 14px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-top .t { display: flex; align-items: center; gap: 12px; }
.admin-top .t img { height: 30px; filter: brightness(0) invert(1); }
.admin-top h1 { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.admin-top h1 small { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.admin-wrap { max-width: 1180px; margin: 0 auto; padding: 20px 18px 70px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { background: none; border: none; font: inherit; font-size: 14.5px; padding: 10px 14px; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--gold); font-weight: 600; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.admin-wrap .stat { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.admin-wrap .stat b { font-family: var(--serif); font-size: 28px; display: block; line-height: 1.1; }
.admin-wrap .stat span { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-subtle); }
.draw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.draw-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.draw-card.done { background: #F7F6F1; }
.draw-card h3 { font-family: var(--serif); font-size: 18px; margin-bottom: 4px; }
.draw-card .who { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.draw-card .who img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.draw-card .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.screen-box { background: var(--navy); color: #fff; border-radius: 16px; padding: 18px; display: grid; grid-template-columns: 1fr 150px; gap: 18px; align-items: center; }
.screen-box .lnk { font-family: ui-monospace, monospace; font-size: 12.5px; background: rgba(255,255,255,.1); padding: 8px 10px; border-radius: 8px; word-break: break-all; }
table.grid { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; font-size: 14px; }
table.grid th, table.grid td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.grid th { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-subtle); font-weight: 600; background: #FAFAF7; }
table.grid tr.won td { background: #FBF6E9; }
table.grid img.thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.badge { display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); }
.badge.gold { border-color: rgba(200,168,75,.5); background: #FBF6E9; color: var(--gold-dim); }
.badge.ok { border-color: rgba(31,122,77,.35); color: var(--ok); }
.modal-back { position: fixed; inset: 0; background: rgba(5,11,24,.6); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 50; }
.modal { background: #fff; border-radius: 16px; padding: 20px; max-width: 480px; width: 100%; }

/* ── poster QR ── */
.poster { background: #fff; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 18mm 16mm; color: var(--navy); }
.poster-inner { border: 3px double var(--gold); border-radius: 8px; padding: 14mm 10mm; text-align: center; height: 100%; }
.poster h1 { font-family: var(--serif); font-size: 40pt; line-height: 1.08; margin: 6mm 0 2mm; }
.poster h1 em { color: var(--gold-dim); font-style: italic; }
.poster .kicker { font-size: 12pt; letter-spacing: .34em; text-transform: uppercase; color: var(--gold-dim); }
.poster .qr { width: 78mm; height: 78mm; margin: 8mm auto; }
.poster .qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.poster .how { font-size: 13pt; line-height: 1.7; margin-top: 4mm; }
.poster .how b { color: var(--navy); }
.poster .big { font-size: 26pt; font-family: var(--serif); margin: 6mm 0 0; }
.poster .foot { margin-top: 8mm; font-size: 10.5pt; color: #666; }
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .poster { width: auto; min-height: auto; padding: 0; margin: 0; }
  @page { size: A4; margin: 12mm; }
}

/* ── Layar besar (proyektor ruangan): perbesar supaya terbaca dari belakang ── */
@media (min-width: 1500px) {
  .screen-top { padding: 26px 48px; }
  .screen-top .ev strong { font-size: 26px; }
  .screen-top .stat { min-width: 136px; }
  .screen-top .stat b { font-size: 38px; }
  .screen-top .stat span { font-size: 13px; letter-spacing: .16em; }
  .spin-head h2 { font-size: 54px; }
  .spin-grid { max-width: 1720px; gap: 22px; margin-top: 42px; }
  .spin-card { padding: 18px 12px; border-radius: 18px; }
  .spin-card img { width: 104px; height: 104px; margin-bottom: 12px; }
  .spin-card span { font-size: 16px; line-height: 1.3; }
  .reveal-photo { width: min(38vh, 360px); }
}

/* ── responsif ── */
@media (max-width: 700px) {
  .screen-top, .screen-main, .screen-foot { padding-left: 16px; padding-right: 16px; }
  .spin-grid { --cols: 3 !important; gap: 10px; }
  .screen-box { grid-template-columns: 1fr; }
  .admin-wrap { padding: 14px 12px 60px; }
}
