@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0a0818;
  --bg2: #120e2b;
  --card: rgba(255, 255, 255, 0.055);
  --card-b: rgba(255, 255, 255, 0.11);
  --text: #f4f1ff;
  --muted: #a39fc4;
  --gold: #f2c14e;
  --gold2: #ffe3a0;
  --violet: #8b6bff;
  --rose: #ff5d8f;
  --teal: #3ddbd9;
  --ok: #4ade80;
  --danger: #ff6b6b;
  --radius: 18px;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Playfair Display', Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(139, 107, 255, 0.34), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 93, 143, 0.2), transparent 55%),
    radial-gradient(800px 600px at 50% 125%, rgba(242, 193, 78, 0.13), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); margin: 0 0 0.4em; letter-spacing: 0.2px; }
a { color: var(--gold2); }
.muted { color: var(--muted); }
.gold-text {
  background: linear-gradient(100deg, #fff1c4, var(--gold) 45%, #ff9f6e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hidden { display: none !important; }

/* ---------- layout ---------- */
.container { width: min(1100px, 100% - 32px); margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 8, 24, 0.72);
  border-bottom: 1px solid var(--card-b);
}
.topbar .inner { display: flex; align-items: center; gap: 14px; padding: 12px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem;
  background: linear-gradient(135deg, var(--violet), var(--rose)); box-shadow: 0 6px 20px rgba(139, 107, 255, 0.45);
}
.spacer { flex: 1; }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.userbox .name { font-weight: 600; }

/* ---------- komponen ---------- */
.card {
  background: var(--card); border: 1px solid var(--card-b); border-radius: var(--radius);
  padding: 20px; backdrop-filter: blur(6px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.btn {
  appearance: none; border: 1px solid var(--card-b); background: rgba(255, 255, 255, 0.07);
  color: var(--text); font: inherit; font-weight: 600; font-size: 0.92rem;
  padding: 9px 16px; border-radius: 12px; cursor: pointer; transition: 0.18s; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { background: rgba(255, 255, 255, 0.13); transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(135deg, var(--violet), #b25cff); border-color: transparent; box-shadow: 0 8px 24px rgba(139, 107, 255, 0.4); }
.btn.gold { background: linear-gradient(135deg, var(--gold), #ff9f6e); color: #2a1a00; border-color: transparent; box-shadow: 0 8px 24px rgba(242, 193, 78, 0.35); }
.btn.danger { background: rgba(255, 107, 107, 0.15); border-color: rgba(255, 107, 107, 0.4); color: #ffb3b3; }
.btn.sm { padding: 5px 10px; font-size: 0.8rem; border-radius: 9px; }
.btn.icon { padding: 6px 9px; }

input, select, textarea {
  font: inherit; color: var(--text); background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--card-b); border-radius: 12px; padding: 10px 12px; width: 100%;
  outline: none; transition: border 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 107, 255, 0.28); }
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
select option { background: #1b1640; color: #fff; }
label.field { display: grid; gap: 6px; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--violet); cursor: pointer; padding: 0; }
input[type='color'] { padding: 2px; height: 38px; width: 56px; cursor: pointer; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 700; border: 1px solid transparent; white-space: nowrap;
}
.chip.cat { background: rgba(139, 107, 255, 0.18); color: #cfc3ff; border-color: rgba(139, 107, 255, 0.35); }
.chip.warn { background: rgba(255, 107, 107, 0.15); color: #ffb3b3; border-color: rgba(255, 107, 107, 0.35); }
.chip.ok { background: rgba(74, 222, 128, 0.15); color: #9ff0bf; border-color: rgba(74, 222, 128, 0.35); }
.rating { color: #1a1030; }

.progress { height: 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--violet), var(--rose), var(--gold)); transition: width 0.4s; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

table.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 700; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.8px; padding: 10px 12px; border-bottom: 1px solid var(--card-b); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); vertical-align: middle; }
.tbl tr:hover td { background: rgba(255, 255, 255, 0.025); }
.table-wrap { overflow-x: auto; }

dialog {
  border: 1px solid var(--card-b); border-radius: 22px; padding: 0; color: var(--text);
  background: linear-gradient(160deg, #1d1745, #130f2e); width: min(520px, 94vw);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
dialog::backdrop { background: rgba(5, 3, 15, 0.7); backdrop-filter: blur(4px); }
dialog .dlg { padding: 24px; display: grid; gap: 14px; }
dialog .dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 10px; z-index: 999; }
.toast {
  padding: 12px 16px; border-radius: 14px; background: #1f1949; border: 1px solid var(--card-b);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-weight: 600; font-size: 0.9rem; animation: pop 0.25s ease;
}
.toast.err { border-color: rgba(255, 107, 107, 0.6); background: #3a1630; }
.toast.ok { border-color: rgba(74, 222, 128, 0.5); }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.curtain { position: absolute; top: 0; width: 22vw; height: 100%; opacity: 0.55; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(139, 40, 90, 0.55) 0 14px, rgba(90, 20, 70, 0.55) 14px 28px); }
.curtain.l { left: 0; mask-image: linear-gradient(90deg, #000 30%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 30%, transparent); }
.curtain.r { right: 0; mask-image: linear-gradient(270deg, #000 30%, transparent); -webkit-mask-image: linear-gradient(270deg, #000 30%, transparent); }
.login-card { width: min(460px, 100%); text-align: center; padding: 38px 30px; position: relative; z-index: 1; }
.login-card .logo-big { font-size: 3.2rem; filter: drop-shadow(0 8px 24px rgba(242, 193, 78, 0.5)); }
.login-card h1 { font-size: clamp(1.7rem, 5vw, 2.2rem); line-height: 1.15; }
.login-card .sub { color: var(--muted); margin: 0 0 26px; }
#gbtn { display: flex; justify-content: center; min-height: 44px; }
.devbox { margin-top: 22px; text-align: left; border-top: 1px dashed var(--card-b); padding-top: 16px; display: grid; gap: 8px; }
.devbox .tag { color: var(--gold2); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- juri ---------- */
.hero { padding: 30px 0 10px; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ev-card { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 18px; margin-bottom: 14px; transition: border 0.2s, box-shadow 0.2s; scroll-margin-top: 90px; }
.ev-card.done { border-color: rgba(74, 222, 128, 0.35); }
.ev-no {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-family: var(--font-head);
  font-weight: 800; font-size: 1.35rem; background: linear-gradient(135deg, rgba(139, 107, 255, 0.3), rgba(255, 93, 143, 0.25)); border: 1px solid var(--card-b);
}
.ev-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.ev-head h3 { margin: 0; font-size: 1.2rem; font-family: var(--font-body); font-weight: 700; }
.score-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 14px; align-items: center; margin-bottom: 12px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper input { text-align: center; font-weight: 800; font-size: 1.2rem; padding: 8px 4px; }
.stepper button { width: 34px; height: 38px; border-radius: 10px; border: 1px solid var(--card-b); background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 1.1rem; cursor: pointer; flex: none; }
.stepper button:hover { background: rgba(255, 255, 255, 0.16); }
input[type='range'] { padding: 0; height: 6px; background: rgba(255, 255, 255, 0.15); border: none; border-radius: 99px; appearance: none; -webkit-appearance: none; box-shadow: none; }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), #ff9f6e); border: 2px solid #fff; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
input[type='range']::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; cursor: pointer; }
input[type='range'].unset::-webkit-slider-thumb { background: #6b6690; }
.save-state { font-size: 0.76rem; color: var(--muted); min-height: 16px; text-align: right; margin-top: 4px; }
.save-state.ok { color: var(--ok); }
.save-state.err { color: var(--danger); }
@media (max-width: 640px) {
  .ev-card { grid-template-columns: 1fr; }
  .ev-no { width: 46px; height: 46px; font-size: 1.1rem; }
  .score-row { grid-template-columns: 1fr; }
}
.section-title { display: flex; align-items: center; gap: 12px; margin: 34px 0 14px; }
.section-title .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--card-b), transparent); }
.aspect-card { margin-bottom: 14px; padding: 18px; }
.aspect-card summary { cursor: pointer; color: var(--gold2); font-size: 0.85rem; font-weight: 600; }
.aspect-card .guide { color: var(--muted); font-size: 0.88rem; line-height: 1.6; margin-top: 8px; }
.aspect-card .guide b { color: var(--text); }
.summary-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 18px; }
.summary-box .cell { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--card-b); border-radius: 14px; padding: 14px; text-align: center; }
.summary-box .lbl { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.summary-box .val { font-family: var(--font-head); font-size: 1.7rem; font-weight: 800; margin-top: 4px; }
.sticky-bar {
  position: sticky; bottom: 0; z-index: 30; margin-top: 24px; padding: 14px 0 16px;
  background: linear-gradient(180deg, transparent, rgba(10, 8, 24, 0.92) 30%);
}
.sticky-bar .bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; background: rgba(24, 18, 58, 0.92); border: 1px solid var(--card-b); border-radius: 16px; backdrop-filter: blur(10px); }
.sticky-bar .prog { flex: 1; min-width: 160px; }
.banner { padding: 14px 18px; border-radius: 14px; margin: 14px 0; font-weight: 600; }
.banner.lock { background: rgba(74, 222, 128, 0.12); border: 1px solid rgba(74, 222, 128, 0.35); color: #b6f5cd; }
.tabs-mini { display: flex; gap: 8px; margin: 16px 0 6px; }
.tabs-mini button { background: transparent; }
.tabs-mini button.active { background: rgba(139, 107, 255, 0.28); border-color: var(--violet); }

/* ---------- admin ---------- */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; gap: 22px; padding: 22px 0 60px; }
.sidenav { position: sticky; top: 84px; align-self: start; display: grid; gap: 6px; }
.sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 13px; color: var(--muted);
  text-decoration: none; font-weight: 600; border: 1px solid transparent; transition: 0.15s;
}
.sidenav a:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.sidenav a.active { background: linear-gradient(135deg, rgba(139, 107, 255, 0.28), rgba(255, 93, 143, 0.16)); color: #fff; border-color: rgba(139, 107, 255, 0.45); }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidenav { position: static; grid-auto-flow: column; overflow-x: auto; padding-bottom: 6px; }
  .sidenav a { white-space: nowrap; }
}
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { margin: 0; font-size: 1.7rem; }
.stat { padding: 18px; }
.stat .lbl { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.stat .val { font-family: var(--font-head); font-size: 2.3rem; font-weight: 800; line-height: 1.1; margin: 6px 0; }
.stat.big { background: linear-gradient(145deg, rgba(139, 107, 255, 0.28), rgba(255, 93, 143, 0.15)); border-color: rgba(139, 107, 255, 0.4); }
.bar-row { display: grid; grid-template-columns: 180px 1fr 56px; gap: 10px; align-items: center; margin: 8px 0; font-size: 0.88rem; }
.bar-row .track { height: 12px; background: rgba(255, 255, 255, 0.08); border-radius: 99px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 99px; }
.bar-row .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; flex: 1; max-width: 280px; }
details.ev { margin-bottom: 10px; padding: 0; overflow: hidden; }
details.ev > summary { cursor: pointer; padding: 14px 18px; display: flex; gap: 12px; align-items: center; list-style: none; flex-wrap: wrap; }
details.ev > summary::-webkit-details-marker { display: none; }
details.ev[open] > summary { border-bottom: 1px solid var(--card-b); background: rgba(255, 255, 255, 0.03); }
details.ev .no { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: rgba(139, 107, 255, 0.22); font-weight: 800; font-family: var(--font-head); }
.jrow { padding: 16px 18px; border-bottom: 1px dashed rgba(255, 255, 255, 0.08); display: grid; gap: 10px; }
.jrow:last-child { border-bottom: none; }
.jrow .orig { padding: 10px 12px; background: rgba(0, 0, 0, 0.25); border-radius: 11px; font-size: 0.92rem; line-height: 1.55; white-space: pre-wrap; }
.jrow .edit { display: grid; grid-template-columns: 1fr; gap: 8px; }
.jrow .edit-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.jrow .edit-actions select { width: auto; }
.drag-list { display: grid; gap: 8px; }
.drag-item { display: grid; grid-template-columns: 28px 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--card-b); }
.drag-item.dragging { opacity: 0.4; }
.drag-item.over { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(242, 193, 78, 0.35); }
.drag-item .handle { cursor: grab; color: var(--muted); font-size: 1.2rem; user-select: none; text-align: center; }
.drag-item .no { font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; text-align: center; }
.drag-item .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.matrix { border-collapse: separate; border-spacing: 0; font-size: 0.86rem; }
.matrix th, .matrix td { padding: 8px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); text-align: center; }
.matrix th.juri { writing-mode: vertical-rl; transform: rotate(180deg); height: 170px; text-align: left; vertical-align: bottom; color: var(--text); font-weight: 600; max-width: 56px; }
.matrix td.ev, .matrix th.ev { text-align: left; position: sticky; left: 0; background: #151033; z-index: 1; min-width: 260px; }
.matrix tr.none td.ev { box-shadow: inset 3px 0 0 var(--danger); }
.range-row { display: grid; grid-template-columns: 1fr 110px 70px 40px; gap: 10px; align-items: end; margin-bottom: 10px; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }

/* ---------- presentasi ---------- */
body.present { overflow: hidden; background: #07050f; }
.launcher { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.launcher .card { width: min(560px, 100%); text-align: center; padding: 36px 28px; display: grid; gap: 16px; }
.stage { position: fixed; inset: 0; background:
  radial-gradient(1200px 700px at 20% -10%, rgba(139, 107, 255, 0.35), transparent 60%),
  radial-gradient(1000px 600px at 100% 100%, rgba(255, 93, 143, 0.25), transparent 60%),
  radial-gradient(700px 400px at 50% 50%, rgba(242, 193, 78, 0.07), transparent 70%), #08061a; }
.slide { position: absolute; inset: 0; padding: 5vh 6vw 9vh; display: flex; flex-direction: column; justify-content: center; opacity: 0; pointer-events: none; transform: translateX(40px) scale(0.985); transition: opacity 0.5s ease, transform 0.5s ease; }
.slide.active { opacity: 1; pointer-events: auto; transform: none; }
.slide.past { transform: translateX(-40px) scale(0.985); }
.slide.cover, .slide.final { align-items: center; text-align: center; }
.slide.cover h1 { font-size: clamp(2.4rem, 7vw, 6rem); line-height: 1.05; margin: 0.2em 0; }
.slide.cover .sub { font-size: clamp(1rem, 2.2vw, 1.8rem); color: var(--muted); letter-spacing: 3px; text-transform: uppercase; }
.slide .emoji { font-size: clamp(3rem, 8vw, 6rem); filter: drop-shadow(0 10px 40px rgba(242, 193, 78, 0.5)); }
.ev-slide { display: grid; grid-template-columns: minmax(280px, 34%) 1fr; gap: 4vw; align-items: center; height: 100%; }
.ev-left { text-align: center; display: grid; gap: 1.4vh; justify-items: center; }
.ev-left .order { font-family: var(--font-head); font-size: clamp(1rem, 2vw, 1.6rem); color: var(--gold2); letter-spacing: 4px; text-transform: uppercase; }
.ev-left h2 { font-size: clamp(1.8rem, 4.2vw, 3.6rem); line-height: 1.12; margin: 0; }
.ring { position: relative; width: clamp(180px, 24vw, 340px); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: clamp(2.6rem, 6vw, 5.4rem); }
.ring-track { stroke: rgba(255, 255, 255, 0.1); }
.big-rating { font-size: clamp(1rem, 2vw, 1.7rem); padding: 6px 22px; }
.juri-cards { display: grid; gap: 2vh; max-height: 78vh; overflow: auto; padding-right: 6px; align-content: center; scrollbar-width: none; }
.juri-cards::-webkit-scrollbar { display: none; }
.jcard { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--card-b); border-radius: 22px; padding: 2.2vh 2vw; backdrop-filter: blur(8px); }
.jcard .jh { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 1vh; }
.jcard .jn { font-weight: 700; font-size: clamp(0.9rem, 1.6vw, 1.4rem); color: var(--gold2); }
.jcard .js { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.4rem, 3vw, 2.6rem); }
.jcard .jc { font-size: clamp(0.95rem, 1.9vw, 1.6rem); line-height: 1.55; white-space: pre-wrap; }
.jcard .jc.long { font-size: clamp(0.8rem, 1.45vw, 1.2rem); }
.jcard .jc.xlong { font-size: clamp(0.72rem, 1.15vw, 1rem); }
.jcard .jc.empty { color: var(--muted); font-style: italic; }
.slide h2.title { font-size: clamp(1.8rem, 4vw, 3.2rem); text-align: center; margin-bottom: 3vh; }
.slide .cat-bars { width: min(1000px, 100%); margin: 0 auto; }
.slide .bar-row { grid-template-columns: 26% 1fr 80px; font-size: clamp(0.9rem, 1.8vw, 1.5rem); margin: 1.6vh 0; }
.slide .bar-row .track { height: clamp(14px, 2.2vh, 26px); }
.aspects { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2vw; }
.aspects .a { text-align: center; padding: 3vh 1vw; }
.aspects .a .ic { font-size: clamp(2rem, 5vw, 4rem); }
.aspects .a .nm { font-family: var(--font-head); font-size: clamp(1.1rem, 2.2vw, 2rem); margin: 1vh 0 0.2vh; }
.aspects .a .sb { color: var(--muted); font-size: clamp(0.75rem, 1.2vw, 1.05rem); margin-bottom: 2vh; }
.aspects .a .v { font-family: var(--font-head); font-weight: 800; font-size: clamp(2rem, 5vw, 4.4rem); }
@media (max-width: 800px) { .aspects { grid-template-columns: repeat(2, 1fr); } .ev-slide { grid-template-columns: 1fr; overflow: auto; } }
.slide.final .final-num { font-family: var(--font-head); font-weight: 800; font-size: clamp(5rem, 18vw, 14rem); line-height: 1; }
.slide.final .split { display: flex; gap: 4vw; margin-top: 3vh; justify-content: center; flex-wrap: wrap; }
.slide.final .split div { text-align: center; }
.slide.final .split b { display: block; font-family: var(--font-head); font-size: clamp(1.6rem, 3.6vw, 3rem); }
.slide.final .split span { color: var(--muted); text-transform: uppercase; letter-spacing: 2px; font-size: clamp(0.7rem, 1.2vw, 1rem); }
.hud { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px 22px; display: flex; align-items: center; gap: 14px; z-index: 20; transition: opacity 0.4s; background: linear-gradient(0deg, rgba(5, 3, 15, 0.9), transparent); }
.hud.idle { opacity: 0; pointer-events: none; }
.hud .progress { flex: 1; }
.hud .count { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; min-width: 70px; text-align: center; }
.sparkle { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: 0; animation: spark 3s infinite; }
@keyframes spark { 0% { opacity: 0; transform: translateY(20px) scale(0.5); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-80px) scale(1.2); } }

/* =====================================================================
   RESPONSIF HP / TABLET  (hanya aktif di layar kecil — tampilan PC tidak berubah)
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; }

@media (max-width: 860px) {
  body { overflow-x: hidden; }
  .admin-shell { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 14px; }
  .admin-shell > section { min-width: 0; }
  .sidenav { margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none; gap: 8px; }
  .sidenav::-webkit-scrollbar { display: none; }
  .sidenav a { padding: 9px 14px; border-radius: 999px; font-size: 0.86rem; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--card-b); flex: none; }
  .sidenav a.active { border-color: rgba(139, 107, 255, 0.7); }
  /* kartu 2 kolom di admin tidak boleh dipaksa 3fr:2fr oleh inline style */
  .grid.cols-2 { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 720px) {
  .container { width: calc(100% - 24px); }
  .sidenav { margin: 0 -12px; padding: 2px 12px 8px; }
  h1, h2, h3 { overflow-wrap: anywhere; }

  /* ---- form: cegah zoom otomatis iOS ---- */
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 36px; padding: 7px 12px; }
  @media (hover: none) { .btn:hover { transform: none; } .pick:hover { transform: none; } }

  /* ---- topbar ---- */
  .topbar .inner { gap: 8px; padding: 9px 0; flex-wrap: nowrap; }
  .brand { font-size: 0.98rem; min-width: 0; gap: 9px; }
  .brand .logo { width: 34px; height: 34px; border-radius: 10px; font-size: 1.1rem; flex: none; }
  .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
  .userbox .name { display: none; }
  .topbar .btn.sm { padding: 7px 10px; white-space: nowrap; }
  .topbar .lbl { display: none; }

  /* ---- kartu & judul ---- */
  .card { padding: 15px; border-radius: 16px; }
  .page-head { gap: 8px; margin-bottom: 12px; }
  .page-head h2 { font-size: 1.35rem; }
  .section-title { margin: 26px 0 10px; }
  .section-title h2 { font-size: 1.3rem; }

  /* ---- login / pilih juri ---- */
  .curtain { width: 11vw; opacity: 0.4; }
  .login-wrap { padding: 16px 12px; align-items: start; padding-top: 7vh; }
  .login-card { padding: 26px 18px; }
  .login-card .logo-big { font-size: 2.6rem; }
  .login-card .sub { margin-bottom: 18px; }
  .pick { padding: 12px 14px; gap: 12px; border-radius: 14px; }
  .pick .av { width: 38px; height: 38px; border-radius: 11px; }
  .pick .nm { font-size: 0.94rem; }

  /* ---- halaman juri ---- */
  .hero { padding: 18px 0 4px; }
  .hero h1 { font-size: 1.5rem; }
  .legend { gap: 6px; }
  .legend .chip { font-size: 0.66rem; padding: 3px 9px; }
  .tabs-mini { margin: 14px 0 10px; }
  .tabs-mini .btn { flex: 1; justify-content: center; }
  .ev-card { grid-template-columns: 44px minmax(0, 1fr); gap: 8px 12px; padding: 14px; margin-bottom: 12px; }
  .ev-card > div:not(.ev-no) { display: contents; }
  .ev-card .ev-no { width: 44px; height: 44px; border-radius: 13px; font-size: 1.05rem; grid-column: 1; grid-row: 1; }
  .ev-card .ev-head { grid-column: 2; grid-row: 1; margin: 0; align-self: center; gap: 6px 8px; }
  .ev-card .ev-head h3 { font-size: 1.02rem; line-height: 1.3; }
  .ev-card > div:not(.ev-no) > :not(.ev-head) { grid-column: 1 / -1; }
  .score-row { grid-template-columns: 1fr auto; grid-template-areas: 'step rate' 'slider slider'; gap: 12px 10px; margin: 4px 0 2px; }
  .score-row .stepper { grid-area: step; max-width: 190px; }
  .score-row .slider { grid-area: slider; }
  .score-row .rating-slot { grid-area: rate; justify-self: end; }
  .stepper button { width: 44px; height: 44px; font-size: 1.3rem; }
  .stepper input { height: 44px; font-size: 1.35rem; }
  input[type='range'] { height: 8px; }
  input[type='range']::-webkit-slider-thumb { width: 28px; height: 28px; }
  input[type='range']::-moz-range-thumb { width: 26px; height: 26px; }
  textarea { min-height: 76px; }
  .aspect-card { padding: 14px; }
  .summary-box { gap: 8px; }
  .summary-box .cell { padding: 11px 6px; }
  .summary-box .val { font-size: 1.35rem; }
  .sticky-bar { padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .sticky-bar .bar { padding: 10px 12px; gap: 10px; }
  .sticky-bar .prog { flex: 1 1 100%; }
  .sticky-bar .btn { flex: 1; justify-content: center; }
  .banner { font-size: 0.88rem; padding: 12px 14px; }

  /* ---- admin ---- */
  .grid { gap: 12px; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px; }
  .stat .val { font-size: 1.8rem; }
  .bar-row { grid-template-columns: minmax(0, 36%) 1fr 44px; gap: 8px; font-size: 0.82rem; }
  .tbl { font-size: 0.82rem; }
  .tbl-stack, .tbl-stack tbody { display: block; }
  .tbl-stack tr:first-child { display: none; }
  .tbl-stack tr { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .tbl-stack td { display: block; padding: 0; border: none; }
  .tbl-stack tr:hover td { background: none; }
  .tbl-stack td:last-child { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
  .tbl th, .tbl td { padding: 9px 8px; }
  .toolbar { gap: 8px; }
  .toolbar input, .toolbar select { max-width: none; min-width: 0; flex: 1 1 100%; }
  details.ev > summary { padding: 12px 14px; gap: 8px 10px; }
  details.ev .no { width: 34px; height: 34px; }
  .jrow { padding: 14px; }
  .jrow .edit-actions .btn { flex: 1 1 auto; justify-content: center; }
  .jrow .edit-actions select { flex: 1 1 100%; width: 100%; }
  .drag-item { grid-template-columns: 34px minmax(0, 1fr); gap: 8px 10px; padding: 11px 12px; }
  .drag-item .handle { display: none; }
  .drag-item > :last-child { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
  .drag-item > :last-child .btn { flex: 1; justify-content: center; }
  .matrix { font-size: 0.8rem; }
  .matrix td.ev, .matrix th.ev { min-width: 170px; max-width: 190px; }
  .matrix th, .matrix td { padding: 7px 6px; }
  .matrix th.juri { height: 150px; }
  .range-row { grid-template-columns: 1fr 1fr 44px; }
  .range-row > :first-child { grid-column: 1 / -1; }
  .range-row input[type='color'] { width: 100%; }
  dialog { width: calc(100vw - 20px); max-height: 92dvh; overflow-y: auto; border-radius: 18px; }
  dialog .dlg { padding: 18px; }
  dialog .dlg-actions .btn { flex: 1; justify-content: center; }
  #toasts { left: 12px; right: 12px; top: 64px; bottom: auto; }

  /* ---- presentasi di HP ---- */
  .slide { padding: 4vh 5vw 14vh; justify-content: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .slide.cover, .slide.final { justify-content: center; }
  .ev-slide { grid-template-columns: minmax(0, 1fr); gap: 3vh; height: auto; overflow: visible; align-items: start; }
  .ev-left { gap: 1.2vh; }
  .ev-left h2 { font-size: 1.7rem; }
  .ring { width: min(56vw, 230px); }
  .ring .num { font-size: 2.8rem; }
  .juri-cards { max-height: none; overflow: visible; gap: 12px; padding-right: 0; }
  .jcard { padding: 14px 16px; border-radius: 18px; }
  .jcard .jn { font-size: 0.95rem; }
  .jcard .js { font-size: 1.6rem; }
  .jcard .jc, .jcard .jc.long, .jcard .jc.xlong { font-size: 0.95rem; }
  .slide h2.title { font-size: 1.5rem; margin-bottom: 2vh; }
  .slide .bar-row { grid-template-columns: 34% 1fr 56px; font-size: 0.9rem; }
  .aspects { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aspects .a { padding: 18px 8px; }
  .slide.cover h1 { font-size: 2.4rem; }
  .slide.final .final-num { font-size: 6rem; }
  .hud { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
  .hud .count { min-width: 52px; font-size: 0.85rem; }
  .hud .btn { padding: 8px 10px; }
  .launcher .card { padding: 26px 18px; }
}

@media (max-width: 380px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .brand span { max-width: 30vw; }
}

.ring svg { overflow: visible; }

