/* KONGLOMERAT — gaya visual: tinta uang kertas di atas kertas sekuriti */
:root {
  --ink: #0F3D3E;
  --ink-deep: #0A2B2C;
  --ink-soft: #1B5253;
  --ink-line: #2A6465;
  --paper: #F1F4EC;
  --paper-2: #E4EADC;
  --paper-3: #CBD5C1;
  --text: #132A2B;
  --muted: #5A6D6B;
  --on-ink: #E8F0EA;
  --on-ink-muted: #9DB9B4;
  --gold: #D9A21B;
  --gold-hi: #F0BE3A;
  --gold-deep: #8E6508;
  --up: #13894C;
  --down: #C62839;
  --focus: #F7B32B;
  --display: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
  --ui: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 6px 18px rgba(4, 24, 24, .28);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--ui); font-size: 15px; line-height: 1.45; color: var(--on-ink);
  background: var(--ink-deep);
  background-image: radial-gradient(ellipse at 50% -10%, #165152 0%, var(--ink) 45%, var(--ink-deep) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.num { font-family: var(--display); font-stretch: 108%; font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -0.01em; }
.up { color: var(--up); } .down { color: var(--down); }
.muted { color: var(--muted); }

/* ---------- tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--r-md); border: 1.5px solid transparent;
  background: var(--paper); color: var(--text); font-weight: 700; font-size: 15px; text-decoration: none;
  transition: transform .08s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #2A1E02; border-color: var(--gold-deep); box-shadow: 0 2px 0 var(--gold-deep); }
.btn.gold:active { box-shadow: 0 1px 0 var(--gold-deep); }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn.ink { background: var(--ink); color: var(--on-ink); border-color: var(--ink-deep); }
.btn.danger { background: var(--down); color: #fff; border-color: #8C1524; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13.5px; border-radius: 8px; }
.btn.xs { min-height: 28px; padding: 3px 9px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn.big { min-height: 54px; font-size: 17px; padding: 12px 26px; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

/* ---------- beranda ---------- */
#scr-home { max-width: 560px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top, 0px)) 18px calc(40px + var(--safe-b)); }
.hero { position: relative; text-align: center; padding: 34px 6px 26px; overflow: hidden; }
.hero .rosette { position: absolute; inset: -40px -80px; background-repeat: no-repeat; background-position: center; background-size: 520px; opacity: .55; pointer-events: none; }
.wordmark { position: relative; font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: clamp(34px, 10.5vw, 58px); line-height: .92; letter-spacing: -0.02em; margin: 0; color: var(--paper);
  text-shadow: 0 2px 0 var(--ink-deep), 0 0 26px rgba(217,162,27,.25); }
.wordmark span { display: block; font-size: .36em; font-stretch: 100%; font-weight: 600; letter-spacing: .02em; color: var(--gold-hi); margin-top: 10px; text-shadow: none; }
.tagline { position: relative; margin: 14px auto 0; max-width: 34ch; color: var(--on-ink-muted); font-size: 15.5px; }
.sheet { background: var(--paper); color: var(--text); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); margin-top: 14px; }
.sheet h2 { font-size: 17px; margin: 0 0 12px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.input { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-md); border: 1.5px solid var(--paper-3); background: #fff; color: var(--text); font-size: 16px; }
.input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(15,61,62,.15); }
.avatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.avatars button { aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--paper-3); background: #fff; font-size: 22px; display: grid; place-items: center; padding: 0; }
.avatars button[aria-pressed="true"] { border-color: var(--ink); background: var(--gold-hi); box-shadow: 0 0 0 3px rgba(217,162,27,.35); }
.join-row { display: flex; gap: 8px; }
.join-row .input { text-transform: uppercase; letter-spacing: .18em; font-family: var(--display); font-weight: 800; font-stretch: 115%; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--paper-3); }
.offline-note { font-size: 13.5px; color: var(--muted); background: var(--paper-2); border-radius: var(--r-md); padding: 10px 12px; margin: 0 0 12px; }
.room-list { list-style: none; margin: 0; padding: 0; }
.room-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--paper-2); }
.room-list li:first-child { border-top: 0; }
.room-code { font-family: var(--display); font-stretch: 118%; font-weight: 800; letter-spacing: .08em; font-size: 16px; }
.room-meta { flex: 1; font-size: 13px; color: var(--muted); }
.rules { margin: 0; padding-left: 20px; font-size: 14px; }
.rules li { margin-bottom: 8px; }
.home-foot { text-align: center; font-size: 12.5px; color: var(--on-ink-muted); margin-top: 22px; }
details.sheet summary { font-weight: 700; cursor: pointer; font-size: 16px; }
details.sheet[open] summary { margin-bottom: 12px; }

/* ---------- lobi ---------- */
#scr-lobby { max-width: 620px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top, 0px)) 18px calc(40px + var(--safe-b)); }
.lobby-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.code-card { text-align: center; padding: 22px 16px 18px; position: relative; overflow: hidden; }
.code-card .rosette { position: absolute; inset: -60px; background-size: 360px; background-position: center; background-repeat: no-repeat; opacity: .5; pointer-events: none; }
.code-big { position: relative; font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 52px; letter-spacing: .14em; line-height: 1; margin: 6px 0 14px; color: var(--ink); }
.code-label { position: relative; font-size: 13px; color: var(--muted); font-weight: 600; }
.share-row { position: relative; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.btn.wa { background: #1FA855; color: #fff; border-color: #157A3D; }
.seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.seat { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md); background: #fff; border: 1.5px solid var(--paper-3); min-height: 62px; }
.seat.empty { border-style: dashed; background: transparent; color: var(--muted); justify-content: center; font-size: 13px; }
.seat .nm { font-weight: 700; line-height: 1.2; }
.seat .tag { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.seat .x { margin-left: auto; border: 0; background: none; font-size: 18px; color: var(--muted); padding: 4px 6px; }
.disc { --c: var(--gold); width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; background: #fff; box-shadow: 0 0 0 3px var(--c), 0 2px 6px rgba(0,0,0,.2); }
.disc.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 16px; box-shadow: 0 0 0 2.5px var(--c); }
.disc.xs { width: 22px; height: 22px; flex-basis: 22px; font-size: 12px; box-shadow: 0 0 0 2px var(--c); }
.set-grid { display: grid; gap: 14px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 38px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--paper-3); background: #fff; font-weight: 600; font-size: 13.5px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.seg button:disabled { cursor: default; }
.seg button:disabled:not([aria-pressed="true"]) { opacity: .5; }
.set-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.wait { text-align: center; color: var(--muted); font-size: 14px; margin-top: 10px; }

/* ---------- permainan: tata letak ---------- */
#scr-game { min-height: 100dvh; }
.g-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; background: rgba(10, 43, 44, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ink-line); }
.g-top .brand { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 16px; letter-spacing: -0.01em; color: var(--paper); }
.g-top .meta { font-size: 12.5px; color: var(--on-ink-muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.g-top .meta b { color: var(--on-ink); font-weight: 700; }
.g-top .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.iconbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--ink-line); background: var(--ink); display: grid; place-items: center; font-size: 17px; padding: 0; }
.mycash { font-size: 15px; color: var(--gold-hi); white-space: nowrap; }
.g-top .meta span { white-space: nowrap; }
@media (max-width: 560px) { .g-top .brand { display: none; } .g-top { gap: 8px; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px; } }
.g-board-wrap { padding: 8px; display: flex; justify-content: center; }
.g-panel { background: var(--paper); color: var(--text); border-radius: var(--r-lg) var(--r-lg) 0 0; min-height: 50vh; padding-bottom: var(--safe-b); }
@media (min-width: 1000px) {
  #scr-game { display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; min-height: 0; }
  .g-top { grid-column: 1 / -1; position: relative; }
  .g-board-wrap { padding: 14px; align-items: center; min-height: 0; }
  .g-panel { border-radius: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--paper-3); }
  .tab-body { flex: 1; overflow: auto; }
}

/* ---------- papan ---------- */
.board {
  --g: 1.38fr;
  container-type: inline-size;
  position: relative; width: min(100%, 860px); aspect-ratio: 1;
  display: grid; grid-template-columns: var(--g) repeat(9, 1fr) var(--g); grid-template-rows: var(--g) repeat(9, 1fr) var(--g);
  gap: 1.5px; padding: 1.5px; background: #355F5B; border-radius: 12px;
  box-shadow: 0 0 0 4px var(--paper-2), 0 0 0 5px #8FA79D, 0 18px 40px rgba(0,0,0,.45);
}
@media (min-width: 1000px) { .board { width: min(100%, calc(100dvh - 90px)); } }
.tile {
  --sec: transparent; --owner: transparent;
  position: relative; display: flex; min-width: 0; min-height: 0; padding: 0; border: 0; overflow: hidden;
  background: var(--paper); color: var(--text); border-radius: 2px;
}
.tile:hover { background: #fff; }
.tile .band { position: absolute; background: var(--sec); display: flex; align-items: center; justify-content: center; gap: 1px; }
.tile .tb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2cqw; padding: .4cqw; min-width: 0; }
.tile .tt { display: flex; flex-direction: column; align-items: center; min-width: 0; max-width: 100%; }
.side-l .tb, .side-r .tb { gap: .1cqw; }
.side-l .ico, .side-r .ico { font-size: 2.5cqw; }
.side-l .tn, .side-r .tn { font-size: 1.2cqw; }
.side-l .tp, .side-r .tp { font-size: 1.12cqw; }
.tile.corner .tb { flex-direction: column; padding: .4cqw; }
.tile .ico { font-size: 3.3cqw; line-height: 1; }
.tile .tn { font-size: 1.32cqw; font-weight: 700; line-height: 1.08; text-align: center; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile .tp { font-family: var(--display); font-stretch: 105%; font-weight: 700; font-size: 1.25cqw; color: var(--muted); }
.tile .own { position: absolute; background: var(--owner); }
.tile .pips { display: flex; gap: .25cqw; }
.tile .pips i { width: .75cqw; height: .75cqw; border-radius: 50%; background: #fff; box-shadow: 0 0 0 .12cqw rgba(0,0,0,.25); }
.tile .pips i.max { width: 1.5cqw; border-radius: .4cqw; background: var(--gold-hi); }
.tile .trend { font-size: 1.1cqw; font-weight: 900; color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.6); }
.tile .fx { position: absolute; top: .3cqw; right: .3cqw; font-size: 1.6cqw; line-height: 1; }
/* sisi papan: pita sektor menghadap ke tengah, pita pemilik di tepi luar */
.side-b .band { left: 0; right: 0; top: 0; height: 22%; }
.side-b .tb { padding-top: 24%; }
.side-b .own { left: 8%; right: 8%; bottom: 0; height: 9%; border-radius: 3px 3px 0 0; }
.side-t .band { left: 0; right: 0; bottom: 0; height: 22%; }
.side-t .tb { padding-bottom: 24%; }
.side-t .own { left: 8%; right: 8%; top: 0; height: 9%; border-radius: 0 0 3px 3px; }
.side-l .band { top: 0; bottom: 0; right: 0; width: 22%; flex-direction: column; }
.side-l .tb { padding-right: 24%; }
.side-l .own { top: 8%; bottom: 8%; left: 0; width: 9%; border-radius: 0 3px 3px 0; }
.side-l .pips { flex-direction: column; }
.side-r .band { top: 0; bottom: 0; left: 0; width: 22%; flex-direction: column; }
.side-r .tb { padding-left: 24%; }
.side-r .own { top: 8%; bottom: 8%; right: 0; width: 9%; border-radius: 3px 0 0 3px; }
.side-r .pips { flex-direction: column; }
.tile.owned { box-shadow: inset 0 0 0 .3cqw color-mix(in srgb, var(--owner) 55%, transparent); }
.tile.mortgaged .tb { opacity: .45; }
.tile.mortgaged::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, transparent 0 4px, rgba(19,42,43,.16) 4px 6px); pointer-events: none; }
.tile.t-peluang { background: #F6EED4; }
.tile.t-risiko { background: #F4DEDC; }
.tile.t-tax { background: #E7E3EF; }
.tile.corner { background: var(--paper-2); }
.tile.corner .ico { font-size: 5cqw; }
.tile.corner .tn { font-size: 1.45cqw; -webkit-line-clamp: 2; }
.tile.corner .tt { align-items: center; }
.tile.pulse { animation: pulse .9s ease-out 1; }
@keyframes pulse { 0% { box-shadow: inset 0 0 0 0 var(--gold-hi); } 40% { box-shadow: inset 0 0 0 1cqw var(--gold-hi); } 100% { box-shadow: inset 0 0 0 0 transparent; } }
.tile.here { background: #FFFDF4; }
@container (max-width: 600px) {
  .tile .tn, .tile .tp { display: none; }
  .tile.corner .tn { display: -webkit-box; font-size: 2cqw; }
  .side-l .ico, .side-r .ico { font-size: 4.4cqw; }
  .c-feed { display: none; }
  .tile .ico { font-size: 4.4cqw; }
  .tile.corner .ico { font-size: 6cqw; }
  .tile .pips i { width: 1.1cqw; height: 1.1cqw; }
  .tile .pips i.max { width: 2cqw; }
  .tile .trend { font-size: 1.8cqw; }
  .tile .fx { font-size: 2.4cqw; }
}

/* ---------- token pemain ---------- */
.tokens { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.token {
  --c: #fff; position: absolute; left: 0; top: 0; width: 4.6cqw; height: 4.6cqw; margin: -2.3cqw 0 0 -2.3cqw;
  border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 2.7cqw; line-height: 1;
  box-shadow: 0 0 0 .45cqw var(--c), 0 .5cqw 1cqw rgba(0,0,0,.4);
  transition: transform .17s cubic-bezier(.3,.7,.4,1.4);
}
.token.active { z-index: 2; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -.6cqw; } }
.token.jump { transition: transform .45s ease-in-out; }
@container (max-width: 600px) { .token { width: 6.2cqw; height: 6.2cqw; margin: -3.1cqw 0 0 -3.1cqw; font-size: 3.6cqw; } }
.floaty { position: absolute; z-index: 8; pointer-events: none; font-family: var(--display); font-weight: 800; font-stretch: 110%; font-size: max(12px, 2cqw); padding: 2px 7px; border-radius: 999px; white-space: nowrap; transform: translate(-50%, -50%); animation: floaty 1.6s ease-out forwards; }
.floaty.pos { background: var(--up); color: #fff; }
.floaty.neg { background: var(--down); color: #fff; }
@keyframes floaty { 0% { opacity: 0; translate: 0 0; } 12% { opacity: 1; } 100% { opacity: 0; translate: 0 -7cqw; } }

/* ---------- tengah papan ---------- */
.center {
  grid-row: 2 / 11; grid-column: 2 / 11; position: relative; overflow: hidden;
  background-color: var(--paper); background-repeat: no-repeat; background-position: center; background-size: 92%;
  border-radius: 3px; color: var(--text);
  display: flex; flex-direction: column; padding: 2.2cqw 2.6cqw; gap: 1.4cqw; min-height: 0;
}
.center .wm { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-28deg); font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 9.6cqw; color: rgba(15, 61, 62, .055); white-space: nowrap; pointer-events: none; letter-spacing: -0.02em; }
.c-top { position: relative; display: flex; flex-wrap: wrap; gap: .8cqw; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: .45cqw 1.1cqw; border-radius: 999px; font-size: max(11px, 1.55cqw); font-weight: 700; background: var(--paper-2); color: var(--text); white-space: nowrap; }
.chip.tone-up { background: #D3EEDD; color: #0B5B32; }
.chip.tone-down { background: #F6D6D9; color: #8C1524; }
.chip.tone-flat { background: #E0E6EE; color: #2A3B55; }
.chip.ink { background: var(--ink); color: var(--on-ink); }
.c-news { position: relative; font-size: max(11.5px, 1.65cqw); line-height: 1.3; color: var(--text); font-weight: 600; min-height: 2.6em; }
.c-news span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-news span + span { color: var(--muted); font-weight: 500; }
.c-mid { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6cqw; min-height: 0; text-align: center; }
.turnline { display: flex; align-items: center; gap: 1.2cqw; font-size: max(13px, 2.1cqw); font-weight: 700; }
.turnline .st { display: block; font-size: max(11.5px, 1.6cqw); font-weight: 500; color: var(--muted); }
.tbar { width: min(70%, 320px); height: 5px; background: var(--paper-3); border-radius: 99px; overflow: hidden; }
.tbar i { display: block; height: 100%; width: 100%; background: var(--ink); border-radius: 99px; transition: width .25s linear; }
.tbar.low i { background: var(--down); }
.dice { display: flex; gap: 2cqw; }
.die { width: 8.4cqw; height: 8.4cqw; min-width: 40px; min-height: 40px; border-radius: 18%; background: #fff; box-shadow: 0 .35cqw 0 #B9C6B3, 0 .6cqw 1.4cqw rgba(0,0,0,.2); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 14%; }
.die i { width: 72%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); place-self: center; visibility: hidden; }
.die i.on { visibility: visible; }
.die.red i { background: var(--down); }
.die.roll { animation: roll .6s cubic-bezier(.2,.8,.3,1); }
@keyframes roll { 0% { transform: rotate(0) scale(1); } 30% { transform: rotate(160deg) scale(1.12) translateY(-10%); } 60% { transform: rotate(300deg) scale(.95); } 100% { transform: rotate(360deg) scale(1); } }
.c-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.c-actions .btn.big { min-width: 60%; }
.c-hint { font-size: max(11.5px, 1.55cqw); color: var(--muted); max-width: 46ch; }
.c-feed { position: relative; list-style: none; margin: 0; padding: 0; font-size: max(11px, 1.42cqw); color: var(--muted); }
.c-feed li { padding: .35cqw 0 .35cqw 1cqw; border-left: 3px solid var(--paper-3); margin-top: .4cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(241,244,236,.85); }
.c-feed li.good { border-color: var(--up); } .c-feed li.bad { border-color: var(--down); } .c-feed li.build { border-color: var(--gold); } .c-feed li.rent { border-color: #8F5CF7; } .c-feed li.news { border-color: #3D8BFD; } .c-feed li.trade { border-color: #2EC4B6; }
.c-foot { position: relative; display: flex; justify-content: space-between; gap: 8px; font-size: max(11px, 1.5cqw); color: var(--muted); font-weight: 600; }
@container (max-width: 600px) {
  .center { padding: 2.6cqw 3cqw; gap: 1.8cqw; }
  .c-news { font-size: 11.5px; min-height: 0; }
  .c-news span + span { display: none; }
  .c-actions .btn.big { min-height: 46px; font-size: 15.5px; padding: 8px 16px; }
  .c-actions .btn { min-height: 38px; padding: 6px 12px; font-size: 13.5px; }
  .die { width: 11cqw; height: 11cqw; }
  .c-hint { display: none; }
}

/* ---------- panel & tab ---------- */
.tabs { display: flex; gap: 2px; padding: 8px 8px 0; position: sticky; top: 55px; z-index: 20; background: var(--paper); border-radius: var(--r-lg) var(--r-lg) 0 0; overflow-x: auto; scrollbar-width: none; }
@media (min-width: 1000px) { .tabs { position: static; border-radius: 0; } }
.tabs button { flex: 1; min-height: 42px; border: 0; background: none; font-weight: 700; font-size: 13.5px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; padding: 6px 8px; position: relative; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--gold); }
.tabs .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--down); }
.tab-body { padding: 12px 14px 20px; }
.sec-title { font-size: 13px; font-weight: 800; color: var(--muted); margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
.sec-title:first-child { margin-top: 2px; }
.prow { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-md); border: 1.5px solid transparent; width: 100%; background: none; text-align: left; color: inherit; }
.prow + .prow { margin-top: 4px; }
.prow:hover { background: var(--paper-2); }
.prow.turn { border-color: var(--gold); background: #FBF3DA; }
.prow.out { opacity: .5; }
.prow .who { flex: 1; min-width: 0; }
.prow .nm { font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--paper-2); color: var(--muted); }
.badge.gold { background: #F6E6B4; color: #6B4C05; }
.badge.red { background: #F6D6D9; color: #8C1524; }
.badge.green { background: #D3EEDD; color: #0B5B32; }
.prow .sub { font-size: 12.5px; color: var(--muted); }
.prow .cash { text-align: right; font-size: 15px; }
.prow .cash small { display: block; font-family: var(--ui); font-weight: 600; font-size: 11.5px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.kpi { background: #fff; border: 1.5px solid var(--paper-2); border-radius: var(--r-md); padding: 10px 12px; }
.kpi label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.kpi .num { font-size: 18px; }
.kpi.wide { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.biz-group { border-radius: var(--r-md); background: #fff; border: 1.5px solid var(--paper-2); overflow: hidden; margin-bottom: 10px; }
.biz-group header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-weight: 800; font-size: 13px; border-left: 6px solid var(--sec); background: var(--paper-2); }
.biz-group header .badge { margin-left: auto; }
.biz { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; border-top: 1px solid var(--paper-2); }
.biz .ic { font-size: 22px; width: 30px; text-align: center; }
.biz .info { flex: 1; min-width: 0; }
.biz .info b { display: block; font-size: 14px; }
.biz .info span { font-size: 12.5px; color: var(--muted); }
.biz .acts { display: flex; gap: 5px; flex-wrap: wrap; width: 100%; padding-left: 40px; }
.lvl { display: inline-flex; gap: 2px; vertical-align: middle; margin-left: 4px; }
.lvl i { width: 7px; height: 7px; border-radius: 50%; background: var(--paper-3); }
.lvl i.on { background: var(--gold); }
.empty { text-align: center; color: var(--muted); padding: 22px 10px; font-size: 14px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; background: #fff; border: 1.5px solid var(--paper-2); border-radius: var(--r-md); }
.switch input { width: 46px; height: 26px; appearance: none; background: var(--paper-3); border-radius: 99px; position: relative; cursor: pointer; flex: 0 0 auto; transition: background .2s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked { background: var(--up); }
.switch input:checked::after { transform: translateX(20px); }
.cycle { display: flex; gap: 2px; margin-top: 6px; }
.cycle i { flex: 1; height: 14px; border-radius: 2px; }
.pl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pl td { padding: 5px 0; border-bottom: 1px dashed var(--paper-3); }
.pl td:last-child { text-align: right; font-family: var(--display); font-weight: 700; font-stretch: 105%; font-variant-numeric: tabular-nums; }
.pl tr.head td { font-weight: 800; color: var(--muted); font-size: 12px; border-bottom: 0; padding-top: 12px; font-family: var(--ui); text-align: left; }
.pl tr.total td { border-bottom: 0; border-top: 2px solid var(--text); font-weight: 800; font-size: 15px; padding-top: 8px; }
.log { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.log li { padding: 7px 0 7px 10px; border-left: 3px solid var(--paper-3); margin-bottom: 4px; }
.log li.good { border-color: var(--up); } .log li.bad { border-color: var(--down); }
.log li.news { border-color: #3D8BFD; background: #EEF4FF; padding-right: 6px; }
.log li.build { border-color: var(--gold); } .log li.rent { border-color: #8F5CF7; } .log li.bank, .log li.tax { border-color: #6B7C7A; }
.log li.trade { border-color: #2EC4B6; }
.log .r { font-size: 11px; color: var(--muted); font-weight: 700; margin-right: 6px; }
.chat-list { display: flex; flex-direction: column; gap: 8px; }
.msg { display: flex; gap: 8px; align-items: flex-start; }
.msg .bubble { background: #fff; border: 1.5px solid var(--paper-2); border-radius: 4px 12px 12px 12px; padding: 7px 11px; font-size: 14px; max-width: 85%; word-wrap: break-word; }
.msg .bubble b { display: block; font-size: 12px; }
.msg.me { flex-direction: row-reverse; }
.msg.me .bubble { background: #FBF3DA; border-radius: 12px 4px 12px 12px; }
.chat-box { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--paper-3); padding: 8px 10px calc(8px + var(--safe-b)); }
.chat-box form { display: flex; gap: 6px; }
.chat-box .input { min-height: 40px; font-size: 15px; }
.chat-quick { display: flex; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; }
.chat-quick button { border: 1.5px solid var(--paper-3); background: #fff; border-radius: 99px; padding: 3px 10px; font-size: 13px; }

/* ---------- modal ---------- */
#modals { position: relative; z-index: 60; }
.modal-back { position: fixed; inset: 0; background: rgba(5, 22, 22, .55); display: flex; align-items: flex-end; justify-content: center; padding: 10px; animation: fade .18s ease-out; }
@media (min-width: 700px) { .modal-back { align-items: center; } }
@keyframes fade { from { opacity: 0; } }
.modal-back[data-key="confirm"] { z-index: 3; }
.modal-back[data-key="closing"], .modal-back[data-key="mycard"], .modal-back[data-key="tile"], .modal-back[data-key="player"], .modal-back[data-key="trade"], .modal-back[data-key="menu"], .modal-back[data-key="rules"] { z-index: 2; }
.modal { width: min(100%, 460px); max-height: calc(100dvh - 20px); overflow: auto; background: var(--paper); color: var(--text); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.45); animation: rise .22s cubic-bezier(.2,.8,.3,1); position: relative; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.modal.wide { width: min(100%, 620px); }
.m-pad { padding: 18px; }
.m-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 0; }
.m-head h3 { margin: 0; font-size: 19px; line-height: 1.25; flex: 1; }
.m-head .sub { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.m-close { margin: -4px -6px 0 0; border: 0; background: var(--paper-2); width: 34px; height: 34px; border-radius: 50%; font-size: 16px; flex: 0 0 auto; }
.m-actions { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 18px; }
.m-actions .row { display: flex; gap: 8px; }
.m-actions .row > * { flex: 1; }
.minimize { display: block; margin: 0 auto 14px; font-size: 13.5px; color: var(--muted); }
.bizcard { margin: 14px 18px; border-radius: 14px; overflow: hidden; background: #fff; border: 1.5px solid var(--paper-3); }
.bizcard .top { background: var(--sec); color: #fff; padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.bizcard .top .bi { font-size: 34px; background: rgba(255,255,255,.95); width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; }
.bizcard .top b { font-size: 18px; display: block; line-height: 1.2; }
.bizcard .top span { font-size: 13px; opacity: .92; font-weight: 600; }
.bizcard .price { margin-left: auto; text-align: right; font-size: 20px; }
.bizcard .price small { display: block; font-family: var(--ui); font-size: 11px; font-weight: 600; opacity: .9; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--paper-2); }
.facts div { background: #fff; padding: 9px 14px; }
.facts label { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.facts .num { font-size: 15.5px; }
.rent-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rent-table td { padding: 6px 14px; border-top: 1px solid var(--paper-2); }
.rent-table td:last-child { text-align: right; font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.rent-table tr.on td { background: #FBF3DA; font-weight: 800; }
.note { margin: 0 18px 14px; font-size: 13px; color: var(--muted); }
.warn { margin: 0 18px 14px; font-size: 13.5px; background: #F6D6D9; color: #6E101D; padding: 9px 12px; border-radius: 10px; font-weight: 600; }
/* kartu peluang & risiko */
.pcard { --deck: var(--gold); margin: 16px 18px; border-radius: 16px; background: #FFFDF6; border: 2px solid var(--deck); position: relative; overflow: hidden; }
.pcard.risiko { --deck: var(--down); background: #FFF8F7; }
.pcard .deck { background: var(--deck); color: #fff; padding: 7px 14px; font-size: 13px; font-weight: 800; display: flex; justify-content: space-between; }
.pcard.peluang .deck { color: #2A1E02; }
.pcard .body { padding: 14px 16px 16px; position: relative; }
.pcard h4 { margin: 0 0 8px; font-size: 19px; line-height: 1.25; font-family: var(--display); font-stretch: 104%; font-weight: 800; }
.pcard p { margin: 0; font-size: 14.5px; }
.pcard .lesson { margin-top: 12px; padding: 9px 12px; background: rgba(15,61,62,.06); border-radius: 10px; font-size: 13.5px; color: #234546; }
.pcard .lesson b { display: block; font-size: 12px; color: var(--ink); }
.pcard .outcome { margin-top: 10px; font-weight: 700; font-size: 14px; }
.pcard.flip { animation: flip .5s cubic-bezier(.2,.8,.3,1); }
@keyframes flip { from { transform: perspective(800px) rotateY(80deg); opacity: 0; } }
.opt { text-align: left; justify-content: flex-start; line-height: 1.3; }
/* tender */
.tender-high { text-align: center; padding: 6px 18px 10px; }
.tender-high .num { font-size: 34px; display: block; color: var(--ink); }
.tender-high .who { font-size: 14px; color: var(--muted); font-weight: 600; }
.tbar.big { width: auto; margin: 0 18px 14px; height: 8px; }
/* negosiasi */
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 18px; }
@media (max-width: 480px) { .trade-cols { grid-template-columns: 1fr; } }
.trade-col h4 { margin: 8px 0 6px; font-size: 13.5px; }
.pick { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 9px; border: 1.5px solid var(--paper-3); background: #fff; margin-bottom: 5px; font-size: 13.5px; cursor: pointer; }
.pick input { width: 18px; height: 18px; accent-color: var(--ink); }
.pick .sw { width: 10px; height: 26px; border-radius: 3px; background: var(--sec); flex: 0 0 auto; }
.pick small { color: var(--muted); display: block; font-size: 11.5px; }
.cash-in { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.cash-in .input { min-height: 40px; }
.tsum { margin: 10px 18px; padding: 10px 12px; background: var(--paper-2); border-radius: 10px; font-size: 13.5px; }
.tsum ul { margin: 4px 0 0; padding-left: 18px; }
/* hasil akhir */
.podium { list-style: none; margin: 0; padding: 0 18px; }
.podium li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: #fff; border: 1.5px solid var(--paper-2); margin-bottom: 8px; }
.podium li.first { border-color: var(--gold); background: linear-gradient(180deg, #FFF6D9, #fff); }
.podium .rk { font-family: var(--display); font-weight: 900; font-stretch: 120%; font-size: 22px; width: 28px; text-align: center; color: var(--muted); }
.podium li.first .rk { color: var(--gold-deep); }
.podium .who { flex: 1; min-width: 0; }
.podium .who b { display: block; }
.podium .who span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.crown { text-align: center; padding: 20px 18px 6px; position: relative; overflow: hidden; }
.crown .rosette { position: absolute; inset: -80px; background-size: 380px; background-position: center; background-repeat: no-repeat; opacity: .6; pointer-events: none; }
.crown h3 { position: relative; margin: 8px 0 2px; font-family: var(--display); font-stretch: 120%; font-weight: 900; font-size: 26px; }
.crown p { position: relative; margin: 0; color: var(--muted); }
.crown .disc { margin: 0 auto; width: 64px; height: 64px; font-size: 34px; position: relative; }

/* ---------- toast ---------- */
#toasts { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 6px; width: min(94vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; background: var(--paper); color: var(--text); border-radius: 12px; padding: 10px 10px 10px 14px; box-shadow: 0 10px 28px rgba(0,0,0,.35); border-left: 5px solid var(--ink); font-size: 14px; animation: tin .25s cubic-bezier(.2,.8,.3,1); touch-action: pan-y; transition: transform .2s, opacity .2s; }
.toast.good { border-left-color: var(--up); } .toast.bad { border-left-color: var(--down); } .toast.gold { border-left-color: var(--gold); } .toast.news { border-left-color: #3D8BFD; }
.toast .tx { flex: 1; }
.toast .tx b { display: block; }
.toast .x { border: 0; background: none; font-size: 15px; color: var(--muted); padding: 2px 6px; }
@media (min-width: 1000px) { #toasts { left: calc((100vw - 400px) / 2); top: 66px; } }
@keyframes tin { from { transform: translateY(-12px); opacity: 0; } }
#conn { position: fixed; bottom: calc(14px + var(--safe-b)); left: 50%; transform: translateX(-50%); z-index: 90; background: var(--down); color: #fff; font-weight: 700; font-size: 13.5px; padding: 8px 16px; border-radius: 99px; box-shadow: 0 6px 18px rgba(0,0,0,.3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
