/* ============================================================
   NEGERIKU — Desain ceria & ramas ("friendly sticker" style)
   Krem + tinta gelap + koral/teal/kuning. Bukan gradien AI.
   ============================================================ */
:root {
  --cream: #FFF6E8;
  --paper: #FFFDF6;
  --ink: #2B2118;
  --ink-soft: #5B4B3E;
  --coral: #FF6B4A;
  --coral-deep: #E8532F;
  --teal: #0FA3A3;
  --teal-deep: #0B7C7C;
  --sun: #FFC94D;
  --leaf: #35A854;
  --pink: #FF8FB1;
  --violet: #8B7CF6;
  --sky: #7FD8F7;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-soft: 0 12px 28px rgba(43, 33, 24, .22);
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  overscroll-behavior: none;
}
h1, h2, h3, .fredoka { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; letter-spacing: .2px; }
button { font-family: inherit; }

/* ============ LAYAR AUTH ============ */
.auth-screen {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 480px);
  gap: clamp(16px, 3vw, 48px);
  align-items: center;
  padding: clamp(14px, 3vw, 40px);
  position: relative;
  overflow: hidden;
  background-color: var(--cream);
  background-image: radial-gradient(rgba(43,33,24,.10) 1.6px, transparent 1.7px);
  background-size: 26px 26px;
}
.auth-blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; pointer-events: none; }
.auth-blob-1 { width: 340px; height: 340px; background: #FFD9A0; top: -110px; left: -120px; }
.auth-blob-2 { width: 260px; height: 260px; background: #BDEBE3; bottom: -90px; left: 38%; }
.auth-blob-3 { width: 220px; height: 220px; background: #FFD3DE; top: 8%; right: -80px; }

.auth-hero { position: relative; display: flex; flex-direction: column; gap: 18px; max-width: 720px; }
.auth-illustration {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border: 4px solid var(--ink); border-radius: 26px;
  box-shadow: 8px 8px 0 var(--ink);
  background: #fff;
}
.auth-logo-row { display: flex; align-items: center; gap: 18px; }
.auth-logo { width: 86px; height: 86px; border-radius: 22px; border: 3px solid var(--ink); background: #fff; box-shadow: var(--shadow); }
.auth-title { margin: 0; font-size: clamp(2.2rem, 4.6vw, 3.4rem); font-weight: 700; line-height: .95; }
.auth-title span { color: var(--coral); }
.auth-tagline { margin: 6px 0 0; color: var(--ink-soft); font-weight: 800; max-width: 46ch; }
.auth-features { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 4px 0 0; }
.auth-features li {
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px;
  padding: 8px 14px; font-weight: 800; font-size: .86rem; box-shadow: 3px 3px 0 var(--ink);
}

.auth-card {
  position: relative; background: var(--paper); border: 4px solid var(--ink);
  border-radius: 26px; box-shadow: 10px 10px 0 var(--ink); padding: 26px;
}
.auth-tabs { display: flex; background: #F3EADF; border: 3px solid var(--ink); border-radius: 16px; padding: 6px; gap: 6px; margin-bottom: 16px; }
.auth-tab { flex: 1; border: 0; background: transparent; padding: 12px; border-radius: 12px; font-weight: 900; font-size: 1rem; cursor: pointer; color: var(--ink-soft); }
.auth-tab.active { background: var(--coral); color: #fff; box-shadow: 2px 2px 0 var(--ink); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 900; font-size: .85rem; color: var(--ink-soft); }
.auth-form input {
  font: 700 1rem 'Nunito', sans-serif; padding: 13px 14px; border-radius: 14px;
  border: 3px solid var(--ink); background: #fff; outline: none; transition: transform .12s, box-shadow .12s;
}
.auth-form input:focus { box-shadow: 4px 4px 0 var(--teal); transform: translate(-1px, -1px); }
.auth-note { background: #FFF3C4; border: 2px dashed #D9A62E; padding: 10px 12px; border-radius: 12px; font-weight: 800; font-size: .85rem; margin: 0; }
.auth-error { background: #FFE1DC; border: 2px solid var(--coral-deep); color: var(--coral-deep); padding: 10px 12px; border-radius: 12px; font-weight: 800; font-size: .85rem; margin: 0; }
.auth-foot { margin: 16px 2px 0; font-size: .82rem; color: var(--ink-soft); text-align: center; font-weight: 700; }

/* ============ TOMBOL ============ */
.btn { border: 3px solid var(--ink); border-radius: 14px; padding: 13px 18px; font-weight: 900; font-size: .95rem; cursor: pointer; transition: transform .12s, box-shadow .12s; box-shadow: var(--shadow); }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-accent { background: var(--coral); color: #fff; }
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-ghost { background: #fff; color: var(--ink); }
.btn-danger { background: #FFD9D3; color: var(--coral-deep); border-color: var(--coral-deep); box-shadow: 4px 4px 0 var(--coral-deep); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: .8rem; border-radius: 11px; box-shadow: 3px 3px 0 var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ============ GAME SHELL ============ */
body.in-game { overflow: hidden; height: 100dvh; }
#gameRoot { position: fixed; inset: 0; overflow: hidden; background: #79B473; }
#gameCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* --- Topbar --- */
#topbar {
  position: absolute; top: max(10px, env(safe-area-inset-top)); left: 12px; right: 12px;
  display: flex; align-items: center; gap: 12px; z-index: 20;
  background: rgba(255, 253, 246, .92); backdrop-filter: blur(10px);
  border: 3px solid var(--ink); border-radius: 18px; padding: 8px 12px; box-shadow: var(--shadow-soft);
}
.tb-left { display: flex; align-items: center; gap: 8px; }
.tb-logo { width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--ink); }
.tb-brand { font-family: 'Fredoka'; font-weight: 700; font-size: 1.15rem; }
.tb-brand span { color: var(--coral); }
.tb-search {
  flex: 1; display: flex; align-items: center; gap: 8px; background: #fff;
  border: 3px solid var(--ink); border-radius: 999px; padding: 8px 14px; min-width: 0;
}
.tb-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: 800 .95rem 'Nunito'; color: var(--ink); }
.tb-kbd { font: 800 .7rem 'Nunito'; background: #EDE3D3; border: 1.5px solid var(--ink); border-radius: 6px; padding: 2px 6px; color: var(--ink-soft); }
.tb-right { display: flex; align-items: center; gap: 8px; }
.chip { display: flex; align-items: center; gap: 6px; border-radius: 999px; border: 2.5px solid var(--ink); padding: 7px 12px; font-weight: 900; font-size: .8rem; background: var(--sun); white-space: nowrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; cursor: pointer; font-size: 1.05rem; box-shadow: 2px 2px 0 var(--ink); transition: transform .1s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.icon-btn:active { transform: translate(2px,2px); box-shadow: none; }

/* --- Pengumuman --- */
.announce-bar {
  position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 62px); left: 50%; transform: translateX(-50%);
  z-index: 19; display: flex; gap: 8px; align-items: center; max-width: min(680px, 92vw);
  background: var(--sun); border: 3px solid var(--ink); border-radius: 999px; padding: 8px 18px;
  font-weight: 900; font-size: .82rem; box-shadow: var(--shadow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* --- HUD --- */
.hud-card {
  position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 62px); left: 12px; z-index: 15;
  background: rgba(255,253,246,.94); backdrop-filter: blur(8px); border: 3px solid var(--ink);
  border-radius: var(--radius); padding: 12px; width: 228px; box-shadow: var(--shadow-soft);
}
.hud-top { display: flex; gap: 10px; align-items: center; }
.hud-avatar { width: 56px; height: 56px; font-size: 1.9rem; border-radius: 16px; background: var(--sun); border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.hud-name { font-family: 'Fredoka'; font-weight: 600; font-size: .92rem; line-height: 1.1; }
.hud-balance { font-weight: 900; color: var(--teal-deep); font-size: .95rem; margin-top: 2px; }
.hud-stats { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.stat { display: flex; align-items: center; gap: 8px; }
.stat-ic { font-size: .85rem; width: 20px; text-align: center; }
.stat-bar { flex: 1; height: 10px; border: 2px solid var(--ink); border-radius: 999px; background: #EDE3D3; overflow: hidden; }
.stat-bar .fill { display: block; height: 100%; width: 50%; border-radius: 999px; transition: width .4s; }
.fill-orange { background: #FF9F43; } .fill-pink { background: var(--pink); } .fill-red { background: #FF5B5B; } .fill-violet { background: var(--violet); }

/* --- FAB kanan --- */
#fabCol { position: absolute; right: 12px; bottom: 96px; display: flex; flex-direction: column; gap: 10px; z-index: 15; }
.fab { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; padding: 10px 4px; border-radius: 18px; border: 3px solid var(--ink); background: var(--paper); cursor: pointer; box-shadow: var(--shadow); }
.fab:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.fab-ic { font-size: 1.5rem; }
.fab-label { font-size: .62rem; font-weight: 900; color: var(--ink-soft); }

/* --- Bottom nav --- */
#bottomNav {
  position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 15;
  display: flex; gap: 6px; background: rgba(255,253,246,.95); backdrop-filter: blur(8px);
  border: 3px solid var(--ink); border-radius: 22px; padding: 8px; box-shadow: var(--shadow-soft);
}
.bn-item { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 74px; padding: 8px 14px; border-radius: 16px; border: 0; background: transparent; cursor: pointer; font-weight: 900; font-size: .72rem; color: var(--ink-soft); }
.bn-item span { font-size: 1.35rem; }
.bn-item.active { background: var(--sun); color: var(--ink); box-shadow: inset 0 0 0 2.5px var(--ink); }

/* --- Panel samping --- */
#sidePanel {
  position: absolute; top: 0; right: 0; height: 100dvh; width: min(430px, 100vw); z-index: 30;
  background: var(--cream); border-left: 4px solid var(--ink); box-shadow: -10px 0 40px rgba(0,0,0,.25);
  transform: translateX(105%); transition: transform .28s cubic-bezier(.2,.9,.3,1.1); display: flex; flex-direction: column;
}
#sidePanel.open { transform: translateX(0); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 3px solid var(--ink); background: var(--paper); }
.panel-head h2 { margin: 0; font-size: 1.25rem; }
.panel-body { flex: 1; overflow-y: auto; padding: 16px; }

.job-card, .asset-card, .rank-row, .shop-item { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 16px; }
.job-card { padding: 12px; display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.job-icon { width: 56px; height: 56px; border-radius: 14px; background: #FFF0D6; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font-size: 1.7rem; flex: 0 0 auto; }
.job-info { flex: 1; min-width: 0; }
.job-name { font-weight: 900; }
.job-desc { font-size: .72rem; color: var(--ink-soft); font-weight: 700; }
.job-pay { font-size: .72rem; color: var(--teal-deep); font-weight: 900; }

.asset-hero { text-align: center; background: linear-gradient(160deg, #0FA3A3, #0B7C7C); border: 3px solid var(--ink); border-radius: 18px; color: #fff; padding: 18px 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.asset-hero small { font-weight: 800; opacity: .85; letter-spacing: 1px; text-transform: uppercase; font-size: .65rem; }
.asset-hero .amount { font-family: 'Fredoka'; font-size: 1.7rem; font-weight: 600; margin: 4px 0 10px; }
.asset-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.deposit-box { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 16px; padding: 12px; margin-bottom: 12px; }
.deposit-box h3 { margin: 0 0 6px; font-size: .95rem; }
.deposit-amount { font-size: 1.15rem; font-weight: 900; color: var(--teal-deep); }
.deposit-actions { display: flex; gap: 8px; margin-top: 8px; }
.deposit-actions input { flex: 1; min-width: 0; border: 2px solid var(--ink); border-radius: 10px; padding: 8px 10px; font: 800 .85rem 'Nunito'; }

.plot-card { padding: 10px 12px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.plot-status { font-size: .68rem; font-weight: 900; padding: 3px 8px; border-radius: 999px; border: 1.5px solid var(--ink); }
.st-empty { background: #FFE9C7; } .st-building { background: #FFD3D3; } .st-done { background: #CBF3D0; }
.progress { height: 12px; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: #EDE3D3; margin-top: 6px; }
.progress > i { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--sun) 0 8px, #F5B93B 8px 16px); width: 0%; transition: width .3s; }

.rank-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px; font-weight: 800; }
.rank-num { width: 30px; height: 30px; border-radius: 9px; background: #EDE3D3; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.rank-row.me { background: #FFF3C4; }

.help-block { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 16px; padding: 12px; margin-bottom: 12px; font-size: .85rem; font-weight: 700; }
.help-block b { color: var(--coral-deep); }
.trx-row { display: flex; justify-content: space-between; gap: 10px; font-size: .78rem; font-weight: 700; padding: 7px 4px; border-bottom: 1.5px dashed #E0D2C0; }
.trx-plus { color: var(--leaf); } .trx-minus { color: var(--coral-deep); }

/* --- Joystick --- */
#joystick {
  display: none; position: absolute; left: 18px; bottom: 104px; z-index: 18;
  width: 118px; height: 118px; border-radius: 50%;
  border: 3px solid rgba(43,33,24,.65); background: rgba(255,253,246,.35); backdrop-filter: blur(2px);
  touch-action: none;
}
#joyKnob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%; background: rgba(255,253,246,.92); border: 3px solid var(--ink); transform: translate(-50%,-50%); box-shadow: 2px 2px 0 var(--ink); }
@media (pointer: coarse), (max-width: 760px) { #joystick { display: block; } .tb-kbd { display: none; } }

/* --- Kartu NPC mengambang --- */
.floating-card {
  position: absolute; z-index: 25; background: var(--paper); border: 3px solid var(--ink);
  border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; width: 250px; font-size: .82rem;
}
.floating-card h3 { margin: 0 0 6px; font-size: .95rem; word-break: break-all; }
.floating-card .npc-act { background: #E9F7EF; border: 2px dashed var(--leaf); border-radius: 10px; padding: 6px 8px; font-weight: 800; font-size: .78rem; }
.floating-card .npc-meta { color: var(--ink-soft); font-weight: 700; font-size: .72rem; margin-top: 6px; }

/* --- Modal --- */
#modalOverlay { position: absolute; inset: 0; z-index: 40; background: rgba(20,12,6,.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; }
#modalOverlay[hidden] { display: none; }
#modalBox { background: var(--cream); border: 4px solid var(--ink); border-radius: 22px; box-shadow: 10px 10px 0 rgba(0,0,0,.4); width: min(560px, 96vw); max-height: min(86dvh, 720px); overflow-y: auto; animation: pop .22s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.modal-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 3px solid var(--ink); background: var(--paper); border-radius: 18px 18px 0 0; z-index: 1; }
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 16px; }
.modal-foot { padding: 12px 16px; border-top: 3px solid var(--ink); background: var(--paper); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; border-radius: 0 0 18px 18px; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.shop-item { padding: 10px; display: flex; flex-direction: column; gap: 6px; text-align: center; }
.shop-icon { font-size: 2rem; }
.shop-name { font-weight: 900; font-size: .78rem; line-height: 1.25; min-height: 2.4em; }
.shop-desc { font-size: .68rem; color: var(--ink-soft); font-weight: 700; min-height: 2em; }
.shop-price { font-size: .8rem; font-weight: 900; color: var(--teal-deep); }

.tabs-mini { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs-mini button { border: 2.5px solid var(--ink); background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 900; font-size: .75rem; cursor: pointer; }
.tabs-mini button.active { background: var(--coral); color: #fff; }
.shop-item.wi-wear { outline: 3px solid var(--teal); outline-offset: -3px; }
#fsA { border: 2.5px solid var(--ink); border-radius: 10px; padding: 8px 10px; font-family: inherit; font-weight: 700; }

/* --- Toast --- */
#toast {
  position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 110px); left: 50%; transform: translateX(-50%) translateY(-8px);
  z-index: 50; background: var(--ink); color: var(--cream); padding: 11px 18px; border-radius: 14px;
  font-weight: 800; font-size: .85rem; opacity: 0; transition: all .25s; max-width: 90vw; text-align: center; pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Taksi overlay --- */
#taxiOverlay { position: absolute; inset: 0; z-index: 45; background: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.taxi-dash { font-size: 4rem; animation: dash 1s infinite linear; }
@keyframes dash { 0% { transform: translateX(-140px); } 100% { transform: translateX(140px); } }
#taxiOverlay p { color: var(--cream); font-weight: 900; }

/* --- Interior rumah (DOM "dunia dalam") --- */
.room-scene { position: relative; border: 3px solid var(--ink); border-radius: 16px; overflow: hidden; margin-bottom: 12px; background: linear-gradient(#FFE8C7 0 62%, #E0A96D 62% 100%); min-height: 170px; }
.room-wall-decor { position: absolute; top: 14px; left: 0; right: 0; text-align: center; font-size: 1.6rem; letter-spacing: 10px; opacity: .9; }
.room-floor { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 0 12px; }
.room-furn { font-size: 1.7rem; background: rgba(255,255,255,.75); border: 2px solid var(--ink); border-radius: 10px; padding: 4px 7px; }
.room-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 900; color: rgba(43,33,24,.45); text-align: center; padding: 20px; }
.room-expanded-badge { position: absolute; top: 8px; right: 10px; background: var(--violet); color: #fff; font-size: .62rem; font-weight: 900; border-radius: 999px; padding: 3px 10px; border: 2px solid var(--ink); }

.type-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.type-card { border: 2.5px solid var(--ink); border-radius: 14px; padding: 10px 8px; text-align: center; cursor: pointer; background: #fff; }
.type-card.sel { background: #FFF3C4; box-shadow: inset 0 0 0 2.5px var(--ink); }
.type-card b { display: block; font-size: .85rem; } .type-card small { font-size: .68rem; font-weight: 800; color: var(--teal-deep); }

/* ============ RESPONSIF ============ */
@media (max-width: 1080px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-hero { order: 2; max-width: none; }
  .auth-illustration { display: none; }
  .auth-features { display: none; }
  .auth-card { order: 1; max-width: 520px; margin: 0 auto; width: 100%; }
}
@media (max-width: 860px) {
  .tb-brand { display: none; }
  .chip-clock { display: none; }
  .announce-bar { top: calc(max(10px, env(safe-area-inset-top)) + 112px); left: 12px; right: 12px; transform: none; max-width: none; white-space: normal; border-radius: 14px; }
  .hud-card { width: 158px; padding: 8px; }
    .hud-avatar { width: 42px; height: 42px; font-size: 1.4rem; }
  .hud-balance { font-size: .8rem; }
  #fabCol { right: 8px; bottom: 128px; }
  .fab { width: 54px; }
  .bn-item { min-width: 62px; padding: 6px 8px; }
  .tb-search { padding: 6px 12px; }
}
@media (max-width: 420px) {
  .tb-search input::placeholder { font-size: .78rem; }
  #topbar { gap: 6px; padding: 6px 8px; }
  .icon-btn { width: 34px; height: 34px; font-size: .9rem; }
}


/* ===== UI ringkas (v3) ===== */
.player-chip { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px 0 4px; border: 3px solid var(--ink); border-radius: 999px; background: var(--paper); cursor: pointer; font: inherit; font-weight: 900; color: var(--teal-deep); box-shadow: 2px 2px 0 var(--ink); }
.player-chip:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--ink); }
.pc-av { width: 28px; height: 28px; border-radius: 50%; background: var(--sun); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font-size: 1rem; line-height: 1; }
.pc-bal { font-size: .82rem; white-space: nowrap; }
.pc-caret { font-size: .6rem; opacity: .6; }
.drop { z-index: 30; }
.hud-card.drop { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 62px); right: 12px; left: auto; width: 240px; }
.hud-card.drop[hidden], .menu-drop[hidden] { display: none; }
.menu-drop { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 62px); right: 12px; display: flex; gap: 8px; padding: 8px; background: rgba(255,253,246,.96); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-soft); }
#fabWrap { position: absolute; right: 12px; bottom: 96px; z-index: 15; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#fabWrap #fabCol { position: static; display: flex; flex-direction: column; gap: 8px; }
#fabWrap #fabCol[hidden] { display: none; }
#fabWrap .fab { width: 58px; padding: 7px 3px; border-radius: 16px; }
#fabWrap .fab-ic { font-size: 1.25rem; }
#fabWrap .fab-label { font-size: .56rem; }
#fabWrap .fab.active { background: #b8f5c4; box-shadow: inset 0 0 0 3px #1c8a3a, var(--shadow); }
#fabMain { width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--ink); background: var(--sun); font-size: 1.7rem; font-weight: 900; line-height: 1; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s; }
#fabMain[aria-expanded="true"] { transform: rotate(45deg); background: var(--paper); }
#bottomNav { padding: 5px 6px; gap: 2px; border-radius: 18px; }
.bn-item { min-width: 58px; padding: 4px 10px; font-size: .62rem; border-radius: 13px; gap: 0; }
.bn-item span { font-size: 1.15rem; }
@media (max-width: 860px) {
  .pc-bal { font-size: .74rem; }
  .hud-card.drop { right: 8px; width: min(240px, calc(100vw - 16px)); }
  .menu-drop { right: 8px; }
  #fabWrap { right: 8px; bottom: 128px; }
  .bn-item { min-width: 52px; padding: 3px 7px; }
}

/* ============================================================
   v4 — Dunia dalam, aksi, dekorasi, shift kerja
   ============================================================ */
.hidden { display: none !important; }
.fade-ov { position: fixed; inset: 0; background: #14101f; opacity: 0; pointer-events: none; z-index: 90; transition: opacity .25s ease; }
.fade-ov.on { opacity: 1; pointer-events: auto; }

.act-btn { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 40; border: 3px solid var(--ink); background: var(--sun); color: var(--ink); font-weight: 900; font-size: .95rem; padding: 12px 20px; border-radius: 16px; box-shadow: var(--shadow); cursor: pointer; max-width: 92vw; animation: actPulse 1.4s ease-in-out infinite; }
@keyframes actPulse { 50% { transform: translateX(-50%) scale(1.04); } }
.leave-btn, .decor-btn { position: fixed; z-index: 41; top: calc(max(10px, env(safe-area-inset-top)) + 64px); border: 3px solid var(--ink); background: var(--paper); font-weight: 900; padding: 8px 14px; border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); cursor: pointer; font-size: .85rem; }
.leave-btn { left: 12px; background: #ffe0d6; }
.decor-btn { right: 12px; background: #d8f5df; }

.enter-card { position: fixed; z-index: 45; left: 50%; bottom: 110px; transform: translateX(-50%); width: min(340px, 92vw); background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 16px; }
.enter-card .ec-x { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 1.1rem; cursor: pointer; }
.ec-t { font-weight: 900; font-size: 1.05rem; padding-right: 22px; } .ec-s { font-size: .8rem; font-weight: 700; color: var(--ink-soft); margin: 3px 0; } .ec-d { font-size: .75rem; font-weight: 800; color: var(--teal-deep); } .ec-b { display: flex; gap: 8px; margin-top: 10px; } .ec-b .btn { flex: 1; padding: 9px 10px; }

/* dekorasi */
.decor-panel { position: fixed; z-index: 44; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 4px solid var(--ink); box-shadow: 0 -8px 24px rgba(43,33,24,.25); padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); max-height: 38vh; display: flex; flex-direction: column; }
.dp-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.dp-tabs { display: flex; gap: 4px; overflow-x: auto; } .dp-tabs button { border: 2.5px solid var(--ink); background: #fff; border-radius: 12px; padding: 6px 10px; font-weight: 900; font-size: .78rem; cursor: pointer; white-space: nowrap; } .dp-tabs button.active { background: var(--sun); }
.dp-body { overflow-y: auto; padding-top: 8px; }
.dp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.dp-item { display: flex; flex-direction: column; align-items: center; gap: 1px; border: 2.5px solid var(--ink); background: #fff; border-radius: 12px; padding: 6px 4px; cursor: pointer; font-weight: 800; }
.dp-item.sel { background: #d8f5df; box-shadow: 0 0 0 3px var(--leaf); } .dp-ic { font-size: 1.5rem; } .dp-n { font-size: .68rem; text-align: center; line-height: 1.1; } .dp-p { font-size: .68rem; color: var(--teal-deep); } .dp-s { font-size: .6rem; color: var(--ink-soft); }
.dp-sec { font-weight: 900; font-size: .8rem; margin: 6px 0; } .dp-sw { display: flex; gap: 6px; flex-wrap: wrap; } .dp-swb { width: 38px; height: 38px; border-radius: 10px; border: 3px solid var(--ink); cursor: pointer; } .dp-swb.sel { box-shadow: 0 0 0 3px var(--leaf); } .dp-fl { display: flex; gap: 6px; flex-wrap: wrap; }
.furn-card { position: fixed; z-index: 46; left: 50%; transform: translateX(-50%); top: calc(max(10px, env(safe-area-inset-top)) + 110px); background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow); padding: 8px 12px; text-align: center; font-size: .85rem; max-width: 94vw; }
.furn-card .fc-h { display: block; font-size: .7rem; color: var(--ink-soft); font-weight: 700; margin: 2px 0 6px; } .furn-card .btn { padding: 6px 8px; font-size: .78rem; margin: 0 2px; }

/* HUD shift kerja */
.job-hud { position: fixed; z-index: 42; left: 50%; transform: translateX(-50%); top: calc(max(10px, env(safe-area-inset-top)) + 104px); width: min(420px, 94vw); background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow); padding: 8px 12px; }
.jh-top { display: flex; align-items: center; gap: 8px; font-size: .85rem; } .jh-ic { font-size: 1.3rem; } .jh-cnt { margin-left: auto; font-weight: 900; } .jh-pay { font-weight: 900; color: var(--teal-deep); }
.jh-bar { height: 9px; border: 2px solid var(--ink); border-radius: 6px; background: #eee; margin: 5px 0; overflow: hidden; } .jh-bar i { display: block; height: 100%; background: var(--leaf); transition: width .3s; }
.jh-obj { font-size: .8rem; font-weight: 800; color: var(--ink); min-height: 1.1em; } .jh-btns { margin-top: 5px; text-align: right; } .jh-btns .btn { padding: 5px 10px; font-size: .75rem; }
.job-panel { position: fixed; z-index: 47; left: 50%; bottom: 104px; transform: translateX(-50%); width: min(520px, 96vw); background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); padding: 10px 12px; max-height: 60vh; overflow: auto; }
.pos-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; } .pos-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; } @media (max-width: 560px) { .pos-grid { grid-template-columns: 1fr; } }
.pos-t { font-size: .72rem; font-weight: 900; color: var(--ink-soft); margin: 4px 0; } .pos-it { display: flex; justify-content: space-between; width: 100%; border: 2.5px solid var(--ink); border-radius: 10px; padding: 7px 9px; margin-bottom: 4px; background: #fff; font-weight: 800; font-size: .82rem; cursor: pointer; } .pos-it.ok { background: #d8f5df; }
.pos-tot, .pos-pay, .pos-chg { font-weight: 800; font-size: .9rem; margin-bottom: 3px; } .pos-chg b { color: var(--coral-deep); } .pos-den { display: flex; flex-wrap: wrap; gap: 5px; } .pos-den .btn { padding: 6px 9px; } .pos-hint { font-weight: 700; color: var(--ink-soft); font-size: .82rem; }
.tp-text { background: #fff; border: 2.5px dashed var(--ink); border-radius: 10px; padding: 8px; font-weight: 800; margin: 6px 0; } .tp-in { width: 100%; border: 2.5px solid var(--ink); border-radius: 10px; padding: 8px; font: inherit; font-weight: 700; margin-bottom: 6px; }
.ex-box { background: #eef7fb; border: 2.5px solid var(--ink); border-radius: 10px; padding: 8px; font-size: .82rem; font-weight: 700; line-height: 1.5; margin-bottom: 6px; } .ex-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .ex-opts .btn { padding: 8px; font-size: .78rem; }
.slip { width: 100%; border-collapse: collapse; font-weight: 800; font-size: .88rem; text-align: left; } .slip td { border-bottom: 2px dashed #cdbfae; padding: 5px 4px; } .slip td:last-child { text-align: right; } .slip tr.tot td { border-bottom: 0; border-top: 3px solid var(--ink); font-size: 1.05rem; color: var(--teal-deep); }
@media (max-width: 760px) { .act-btn { bottom: 236px; } .enter-card { bottom: 232px; } .job-panel { bottom: 232px; } .decor-panel { max-height: 44vh; } }

/* --- v6.1: Chat multiplayer --- */
.chat-fab {
  position: absolute; right: 14px; bottom: 172px; z-index: 16;
  width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--ink);
  background: #ffe9a8; font-size: 1.15rem; cursor: pointer; box-shadow: var(--shadow-soft);
}
.chat-fab:active { transform: translate(1px, 1px); }
.chat-box {
  position: absolute; left: 50%; bottom: 86px; transform: translateX(-50%); z-index: 40;
  display: flex; gap: 8px; align-items: stretch; width: min(560px, 92vw);
  background: var(--paper); border: 3px solid var(--ink); border-radius: 16px;
  padding: 8px; box-shadow: var(--shadow);
}
.chat-box.hidden { display: none; }
.chat-box input {
  flex: 1; min-width: 0; border: 2.5px solid var(--ink-soft); border-radius: 10px;
  padding: 9px 12px; font: inherit; font-weight: 700; background: #fff;
}
.btn.btn-sm { padding: 8px 14px; font-size: .8rem; border-radius: 12px; }
/* tombol nav bawah: pastikan selalu bisa diklik/tap */
.bn-item span { pointer-events: none; }
