/* Monopoly: a 3D table under glass panels. Chunky board-game buttons, cream paper cards, gold money. RTL-aware. */
:root {
  --ink: #1f150d; --cream: #fbf5e6; --paper: #f4ead2; --gold: #f2c14e; --gold-d: #b97a17; --green: #2fa04c; --red: #d7312b;
  --glass: rgba(24, 15, 9, 0.74); --glass2: rgba(38, 25, 15, 0.86); --line: rgba(255, 236, 200, 0.16); --muted: rgba(251, 245, 230, 0.62);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #140d09; color: var(--cream); font-family: Rubik, system-ui, sans-serif; font-size: 15px; touch-action: manipulation; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
bdi.m { unicode-bidi: isolate; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.center { text-align: center; }
#stage { position: fixed; inset: 0; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.labels3d { position: absolute !important; inset: 0; pointer-events: none; overflow: hidden; }
#ui { position: absolute; inset: 0; pointer-events: none; }
#ui > * { pointer-events: none; }
#ui button, #ui input, #ui a, #ui .join-card, #ui .lobby-card, #ui .dock, #ui .top, #ui .side, #ui details, #ui .lobby-foot, #ui .topline > *, #ui .center-card, #ui .chip { pointer-events: auto; }

/* ---------- boot */
#boot { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: radial-gradient(circle at 50% 40%, #3a2416, #120a06 70%); z-index: 50; transition: opacity 0.6s; }
#boot.gone { opacity: 0; pointer-events: none; }
.boot-logo { font-weight: 800; font-size: clamp(34px, 9vw, 64px); letter-spacing: 0.04em; background: #c62828; color: #fff; padding: 6px 22px; border-radius: 12px; transform: rotate(-4deg); box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 0 3px #fff3d6; }
.boot-sub { font-weight: 800; font-size: 24px; color: var(--gold); }
.boot-note { color: var(--muted); font-size: 14px; }
.boot-dice { display: flex; gap: 12px; margin: 14px 0; }
.boot-dice i { width: 34px; height: 34px; border-radius: 8px; background: #fbfaf5; box-shadow: inset -4px -4px 0 rgba(0,0,0,0.12), 0 6px 12px rgba(0,0,0,0.4); animation: tumble 1s infinite ease-in-out; }
.boot-dice i:nth-child(2) { animation-delay: 0.15s; }
@keyframes tumble { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(180deg); } }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 14px; padding: 11px 15px; min-height: 46px; font-weight: 700; font-size: 15px; color: var(--ink);
  background: linear-gradient(#fffaf0, #e9d7ad); box-shadow: 0 4px 0 #a2844e, 0 8px 16px rgba(0,0,0,0.3); text-decoration: none; transition: transform 0.08s, box-shadow 0.08s, filter 0.2s; user-select: none; -webkit-user-select: none; line-height: 1.1; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #a2844e, 0 3px 8px rgba(0,0,0,0.3); }
.btn.gold { background: linear-gradient(#ffe07a, #f0a62a); box-shadow: 0 4px 0 #a5620e, 0 8px 18px rgba(240,166,42,0.35); }
.btn.gold:active:not(:disabled) { box-shadow: 0 1px 0 #a5620e; }
.btn.red { background: linear-gradient(#ff7a6c, #d7312b); color: #fff; box-shadow: 0 4px 0 #8a1813, 0 8px 16px rgba(0,0,0,0.3); }
.btn.big { font-size: 18px; padding: 14px 20px; min-height: 56px; border-radius: 16px; font-weight: 800; }
.btn.sm { min-height: 36px; padding: 7px 12px; font-size: 13px; border-radius: 11px; box-shadow: 0 3px 0 #a2844e; }
.btn:disabled { filter: grayscale(0.8) brightness(0.8); opacity: 0.55; cursor: default; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 20px; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.icon-btn:active { transform: scale(0.94); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: center; }
.row > .btn { flex: 1 1 auto; }
.langs { display: inline-flex; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.langs button { border: 0; background: transparent; padding: 7px 10px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); }
.langs button.on { background: var(--gold); color: var(--ink); }
.field { width: 100%; border-radius: 14px; border: 2px solid rgba(31,21,13,0.15); background: #fff; color: var(--ink); padding: 13px 14px; font-size: 17px; font-weight: 600; outline: none; }
.field:focus { border-color: var(--gold-d); }
.label { display: block; font-weight: 700; font-size: 13px; color: #7a6040; margin: 12px 2px 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.why { color: #c62828; font-weight: 600; min-height: 1em; margin: 8px 0; font-size: 14px; }

/* ---------- brand */
.logo { display: inline-block; transform: rotate(-3deg); }
.logo span { display: inline-block; background: #c62828; color: #fff; font-weight: 800; font-size: 30px; letter-spacing: 0.03em; padding: 4px 16px; border-radius: 10px; box-shadow: inset 0 0 0 2px #fff3d6, 0 6px 16px rgba(0,0,0,0.35); }
.brand { text-align: center; }
.brand .sub { margin: 8px 0 0; font-weight: 700; color: #8a6a3a; }
.center-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--paper); color: var(--ink); padding: 22px; border-radius: 22px; text-align: center; width: min(92vw, 380px); }

/* ---------- join */
.join { position: absolute; inset: 0; display: flex; flex-direction: column; }
.topline { display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-t)) 12px 8px; }
.topline .grow { flex: 1; }
.roomno { background: var(--glass); border: 1px solid var(--line); padding: 8px 12px; border-radius: 12px; font-size: 13px; color: var(--muted); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); margin-inline-end: auto; }
.roomno b { color: var(--gold); font-size: 18px; margin-inline-start: 4px; }
.chipx { background: var(--glass); border: 1px solid var(--line); padding: 7px 10px; border-radius: 12px; font-size: 13px; }
.join-card, .lobby-card { margin-top: auto; background: var(--paper); color: var(--ink); border-radius: 26px 26px 0 0; padding: 18px 16px calc(16px + var(--safe-b)); max-height: 66vh; overflow-y: auto; box-shadow: 0 -12px 40px rgba(0,0,0,0.5); -webkit-overflow-scrolling: touch; }
.join-card .btn.big { width: 100%; margin-top: 6px; }
.pieces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pieces .pc { border: 2px solid transparent; background: #fff; border-radius: 14px; padding: 4px 2px 3px; display: flex; flex-direction: column; align-items: center; gap: 1px; box-shadow: 0 2px 0 rgba(0,0,0,0.12); }
.pieces .pc img { width: 100%; max-width: 56px; aspect-ratio: 1; object-fit: contain; mix-blend-mode: multiply; }
.pieces .pc small { font-size: 10px; font-weight: 700; color: #6b5233; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pieces .pc.on { border-color: var(--gold-d); background: #fff3cf; transform: translateY(-2px); box-shadow: 0 6px 12px rgba(185,122,23,0.35); }
.pieces .pc:disabled { opacity: 0.3; filter: grayscale(1); }
.pieces.small { grid-template-columns: repeat(10, 1fr); }
.pieces.small .pc { padding: 2px; border-radius: 10px; }
.faces { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.faces button { border: 3px solid transparent; border-radius: 50%; padding: 0; background: #fff; aspect-ratio: 1; overflow: hidden; display: grid; place-items: center; }
.faces button img { width: 100%; height: 100%; object-fit: cover; }
.faces button.on { border-color: var(--gold-d); box-shadow: 0 0 0 3px rgba(242,193,78,0.5); }
.faces .selfie { font-size: 9px; font-weight: 700; color: #6b5233; line-height: 1.1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.faces .selfie b { font-size: 18px; }
.cam { width: 180px; height: 180px; border-radius: 50%; overflow: hidden; margin: 6px auto; border: 4px solid var(--gold); }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.row2 { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }

/* ---------- faces (players) */
.face { position: relative; display: inline-block; width: 40px; height: 40px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px var(--pc, #999), 0 3px 8px rgba(0,0,0,0.4); background: #fff; }
.face > img:first-child { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.face .piece { position: absolute; width: 22px; height: 22px; inset-inline-end: -7px; bottom: -6px; border-radius: 50%; background: #fff; padding: 1px; box-shadow: 0 0 0 2px var(--pc, #999); object-fit: contain; }
.face.sm { width: 30px; height: 30px; }
.face.sm .piece { width: 16px; height: 16px; inset-inline-end: -5px; bottom: -4px; }
.face.lg { width: 64px; height: 64px; }
.face.xl { width: 96px; height: 96px; box-shadow: 0 0 0 5px var(--pc, #999), 0 8px 24px rgba(0,0,0,0.4); }
.face.xl .piece { width: 40px; height: 40px; }
.face.plus { display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #8a6a3a; box-shadow: 0 0 0 3px #d9c79f; background: #fff8e6; }

/* ---------- lobby */
.lobby { position: absolute; inset: 0; display: flex; flex-direction: column; }
.lobby-card { max-height: 54vh; padding-bottom: 8px; border-radius: 26px 26px 0 0; }
.lobby-foot { background: var(--paper); padding: 8px 16px calc(12px + var(--safe-b)); box-shadow: 0 -6px 16px rgba(0,0,0,0.12); }
.lobby-foot .btn.big { width: 100%; }
.lobby-foot .why { color: #8a6a3a; text-align: center; }
.lobby-card h3 { margin: 12px 4px 8px; font-size: 16px; }
.lobby-card h3 .n { color: #8a6a3a; font-weight: 600; }
.monya-line { display: flex; gap: 10px; align-items: center; background: #fff8e6; border-radius: 16px; padding: 8px 10px; border: 1px solid #ead9b0; }
.monya-line img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--gold); }
.monya-line p { margin: 0; font-size: 13.5px; font-weight: 500; color: #5c4428; }
.seats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seats li { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 9px 10px; border: 2px solid transparent; position: relative; min-width: 0; }
.seats li.me { border-color: var(--pc); }
.seats li.add { background: #fff8e6; border: 2px dashed #d9c79f; cursor: pointer; pointer-events: auto; }
.seats .nm { font-weight: 700; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seats .nm small { display: block; font-weight: 500; font-size: 11px; color: #8a6a3a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seats .x { position: absolute; inset-inline-end: 4px; top: 4px; border: 0; background: transparent; color: #b09774; font-size: 13px; padding: 4px; }
.mypiece { margin-top: 10px; }
.how { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0 4px; }
.how div { background: #fff; border-radius: 12px; padding: 8px; font-size: 12px; font-weight: 600; color: #5c4428; display: flex; gap: 6px; align-items: center; }
.how b { font-size: 18px; }
.settings { margin-top: 10px; background: #fff; border-radius: 14px; padding: 4px 10px; }
.settings summary { font-weight: 700; padding: 8px 2px; cursor: pointer; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid #efe3c6; flex-wrap: wrap; }
.setrow .k { font-weight: 600; font-size: 13.5px; }
.setrow .k small { color: #8a6a3a; }
.seg { display: inline-flex; background: #f1e6c9; border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 10px; border-radius: 9px; font-weight: 700; font-size: 13px; color: #6b5233; }
.seg button.on { background: var(--ink); color: var(--gold); }
.tvjoin { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: 16px; padding: 10px; margin-bottom: 10px; }
.tvjoin img { width: 120px; height: 120px; }
.tvjoin .big { font-weight: 800; font-size: 20px; }
.tvjoin .url { color: #c62828; font-weight: 800; font-size: 22px; direction: ltr; }

/* ---------- game: top players */
.game { position: absolute; inset: 0; }
.top { position: absolute; top: calc(6px + var(--safe-t)); inset-inline: 6px; display: flex; align-items: flex-start; gap: 5px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 6px; }
.top::-webkit-scrollbar { display: none; }
.chip { position: relative; display: flex; align-items: center; gap: 7px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line);
  border-radius: 16px; padding: 5px 9px 5px 6px; flex: 1 1 0; min-width: 92px; max-width: 170px; transition: transform 0.25s, box-shadow 0.25s, background 0.25s; cursor: pointer; }
[dir="rtl"] .chip { padding: 5px 6px 5px 9px; }
.chip .face { width: 34px; height: 34px; }
.chip .face .piece { width: 18px; height: 18px; }
.chip .ci { display: flex; flex-direction: column; min-width: 0; }
.chip .nm { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .cash { font-size: 15px; font-weight: 800; color: var(--gold); }
.chip.turn { background: linear-gradient(135deg, rgba(60,40,18,0.95), rgba(30,20,10,0.92)); box-shadow: 0 0 0 2px var(--pc), 0 0 18px var(--pc); transform: translateY(2px) scale(1.04); }
.chip.turn .nm { color: var(--cream); }
.chip.me .nm::after { content: ' ●'; color: var(--pc); }
.chip.out { filter: grayscale(1); opacity: 0.45; }
.chip.off .face { opacity: 0.55; }
.chip.indebt { animation: debtpulse 0.9s infinite; }
@keyframes debtpulse { 50% { box-shadow: 0 0 0 2px #ff3b30, 0 0 22px #ff3b30; } }
.chip.up .cash { animation: up 0.9s; }
.chip.down .cash { animation: down 0.9s; }
.chip.pop { animation: pop 0.5s; }
@keyframes up { 30% { color: #6dff8f; transform: scale(1.15); } }
@keyframes down { 30% { color: #ff6b5e; transform: scale(1.15); } }
@keyframes pop { 40% { transform: scale(1.12); } }
.chip .badge { position: absolute; top: -7px; inset-inline-end: -3px; font-size: 13px; background: var(--ink); border-radius: 9px; padding: 1px 4px; border: 1px solid var(--line); }
.chip .badge + .badge { inset-inline-end: 22px; }
.infobar { position: absolute; top: calc(66px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; font-size: 11px; font-weight: 700; color: var(--muted); }
.infobar span { background: rgba(20,12,7,0.55); padding: 3px 8px; border-radius: 9px; white-space: nowrap; }
.side { position: absolute; top: calc(94px + var(--safe-t)); inset-inline-end: 8px; display: flex; flex-direction: column; gap: 8px; }
.side .icon-btn { width: 40px; height: 40px; font-size: 17px; }

/* Uncle Monya's line */
.monya { position: absolute; top: calc(94px + var(--safe-t)); inset-inline-start: 8px; max-width: min(78vw, 360px); display: flex; gap: 8px; align-items: flex-start; opacity: 0; transform: translateY(-8px) scale(0.96); transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
.monya.on { opacity: 1; transform: none; }
.monya .mface { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--gold), 0 6px 14px rgba(0,0,0,0.45); flex: none; background: #3a2416; }
.monya .mtext { background: rgba(251,245,230,0.94); color: var(--ink); border-radius: 4px 16px 16px 16px; padding: 7px 11px; font-size: 13.5px; font-weight: 500; box-shadow: 0 6px 16px rgba(0,0,0,0.35); }
[dir="rtl"] .monya .mtext { border-radius: 16px 4px 16px 16px; }
.monya .mtext b { display: block; font-size: 11px; color: #a5620e; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- the dock */
.dock { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(rgba(24,15,9,0.0), rgba(24,15,9,0.82) 22px, rgba(18,11,6,0.94)); padding: 22px 10px calc(8px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; }
.ctx { min-height: 52px; display: flex; flex-direction: column; justify-content: center; }
.status { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 15px; padding: 8px 0; text-align: center; }
.status .sqn { color: var(--cream); border-bottom: 3px solid var(--gc); }
.emotes { display: flex; justify-content: center; gap: 4px; align-items: center; }
.emotes button { border: 0; background: rgba(255,255,255,0.07); border-radius: 12px; font-size: 21px; width: 42px; height: 40px; }
.emotes button:active { transform: scale(1.2); }
.emotes .btn.sm { width: auto; margin-inline-start: 6px; }
.rollbox { display: flex; justify-content: center; }
.dicebtn { position: relative; border: 0; width: min(92vw, 360px); min-height: 78px; border-radius: 22px; background: radial-gradient(circle at 30% 20%, #fff2b8, #f4b33a 55%, #d5841a); color: var(--ink); box-shadow: 0 6px 0 #9a5a0d, 0 12px 28px rgba(244,179,58,0.45);
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 10px 18px; text-align: start; touch-action: none; user-select: none; -webkit-user-select: none; animation: breathe 2.2s infinite; }
.dicebtn b { font-size: 24px; font-weight: 800; grid-column: 2; }
.dicebtn small { grid-column: 2; font-size: 12px; font-weight: 600; opacity: 0.75; }
.dicebtn .d3 { grid-row: 1 / span 2; display: flex; gap: 6px; }
.dicebtn .d3 i { width: 30px; height: 30px; border-radius: 7px; background: #fff; box-shadow: inset -3px -3px 0 rgba(0,0,0,0.12), 0 3px 6px rgba(0,0,0,0.3); position: relative; }
.dicebtn .d3 i::after { content: ''; position: absolute; inset: 0; margin: auto; width: 7px; height: 7px; border-radius: 50%; background: #c62828; box-shadow: 9px 9px 0 #222, -9px -9px 0 #222; }
.dicebtn.hold { animation: shake 0.12s infinite; transform: scale(0.97); box-shadow: 0 2px 0 #9a5a0d, 0 6px 20px rgba(244,179,58,0.6); }
.dicebtn.hold .d3 i { animation: tumble 0.3s infinite; }
@keyframes breathe { 50% { box-shadow: 0 6px 0 #9a5a0d, 0 12px 38px rgba(244,179,58,0.75); } }
@keyframes shake { 0% { transform: translate(1px, -1px) rotate(-1deg) scale(0.97); } 50% { transform: translate(-2px, 1px) rotate(1deg) scale(0.97); } 100% { transform: translate(1px, 1px) rotate(0) scale(0.97); } }
.jailbox p { text-align: center; margin: 0 0 8px; font-weight: 700; }
.endrow .btn.big { flex: 2 1 auto; }
.offer, .auction { display: flex; gap: 10px; align-items: stretch; }
.offer .col, .auction .col { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; min-width: 0; }
.offer .btn.buy { flex-direction: column; gap: 2px; }
.offer .btn.buy span { font-size: 14px; font-weight: 700; }
.offer .btn.buy bdi { font-size: 24px; }
.abid { text-align: center; }
.abid small { display: block; color: var(--muted); font-weight: 600; }
.abid b { font-size: 28px; color: var(--gold); }
.atime { height: 8px; background: rgba(255,255,255,0.12); border-radius: 6px; overflow: hidden; }
.atime i { display: block; height: 100%; background: linear-gradient(90deg, #6dff8f, var(--gold)); border-radius: 6px; transition: width 0.2s linear; }
.atime i.hot { background: linear-gradient(90deg, #ff6b5e, #ffb199); }
.bids { display: flex; gap: 6px; }
.bids .btn { flex: 1; padding: 8px 4px; font-size: 14px; }
.lead { color: #6dff8f; font-weight: 700; text-align: center; margin: 0; }
.debt { display: flex; flex-direction: column; gap: 6px; }
.debt .dt { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.debt .dt b { font-size: 20px; color: #ff8a7a; }
.debt .hint { margin: 0; text-align: center; font-size: 12.5px; color: var(--muted); }

/* deeds: the property cards */
.deed { background: var(--cream); color: var(--ink); border-radius: 12px; border: 2px solid var(--ink); overflow: hidden; box-shadow: 0 10px 24px rgba(0,0,0,0.35); width: 100%; max-width: 330px; margin: 0 auto; }
.deed .band { background: linear-gradient(var(--gc), color-mix(in srgb, var(--gc) 78%, #000)); color: #fff; text-align: center; padding: 8px 8px 9px; border-bottom: 2px solid var(--ink); text-shadow: 0 1px 2px rgba(0,0,0,0.45); }
.deed .band small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.92; }
.deed .band b { display: block; font-size: 19px; font-weight: 800; text-transform: uppercase; line-height: 1.1; }
.deed .pic { height: 120px; background-size: cover; background-position: center 40%; border-bottom: 1px solid #e3d5b0; }
.deed .price { text-align: center; font-weight: 800; padding: 6px 0 2px; font-size: 15px; }
.deed table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 2px 0 6px; }
.deed td { padding: 3px 12px; }
.deed td:last-child { text-align: end; font-weight: 700; }
.deed tr.cur { background: #fff0bf; }
.deed tr.sep td { border-top: 1px solid #e3d5b0; padding-top: 6px; color: #6b5233; }
.deed.mort { filter: grayscale(0.6); }
.deed.compact { width: 148px; flex: none; box-shadow: 0 8px 18px rgba(0,0,0,0.45); transform: rotate(-2deg); animation: dealin 0.45s cubic-bezier(.2,1.3,.4,1); }
[dir="rtl"] .deed.compact { transform: rotate(2deg); }
.deed.compact .band { padding: 5px 6px; }
.deed.compact .band b { font-size: 13px; }
.deed.compact .band small { font-size: 9px; }
.deed.compact .pic { height: 66px; }
.deed.compact .price { font-size: 13px; padding: 3px 0 0; }
.deed.compact table { font-size: 10.5px; margin: 0 0 4px; }
.deed.compact td { padding: 1px 6px; }
@keyframes dealin { from { transform: translateY(60px) rotate(-14deg) scale(0.6); opacity: 0; } }
.deeds { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; }
.deeds::-webkit-scrollbar { display: none; }
.deeds.empty { color: var(--muted); font-size: 12.5px; justify-content: center; padding: 6px; }
.deeds.wrap { flex-wrap: wrap; overflow: visible; }
.mini { position: relative; flex: none; width: 66px; height: 74px; border-radius: 9px; border: 1.5px solid var(--ink); background: var(--cream); color: var(--ink); padding: 15px 3px 3px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; box-shadow: 0 3px 8px rgba(0,0,0,0.35); }
.mini > i { position: absolute; top: 0; left: 0; right: 0; height: 12px; background: var(--gc); border-bottom: 1.5px solid var(--ink); }
.mini > span { font-size: 9.5px; font-weight: 700; line-height: 1.1; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.mini > em { font-style: normal; font-size: 9px; position: absolute; bottom: 2px; }
.mini.set { box-shadow: 0 0 0 2px var(--gc), 0 3px 10px rgba(0,0,0,0.4); }
.mini.mort { background: repeating-linear-gradient(-45deg, #e8dcc0, #e8dcc0 6px, #d6c7a3 6px, #d6c7a3 12px); opacity: 0.75; }
.mini.tg { opacity: 0.6; }
.mini.tg.on { opacity: 1; transform: translateY(-3px); box-shadow: 0 0 0 3px var(--gold-d), 0 6px 14px rgba(0,0,0,0.35); }
.mini.tg:disabled { opacity: 0.25; }
.mini.sm { width: 54px; height: 58px; }
.mini.sm > span { font-size: 8.5px; }

/* ---------- sheets (paper cards from the bottom) */
#sheets, .rtcsheets { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
#sheets.on, .rtcsheets.on { pointer-events: auto; }
.rtcsheets { z-index: 31; }
.sheet-bg { position: absolute; inset: 0; background: rgba(10,6,3,0.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.25s; }
#sheets.on .sheet-bg, .rtcsheets.on .sheet-bg { opacity: 1; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; background: var(--paper); color: var(--ink); border-radius: 26px 26px 0 0; padding: 22px 16px calc(18px + var(--safe-b)); transform: translateY(100%); transition: transform 0.32s cubic-bezier(.2,.9,.3,1); box-shadow: 0 -18px 50px rgba(0,0,0,0.5); -webkit-overflow-scrolling: touch; }
#sheets.on .sheet, .rtcsheets.on .sheet { transform: none; }
.sheet-x { position: absolute; top: 10px; inset-inline-end: 12px; border: 0; background: #ead9b0; width: 34px; height: 34px; border-radius: 50%; font-size: 15px; color: var(--ink); z-index: 2; }
.sheet h2 { margin: 0 0 12px; font-size: 21px; }
.sheet h4 { margin: 12px 0 6px; font-size: 14px; color: #6b5233; }
.sheet .muted { color: #8a6a3a; }
.sheet .small { font-size: 12px; }
.sheet .btn.big { width: 100%; margin-top: 10px; }
.sheet .deeds .mini { width: 74px; height: 82px; }
.sheet .mini > span { font-size: 10.5px; }
.owner { display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 12px 0 4px; font-size: 14px; }
.owner.free { color: #2e7d32; font-weight: 700; }
.owner .rnow { background: #fff0bf; padding: 3px 8px; border-radius: 8px; font-weight: 700; }
.owner .mtag { background: #ffd6d0; color: #b71c1c; padding: 3px 8px; border-radius: 8px; font-weight: 700; }
.sq-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sq-acts .btn { flex: 1 1 140px; }
.special { text-align: center; }
.special img { width: 180px; height: 180px; border-radius: 20px; object-fit: cover; box-shadow: 0 10px 24px rgba(0,0,0,0.25); }
.pl { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.pl h2 { margin: 0; }
.pl p { margin: 3px 0; }
.who { display: flex; gap: 8px; flex-wrap: wrap; }
.whob { display: flex; align-items: center; gap: 7px; border: 2px solid transparent; background: #fff; border-radius: 14px; padding: 6px 10px 6px 7px; font-weight: 700; }
.whob.on { border-color: var(--gold-d); background: #fff3cf; }
.tcols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.tside { background: #fff; border-radius: 16px; padding: 4px 8px 10px; min-width: 0; }
.tside .deeds .mini { width: 62px; height: 68px; }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.stepper b { grid-column: 1 / -1; grid-row: 1; text-align: center; font-size: 17px; background: #fff8e6; border-radius: 9px; padding: 4px 0; }
.stepper button { border: 0; background: #f1e6c9; border-radius: 9px; padding: 7px 0; font-weight: 700; font-size: 12px; min-width: 0; }
.offerline { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 8px 10px; font-size: 13px; margin-top: 6px; }
.offercard { background: #fff; border-radius: 18px; padding: 12px; margin-bottom: 10px; }
.ofrom { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tsum { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; margin-bottom: 10px; }
.tsum > div:not(.arrow) { display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
.tsum h4 { width: 100%; margin: 0 0 4px; }
.tsum .arrow { font-size: 24px; color: var(--gold-d); }
.cashpill { background: #fff0bf; border-radius: 9px; padding: 4px 8px; font-weight: 800; }
.results { text-align: center; }
.results .crown { font-size: 44px; animation: pop 1s infinite; }
.results h2 { margin: 12px 0 4px; font-size: 24px; }
.rank { list-style: none; padding: 0; margin: 14px 0; text-align: start; counter-reset: r; }
.rank li { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 8px 12px; margin-bottom: 6px; counter-increment: r; border-inline-start: 5px solid var(--pc); }
.rank li::before { content: counter(r); font-weight: 800; color: #8a6a3a; width: 18px; }
.rank li span { flex: 1; font-weight: 700; }
.rank li:first-child { background: #fff3cf; }
.log { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.log li { padding: 7px 4px; border-bottom: 1px solid #ead9b0; }
.vol label { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-weight: 600; font-size: 14px; }
.vol label span { width: 110px; }
.vol input { flex: 1; accent-color: var(--gold-d); }
.rules { background: #fff; border-radius: 14px; padding: 6px 12px; margin: 10px 0; }
.rules summary { font-weight: 700; padding: 6px 0; cursor: pointer; }
.rules p { font-size: 13.5px; margin: 8px 0; }
.credits { font-size: 11px; color: #a08a68; text-align: center; margin-top: 14px; }
.ask { font-size: 17px; font-weight: 600; text-align: center; margin: 10px 0 18px; }

/* ---------- overlays: banners, floating labels, flashes, coach, toast */
.banner { position: fixed; left: 50%; top: 36%; transform: translate(-50%, -50%); z-index: 25; pointer-events: none; animation: bannerin 0.45s cubic-bezier(.2,1.5,.4,1); }
.banner span { display: inline-block; white-space: nowrap; font-weight: 800; font-size: clamp(24px, 8vw, 46px); color: #fff; padding: 8px 22px; border-radius: 16px; background: rgba(24,15,9,0.82); box-shadow: 0 10px 30px rgba(0,0,0,0.45); -webkit-text-stroke: 0; text-shadow: 0 3px 0 rgba(0,0,0,0.35); }
.banner.gold span { background: linear-gradient(#ffe07a, #f0a62a); color: var(--ink); text-shadow: none; }
.banner.red span { background: linear-gradient(#ff6b5e, #c62828); }
.banner.mine span { background: linear-gradient(#7dffa0, #2fa04c); color: #052b0f; text-shadow: none; }
.banner.out { animation: bannerout 0.45s forwards; }
@keyframes bannerin { from { transform: translate(-50%, -50%) scale(0.3) rotate(-8deg); opacity: 0; } }
@keyframes bannerout { to { transform: translate(-50%, -80%) scale(0.9); opacity: 0; } }
.float3d { font-weight: 800; font-size: 18px; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 12px rgba(0,0,0,0.5); white-space: nowrap; pointer-events: none; }
.float3d.plus { color: #6dff8f; font-size: 21px; }
.float3d.minus { color: #ff7a6c; font-size: 21px; }
.float3d.bid { color: var(--gold); }
.float3d.note { font-size: 15px; background: rgba(24,15,9,0.8); padding: 4px 10px; border-radius: 10px; }
.float3d.emote .emo { font-size: 42px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); }
.float3d.dice .dsum { background: rgba(251,245,230,0.95); color: var(--ink); padding: 5px 12px; border-radius: 12px; font-size: 17px; text-shadow: none; box-shadow: 0 6px 14px rgba(0,0,0,0.4); }
.float3d.dice b { color: #c62828; font-size: 21px; }
.stamp { display: inline-block; border: 3px solid var(--pc); color: var(--pc); background: rgba(255,255,255,0.92); padding: 3px 10px; border-radius: 8px; transform: rotate(-10deg); font-size: 16px; text-shadow: none; animation: stampin 0.35s cubic-bezier(.2,1.6,.4,1); }
@keyframes stampin { from { transform: rotate(-10deg) scale(2.4); opacity: 0; } }
.flash { position: fixed; inset: 0; z-index: 24; pointer-events: none; }
.flash.police { animation: police 0.9s; }
@keyframes police { 0%, 50% { background: rgba(255,30,30,0.28); } 25%, 75% { background: rgba(30,80,255,0.28); } 100% { background: transparent; } }
.coach { position: fixed; left: 10px; right: 10px; bottom: calc(170px + var(--safe-b)); z-index: 26; display: flex; gap: 10px; align-items: center; background: var(--paper); color: var(--ink); border-radius: 18px; padding: 10px 12px; box-shadow: 0 12px 30px rgba(0,0,0,0.5); animation: bannerin2 0.4s cubic-bezier(.2,1.4,.4,1); max-width: 460px; margin: 0 auto; }
.coach img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 3px var(--gold); }
.coach p { margin: 0; font-size: 13.5px; font-weight: 500; flex: 1; }
@keyframes bannerin2 { from { transform: translateY(30px); opacity: 0; } }
.toast { position: fixed; left: 50%; top: calc(90px + var(--safe-t)); transform: translateX(-50%); z-index: 40; background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,0.45); max-width: 90vw; text-align: center; animation: bannerin2 0.3s; }
.toast.warn { background: #ffe1db; color: #8a1813; }
.unlock { position: fixed; left: 50%; bottom: calc(190px + var(--safe-b)); transform: translateX(-50%); z-index: 27; border: 0; background: var(--gold); color: var(--ink); font-weight: 800; padding: 12px 18px; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); animation: breathe 1.6s infinite; }

/* ---------- wide screens (laptop, TV): players on the left, the dock in the middle at the bottom */
@media (min-aspect-ratio: 11/10) {
  .top { flex-direction: column; inset-inline: auto; inset-inline-start: 10px; top: 12px; width: 220px; max-height: calc(100vh - 24px); overflow-y: auto; }
  .chip { flex: none; max-width: none; min-width: 0; padding: 8px 10px; }
  .chip .face { width: 44px; height: 44px; }
  .chip .nm { font-size: 13px; }
  .chip .cash { font-size: 18px; }
  .chip.turn { transform: translateX(6px) scale(1.03); }
  [dir="rtl"] .chip.turn { transform: translateX(-6px) scale(1.03); }
  .monya { top: 12px; inset-inline-start: 244px; }
  .infobar { top: auto; bottom: 8px; left: auto; inset-inline-end: 12px; transform: none; }
  .side { top: 12px; }
  .dock { left: 50%; right: auto; transform: translateX(-50%); width: min(720px, 62vw); border-radius: 22px 22px 0 0; background: rgba(18,11,6,0.9); padding-top: 12px; }
  [dir="rtl"] .dock { transform: translateX(-50%); }
  .join-card, .lobby-card, .lobby-foot { width: min(560px, 92vw); margin-inline: auto; }
  .lobby-card { max-height: 58vh; }
  .sheet { width: min(560px, 96vw); left: 50%; right: auto; transform: translate(-50%, 100%); }
  #sheets.on .sheet, .rtcsheets.on .sheet { transform: translate(-50%, 0); }
  .coach { bottom: 200px; }
}
body.tv .chip .face { width: 54px; height: 54px; }
body.tv .chip .cash { font-size: 22px; }
body.tv .monya .mtext { font-size: 18px; }
body.tv .monya .mface { width: 80px; height: 80px; }
@media (max-height: 640px) and (max-aspect-ratio: 11/10) {
  .dicebtn { min-height: 64px; }
  .deed.compact .pic { height: 46px; }
  .mini { width: 58px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) { .dicebtn, .results .crown { animation: none; } }

/* the video call: live faces in the chips, the call panel */
.face video { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; transform: scaleX(-1); }
.face.talking { box-shadow: 0 0 0 3px #6dff8f, 0 0 14px #6dff8f; }
.callrow { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 8px 10px; margin-top: 6px; }
.callrow span { flex: 1; font-weight: 700; }
.callnote { background: #fff8e6; border-radius: 12px; padding: 8px 10px; font-size: 13px; }
.sec { font-weight: 700; margin: 12px 0 4px; color: #6b5233; }

/* the face over the current player's piece */
.turntag { position: relative; width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 0 3px var(--pc), 0 6px 14px rgba(0,0,0,0.5); background: #fff; animation: bob 1.4s ease-in-out infinite; pointer-events: none; }
.turntag img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.turntag::after { content: ''; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--pc); }
@keyframes bob { 50% { transform: translateY(-5px); } }
[dir="rtl"] .fwd { display: inline-block; transform: scaleX(-1); }
/* a big screen across the room: bigger lobby card and QR */
@media (min-width: 1500px) {
  body.tv .lobby-card, body.tv .lobby-foot { width: min(820px, 50vw); }
  body.tv .lobby-card { font-size: 19px; max-height: 64vh; }
  body.tv .tvjoin img { width: 200px; height: 200px; }
  body.tv .tvjoin .big { font-size: 30px; }
  body.tv .tvjoin .url { font-size: 34px; }
  body.tv .seats .nm { font-size: 19px; }
  body.tv .seats .nm small { font-size: 14px; }
  body.tv .monya-line p { font-size: 18px; }
  body.tv .face { width: 52px; height: 52px; }
}
