/* =====================================================================================
   Desa Piksel — sistem UI (dimuat terakhir, menimpa aturan lama bila perlu)
   Token warna · status fokus/disabled · HUD baru · chip · bar XP · toast · Jurnal · emote ·
   layar pemuatan · tata letak mobile. Gaya tetap "panel kayu pixel" tapi lebih ringan & konsisten.
   ===================================================================================== */
:root {
  --gold: #ffd34d; --gold-lo: #e0a92a; --gold-ink: #6e4524;
  --ok: #2f8275; --ok-lo: #22635a; --ok-bg: #dff5ef;
  --err: #c4553f; --err-lo: #8e3a2c; --err-bg: #fde3dc;
  --info-bg: #fff8e8;
  --xp: #5fa8ff; --xp-lo: #2f6fc4;
  --focus: #ffd34d;
  --r: 10px; /* radius lembut untuk elemen kecil (panel besar tetap bersudut) */
  --hud-h: 56px;
  --ctl-h: 0px; /* tinggi area kontrol sentuh di bawah */
  --toast-bottom: 92px;
  --shadow: 0 4px 0 rgba(20, 12, 6, 0.45);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
body.text-lg { font-size: 19px; }
body.text-lg .loc-card strong { font-size: 21px; }
body.text-lg .dialog p { font-size: 20px; }

/* ---------- Status interaksi yang konsisten ---------- */
:where(button, [role='button'], a, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px rgba(42, 28, 20, 0.6);
}
:where(button):focus:not(:focus-visible) { outline: none; }
button:disabled, .btn:disabled, .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; filter: saturate(0.6); }
.btn { transition: transform 0.08s var(--ease), filter 0.12s, background 0.12s; min-height: 40px; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 15px; }
.btn.primary:active { transform: translateY(2px); }
.btn.on { background: var(--accent); color: #fff; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }

/* ---------- HUD atas ---------- */
.hud-top { gap: 8px; align-items: flex-start; }
.hud-left { gap: 8px; align-items: stretch; flex-wrap: nowrap; }
.loc-card { min-height: 52px; }
.loc-card strong { font-size: 18px; }
.hud-actions { gap: 6px; align-items: stretch; }
.hud-actions .btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.hud-actions .btn.icon { width: 44px; padding: 0; font-size: 20px; }
.hud-actions .btn .dot { position: absolute; right: 4px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--err); border: 2px solid var(--ink); }
.hud-actions .btn { position: relative; }
#btn-chat { display: none; }
body.touch #btn-chat { display: inline-flex; }
body.touch .chatfeed .cf-toggle { display: none; }

/* Chip pemain: potret + nama + level + bar XP */
.me-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 8px; max-width: 280px; min-height: 52px; cursor: pointer;
  font: inherit; color: var(--text); text-align: left;
}
.me-chip:hover { background: var(--info-bg); }
.me-ava {
  width: 36px; height: 40px; flex-shrink: 0; display: grid; place-items: center; background: #e9f3ec; border: 2px solid var(--ink); border-radius: 6px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12); overflow: hidden;
}
.me-ava img, .ava { image-rendering: pixelated; image-rendering: crisp-edges; }
.me-ava img { width: auto; height: 36px; }
.me-txt { display: grid; gap: 2px; min-width: 0; line-height: 1.15; }
.me-txt b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.lvl { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--gold); color: var(--gold-ink); border: 2px solid var(--ink); font: 800 11px/16px var(--font); }
.xpbar { display: block; position: relative; width: 100%; height: 6px; background: #d9c9a6; border: 1px solid var(--ink); border-radius: 4px; overflow: hidden; }
.xpbar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--xp-lo), var(--xp)); transition: width 0.6s var(--ease); }
.xpbar.big { height: 12px; border-width: 2px; border-radius: 6px; }
.xpbar.flash > i { animation: xp-flash 0.6s; }
@keyframes xp-flash { 50% { filter: brightness(1.6); } }
body.hud-compact .me-txt small, body.hud-compact .xpbar { display: none; }
.owner-badge { margin-left: 2px; }

.hud-chip { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; min-height: 52px; font: 700 15px var(--font); color: var(--text); cursor: pointer; white-space: nowrap; }
.hud-chip:hover { background: var(--info-bg); }
.online-chip b { font-size: 16px; }
.online-chip .pulse { width: 9px; height: 9px; border-radius: 50%; background: #3fbf6a; border: 2px solid var(--ink); box-shadow: 0 0 0 0 rgba(63, 191, 106, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(63, 191, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(63, 191, 106, 0); } }
.coin-card { min-height: 52px; }
.coin-card.bump strong { animation: coin-bump 0.5s var(--ease); }
@keyframes coin-bump { 30% { transform: scale(1.25); color: var(--gold-lo); } }

/* ---------- Toast bertumpuk ---------- */
.toasts {
  position: fixed; left: 50%; bottom: calc(var(--toast-bottom) + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(460px, calc(100vw - 24px)); pointer-events: none;
}
.toast-item {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 8px 14px; cursor: pointer;
  background: var(--paper); color: var(--text); border: 3px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow);
  font-size: 15px; line-height: 1.25; animation: toast-in 0.22s var(--ease);
}
.toast-item.out { animation: toast-out 0.25s var(--ease) forwards; }
.toast-item .ti { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.toast-item .tt { display: grid; min-width: 0; }
.toast-item .tt b { font-weight: 700; overflow-wrap: anywhere; }
.toast-item .tt small { font-size: 12.5px; color: var(--muted); }
.toast-item.t-ok { border-left: 8px solid var(--ok); }
.toast-item.t-err { border-left: 8px solid var(--err); background: var(--err-bg); }
.toast-item.t-reward, .toast-item.t-level, .toast-item.t-ach { background: #fff3c4; border-left: 8px solid var(--gold-lo); }
.toast-item.t-level { background: linear-gradient(90deg, #fff3c4, #ffe9a8); font-size: 16px; }
.toast-item.t-quest { border-left: 8px solid #8a5fd1; }
.toast-item.t-chat { border-left: 8px solid var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px) scale(0.98); } }
#toast { display: none !important; } /* toast lama diganti */
body.ob-open .toasts { bottom: auto; top: calc(var(--hud-h) + 16px + env(safe-area-inset-top)); }

/* ---------- Emote ---------- */
.emotes { position: fixed; left: 50%; bottom: calc(var(--toast-bottom) + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; padding: 8px; }
.em-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.em {
  display: grid; justify-items: center; gap: 1px; width: 60px; padding: 6px 2px; font: 600 11px var(--font); color: var(--muted); cursor: pointer;
  background: #fffaf0; border: 2px solid var(--paper-2); border-radius: 8px; transition: transform 0.08s, background 0.1s;
}
.em span { font-size: 24px; line-height: 1.1; }
.em:hover { background: #fff3c4; border-color: var(--ink); transform: translateY(-2px); }
.em:active { transform: scale(0.95); }
#btn-emote.on { background: var(--accent); color: #fff; }

/* ---------- Jurnal ---------- */
.journal { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.jr-head { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.jr-head h2 { margin: 0; font-size: 21px; font-weight: 800; }
.jr-sub { margin: 0; font-size: 13.5px; color: var(--muted); }
.jr-head .close-x { margin-left: auto; }
.jr-ico { width: 44px; height: 44px; display: grid; place-items: center; font-size: 24px; background: #8a5fd1; border: 3px solid var(--ink); border-radius: 10px; box-shadow: inset 0 -3px 0 #5f3fa0; }
.jr-level { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; border: 2px solid var(--paper-2); border-radius: var(--r); }
.lvl-badge { width: 58px; height: 58px; flex-shrink: 0; display: grid; place-items: center; font: 800 16px var(--font); color: var(--gold-ink); background: var(--gold); border: 3px solid var(--ink); border-radius: 50%; box-shadow: inset 0 -4px 0 var(--gold-lo); }
.lvl-bar-wrap { flex: 1; min-width: 0; display: grid; gap: 4px; }
.lvl-row { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.lvl-row span { color: var(--muted); font-variant-numeric: tabular-nums; }
.lvl-bar-wrap small { font-size: 12.5px; color: var(--muted); }
.jr-tabs { flex-shrink: 0; display: flex; gap: 4px; border-bottom: 3px solid var(--paper-2); overflow-x: auto; scrollbar-width: none; }
.jr-tabs button { position: relative; flex-shrink: 0; padding: 8px 12px; border: 0; background: none; color: var(--muted); font: 800 15px var(--font); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -3px; }
.jr-tabs button.on { color: var(--text); border-color: var(--accent); }
.jr-tabs button.badge::after { content: ''; position: absolute; right: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--err); }
.jr-body { display: grid; gap: 8px; }
.jr-note { margin: 0; font-size: 13.5px; color: var(--muted); }
.qlist, .alist, .hlist, .lblist, .slist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.qrow, .arow, .hlist li, .lblist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 2px solid var(--paper-2); border-radius: var(--r); }
.qrow.done { border-color: var(--gold-lo); background: #fff8dc; }
.qrow.claimed { opacity: 0.6; }
.q-ico, .ai, .hi { width: 32px; font-size: 24px; text-align: center; flex-shrink: 0; }
.qt, .at, .ht { flex: 1; min-width: 0; display: grid; gap: 3px; }
.qt b, .at b, .ht b { font-size: 15px; }
.qt small, .at small, .ht small { font-size: 12.5px; color: var(--muted); }
.qbar { height: 8px; background: #e9dcc0; border: 1px solid var(--ink); border-radius: 4px; overflow: hidden; }
.qbar i { display: block; height: 100%; background: linear-gradient(90deg, #58b35a, #8fd16f); transition: width 0.4s var(--ease); }
.qst { font-weight: 800; color: var(--ok); white-space: nowrap; }
.qst.muted { color: var(--muted); font-variant-numeric: tabular-nums; }
.arow.on { background: #fff8dc; border-color: var(--gold-lo); }
.arow:not(.on) .at b { color: var(--muted); }
.ar { display: grid; justify-items: end; font: 800 14px var(--font); color: var(--ok); white-space: nowrap; }
.ar small { font-weight: 700; font-size: 12px; color: var(--muted); }
.hd { font: 800 16px var(--font); font-variant-numeric: tabular-nums; }
.hd.plus { color: var(--ok); }
.hd.minus { color: var(--err); }
.lb-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.lb-tabs button { padding: 6px 10px; border: 2px solid var(--paper-2); background: #fff; border-radius: 8px; font: 700 13.5px var(--font); color: var(--muted); cursor: pointer; }
.lb-tabs button.on { background: var(--accent); color: #fff; border-color: var(--ink); }
.lblist li.me { background: #fff8dc; border-color: var(--gold-lo); }
.lblist li.none { display: block; color: var(--muted); font-size: 14px; }
.lblist .rk { width: 28px; text-align: center; font-weight: 800; }
.lblist .ava { width: auto; height: 24px; }
.lblist b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lblist small { color: var(--muted); font-size: 12px; }
.lblist .rv { font-size: 13.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.slist { grid-template-columns: 1fr 1fr; }
.slist li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #fff; border: 2px solid var(--paper-2); border-radius: 8px; font-size: 14px; }
.slist li span { color: var(--muted); }
@media (max-width: 560px) { .slist { grid-template-columns: 1fr; } }

/* ---------- Pengaturan: tambahan ---------- */
.st-seg { grid-area: s; display: inline-flex; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
.st-seg button { padding: 5px 10px; border: 0; background: var(--paper); font: 700 13px var(--font); color: var(--muted); cursor: pointer; }
.st-seg button + button { border-left: 2px solid var(--ink); }
.st-seg button.on { background: var(--accent); color: #fff; }
.st-row .st-t small em { font-style: normal; color: #9b5a1a; }
.settings .btn.ghost { color: var(--muted); }

/* ---------- Layar pemuatan ---------- */
#loading {
  display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 30%, #2e4a2a, #1d2b1a 70%); color: #f1e3c2;
}
.ld-logo { font: 800 34px/1 var(--font); letter-spacing: 1px; color: #fff3c4; text-shadow: 0 3px 0 #2a1c14, 0 0 18px rgba(255, 211, 77, 0.25); }
.ld-logo small { display: block; margin-top: 6px; font: 600 14px var(--font); color: #b9d8cf; letter-spacing: 2px; text-transform: uppercase; }
.ld-bar { width: min(320px, 80vw); height: 16px; background: #0f1a0e; border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px #3d5a38; }
.ld-bar i { display: block; height: 100%; width: 0%; background: repeating-linear-gradient(90deg, #ffd34d 0 8px, #e0a92a 8px 12px); transition: width 0.25s var(--ease); }
#ld-text { font-size: 15px; color: #d8ecd9; min-height: 20px; }
.ld-tip { max-width: 360px; font-size: 13.5px; color: #b9d8cf; opacity: 0.9; min-height: 36px; }
.ld-tip b { color: #ffd34d; }
.ld-walker { width: 54px; height: 72px; image-rendering: pixelated; animation: ld-bob 0.8s steps(2) infinite; }
@keyframes ld-bob { 50% { transform: translateY(-3px); } }

/* ---------- Petunjuk kontekstual: jangan menutupi karakter ---------- */
body.touch .hint { left: 8px; right: 8px; width: auto; transform: none; bottom: auto; top: calc(var(--hud-h) + 12px + env(safe-area-inset-top)); animation: hint-in-top 0.25s ease-out; }
body.touch.in-cafe .hint { bottom: auto; top: calc(var(--hud-h) + 150px + env(safe-area-inset-top)); }
@keyframes hint-in-top { from { opacity: 0; transform: translateY(-8px); } }
body.touch.has-hint .chatfeed { top: calc(var(--hud-h) + 150px + env(safe-area-inset-top)); }

/* ---------- Kontrol sentuh: ukuran & sisi ---------- */
body.touch { --ctl-h: 150px; --toast-bottom: 196px; }
body.touch.in-field { --toast-bottom: 240px; }
.joy { transition: none; }
body.joy-s .joy { width: 104px; height: 104px; }
body.joy-s .joy-knob { width: 46px; height: 46px; }
body.joy-l .joy { width: 152px; height: 152px; }
body.joy-l .joy-knob { width: 66px; height: 66px; }
body.joy-right .joy { left: auto; right: max(18px, env(safe-area-inset-right)); }
body.joy-right .tbtn.act { right: auto; left: max(20px, env(safe-area-inset-left)); }
body.joy-right .tbtn.run { right: auto; left: calc(max(20px, env(safe-area-inset-left)) + 96px); }
body.joy-right .tbtn.emote { right: auto; left: calc(max(20px, env(safe-area-inset-left)) + 8px); }
.tbtn.emote { right: calc(max(20px, env(safe-area-inset-right)) + 8px); bottom: calc(max(34px, env(safe-area-inset-bottom)) + 96px); width: 48px; height: 48px; font-size: 22px; background: radial-gradient(circle at 35% 30%, #fffaf0, #e8d7a8); color: var(--ink); box-shadow: inset 0 -4px 0 #c9b07a, 0 3px 0 rgba(20, 12, 6, 0.4); }
.tbtn.emote:active { transform: translateY(2px); }
.tbtn, .joy { -webkit-tap-highlight-color: transparent; }

/* ---------- Tata letak HUD di HP (potret) ---------- */
@media (max-width: 640px) {
  body.touch { --hud-h: 104px; }
  body.touch .hud-top { flex-wrap: wrap; gap: 6px; }
  body.touch .hud-left { flex: 1 1 100%; gap: 6px; }
  body.touch .loc-card { flex: 1 1 auto; min-height: 44px; padding: 4px 8px 4px 4px; }
  body.touch .loc-card strong { font-size: 14px; }
  body.touch .loc-card small { font-size: 11.5px; }
  body.touch .coin-card { min-height: 44px; padding: 4px 10px; font-size: 15px; }
  body.touch .online-chip { min-height: 44px; padding: 0 10px; font-size: 14px; }
  body.touch .hud-actions { flex: 1 1 100%; justify-content: space-between; gap: 4px; }
  body.touch .me-chip { flex: 0 0 auto; min-height: 42px; max-width: 46vw; padding: 3px 8px 3px 4px; gap: 6px; }
  body.touch .me-ava { width: 30px; height: 34px; }
  body.touch .me-ava img { width: auto; height: 30px; }
  body.touch .me-txt b { font-size: 13px; }
  body.touch .me-txt small { font-size: 10.5px; gap: 4px; }
  body.touch .me-txt small > span:not(.lvl) { display: none; }
  body.touch .xpbar { height: 5px; }
  body.touch .hud-actions .act-group { display: flex; gap: 4px; }
  body.touch .hud-actions .btn, body.touch .hud-actions .btn.icon { width: 40px; min-width: 40px; height: 42px; min-height: 42px; padding: 0; font-size: 18px; }
  body.touch #btn-map, body.touch #btn-work { font-size: 0; gap: 0; }
  body.touch #btn-map::before, body.touch #btn-work::before { font-size: 18px; }
  body.touch #btn-map kbd, body.touch #btn-work kbd { display: none; }
  body.touch #btn-help { display: none; } /* bantuan tetap ada di Pengaturan */
  body.touch .hud-actions .act-group { display: flex; gap: 4px; }
  body.touch .hud-actions .act-group:last-child { margin-left: auto; }
  .journal, .settings, .profile-panel, .shop-panel, .help, .map-panel, .board-panel { border-radius: 14px 14px 0 0; }
  .emotes { left: 8px; right: 8px; transform: none; width: auto; bottom: calc(var(--ctl-h) + 56px + env(safe-area-inset-bottom)); }
  .em-grid { grid-template-columns: repeat(6, 1fr); }
  .em { width: auto; }
  .em small { display: none; }
}
@media (min-width: 641px) {
  body.touch .hud-actions .act-group { display: contents; }
}
.act-group { display: contents; }
@media (max-height: 460px) and (orientation: landscape) {
  body.touch { --hud-h: 52px; --ctl-h: 120px; --toast-bottom: 24px; }
  body.touch .hud-top { flex-wrap: nowrap; }
  body.touch .hud-left { flex: 1 1 auto; }
  body.touch .hud-actions { flex: 0 0 auto; }
  body.touch .me-chip .me-txt small > span:not(.lvl) { display: none; }
  .toasts { left: auto; right: 16px; transform: none; width: min(340px, 44vw); }
  .emotes { left: auto; right: 90px; transform: none; bottom: 16px; }
  .tbtn.emote { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 80px); }
}

/* ---------- Bantuan: tombol di pengaturan & tautan jurnal ---------- */
.st-links { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Daftar warga online (profil) ---------- */
.online li { align-items: center; }
.online .ava { width: auto; height: 24px; margin-right: 6px; vertical-align: middle; }
.online .lvl { margin-left: 6px; }

/* ---------- Pemilih tampilan karakter ---------- */
.lp { display: grid; gap: 8px; }
.lp-top { display: flex; align-items: center; gap: 12px; }
.lp-prev { image-rendering: pixelated; image-rendering: crisp-edges; background: #e9f3ec; border: 2px solid var(--ink); border-radius: 8px; padding: 6px 10px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.1); }
.lp-sec { display: grid; gap: 4px; }
.lp-sec > b { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.lp-row { display: flex; gap: 6px; flex-wrap: wrap; }
.lp-sw { width: 30px; height: 30px; }
.lp-style { padding: 5px 10px; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); font: 700 13px var(--font); color: var(--text); cursor: pointer; box-shadow: inset 0 -3px 0 var(--paper-2); }
.lp-style.active { background: var(--accent); color: #fff; box-shadow: inset 0 -3px 0 var(--ok-lo); }
.ob-looks { text-align: left; }
.ob-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.profile-panel { width: min(520px, 100%); }

.st-touch { display: contents; }
body:not(.touch) .st-touch { display: none; }

/* ---------- Pengaman: panel overlay tidak boleh lebih tinggi dari layar (landscape HP) ---------- */
.overlay > .panel { max-height: calc(100vh - 24px); overflow: auto; overscroll-behavior: contain; }
.onboard { max-height: calc(100vh - 24px); overflow: auto; }
@media (max-height: 460px) and (orientation: landscape) {
  .onboard { padding: 12px 16px 10px; }
  .onboard .ob-art { font-size: 30px; margin-bottom: 2px; }
  .onboard h2 { font-size: 18px; }
  .onboard .lp-prev { height: 64px; width: auto; }
  body.ob-open .toasts { left: 12px; right: auto; top: auto; bottom: 12px; transform: none; width: 300px; }
}

/* ---------- Teman & pesan pribadi ---------- */
.hud-actions .btn .badge-n { position: absolute; right: -4px; top: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--err); color: #fff; font: 800 11px/14px var(--font); border: 2px solid var(--ink); font-style: normal; }
.fr-ico { background: #3f9a7a; box-shadow: inset 0 -3px 0 #2a6f57; }
.fr-h { margin: 6px 0 0; font-size: 14px; color: var(--muted); font-weight: 800; }
.fr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fr-list .none { color: var(--muted); font-size: 14px; padding: 6px 2px; }
.fr-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 2px solid var(--paper-2); border-radius: var(--r); }
.fr-row.unread { border-color: var(--gold-lo); background: #fff8dc; }
.fr-ava { position: relative; flex-shrink: 0; width: 30px; display: grid; place-items: center; }
.fr-ava .ava { height: 30px; width: auto; image-rendering: pixelated; }
.fr-dot { position: absolute; right: -2px; bottom: 0; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); background: #9a9a9a; }
.fr-dot.on { background: #3fbf6a; } .fr-dot.away { background: #f0b43c; }
.fr-t { flex: 1; min-width: 0; }
.fr-t b { font-size: 15px; } .fr-t .lvl { font-size: 12px; color: var(--muted); font-weight: 800; }
.fr-t small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-unread { min-width: 22px; height: 22px; border-radius: 11px; background: var(--err); color: #fff; font: 800 12px/22px var(--font); text-align: center; padding: 0 6px; }
.fr-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.fr-acts .btn.sm { min-height: 34px; min-width: 38px; padding: 4px 8px; }
.fr-search { width: 100%; padding: 9px 12px; border: 2px solid var(--paper-2); border-radius: var(--r); font: 600 15px var(--font); background: #fff; }
.fr-opt, .fr-away { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.dm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dm-head b { font-size: 16px; } .dm-head small { color: var(--muted); flex: 1; }
.dm-list { list-style: none; margin: 0; padding: 10px; display: flex; flex-direction: column; gap: 6px; max-height: 46vh; min-height: 160px; overflow-y: auto; background: #fff; border: 2px solid var(--paper-2); border-radius: var(--r); }
.dm-list li { align-self: flex-start; max-width: 80%; padding: 6px 10px; border-radius: 12px 12px 12px 4px; background: var(--paper-2, #efe0bf); font-size: 15px; word-break: break-word; }
.dm-list li.mine { align-self: flex-end; background: #d9f0ff; border-radius: 12px 12px 4px 12px; }
.dm-list li small { display: block; font-size: 11px; color: var(--muted); text-align: right; }
.dm-list li.none { align-self: center; background: none; color: var(--muted); }
.dm-form { display: flex; gap: 6px; }
.dm-form input { flex: 1; min-width: 0; padding: 10px 12px; border: 2px solid var(--paper-2); border-radius: var(--r); font: 600 15px var(--font); }
.btn.arm { background: #b8392f !important; color: #fff !important; }
.btn.ghost { background: transparent; }
.lp-sw.locked, .lp-style.locked { position: relative; opacity: 0.45; filter: grayscale(0.4); }
.lp-sw.locked::after { content: '🔒'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; }
.lp-lock-note { margin: 4px 0 0; font-size: 13px; font-weight: 700; color: #9b5a1a; }
.jr-h { margin: 8px 0 0; font-size: 15px; font-weight: 800; }
.jr-h small { font-weight: 600; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.badge-shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.badge-shelf li { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 8px 6px; background: #fff8dc; border: 2px solid var(--gold-lo); border-radius: var(--r); }
.badge-shelf span { font-size: 28px; } .badge-shelf small { font-size: 11px; color: var(--muted); } .badge-shelf b { font-size: 13px; }
.cos-sw { width: 30px; height: 30px; border: 2px solid var(--ink); border-radius: 8px; display: grid; place-items: center; font-size: 13px; }
.fert-ico { display: grid; place-items: center; font-size: 26px; }
/* Pengaturan: tombol keyboard */
.st-keygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 10px; padding: 0 4px 6px; }
.st-key { display: flex !important; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px !important; font-size: 14px; }
.keycap { min-width: 64px; font-family: var(--mono, monospace); }
.keycap.wait { background: var(--gold); animation: pulse 1s infinite; }
.st-pad { font-size: 13px; font-weight: 700; color: var(--muted); }
/* Minimap */
.minimap { position: fixed; right: 10px; top: calc(var(--hud-h) + 18px); z-index: 20; padding: 3px; width: 152px; height: 112px; cursor: pointer; line-height: 0; }
.minimap canvas { width: 144px; height: 104px; image-rendering: pixelated; border-radius: 4px; }
.minimap .mm-n { position: absolute; right: 7px; top: 5px; font: 800 10px/1 var(--font); color: #fff; text-shadow: 0 1px 0 #000; }
body.touch .minimap { width: 116px; height: 86px; } body.touch .minimap canvas { width: 108px; height: 78px; }
body.hud-compact .minimap { display: none; }
