:root {
  --ink: #1F2937; --muted: #64748B; --line: #E2E8F0; --paper: #FFFFFF;
  --primary: #2563EB; --primary-dark: #1D4ED8; --gold: #FBBF24; --danger: #DC2626; --ok: #15803D;
  --radius: 16px; --gutter: 12px;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #7CC7E8; overscroll-behavior: none; }
body { -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: #7CC7E8; font-weight: 800; font-size: 18px; z-index: 20; padding: 24px; text-align: center; }

.panel { background: rgba(255,255,255,.94); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 0 4px 0 rgba(31,41,55,.18); }
.hud-top { position: fixed; top: calc(var(--gutter) + env(safe-area-inset-top)); left: var(--gutter); right: var(--gutter); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; }
.count-box { padding: 10px 16px 11px; min-width: 150px; }
.count-box.bump { animation: bump .6s ease; }
@keyframes bump { 30% { transform: scale(1.08); background: #FEF3C7; } }
.brand { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.count { margin: 0; font-size: 34px; line-height: 1.12; font-weight: 800; font-variant-numeric: tabular-nums; }
.count-sub { margin: 0; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.minimap { width: 132px; height: 101px; display: block; image-rendering: pixelated; overflow: hidden; }

.news { position: fixed; top: calc(var(--gutter) + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(520px, calc(100vw - 370px)); display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; font-weight: 600; pointer-events: none; }
.news-tag { flex: none; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
#news-text { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }

.district-name { position: fixed; top: 22%; left: 50%; transform: translateX(-50%); font-size: 24px; font-weight: 800; color: #fff; opacity: 0; pointer-events: none; white-space: nowrap; paint-order: stroke; -webkit-text-stroke: 5px var(--ink); }
.district-name.show { animation: district 2.6s ease; }
@keyframes district { 12%, 75% { opacity: 1; } 100% { opacity: 0; } }

.hud-bottom { position: fixed; left: var(--gutter); bottom: calc(var(--gutter) + env(safe-area-inset-bottom)); pointer-events: none; }
.status { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.stage-chip { background: var(--paper); border: 2px solid var(--ink); border-radius: 99px; padding: 7px 12px; font-size: 13px; font-weight: 800; }
.stage-chip[data-stage="citizen"] { background: var(--gold); }

.btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 800; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: 9px 14px; min-height: 40px; cursor: pointer; text-decoration: none; box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn:focus-visible, .option:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.big { width: 100%; min-height: 50px; font-size: 16px; }
.btn:disabled { opacity: .6; cursor: default; }

.online { margin: 3px 0 0; font-size: 11.5px; font-weight: 800; color: #166534; }
.online::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #22C55E; vertical-align: 1px; }
.sosial-nav { display: flex; gap: 6px; margin-bottom: 8px; pointer-events: auto; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; margin-left: 2px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

.chat { background: #fff; position: fixed; left: var(--gutter); bottom: calc(112px + env(safe-area-inset-bottom)); width: 340px; height: min(48dvh, 420px); display: flex; flex-direction: column; overflow: hidden; z-index: 4; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 8px 6px; border-bottom: 1.5px solid var(--line); }
.tabs { display: flex; gap: 4px; min-width: 0; }
.tab { font: inherit; font-size: 12.5px; font-weight: 800; color: var(--muted); background: none; border: 0; border-radius: 99px; padding: 6px 10px; cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; }
.icon-btn { flex: none; width: 34px; height: 34px; font-size: 21px; line-height: 1; background: none; border: 0; border-radius: 50%; cursor: pointer; color: var(--ink); }
.icon-btn:hover { background: #F1F5F9; }
.chat-list { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.chat-empty { margin: auto; text-align: center; font-size: 13px; color: var(--muted); padding: 12px; line-height: 1.45; }
.chat-line { font-size: 13.5px; line-height: 1.4; overflow-wrap: anywhere; }
.chat-name { font: inherit; font-weight: 800; color: var(--primary); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.chat-meta { font-size: 11px; color: var(--muted); margin-left: 4px; }
.mini-link { font: inherit; font-size: 11px; color: var(--muted); background: none; border: 0; padding: 0 0 0 5px; text-decoration: underline; cursor: pointer; }
.chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1.5px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; min-height: 40px; font: inherit; font-size: 16px; padding: 6px 10px; border: 2px solid var(--ink); border-radius: 10px; }
.chat-cta { margin: 8px; }
.chat > .error { margin: 0 10px 8px; }

.profile-actions:empty { display: none; }
.profile-actions { margin-top: 12px; }
.profile-row { display: flex; gap: 6px; }
.profile-row .btn { flex: 1; }
.btn.subtle { box-shadow: none; border-color: var(--line); font-weight: 700; color: #475569; }
.setting { margin-top: 14px; text-align: left; }
dialog.sheet.wide { width: min(680px, calc(100vw - 24px)); }
.list { display: grid; gap: 8px; margin: 12px 0 0; }
.list-item { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: pointer; }
.list-item:hover { border-color: var(--ink); }
.list-item strong { display: block; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.list-sub { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.section { margin-top: 18px; }
.lead.compact { margin-bottom: 10px; }
.hint.left { text-align: left; }
select.block { display: block; width: 100%; margin-top: 5px; min-height: 44px; font: inherit; font-size: 16px; font-weight: 600; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 11px; background: #fff; }
.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 22px 8px; line-height: 1.5; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.toolbar select { min-height: 42px; font: inherit; font-size: 15px; font-weight: 700; padding: 6px 9px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; max-width: 100%; }
.back { font: inherit; font-weight: 800; font-size: 13px; color: var(--primary); background: none; border: 0; padding: 4px 0; margin-bottom: 6px; cursor: pointer; }
.post { padding: 12px 0; border-top: 1.5px solid var(--line); overflow-wrap: anywhere; }
.post-body { margin: 5px 0 7px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; }
.post-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.like { font: inherit; font-size: 12.5px; font-weight: 800; color: var(--ink); background: #F1F5F9; border: 1.5px solid var(--line); border-radius: 99px; padding: 5px 10px; min-height: 32px; cursor: pointer; }
.like[aria-pressed="true"] { background: #FEF3C7; border-color: var(--ink); }
.field textarea, .compose textarea { display: block; width: 100%; margin-top: 5px; min-height: 104px; resize: vertical; font: inherit; font-size: 16px; line-height: 1.45; padding: 9px 11px; border: 2px solid var(--ink); border-radius: 11px; }
.compose { margin-top: 12px; }
.compose .btn { margin-top: 8px; width: 100%; }
.bubbles { display: flex; flex-direction: column; gap: 6px; max-height: 44dvh; overflow-y: auto; padding: 4px 0; margin: 8px 0; }
.bubble { max-width: 82%; padding: 8px 11px; border-radius: 13px; background: #F1F5F9; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; align-self: flex-start; }
.bubble.me { align-self: flex-end; background: var(--primary); color: #fff; }
.bubble .mini-link { display: inline; color: inherit; }
.chat-form.flat { padding: 8px 0 0; }
.notice { background: #F1F5F9; border-radius: 11px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; margin: 8px 0; }

.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.zoom { display: flex; flex-direction: column; overflow: hidden; pointer-events: auto; border-radius: 12px; }
.zoom button { width: 42px; height: 42px; font: inherit; font-size: 22px; font-weight: 800; background: none; border: 0; color: var(--ink); cursor: pointer; }
.zoom button + button { border-top: 1.5px solid var(--line); }
.zoom button:hover { background: #F1F5F9; }
.menu { position: fixed; left: var(--gutter); bottom: calc(112px + env(safe-area-inset-bottom)); width: 240px; max-height: 62dvh; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; background: #fff; z-index: 5; }
.menu button, .menu a { font: inherit; font-size: 14px; font-weight: 700; text-align: left; color: var(--ink); text-decoration: none; background: none; border: 0; border-radius: 9px; padding: 10px 11px; min-height: 42px; cursor: pointer; }
.menu button:hover, .menu button:focus-visible, .menu a:hover { background: #F1F5F9; outline: none; }
.social-chip { font-size: 12.5px; font-weight: 700; color: var(--primary); background: #EFF6FF; border-radius: 99px; padding: 6px 10px; text-decoration: none; overflow-wrap: anywhere; }
small.muted { display: block; margin-top: 4px; color: var(--muted); font-weight: 500; }
.field textarea { min-height: 96px; }
#profil-preview { width: 66px; height: 108px; flex: none; }
.log-line { font-size: 12.5px; color: #475569; margin: 4px 0; overflow-wrap: anywhere; }
.doc .stat-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.update { position: fixed; inset: calc(10px + env(safe-area-inset-top)) auto auto 50%; margin: 0; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: var(--ink); color: #fff; border: 0; border-radius: 14px; font-size: 14px; font-weight: 700; box-shadow: 0 6px 20px rgba(15,23,42,.3); z-index: 8; }
.update:not([hidden]) { display: flex; }
#update-muat { font: inherit; font-weight: 800; color: var(--ink); background: var(--gold); border: 0; border-radius: 9px; padding: 8px 12px; min-height: 40px; cursor: pointer; white-space: nowrap; }
#update-tutup { font: inherit; font-size: 20px; line-height: 1; color: #fff; background: none; border: 0; width: 34px; height: 34px; cursor: pointer; flex: none; }
.badge.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; align-self: flex-start; }
.btn .badge { flex: none; }
.lonceng { position: relative; width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer; pointer-events: auto; color: var(--ink); padding: 0; border-radius: 12px; }
.lonceng .badge { position: absolute; top: -7px; right: -7px; }
.list-item.belum { background: #EFF6FF; border-color: #93C5FD; }
.chat-line.disebut { background: #FEF3C7; border-radius: 8px; padding: 4px 6px; margin: -2px -4px; }
.saran { display: flex; flex-direction: column; border-top: 1.5px solid var(--line); background: #fff; max-height: 150px; overflow-y: auto; }
.saran button { font: inherit; font-size: 13.5px; font-weight: 700; text-align: left; background: none; border: 0; padding: 9px 12px; min-height: 40px; color: var(--ink); cursor: pointer; }
.saran button:hover, .saran button:focus-visible { background: #F1F5F9; }
.saran small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.tab-panel { position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; margin: 0 -4px 8px; padding: 8px 4px; background: #F8FAFC; overflow-x: auto; }
.tab-panel button { font: inherit; font-size: 14px; font-weight: 800; color: var(--muted); background: none; border: 2px solid transparent; border-radius: 10px; padding: 8px 13px; min-height: 42px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.tab-panel button[aria-selected="true"] { color: #fff; background: var(--ink); }
#atribut-preview { width: 132px; height: 156px; flex: none; }
.swatch-dot.kosong { background: repeating-linear-gradient(45deg, #fff 0 4px, #CBD5E1 4px 8px); box-shadow: none; border-color: var(--line); }
.stat-grid.spaced, .btn.spaced { margin-top: 12px; }
.pilih { display: block; margin-top: 5px; }
.toolbar .pilih { margin-top: 0; flex: 0 1 auto; min-width: 0; }
.pilih-asli { display: none !important; }
.pilih-tombol { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; font: inherit; font-size: 16px; font-weight: 600; text-align: left; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 11px; padding: 8px 12px; cursor: pointer; }
.pilih-tombol:hover { background: #F8FAFC; }
.pilih-tombol:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.pilih-tombol::after { content: ""; flex: none; width: 9px; height: 9px; margin: -4px 3px 0 0; border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(45deg); transition: transform .12s; }
.pilih-tombol[aria-expanded="true"]::after { margin-top: 4px; transform: rotate(225deg); }
.pilih-teks { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pilih-daftar { position: fixed; z-index: 20; display: flex; flex-direction: column; gap: 2px; width: max-content; overflow-y: auto; overscroll-behavior: contain; padding: 6px; background: #fff; border: 2px solid var(--ink); border-radius: 13px; box-shadow: 0 4px 0 var(--ink); }
.pilih-opsi { font: inherit; font-size: 14.5px; font-weight: 600; text-align: left; color: var(--ink); background: none; border: 0; border-radius: 9px; padding: 9px 11px; min-height: 42px; cursor: pointer; flex: none; }
.pilih-opsi:hover, .pilih-opsi:focus { background: #F1F5F9; outline: none; }
.pilih-opsi[aria-selected="true"] { background: var(--gold); font-weight: 800; }
.pilih-kepala { margin: 8px 11px 2px; font-size: 11.5px; font-weight: 800; color: var(--primary); flex: none; }
.pilih-kepala:first-child { margin-top: 3px; }
.menu-head { margin: 8px 11px 2px; font-size: 11px; font-weight: 800; color: var(--muted); }
.menu-head:first-child { margin-top: 4px; }
.bar { height: 10px; background: #E2E8F0; border-radius: 99px; overflow: hidden; margin: 6px 0; }
.bar span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.checklist { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; }
.checklist li { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; padding: 10px 12px; border: 2px solid var(--line); border-radius: 11px; }
.checklist li b { margin-left: auto; color: var(--primary); }
.checklist li.done { background: #F0FDF4; border-color: #86EFAC; }
.checklist li.done span { color: var(--ok); font-weight: 800; }
.vote { margin-top: 8px; font-size: 13.5px; }
.vote-row { display: flex; justify-content: space-between; gap: 10px; }
.code { font-size: 13px; background: #F1F5F9; border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat-grid div { background: #F1F5F9; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; }
.stat-grid b { font-size: 24px; }
.stat-grid span { font-size: 12.5px; color: var(--muted); }
.room { display: block; width: 100%; height: auto; border-radius: 12px; border: 2px solid var(--ink); margin-bottom: 8px; }
.post-actions.spaced { margin: 12px 0; }
.check + .check { margin-top: 10px; }
.profil-publik { text-align: center; max-width: 460px; }
.publik-avatar { width: 150px; height: auto; }
.chips.center { justify-content: center; margin: 14px 0; }
.profil-publik > .btn { margin-top: 22px; }
.joystick { display: none; position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 124px; height: 124px; border-radius: 50%; background: rgba(255,255,255,.42); border: 2px solid rgba(31,41,55,.6); touch-action: none; place-items: center; }
#joystick-knob { width: 52px; height: 52px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); box-shadow: 0 3px 0 rgba(31,41,55,.3); }
@media (pointer: coarse) { .joystick { display: grid; } .action kbd { display: none; } }

.action { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%); font: inherit; font-weight: 800; font-size: 15px; background: var(--gold); color: var(--ink); border: 2px solid var(--ink); border-radius: 99px; padding: 12px 18px; min-height: 48px; display: flex; gap: 8px; align-items: center; cursor: pointer; box-shadow: 0 4px 0 var(--ink); white-space: nowrap; }
.action kbd { font: inherit; font-size: 11px; border: 1.5px solid var(--ink); border-radius: 5px; padding: 0 5px; background: #fff; }
@media (pointer: coarse) { .action { left: auto; right: 22px; transform: none; bottom: calc(154px + env(safe-area-inset-bottom)); } }

.toast { pointer-events: none; position: fixed; inset: 96px auto auto 50%; margin: 0; border: 0; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; padding: 10px 16px; border-radius: 12px; max-width: calc(100vw - 32px); width: max-content; text-align: center; z-index: 5; }

dialog.sheet { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 2.5px solid var(--ink); border-radius: 22px; padding: 20px; color: var(--ink); background: var(--paper); box-shadow: 0 7px 0 var(--ink); overflow-y: auto; overscroll-behavior: contain; }
dialog.sheet.small { width: min(320px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(15,23,42,.38); backdrop-filter: blur(2px); }
dialog.gate::backdrop { background: rgba(15,23,42,.28); backdrop-filter: blur(1.5px); }
.eyebrow { margin: 0 0 4px; color: var(--primary); font-size: 12px; font-weight: 800; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; font-weight: 800; }
h1 { font-size: 26px; } h2 { font-size: 21px; } h3 { font-size: 16px; }
.lead { margin: 0 0 16px; line-height: 1.5; font-size: 15px; color: #334155; }
.hint { margin: 0; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.4; }
.fine { margin: 14px 0 0; text-align: center; font-size: 12.5px; }
.fine a { color: var(--muted); }
.stack { display: grid; gap: 10px; }
.steps { margin: 0 0 4px; padding-left: 20px; line-height: 1.7; font-size: 14.5px; }
.error { color: var(--danger); font-size: 13.5px; font-weight: 700; margin: 8px 0 0; min-height: 0; }
.error:empty { display: none; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 auto; }

.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; margin-bottom: 6px; }
#avatar-preview { width: 66px; height: 108px; flex: none; }
.field { display: block; border: 0; padding: 0; margin: 0 0 12px; font-size: 13.5px; font-weight: 700; }
.field legend { padding: 0; margin-bottom: 6px; }
.field input:not([type=radio]), .field select, .field textarea { display: block; width: 100%; margin-top: 5px; min-height: 44px; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); padding: 8px 11px; border: 2px solid var(--ink); border-radius: 11px; background: #fff; }
.field input:read-only { background: #F1F5F9; }
.field small { display: block; margin-top: 4px; color: var(--ok); }
.chips, .swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.chip input, .swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: block; font-size: 13px; font-weight: 700; padding: 7px 11px; border: 2px solid var(--line); border-radius: 99px; cursor: pointer; }
.chip input:checked + span { border-color: var(--ink); background: var(--gold); }
.chip input:focus-visible + span, .swatch input:focus-visible + .swatch-dot { outline: 3px solid var(--primary); outline-offset: 2px; }
.swatch-dot { display: block; width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 2px #fff; }
.swatch input:checked + .swatch-dot { border-color: var(--ink); }
.check { display: flex; gap: 9px; font-size: 13px; line-height: 1.45; font-weight: 600; align-items: flex-start; color: #334155; }
.check input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--primary); }

.card-sheet { text-align: center; }
.card-preview { display: block; height: min(46dvh, 420px); width: auto; margin: 0 auto; border-radius: 12px; border: 2px solid var(--ink); }
.link-danger { font: inherit; color: var(--danger); background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 6px; }

.facts { margin: 0 0 16px; padding-left: 20px; line-height: 1.55; font-size: 14.5px; display: grid; gap: 7px; }
.quiz { background: #F1F5F9; border-radius: 14px; padding: 14px; font-size: 14.5px; }
.quiz p { margin: 0 0 10px; }
.quiz .btn { width: 100%; margin-top: 2px; }
.options { display: grid; gap: 7px; }
.option { font: inherit; font-weight: 700; text-align: left; padding: 10px 12px; min-height: 44px; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; cursor: pointer; }
.option:disabled { cursor: default; opacity: .72; }
.option.right { background: #DCFCE7; border-color: var(--ok); opacity: 1; }
.option.wrong { background: #FEE2E2; border-color: var(--danger); }
.quiz-result { font-weight: 700; margin: 10px 0 0 !important; min-height: 1.2em; }

.doc { height: auto; overflow: auto; background: #F8FAFC; }
.doc main { max-width: 680px; margin: 0 auto; padding: 32px 16px 56px; line-height: 1.65; }
.doc h1 { font-size: 30px; } .doc h2 { margin-top: 26px; font-size: 19px; }
html:has(body.doc) { overflow: auto; height: auto; min-height: 100%; background: #F8FAFC; }

@media (max-width: 760px) {
  .news { top: auto; bottom: calc(116px + env(safe-area-inset-bottom)); left: var(--gutter); transform: none; width: calc(100vw - 170px); font-size: 12px; padding: 6px 9px; }
  .news-tag { display: none; }
  .count-box { min-width: 128px; max-width: 150px; padding: 8px 12px 9px; }
  .count { font-size: 28px; }
  .minimap { width: 104px; height: 80px; }
  .district-name { font-size: 20px; }
}
@media (max-width: 760px) {
  .chat { left: 0; right: 0; bottom: 0; width: 100%; height: 58dvh; border-radius: 18px 18px 0 0; border-width: 2px 0 0; z-index: 6; padding-bottom: env(safe-area-inset-bottom); }
  .sosial-nav { gap: 4px; }
  .sosial-nav .btn { padding: 7px 8px; min-height: 38px; font-size: 12.5px; }
  .zoom button { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .count-box.bump, .district-name.show { animation-duration: .01s; }
}

/* Lemari Gaya */
.lemari-atas { display: flex; gap: 12px; align-items: center; background: #F1F5F9; border-radius: 14px; padding: 8px 12px; margin-bottom: 8px; }
.lemari-kanvas { width: 132px; height: 147px; flex: none; }
.lemari-info { min-width: 0; flex: 1; }
.lemari-level { font-size: 20px; }
.lemari-info .hint { margin: 2px 0; }
.lemari-pesan { background: #FEF3C7; border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; font-size: 13.5px; font-weight: 700; }
.lemari-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-bottom: 14px; }
.lemari-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 4px 4px 7px; cursor: pointer; min-width: 0; color: var(--ink); }
.lemari-item canvas { width: 66px; height: 78px; }
.lemari-item.aktif { border-color: var(--primary); background: #EFF6FF; }
.lemari-item.kunci canvas { opacity: .45; filter: grayscale(.6); }
.lemari-item.kunci .lemari-nama { color: var(--muted); }
.lemari-nama { font-size: 12px; font-weight: 700; line-height: 1.2; text-align: center; }
.lemari-gembok { position: absolute; top: 4px; right: 4px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 1px 6px; }
.lemari-item:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

#masuk-pin { letter-spacing: .3em; font-size: 22px; font-weight: 800; text-align: center; }
#form-masuk .field { margin-top: 12px; }
#gate-masuk { width: 100%; margin-top: 10px; }
#daftar-ke-masuk { width: 100%; margin-bottom: 10px; }
.pin-hasil { background: #F1F5F9; border-radius: 12px; padding: 12px; margin-top: 10px; }
.pin-angka { font-size: 34px; font-weight: 800; letter-spacing: .2em; display: block; }
.pin-pesan { width: 100%; min-height: 96px; margin: 8px 0; font: inherit; font-size: 14px; }

/* Gaya komik Profesi Netizen: garis tinta, warna rata, bayangan tegas, tombol seperti stiker */
html, body, #loading { background: #7AD3D6; }
#world { transition: opacity .11s linear; }
.panel { background: #FFF8E7; border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 3px 4px 0 var(--ink); }
.count-box { padding: 0; min-width: 132px; overflow: hidden; text-align: center; }
.count-box .brand { background: #B91C1C; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 5px 10px; border-bottom: 2.5px solid var(--ink); }
.count-box .count { font-size: 30px; line-height: 1.1; padding-top: 4px; }
.count-box .count-sub { padding: 0 8px; }
.count-box .online { padding-bottom: 6px; }
.jam { padding: 6px 12px; text-align: center; line-height: 1.1; transform: rotate(1.2deg); }
.jam strong { display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.jam span { font-size: 11px; color: var(--muted); font-weight: 700; }
.zoom button + button { border-top: 2px solid var(--ink); }
.zoom button:hover { background: #FDE68A; }
.zoom button { font-size: 21px; }
.news { background: #FFF8E7; }
#stage-chip[data-stage="citizen"] { display: none; }
.hud-bottom { left: var(--gutter); right: var(--gutter); bottom: calc(12px + env(safe-area-inset-bottom)); }
.status { margin-bottom: 10px; align-items: flex-end; }
.sosial-nav { display: flex; align-items: flex-end; gap: 8px; margin: 0; pointer-events: none; }
.stiker { position: relative; pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 66px; height: 60px; font: inherit; font-size: 12px; font-weight: 800; color: var(--ink); border: 2.5px solid var(--ink); border-radius: 13px; box-shadow: 3px 4px 0 var(--ink); cursor: pointer; transition: transform .08s, box-shadow .08s; }
.stiker:nth-child(odd) { transform: rotate(-1.6deg); }
.stiker:nth-child(even) { transform: rotate(1.4deg); }
.stiker:hover { transform: translateY(-2px) rotate(0); }
.stiker:active { transform: translate(3px, 4px); box-shadow: 0 0 0 var(--ink); }
.stiker:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.stiker.kuning { background: #FDE047; }
.stiker.biru { background: #93C5FD; }
.stiker.hijau { background: #A7E08B; }
.stiker.pink { background: #F9A8D4; }
.stiker.tinta { background: var(--ink); color: #fff; }
.stiker .badge { position: absolute; top: -8px; right: -8px; margin: 0; border: 2px solid var(--ink); line-height: 15px; }
.kartu-hud { pointer-events: auto; display: flex; align-items: center; gap: 8px; font: inherit; color: var(--ink); text-align: left; background: #FFF8E7; border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 3px 4px 0 var(--ink); padding: 4px 12px 4px 4px; cursor: pointer; max-width: 230px; }
.kartu-hud canvas { width: 46px; height: 46px; flex: none; background: #BFE3F5; border: 2px solid var(--ink); border-radius: 10px; }
.kartu-isi { display: block; min-width: 0; }
.kartu-isi strong { display: block; font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kartu-isi small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kartu-bar { display: block; height: 7px; margin-top: 3px; background: #fff; border: 1.5px solid var(--ink); border-radius: 99px; overflow: hidden; width: 130px; }
.kartu-bar span { display: block; height: 100%; background: #FBBF24; }
.cari-hasil { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.cari-baris { display: flex; align-items: center; gap: 10px; width: 100%; font: inherit; color: var(--ink); text-align: left; background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 9px 12px; cursor: pointer; }
.cari-baris:hover { background: #FEF3C7; }
.cari-baris small { display: block; color: var(--muted); }
.cari-titik { flex: none; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--ink); }
.menu { bottom: calc(86px + env(safe-area-inset-bottom)); background: #FFF8E7; }
.chat { bottom: calc(86px + env(safe-area-inset-bottom)); }
.joystick { bottom: calc(150px + env(safe-area-inset-bottom)); }
@media (pointer: coarse) { .action { bottom: calc(286px + env(safe-area-inset-bottom)); } }
@media (pointer: fine) { .action { bottom: calc(92px + env(safe-area-inset-bottom)); } }
@media (max-width: 760px) {
  .news { display: none; }
  .sosial-nav { justify-content: space-between; gap: 6px; }
  .stiker { flex: 1; width: auto; min-width: 0; }
}

/* HP: peta dapat ruang terbesar, dan semua tombol berukuran serta berjarak sama. */
.zoom button { display: grid; place-items: center; padding: 0; }
@media (max-width: 760px) {
  :root { --tepi: 12px; --tinggi-atas: 44px; --jeda: 7px; }
  .hud-top { left: var(--tepi); right: var(--tepi); align-items: stretch; gap: var(--jeda); }
  .panel, .stiker, .kartu-hud canvas, .jam, .count-box, .lonceng.panel, .zoom.panel { box-shadow: 2px 2px 0 var(--ink); }
  .count-box { display: flex; flex-direction: column; justify-content: center; flex: 1 1 auto; min-width: 0; height: var(--tinggi-atas); text-align: center; border-radius: 12px; }
  .count-box .brand { font-size: 9.5px; padding: 2px 6px; border-bottom-width: 2px; white-space: nowrap; }
  .count-box > .count, .count-box > .count-sub { display: inline; padding: 0; font-size: 12px; font-weight: 800; line-height: 1; }
  .count-box { display: block; }
  .count-box .count { margin: 0; }
  .count-box .count::after { content: " "; }
  .count-box .count-sub { margin: 0; color: var(--muted); font-weight: 700; }
  .count-box .online { display: none; }
  /* Selebar isinya ("PROFESI NETIZEN" / "0 warga terdaftar") dengan jarak tepi, tidak pernah terpotong. */
  .count-box { flex: 0 1 auto; width: max-content; min-width: 0; max-width: 100%; padding: 0; white-space: nowrap; }
  .count-box .brand { padding: 2px 12px; }
  .count-box > .count { padding-left: 12px; }
  .count-box > .count-sub { padding-right: 12px; }
  .count-box { overflow: hidden; text-overflow: ellipsis; }
  .hud-right { flex: none; flex-direction: row; align-items: stretch; gap: var(--jeda); }
  .jam { display: grid; place-items: center; width: 62px; height: var(--tinggi-atas); padding: 0; transform: none; border-radius: 12px; }
  .jam strong { font-size: 14px; }
  .jam span { display: none; }
  .lonceng, .lonceng.panel, .zoom.panel { width: var(--tinggi-atas); height: var(--tinggi-atas); border-radius: 12px; }
  .zoom button { width: 100%; height: 100%; }
  #putar-kiri, #zoom-in, #zoom-out { display: none; }
  #putar-kanan { border-top: 0; }
  .hud-bottom { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--jeda); left: var(--tepi); right: var(--tepi); bottom: calc(10px + env(safe-area-inset-bottom)); }
  .sosial-nav { display: contents; }
  .status { grid-column: 1; grid-row: 1; margin: 0; display: block; }
  .stiker, .stiker:nth-child(odd), .stiker:nth-child(even) { width: 100%; height: 52px; padding: 0; font-size: 10.5px; border-width: 2px; border-radius: 12px; transform: none; }
  .stiker svg { width: 18px; height: 18px; }
  .stiker:hover { transform: none; }
  .stiker:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
  .stiker .badge { top: -7px; right: -5px; }
  .kartu-hud { display: block; width: 100%; height: 52px; padding: 0; border: 0; background: none; box-shadow: none; max-width: none; }
  .kartu-hud canvas { display: block; width: 100%; height: 52px; object-fit: cover; border-width: 2px; border-radius: 12px; }
  .kartu-isi { display: none; }
  /* Tamu belum punya kartu dan pesan: baris daftar di atas, empat tombol sama lebar di bawah. */
  .hud-bottom:has(#btn-daftar:not([hidden])) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hud-bottom:has(#btn-daftar:not([hidden])) .status { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: var(--jeda); }
  .hud-bottom:has(#btn-daftar:not([hidden])) .status > * { display: grid; place-items: center; height: 44px; margin: 0; padding: 0 6px; border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); }
  .hud-bottom:has(#btn-daftar:not([hidden])) #btn-kartu { display: none; }
  .joystick { width: 100px; height: 100px; right: var(--tepi); bottom: calc(76px + env(safe-area-inset-bottom)); }
  #joystick-knob { width: 42px; height: 42px; }
  .menu, .chat { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) and (pointer: coarse) {
  .action { right: var(--tepi); bottom: calc(186px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) {
  body:has(#btn-daftar:not([hidden])) .joystick { bottom: calc(128px + env(safe-area-inset-bottom)); }
  body:has(#btn-daftar:not([hidden])) .action { bottom: calc(238px + env(safe-area-inset-bottom)); }
}
/* Tombol aksi selalu di tengah bawah, tepat di atas deretan tombol. */
.action, body:has(#btn-daftar:not([hidden])) .action { left: 50%; right: auto; transform: translateX(-50%); white-space: nowrap; }
@media (max-width: 760px) {
  .action { bottom: calc(76px + env(safe-area-inset-bottom)); }
  body:has(#btn-daftar:not([hidden])) .action { bottom: calc(128px + env(safe-area-inset-bottom)); }
  .joystick { bottom: calc(136px + env(safe-area-inset-bottom)); }
  body:has(#btn-daftar:not([hidden])) .joystick { bottom: calc(188px + env(safe-area-inset-bottom)); }
}

/* Dompet, toko, dan minigame */
.dompet-saldo { background: #FEF3C7; border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 3px 4px 0 var(--ink); padding: 12px 16px; margin: 6px 0 12px; text-align: center; }
.dompet-saldo small { display: block; font-weight: 700; color: var(--muted); }
.dompet-saldo strong { font-size: 28px; font-weight: 800; }
.riwayat { list-style: none; margin: 0; padding: 0; }
.riwayat li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 2px; border-bottom: 1.5px solid var(--line); font-size: 14px; }
.riwayat .naik { color: var(--ok); }
.riwayat .turun { color: var(--danger); }
.baris-toko { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.game-wadah { text-align: center; }
.game-info { font-weight: 700; margin: 4px 0 8px; }
.game-kanvas { width: 100%; max-width: 340px; height: auto; border: 2.5px solid var(--ink); border-radius: 14px; touch-action: none; display: block; margin: 0 auto 10px; }
.game-kartu { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; max-width: 340px; margin: 0 auto; }
.kartu-ingat { aspect-ratio: 1; font-size: 26px; font-weight: 800; color: var(--ink); background: #93C5FD; border: 2.5px solid var(--ink); border-radius: 11px; box-shadow: 2px 3px 0 var(--ink); cursor: pointer; }
.kartu-ingat.buka { background: #FFF8E7; }
.foto-hasil { width: 100%; border-radius: 12px; border: 2.5px solid var(--ink); margin-bottom: 10px; }

.syarat { list-style: none; margin: 6px 0 10px; padding: 0; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.syarat li { padding: 2px 0; }
.syarat li.ok { color: var(--ok); }
.post > .btn { margin-top: 8px; }

/* Form seragam di semua dialog, termasuk yang tidak memakai .field */
dialog input:not([type=radio], [type=checkbox], [type=color], [type=file]), dialog textarea { width: 100%; min-height: 44px; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); background: #fff; padding: 8px 11px; border: 2px solid var(--ink); border-radius: 11px; }
dialog input::placeholder, dialog textarea::placeholder { color: #94A3B8; font-weight: 500; }
dialog input:focus-visible, dialog textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
dialog input[type=radio], dialog input[type=checkbox] { accent-color: var(--ink); flex: none; width: 20px; height: 20px; }
input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.kotak-cari { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 48px; margin: 4px 0 10px; padding: 0 13px; background: #FEF3C7; border: 2.5px solid var(--ink); border-radius: 13px; box-shadow: 3px 3px 0 var(--ink); cursor: text; }
.kotak-cari svg { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
dialog .kotak-cari input { flex: 1; min-width: 0; min-height: 42px; padding: 0; background: none; border: 0; border-radius: 0; font-weight: 700; }
dialog .kotak-cari input:focus-visible { outline: none; }
.kotak-cari:focus-within { background: #FDE68A; }
/* Satu gaya untuk kartu, daftar, dan catatan */
.list-item, .cari-baris, .checklist li { border: 2px solid var(--ink); }
.list-item:hover { background: #FEF3C7; }
.notice { background: #FEF3C7; border: 2px solid var(--ink); }
.tab-panel { background: transparent; border: 0; outline: none; }
#info-isi > .btn + *, #info-isi > .btn.big { margin-top: 10px; }
#info-isi .hint.left + .btn, #info-isi .hint.left + a.btn { margin-top: 10px; }
#info-isi > .hint.left { margin-bottom: 6px; }
.tombol-turun { position: fixed; left: var(--gutter); bottom: calc(150px + env(safe-area-inset-bottom)); width: 72px; height: 42px; z-index: 3; }
@media (min-width: 761px) { .tombol-turun { bottom: calc(170px + env(safe-area-inset-bottom)); } }
@media (max-width: 760px) { .tombol-turun, .tombol-turun:nth-child(n) { left: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); } }
.toolbar .kotak-cari { margin: 0; flex: 1 1 100%; }
.kotak-cari input::placeholder { color: #57606F; }
@media (max-width: 760px) {
  .stiker.tombol-turun, .stiker.tombol-turun:nth-child(n) { width: 76px; height: 44px; font-size: 13px; left: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* Tombol musik */
#nav-musik { position: relative; }
#nav-musik.mati { color: var(--muted); }
#nav-musik .musik-garis { display: none; position: absolute; width: 28px; height: 3px; background: var(--danger); transform: rotate(-45deg); border-radius: 2px; }
#nav-musik.mati .musik-garis { display: block; }
.list-item.terpilih { background: #FDE047; font-weight: 800; }
dialog input[type=range] { padding: 0; border: 0; min-height: 32px; accent-color: var(--ink); background: transparent; }
@media (max-width: 760px) {
  .count-box { flex: 0 1 auto; min-width: 0; }
  .count-box .brand, .count-box > .count-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .jam { width: 54px; }
  .hud-top { justify-content: space-between; }
  #nav-musik, #nav-lonceng { flex: none; }
}
@media (max-width: 380px) { .jam { display: none; } }

.soal { margin: 12px 0 6px; font-weight: 700; }
.game-urutan { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.game-urutan .btn.big { min-height: 48px; }
.goyang { animation: goyang .28s; background: #FECACA !important; }
@keyframes goyang { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (max-width: 430px) { .jam { display: none; } }

/* Halaman panduan warga baru */
body.doc.panduan { background: #FFF8E7; }
.panduan main { max-width: 620px; margin: 0 auto; padding: 28px 18px 60px; line-height: 1.6; }
.panduan h1 { font-size: 30px; margin: 0 0 6px; }
.panduan h2 { font-size: 19px; margin: 0 0 6px; display: flex; align-items: center; gap: 9px; }
.langkah { background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 3px 4px 0 var(--ink); padding: 14px 16px; margin: 14px 0; }
.langkah p { margin: 0; }
.nomor { flex: none; display: grid; place-items: center; width: 28px; height: 28px; background: #FDE047; border: 2px solid var(--ink); border-radius: 8px; font-weight: 800; font-size: 14px; }
.panduan .aksi { display: flex; text-decoration: none; margin: 22px 0 18px; }
.panduan .kecil { font-size: 13.5px; color: var(--muted); }
.stage-chip { white-space: nowrap; width: max-content; }

/* Halaman dokumen harus bisa digulir, berbeda dari halaman peta yang terkunci */
/* Memakai kelas, bukan :has, supaya tetap jalan di browser HP lama dan browser bawaan Instagram. */
html.html-doc, html.html-doc body { position: static; height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: auto; touch-action: pan-y pinch-zoom; -webkit-overflow-scrolling: touch; }
html.html-doc { background: #FFF8E7; }

/* Pengunjung yang sedang melihat-lihat kota */
.gate-lihat { display: block; width: 100%; margin-top: 10px; padding: 8px; font: inherit; font-size: 14.5px; font-weight: 800; color: var(--primary); background: none; border: 0; cursor: pointer; }
.gate-lihat:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
#stage-chip[data-stage="visitor"] { display: none; }
.hint-lihat { pointer-events: none; background: #FFF8E7; border: 2px solid var(--ink); border-radius: 99px; padding: 7px 12px; font-size: 12.5px; font-weight: 700; }
.status:has(#btn-masuk-kota:not([hidden])) { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#btn-masuk-kota { pointer-events: auto; }
@media (max-width: 760px) {
  .hud-bottom:has(#btn-masuk-kota:not([hidden])) { display: block; }
  .joystick { }
  body:has(#btn-masuk-kota:not([hidden])) .joystick { bottom: calc(68px + env(safe-area-inset-bottom)); }
  .hint-lihat { font-size: 11.5px; padding: 6px 10px; white-space: nowrap; }
}

/* HP sempit: jumlah warga saja, tanpa jumlah pendatang. */
@media (max-width: 380px) {
  .count-pendatang { display: none; }
}
