/* PKM STMM v2 — identitas visual: benang warna-warni (seperti tenun/batik) di atas biru-hijau lereng Menoreh.
   Satu elemen khas: "benang" 8 warna di bawah header dan pada grafik hasil. */
:root {
  --bg: #f3f6fb;
  --paper: #ffffff;
  --ink: #14202b;
  --muted: #5d6b7a;
  --line: #dde4ee;
  --primary: #14485c;
  --primary-2: #1d6a85;
  --primary-dark: #0d3242;
  --teal: #0f9d8a;
  --gold: #f4a62a;
  --rose: #e0457b;
  --blue: #3b82d6;
  --violet: #7c5cd6;
  --green: #3fa34d;
  --orange: #ef6a3c;
  --cyan: #14b8c6;
  --danger: #c9372c;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 40, 60, .06), 0 12px 28px -14px rgba(16, 40, 60, .22);
  --thread: linear-gradient(90deg, var(--teal), var(--cyan), var(--blue), var(--violet), var(--rose), var(--orange), var(--gold), var(--green));
  --font: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--font); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .4em; color: var(--primary-dark); }
h1 { font-size: 1.85rem; font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8em; }
a { color: var(--primary-2); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: #fff; padding: 12px 20px; position: sticky; top: 0; z-index: 20;
  background:
    radial-gradient(circle at 12px 12px, rgba(255,255,255,.09) 2px, transparent 2.5px) 0 0 / 24px 24px,
    linear-gradient(105deg, #0d3242 0%, #14485c 50%, #1d6a85 100%);
}
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; background: var(--thread); }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.05rem; letter-spacing: .005em; }
.brand svg { width: 30px; height: 30px; flex: none; }
img.logo { height: 36px; width: auto; max-width: 130px; object-fit: contain; background: #fff; border-radius: 9px; padding: 3px 6px; flex: none; }
.top nav { display: flex; align-items: center; gap: 16px; font-size: .92rem; }
.top nav a { color: #cfe3ee; text-decoration: none; font-weight: 600; }
.top nav a:hover { color: #fff; }
.top .who { color: #9fc2d3; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 18px 90px; }
.narrow { max-width: 470px; }

/* ---------- Tombol & form ---------- */
button, .btn {
  font: inherit; font-weight: 700; cursor: pointer; border: 1.5px solid var(--primary-2);
  background: var(--primary-2); color: #fff; padding: 10px 18px; border-radius: 11px;
  text-decoration: none; display: inline-block; line-height: 1.3;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: 0 6px 14px -8px rgba(20, 72, 92, .7);
}
button:hover, .btn:hover { background: var(--primary); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost, button.ghost { background: transparent; color: var(--primary-2); box-shadow: none; }
.btn.ghost:hover, button.ghost:hover { background: #e4eff5; }
.btn.good, button.good { background: var(--green); border-color: var(--green); box-shadow: 0 6px 14px -8px rgba(63, 163, 77, .8); }
.btn.good:hover, button.good:hover { background: #328640; }
.btn.danger, button.danger { background: var(--danger); border-color: var(--danger); box-shadow: 0 6px 14px -8px rgba(201, 55, 44, .7); }
.btn.gold, button.gold { background: var(--gold); border-color: var(--gold); color: #3d2a00; box-shadow: 0 6px 14px -8px rgba(244, 166, 42, .9); }
.btn.gold:hover { background: #e39618; }
.btn.sm, button.sm { padding: 6px 12px; font-size: .86rem; border-radius: 9px; }
.btn.block { display: block; width: 100%; text-align: center; padding: 14px 18px; font-size: 1.05rem; border-radius: 13px; }
button.link { background: none; border: none; color: inherit; padding: 0; font-weight: 500; text-decoration: underline; box-shadow: none; }
button.link:hover { background: none; transform: none; }
button.link.danger { color: var(--danger); background: none; }
.top button.link { color: #cfe3ee; text-decoration: none; font-weight: 600; }

label { display: block; font-weight: 700; font-size: .9rem; margin: 15px 0 6px; color: #2a3a4a; }
input, select, textarea {
  font: inherit; width: 100%; padding: 11px 13px; border: 1.5px solid #c5d0dd; border-radius: 11px;
  background: #fff; color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(29, 106, 133, .15); }
textarea { min-height: 88px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { color: var(--danger); font-weight: 650; margin: 10px 0 0; min-height: 1.2em; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }

/* ---------- Panel ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel > :last-child { margin-bottom: 0; }
.panel.flat { position: relative; overflow: hidden; padding-top: 24px; }
.panel.flat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--thread); }

.eventlist { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.eventitem { display: block; text-decoration: none; color: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 18px 24px; position: relative; overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.eventitem::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--ac, var(--teal)); }
.eventitem:nth-child(8n+1) { --ac: var(--teal); } .eventitem:nth-child(8n+2) { --ac: var(--rose); }
.eventitem:nth-child(8n+3) { --ac: var(--blue); } .eventitem:nth-child(8n+4) { --ac: var(--gold); }
.eventitem:nth-child(8n+5) { --ac: var(--violet); } .eventitem:nth-child(8n+6) { --ac: var(--orange); }
.eventitem:nth-child(8n+7) { --ac: var(--green); } .eventitem:nth-child(8n+8) { --ac: var(--cyan); }
.eventitem:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(16,40,60,.06), 0 18px 34px -14px rgba(16,40,60,.3); }
.eventitem h3 { margin-bottom: 4px; }
.chip { display: inline-block; font-weight: 800; letter-spacing: .1em; background: #e3f4f1; color: #0b6f61; padding: 3px 11px; border-radius: 99px; font-size: .88rem; }
.badge { display: inline-block; padding: 3px 11px; border-radius: 99px; font-size: .8rem; font-weight: 700; background: #e7edf4; color: var(--muted); }
.badge.live { background: var(--green); color: #fff; animation: pulse 2s infinite; }
.badge.warn { background: #fde7b8; color: #6a4500; }

.evhead { margin-bottom: 8px; }
.back { font-size: .9rem; text-decoration: none; font-weight: 600; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 16px 0 20px; padding: 5px; background: #e6edf5; border-radius: 14px; -webkit-overflow-scrolling: touch; }
.tabs a { padding: 9px 16px; text-decoration: none; color: var(--muted); font-weight: 700; white-space: nowrap; border-radius: 10px; font-size: .94rem; transition: background .12s, color .12s; }
.tabs a:hover { color: var(--primary); }
.tabs a.on { background: #fff; color: var(--primary); box-shadow: 0 2px 8px -2px rgba(16,40,60,.25); }

/* ---------- Statistik ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--ac); }
.stat:nth-child(1) { --ac: var(--teal); } .stat:nth-child(2) { --ac: var(--blue); } .stat:nth-child(3) { --ac: var(--violet); }
.stat:nth-child(4) { --ac: var(--rose); } .stat:nth-child(5) { --ac: var(--green); }
.stat .v { font-size: 2.1rem; font-weight: 800; color: var(--ac); line-height: 1.1; margin-top: 4px; }
.stat .l { font-size: .84rem; color: var(--muted); font-weight: 600; }

.share { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.qr { background: #fff; padding: 10px; border: 1px solid var(--line); border-radius: 14px; line-height: 0; box-shadow: var(--shadow); }
.qr img, .qr canvas { width: 100% !important; height: auto !important; display: block; }
.linkbox { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; background: #eef3f8; padding: 9px 12px; border-radius: 9px; word-break: break-all; }

/* ---------- Tabel ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input { flex: 1; min-width: 180px; }
.tablewrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid #e9eef5; vertical-align: middle; }
th { background: #f1f6fa; font-weight: 750; white-space: nowrap; font-size: .82rem; color: var(--muted); }
tbody tr:hover td { background: #fafcfe; }
tr:last-child td { border-bottom: none; }
td.c, th.c { text-align: center; }
td.att { cursor: pointer; user-select: none; }
td.att:hover { background: #e9f6ec !important; }
.yes { color: var(--green); font-weight: 800; font-size: 1.1rem; }
.no { color: #c4cdd8; }
.delta.pos { color: var(--green); font-weight: 800; }
.delta.neg { color: var(--danger); font-weight: 800; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }

/* ---------- Modal & toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8, 28, 40, .6); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 26px 12px; animation: fade .18s ease; }
.modal { background: var(--paper); border-radius: 20px; width: 100%; max-width: 490px; padding: 24px; box-shadow: 0 30px 70px rgba(0,0,0,.35); animation: rise .25s cubic-bezier(.2, .8, .2, 1); }
.modal.wide { max-width: 780px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 24px); max-width: 420px; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 650; box-shadow: 0 10px 28px rgba(0,0,0,.3); animation: rise .25s ease; }
.toast.bad { background: var(--danger); }
.toast.good { background: var(--green); }

/* ---------- Editor soal ---------- */
.qcard { border: 1.5px solid var(--line); border-radius: 14px; padding: 16px; margin: 14px 0; background: #fafcfe; border-left: 6px solid var(--blue); }
.qcard textarea { min-height: 66px; margin: 6px 0; }
.opt { display: flex; gap: 10px; align-items: center; margin: 7px 0; font-weight: 400; }
.opt input[type=radio] { width: 20px; height: 20px; flex: none; accent-color: var(--green); }

/* ---------- Interaksi & hasil ---------- */
.itrow { border-top: 1px solid var(--line); padding: 16px 0; }
.itrow:first-child { border-top: none; }
.itactions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.bars { display: grid; gap: 10px; margin: 14px 0; }
.bar { position: relative; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 20px; background: #fff; min-height: 48px; align-items: center; }
.bar::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--c); z-index: 2; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); opacity: .22; transition: width .7s cubic-bezier(.2, .8, .2, 1); z-index: 0; }
.bar .lbl, .bar .val { position: relative; z-index: 1; font-weight: 700; }
.bar.ok { border-color: var(--green); box-shadow: 0 0 0 3px rgba(63, 163, 77, .18); }
.bar.mine { outline: 3px solid var(--gold); }
.cloud { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; align-items: center; padding: 18px 4px; line-height: 1.1; }
.cloud span { font-weight: 800; animation: pop .5s ease both; }
.answers { display: grid; gap: 10px; margin: 14px 0; }
.answers div { background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--c, var(--blue)); border-radius: 12px; padding: 11px 14px; word-break: break-word; animation: rise .35s ease both; }
.answers div:nth-child(8n+1) { --c: var(--teal); } .answers div:nth-child(8n+2) { --c: var(--rose); }
.answers div:nth-child(8n+3) { --c: var(--blue); } .answers div:nth-child(8n+4) { --c: var(--gold); }
.answers div:nth-child(8n+5) { --c: var(--violet); } .answers div:nth-child(8n+6) { --c: var(--orange); }
.answers div:nth-child(8n+7) { --c: var(--green); } .answers div:nth-child(8n+8) { --c: var(--cyan); }

/* ---------- Pengaturan logo ---------- */
.logoprev { width: 180px; height: 110px; border: 2px dashed #b8c6d6; border-radius: 14px; display: grid; place-items: center; background: #f7fafd; overflow: hidden; }
.logoprev img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- Layar proyektor ----------
   Semua ukuran memakai rem. JavaScript mengatur font-size root sesuai resolusi layar
   dan memperkecilnya otomatis bila isi melebihi tinggi layar, sehingga selalu muat. */
.stage {
  height: 100vh; width: 100%; color: #fff; padding: 3vh 3.5vw 4vh; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 14px 14px, rgba(255,255,255,.055) 2px, transparent 2.5px) 0 0 / 28px 28px,
    radial-gradient(70vw 60vh at 85% -10%, rgba(124, 92, 214, .55), transparent 60%),
    radial-gradient(60vw 60vh at -10% 110%, rgba(15, 157, 138, .5), transparent 60%),
    radial-gradient(40vw 40vh at 100% 100%, rgba(224, 69, 123, .35), transparent 60%),
    #0a2433;
}
.stage::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 7px; background: var(--thread); }
.stage #view { height: 100%; overflow: hidden; }
.stage .ctl { position: fixed; top: 8px; right: 12px; z-index: 5; display: flex; gap: 6px; opacity: .35; transition: opacity .2s; }
.stage .ctl:hover { opacity: 1; }
.stage .ctl a, .stage .ctl button { color: #fff; text-decoration: none; font-size: 1.05rem; background: rgba(255,255,255,.14); border: none; box-shadow: none; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.stage .brandrow { display: flex; align-items: center; gap: .9rem; font-weight: 800; font-size: 1.3rem; }
.stage .brandrow img.logo { height: 3.2rem; }
.stage .evt { color: #b9d5e3; font-size: 1.3rem; font-weight: 600; }
.stage .pill { display: inline-block; background: rgba(255,255,255,.14); padding: .3rem 1rem; border-radius: 99px; font-size: 1rem; font-weight: 700; backdrop-filter: blur(4px); }
.enter { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }

/* Mode presensi: QR dan detail registrasi dominan */
.attend { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 4vw; align-items: center; height: 100%; }
.qrcard { justify-self: center; background: #fff; border-radius: 2rem; padding: 1.3rem; width: min(40vw, 64vh); box-shadow: 0 0 0 .6rem rgba(255,255,255,.12), 0 40px 90px -20px rgba(0,0,0,.6); animation: float 6s ease-in-out infinite; }
.qrcard #qr { line-height: 0; }
.qrcard #qr img, .qrcard #qr canvas { width: 100% !important; height: auto !important; display: block; }
.qrcard .scan { text-align: center; color: var(--primary-dark); font-weight: 800; font-size: 1.5rem; margin-top: .8rem; line-height: 1.2; }
.attend .info { display: grid; gap: 1.2rem; min-width: 0; }
.attend h1 { color: #fff; font-size: 4.2rem; line-height: 1.04; margin: 0; letter-spacing: -.025em; word-break: break-word; }
.attend h1 .hl { background: linear-gradient(90deg, var(--gold), var(--rose)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.codebox { background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.2); border-radius: 1.4rem; padding: 1.1rem 1.6rem; backdrop-filter: blur(6px); }
.codebox .lbl { color: #b9d5e3; font-size: 1rem; font-weight: 700; }
.codebox .code { font-size: 4rem; font-weight: 800; letter-spacing: .16em; color: var(--gold); line-height: 1.05; }
.codebox .url { font-size: 1.5rem; font-weight: 650; word-break: break-all; }
.counter { display: flex; align-items: baseline; gap: .9rem; font-size: 1.4rem; color: #cfe3ee; font-weight: 650; }
.counter b { font-size: 4rem; color: #fff; line-height: 1; font-variant-numeric: tabular-nums; }
.counter b.bump { animation: pop .5s ease; }
.recent { display: flex; flex-wrap: wrap; gap: .6rem; max-height: 8.5rem; overflow: hidden; }
.rchip { background: var(--c, var(--teal)); color: #fff; padding: .35rem 1rem; border-radius: 99px; font-weight: 700; font-size: 1.05rem; animation: pop .5s ease both; box-shadow: 0 8px 18px -8px rgba(0,0,0,.5); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rchip:nth-child(8n+1) { --c: #0f9d8a; } .rchip:nth-child(8n+2) { --c: #e0457b; } .rchip:nth-child(8n+3) { --c: #3b82d6; }
.rchip:nth-child(8n+4) { --c: #c98400; } .rchip:nth-child(8n+5) { --c: #7c5cd6; } .rchip:nth-child(8n+6) { --c: #ef6a3c; }
.rchip:nth-child(8n+7) { --c: #3fa34d; } .rchip:nth-child(8n+8) { --c: #14a3b0; }

/* Mode pertanyaan: QR mengecil ke pojok, pertanyaan dominan */
.qview { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.qtop { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; margin-bottom: 1.6rem; flex: none; }
.minijoin { display: flex; align-items: center; gap: 1rem; background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.2); border-radius: 1.2rem; padding: .6rem 1.2rem .6rem .6rem; backdrop-filter: blur(6px); flex: none; }
.minijoin .qrs { background: #fff; padding: .4rem; border-radius: .8rem; width: 6.6rem; line-height: 0; }
.minijoin .qrs img, .minijoin .qrs canvas { width: 100% !important; height: auto !important; display: block; }
.minijoin .code { font-size: 2.1rem; font-weight: 800; letter-spacing: .14em; color: var(--gold); line-height: 1; }
.minijoin .lbl { color: #b9d5e3; font-size: .85rem; font-weight: 650; }
.qview h1 { color: #fff; font-size: 3.2rem; line-height: 1.12; margin: .8rem 0 1.4rem; letter-spacing: -.02em; word-break: break-word; flex: none; }
.qview #res { flex: 1; min-height: 0; }
.qview .bars { gap: .8rem; margin: 0; }
.qview .bar { min-height: 4rem; font-size: 1.65rem; color: var(--ink); border: none; border-radius: 1rem; padding: .5rem 1rem .5rem 1.6rem; }
.qview .bar::before { width: .7rem; }
.qview .bar .fill { opacity: .5; }
.qview .bar.ok { box-shadow: 0 0 0 .3rem rgba(63, 163, 77, .55); }
.qview .answers { gap: .6rem; margin: 0; }
.qview .answers div { font-size: 1.5rem; color: var(--ink); padding: .6rem 1rem; }
.qview .muted { color: #b9d5e3; font-size: 1rem; margin-top: .6rem; }
.qview .cloud { padding: 2rem 0; gap: .5rem 2.4rem; font-size: 1.6rem; }
.wait { font-size: 1.9rem; color: #b9d5e3; }

/* Sambutan peserta di layar */
#welcome { position: fixed; inset: 0; z-index: 30; pointer-events: none; display: grid; place-items: center; padding: 3vw; }
.wcard { text-align: center; background: linear-gradient(145deg, rgba(255,255,255,.97), rgba(255,255,255,.9)); color: var(--primary-dark); border-radius: 2.2rem; padding: 2rem 3.6rem; box-shadow: 0 0 0 .7rem rgba(255,255,255,.18), 0 50px 120px -20px rgba(0,0,0,.7); max-width: 92vw; max-height: 92vh; animation: welcomeIn .7s cubic-bezier(.2, 1.2, .3, 1) both; }
.wcard.out { animation: welcomeOut .45s ease both; }
.wcard .hi { font-size: 1.6rem; font-weight: 700; color: var(--rose); margin-top: .4rem; }
.wcard .nm { font-size: 4.6rem; font-weight: 800; line-height: 1.08; letter-spacing: -.025em; background: linear-gradient(90deg, var(--teal), var(--blue), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; word-break: break-word; padding-bottom: .1em; }
.wcard .gp { font-size: 1.6rem; color: var(--muted); font-weight: 650; margin-top: .3rem; }
.wcard.small-mode { padding: 1.2rem 2.2rem; border-radius: 1.6rem; }
.wcard.small-mode .nm { font-size: 3rem; }
svg.tick { width: 6rem; height: auto; }
.wcard svg.tick { width: 6.5rem; }
svg.tick circle { fill: var(--green); transform-origin: center; animation: pop .5s .05s ease both; }
svg.tick path { fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw .5s .4s ease forwards; }

.fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 400; }

/* ---------- Kartu sesi yang bisa memanjang ---------- */
.sess { padding: 0; overflow: hidden; }
.sesshead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 20px; cursor: pointer; transition: background .12s; }
.sesshead:hover { background: #f7fafd; }
.chev { display: inline-block; transition: transform .25s ease; color: var(--muted); font-size: 1.2rem; width: 24px; text-align: center; }
.sess.open .chev { transform: rotate(180deg); }
.sess.open .sesshead { border-bottom: 1px solid var(--line); background: #f4f9fc; }
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.sess.open .collapse { grid-template-rows: 1fr; }
.collapse > .inner { overflow: hidden; min-height: 0; }
.sessbody { padding: 16px 20px 20px; }
.sessbody .tablewrap { box-shadow: none; }
.sigthumb { height: 34px; width: auto; max-width: 110px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; display: block; }

/* ---------- Peserta terhubung ---------- */
.peers { display: grid; gap: 8px; margin-top: 12px; }
.peer { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; animation: rise .3s ease both; flex-wrap: wrap; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--c, var(--teal)); flex: none; position: relative; }
.avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #3fd06c; border: 2px solid #fff; }
.peer .who { flex: 1; min-width: 140px; line-height: 1.3; }
.peer:nth-child(8n+1) { --c: var(--teal); } .peer:nth-child(8n+2) { --c: var(--rose); } .peer:nth-child(8n+3) { --c: var(--blue); }
.peer:nth-child(8n+4) { --c: #c98400; } .peer:nth-child(8n+5) { --c: var(--violet); } .peer:nth-child(8n+6) { --c: var(--orange); }
.peer:nth-child(8n+7) { --c: var(--green); } .peer:nth-child(8n+8) { --c: var(--cyan); }

/* ---------- Saran kelompok/usaha ---------- */
.suggest { margin-top: 8px; }
.suggest .st { font-size: .84rem; color: var(--muted); font-weight: 650; margin-bottom: 6px; }
.suggest .st.ok { color: var(--green); }
.sgchips { display: flex; flex-wrap: wrap; gap: 8px; }
.sgchip { background: #fff; color: var(--ink); border: 1.5px solid var(--c, var(--teal)); box-shadow: none; padding: 7px 12px; border-radius: 99px; font-weight: 650; font-size: .9rem; animation: pop .3s ease both; text-align: left; }
.sgchip small { color: var(--muted); font-weight: 600; margin-left: 4px; }
.sgchip:hover { background: color-mix(in srgb, var(--c, var(--teal)) 12%, #fff); transform: none; }
.sgchip:nth-child(8n+1) { --c: var(--teal); } .sgchip:nth-child(8n+2) { --c: var(--rose); } .sgchip:nth-child(8n+3) { --c: var(--blue); }
.sgchip:nth-child(8n+4) { --c: #c98400; } .sgchip:nth-child(8n+5) { --c: var(--violet); } .sgchip:nth-child(8n+6) { --c: var(--orange); }
.sgchip:nth-child(8n+7) { --c: var(--green); } .sgchip:nth-child(8n+8) { --c: var(--cyan); }

/* ---------- Sisi peserta ---------- */
.pbar { color: #fff; padding: 14px 18px 18px; position: relative;
  background: radial-gradient(circle at 12px 12px, rgba(255,255,255,.09) 2px, transparent 2.5px) 0 0 / 24px 24px, linear-gradient(105deg, #0d3242 0%, #14485c 55%, #1d6a85 100%); }
.pbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--thread); }
.pbrand { display: flex; align-items: center; gap: 12px; max-width: 540px; margin: 0 auto; }
.pbrand svg { width: 34px; height: 34px; flex: none; }
.pbar h1 { font-size: 1.15rem; margin: 0; color: #fff; }
.pbar .sub { color: #a9cbdb; font-size: .86rem; font-weight: 600; }
.pbar .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-right: 7px; }
.pbar .dot.on { background: #6be08a; box-shadow: 0 0 0 4px rgba(107, 224, 138, .25); }
.pwrap { max-width: 540px; margin: 0 auto; padding: 18px 14px 70px; }
.pcard { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.pcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--ac, var(--teal)); }
.pcard h2 { font-size: 1.08rem; margin-bottom: 8px; padding-left: 6px; }
.pcard > *:not(h2):not(.badge) { padding-left: 6px; }
.pcard.c-presensi { --ac: var(--teal); } .pcard.c-pre { --ac: var(--blue); } .pcard.c-post { --ac: var(--violet); }
.pcard.live { --ac: var(--rose); border-color: #f3c2d4; box-shadow: 0 0 0 4px rgba(224, 69, 123, .1), var(--shadow); }
.pcard.sent { animation: sent .6s ease; }
.status { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ok-ic { color: var(--green); font-weight: 900; }
.choicebtn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; color: var(--ink); border: 2px solid var(--line); padding: 14px 16px; margin: 9px 0; font-weight: 650; border-radius: 14px; box-shadow: none; position: relative; overflow: hidden; }
.choicebtn::before { content: attr(data-l); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--c); color: #fff; font-weight: 800; flex: none; font-size: .9rem; }
.choicebtn:hover { background: #f4f9fc; transform: translateY(-1px); border-color: var(--c); }
.choicebtn.sel { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.choicebtn.sel::after { content: "✓"; margin-left: auto; color: var(--c); font-weight: 900; font-size: 1.3rem; animation: pop .45s ease both; }
.choicebtn.pop { animation: choose .55s cubic-bezier(.2, 1.4, .3, 1); }
.qrun { border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; margin: 14px 0; background: #fff; box-shadow: var(--shadow); }
.qrun .qt { font-weight: 750; margin-bottom: 10px; }
.qrun label.o { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; margin: 7px 0; cursor: pointer; color: var(--ink); transition: background .12s, border-color .12s; }
.qrun label.o:has(input:checked) { border-color: var(--blue); background: #e8f1fc; }
.qrun label.o input { margin-top: 3px; width: 20px; height: 20px; flex: none; accent-color: var(--blue); }
.bigscore { font-size: 4rem; font-weight: 800; line-height: 1; background: linear-gradient(90deg, var(--teal), var(--blue), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pop .7s ease both; }
canvas.sig { width: 100%; height: 170px; border: 2px dashed #8aa3b8; border-radius: 14px; background: #fff; touch-action: none; display: block; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .88rem; margin-top: 14px; }
.consent input { margin-top: 3px; width: 20px; height: 20px; flex: none; }

.celebrate { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 30%, rgba(29,106,133,.96), rgba(10,36,51,.98)); color: #fff; text-align: center; animation: fade .3s ease; }
.celebrate.out { animation: fadeOut .35s ease both; }
.celebrate .cbox { max-width: 380px; }
.celebrate h2 { color: #fff; font-size: 1.7rem; margin: 14px 0 4px; animation: rise .5s .5s ease both; }
.celebrate .nm { font-size: 2.2rem; font-weight: 800; line-height: 1.1; color: var(--gold); animation: rise .5s .65s ease both; word-break: break-word; }
.celebrate p { color: #cfe3ee; margin: 10px 0 18px; animation: rise .5s .8s ease both; }
.celebrate .btn { animation: rise .5s .95s ease both; background: var(--gold); border-color: var(--gold); color: #3d2a00; }
.celebrate svg.tick { width: 110px; }

/* ---------- Keyframes ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(63, 163, 77, .5); } 50% { box-shadow: 0 0 0 7px rgba(63, 163, 77, 0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes welcomeIn { 0% { opacity: 0; transform: scale(.6) translateY(40px) rotate(-2deg); } 100% { opacity: 1; transform: none; } }
@keyframes welcomeOut { to { opacity: 0; transform: scale(.9) translateY(-30px); } }
@keyframes choose { 0% { transform: scale(1); } 35% { transform: scale(.94); } 70% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes sent { 0% { transform: scale(1); } 40% { transform: scale(1.025); box-shadow: 0 0 0 8px rgba(63,163,77,.25); } 100% { transform: scale(1); } }

@media (max-aspect-ratio: 1/1) {
  .attend { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 2vh; align-items: start; }
  .qrcard { width: min(70vw, 34vh); }
  .attend h1 { font-size: 3rem; }
}
@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  .top .who { display: none; }
  .top { padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============================================================
   TAMPILAN HP: menu menjadi sidebar (drawer) dengan hamburger
   ============================================================ */
.burger, .scrim, .drawer, .tabpill { display: none; }
.top { padding-top: calc(12px + env(safe-area-inset-top)); }
.pwrap { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }

@media (max-width: 800px) {
  body.menu-open { overflow: hidden; }
  .top { justify-content: flex-start; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
  .top nav { display: none; }
  .top .brand { min-width: 0; flex: 1; }
  .top .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; flex: none;
    width: 44px; height: 44px; padding: 0 11px; background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.28); border-radius: 12px; box-shadow: none;
  }
  .burger:hover { background: rgba(255,255,255,.2); transform: none; }
  .burger span { display: block; height: 2.5px; background: #fff; border-radius: 2px; }

  .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(8, 28, 40, .6); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  body.menu-open .scrim { opacity: 1; pointer-events: auto; }

  .drawer {
    display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 45;
    width: min(84vw, 320px); color: #fff; overflow-y: auto; overscroll-behavior: contain;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
    background: radial-gradient(circle at 12px 12px, rgba(255,255,255,.07) 2px, transparent 2.5px) 0 0 / 24px 24px, linear-gradient(170deg, #0d3242 0%, #14485c 60%, #1d6a85 100%);
    box-shadow: 12px 0 40px rgba(0,0,0,.35);
    transform: translateX(-104%); visibility: hidden;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s .28s;
  }
  body.menu-open .drawer { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
  .drawer::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 4px; background: linear-gradient(180deg, var(--teal), var(--cyan), var(--blue), var(--violet), var(--rose), var(--orange), var(--gold), var(--green)); }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 12px; }
  .drawer-head .brand { min-width: 0; font-size: 1rem; }
  .drawer-head .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dclose { background: rgba(255,255,255,.12); border: none; color: #fff; width: 38px; height: 38px; padding: 0; border-radius: 10px; font-size: 1rem; box-shadow: none; flex: none; }
  .dclose:hover { background: rgba(255,255,255,.22); transform: none; }
  .drawer-user { display: flex; align-items: center; gap: 12px; margin: 4px 16px 10px; padding: 12px; background: rgba(255,255,255,.1); border-radius: 14px; line-height: 1.3; }
  .drawer-user .small { color: #a9cbdb; }
  .drawer-nav { display: flex; flex-direction: column; padding: 6px 12px; flex: 1; }
  .dsec { color: #8fb8cb; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; padding: 14px 10px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .drawer-nav a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; color: #dcecf4; text-decoration: none; font-weight: 650; border-radius: 12px; position: relative; }
  .drawer-nav a::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dc, var(--teal)); flex: none; }
  .drawer-nav a:nth-of-type(8n+1) { --dc: var(--teal); } .drawer-nav a:nth-of-type(8n+2) { --dc: var(--rose); }
  .drawer-nav a:nth-of-type(8n+3) { --dc: var(--blue); } .drawer-nav a:nth-of-type(8n+4) { --dc: var(--gold); }
  .drawer-nav a:nth-of-type(8n+5) { --dc: var(--violet); } .drawer-nav a:nth-of-type(8n+6) { --dc: var(--orange); }
  .drawer-nav a:nth-of-type(8n+7) { --dc: var(--green); } .drawer-nav a:nth-of-type(8n+8) { --dc: var(--cyan); }
  .drawer-nav a:active { background: rgba(255,255,255,.12); }
  .drawer-nav a.on { background: #fff; color: var(--primary-dark); }
  .drawer-foot { padding: 12px 16px 18px; }
  .drawer-foot .btn.ghost { color: #fff; border-color: rgba(255,255,255,.45); }
  .drawer-foot .btn.ghost:hover { background: rgba(255,255,255,.14); }

  /* tab event pindah ke sidebar; tampilkan tombol penunjuk halaman aktif */
  .tabs { display: none; }
  .tabpill { display: flex; align-items: center; gap: 8px; width: 100%; margin: 14px 0 16px; padding: 12px 16px; background: #fff; color: var(--primary); border: 1.5px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); font-size: 1rem; text-align: left; }
  .tabpill b { flex: 1; }
  .tabpill:hover { background: #f4f9fc; transform: none; }

  /* penyesuaian umum di HP */
  .wrap { padding: 18px 14px calc(80px + env(safe-area-inset-bottom)); }
  .eventlist { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat .v { font-size: 1.7rem; }
  .share { flex-direction: column; align-items: stretch; }
  .share .qr { align-self: center; }
  .share .row .btn, .share .row button { flex: 1 1 auto; text-align: center; }
  .toolbar > * { flex: 1 1 100%; }
  .panel { padding: 16px; }
  .sesshead { padding: 14px 16px; }
  .sessbody { padding: 12px 14px 16px; }
  .overlay { padding: 12px 10px; }
  .modal { padding: 18px; border-radius: 16px; }
  .modal .actions { justify-content: stretch; }
  .modal .actions button { flex: 1; }
  button.sm, .btn.sm { min-height: 38px; }
  .itactions button { flex: 1 1 auto; }
  .peer { padding: 10px 12px; }
  table { font-size: .88rem; }
  th, td { padding: 9px 10px; }
}
