/* ============================================================
   BOOST ARENA – tampilan game
   HUD grafit tenang di atas diorama kota, panel kertas krem,
   satu aksen amber, token P/K & titik distrik sebagai ciri khas.
   ============================================================ */
:root {
  /* HUD (grafit gelap di atas kota) */
  --hud: rgba(20, 20, 21, 0.92);
  --hud-2: #232325;
  --hud-line: rgba(237, 237, 237, 0.1);
  --hud-text: #ededed;
  --hud-text-2: #b4b4b9;
  --hud-muted: #85858b;

  /* panel kertas krem */
  --paper: #f7f1e3;
  --card: #fffaf0;
  --raised: #efe6d2;
  --field: #fffdf8;
  --ink: #2a2318;
  --ink-2: #5e554a;
  --ink-3: #776e62;
  --rule: rgba(42, 35, 24, 0.12);
  --rule-2: rgba(42, 35, 24, 0.22);
  --edge: #dccdb0;

  /* aksen & semantik */
  --accent: #f2b544;
  --accent-hover: #f6c260;
  --accent-edge: #c4871a;
  --accent-ink: #2a1d05;
  --accent-soft: rgba(242, 181, 68, 0.2);

  --ok: #2f9e6a;
  --ok-soft: #e1f1e6;
  --ok-ink: #1d6844;
  --bad: #c8372d;
  --bad-soft: #f9e3df;
  --bad-ink: #9d271f;
  --warn-soft: #f9ebcb;
  --warn-ink: #855400;
  --koin: #36bfd2;
  --koin-edge: #1b8797;
  --flame: #ee7a32;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #141415;
  color: var(--ink);
  font: 400 14px/20px var(--sans);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
body.game {
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: #c2e3f5;
}
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule-2);
  text-underline-offset: 3px;
}
:where(a, code) { overflow-wrap: anywhere; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; line-height: 16px; }
.num, .amt, .tbl td, .stats b, .xptext, .chip.cur b, .roundbar b, .pkg .big, .dbar > b, .feed time {
  font-variant-numeric: tabular-nums;
}
.r { text-align: right !important; }

/* satu set ikon (lucide, 16/18px, stroke 1.5 konsisten) */
svg.i {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 4px;
  font: 600 12px/1 var(--sans);
  background: var(--hud-2);
  color: var(--hud-text);
  border: 1px solid var(--hud-line);
}
code {
  font: 500 13px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: var(--raised);
  border-radius: 4px;
  padding: 2px 6px;
}
fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
legend { padding: 0; }

#city {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: pointer;
}

/* ---------- token mata uang & titik distrik (ciri khas) ---------- */
.tok {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  font: 600 12px/1 var(--display);
}
.tok.p {
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1.5px solid var(--accent-edge);
}
.tok.k {
  background: var(--koin);
  color: #06323a;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}
.amt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.flame {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: none;
  background: var(--flame);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.flame.big { width: 28px; height: 28px; }
.ddot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.ddot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--dc);
  flex: none;
}
.ddot.sm { gap: 0; vertical-align: 1px; }
p .ddot, h4 .ddot { margin-left: 4px; }

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
  pointer-events: none;
  flex-wrap: wrap;
  color: var(--hud-text);
  z-index: 5;
}
.hud-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: none;
}
.hud-left > *, .chips > * { pointer-events: auto; }

.who {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--hud);
  padding: 8px 16px 8px 8px;
  border-radius: 16px;
  border: 1px solid var(--hud-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: grid;
  place-items: center;
  font: 600 16px/1 var(--display);
  color: #141415;
  flex: none;
}
.nm {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 14px;
  line-height: 16px;
}
.nm b { font: 600 15px/1 var(--display); }
.lvl { font-size: 12px; color: var(--hud-text-2); }
.hud-sep { width: 1px; height: 12px; background: var(--hud-line); }
.hud-dist { font-size: 12px; color: var(--hud-text-2); }
.xpbar {
  width: 148px;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.xpbar div {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: transform 0.35s var(--ease), width 0.35s var(--ease);
}
.xptext {
  font-size: 12px;
  line-height: 16px;
  color: var(--hud-text-2);
  margin-top: 4px;
}

.chips {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  background: var(--hud);
  color: var(--hud-text);
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--hud-line);
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font: 500 13px/1 var(--sans);
}
.chip.cur b { font: 600 15px/1 var(--display); }
.chip svg.i { width: 16px; height: 16px; color: var(--hud-text-2); }
.chip.warnchip {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent-edge);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), transform 0.14s var(--ease);
}
.chip.warnchip svg.i { color: var(--accent-ink); }
.chip.warnchip:hover { background: var(--accent-hover); }
.chip.warnchip:active { transform: scale(0.98); }
.chip.warnchip.pending {
  background: var(--hud);
  color: var(--hud-text);
  border-color: var(--hud-line);
}
.chip.warnchip.pending svg.i { color: var(--accent); }

.iconbtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--hud);
  color: var(--hud-text);
  border: 1px solid var(--hud-line);
  border-radius: 10px;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  cursor: pointer;
  font: 500 13px/1 var(--sans);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background-color 0.15s var(--ease), transform 0.14s var(--ease);
}
.iconbtn:hover { background: var(--hud-2); }
.iconbtn:active { transform: scale(0.97); }
.iconbtn svg.i { width: 18px; height: 18px; color: var(--hud-text-2); }
.iconbtn:hover svg.i { color: var(--hud-text); }
.maplbl { display: inline; }
.dot {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 12px/1 var(--sans);
  border-radius: 9px;
  padding: 0 4px;
  border: 2px solid #141415;
}

#prompt {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--hud);
  color: var(--hud-text);
  border: 1px solid var(--hud-line);
  padding: 8px 12px 8px 16px;
  border-radius: 12px;
  white-space: nowrap;
  font: 500 14px/20px var(--sans);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: pop 0.22s var(--ease);
  cursor: pointer;
  z-index: 6;
  transition: background-color 0.15s var(--ease), transform 0.14s var(--ease);
}
#prompt:hover { background: var(--hud-2); }
#prompt:active { transform: translateX(-50%) scale(0.98); }
#prompt b { font-weight: 600; }
#prompt svg.i { color: var(--accent); }
#prompt kbd {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  margin-left: 4px;
}
@keyframes pop {
  from { transform: translate(-50%, 8px); opacity: 0; }
}

#keyhint {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  line-height: 16px;
  color: var(--hud-text-2);
  background: var(--hud);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--hud-line);
  z-index: 4;
}
#keyhint kbd { margin-right: 2px; }
#keyhint .sep { width: 1px; height: 12px; background: var(--hud-line); margin: 0 8px; }

/* kontrol HP */
#controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  pointer-events: none;
  z-index: 5;
}
#controls button { pointer-events: auto; touch-action: none; }
.dpad { position: relative; width: 152px; height: 152px; }
.dpad button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--hud-line);
  background: var(--hud);
  color: var(--hud-text);
  transition: background-color 0.14s var(--ease), transform 0.12s var(--ease);
}
.dpad button svg.i { width: 20px; height: 20px; }
.dpad button.pressed {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent-edge);
  transform: scale(0.96);
}
.dpad .up { left: 50px; top: 0; }
.dpad .down { left: 50px; bottom: 0; }
.dpad .left { left: 0; top: 50px; }
.dpad .right { right: 0; top: 50px; }
.actbtns {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 32px;
}
.jbtn {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 26px;
  border: 1px solid var(--hud-line);
  background: var(--hud);
  color: var(--hud-text);
  transition: background-color 0.14s var(--ease), transform 0.12s var(--ease);
}
.jbtn svg.i { width: 20px; height: 20px; }
.jbtn.pressed {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent-edge);
  transform: scale(0.95);
}
.abtn {
  width: 72px;
  height: 72px;
  border-radius: 36px;
  border: 2px solid var(--accent-edge);
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 24px/1 var(--display);
  transition: background-color 0.14s var(--ease), transform 0.12s var(--ease);
}
.abtn:active { transform: scale(0.96); }

@media (hover: none), (max-width: 820px) {
  #controls { display: flex; }
  #keyhint { display: none; }
  #prompt { bottom: 184px; }
}

/* ---------- label 3D ---------- */
#labels {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}
.lbl3d {
  position: absolute;
  left: 0;
  top: 0;
  background: rgba(20, 20, 21, 0.84);
  color: var(--hud-text);
  font: 500 12px/16px var(--sans);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  will-change: transform;
  pointer-events: none;
}
.lbl3d.me {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent-edge);
  font-weight: 600;
}
.lbl3d.bld {
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font: 500 13px/16px var(--display);
  padding: 4px 12px 4px 4px;
  border-radius: 8px;
  background: rgba(20, 20, 21, 0.88);
  color: var(--hud-text);
  border: 1px solid rgba(237, 237, 237, 0.12);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.lbl3d.bld:hover {
  background: var(--hud-2);
  border-color: rgba(237, 237, 237, 0.24);
}
.lbl3d.bld svg.i {
  width: 24px;
  height: 24px;
  padding: 4px;
  border-radius: 6px;
  background: var(--hud-2);
  color: var(--hud-text-2);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.lbl3d.bld.near {
  border-color: var(--accent);
}
.lbl3d.bld.near svg.i {
  background: var(--accent);
  color: var(--accent-ink);
}
.lbl3d.flag {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--rule);
}
.lbl3d.flag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--dc);
}

#camctl {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
  z-index: 4;
}
@media (hover: none), (max-width: 820px) {
  #camctl {
    bottom: 264px;
    right: max(20px, env(safe-area-inset-right));
    flex-direction: column;
  }
}
.nogl {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  font-size: 18px;
  background: #141415;
  color: var(--hud-text);
  z-index: 30;
}

/* ---------- modal panel (native dialog, kertas krem) ---------- */
dialog.panel-dialog {
  margin: auto;
  padding: 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  overflow: visible;
}
dialog.panel-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
dialog.panel-dialog:modal {
  overscroll-behavior: contain;
}
dialog.panel-dialog::backdrop {
  background: rgba(15, 15, 16, 0.48);
  overflow: hidden;
  overscroll-behavior: contain;
  animation: fade 0.2s var(--ease);
}
@keyframes fade { from { opacity: 0; } }

.panel {
  width: min(640px, 100%);
  max-height: min(88vh, 880px);
  background: var(--paper);
  color: var(--ink);
  border-radius: 20px;
  border: 1px solid var(--edge);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  animation: rise 0.28s var(--ease);
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }

.panel > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 16px 20px;
  border-bottom: 1px solid var(--rule);
}
.panel h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font: 600 20px/24px var(--display);
  min-width: 0;
}
.ptile {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent-edge);
  flex: none;
}
.ptile svg.i { width: 18px; height: 18px; }
.iconbtn.close {
  background: var(--raised);
  color: var(--ink-2);
  border-color: var(--rule);
  box-shadow: none;
  width: 36px;
  padding: 0;
}
.iconbtn.close svg.i { color: var(--ink-2); }
.iconbtn.close:hover { background: var(--edge); color: var(--ink); }
.iconbtn.close:hover svg.i { color: var(--ink); }

#panelBody { padding: 20px; overflow-y: auto; }
#panelBody h4 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 24px 0 12px;
  font: 600 15px/20px var(--display);
  color: var(--ink);
}
#panelBody h4 .muted { font: 400 12px/16px var(--sans); }
#panelBody > :first-child { margin-top: 0; }

@media (max-width: 600px) {
  dialog.panel-dialog { padding: 0; }
  dialog.panel-dialog[open] { align-items: flex-end; }
  .panel {
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
  }
}

/* ---------- elemen umum (di atas kertas) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  padding: 0 16px;
  font: 600 14px/1 var(--sans);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.12s var(--ease);
}
.btn:hover:not(:disabled) { background: #ffffff; border-color: var(--ink-3); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn small { font-weight: 500; opacity: 0.75; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent-edge);
  color: var(--accent-ink);
}
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-edge); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover:not(:disabled) { background: var(--raised); color: var(--ink); border-color: transparent; }
.btn.big { width: 100%; min-height: 48px; font-size: 15px; margin-top: 16px; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.okb { background: var(--ok-soft); border-color: transparent; color: var(--ok-ink); }
.btn.okb:hover:not(:disabled) { background: #d0ead8; border-color: transparent; }
.btn.danger { background: var(--bad-soft); border-color: transparent; color: var(--bad-ink); }
.btn.danger:hover:not(:disabled) { background: #f3d2cc; border-color: transparent; }

input, select, textarea {
  width: 100%;
  min-height: 40px;
  background: var(--field);
  color: var(--ink);
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  padding: 0 12px;
  font: 400 14px/20px var(--sans);
  transition: border-color 0.15s var(--ease);
}
input::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent-edge);
}
select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23776e62' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--raised);
  color: var(--ink-2);
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.pill svg.i { width: 14px; height: 14px; }
.pill.lv { background: var(--accent-soft); color: var(--accent-ink); }
.pill.ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill.bad { background: var(--bad-soft); color: var(--bad-ink); }
.pill.badge { background: var(--card); color: var(--ink); border: 1px solid var(--rule); }
.pill.badge svg.i { color: var(--accent-edge); }
.pills { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }

.lead { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; line-height: 22px; }
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}
.empty {
  text-align: center;
  color: var(--ink-3);
  padding: 24px 16px;
  border: 1.5px dashed var(--rule-2);
  border-radius: 12px;
}
.bar { height: 8px; background: var(--raised); border-radius: 4px; overflow: hidden; margin: 12px 0 8px; }
.bar div { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.35s var(--ease); }
.form {
  display: grid;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
}
.form .btn.big { margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 8px; border-bottom: 1px solid var(--rule); }
.tbl th { color: var(--ink-3); font-weight: 500; font-size: 12px; }
.tbl tr.hl td { background: var(--accent-soft); }

/* cara main */
.howto { display: grid; gap: 8px; margin-bottom: 20px; }
.howto > div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; color: var(--ink-2); }
.keys { display: flex; gap: 4px; }
.panel kbd { background: var(--card); color: var(--ink); border-color: var(--rule-2); }
.steps { display: grid; gap: 8px; margin: 0; }
.steps > div {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px;
}
.steps > div > b { font: 600 13px/1 var(--display); color: var(--ink-3); width: 12px; flex: none; }
.stic {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--raised);
  color: var(--ink);
  flex: none;
}

/* verifikasi */
.vsteps { padding-left: 20px; display: grid; gap: 16px; margin: 0 0 16px; }
.vsteps li::marker { font-family: var(--display); font-weight: 600; color: var(--ink-3); }
.vsteps li > div { margin-top: 8px; }
.ticket {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  background: var(--card);
  border: 1.5px dashed var(--accent-edge);
  border-radius: 12px;
  padding: 12px 12px 12px 16px;
}
.ticket > div { flex: 1; display: grid; gap: 4px; }
.tlabel { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.ticket code {
  background: none;
  padding: 0;
  font-size: 18px;
  line-height: 24px;
  color: var(--ink);
  user-select: all;
  -webkit-user-select: all;
}
.verified { text-align: center; padding: 12px 0 0; }
.verified .seal {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 32px;
  background: var(--ok);
  color: #ffffff;
  border: 4px solid var(--ok-soft);
}
.verified .seal svg.i { width: 28px; height: 28px; }
.verified h3 { margin: 16px 0 4px; font: 600 18px/24px var(--display); }
.banner {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--rule);
  color: var(--ink-2);
}
.banner b { color: var(--ink); }
.banner.ok { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--ok-soft); border-color: transparent; color: var(--ok-ink); }
.banner.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad-ink); margin-bottom: 16px; }
details.banner summary { cursor: pointer; }
details.banner summary .amt { vertical-align: -4px; }
details.banner ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent-edge);
  border-top-color: transparent;
  border-radius: 50%;
  animation: sp 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 8px;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* profil & KTP digital */
.soc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ktp {
  background: var(--field);
  border: 1px solid var(--edge);
  border-top: 4px solid var(--dc, var(--accent));
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
}
.ktp.active { border-color: var(--edge); border-top-color: var(--dc, var(--ok)); }
.ktp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.ktp-brand { display: block; font: 600 14px/18px var(--display); color: var(--ink); }
.ktp-sub { display: block; font-size: 12px; line-height: 16px; color: var(--ink-3); }
.ktp-body { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.ktp-photo { display: grid; gap: 8px; justify-items: center; }
.ktp-nik {
  font: 500 12px/16px ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  background: var(--raised);
  color: var(--ink-2);
  padding: 2px 8px;
  border-radius: 4px;
}
.ktp-info { display: grid; gap: 4px; }
.ktp-row { display: grid; grid-template-columns: 80px 1fr; gap: 8px; align-items: baseline; font-size: 13px; line-height: 20px; }
.ktp-row > span { font-size: 12px; color: var(--ink-3); }
.ktp-row > b { font-weight: 600; color: var(--ink); }
.ktp-soc-wrap {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule-2);
}
.ktp-lbl { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.ktp-socs { display: flex; flex-wrap: wrap; gap: 8px; }
.ktp-soc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 16px;
}
.ktp-soc small { color: var(--ink-3); font-weight: 500; }
.ktp-soc b { font-weight: 600; color: var(--ink); }
.ktp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  font-size: 12px;
  line-height: 16px;
  color: var(--ink-3);
}
.ktp-stamp {
  font: 600 12px/16px var(--display);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--rule-2);
  color: var(--ink-2);
}
.ktp-stamp.ok {
  border-color: var(--ok);
  color: var(--ok-ink);
  background: var(--ok-soft);
}
.ktp-edit summary { cursor: pointer; font-weight: 500; color: var(--ink); }
.soc-edit-form { display: grid; gap: 12px; margin-top: 12px; }
.soc-edit-form .btn { justify-self: start; }

.profile { display: flex; gap: 16px; align-items: center; }
.profile h3 { margin: 0; font: 600 20px/24px var(--display); }
.bigavatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font: 600 28px/1 var(--display);
  color: #141415;
  flex: none;
  border: 1px solid var(--rule);
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stats div {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 4px;
}
.stats b { display: block; font: 600 18px/24px var(--display); }
.stats span { font-size: 12px; color: var(--ink-3); }
.stats b .amt { font: inherit; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}
.feed time { color: var(--ink-3); font-size: 12px; white-space: nowrap; }

/* misi */
.missions { display: grid; gap: 8px; }
.mission {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px 16px;
}
.mission.ready { border-color: var(--accent-edge); }
.mission.claimed { opacity: 0.55; }
.mtop, .mbot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 600 14px/1 var(--display);
  white-space: nowrap;
}
.streakcard { display: flex; gap: 12px; align-items: center; }

/* arena */
.roundbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.roundbar div {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 4px;
}
.roundbar span { font-size: 12px; color: var(--ink-3); }
.roundbar b { font: 600 22px/1 var(--display); }
.slot {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
}
.slot.complete { border-color: rgba(47, 158, 106, 0.45); }
.slot.mine { border-color: var(--accent-edge); }
.slothead { display: flex; gap: 12px; align-items: center; }
.slothead > div { flex: 1; min-width: 0; }
.slothead a:not(.btn) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.av {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font: 600 13px/1 var(--display);
  color: #141415;
  flex: none;
  vertical-align: middle;
}
.av.big { width: 52px; height: 52px; border-radius: 16px; font-size: 22px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; }
.komen { display: flex; gap: 8px; margin-top: 12px; }
.komen input { flex: 1; min-height: 32px; }
.recv {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 12px 0 0;
  font-weight: 500;
  align-items: center;
}
.recv > span { display: inline-flex; align-items: center; gap: 8px; }
.recv svg.i { color: var(--ink-3); }
.state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-size: 13px;
  font-weight: 500;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--raised);
  color: var(--ink-2);
}
.state svg.i { width: 14px; height: 14px; }
.state.pending { background: var(--warn-soft); color: var(--warn-ink); }
.state.ok { background: var(--ok-soft); color: var(--ok-ink); }
.state.rejected { background: var(--bad-soft); color: var(--bad-ink); }
.state small { font-weight: 500; opacity: 0.75; }
.komenok { margin: 12px 0 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.claim {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--accent-edge);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
}
.claim > div { flex: 1; }
.ronda-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--warn-soft);
  border-color: var(--accent-edge);
  color: var(--warn-ink);
}
.kentongan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 0;
}
.kentongan-row > div { flex: 1; min-width: 200px; display: grid; gap: 4px; }
.ronda-roster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.note-feed {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}
.note-feed li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
}
.av.sm { width: 24px; height: 24px; border-radius: 6px; font-size: 11px; }
.note-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.note-body time { color: var(--ink-3); font-size: 12px; margin-left: 8px; font-weight: 400; }
.note-body div { color: var(--ink-2); overflow-wrap: anywhere; }
.lock {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 24px 16px;
  border: 1.5px dashed var(--rule-2);
  border-radius: 16px;
}
.lock p { margin: 0 0 8px; }
.lock b { font: 600 17px/24px var(--display); }
.locktile {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--raised);
  color: var(--ink-2);
}
.locktile svg.i { width: 20px; height: 20px; }

/* toko & bank */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  background: var(--raised);
  border-radius: 12px;
  overflow-x: auto;
}
.tab {
  flex: 1;
  min-height: 36px;
  background: transparent;
  color: var(--ink-2);
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  font: 500 13px/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.on {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  border: 1px solid var(--rule);
}
.saldo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font: 600 18px/24px var(--display);
}
.saldo > span:first-child { font: 400 13px/20px var(--sans); color: var(--ink-3); }
.plat { margin-bottom: 12px; }
.plabel { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.svcgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.svc, .pkg {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.svc:hover, .pkg:hover { border-color: var(--rule-2); }
.svc > span { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 4px; }
.svc small { color: var(--ink-3); }
.svc.sel, .pkg.sel { border-color: var(--accent-edge); background: #fff7e3; }
.price { display: flex; flex-direction: column; justify-content: center; padding: 0 8px; }
.price b { font: 600 17px/24px var(--display); }
.price small { color: var(--ink-3); }
.price.bad b { color: var(--bad); }
.pkgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pkg { position: relative; padding: 12px; }
.pkg .big { font: 600 22px/28px var(--display); }
.pkg .big small { font: 400 13px var(--sans); color: var(--ink-3); }
.pkg .pill { align-self: flex-start; margin-top: 4px; }
.stack { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 2px; height: 36px; margin-bottom: 4px; }
.stack i {
  display: block;
  width: 24px;
  height: 6px;
  border-radius: 4px;
  background: var(--koin);
  border-bottom: 2px solid var(--koin-edge);
}
.stack i:nth-child(even) { margin-left: 2px; }
.pay { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 16px; }
.qris {
  width: 144px;
  height: 144px;
  background: #ffffff;
  color: var(--ink);
  display: grid;
  place-content: center;
  gap: 4px;
  font: 600 16px/1 var(--display);
  border-radius: 12px;
  border: 1.5px dashed var(--rule-2);
}
.qris small { font: 400 12px var(--sans); color: var(--ink-3); }
.orders { list-style: none; padding: 0; margin: 0; }
.orders li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink-2);
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--ink-3); }
.status.menunggu, .status.pending { color: var(--warn-ink); }
.status.menunggu::before, .status.pending::before { background: #d99a1e; }
.status.diproses::before { background: #3b82c4; }
.status.selesai, .status.confirmed { color: var(--ok-ink); }
.status.selesai::before, .status.confirmed::before { background: var(--ok); }
.status.gagal, .status.rejected { color: var(--bad-ink); }
.status.gagal::before, .status.rejected::before { background: var(--bad); }

/* peringkat – podium */
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: end; margin-bottom: 16px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.pod > b { font: 600 15px/20px var(--display); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod > .num { font-size: 12px; color: var(--ink-3); }
.pod .step {
  width: 100%;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 8px;
  border-radius: 12px 12px 4px 4px;
  background: var(--card);
  border: 1px solid var(--rule);
}
.pod .place { font: 600 28px/1 var(--display); color: var(--ink-3); }
.pod .prize { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pod .prize svg.i { color: var(--ink-3); width: 16px; height: 16px; }
.pod.p1 { order: 2; }
.pod.p2 { order: 1; }
.pod.p3 { order: 3; }
.pod.p1 .step { height: 108px; background: #fff3d6; border-color: var(--accent-edge); }
.pod.p1 .place { color: var(--accent-edge); }
.pod.p2 .step { height: 84px; }
.pod.p3 .step { height: 68px; }
.tbl.rank td:first-child { width: 32px; }
.menugrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mapbtn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 12px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 12px;
  font: 500 14px/1.2 var(--sans);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.12s var(--ease);
}
.mapbtn:hover { background: #ffffff; border-color: var(--rule-2); }
.mapbtn:active { transform: scale(0.98); }
.mapbtn .stic { background: var(--raised); color: var(--ink); }
.menufoot { display: flex; gap: 8px; margin-top: 16px; }
.dbars { display: grid; gap: 8px; }
.dbar {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 12px 16px;
  border-radius: 12px;
}
.dbar.mine { border-color: var(--accent-edge); }
.dbar .rk { font: 600 14px/1 var(--display); color: var(--ink-3); }
.dbar .dn { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dbar > b { font: 600 15px/1 var(--display); }
.dbar > div { grid-column: 2 / -1; height: 8px; background: var(--raised); border-radius: 4px; overflow: hidden; }
.dbar > div i { display: block; height: 100%; border-radius: 4px; }

/* ---------- login split (kota 3D hidup terbuka di kanan) ---------- */
#login {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
}
.login-stage {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
}
.loginbox {
  pointer-events: auto;
  width: min(440px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: var(--paper);
  color: var(--ink);
  border-radius: 20px;
  border: 1px solid var(--edge);
  padding: 24px;
  display: grid;
  gap: 16px;
  user-select: text;
  touch-action: auto;
  box-shadow: 0 24px 60px rgba(20, 20, 21, 0.25);
  animation: rise 0.36s var(--ease);
}
.login-head { display: grid; gap: 8px; }
.loginbox h1 {
  margin: 0;
  font: 600 24px/28px var(--display);
  letter-spacing: -0.01em;
}
.loginbox .sub {
  margin: 0;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.pv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #38bdf8;
  color: #141415;
  display: grid;
  place-items: center;
  font: 600 18px/1 var(--display);
  flex: none;
}
.pv-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pv-meta b { font: 600 14px/18px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-meta span { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-dist {
  font-size: 12px;
  color: var(--ink-2);
  background: var(--raised);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.field-group { display: grid; gap: 8px; }
.field-group label, .glabel {
  display: block;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-2);
}
.group { display: grid; gap: 8px; }
.loginbox .btn.big { margin-top: 4px; }
.loginbox > small { text-align: center; font-size: 12px; }

.brand { display: flex; align-items: center; gap: 8px; font: 600 16px/1 var(--display); }
.mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex: none;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M8 24V15h4v9zm6 0V9h4v15zm6 0V12h4v12z' fill='%232a1d05'/%3E%3C/svg%3E") center / 100% no-repeat;
  border: 1px solid var(--accent-edge);
}

#colorPick { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(42, 35, 24, 0.16);
  background: var(--c);
  cursor: pointer;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.swatch:active { transform: scale(0.95); }
.swatch.sel { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }

#districtPick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dist {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0 12px;
  font: 500 13px/1.2 var(--sans);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.dist::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--dc); flex: none; }
.dist-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
  flex: none;
}
.dist-meta svg.i { width: 12px; height: 12px; }
.dist:hover:not(:disabled) { border-color: var(--rule-2); }
.dist.sel {
  border-color: var(--dc);
  background: color-mix(in srgb, var(--dc) 12%, var(--card));
}
.dist.sel .dist-meta { color: var(--ink); font-weight: 600; }
.dist.locked {
  opacity: 0.56;
  cursor: not-allowed;
  background: var(--raised);
  border-style: dashed;
}

@media (max-width: 820px) {
  #login { justify-content: center; align-items: flex-end; padding: 12px; }
  .login-stage { justify-content: center; }
}

/* ---------- toast ---------- */
#toasts {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 40;
  width: min(420px, 92vw);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--hud);
  color: var(--hud-text);
  border: 1px solid var(--hud-line);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  animation: tin 0.24s var(--ease);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: #8f8f95; flex: none; }
.toast.ok::before { background: #4cc38a; }
.toast.err::before { background: #e5484d; }
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- adaptasi layar kecil & perangkat sentuh ---------- */
@media (pointer: coarse) {
  :root { --target: 44px; }
  .btn, input, select, textarea, .iconbtn, .tab, .dist, .swatch {
    min-block-size: var(--target);
  }
  input, select, textarea { font-size: max(16px, 1em); }
}

@media (max-width: 640px) {
  .who { padding-right: 12px; }
  .xpbar { width: 112px; }
  .maplbl { display: none; }
  .hud-sep, .hud-dist { display: none; }
  .chip { padding: 0 8px; gap: 6px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .howto > div { grid-template-columns: 1fr; gap: 4px; }
  #districtPick, .soc-grid { grid-template-columns: 1fr; }
  .ktp-body { grid-template-columns: 1fr; }
  .ktp-photo { justify-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* unslop by @heydamir (CC BY 4.0) */
