/* Hub palette so this reads as a sibling of the other game sites. */
:root {
  --bg: #0f1117; --bg-soft: #161923; --card: #1a1e2b; --card-hover: #212636;
  --line: #2a3042; --text: #e8eaf0; --muted: #969db4;
  --accent: #6ea8fe; --accent-warm: #f0b354;
  --good: #6ee7a8; --bad: #f08c8c; --mid: #f0d36e;
  --sq: #1d2231; --sq-line: #333b52;
  --radius: 12px;
  --head: 44px; --tabh: 58px;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); overflow: hidden;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; overflow-x: clip;
}
button, input, select, textarea { font: inherit; color: inherit; }
input, select { font-size: 16px; }
button { cursor: pointer; }

#app { height: 100vh; height: 100dvh; display: grid; grid-template-rows: var(--head) 1fr auto; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 14px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--bg); min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -.01em; font-size: 17px; }
.brand svg { width: 24px; height: 24px; color: var(--text); }
.ver { margin-left: auto; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.tabs-top { display: none; gap: 4px; }
.tabs-top button { background: none; border: 0; padding: 8px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.tabs-top button[aria-current="page"] { color: var(--text); background: var(--card); }

/* ---------- bottom tabs (phone) ---------- */
.tabs-bottom { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: var(--bg-soft); padding-bottom: env(safe-area-inset-bottom); }
.tabs-bottom button { background: none; border: 0; height: var(--tabh); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 600; transition: color .15s; }
.tabs-bottom button svg { width: 22px; height: 22px; }
.tabs-bottom button[aria-current="page"] { color: var(--accent-warm); }
.tabs-bottom button.hub svg { width: 28px; height: 28px; }
.tabs-bottom button:active { transform: scale(.97); }

/* ---------- main ---------- */
main { min-height: 0; display: flex; flex-direction: column; align-items: center; padding: 8px 8px 0; gap: 8px; overflow: hidden; }
.board-col { flex: none; }
.board-wrap { position: relative; width: 360px; height: 360px; }
#board { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; }
.cam { position: absolute; inset: 0; transform-origin: 0 0; }
.cbox { position: absolute; left: 13.6%; top: 13.6%; width: 72.8%; height: 72.8%; pointer-events: none; z-index: 1; }
.center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6px; overflow: hidden; pointer-events: none; }
.center > * { pointer-events: auto; }
.panel-col { flex: 1; min-height: 0; width: 100%; max-width: 560px; overflow-y: auto; overscroll-behavior: contain; padding: 0 2px 12px; scrollbar-width: thin; }

@media (min-width: 900px) {
  #app { grid-template-rows: 56px 1fr; }
  :root { --head: 56px; }
  .tabs-top { display: flex; }
  .tabs-bottom { display: none; }
  main { flex-direction: row; align-items: stretch; justify-content: center; padding: 16px 20px; gap: 22px; }
  .board-col { display: flex; align-items: flex-start; }
  .panel-col { flex: 0 1 480px; max-width: 500px; padding: 0 4px 16px; }
}
/* phone: the version lives in Settings; small buttons still get a 40px tap target;
   game player rows are one line each so more of the table fits above the tab bar */
@media (max-width: 899px) {
  .ver { display: none; }
  .btn.small { min-height: 40px; min-width: 40px; }
  .prow { min-height: 40px; padding: 5px 10px; }
  .prow .name br { display: none; }
  .prow .name .sub { margin-left: 6px; }
  .prow .v { display: flex; align-items: baseline; gap: 6px; }
  .prow .v small { display: inline; }
}
.prow.turn { box-shadow: inset 3px 0 0 var(--pc), 0 0 0 1px var(--pc); }

/* ---------- board: the real board's mint paper, black rules, printed caps ---------- */
.board-wrap { border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 3px 0 #b8c9b8, 0 4px 0 rgba(0,0,0,.45), 0 14px 30px rgba(0,0,0,.55); }
.board-paper { fill: #d3e7d3; }
.sq rect.base { fill: #d3e7d3; stroke: #17201a; stroke-width: 2; }
.sq .band { stroke: #17201a; stroke-width: 2; }
.sq { cursor: pointer; }
.sq.sel rect.base { stroke: #e0413a; stroke-width: 7; }
.sq text, .vals text { font-family: "Arial Narrow", "Helvetica Neue", Arial, system-ui, sans-serif; text-anchor: middle; fill: #17201a; pointer-events: none; }
.sq .nm { font-weight: 700; letter-spacing: .02em; }
.sq.inv .nm, .sq.inv .price, .sq.inv .sprice { fill: #e8eaf0; }
.vals .val { font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.sq .price { font-size: 15px; font-weight: 700; }
.board-small .sq .print, .board-small .sq .price { display: none; }
.board-small .vals .val { font-size: 25px; }
.sq .sprice { display: none; font-size: 25px; font-weight: 800; font-variant-numeric: tabular-nums; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.board-small .sq .sprice { display: inline; }
.board-small .sq .glyph { transform: scale(1.25); }
.board-felt { fill: #d3e7d3; stroke: #17201a; stroke-width: 2.5; }
/* pewter playing pieces on a base in the player's colour */
.token .pewter { fill: url(#pewter); stroke: #3f454d; stroke-width: 1.4; stroke-linejoin: round; }
.token .base { stroke: rgba(0,0,0,.6); stroke-width: 1.5; }
.token .shadow { fill: rgba(0,0,0,.35); }
.token { filter: drop-shadow(1px 2px 1.5px rgba(0,0,0,.45)); }
.token.turn .base { stroke: #fff; stroke-width: 3; }
.house { stroke: #0b1f10; stroke-width: 1.6; stroke-linejoin: round; }
.ownmark { stroke: #17201a; stroke-width: 1.5; }
.sq .mort { letter-spacing: .08em; }

/* Chance + Community Chest decks lying on their places in the middle of the board */
.mdeck { position: absolute; --card-w: calc(var(--bw, 360px) * .175); --ratio: 3.5 / 2.2; pointer-events: none; z-index: 0; translate: -50% -50%; }
.mdeck.chest { left: 25.5%; top: 25.5%; rotate: 135deg; }
.mdeck.chance { left: 74.5%; top: 74.5%; rotate: -45deg; }
.mdeck .tbl-back { --back-frame: #fbf6e8; }
.mback.chance { --back: #ef8a2a; }
.mback.chest { --back: #f2cf3e; }
.mback.chance::before { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; font: 900 calc(var(--card-w) * .42)/1 Georgia, serif; color: #fff4e2; text-shadow: 0 1px 0 #a24f07; }
.mback.chest::before { content: ""; position: absolute; inset: 20% 28%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-23 -21 46 41'%3E%3Cpath d='M-21 -3 V-11 Q0 -19 21 -11 V-3 Z' fill='%23a8641f' stroke='%235a3410' stroke-width='1.5'/%3E%3Crect x='-21' y='-3' width='42' height='21' rx='1.5' fill='%2392521a' stroke='%235a3410' stroke-width='1.5'/%3E%3Cpath d='M-13 -15 V18 M13 -15 V18' stroke='%23fff0b0' stroke-width='3'/%3E%3Crect x='-4.5' y='-6' width='9' height='10' rx='1' fill='%23fff0b0'/%3E%3C/svg%3E") center / contain no-repeat; }
.center { z-index: 1; color: #17201a; }
.center .cap, .center .csub { color: #3d4a40; }
.center .cap.turn { color: #17201a; }
.center .big, .center .cap span, .center .ctitle[style] { text-shadow: 0 1px 0 rgba(0,0,0,.6), 0 0 1px rgba(0,0,0,.9), 0 0 6px rgba(255,255,255,.4); }
.center .help { background: #eef6ee; border-color: #8aa58f; color: #3d4a40; }
.center .btn:not(.warm):not(.primary) { background: #fbfaf5; border-color: #8aa58f; color: #17201a; }
.center .btn.danger { color: #b3261e; border-color: #c98a86; }

/* ---------- center content ---------- */
.big { font-size: clamp(28px, 9vw, 52px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.cap { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ctitle { font-weight: 700; font-size: 15px; line-height: 1.2; }
.csub { color: var(--muted); font-size: 12.5px; }
.chip-band { width: 40%; height: 6px; border-radius: 3px; margin: 2px auto 6px; }
.center .row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.center .btn { padding: 8px 12px; font-size: 14px; }
.cap.turn { font-size: 13px; color: var(--text); }
@media (min-width: 900px) {
  .center .btn { padding: 13px 24px; font-size: 17px; border-radius: 12px; }
  .center .row { gap: 10px; margin-top: 10px; }
  .ctitle { font-size: 26px; }
  .csub { font-size: 14px; }
  .center .csub { font-size: 16px; }
  .big { font-size: 72px; }
  .cap.turn { font-size: 15px; }
}

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 14px; font-weight: 650; min-height: 40px; transition: background .12s, border-color .12s, transform .06s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0d1424; }
.btn.warm { background: var(--accent-warm); border-color: var(--accent-warm); color: #1d1404; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; min-height: 32px; font-size: 13.5px; border-radius: 8px; }
.btn.danger { border-color: #6b3434; color: var(--bad); }
.seg { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; padding: 6px 11px; border-radius: 8px; color: var(--muted); font-weight: 650; font-size: 13.5px; }
.seg button[aria-pressed="true"] { background: var(--card-hover); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.help { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted); font-size: 12px; font-weight: 700; padding: 0; vertical-align: middle; margin-left: 4px; flex: none; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 14px; transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(18px); }
.num { width: 92px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; text-align: right; font-variant-numeric: tabular-nums; }
select.sel { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; }

/* ---------- panel ---------- */
.ph { display: flex; align-items: center; gap: 8px; margin: 4px 2px 8px; flex-wrap: wrap; }
.ph h2 { margin: 0; font-size: 16px; }
.ph .grow { flex: 1; }
.list { display: flex; flex-direction: column; gap: 2px; }
.rowi { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--card); min-height: 44px; }
.rowi.tap { cursor: pointer; }
.rowi.tap:active { background: var(--card-hover); }
.rowi .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.rowi .band { width: 6px; align-self: stretch; border-radius: 3px; flex: none; }
.rowi .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rowi .sub { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.rowi .v { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; white-space: nowrap; }
.rowi .v small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.sec { margin: 14px 2px 6px; font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; display: flex; align-items: center; }
table.t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13.5px; }
table.t th { color: var(--muted); font-weight: 600; text-align: right; padding: 4px 6px; font-size: 12px; }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t td { padding: 7px 6px; text-align: right; border-top: 1px solid var(--line); }
table.t tr.tap { cursor: pointer; }
.empty { color: var(--muted); padding: 14px; text-align: center; font-size: 14px; }
.log { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.log div:last-child { color: var(--text); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted); }

/* ---------- fairness meter ---------- */
.meter { position: relative; height: 14px; border-radius: 7px; background: linear-gradient(90deg, #e0675f, #f0d36e 42%, #6ee7a8 50%, #f0d36e 58%, #e0675f); margin: 10px 0 4px; }
.meter .needle { position: absolute; top: -5px; width: 4px; height: 24px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 2px #0f1117; transition: left .3s ease; }
.meter-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ---------- sheet ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(5, 7, 12, .55); z-index: 20; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--card); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; max-height: 82dvh; overflow-y: auto; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(0,0,0,.45); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet h3 { margin: 0 0 4px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.sheet .acts { display: flex; gap: 10px; margin-top: 14px; }
.sheet .acts .btn { flex: 1; }
.line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.line:first-of-type { border-top: 0; }
.line .lbl { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--bg-soft); border-radius: 999px; padding: 6px 11px; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; }
.chip[aria-pressed="true"] { border-color: var(--accent-warm); background: rgba(240,179,84,.14); color: var(--accent-warm); }
.chip:disabled { opacity: .35; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }
@media (min-width: 900px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 460px; transform: translate(-50%, -50%); border-radius: 16px; border: 1px solid var(--line); max-height: 86vh; animation: pop .16s ease-out; }
  @keyframes pop { from { opacity: .3; transform: translate(-50%, -48%); } to { opacity: 1; transform: translate(-50%, -50%); } }
}
.toast { position: fixed; left: 50%; bottom: calc(var(--tabh) + 14px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #262c3d; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; z-index: 30; font-size: 14px; max-width: 92vw; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* dice: real white dice thrown onto the board, each at its own angle */
.dice { display: flex; gap: 10px; justify-content: center; margin: 4px 0; }
.mdie { --die-size: 34px; transform: translate(var(--jx), var(--jy)) rotate(var(--jr)); }
.mdie.roll { animation: roll .5s cubic-bezier(.2,.7,.3,1); }
@keyframes roll { 0% { transform: translate(-30px, 70px) rotate(-260deg) scale(.85); } 55% { transform: translate(4px, -6px) rotate(calc(var(--jr) + 20deg)) scale(1.06); } 80% { transform: translate(var(--jx), calc(var(--jy) - 3px)) rotate(var(--jr)); } 100% { transform: translate(var(--jx), var(--jy)) rotate(var(--jr)); } }
@media (min-width: 900px) { .dice { gap: 16px; margin: 8px 0; } .mdie { --die-size: 60px; } .cardnote { font-size: 15px; padding: 10px 16px 12px; } .cardnote b { font-size: 12px; } }
/* a drawn Chance / Community Chest card, face up in the middle */
.cardnote { position: relative; background: #fcd9a8; color: #2a1a08; border-radius: 6px; padding: 6px 12px 8px; font: 600 12.5px/1.3 Georgia, "Times New Roman", serif; max-width: 88%; margin: 4px auto; border: 1px solid rgba(0,0,0,.35); box-shadow: inset 0 0 0 3px #fff7ea, inset 0 0 0 4px rgba(0,0,0,.18), 0 1px 1px rgba(0,0,0,.3), 0 6px 14px rgba(0,0,0,.35); rotate: -1.5deg; }
.cardnote.chest { background: #f9e79a; }
.cardnote b { display: block; font: 800 10px/1.4 system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #a24f07; }
.cardnote.chest b { color: #1f4f9a; }
.cardnote.flipin { animation: flipin .42s cubic-bezier(.3,.7,.3,1); }
@keyframes flipin { from { transform: perspective(500px) rotateY(90deg); } to { transform: perspective(500px) rotateY(0); } }
@media (prefers-reduced-motion: reduce) { .token { transition: none; } .mdie.roll, .sheet, .cardnote.flipin { animation: none; } }

/* ---------- the table during a game: seats, your area, side panel ---------- */
.seats, .mine { width: 100%; flex: none; }
.seats { display: flex; gap: 6px; height: 54px; }
.seat { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 3px 4px; border-radius: 8px; cursor: pointer; background: rgba(0,0,0,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.seat.turn { box-shadow: inset 0 0 0 2px var(--pc), 0 0 12px rgba(255,220,150,.18); }
.seat.out { opacity: .4; }
.plate { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font: 700 12px/18px system-ui, sans-serif; color: #f6efdc; white-space: nowrap; overflow: hidden; }
.plate .pn { overflow: hidden; text-overflow: ellipsis; }
.plate .ps { color: rgba(246,239,220,.6); font-weight: 600; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.pdot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.6), transparent 55%), var(--pc); box-shadow: 0 1px 2px rgba(0,0,0,.6); }
.sarea { display: flex; align-items: flex-end; gap: 4px; min-width: 0; flex: 1; }
.sdeeds { display: flex; gap: 2px; align-items: flex-end; min-width: 0; overflow: hidden; flex: 1; }
.scash { display: flex; align-items: center; gap: 3px; flex: none; }
.scash b, .mcash b { font: 800 12px/1 system-ui, sans-serif; color: #f6efdc; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.sworth { font-size: 11px; color: rgba(246,239,220,.6); }
.seats .bills { --bw2: 22px; }

/* paper money, sorted in stacks by note */
.bills { --bw2: 44px; display: inline-flex; gap: 3px; align-items: flex-end; }
.bstack { position: relative; width: var(--bw2); height: calc(var(--bw2) * .53 + (var(--n) - 1) * 2px); flex: none; }
.bill { position: absolute; left: calc(var(--i) * 1px); bottom: calc(var(--i) * 2px); width: 100%; height: calc(var(--bw2) * .53); box-sizing: border-box; border-radius: 2px; background: var(--bc); border: 1px solid rgba(0,0,0,.28); box-shadow: inset 0 0 0 2px rgba(255,255,255,.5), inset 0 0 0 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.35); display: grid; place-items: center; rotate: calc((var(--i) - 1) * 1.2deg); }
.bill b { font: 800 calc(var(--bw2) * .26)/1 Georgia, serif; color: rgba(40,30,15,.75); }
.seats .bill b { display: none; }

/* title deeds: colour band at the top, rent lines under it; sets overlap like real holdings */
.dset { display: inline-flex; flex: none; }
.dset + .dset { margin-left: calc(var(--dw) * .12); }
.dset > .deed + .deed { margin-left: calc(var(--dw) * -.66); }
.deed { position: relative; flex: none; width: var(--dw); aspect-ratio: 5 / 6; box-sizing: border-box; border-radius: 2px; background: #fbf9f2; border: 1px solid rgba(0,0,0,.35); box-shadow: 0 1px 2px rgba(0,0,0,.4); display: flex; flex-direction: column; align-items: stretch; padding: calc(var(--dw) * .07); gap: calc(var(--dw) * .05); overflow: hidden; }
.deed em { display: block; height: 30%; background: var(--dc); border: 1px solid rgba(0,0,0,.4); font: 800 calc(var(--dw) * .17)/1 system-ui, sans-serif; color: #111; font-style: normal; text-align: center; overflow: hidden; white-space: nowrap; padding-top: calc(var(--dw) * .04); text-transform: uppercase; }
.deed.rr em, .deed.util em { background: #fff; }
.deed u { display: block; height: 1px; margin: 0 8%; background: rgba(0,0,0,.25); }
.deed.back { background: #f6efe0; justify-content: center; align-items: center; }
.deed.back i { font: 900 calc(var(--dw) * .4)/1 Georgia, serif; color: #c0312a; font-style: normal; }
.deed.flying { --dw: 40px; }
.seats .deed em { font-size: 0; }
.jcard { flex: none; width: calc(var(--dw) * 1.2); aspect-ratio: 3.5 / 2.2; border-radius: 2px; background: #ef8a2a; border: 1px solid rgba(0,0,0,.35); box-shadow: inset 0 0 0 2px #fbf6e8, 0 1px 2px rgba(0,0,0,.4); margin-left: 4px; align-self: flex-end; }
.jcard.chest { background: #f2cf3e; }

/* your own area at the bottom edge */
.mine { display: flex; flex-direction: column; gap: 6px; height: 104px; }
.mrow { flex: 1; min-height: 0; display: flex; align-items: flex-end; gap: 10px; padding: 0 2px; }
.mdeeds { flex: 1; min-width: 0; display: flex; align-items: flex-end; overflow: hidden; cursor: pointer; padding-bottom: 2px; }
.dspot { --card-w: 34px; --ratio: 5 / 6; }
.mcash { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.mcash .bills { --bw2: 30px; flex-wrap: wrap; justify-content: flex-end; max-width: 140px; }
.mcash b { font-size: 15px; }
.mbar { display: flex; align-items: center; gap: 6px; flex: none; }
.mbar .grow { flex: 1; }
.mbar .plate { padding: 0 8px; border-radius: 4px; height: 26px; background: linear-gradient(#3b2a1a, #24180d); border: 1px solid #7a5a2e; }
.mbar .plate.turn { border-color: var(--pc); box-shadow: 0 0 0 2px var(--pc); }
.mbar .btn.small { background: rgba(20,22,30,.82); }
.playing .panel-col { display: none; }

@media (min-width: 900px) {
  .playing main { display: grid; grid-template-columns: 210px auto 290px; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "seats board side" "seats mine side"; justify-content: center; align-items: start; column-gap: 18px; row-gap: 10px; }
  .playing .seats { grid-area: seats; flex-direction: column; height: auto; gap: 10px; }
  .playing .seat { flex: none; padding: 8px 10px; gap: 6px; }
  .playing .seat .sarea { flex-direction: column; align-items: flex-start; gap: 6px; }
  .playing .seat .sdeeds { flex-wrap: wrap; row-gap: 4px; }
  .playing .seats .bills { --bw2: 30px; }
  .playing .plate { font-size: 13.5px; }
  .playing .board-col { grid-area: board; }
  .playing .mine { grid-area: mine; height: 128px; width: auto; }
  .playing .mcash .bills { --bw2: 40px; max-width: 220px; }
  .playing .mcash b { font-size: 17px; }
  .playing .panel-col { display: block; grid-area: side; grid-row: 1 / span 2; align-self: stretch; max-width: none; min-height: 0; background: rgba(12,14,20,.78); border-radius: 12px; padding: 10px 12px 16px; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
}
/* phone held sideways: seats | board | your area side by side */
@media (max-width: 899px) {
  .playing.land main { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.35fr); grid-template-areas: "seats board mine"; align-items: start; column-gap: 8px; padding-top: 6px; }
  .playing.land .seats { grid-area: seats; flex-direction: column; height: auto; }
  .playing.land .seat { flex: none; }
  .playing.land .board-col { grid-area: board; }
  .playing.land .mine { grid-area: mine; height: 100%; padding-bottom: 6px; }
  .playing.land .mbar { flex-wrap: wrap; }
}
.sec + .line, .ph + .line { border-top: 0; }
/* fast taps on buttons and the board must not select text or zoom on iPhone */
.btn, .seg button, .chip, #center, #board, .tabs { -webkit-user-select: none; user-select: none; touch-action: manipulation; -webkit-touch-callout: none; }
/* Settings > Sound & effects: Animations off / Fast (js/fx-game.js); squares pop from their own centre */
.sq { transform-box: fill-box; transform-origin: center; }
.fx-noanim .mdie.roll, .fx-noanim .sheet, .fx-noanim .toast, .fx-noanim .cardnote.flipin { animation: none; }
.fx-noanim .token { transition: none !important; }
.fx-fast .mdie.roll { animation-duration: .25s; }
.fx-fast .cardnote.flipin { animation-duration: .22s; }
/* Odds numbers on a corner: the corner's printing fades back so the number reads */
.sq.dimart > :not(.base) { opacity: .25; }
/* edge pass: crowded tables (5-7 opponents), long amounts, and bill numbers that fit their notes */
.scash { min-width: 0; }
.scash b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seats.many .plate .ps { display: none; }
.seats.many .seat { padding: 3px 3px; }
.seats.many .scash { margin-left: auto; }
.bill b { font-size: calc(var(--bw2) * .22); letter-spacing: -.03em; }
@media (min-width: 900px) {
  .playing .seats { align-self: stretch; max-height: calc(100vh - 56px - 32px); max-height: calc(100dvh - 56px - 32px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .playing .seats.many { gap: 6px; }
  .playing .seats.many .seat { padding: 5px 8px; gap: 3px; }
  .playing .seats.many .sworth { display: none; }
}
@media (max-width: 899px) {
  .playing.land .seats { max-height: calc(100vh - 44px - 58px - 12px); max-height: calc(100dvh - 44px - 58px - 12px); overflow-y: auto; overscroll-behavior: contain; }
  .playing.land .seats.many .seat { gap: 1px; }
}
/* phone board: short street names (bigger type) with the price under them */
.sq .pprint { display: none; }
.board-small .sq .pprint { display: inline; }
.sq .pnm { font-weight: 800; letter-spacing: .01em; }
.board-small .sq .sprice { font-size: 20px; }
.sq.inv .pnm { fill: #e8eaf0; }
.board-small .sq.ru .glyph { transform: none; }
.board-small .sq.ruh .glyph { transform: scale(.7); }

/* visibility pass: the phone board follows the action at about twice the size (camera on the
   player whose turn it is); the dice and buttons sit on the free middle of the board in view */
.board-wrap { overflow: hidden; }
.cam { transition: transform .5s cubic-bezier(.3,.7,.3,1); }
.cbox { transition: left .5s cubic-bezier(.3,.7,.3,1), top .5s cubic-bezier(.3,.7,.3,1), width .5s cubic-bezier(.3,.7,.3,1), height .5s cubic-bezier(.3,.7,.3,1); }
.zoomed .mdeck { opacity: 0; }
.mdeck { transition: opacity .3s; }
.fx-noanim .cam, .fx-noanim .cbox { transition: none; }
.fx-fast .cam, .fx-fast .cbox { transition-duration: .25s; }
.zoomb { position: absolute; right: 2px; top: 2px; width: 40px; height: 40px; padding: 0; border: 0; background: none; pointer-events: auto; display: grid; place-items: center; cursor: pointer; }
.zoomed .zoomb { width: calc(var(--bw) * .27); height: calc(var(--bw) * .27); right: 5px; top: 5px; }
.zoomb .mmap { width: 100%; height: 100%; display: block; border-radius: 3px; box-shadow: 0 2px 6px rgba(0,0,0,.45); }
.zoomed .center { padding-top: calc(var(--bw) * .27 + 8px); }
.zoomb svg:not(.mmap) { width: 30px; height: 30px; border-radius: 50%; background: rgba(23,32,26,.78); color: #f4f1ea; padding: 6px; box-sizing: border-box; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.zoomb:active svg { transform: scale(.92); }
/* laptop: the board takes the full height; your own money and deeds sit at the top of the right column */
@media (min-width: 900px) {
  .playing main { grid-template-areas: "seats board mine" "seats board side"; grid-template-rows: auto minmax(0, 1fr); }
  .playing .mine { height: auto; width: auto; gap: 8px; background: rgba(12,14,20,.5); border-radius: 12px; padding: 10px 12px; }
  .playing .mrow { flex-direction: column; align-items: stretch; gap: 8px; }
  .playing .mdeeds { min-height: 56px; }
  .playing .mcash { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .playing .mcash .bills { justify-content: flex-start; max-width: 190px; --bw2: 34px; }
  .playing .mbar { flex-wrap: wrap; row-gap: 6px; }
  .playing .panel-col { grid-row: auto; grid-area: side; }
  /* one line per player so the log still shows under eight players */
  .playing .panel-col .prow { min-height: 40px; padding: 5px 10px; }
  .playing .panel-col .prow .name br { display: none; }
  .playing .panel-col .prow .name .sub { margin-left: 6px; }
  .playing .panel-col .prow .v { display: flex; align-items: baseline; gap: 6px; }
  .playing .panel-col .prow .v small { display: inline; }
}
/* phone held sideways during a game: no title bar, so the board gets that height */
@media (max-width: 899px) {
  .playing.land #app { grid-template-rows: 1fr auto; }
  .playing.land .top { display: none; }
}
