/* Minimal UI theme — flat white surfaces, hairline borders, small radii, one accent.
   Loaded last; restyles everything outside the 3D board. Positions stay in style.css. */
:root {
  --m-ink: #0f172a; --m-ink-2: #334155; --m-muted: #64748b;
  --m-line: #e2e8f0; --m-line-2: #cbd5e1; --m-surface: #ffffff; --m-subtle: #f8fafc;
  --m-accent: #2563eb; --m-pos: #16a34a; --m-neg: #dc2626; --m-gold: #ca8a04;
  --m-r-sm: 4px; --m-r: 6px; --m-r-lg: 10px;
  --m-shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.08);
  --m-shadow-lg: 0 20px 48px rgba(15,23,42,.22);
  --m-font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
/* No green flash from the old theme while the page or the 3D board loads. */
html, body { background: #f1f5f9; }
body { font-family: var(--m-font); }
#game { background: linear-gradient(180deg, #6fd6ff, #3f9cf5 55%, #2d6fd8); }

/* ---------- buttons ---------- */
.btn, .btn.big, #actionbar .btn, .modal .btn {
  --b-bg: var(--m-ink); --b-fg: #fff; --b-line: var(--m-ink);
  min-height: 44px; padding: 10px 16px; border: 1px solid var(--b-line); border-radius: var(--m-r);
  background: var(--b-bg); color: var(--b-fg); box-shadow: none; text-shadow: none; animation: none;
  font-family: var(--m-font); font-weight: 600; font-size: 14px; letter-spacing: 0; transition: background .12s, opacity .12s, transform .06s;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; filter: none; }
.btn-pink { --b-bg: var(--m-ink); --b-line: var(--m-ink); }
.btn-green { --b-bg: var(--m-pos); --b-line: var(--m-pos); }
.btn-red { --b-bg: var(--m-neg); --b-line: var(--m-neg); }
.btn-blue { --b-bg: var(--m-accent); --b-line: var(--m-accent); }
.btn-ghost, #actionbar .btn-ghost, .modal .btn-ghost { --b-bg: var(--m-surface); --b-fg: var(--m-ink); --b-line: var(--m-line-2); }
.btn-ghost:hover:not(:disabled) { filter: none; background: var(--m-subtle); }
.btn b { font-weight: 700; }
.btn-link { color: var(--m-muted); font-family: var(--m-font); font-weight: 500; font-size: 13px; text-shadow: none; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- lobby ---------- */
.lobby-bg { background: radial-gradient(circle, #cbd5e1 1px, transparent 1.2px) 0 0 / 22px 22px, #f1f5f9; }
.floaters { display: none; }
.lobby-card { border: 1px solid var(--m-line); border-radius: var(--m-r-lg); background: var(--m-surface); box-shadow: var(--m-shadow-lg); }
.lobby-logo { margin-bottom: 22px; }
.lobby-logo h1 { font-family: var(--m-font); font-weight: 800; }
.lobby-logo h1 span {
  padding: 0; border: 0; outline: 0; border-radius: 0; background: none; box-shadow: none; transform: none;
  color: var(--m-ink); letter-spacing: -1.5px; text-shadow: none;
}
.lobby-logo h1 span::after { content: '.'; color: #e11d48; }
.lobby-logo h1 em { margin-top: 10px; color: var(--m-muted); font-family: var(--m-font); font-weight: 600; font-size: 11px; letter-spacing: 2.5px; }
.tagline { color: var(--m-muted); font-weight: 400; }
.edition-picker { gap: 12px; }
.edition-option, .edition-option.world {
  padding: 22px 12px 18px; border: 1px solid var(--m-line); border-radius: var(--m-r-lg); background: var(--m-surface);
  color: var(--m-ink); box-shadow: none; gap: 10px; transition: border-color .12s, transform .12s;
}
.edition-option::before { height: 3px; border: 0; border-radius: var(--m-r-lg) var(--m-r-lg) 0 0; background: #e11d48; }
.edition-option.world::before { background: var(--m-accent); }
.edition-option:hover { transform: none; border-color: var(--m-ink); box-shadow: var(--m-shadow); }
.edition-option strong { font-family: var(--m-font); font-weight: 700; font-size: 16px; letter-spacing: -.2px; }
.edition-option > span:last-child { color: var(--m-muted); font-size: 12px; }
.edition-globe { color: var(--m-accent); }
.home-join { border-top: 1px solid var(--m-line); }
.home-join-lbl { color: var(--m-ink-2); font-family: var(--m-font); font-weight: 600; font-size: 13px; }
.lbl { font-family: var(--m-font); font-weight: 600; font-size: 11px; letter-spacing: 1px; color: var(--m-muted); }
.inp, .home-join .inp.code {
  min-height: 44px; border: 1px solid var(--m-line-2); border-radius: var(--m-r); background: var(--m-surface);
  color: var(--m-ink); font-family: var(--m-font); font-weight: 500; font-size: 15px; box-shadow: none;
}
.home-join .inp.code { font-weight: 700; letter-spacing: 6px; }
.inp:focus { border-color: var(--m-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); outline: none; transform: none; }
.join-target { border: 1px solid var(--m-line); border-radius: var(--m-r); background: var(--m-subtle); box-shadow: none; color: var(--m-ink-2); font-family: var(--m-font); font-weight: 500; }
.join-target b { color: var(--m-ink); font-family: var(--m-font); font-weight: 800; letter-spacing: 4px; }
.avatar-stage { border-radius: var(--m-r-lg); background: var(--m-subtle); box-shadow: none; border: 1px solid var(--m-line); }
#avatar-preview-name { font-family: var(--m-font); font-weight: 700; color: var(--m-ink); letter-spacing: 0; font-size: 14px; }
.avatar-opt, .setup-card .avatar-opt { border: 1px solid var(--m-line); border-radius: var(--m-r); background: var(--m-surface); box-shadow: none; transition: border-color .12s; }
.avatar-opt:hover { transform: none; border-color: var(--m-line-2); }
.avatar-opt.sel { border: 2px solid var(--m-ink); background: var(--m-subtle); box-shadow: none; transform: none; }
.color-opt { border: 2px solid #fff; box-shadow: 0 0 0 1px var(--m-line-2); }
.color-opt.sel { box-shadow: 0 0 0 2px var(--m-ink); transform: none; }

/* ---------- waiting room ---------- */
.wr-title { font-family: var(--m-font); font-weight: 600; font-size: 12px; color: var(--m-muted); letter-spacing: 2px; text-transform: uppercase; }
.wr-code { margin: 4px auto; padding: 0; border-radius: 0; background: none; box-shadow: none; color: var(--m-ink); font-family: var(--m-font); font-weight: 800; letter-spacing: 10px; }
.wr-edition { color: var(--m-muted); font-weight: 500; }
.wr-players { gap: 0; border: 1px solid var(--m-line); border-radius: var(--m-r); overflow: hidden; }
.wr-player { border: 0; border-bottom: 1px solid var(--m-line); border-radius: 0; background: var(--m-surface); box-shadow: none; font-family: var(--m-font); font-weight: 600; font-size: 15px; color: var(--m-ink); }
.wr-player:last-child { border-bottom: 0; }
#wr-mode { min-height: 40px; border: 1px solid var(--m-line-2); border-radius: var(--m-r); background: var(--m-surface); font-family: var(--m-font); font-weight: 500; color: var(--m-ink); padding: 6px 10px; }
#waitroom #btn-start { font-size: 15px; }
#wr-team-colors { display: grid; gap: 8px; margin: 10px 0 4px; }
#wr-team-colors[hidden] { display: none; }
.team-color-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.team-color-row > span { font-size: 13px; font-weight: 600; color: var(--m-ink-2); white-space: nowrap; }
.team-color-row > div { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.team-color { width: 24px; height: 24px; border: 2px solid #fff; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px var(--m-line-2); cursor: pointer; }
.team-color.sel { box-shadow: 0 0 0 2px var(--m-ink); }
.team-color:disabled { opacity: .25; cursor: not-allowed; }
.team-color.sel:disabled { opacity: 1; }

/* ---------- game HUD ---------- */
#game { font-family: var(--m-font); }
#game .tb-btn {
  width: 40px; height: 40px; border: 1px solid var(--m-line); border-radius: var(--m-r); background: var(--m-surface);
  color: var(--m-ink); box-shadow: var(--m-shadow); transition: background .12s;
}
#game .tb-btn:hover { transform: none; background: var(--m-subtle); }
#game .tb-btn.trade-open { width: auto; padding: 0 12px; gap: 6px; }
#game .trade-open .fi { color: var(--m-gold); }
#game .tb-btn.trade-open span { font-weight: 600; font-size: 12px; }
/* The menu opens over every HUD panel (player strip, status, toasts). */
#topbar { z-index: 30; }
#settings-menu:not([hidden]) { z-index: 31; min-width: 190px; }
#game #settings-menu .tb-btn { width: 100%; justify-content: flex-start; white-space: nowrap; }
#settings-menu:not([hidden]) { border: 1px solid var(--m-line); border-radius: var(--m-r-lg); background: var(--m-surface); box-shadow: var(--m-shadow); }
#game #settings-menu .tb-btn { box-shadow: none; border: 0; background: transparent; }
.tb-logo { border: 0; border-radius: var(--m-r); background: var(--m-ink); color: #fff; box-shadow: none; font-family: var(--m-font); }

.me-profile { border: 1px solid var(--m-line); border-radius: var(--m-r-lg); background: var(--m-surface); box-shadow: var(--m-shadow); gap: 10px; padding: 8px 12px; }
.me-profile::before { display: none; }
.me-profile small { color: var(--m-muted); font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.me-avatar { border: 0; border-radius: var(--m-r); color: #fff; font-weight: 700; font-size: 12px; box-shadow: none; text-shadow: none; }
.me-money { display: block; margin: 0; padding: 0; border-radius: 0; background: none; box-shadow: none; color: var(--m-ink); font-family: var(--m-font); font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.me-money > .fi { display: none; }
.victory-meter { color: var(--m-ink); border-left: 1px solid var(--m-line); gap: 4px; }
.victory-meter > small { color: var(--m-muted); font-weight: 500; font-size: 9px; }
.lm-label { font-size: 9px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--m-muted); }
.lm-pips { display: flex; gap: 3px; }
.lm-pips i:not(.fi) { width: 8px; height: 8px; border-radius: 50%; background: var(--m-line); clip-path: none; filter: none; transform: none; border: 0; }
.lm-pips i.on:not(.fi) { background: var(--m-gold); }

.wchip, .wchip.bank, .wchip.sell-card {
  min-height: 24px; padding: 2px 8px; border: 1px solid var(--m-line); border-radius: var(--m-r-sm); background: var(--m-surface);
  color: var(--m-ink-2); box-shadow: none; font-weight: 600; font-size: 11px;
}
.wchip .fi, .wchip.bank .fi { display: inline; width: auto; height: auto; border-radius: 0; background: none; color: var(--m-muted) !important; font-size: 12px !important; }
.wchip.sell-card { background: var(--m-ink); border-color: var(--m-ink); color: #fff; }
.wchip.fee-due { border-color: #fecaca; background: #fef2f2; color: var(--m-neg); }
.wchip.fee-due .fi { background: none; color: var(--m-neg) !important; }

.pchip { width: 18px; height: 18px; flex: 0 0 18px; border: 0; border-radius: var(--m-r-sm); color: #fff; box-shadow: none; }
.pchip::before { display: none; }
.pchip .fi { font-size: 10px !important; }
.pchip.lm { box-shadow: 0 0 0 2px var(--m-gold); }
.pchip.m { opacity: .35; filter: grayscale(.6); }

.me-turn, .me-turn.me { border: 1px solid var(--m-line); border-radius: var(--m-r); background: var(--m-surface); color: var(--m-ink-2); box-shadow: none; font-weight: 500; animation: none; }
.me-turn.me { background: var(--m-ink); border-color: var(--m-ink); color: #fff; }
.me-turn.me b { color: #fff; }

#owner-legend { gap: 0; border: 1px solid var(--m-line); border-radius: var(--m-r-lg); background: var(--m-surface); box-shadow: var(--m-shadow); overflow: hidden; }
.owner-legend-row, .owner-legend-row.current {
  position: relative; border: 0; border-bottom: 1px solid var(--m-line); border-radius: 0; background: transparent; box-shadow: none; padding: 7px 10px;
}
.owner-legend-row:last-child { border-bottom: 0; }
.owner-legend-row.current { background: var(--m-subtle); }
.owner-legend-row.current::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--player-color); border: 0; transform: none; }
.owner-legend-row b { color: var(--m-ink); font-weight: 600; }
.owner-legend-row small { color: var(--m-muted); font-weight: 400; }
.owner-id, .team-owner-id { border: 0; border-radius: var(--m-r-sm); color: #fff; font-weight: 700; box-shadow: none; text-shadow: none; }
.turn-light { display: none; }
.legend-turn { background: none; color: var(--m-ink); padding: 0; font-weight: 700; }
.owner-legend-row.eliminated { filter: none; opacity: .45; }
.owner-legend-row.eliminated b { text-decoration: line-through; }

.status-chip { border: 1px solid var(--m-line); border-left: 3px solid var(--effect); border-radius: var(--m-r); background: var(--m-surface); color: var(--m-ink); box-shadow: var(--m-shadow); font-weight: 600; }
.status-chip .status-icon { color: var(--effect); }
.status-count { border-left: 1px solid var(--m-line); font-weight: 700; }

/* roll */
#roll-hud { gap: 10px; align-items: center; }
#roll-hud .roll-btn, .roll-btn {
  width: 84px; height: 84px; border-radius: 14px; border: 0; color: #fff; background: var(--m-ink);
  box-shadow: 0 10px 24px rgba(15,23,42,.3); animation: none; text-shadow: none;
  font-family: var(--m-font); font-weight: 800; font-size: 15px; letter-spacing: 2px; transition: transform .06s, background .12s;
}
#roll-hud .roll-btn:hover { background: #1e293b; }
#roll-hud .roll-btn:active { transform: scale(.96); }
.roll-tickets { border: 1px solid var(--m-line); border-radius: var(--m-r-sm); background: var(--m-surface); color: var(--m-muted); box-shadow: none; font-weight: 500; font-size: 11px; }
.bet-pill, .bet-pill.active {
  min-height: 44px; padding: 0 14px; border: 1px solid var(--m-line-2); border-radius: var(--m-r); background: var(--m-surface);
  color: var(--m-ink); box-shadow: var(--m-shadow); transform: none; text-shadow: none;
  font-family: var(--m-font); font-weight: 700; font-size: 12px; letter-spacing: 1px; transition: background .12s;
}
#bet-odd, #bet-even { margin: 0; }
.bet-pill.active { background: var(--m-ink); border-color: var(--m-ink); color: #fff; }

/* toasts & banner */
.toast {
  --toast-accent: var(--m-ink-2);
  border: 1px solid var(--m-line); border-left: 3px solid var(--toast-accent); border-radius: var(--m-r);
  background: var(--m-surface); color: var(--m-ink); box-shadow: var(--m-shadow); font-family: var(--m-font); font-weight: 500;
}
.toast-gain { --toast-accent: var(--m-pos); } .toast-loss { --toast-accent: var(--m-neg); }
.toast-reward, .toast-warning { --toast-accent: var(--m-gold); } .toast-portal { --toast-accent: #7c3aed; }
.toast-icon { border-radius: 0; background: none; color: var(--toast-accent); }
.toast-message { color: var(--m-ink); }
.toast-gain .toast-message > b { color: var(--m-pos); } .toast-loss .toast-message > b { color: var(--m-neg); }
#banner {
  padding: 7px 14px; border: 0; border-radius: var(--m-r); background: var(--m-ink); color: #fff; box-shadow: var(--m-shadow);
  font-family: var(--m-font); font-weight: 600; font-size: 13px; letter-spacing: 0; text-transform: none; text-shadow: none;
}
#dice-pop { font-family: var(--m-font); font-weight: 800; color: #fff; text-shadow: 0 2px 12px rgba(15,23,42,.45); }
#chat-panel { border: 1px solid var(--m-line); border-radius: var(--m-r-lg); background: var(--m-surface); box-shadow: var(--m-shadow); }

/* Jail bail button printed like a banknote (kept flat). */
#actionbar .btn.btn-banknote {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px; border: 1px solid #e8a3b8; border-radius: var(--m-r-sm);
  color: #6b2139; background: repeating-linear-gradient(135deg, rgba(255,255,255,.25) 0 3px, transparent 3px 8px), #f7c3d1;
  box-shadow: inset 0 0 0 3px #fbe1e8;
}
.btn-banknote .bn-main { display: flex; flex-direction: column; align-items: center; line-height: 1; font-size: 17px; font-weight: 800; }
.btn-banknote .bn-main small { font-size: 9px; font-weight: 600; letter-spacing: 1.5px; margin-bottom: 3px; }
.btn-banknote .bn-corner { align-self: flex-start; font-size: 10px; font-weight: 700; opacity: .75; }
.btn-banknote .bn-corner:last-child { align-self: flex-end; }

/* ---------- modals ---------- */
.modal-wrap { background: rgba(15,23,42,.45); backdrop-filter: blur(2px); }
.modal {
  border: 0; border-radius: 12px; background: var(--m-surface); color: var(--m-ink); box-shadow: var(--m-shadow-lg);
  font-family: var(--m-font); padding: 20px; text-align: left;
}
.modal h3 { font-family: var(--m-font); font-weight: 700; font-size: 18px; letter-spacing: -.2px; color: var(--m-ink); display: flex; align-items: center; gap: 8px; }
.modal h3 .fi { color: var(--m-muted); }
.modal .sub { color: var(--m-muted); font-weight: 400; }
.modal .btn-row { gap: 8px; }
.confirm-action { width: min(380px, calc(100vw - 32px)); }
.confirm-action .sub { line-height: 1.55; margin: 12px 0 20px; }
.confirm-action .btn-row .btn { min-height: 44px; }
.property-actions { gap: 8px; }
.property-actions .btn, .visit-actions .btn { flex-direction: row; justify-content: space-between; gap: 8px; min-height: 48px; padding: 10px 14px; font-size: 13px; }
.property-actions .btn b, .visit-actions .btn b { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.property-actions .btn span, .visit-actions .btn span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.visit-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.visit-actions .btn { width: 100%; }
.property-actions .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
.property-hint { color: var(--m-muted); font-size: 12px; }
.purchase-balance > span { grid-column: 1 / -1; font-size: 12px; color: var(--m-muted); }
.purchase-balance b { white-space: nowrap; }
.purchase-balance { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 8px; margin: 12px 0; padding: 10px 12px; border: 0; border-radius: var(--m-r); background: var(--m-subtle); font-weight: 500; color: var(--m-muted); font-size: 13px; }
.purchase-balance b { font-size: 16px; font-weight: 700; color: var(--m-ink); font-variant-numeric: tabular-nums; }
.purchase-warning { color: var(--m-neg); font-weight: 500; }
.build-path { color: var(--m-muted); font-weight: 600; font-size: 12px; }
.build-path > span { color: var(--m-line-2); }
.card-effect { border: 0; border-radius: var(--m-r); background: var(--m-subtle); color: var(--m-ink); font-weight: 600; box-shadow: none; }
.card-effect.gain { background: #f0fdf4; color: var(--m-pos); }
.card-effect.loss { background: #fef2f2; color: var(--m-neg); }
.event-mark { border: 1px solid var(--m-line); border-radius: var(--m-r-lg); background: var(--m-subtle); color: var(--m-ink); box-shadow: none; }
.event-report-top { border-color: var(--m-line); color: var(--m-muted); }
.event-report-top > span:first-child { background: var(--m-ink); color: #fff; border-radius: var(--m-r-sm); }
.event-report-head .event-mark { border-radius: var(--m-r-lg); box-shadow: none; }
.event-report-head h3 { color: var(--m-ink); }
.event-report-body { color: var(--m-ink-2); }
.event-report-foot { border-color: var(--m-line); color: var(--m-muted); }
.landmark-preview { border: 0; border-bottom: 1px solid var(--m-line); background: var(--m-subtle); }
.landmark-preview figcaption { color: var(--m-ink); font-weight: 600; }
.visit-building-line { color: var(--m-muted); font-weight: 600; }
.visit-bonus { border: 0; border-radius: var(--m-r-sm); background: #fefce8; color: var(--m-gold); font-weight: 600; }

/* Deed: flat card with a colored title band; tap to flip. */
.deed, .deed-flip .deed { width: min(300px, 100%); margin: 8px auto; padding: 0; border: 1px solid var(--m-line); border-radius: var(--m-r-lg); background: var(--m-surface); box-shadow: none; overflow: hidden; }
.deed-head, .deed-flip .deed-head { justify-content: flex-start; gap: 10px; padding: 12px 14px; border: 0; border-radius: 0; background: var(--gc); color: #fff; font-family: var(--m-font); text-align: left; }
.deed-head .dh-ic { border-radius: var(--m-r); background: rgba(255,255,255,.18); padding: 6px; }
.deed-head .dh-txt small, .deed-flip .dh-txt small { font-family: var(--m-font); font-size: 9px; font-weight: 600; letter-spacing: 1.5px; opacity: .85; }
.deed-head .dh-txt b, .deed-flip .dh-txt b { font-family: var(--m-font); font-weight: 700; font-size: 17px; text-transform: none; letter-spacing: -.2px; }
.deed-head .dh-lm { border-radius: var(--m-r-sm); background: rgba(255,255,255,.95); color: var(--m-gold); box-shadow: none; }
.deed-body, .deed-flip .deed-body { padding: 12px 14px; border: 0; border-radius: 0; background: var(--m-surface); font-size: 13px; }
.deed-flip .deed { display: flex; flex-direction: column; }
.deed-flip { perspective: 1000px; cursor: pointer; -webkit-tap-highlight-color: transparent; outline: none; }
.deed-flip:focus-visible .deed { box-shadow: 0 0 0 2px var(--m-accent); }
/* Both sides share one grid cell, so the card (and popup) keeps the taller side's height;
   the hidden side is swapped at the half-turn. */
.deed-inner, .deed-flip.flipped .deed-inner { display: grid; justify-items: center; transform: none; transition: none; }
.deed-flip .deed-front, .deed-flip .deed-back { grid-area: 1 / 1; display: flex; margin: 0; transform: none; backface-visibility: visible; }
.deed-flip .deed-back, .deed-flip.flipped .deed-front { visibility: hidden; }
.deed-flip.flipped .deed-back { visibility: visible; }
.deed-flip.turning .deed-inner { animation: deedTurn .32s cubic-bezier(.4,0,.2,1); }
@keyframes deedTurn { 0% { transform: perspective(900px) rotateY(0); } 50% { transform: perspective(900px) rotateY(90deg); } 100% { transform: perspective(900px) rotateY(0); } }
.deed-back-head { padding: 12px 14px; border: 0; border-radius: 0; text-align: left; color: #fff; background: var(--gc); }
.deed-back-head small { display: block; font-size: 9px; font-weight: 600; letter-spacing: 1.5px; opacity: .85; }
.deed-back-head b { font-family: var(--m-font); font-weight: 700; font-size: 16px; text-transform: none; text-shadow: none; }
.td-price { display: flex; justify-content: space-between; width: auto; margin: 0 0 8px; padding: 0 0 8px; border-radius: 0; border-bottom: 1px solid var(--m-line); background: none; box-shadow: none; color: var(--m-muted); font-size: 12px; font-weight: 500; text-align: left; }
.td-price b { color: var(--m-ink); font-weight: 700; }
.td-rent { display: grid; gap: 0; }
.td-row { display: flex; align-items: baseline; gap: 8px; padding: 4px 8px; margin: 0 -8px; border-radius: var(--m-r-sm); color: var(--m-ink-2); font-size: 13px; }
.td-row i { flex: 1; border-bottom: 1px dotted var(--m-line-2); transform: translateY(-3px); }
.td-row b { color: var(--m-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.td-row:first-child span { font-weight: 600; letter-spacing: 0; }
.td-row:last-child { color: var(--m-gold); }
.td-row:last-child b { color: var(--m-gold); }
.td-row.current { background: var(--m-subtle); box-shadow: inset 2px 0 0 var(--m-ink); }
.td-row.current span::before { content: none; }
.td-row.current b { font-weight: 800; }
.td-note { margin: 8px 0; color: var(--m-muted); font-size: 11.5px; font-style: normal; text-align: left; }
.td-cost { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-top: 8px; border-top: 1px solid var(--m-line); text-align: left; font-size: 11px; color: var(--m-muted); }
.td-cost b { display: block; color: var(--m-ink); font-size: 12px; font-weight: 600; }
.deed-flip-hint { padding: 0 14px 10px; color: var(--m-muted); font-size: 11px; font-weight: 500; text-align: left; background: var(--m-surface); }
.pr-row.hl { margin: 0 -8px; padding: 5px 8px; border-radius: var(--m-r-sm); background: var(--m-subtle); }
.pr-ic { color: var(--m-muted); }
.pr-lb { color: var(--m-ink-2); font-weight: 500; }
.pr-dots { border-bottom: 1px dotted var(--m-line-2); }
.pr-val { color: var(--m-ink); font-weight: 700; }
.pr-note { margin-top: 8px; padding: 0; border-radius: 0; background: none; color: var(--m-muted); font-size: 11.5px; font-weight: 500; line-height: 1.45; }
.pr-owner, .pr-owner.free { margin-top: 10px; padding: 8px 10px; border-radius: var(--m-r); background: var(--m-subtle); color: var(--m-ink-2); font-weight: 600; font-size: 12px; }
.player-badge { border: 0; border-radius: var(--m-r-sm); }
.tile-effect, .tile-effect.rentFree { border: 0; border-left: 3px solid var(--m-gold); border-radius: 0; background: #fefce8; color: var(--m-ink-2); font-weight: 600; }
.special-icon { border: 1px solid var(--m-line); background: var(--m-subtle); color: var(--m-ink); }
.special-tile p { color: var(--m-ink); font-weight: 600; }
.special-tile small { border-top: 1px solid var(--m-line); color: var(--m-muted); font-weight: 600; }

/* Victory screen: trophy flanked by the winning pawn(s). */
.gameover-modal { text-align: center; overflow: hidden; animation: goPop .55s cubic-bezier(.2,1.5,.4,1) both; }
.go-stage { --win: #f5b301; position: relative; margin: -20px -20px 0; height: 210px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--win) 55%, #fff), color-mix(in srgb, var(--win) 80%, #0f172a) 75%); }
.go-rays { position: absolute; left: 50%; top: 58%; width: 520px; height: 520px; margin: -260px 0 0 -260px; background: repeating-conic-gradient(rgba(255,255,255,.26) 0 9deg, transparent 9deg 22deg); animation: goSpin 14s linear infinite; }
.go-confetti i { position: absolute; top: -12px; left: var(--x); width: 7px; height: 11px; border-radius: 2px; background: var(--c); transform: rotate(var(--r)); animation: goFall 2.8s var(--d) linear infinite; }
.go-trophy { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(160deg, #fff3bf, #fcc419); color: #b45309; box-shadow: 0 0 0 4px rgba(255,255,255,.55), 0 0 24px #ffe066; animation: goTrophy 1.6s ease-in-out infinite; }
.go-pawns { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 0; margin-bottom: -6px; z-index: 1; }
.go-pawn { width: 104px; height: 132px; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(15,23,42,.35)); animation: goBounce .9s ease-in-out infinite; }
.go-pawn + .go-pawn { animation-delay: 0s; } /* teammates bounce together */
.go-plinth { position: relative; width: 170px; height: 34px; border-radius: 10px 10px 0 0; background: linear-gradient(180deg, #ffe066, #f59f00); color: #7c4a03; font: 900 18px/34px var(--m-font); box-shadow: inset 0 3px 0 rgba(255,255,255,.6); }
.go-ribbon { position: relative; margin: -2px -20px 0; padding: 10px 16px 12px; background: var(--win); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--win) 40%, transparent); }
.go-ribbon small { display: inline-flex; align-items: center; gap: 6px; font: 800 11px var(--m-font); letter-spacing: 5px; color: #fff3bf; }
.go-ribbon b { display: block; font: 900 28px/1.1 var(--m-font); text-shadow: 0 3px 0 rgba(0,0,0,.25); animation: goName .7s .2s cubic-bezier(.2,1.6,.4,1) both; }
.go-sub { margin: 12px 0 0; text-align: center; }
@keyframes goBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes goSpin { to { transform: rotate(360deg); } }
@keyframes goFall { to { transform: translateY(240px) rotate(calc(var(--r) + 540deg)); } }
@keyframes goTrophy { 0%, 100% { transform: translateX(-50%) scale(1) rotate(-6deg); } 50% { transform: translateX(-50%) scale(1.1) rotate(6deg); } }
@keyframes goName { from { transform: scale(2.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes goPop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .go-pawn, .go-rays, .go-confetti i, .go-trophy, .go-ribbon b, .gameover-modal { animation: none; } }

/* Sabotage Time: hazard tape slides across, a red alarm card slams in. */
.sabotage-intro { position: fixed; inset: 0; z-index: 39; display: grid; place-items: center; pointer-events: none; background: radial-gradient(circle, rgba(224,49,49,.25), rgba(15,23,42,.65)); animation: sbFlash .6s ease-in-out 3, whIn .2s ease both; }
.sabotage-intro.out { animation: whOut .4s ease forwards; }
.sb-tape { position: absolute; left: -10%; right: -10%; height: 34px; background: repeating-linear-gradient(-45deg, #ffd43b 0 22px, #1a1a1a 22px 44px); box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.sb-tape-top { top: 18%; transform: rotate(-4deg); animation: sbTapeL .5s cubic-bezier(.2,.8,.3,1) both; }
.sb-tape-bottom { bottom: 18%; transform: rotate(3deg); animation: sbTapeR .5s .1s cubic-bezier(.2,.8,.3,1) both; }
.sb-card { position: relative; width: min(340px, 90vw); padding: 16px 18px 18px; border-radius: 20px; background: #fff; text-align: center; box-shadow: 0 0 0 5px #e03131, 0 18px 50px rgba(0,0,0,.5); animation: sbSlam .5s .25s cubic-bezier(.2,1.6,.4,1) both; }
.sb-card small { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 12px; background: var(--prey); color: #fff; font: 800 12px var(--m-font); }
.sb-card b { display: flex; flex-direction: column; margin: 8px 0 4px; font: 900 44px/.95 var(--m-font); color: #e03131; letter-spacing: 1px; text-shadow: 0 4px 0 #7f1d1d; }
.sb-card b i { font-style: normal; display: block; }
.sb-card b i + i { color: #1a1a1a; text-shadow: 0 4px 0 #ffd43b; }
.sb-card span { display: block; font: 600 13px/1.35 var(--m-font); color: #475569; }
@keyframes sbFlash { 50% { background-color: rgba(224,49,49,.25); } }
@keyframes sbTapeL { from { transform: translateX(-110%) rotate(-4deg); } }
@keyframes sbTapeR { from { transform: translateX(110%) rotate(3deg); } }
@keyframes sbSlam { from { transform: scale(2.4) rotate(-8deg); opacity: 0; } }
/* Sabotage failed: a card listing each missed trap. */
.sabotage-failed { position: fixed; inset: 0; z-index: 38; display: grid; place-items: center; padding: 16px; pointer-events: none; background: rgba(15,23,42,.35); animation: whIn .25s ease both; }
.sabotage-failed.out { animation: whOut .35s ease forwards; }
.sf-card { width: min(340px, 92vw); padding: 14px 16px 12px; border-radius: 18px; background: #fff; text-align: center; box-shadow: 0 0 0 4px #94a3b8, 0 16px 40px rgba(15,23,42,.35); animation: whPop .45s cubic-bezier(.2,1.5,.4,1) both; }
.sf-card > b { display: block; font: 900 22px var(--m-font); color: #475569; letter-spacing: 1px; }
.sf-card > small { display: block; margin-bottom: 8px; font: 600 12px var(--m-font); color: #64748b; }
.sf-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; text-align: left; }
.sf-card li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: #f8fafc; font: 600 12px var(--m-font); color: #334155; }
.sf-card li > span:nth-child(2) { flex: 1; min-width: 0; }
.sf-card li em { font-style: normal; font-weight: 800; color: #e03131; white-space: nowrap; }
.sf-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.sf-card p { margin: 8px 0 0; display: inline-flex; align-items: center; gap: 5px; font: 700 12px var(--m-font); color: #0f766e; }
/* Trap picker (bottom bar) and the mystery-crate decision. */
.trap-picker { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 3px #e03131, var(--m-shadow); pointer-events: auto; }
.trap-picker > b { display: inline-flex; align-items: center; gap: 6px; font: 900 14px var(--m-font); color: #e03131; letter-spacing: 1px; }
.trap-picker > div { display: flex; gap: 8px; }
.trap-picker small { font: 600 12px var(--m-font); color: #64748b; }
.trap-picker.waiting { flex-direction: row; font: 700 13px var(--m-font); color: #475569; box-shadow: var(--m-shadow); }
.trap-kind { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 78px; padding: 8px 6px; border: 2px solid #e2e8f0; border-radius: 12px; background: #f8fafc; color: #1e293b; font: 800 12px var(--m-font); cursor: pointer; }
.trap-picker > div { flex-wrap: wrap; justify-content: center; }
.trap-kind { min-width: 70px; }
.trap-kind small { font: 700 10px var(--m-font); color: #64748b; }
.trap-kind:disabled { opacity: .45; cursor: not-allowed; }
.trap-kind.active { border-color: #e03131; background: #fff5f5; color: #e03131; box-shadow: 0 0 0 3px rgba(224,49,49,.2); }
.trap-targets { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font: 800 12px var(--m-font); color: #475569; }
.trap-target { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 10px; border: 2px solid var(--t-color, #e03131); border-radius: 999px; background: #fff; color: #1e293b; font: 800 12px var(--m-font); cursor: pointer; }
.trap-target.active { background: var(--t-color, #e03131); color: #fff; }
.trap-later { padding: 6px 12px; border: 0; border-radius: 10px; background: #f1f5f9; color: #334155; font: 800 12px var(--m-font); cursor: pointer; }
.trap-choice { text-align: center; }
.tc-crate { width: 84px; height: 84px; margin: 4px auto 8px; display: grid; place-items: center; border-radius: 18px; background: #e03131; color: #fff; font: 900 56px var(--m-font); border: 5px dashed #ffd43b; animation: tcShake .5s ease-in-out infinite; }
.trap-choice h3 { justify-content: center; }
@keyframes tcShake { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }

/* Prize wheel (Roda Hoki, Special Event draw): a card with a coloured wheel, a pointer on top and the result below. */
.wheel-overlay { position: fixed; inset: 0; z-index: 38; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 45%, rgba(15,23,42,.25), rgba(15,23,42,.6)); animation: whIn .3s ease both; pointer-events: none; }
.wheel-overlay.out { animation: whOut .35s ease forwards; }
.wh-card { width: min(330px, 92vw); padding: 14px 14px 16px; border-radius: 22px; background: #fff; box-shadow: 0 20px 50px rgba(15,23,42,.4), 0 0 0 4px #ffd43b; text-align: center; animation: whPop .45s cubic-bezier(.2,1.5,.4,1) both; }
.wh-head b { display: block; font: 900 20px/1.1 var(--m-font); letter-spacing: 3px; color: #1e2540; }
.wh-head small { display: block; margin-top: 2px; font: 600 12px var(--m-font); color: #64748b; }
.wh-stage { position: relative; width: min(270px, 76vw); aspect-ratio: 1; margin: 12px auto 4px; }
.wh-pointer { position: absolute; top: -6px; left: 50%; z-index: 2; width: 0; height: 0; transform: translateX(-50%); border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 24px solid #e03131; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.wh-wheel { position: absolute; inset: 0; border-radius: 50%; border: 6px solid #fff; box-shadow: 0 0 0 4px #ffd43b, 0 8px 20px rgba(15,23,42,.3), inset 0 0 0 2px rgba(0,0,0,.08); will-change: transform; }
.wh-label { position: absolute; left: 50%; top: 50%; display: flex; flex-direction: column; align-items: center; gap: 1px; width: 64px; height: 34px; margin: -17px 0 0 -32px; transform: rotate(var(--a)) translateY(calc(min(270px, 76vw) * -.32)); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.55); }
.wh-label b { font: 800 9.5px/1.05 var(--m-font); text-align: center; }
.wh-hub { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: grid; place-items: center; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px #ffd43b, 0 2px 6px rgba(0,0,0,.3); font-style: normal; font-size: 22px; }
.wh-result { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 16px; border-radius: 14px; background: var(--c); color: #fff; font: 900 17px var(--m-font); text-shadow: 0 1px 2px rgba(0,0,0,.35); box-shadow: 0 4px 0 rgba(0,0,0,.18); animation: whPop .5s cubic-bezier(.2,1.6,.4,1) both; }
.wheel-overlay.done .wh-card { animation: whWin .5s ease; }
@keyframes whIn { from { opacity: 0; } }
@keyframes whOut { to { opacity: 0; transform: scale(.96); } }
@keyframes whPop { from { transform: scale(.5); opacity: 0; } }
@keyframes whWin { 50% { transform: scale(1.05); } }
.wh-label em, .wh-result em { font-style: normal; font-size: 18px; line-height: 1; }
/* Cute theme (Roda Hoki): pastel card with polka dots, a soft pink pointer, dark friendly labels, a bouncy finish. */
.wheel-overlay.cute { background: radial-gradient(circle at 50% 45%, rgba(255,240,246,.35), rgba(30,41,59,.45)); }
.wheel-overlay.cute .wh-card { background: radial-gradient(#ffe3ec 2px, transparent 2.5px) 0 0 / 18px 18px, #fffaf0; box-shadow: 0 16px 40px rgba(15,23,42,.3), 0 0 0 4px #ffc9de; }
.wheel-overlay.cute .wh-head b { color: #d6336c; letter-spacing: 2px; }
.wheel-overlay.cute .wh-pointer { border-top-color: #f06595; top: -10px; }
.wheel-overlay.cute .wh-wheel { border: 6px dashed #fff; box-shadow: 0 0 0 4px #ffc9de, 0 8px 18px rgba(214,51,108,.2); }
.wheel-overlay.cute .wh-label { color: #343a40; text-shadow: none; }
.wheel-overlay.cute .wh-hub { box-shadow: 0 0 0 4px #ffc9de; }
.wheel-overlay.cute .wh-result { color: #343a40; text-shadow: none; box-shadow: 0 4px 0 rgba(0,0,0,.08); }
.wheel-overlay.cute.done .wh-card { animation: whBounce .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes whBounce { 30% { transform: scale(1.08) rotate(-2deg); } 60% { transform: scale(.97) rotate(1deg); } }
/* Roda Hoki button above ROLL. */
#roll-hud .spin-btn { display: flex; align-items: center; gap: 6px; margin: 0 auto 8px; padding: 6px 14px; border: 0; border-radius: 20px; background: linear-gradient(135deg, #ffd43b, #ff922b); color: #5c2d00; font: 800 13px var(--m-font); box-shadow: 0 3px 0 #e8590c, 0 6px 14px rgba(232,89,12,.3); cursor: pointer; pointer-events: auto; animation: spinGlow 1.8s ease-in-out infinite; }
#roll-hud .spin-btn small { font-weight: 700; opacity: .8; }
#roll-hud .spin-btn:disabled { filter: grayscale(1); opacity: .6; animation: none; }
@keyframes spinGlow { 50% { box-shadow: 0 3px 0 #e8590c, 0 6px 22px rgba(255,146,43,.6); } }

/* Bank pot: plain icon + text at the end of the profile card (not a button). */
#game .me-profile > .me-bank { flex: none; display: flex; align-items: center; gap: 6px; margin-left: auto; padding-left: 10px; border-left: 1px solid var(--m-line); color: #0f766e; }
.me-bank > .fi { font-size: 18px; }
.me-bank > span { display: flex; flex-direction: column; line-height: 1.15; }
#game .me-bank small { font-size: 10px; font-weight: 600; color: var(--m-muted); }
.me-bank b { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Wide screens: the tool icons sit together in one white pill, with a label on hover. */
@media (min-width: 761px) and (min-height: 481px) {
  #game #settings-menu { gap: 2px; padding: 4px; border: 1px solid var(--m-line); border-radius: 14px; background: var(--m-surface); box-shadow: var(--m-shadow); }
  #game #settings-menu .tb-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #475569; font-size: 17px; transition: background .15s, color .15s; }
  #game #settings-menu .tb-btn:hover { background: #eef2ff; color: var(--m-accent, #2563eb); }
  #game #settings-menu #btn-menu:hover { background: #fef2f2; color: #dc2626; }
  #game #settings-menu .tb-btn::after { content: attr(title); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 3px 8px; border-radius: 6px; background: #1e293b; color: #fff; font: 600 11px var(--m-font); white-space: nowrap; text-transform: capitalize; opacity: 0; pointer-events: none; transition: opacity .15s; }
  #game #settings-menu .tb-btn:hover::after { opacity: 1; }
}

/* Victory cinematic: black letterbox bars slide in, a white flash, gold sparks, the champion's name drops in letter by letter. */
.victory-cine { --win: #f5b301; position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
/* Festive banners in the winner's colour (not black): a diagonal stripe pattern, a gold trim with a soft glow,
   and a light sheen sweeping across now and then. */
.vc-bar { position: absolute; left: 0; right: 0; overflow: hidden;
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,.10) 0 14px, transparent 14px 34px),
    linear-gradient(180deg, color-mix(in srgb, var(--win) 78%, #fff), var(--win) 55%, color-mix(in srgb, var(--win) 70%, #1e1b4b)); }
.vc-bar::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -45%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); animation: vcSheen 2.6s 1s ease-in-out infinite; }
.vc-top { top: 0; height: 9vh; min-height: 56px; transform: translateY(-100%); animation: vcIn .7s .1s cubic-bezier(.2,.8,.3,1) forwards;
  border-bottom: 4px solid #ffd43b; box-shadow: 0 4px 0 color-mix(in srgb, var(--win) 60%, #000), 0 10px 30px color-mix(in srgb, #ffd43b 55%, transparent); }
.vc-top::before { content: '★  ★  ★  ★  ★  ★  ★  ★  ★  ★  ★  ★'; position: absolute; inset: 0; display: grid; place-items: center; white-space: nowrap; color: rgba(255,255,255,.55); font-size: 16px; letter-spacing: 10px; }
.vc-bottom { bottom: 0; height: max(21vh, 150px); transform: translateY(100%); animation: vcIn .7s .1s cubic-bezier(.2,.8,.3,1) forwards; display: grid; place-items: center;
  border-top: 4px solid #ffd43b; box-shadow: 0 -4px 0 color-mix(in srgb, var(--win) 60%, #000), 0 -12px 34px color-mix(in srgb, #ffd43b 55%, transparent); }
.vc-pop { position: absolute; bottom: max(21vh, 150px); width: 0; height: 0; z-index: 2; }
.vc-pop-l { left: 0; } .vc-pop-r { right: 0; }
.vc-pop i { position: absolute; left: 0; top: 0; width: 8px; height: 12px; border-radius: 2px; background: var(--c); opacity: 0; }
.title-in .vc-pop i { animation: vcPop 1.8s var(--d) cubic-bezier(.15,.7,.4,1) forwards; }
@keyframes vcPop { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 22vh)) rotate(var(--r)); } }
@keyframes vcSheen { 0% { left: -45%; } 60%, 100% { left: 110%; } }
.victory-cine.out .vc-top { animation: vcOutTop .6s ease-in forwards; }
.victory-cine.out .vc-bottom { animation: vcOutBottom .6s ease-in forwards; }
.victory-cine.out .vc-sparks { opacity: 0; transition: opacity .4s; }
/* Title, flash and sparks wait for .title-in (added when the camera reaches the champion). */
.vc-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, #fff, color-mix(in srgb, var(--win) 40%, #fff) 45%, transparent 75%); opacity: 0; }
.vc-title { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 16px; text-align: center; color: #fff; }
.vc-title small { display: inline-flex; align-items: center; gap: 8px; padding: 3px 14px; border-radius: 20px; background: #ffd43b; color: #7c4a03; font: 900 12px var(--m-font, sans-serif); letter-spacing: 6px; box-shadow: 0 3px 0 #e67700; opacity: 0; }
.vc-title b { display: flex; flex-wrap: wrap; justify-content: center; font: 900 clamp(32px, 10vw, 58px)/1.05 var(--m-font, sans-serif); letter-spacing: 1px; }
.vc-title b i { font-style: normal; display: inline-block; color: #fff; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--win) 55%, #000);
  text-shadow: 0 4px 0 color-mix(in srgb, var(--win) 55%, #000), 0 7px 0 rgba(0,0,0,.18), 0 0 26px #ffe066; opacity: 0; transform: translateY(-70px) scale(1.8); }
.vc-title span { padding: 2px 10px; border-radius: 10px; background: rgba(0,0,0,.18); font: 700 13px var(--m-font, sans-serif); color: #fff; opacity: 0; }
.vc-sparks em { position: absolute; bottom: max(22vh, 150px); left: var(--x); width: 8px; height: 8px; border-radius: 2px; background: #ffd75c; box-shadow: 0 0 8px #ffd75c; opacity: 0; transform: rotate(45deg) scale(var(--s)); }
.title-in .vc-flash { animation: vcFlash 1s ease-out; }
.title-in .vc-title small { animation: vcFade .5s forwards; }
.title-in .vc-title b i { animation: vcDrop .45s calc(.2s + var(--i) * .06s) cubic-bezier(.2,1.6,.4,1) forwards; }
.title-in .vc-title span { animation: vcFade .5s 1.1s forwards; }
.title-in .vc-sparks em { animation: vcSpark 2.4s calc(.3s + var(--d)) ease-out infinite; }
.vc-sparks em:nth-child(3n) { background: #fff; }
.vc-sparks em:nth-child(3n+1) { background: var(--win); }
@keyframes vcIn { to { transform: translateY(0); } }
@keyframes vcOutTop { from { transform: translateY(0); } to { transform: translateY(-100%); } }
@keyframes vcOutBottom { from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes vcFlash { 0% { opacity: 0; } 12% { opacity: .85; } 100% { opacity: 0; } }
@keyframes vcFade { to { opacity: 1; } }
@keyframes vcDrop { 60% { opacity: 1; transform: translateY(6px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes vcSpark { 0% { opacity: 0; transform: translateY(0) rotate(45deg) scale(var(--s)); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-38vh) rotate(260deg) scale(var(--s)); } }
@media (prefers-reduced-motion: reduce) { .victory-cine *, .victory-cine { animation-duration: .01s !important; animation-delay: 0s !important; } }

/* Chance (orange, big "?") and Dana Umum (yellow), matching the board tiles. */
.card-flip-scene.chance, .draw-card-modal.chance { --card-accent: #ee7d22; --card-dark: #b4510b; }
.card-flip-scene.dana, .draw-card-modal.dana { --card-accent: #f5c32c; --card-dark: #8a6400; }
.card-label { justify-content: flex-start; color: var(--m-muted); font-family: var(--m-font); font-weight: 600; font-size: 11px; letter-spacing: 1.5px; }
.card-label .fi { color: var(--card-accent); }
.card-face { padding: 0; border: 0; border-radius: var(--m-r-lg); box-shadow: 0 8px 24px rgba(15,23,42,.18); background: var(--card-accent); }
.card-face.front .card-face-frame { justify-content: center; gap: 6px; margin: 8px; border: 1.5px solid rgba(255,255,255,.7); border-radius: var(--m-r); background: var(--card-accent); }
.card-face-frame::before, .card-face-frame::after { display: none; }
.card-face.front strong { color: #fff; font-family: var(--m-font); font-weight: 700; font-size: 14px; letter-spacing: 3px; text-shadow: none; }
.card-flip-scene.dana .card-face.front strong { color: var(--card-dark); }
.cf-mark { font-family: var(--m-font); font-weight: 800; font-size: 96px; line-height: .9; color: #fff; text-shadow: none; transform: none; }
.card-face.front .cf-icon { width: 72px; height: 72px; border: 0; border-radius: 50%; background: rgba(255,255,255,.5); color: var(--card-dark); box-shadow: none; }
.card-face.back { background: var(--m-surface); box-shadow: 0 8px 24px rgba(15,23,42,.18), inset 0 0 0 1px var(--m-line); }
.card-face.back .card-face-frame { justify-content: flex-start; gap: 10px; margin: 0; padding: 0 12px 14px; border: 0; border-radius: var(--m-r-lg); background: var(--m-surface); overflow: hidden; }
.cf-band { align-self: stretch; margin: 0 -12px; padding: 7px 0; background: var(--card-accent); color: #fff; font-family: var(--m-font); font-weight: 700; font-size: 11px; letter-spacing: 2.5px; text-shadow: none; }
.card-flip-scene.dana .cf-band { color: var(--card-dark); }
.card-face.back .big { width: 64px; height: 64px; border: 0; border-radius: 50%; background: var(--m-subtle); color: var(--card-accent); box-shadow: none; }
.card-face.back strong { color: var(--m-ink); font-family: var(--m-font); font-weight: 700; font-size: 18px; }
.draw-card-copy p, .draw-card-copy > p { color: var(--m-ink-2); font-weight: 400; }
@media (max-height: 540px) { .cf-mark { font-size: 72px; } }

/* Name tag above human pawns (screen-space, readable at any zoom). */
.pawn-tag {
  position: absolute; transform: translate(-50%, -100%); padding: 0 2px; border: 1px solid rgba(255,255,255,.8);
  border-radius: 3px; background: var(--tag-color, var(--m-ink)); color: #fff;
  font: 800 8px/10px var(--m-font); letter-spacing: .2px; white-space: nowrap; box-shadow: 0 1px 2px rgba(15,23,42,.3);
}
.pawn-tag[hidden] { display: none; }
.speech-bubble { border: 1px solid var(--m-line); border-radius: var(--m-r-lg); background: var(--m-surface); color: var(--m-ink); box-shadow: var(--m-shadow); font-family: var(--m-font); font-weight: 600; font-size: 13px; }

/* ---------- color ---------- */
/* Variants must beat the "#actionbar .btn" / ".modal .btn" base rule. */
.btn.btn-pink, #actionbar .btn.btn-pink, .modal .btn.btn-pink,
.btn.btn-blue, #actionbar .btn.btn-blue, .modal .btn.btn-blue { --b-bg: var(--m-accent); --b-line: var(--m-accent); --b-fg: #fff; }
.btn.btn-green, #actionbar .btn.btn-green, .modal .btn.btn-green { --b-bg: var(--m-pos); --b-line: var(--m-pos); --b-fg: #fff; }
.btn.btn-red, #actionbar .btn.btn-red, .modal .btn.btn-red { --b-bg: var(--m-neg); --b-line: var(--m-neg); --b-fg: #fff; }
.btn.btn-ghost, #actionbar .btn.btn-ghost, .modal .btn.btn-ghost { --b-bg: var(--m-surface); --b-line: var(--m-line-2); --b-fg: var(--m-ink); }

/* Rent you pay = red, takeover = blue — same colors on deed rows and buttons. */
.pr-row.tone-rent { margin: 4px -8px; padding: 7px 8px; border-radius: var(--m-r); background: #fef2f2; }
.pr-row.tone-rent .pr-ic, .pr-row.tone-rent .pr-lb, .pr-row.tone-rent .pr-val { color: var(--m-neg); }
.pr-row.tone-take { margin: 4px -8px; padding: 7px 8px; border-radius: var(--m-r); background: #eff6ff; }
.pr-row.tone-take .pr-ic, .pr-row.tone-take .pr-lb, .pr-row.tone-take .pr-val { color: var(--m-accent); }
.pr-row.tone-rent .pr-dots, .pr-row.tone-take .pr-dots { border-color: currentColor; opacity: .25; }

#roll-hud .roll-btn, .roll-btn { background: var(--m-pos); box-shadow: 0 10px 24px rgba(22,163,74,.35); }
#roll-hud .roll-btn:hover { background: #15803d; }
.bet-pill.active { background: #7c3aed; border-color: #7c3aed; }
.me-profile { border-left: 4px solid var(--player-color, var(--m-accent)); }
.owner-legend-row.current { background: color-mix(in srgb, var(--player-color) 12%, #fff); }
.legend-turn { color: color-mix(in srgb, var(--player-color) 75%, #000); }
.wchip .fi { color: #7c3aed !important; }
.wchip.bank .fi { color: var(--m-accent) !important; }
.lm-pips i.on:not(.fi) { background: #f59e0b; }
.status-chip { background: color-mix(in srgb, var(--effect) 10%, #fff); }
.toast-gain { background: #f0fdf4; } .toast-loss { background: #fef2f2; }
.toast-reward, .toast-warning { background: #fefce8; } .toast-portal { background: #f5f3ff; }
.edition-option { background: linear-gradient(180deg, #fff1f2, #fff 55%); }
.edition-option.world { background: linear-gradient(180deg, #eff6ff, #fff 55%); }
.modal h3 .fi { color: var(--m-accent); }
#game .tb-btn.trade-open { border-color: #fde68a; background: #fffbeb; }
.chat-reactions button .fi { color: #e11d48; }
.speech-reaction { color: #e11d48; }

/* Shared bank pot stays visible beside the board controls, including on phones. */
#board-tools { align-items: center; max-width: calc(100vw - 76px); }
.bank-pot { display: flex; align-items: center; gap: 7px; min-height: 40px; min-width: 0; padding: 5px 9px; border: 1px solid var(--m-line); border-radius: var(--m-r); background: var(--m-surface); color: var(--m-ink); box-shadow: var(--m-shadow); }
.bank-pot > .fi { color: var(--m-muted); font-size: 15px; }
.bank-pot > span { display: flex; flex-direction: column; min-width: 0; }
.bank-pot small { color: var(--m-muted); font-size: 10px; line-height: 1.2; }
.bank-pot b { font-size: 12px; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- phone portrait ---------- */
@media (max-width: 760px) and (orientation: portrait) {
  #board-tools { flex-wrap: wrap; gap: 6px; }
  .me-profile { padding: 8px 10px; }
  .me-money { font-size: clamp(18px, 5.2vw, 21px); }
  .wchip, .wchip.bank, .wchip.sell-card { font-size: 11px; }
  #owner-legend { display: flex; }
  .owner-legend-row, .owner-legend-row.current { flex: 1 1 0; min-width: 0; padding: 6px 6px 6px 8px; gap: 5px; border-bottom: 0; border-right: 1px solid var(--m-line); }
  .owner-legend-row:last-child { border-right: 0; }
  .owner-legend-row.current::before { top: auto; left: 0; right: 0; width: auto; height: 2px; bottom: 0; }
  .owner-legend-row b { font-size: 11px; }
  .owner-legend-row small { font-size: 10px; }
  .owner-id { min-width: 22px; height: 22px; font-size: 10px; }
  .status-chip { font-size: 11px; padding: 4px 8px; }
  #roll-hud { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  #roll-hud .roll-btn, .roll-btn { width: 76px; height: 76px; font-size: 14px; }
  .bet-pill, .bet-pill.active { min-height: 44px; padding: 0 12px; }
  #actionbar .btn { min-height: 48px; font-size: 14px; }
  .modal { padding: 18px 16px; }
  .toast { font-size: 11.5px; }

  /* Decluttered top: profile card + player strip; everything else moves into the board's empty center. */
  #me-hud { top: calc(12px + env(safe-area-inset-top, 0px)); gap: 0; }
  .me-wallet .wchip:not(.fee-due):not(.sell-card):not(.perk) { display: none; }
  .me-wallet:not(:has(.fee-due, .sell-card, .perk)) { display: none; }
  #game.has-wallet #me-hud { gap: 3px; }
  #game.has-wallet .me-wallet { width: 100%; max-width: 100%; min-height: 25px; }
  #game.has-wallet #owner-legend { top: calc(108px + env(safe-area-inset-top, 0px)); }
  #game.has-wallet #status-hud { top: max(calc(154px + env(safe-area-inset-top, 0px)), calc(var(--board-top) - 34px)); }
  .me-props { display: none !important; }
  #owner-legend { top: calc(80px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; }
  /* Sticky statuses sit in the gap between the player strip and the board, never over tiles. */
  #status-hud {
    top: max(calc(126px + env(safe-area-inset-top, 0px)), calc(var(--board-top) - 34px)); left: 12px; right: 12px; transform: none;
    max-width: none; flex-wrap: nowrap; justify-content: center; overflow-x: auto; scrollbar-width: none; pointer-events: auto;
  }
  /* Transient toasts appear just under the board. */
  #toasts { top: calc(var(--board-bottom) + 6px); left: 50%; right: auto; transform: translateX(-50%); width: min(300px, calc(100vw - 120px)); max-height: none; z-index: 9; }
  .toast { max-height: none; }
  #banner { top: calc((var(--board-top) + var(--board-bottom)) / 2 - 18px); }
}
@media (max-width: 380px) and (orientation: portrait) {
  #game #btn-event-vote { width: 40px; padding: 0; }
  #btn-event-vote span { display: none; }
}
@media (max-width: 760px) and (orientation: portrait) and (max-height: 720px) {
  #owner-legend { top: calc(76px + env(safe-area-inset-top, 0px)); }
  #game.has-wallet #owner-legend { top: calc(104px + env(safe-area-inset-top, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .deed-flip.turning .deed-inner { animation: none; } .btn, .edition-option, .avatar-opt { transition: none; } }

.wchip.perk { border-color: #ddd6fe; background: #f5f3ff; color: #5b21b6; }
.wchip.perk .fi { color: #7c3aed !important; }

/* Jail: a light rubber stamp (transform/opacity only, no filters) so it stays smooth on phones. */
.jail-stamp {
  position: absolute; left: 50%; top: calc((var(--board-top, 30vh) + var(--board-bottom, 70vh)) / 2); z-index: 12; pointer-events: none;
  display: grid; place-items: center; gap: 2px; padding: 12px 22px; border: 5px solid #c8102e; border-radius: 14px; background: rgba(255,255,255,.88);
  color: #c8102e; font-family: var(--m-font); text-align: center; box-shadow: 0 6px 16px rgba(70,0,10,.25);
  will-change: transform, opacity; animation: jailStamp 1.9s cubic-bezier(.2,1.3,.4,1) both;
}
.jail-stamp span { font-weight: 800; font-size: 15px; letter-spacing: 6px; }
.jail-stamp b { font-weight: 800; font-size: 38px; line-height: 1; letter-spacing: 2px; }
@keyframes jailStamp {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2) rotate(-14deg); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(.94) rotate(-10deg); }
  22% { transform: translate(-50%, -50%) scale(1) rotate(-10deg); }
  85% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-10deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1) rotate(-10deg); }
}
@media (prefers-reduced-motion: reduce) { .jail-stamp { animation-duration: .01s; } }
/* Chat bubble sits right above its pawn with a tail pointing down at it. */
.speech-bubble { position: absolute; transform: translate(-50%, calc(-100% - 8px)); width: max-content; max-width: min(200px, 60vw); min-width: 0; padding: 6px 10px; text-align: center; overflow: visible; }
.speech-bubble::after {
  content: ''; position: absolute; left: calc(50% + var(--tail, 0px)); bottom: -6px; width: 10px; height: 10px;
  background: var(--m-surface); border-right: 1px solid var(--m-line); border-bottom: 1px solid var(--m-line);
  transform: translateX(-50%) rotate(45deg);
}
@media (max-width: 760px) { .speech-bubble { font-size: 12px; max-width: 62vw; } }
/* ================= Popup & HUD redesign ================= */
/* Decision sheets: buy, build, utility upgrade, visit. */
.sheet-modal { padding: 0 0 18px; overflow: hidden; animation: sheetIn .32s cubic-bezier(.2,1.2,.4,1) both; }
.sheet-modal > :not(.sheet-head) { margin-left: 18px; margin-right: 18px; }
.sheet-head { --sc: var(--m-accent); position: relative; display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 16px 18px 14px; color: #fff;
  background: linear-gradient(135deg, var(--sc), color-mix(in srgb, var(--sc) 62%, #0f172a)); }
.sheet-head::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 88% 0%, #ffffff40, transparent 45%); pointer-events: none; }
.sheet-ic { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 12px; background: #ffffff2e; box-shadow: inset 0 0 0 1px #ffffff40; }
.sheet-ic .fi { color: #fff !important; }
.sheet-head small { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1.4px; opacity: .85; }
.modal .sheet-head h3 { margin: 2px 0 0; color: #fff; font-size: 19px; line-height: 1.15; }
.sheet-modal .deed, .sheet-modal .deed-flip .deed { width: 100%; }
.sheet-modal .visit-deed { margin-top: 0; }
.pay-wallet { margin-top: 12px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--m-line); border-radius: var(--m-r-lg); background: var(--m-subtle); }
.pay-wallet.compact { padding: 9px 12px; }
.pw-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12px; color: var(--m-muted); }
.pw-row b { color: var(--m-ink); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pw-row:last-child b { color: var(--m-pos); }
.pay-wallet.short .pw-row:last-child b { color: var(--m-neg); }
.pay-wallet.compact .pw-row:last-child b { color: var(--m-ink); }
.pw-bar { position: relative; height: 8px; margin: 8px 0; border-radius: 99px; background: #dcfce7; overflow: hidden; }
.pw-bar i { position: absolute; inset: 0; right: var(--used); border-radius: 99px; background: linear-gradient(90deg, #22c55e, #16a34a); transition: right .5s ease; }
.pw-bar em { position: absolute; top: 0; bottom: 0; right: 0; width: var(--used); background: repeating-linear-gradient(135deg, #fca5a5 0 5px, #fecaca 5px 10px); animation: pwCost .7s .15s ease both; }
.pay-wallet.short .pw-bar { background: #fee2e2; }
.sheet-actions { display: grid; gap: 8px; }
.modal .btn.sheet-cta { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; padding: 10px 16px; font-size: 14px; box-shadow: 0 6px 16px color-mix(in srgb, var(--b-bg) 35%, transparent); }
.sheet-cta span { display: inline-flex; align-items: center; gap: 8px; }
.sheet-cta b { padding: 4px 9px; border-radius: 99px; background: #ffffff2e; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet-cta:not(:disabled):hover { transform: translateY(-1px); }
.modal .btn.lm-cta { --b-bg: #d97706; --b-line: #d97706; background: linear-gradient(135deg, #f59e0b, #d97706); }
.sheet-gain { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; margin-bottom: 0; padding: 8px 12px; border-radius: var(--m-r); background: #f0fdf4; color: #166534; font-size: 12.5px; }
.sheet-gain s { color: var(--m-muted); }
.sheet-gain b { color: var(--m-pos); font-size: 14px; }
.level-track { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-top: 4px; margin-bottom: 4px; padding: 0; list-style: none; counter-reset: none; }
.level-track li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--m-muted); text-align: center; }
.level-track li::before { content: ''; position: absolute; top: 13px; right: 50%; width: 100%; height: 3px; background: var(--m-line); z-index: 0; }
.level-track li:first-child::before { display: none; }
.level-track li.done::before, .level-track li.now::before { background: var(--m-pos); }
.level-track li.next::before { background: repeating-linear-gradient(90deg, #f59e0b 0 6px, transparent 6px 10px); }
.level-track i { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--m-line-2); background: #fff; font-style: normal; font-size: 12px; font-weight: 700; }
.level-track li.done i { border-color: var(--m-pos); background: var(--m-pos); color: #fff; }
.level-track li.now i { border-color: var(--m-pos); color: var(--m-pos); box-shadow: 0 0 0 4px #dcfce7; }
.level-track li.now { color: var(--m-ink); }
.level-track li.next i { border-color: #f59e0b; background: #fef3c7; color: #b45309; animation: nextPulse 1.3s ease-in-out infinite; }
.level-track li.next { color: #b45309; }
.sheet-modal .purchase-warning { margin-top: 10px; padding: 8px 12px; border-radius: var(--m-r); background: #fef2f2; font-size: 12.5px; }
.sheet-modal .city-options { margin-top: 12px; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes pwCost { from { width: 0; } }
@keyframes nextPulse { 50% { box-shadow: 0 0 0 5px #fde68a99; } }

/* Toasts: icon badge, big figure for balance changes, slide-in and a life bar. */
.toast { position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 9px 12px 11px; border: 1px solid color-mix(in srgb, var(--toast-accent) 25%, #fff); border-left-width: 1px; border-radius: 12px;
  background: #fff; box-shadow: 0 10px 26px rgba(15,23,42,.14); animation: toastIn .38s cubic-bezier(.2,1.3,.4,1) both; }
.toast-icon { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 10px; background: color-mix(in srgb, var(--toast-accent) 14%, #fff); }
.toast-message { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.toast-message small { font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--toast-accent); }
.toast-amount .toast-message > b { font-size: 18px; font-weight: 800; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.toast-gain .toast-icon { animation: coinSpin .6s .1s ease both; }
.toast-life { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--toast-accent); opacity: .55; transform-origin: left; animation: toastLife 3s linear both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes toastLife { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes coinSpin { from { transform: rotateY(0) scale(.6); } to { transform: rotateY(360deg) scale(1); } }

/* Status chips: pill with a solid icon badge. */
.status-chip { gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid color-mix(in srgb, var(--effect) 30%, #fff); border-radius: 99px; background: #fff; box-shadow: 0 4px 12px rgba(15,23,42,.1); animation: toastIn .35s ease both; }
.status-chip .status-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--effect); color: #fff !important; }
.status-chip .status-icon .fi { color: #fff !important; }
.status-label { font-weight: 700; color: var(--m-ink); }
.status-count { display: inline-flex; align-items: baseline; gap: 3px; padding: 2px 7px; border-radius: 99px; background: color-mix(in srgb, var(--effect) 12%, #fff); color: var(--effect); }
.status-chip.danger { --effect: #dc2626; }
.status-chip.danger .status-icon { animation: lockShake 2.4s ease-in-out infinite; }
@keyframes lockShake { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(-12deg); } 94% { transform: rotate(10deg); } }

/* Special Event progress button and bank pot. */
#game #btn-event-vote { position: relative; overflow: hidden; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid #fde68a; border-radius: 12px; background: #fffbeb; color: #92400e; }
#game #btn-event-vote::after { content: ''; position: absolute; left: 0; bottom: 0; height: 4px; width: var(--progress, 0%); background: linear-gradient(90deg, #fbbf24, #f59e0b); transition: width .5s ease; }
#btn-event-vote .fi { color: #f59e0b !important; font-size: 17px !important; }
#btn-event-vote span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
#btn-event-vote span small { font-size: 10px; font-weight: 600; color: #b45309; }
#btn-event-vote span b { font-size: 14px; font-weight: 800; color: #78350f; }
#btn-event-vote span em { font-style: normal; font-size: 10px; font-weight: 600; color: #b45309; margin-left: 2px; }
.bank-pot { gap: 9px; min-height: 44px; padding: 5px 12px 5px 6px; border-radius: 12px; }
.bank-pot > .fi { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #eff6ff; color: var(--m-accent); }
.bank-pot b { font-size: 14px; }

/* Wallet chips: ticket-shaped odd/even counter and property chips with a tile look. */
.wchip.ticket-chip { gap: 0; padding: 0; overflow: hidden; border-color: #ddd6fe; background: #f5f3ff; }
.tk-stub { display: grid; place-items: center; align-self: stretch; padding: 0 6px; background: #7c3aed; border-right: 2px dashed #f5f3ff; }
.tk-stub .fi { color: #fff !important; }
.tk-body { display: flex; flex-direction: column; gap: 2px; padding: 3px 8px; }
.tk-body small { font-size: 9px; font-weight: 700; letter-spacing: .4px; color: #6d28d9; }
.tk-pips { display: flex; gap: 3px; }
.tk-pips i { width: 7px; height: 7px; border-radius: 2px; background: #ddd6fe; transform: rotate(45deg); }
.tk-pips i.on { background: #7c3aed; }
.pchip { position: relative; width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; padding: 0; overflow: hidden; border: 2px solid #fff; border-radius: 7px; background: #fff !important; box-shadow: 0 2px 6px rgba(15,23,42,.18), inset 0 5px 0 var(--asset-color); }
.pchip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pchip .pc-ic { position: relative; display: grid; place-items: center; width: 100%; height: 100%; padding-top: 4px; color: var(--asset-color); }
.pchip img + .pc-ic { padding: 0; align-items: end; justify-items: end; }
.pchip img + .pc-ic .fi { padding: 1px; border-radius: 4px 0 0 0; background: #fff; }
.pchip .pc-ic .fi { color: inherit !important; font-size: 11px !important; }
.pchip.lm { border-color: #fbbf24; box-shadow: 0 0 0 1px #f59e0b, 0 0 10px #fbbf2499, inset 0 5px 0 var(--asset-color); }
.pchip.lm .pc-ic { color: #d97706; }

/* Chat: colored avatar + name per player, newest message at the bottom. */
#chat-panel { display: flex; flex-direction: column; padding: 0; overflow: hidden; border-radius: 14px; box-shadow: 0 18px 40px rgba(15,23,42,.22); }
.chat-title { padding: 12px 14px; border-bottom: 1px solid var(--m-line); font-size: 14px; font-weight: 700; color: var(--m-ink); }
.chat-title button { width: 28px; height: 28px; border-radius: 8px; line-height: 1; color: var(--m-muted); }
.chat-title button:hover { background: var(--m-subtle); }
#chat-messages { display: flex; flex-direction: column; gap: 8px; min-height: 60px; max-height: 210px; padding: 12px 12px 6px; overflow-y: auto; background: var(--m-subtle); font-size: 12.5px; scroll-behavior: smooth; }
#chat-messages:empty::before { content: 'Belum ada pesan'; margin: auto; color: var(--m-muted); font-size: 12px; }
.chat-message { --player-color: var(--m-accent); display: flex; align-items: flex-end; gap: 7px; margin: 0; animation: toastIn .3s ease both; }
.chat-avatar { flex: 0 0 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--player-color); color: #fff; font-size: 11px; font-weight: 800; }
.chat-bubble { display: flex; flex-direction: column; gap: 1px; max-width: calc(100% - 34px); padding: 6px 10px; border: 1px solid var(--m-line); border-radius: 12px 12px 12px 4px; background: #fff; color: var(--m-ink); overflow-wrap: anywhere; }
.chat-bubble b { font-size: 11px; font-weight: 800; color: var(--player-color); }
.chat-message.mine { flex-direction: row-reverse; }
.chat-message.mine .chat-bubble { border-radius: 12px 12px 4px 12px; border-color: color-mix(in srgb, var(--player-color) 35%, #fff); background: color-mix(in srgb, var(--player-color) 10%, #fff); }
.chat-reactions { gap: 4px; margin: 0; padding: 8px 12px 6px; border-top: 1px solid var(--m-line); }
.chat-reactions button { padding: 5px 0; border: 0; border-radius: 8px; background: transparent; font-size: 16px; transition: transform .12s, background .12s; }
.chat-reactions button:hover { background: var(--m-subtle); transform: scale(1.2); }
#chat-form { gap: 6px; padding: 0 12px 12px; }
#chat-input { min-height: 38px; border: 1px solid var(--m-line-2); border-radius: 10px; padding: 8px 10px; font-family: var(--m-font); }
#chat-input:focus { outline: none; border-color: var(--m-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
#chat-form button { padding: 0 14px; border-radius: 10px; background: var(--m-accent); font-family: var(--m-font); font-weight: 700; }
#chat-toggle { position: relative; }
#chat-toggle.has-unread::after { content: ''; position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: #ef4444; }
@media (prefers-reduced-motion: reduce) { .sheet-modal, .toast, .toast-life, .status-chip, .chat-message, .level-track li.next i, .status-chip.danger .status-icon { animation: none !important; } }
@media (max-width: 380px) and (orientation: portrait) { #btn-event-vote span { display: none; } }
.toast-ticket { --toast-accent: #7c3aed; background: linear-gradient(90deg, #f5f3ff, #fff 60%); }
.toast-ticket .toast-icon { background: #7c3aed; color: #fff; animation: coinSpin .6s .1s ease both; }
.toast-ticket .toast-icon .fi { color: #fff !important; }
.toast-info { --toast-accent: var(--m-accent); }

/* Popups fit the visible screen (dvh excludes the phone browser's address bar) and keep their buttons pinned. */
.modal { max-height: 92vh; max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
.modal-wrap { padding-top: max(12px, env(safe-area-inset-top, 0px)); padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
.sheet-modal { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 0; }
.sheet-modal .sheet-actions, .sheet-modal .visit-actions {
  position: sticky; bottom: 0; z-index: 2; margin: 12px 0 0; padding: 12px 18px max(14px, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(rgba(255,255,255,0), #fff 14px); border-top: 1px solid transparent;
}
.sheet-modal .visit-actions { margin-left: 0; margin-right: 0; }
.sheet-modal .city-options { margin-bottom: 0; }
/* Short or phone screens: tighter sheet so deed + price + buttons usually fit without scrolling. */
@media (max-height: 760px), (max-width: 760px) {
  .sheet-head { padding: 12px 16px 10px; margin-bottom: 10px; }
  .sheet-ic { flex-basis: 34px; height: 34px; border-radius: 10px; }
  .modal .sheet-head h3 { font-size: 17px; }
  .sheet-modal > :not(.sheet-head):not(.sheet-actions):not(.visit-actions) { margin-left: 14px; margin-right: 14px; }
  .sheet-modal .deed-flip-hint { display: none; }
  .sheet-modal .deed, .sheet-modal .deed-flip .deed { margin-top: 0; margin-bottom: 0; }
  .sheet-modal .deed-head { padding: 9px 12px; }
  .sheet-modal .deed-body { padding: 9px 12px; }
  .pay-wallet { margin-top: 10px; margin-bottom: 0; padding: 9px 12px; }
  .pw-bar { margin: 6px 0; }
  .level-track i { width: 24px; height: 24px; }
  .sheet-modal .sheet-actions, .sheet-modal .visit-actions { padding: 10px 14px max(12px, env(safe-area-inset-bottom, 0px)); }
  .modal .btn.sheet-cta { min-height: 48px; }
}

/* Event popup holds still once it has appeared: every effect plays once, nothing loops. */
.event-report-top > span:first-child::after { animation-iteration-count: 1; }
.event-report-head .event-mark::after { animation-iteration-count: 1; }
.event-rays { animation: eventRays 1s ease both; }
.event-report-head .event-mark.concert { animation: eventMarkIn .7s .15s cubic-bezier(.2,1.6,.4,1) both; }

/* Server update banner (countdown before a deploy, then "reconnecting"). */
#update-notice { position: fixed; top: max(10px, env(safe-area-inset-top, 0px)); left: 50%; z-index: 1000; display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: calc(100vw - 24px); padding: 10px 16px; transform: translateX(-50%); border-radius: 14px;
  background: #0f172a; color: #fff; box-shadow: 0 12px 30px rgba(15,23,42,.35); font-family: var(--m-font); animation: toastIn .35s ease both; }
#update-notice .fi { color: #fbbf24 !important; }
#update-notice b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
#update-notice small { display: block; font-size: 11.5px; color: #cbd5e1; }
.un-spin { flex: 0 0 18px; width: 18px; height: 18px; border: 2.5px solid #ffffff40; border-top-color: #fbbf24; border-radius: 50%; animation: unSpin .8s linear infinite; }
@keyframes unSpin { to { transform: rotate(360deg); } }

/* Idle warning: countdown ring + one clear "still here" action. */
.idle-modal { text-align: center; }
.idle-warn h3 { justify-content: center; margin-top: 4px; }
.idle-ring { --p: 100%; position: relative; display: grid; place-items: center; align-content: center; width: 92px; height: 92px; margin: 2px auto 8px; border-radius: 50%;
  background: conic-gradient(#f59e0b var(--p), #fde68a55 0); }
.idle-ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }
.idle-ring b, .idle-ring small { position: relative; line-height: 1; }
.idle-ring b { font-size: 30px; font-weight: 800; color: #b45309; font-variant-numeric: tabular-nums; }
.idle-ring small { font-size: 11px; color: var(--m-muted); }
.idle-warn #idle-stay { width: 100%; min-height: 50px; margin-top: 6px; font-size: 15px; }

/* ---------- Event banner (2026-11): ringkas, tidak menghentikan permainan ---------- */
.event-banner {
  --eb-accent: #7c3aed;
  position: absolute; left: 50%; z-index: 11;
  top: calc(var(--board-top, 30vh) + (var(--board-bottom, 70vh) - var(--board-top, 30vh)) * .19);
  width: min(320px, calc(100vw - 48px));
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px;
  overflow: hidden; text-align: left; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--eb-accent) 30%, #fff); border-radius: 14px;
  background: color-mix(in srgb, var(--eb-accent) 7%, #fff);
  box-shadow: 0 10px 26px -12px rgba(15, 23, 42, .45);
  color: var(--m-ink, #0f172a); font: inherit;
  transform: translateX(-50%); animation: ebIn .42s cubic-bezier(.34, 1.56, .64, 1) both;
}
.event-banner.good { --eb-accent: var(--m-pos, #16a34a); }
.event-banner.bad { --eb-accent: var(--m-neg, #dc2626); }
.event-banner.out { animation: ebOut .26s ease-in both; }
.eb-icon { flex: 0 0 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--eb-accent); background: color-mix(in srgb, var(--eb-accent) 15%, #fff); animation: ebWiggle .7s .3s ease both; }
.eb-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.eb-text small { font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--m-muted, #64748b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eb-text b { font-size: 14px; font-weight: 800; color: var(--eb-accent); letter-spacing: .2px; }
.eb-text span { font-size: 12.5px; font-weight: 600; color: var(--m-ink-2, #334155); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eb-more { flex: 0 0 auto; color: var(--m-muted, #64748b); opacity: .7; }
.eb-life { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--eb-accent); opacity: .5; transform-origin: left; animation: toastLife 5.2s linear both; }
@keyframes ebIn { from { opacity: 0; transform: translate(-50%, -14px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes ebOut { to { opacity: 0; transform: translate(-50%, -8px) scale(.96); } }
@keyframes ebWiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg) scale(1.08); } 60% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .event-banner, .event-banner.out, .eb-icon, .eb-life { animation: none !important; } }

/* ===== Clean HUD: money, Landmark pips and one row of small icon badges; round tools on the right ===== */
#status-hud { display: none !important; }
.me-wallet, .me-props, .me-turn { display: none !important; }
.me-profile.clean { display: flex; align-items: center; gap: 10px; }
.me-profile.clean .me-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--player-color); color: #fff; font-weight: 800; font-size: 13px; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--player-color); }
.me-profile.clean.my-turn .me-avatar { animation: myTurnGlow 1.8s ease-in-out infinite; }
@keyframes myTurnGlow { 50% { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--player-color), 0 0 14px 4px var(--player-color); } }
.me-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.me-profile.clean .me-money { position: relative; font-size: 20px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.me-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.me-sub .lm-pips { display: inline-flex; align-items: center; gap: 3px; color: #b45309; }
.me-sub .lm-pips i:not(.fi) { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e5e7eb; }
.me-sub .lm-pips i.on:not(.fi) { background: #f59e0b; box-shadow: 0 0 0 1px #b45309 inset; }
.me-badges { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.hb { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border: 0; border-radius: 11px; background: #f1f5f9; color: #334155; font: 700 11px/1 var(--m-font); white-space: nowrap; }
.hb b { font-weight: 800; }
.hb.off { opacity: .45; }
.hb.danger { background: #fee2e2; color: #b91c1c; }
.hb.recession { background: #fef3c7; color: #92400e; }
.hb.reverse, .hb.portal { background: #ede9fe; color: #6d28d9; }
.hb.festival { background: #dcfce7; color: #166534; }
.hb.flood, .hb.blackout { background: #e0f2fe; color: #075985; }
.hb.vote, .hb.win { background: #fef3c7; color: #92400e; }
.hb.perk, .hb.card { background: #ecfccb; color: #3f6212; }
.hb.ticket { background: #e0e7ff; color: #3730a3; }
.hb.crazy { background: #ffe3e3; color: #c92a2a; }
.hb.crazy.off { background: #f1f3f5; color: #868e96; }
/* Waiting room: Cozy / Crazy cards. */
.diff-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.diff-pick button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px 8px; border: 2px solid var(--m-line, #e2e8f0); border-radius: 14px; background: #fff; cursor: pointer; font-family: var(--m-font); transition: transform .15s; }
.diff-pick button b { font-size: 14px; color: #1e293b; }
.diff-face { display: inline-block; font-size: 34px; line-height: 1; color: #94a3b8; transition: color .2s, transform .2s; }
.diff-pick button.sel .diff-face { transform: scale(1.12); }
.diff-pick button.sel[data-diff="cozy"] .diff-face { color: #0ca678; }
.diff-pick button.sel[data-diff="crazy"] .diff-face { color: #e03131; }
.diff-pick button.sel[data-diff="cozy"] .diff-face { animation: diffCozy 2.6s ease-in-out infinite; }
.diff-pick button.sel[data-diff="crazy"] .diff-face { animation: diffCrazy .9s ease-in-out infinite; }
@keyframes diffCozy { 50% { transform: scale(1.12) translateY(-2px) rotate(-4deg); } }
@keyframes diffCrazy { 25% { transform: scale(1.15) rotate(-12deg); } 75% { transform: scale(1.15) rotate(12deg); } }
.diff-pick button.sel[data-diff="cozy"] { border-color: #20c997; background: #e6fcf5; }
.diff-pick button.sel[data-diff="crazy"] { border-color: #fa5252; background: #fff5f5; }
.diff-pick button:disabled { opacity: .5; cursor: default; }
.hb.hb-btn { cursor: pointer; background: #16a34a; color: #fff; }
.money-delta { position: fixed; z-index: 40; font-size: 13px; font-weight: 800; white-space: nowrap; pointer-events: none; animation: moneyDelta 1.6s ease-out forwards; }
.money-delta.gain { color: #16a34a; }
.money-delta.loss { color: #dc2626; }
@keyframes moneyDelta { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }

#game #board-tools { position: fixed; top: calc(180px + env(safe-area-inset-top, 0px)); right: 12px; left: auto; bottom: auto; transform: none; display: flex; flex-direction: column; gap: 12px; max-width: none; z-index: 8; }
#game #board-tools #btn-event-vote, #game #board-tools .bank-pot { position: relative; width: 46px; height: 46px; min-width: 0; min-height: 0; padding: 0; border: 1px solid var(--m-line); border-radius: 50%; display: grid; place-items: center; background: var(--m-surface); box-shadow: var(--m-shadow); overflow: visible; }
#game #board-tools #btn-event-vote::before { content: ''; position: absolute; inset: -3px; border-radius: 50%; background: conic-gradient(#f59e0b var(--progress, 0%), #e5e7eb 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px)); }
#game #board-tools #btn-event-vote > .fi { font-size: 19px; color: #d97706; }
#game #board-tools .bank-pot > .fi { font-size: 19px; color: #0f766e; }
#game #board-tools #btn-event-vote > span, #game #board-tools .bank-pot > span { display: block; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); padding: 1px 6px; border-radius: 8px; background: #1e293b; color: #fff; line-height: 1.35; white-space: nowrap; }
#game #board-tools #btn-event-vote > span:empty { display: none; }
#game #board-tools #btn-event-vote > span b, #game #board-tools .bank-pot b { font-size: 10px; font-weight: 800; color: #fff; }
#game #board-tools .bank-pot small { display: none; }
#game #board-tools #btn-event-vote.vote-pending { animation: votePulse 1.2s ease-in-out infinite; }
@keyframes votePulse { 50% { box-shadow: 0 0 0 6px rgba(245,158,11,.3); } }
@media (max-width: 760px) and (orientation: portrait) {
  #game #board-tools { top: calc(134px + env(safe-area-inset-top, 0px)); }
}

/* ===== Special Event intro: emblem with rays, title and one line; clears itself ===== */
.event-intro { --ei: #8b5cf6; position: fixed; inset: 0; z-index: 25; pointer-events: none; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, rgba(10,14,35,.12), rgba(10,14,35,.62)); animation: eiBg 3s ease forwards; overflow: hidden; }
.event-intro.good { --ei: #f59e0b; }
.event-intro.bad { --ei: #3b82f6; }
.ei-rays { position: absolute; left: 50%; top: 45%; width: 150vmax; height: 150vmax; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--ei) 38%, transparent) 0 7deg, transparent 7deg 18deg); -webkit-mask: radial-gradient(circle, #000 0, transparent 55%); mask: radial-gradient(circle, #000 0, transparent 55%); animation: eiRays 3s linear forwards; }
/* White card so the title stays readable over a bright board. */
.ei-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: min(320px, 86vw); padding: 16px 20px 18px; border-radius: 20px; background: rgba(255,255,255,.96); border: 3px solid var(--ei); box-shadow: 0 16px 40px rgba(10,14,35,.35); text-align: center; color: #1e2540; animation: eiCard 3s cubic-bezier(.2,1.3,.4,1) forwards; }
.ei-tag { padding: 3px 10px; border-radius: 20px; background: var(--ei); color: #fff; font: 800 11px var(--m-font); letter-spacing: 4px; }
.ei-emblem { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff, color-mix(in srgb, var(--ei) 30%, #fff) 60%, var(--ei)); color: color-mix(in srgb, var(--ei) 70%, #000); box-shadow: 0 0 0 6px rgba(255,255,255,.85), 0 0 40px 10px color-mix(in srgb, var(--ei) 70%, transparent), 0 18px 30px rgba(0,0,0,.35); animation: eiPop .7s cubic-bezier(.2,1.6,.4,1) both; }
.ei-card small { font-size: 12px; font-weight: 700; letter-spacing: .5px; color: #5b6478; }
.ei-card b { font: 800 26px/1.1 var(--m-font); color: color-mix(in srgb, var(--ei) 55%, #111827); }
.ei-card > span:last-child { font-size: 14px; font-weight: 600; line-height: 1.35; color: #334155; }
@keyframes eiBg { 0% { opacity: 0; } 10% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes eiRays { from { transform: translate(-50%, -50%) rotate(0) scale(.6); } to { transform: translate(-50%, -50%) rotate(40deg) scale(1); } }
@keyframes eiCard { 0% { opacity: 0; transform: scale(.6) translateY(20px); } 12% { opacity: 1; transform: scale(1.04); } 18% { transform: scale(1); } 82% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.96) translateY(-12px); } }
@keyframes eiPop { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1) rotate(0); } }
@media (prefers-reduced-motion: reduce) { .event-intro, .ei-rays, .ei-card, .ei-emblem, .money-delta { animation-duration: .01s; } }

/* Cartoon illustrations on the title deed and the deck card front. */
.deed-art { margin: 8px 0 2px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(15,23,42,.08); }
.deed-art { position: relative; }
.deed-art img { display: block; width: 100%; aspect-ratio: 1 / 1; max-height: 40vh; object-fit: cover; object-position: center 40%; }
.deed-art-cap { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 10px; background: rgba(15,23,42,.72); color: #fff; font: 700 11px var(--m-font, sans-serif); }
.card-face.front .cf-art { display: block; width: 82%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; margin: 0 auto 8px; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.card-face.front .cf-art + .cf-mark, .card-face.front .cf-art + .cf-icon { display: none; }

/* First-visit asset download screen (js/assets.js). */
.asset-loader { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, #6fd6ff, #2d6fd8); transition: opacity .3s; }
.asset-loader.done { opacity: 0; pointer-events: none; }
.al-card { width: min(320px, 100%); padding: 22px 20px; border-radius: 18px; background: #fff; box-shadow: 0 20px 40px rgba(15,23,42,.25); text-align: center; display: flex; flex-direction: column; gap: 8px; font-family: var(--m-font, sans-serif); color: #1e293b; }
.al-card b { font-size: 20px; }
.al-text { font-size: 14px; color: #475569; }
.al-bar { height: 10px; border-radius: 6px; background: #e2e8f0; overflow: hidden; }
.al-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #22c55e, #16a34a); transition: width .2s; }
.al-size { font-size: 11px; color: #64748b; }

/* Character maker in the lobby: one compact row per choice, scrolling sideways on phones. */
.look-maker { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 6px; }
.lk-gender { display: flex; gap: 6px; }
.lk-gender button { flex: 1; min-height: 38px; border: 1px solid var(--m-line, #e2e8f0); border-radius: 12px; background: #fff; font: 800 13px var(--m-font, sans-serif); color: #334155; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.lk-gender .lk-g.sel { background: #1e293b; border-color: #1e293b; color: #fff; }
.lk-gender .lk-random { flex: 0 0 auto; padding: 0 12px; color: #7c3aed; }
.lk-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lk-label { flex: 0 0 74px; font: 700 11px var(--m-font, sans-serif); color: #64748b; }
.lk-items { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 3px 2px; min-width: 0; }
.lk-items::-webkit-scrollbar { display: none; }
.lk-sw { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; background: var(--swatch); box-shadow: 0 0 0 1px #cbd5e1; cursor: pointer; }
.lk-sw.sel { box-shadow: 0 0 0 2px #1e293b; transform: scale(1.08); }
.lk-chip { flex: none; min-height: 30px; padding: 0 11px; border: 1px solid #e2e8f0; border-radius: 15px; background: #fff; font: 700 12px var(--m-font, sans-serif); color: #334155; white-space: nowrap; cursor: pointer; }
.lk-chip.sel { background: #fde68a; border-color: #f59e0b; color: #78350f; }

/* Skin browser: arrows beside the 3D preview (swipe works too). */
.avatar-stage { position: relative; }
.lk-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 1px solid #e2e8f0; background: #fff; box-shadow: 0 4px 10px rgba(15,23,42,.12); display: grid; place-items: center; color: #334155; cursor: pointer; z-index: 2; }
.lk-arrow.prev { left: 6px; }
.lk-arrow.prev .fi { transform: scaleX(-1); }
.lk-arrow.next { right: 6px; }
.lk-arrow:active { transform: translateY(-50%) scale(.92); }

/* Opened card: themed illustration above the icon and title. */
.card-face.back .cf-scene { display: block; width: 86%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 2px solid #26304f; margin: 6px auto 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.card-face.back .cf-scene + .big { display: none; }

/* Classic Monopoly feel: title deed with a dark rule, centred title box, and framed event cards. */
.deed, .deed-flip .deed { border: 2px solid #1f2430; border-radius: 6px; background: #fffdf6; box-shadow: 0 8px 20px rgba(15,23,42,.18); padding: 8px; }
.deed-head, .deed-flip .deed-head { flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 4px; padding: 10px 12px 12px; border: 2px solid #1f2430; border-radius: 3px; }
.deed-head .dh-ic { width: auto; height: auto; background: none; box-shadow: none; }
.deed-head .dh-ic .fi { display: none; }
.deed-head .dh-ic .deed-flag { height: 22px; border-radius: 3px; box-shadow: 0 0 0 2px #fff; }
.deed-head .dh-txt, .deed-flip .dh-txt { align-items: center; text-align: center; }
.deed-head .dh-txt small, .deed-flip .dh-txt small { letter-spacing: 3px; font-size: 10px; font-weight: 800; }
.deed-head .dh-txt b, .deed-flip .dh-txt b { font-size: 19px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; }
.deed .deed-art { margin: 8px 0 4px; border: 2px solid #1f2430; border-radius: 4px; }
.deed .td-rent { margin-top: 4px; }
.deed .td-row { justify-content: space-between; }
.deed .td-row.current { background: #fff1c9; color: #1f2430; font-weight: 700; }
.card-face { border: 2px solid #1f2430 !important; border-radius: 10px !important; }
.card-face .card-face-frame { border: 2px solid rgba(31,36,48,.18); border-radius: 6px; margin: 6px; }
.card-face .cf-band { letter-spacing: 3px; font-weight: 900; }
.card-face.back strong { text-transform: uppercase; letter-spacing: .3px; }

/* Gender picker as two face icons. */
.lk-gender { justify-content: center; }
.lk-gender .lk-g { flex: 0 0 64px; min-height: 48px; color: #475569; }
.lk-gender .lk-g[data-g="m"].sel { background: #dbeafe; border-color: #3b82f6; color: #1d4ed8; }
.lk-gender .lk-g[data-g="f"].sel { background: #fce7f3; border-color: #ec4899; color: #be185d; }

/* Drawn card grows to fit its picture and title (both faces share one grid cell, so the flip still works). */
.draw-card-modal .card-flip-scene { height: auto !important; }
.draw-card-modal .card-flip { display: grid; height: auto; }
.draw-card-modal .card-face { position: relative; inset: auto; grid-area: 1 / 1; }
.draw-card-modal .card-face.back .card-face-frame { justify-content: flex-start; }
.draw-card-modal .card-face.back strong { padding: 0 6px 4px; }

/* Icon-only actions under the title deed: a compact close button and a sell button with its amount. */
.property-actions { display: flex; align-items: stretch; }
.property-actions .btn-icon { justify-content: center; gap: 8px; }
.property-actions .btn-icon.close { flex: 0 0 56px; padding: 0; }
.property-actions .btn-icon.sell { flex: 1 1 auto; color: #15803d; }
.property-actions .btn-icon .fi { line-height: 1; }
.deed-head .dh-lm { letter-spacing: 2px; font-weight: 900; }

/* Balance change: a bold coloured pill beside the money (green in, red out), easy to catch on a phone. */
.money-delta { font-size: 17px !important; font-weight: 900 !important; color: #fff !important; padding: 3px 11px; border-radius: 14px; box-shadow: 0 3px 10px rgba(15,23,42,.28); letter-spacing: .2px; animation: moneyDeltaPop 2.2s ease-out forwards !important; }
.money-delta.gain { background: #16a34a; }
.money-delta.loss { background: #dc2626; }
/* Special Events now start by themselves at a random round (14-20): the vote button is gone. */
#btn-event-vote { display: none !important; }
/* Bail paid: playful pop-up card (padlock springs open), mid-screen, never blocks input. */
.bail-pop { position: fixed; left: 50%; top: 42%; z-index: 60; display: grid; justify-items: center; gap: 1px; min-width: 170px; padding: 12px 18px 10px; border-radius: 20px; background: #fffdf5; border: 3px solid var(--bail-color, #16a34a); box-shadow: 0 6px 0 rgba(15,23,42,.18), 0 14px 30px rgba(15,23,42,.25); pointer-events: none; text-align: center; font-family: var(--m-font, system-ui), sans-serif; animation: bailPop 2.2s cubic-bezier(.2,.9,.3,1.2) forwards; }
.bail-pop .bail-lock { font-size: 40px; line-height: 1; animation: bailLock .7s .1s ease-out both; }
.bail-pop b { font-size: 22px; font-weight: 900; letter-spacing: 1px; color: var(--bail-color, #16a34a); }
.bail-pop small { font-size: 12px; font-weight: 700; color: #475569; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bail-pop .bail-amt { margin-top: 3px; padding: 2px 10px; border-radius: 10px; background: var(--bail-color, #16a34a); color: #fff; font-size: 13px; font-weight: 900; }
@keyframes bailPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-8deg); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(3deg); } 24% { transform: translate(-50%, -50%) scale(1) rotate(0); } 82% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -62%) scale(.9); } }
@keyframes bailLock { 0% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-10px) rotate(-18deg); } 65% { transform: translateY(2px) rotate(10deg); } 100% { transform: translateY(0) rotate(0); } }
@media (prefers-reduced-motion: reduce) { .bail-pop, .bail-pop .bail-lock { animation-duration: .01s; } }
/* Other players' money changes, beside their row in the owner legend (who got/paid what, without a toast or zoom). */
.legend-delta { position: fixed; z-index: 40; max-width: 62vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; padding: 2px 9px; border-radius: 11px; color: #fff; font: 800 12px/18px var(--m-font, system-ui), sans-serif; box-shadow: 0 2px 8px rgba(15,23,42,.25); animation: legendDelta 3.6s ease-out forwards; }
.legend-delta.gain { background: #16a34a; }
.legend-delta.loss { background: #dc2626; }
@keyframes legendDelta { 0% { opacity: 0; translate: 10px 0; } 8% { opacity: 1; translate: 0 0; } 85% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .legend-delta { animation: none; } }
@keyframes moneyDeltaPop { 0% { opacity: 0; transform: translateY(8px) scale(.7); } 12% { opacity: 1; transform: translateY(0) scale(1.12); } 22% { transform: scale(1); } 78% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-12px); } }

/* This device's own pawn: a bigger 'KAMU' tag with a bouncing arrow pointing at the character. */
.pawn-tag.me { z-index: 3; padding: 2px 9px; border: 2px solid #fff; border-radius: 9px; font: 900 12px/16px var(--m-font); letter-spacing: .6px; box-shadow: 0 3px 8px rgba(15,23,42,.35); animation: meBob 1.1s ease-in-out infinite; }
.pawn-tag.me::after { content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 7px solid transparent; border-top-color: var(--tag-color, #1e293b); filter: drop-shadow(0 2px 0 #fff); }
@keyframes meBob { 50% { margin-top: -7px; } }
@media (prefers-reduced-motion: reduce) { .pawn-tag.me { animation: none; } }

/* Kesempatan (black/gold) and Dana Umum (metallic gold) in the card popup. */
.card-flip-scene.chance, .draw-card-modal.chance { --card-accent: #1c1f26; --card-dark: #f2c94c; }
.card-flip-scene.dana, .draw-card-modal.dana { --card-accent: #c9a227; --card-dark: #3b2a05; }
.card-flip-scene.chance .cf-band, .card-flip-scene.chance .card-face.front strong, .card-flip-scene.chance .cf-mark { color: #f2c94c; }
.card-flip-scene.dana .card-face.front { background: linear-gradient(135deg, #e7c65a, #c9a227 45%, #f0d77f 60%, #a9831a); }
/* Own-pawn marker: just a bouncing arrow pointing down at the character. */
.pawn-tag.me { width: 0; height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 0; }
.pawn-tag.me::after { top: -10px; border-width: 9px 7px 0; border-style: solid; border-color: var(--tag-color, #1e293b) transparent transparent; filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff) drop-shadow(0 3px 3px rgba(15,23,42,.35)); }

/* White lettering on player colours (yellow included) gets a soft dark outline so it always reads. */
.player-badge, .me-avatar, .me-profile.clean .me-avatar, .chat-avatar, .pawn-tag { text-shadow: 0 0 2px rgba(15,23,42,.55), 0 1px 1px rgba(15,23,42,.45); }

/* Amount moved, floating briefly over the pawn whose money changed (visible to everyone). */
.amount-tag { position: fixed; z-index: 6; transform: translate(-50%, -100%); padding: 2px 8px; border-radius: 999px; font: 800 12px/16px var(--m-font, sans-serif); color: #fff; white-space: nowrap; pointer-events: none; box-shadow: 0 2px 6px rgba(15,23,42,.3); border: 1.5px solid #fff; }
.amount-tag.gain { background: #15803d; }
.amount-tag.loss { background: #b91c1c; }

/* Held / used cards. */
.amount-tag.perk { background: #f2c94c; color: #3b2a05; text-shadow: none; display: inline-flex; align-items: center; gap: 4px; }
.lg-perk { display: inline-flex; align-items: center; gap: 1px; margin-left: 5px; padding: 0 4px; border-radius: 6px; background: #f2c94c; color: #3b2a05; font-size: 10px; font-weight: 800; vertical-align: 1px; }

/* ===== Opening screens (loader, lobby, waiting room): minimal and light; colour comes from the content (flag, globe, buttons), no rainbow ===== */
.lobby-bg, .asset-loader { background: #fbfaf6; }
.lobby-card { position: relative; overflow: hidden; border: 0; border-radius: 24px; background: #fff; box-shadow: 0 10px 34px rgba(38,48,79,.10); }
.lobby-card::before { display: none; }
.lobby-logo { text-align: center; margin: 6px 0 18px; }
.logo-emoji, .tagline { display: none !important; }
.lobby-logo h1 span.logo-word { display: inline-flex; gap: 1px; font-size: clamp(38px, 11vw, 50px); line-height: 1.05; letter-spacing: 0; text-shadow: none; }
.logo-word i { font-style: normal; }
.logo-word i { color: #26304f; }
.lobby-logo h1 span.logo-word { padding-bottom: 6px; background: linear-gradient(#f2c94c, #f2c94c) center bottom / 56px 5px no-repeat; }
.lobby-logo h1 span::after { content: none; }
.lobby-logo h1 em { display: block; margin-top: 6px; color: #8a92a6; font-style: normal; font-weight: 700; font-size: 11px; letter-spacing: 2.5px; background: none; box-shadow: none; padding: 0; }
.edition-option, .edition-option.world { position: relative; overflow: hidden; border: 1.5px solid #ebe7dc; border-radius: 18px; background: #fff; box-shadow: none; transition: border-color .12s, transform .12s; }
.edition-option::before, .edition-option.world::before { display: none; }
.edition-option:hover { transform: translateY(-1px); border-color: #26304f; box-shadow: none; }
.edition-option img { border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.edition-option strong { color: #26304f; font-weight: 800; }
.edition-globe { color: #2563eb; }
.home-join { border-top: 1px solid #f0ece2; }
.lobby-card .btn-pink, .lobby-card .btn.btn-pink { --b-bg: #26304f; --b-line: #26304f; --b-fg: #fff; box-shadow: none; }
.lobby-card .btn-blue, .lobby-card .btn.btn-blue { --b-bg: #2563eb; --b-line: #2563eb; --b-fg: #fff; box-shadow: none; }
.lobby-card .inp { border: 1.5px solid #ebe7dc; border-radius: 12px; }
.lobby-card .inp:focus { border-color: #26304f; outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.wr-code { color: #26304f; text-shadow: none; }
.al-card { position: relative; overflow: hidden; border: 0; border-radius: 22px; background: #fff; box-shadow: 0 10px 34px rgba(38,48,79,.10); padding-top: 24px; }
.al-card::before { content: 'MONOPOLI'; display: block; font-weight: 800; font-size: 30px; line-height: 1; letter-spacing: 1px;
  color: #26304f; margin-bottom: 6px; }
.al-card::after { display: none; }
.al-card b { font-size: 15px; color: #26304f; }
.al-bar { height: 8px; border: 0; border-radius: 6px; background: #f0ece2; }
.al-bar i { background: #2563eb; border-radius: 6px; }

/* ===== Portrait HUD v3: two tidy rows above the board; nothing floats over the tiles ===== */
@media (max-width: 760px) and (orientation: portrait) {
  #game #topbar { top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; }
  #game #topbar .tb-logo { display: none; }
  #game #me-hud { top: calc(10px + env(safe-area-inset-top, 0px)); left: 12px; max-width: calc(100vw - 222px); }
  #game .me-profile.clean { padding: 5px 12px 5px 5px; border: 0; border-radius: 999px; background: #fff; box-shadow: 0 2px 10px rgba(38,48,79,.12); }
  #game .me-profile.clean .me-avatar { width: 34px; height: 34px; font-size: 12px; }
  #game .me-profile.clean .me-money { font-size: 17px; }
  #game .me-sub { gap: 4px; }
  #game #board-tools { top: calc(10px + env(safe-area-inset-top, 0px)); right: 62px; flex-direction: row; align-items: center; gap: 8px; }
  #game #board-tools #btn-event-vote { width: 42px; height: 42px; }
  #game #board-tools .bank-pot { width: auto; height: 42px; padding: 0 12px 0 10px; border: 0; border-radius: 21px; display: flex; align-items: center; gap: 6px; box-shadow: 0 2px 10px rgba(38,48,79,.12); }
  #game #board-tools .bank-pot > span { position: static; transform: none; padding: 0; background: none; }
  #game #board-tools .bank-pot b { color: #0f766e; font-size: 13px; }
  #game #board-tools #btn-event-vote { border: 0; box-shadow: 0 2px 10px rgba(38,48,79,.12); }
  #game #owner-legend, #game.has-wallet #owner-legend { top: calc(74px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border: 0; background: none; box-shadow: none; overflow: visible; }
  #game .owner-legend-row, #game .owner-legend-row.current { position: relative; min-width: 0; padding: 5px 8px 5px 5px; gap: 6px; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 1px 6px rgba(38,48,79,.10); }
  #game .owner-legend-row.current { background: color-mix(in srgb, var(--player-color) 14%, #fff); box-shadow: 0 0 0 2px var(--player-color); }
  #game .owner-legend-row.current::before { display: none; }
  #game .owner-legend-row > div { min-width: 0; }
  #game .owner-legend-row b { display: block; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #game .owner-legend-row small { display: block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #game .owner-id { min-width: 24px; height: 24px; border-radius: 8px; font-size: 10px; }
}
/* International edition: a small fan of three flags instead of a round globe. */
.edition-flags { position: relative; width: 56px; height: 42px; }
.edition-option .edition-flags img { position: absolute; width: 34px; height: 24px; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 2px 4px rgba(38,48,79,.12); }
.edition-flags img:nth-child(1) { left: 0; top: 12px; transform: rotate(-12deg); }
.edition-flags img:nth-child(2) { left: 11px; top: 4px; z-index: 1; }
.edition-flags img:nth-child(3) { left: 22px; top: 12px; transform: rotate(12deg); z-index: 2; }
/* Landmark progress: icon + "n/4" so it is clear what the four are. */
.lm-count { font-size: 11px; font-weight: 800; color: #b45309; margin: 0 2px; }
.lg-lm { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; color: #b45309; font-weight: 800; }
.lg-lm .fi { color: #d97706 !important; }
/* Any screen too short for a lobby card (small laptops, landscape phones): the card scrolls inside the screen,
   and in the waiting room the Bot / Mulai buttons stay pinned to its bottom edge so the game can always start. */
.screen .lobby-card { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
#waitroom .lobby-card { padding-bottom: 0; }
#waitroom .btn-row { position: sticky; bottom: 0; z-index: 2; margin-top: 8px; padding: 10px 0 12px; background: #fff; box-shadow: 0 -10px 12px -10px rgba(38,48,79,.18); }
/* Waiting room on a portrait phone: compact, and the Bot / Mulai buttons stay pinned at the bottom of the card. */
@media (max-width: 760px) and (orientation: portrait) {
  #waitroom .lobby-card { max-height: calc(100dvh - 24px); overflow-y: auto; padding-bottom: 0; }
  #waitroom .wr-title { font-size: 13px; margin: 0; }
  #waitroom .wr-code { font-size: 34px; margin: 2px 0 4px; }
  #waitroom .wr-edition { margin: 0; }
  #waitroom .lbl { margin: 8px 0 4px; }
  #waitroom #wr-players > div { padding: 6px 8px; min-height: 0; }
  #waitroom .btn-row { position: sticky; bottom: 0; z-index: 2; margin: 8px -4px 0; padding: 10px 4px 12px; background: #fff; box-shadow: 0 -10px 12px -10px rgba(38,48,79,.18); }
  #waitroom .btn.big { margin-top: 0; padding: 12px; font-size: 16px; }
  #waitroom #btn-leave { margin: 4px 0 10px; }
}
/* Portrait: Special Event and the bank pot sit side by side just under the player list (free space above the board). */
@media (max-width: 760px) and (orientation: portrait) {
  #game #me-hud { max-width: calc(100vw - 76px); }
  #game #board-tools { top: calc(var(--legend-bottom, 160px) + 8px); left: 12px; right: auto; flex-direction: row; }
  /* Odd player count: the tools fill the empty half of the list's last row instead of dropping onto the board. */
  #game.tools-in-legend #board-tools { top: var(--tools-top); left: var(--tools-left); width: var(--tools-w); gap: 6px; }
  #game.tools-in-legend #board-tools #btn-event-vote { flex: none; width: var(--tools-h); height: var(--tools-h); }
  #game.tools-in-legend #board-tools .bank-pot { flex: 1; min-width: 0; height: var(--tools-h); justify-content: center; border-radius: 12px; }
}

/* "Cara main": 3-step goal strip, tabs, and a grid of small icon cards (one short line each). */
.rules-modal { width: min(460px, 94vw); }
.rules-pro h3 { justify-content: center; margin-bottom: 10px; }
.rl-goal { display: flex; align-items: stretch; justify-content: center; gap: 4px; }
.rl-goal > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px; border-radius: 12px; background: #f1f5f9; color: #334155; font: 700 11.5px/1.2 var(--m-font); text-align: center; }
.rl-goal > div .fi { color: #2563eb; }
.rl-goal > div.win { background: linear-gradient(160deg, #fff3bf, #ffe066); color: #7c4a03; }
.rl-goal > div.win .fi { color: #e67700; }
.rl-goal > div.win b { color: #c92a2a; }
.rl-goal > i { align-self: center; font-style: normal; font-weight: 900; color: #94a3b8; }
.rl-alt { margin: 6px 0 10px; text-align: center; font: 600 11.5px var(--m-font); color: #64748b; }
.rl-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: #f1f5f9; margin-bottom: 10px; }
.rl-tabs button { flex: 1; padding: 7px 2px; border: 0; border-radius: 9px; background: transparent; color: #64748b; font: 700 12px var(--m-font); cursor: pointer; }
.rl-tabs button.active { background: #fff; color: #1e293b; box-shadow: 0 1px 4px rgba(15,23,42,.12); }
.rl-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 46vh; overflow-y: auto; }
.rl-panel[hidden] { display: none; }
.rl-card { display: flex; align-items: flex-start; gap: 8px; padding: 8px 9px; border: 1px solid #e2e8f0; border-radius: 11px; background: #fff; text-align: left; }
.rl-card > .fi { flex: none; margin-top: 1px; color: #2563eb; }
.rl-card b { display: block; font: 800 12px/1.2 var(--m-font); color: #1e293b; }
.rl-card span { display: block; margin-top: 2px; font: 500 11px/1.3 var(--m-font); color: #64748b; }
.rl-credits { margin-top: 10px; font: 500 10.5px/1.4 var(--m-font); color: #94a3b8; text-align: left; }
.rl-credits summary { cursor: pointer; font-weight: 700; }
@media (max-width: 380px) { .rl-panel { grid-template-columns: 1fr; } }

/* Roll HUD: a big chunky dice button between two tear-off parity tickets. */
#roll-hud { gap: 12px; align-items: center; }
#roll-hud .roll-btn { width: 96px; height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; border: 4px solid #fff; border-radius: 28px;
  background: linear-gradient(160deg, #4ade80, #16a34a 55%, #15803d); color: #fff; box-shadow: 0 7px 0 #14532d, 0 14px 26px rgba(22,163,74,.45); transition: transform .08s, box-shadow .08s; animation: rollIdle 2.8s ease-in-out infinite; }
#roll-hud .roll-btn b { font: 900 15px var(--m-font); letter-spacing: 1.5px; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
#roll-hud .roll-btn .rb-dice { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: #fff; color: #15803d; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
#roll-hud .roll-btn:hover { background: linear-gradient(160deg, #4ade80, #16a34a 55%, #15803d); filter: brightness(1.05); }
#roll-hud .roll-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 #14532d, 0 6px 14px rgba(22,163,74,.35); animation: none; }
@keyframes rollIdle { 0%, 82%, 100% { transform: rotate(0); } 86% { transform: rotate(-6deg) scale(1.04); } 90% { transform: rotate(5deg) scale(1.04); } 94% { transform: rotate(-3deg); } }
#roll-hud .roll-tickets { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 2px 9px; border: 0; border-radius: 10px; background: rgba(255,255,255,.92); color: #475569; font: 700 11px var(--m-font); box-shadow: 0 2px 6px rgba(15,23,42,.12); }
.bet-ticket { --tk: #f59f00; --tk-dark: #b45309; position: relative; width: 78px; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 6px 4px;
  border: 2px dashed var(--tk); border-radius: 10px; background: #fff; color: var(--tk-dark); cursor: pointer; pointer-events: auto; font-family: var(--m-font); box-shadow: 0 4px 0 rgba(15,23,42,.12), 0 8px 16px rgba(15,23,42,.1);
  -webkit-mask: radial-gradient(circle 7px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 7px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 7px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 7px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
  transition: transform .15s, background .15s; }
.bet-ticket.even { --tk: #7048e8; --tk-dark: #5f3dc4; }
.bet-ticket small { font-size: 9px; font-weight: 800; letter-spacing: 2px; opacity: .75; }
.bet-ticket b { font-size: 15px; font-weight: 900; letter-spacing: .5px; }
.bet-ticket.odd { transform: rotate(-5deg); }
.bet-ticket.even { transform: rotate(5deg); }
.bet-ticket.active { background: var(--tk); color: #fff; border-style: solid; border-color: #fff; transform: rotate(0) scale(1.08); box-shadow: 0 0 0 3px var(--tk), 0 10px 22px color-mix(in srgb, var(--tk) 45%, transparent); }
.bet-ticket:disabled { filter: grayscale(1); opacity: .45; cursor: not-allowed; }
@media (max-width: 760px) and (orientation: portrait) {
  #roll-hud .roll-btn { width: 84px; height: 84px; border-radius: 24px; }
  .bet-ticket { width: 70px; min-height: 52px; }
}
@media (prefers-reduced-motion: reduce) { #roll-hud .roll-btn { animation: none; } }

/* The Special Event vote now sits next to the chat button (same size), with a ballot icon, a progress bar and a count badge. */
#game #board-tools { display: none; }
#game #chat-ui { display: flex; align-items: flex-end; gap: 8px; }
#game #chat-ui > .tb-btn { width: 44px; height: 44px; min-width: 0; min-height: 0; padding: 0; display: grid; place-items: center; }
#game #chat-ui #btn-event-vote { position: relative; overflow: visible; border: 1px solid #fde68a; background: #fffbeb; }
#game #chat-ui #btn-event-vote[hidden] { display: none; }
#game #chat-ui #btn-event-vote::after { left: 6px; right: auto; bottom: 4px; max-width: calc(100% - 12px); height: 3px; border-radius: 2px; }
#game #chat-ui #btn-event-vote > .fi { font-size: 19px !important; color: #d97706 !important; }
#game #chat-ui #btn-event-vote > span { position: absolute; top: -7px; right: -6px; padding: 1px 6px; border-radius: 8px; background: #1e293b; line-height: 1.35; }
#game #chat-ui #btn-event-vote > span:empty { display: none; }
#game #chat-ui #btn-event-vote > span b { font-size: 10px; font-weight: 800; color: #fff; }
#game #chat-ui #btn-event-vote.vote-pending { animation: votePulse 1.2s ease-in-out infinite; }
/* While a game is still loading, the corner buttons stay hidden. */
#game:not(.ready) #chat-ui { visibility: hidden; }

/* Mode Crazy: the bank pot burns every round. */
.me-bank.burning b { color: #e03131; animation: bankBurn .25s ease-in-out 6; }
@keyframes bankBurn { 50% { transform: translateX(-2px); text-shadow: 0 0 8px #ff922b; } }
