/* ============ Monopoly — classic board styling ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* The hidden attribute must always win, even over rules that set display
   (author styles beat the UA's [hidden] rule otherwise). */
[hidden] { display: none !important; }

:root {
  --board-size: 888px;
  --corner: 120px;
  --tile: 72px;
  --board-bg: #cfe3c4;
  --line: #1b3a29;
  --cream: #f5efdc;
  --red: #e21c25;
  --felt: #1d5c3a;
  --panel: #22262b;
  --panel-2: #2b3036;
}

html, body { height: 100%; }
body {
  font-family: 'Futura', 'Trebuchet MS', 'Segoe UI', Arial, sans-serif;
  background:
    radial-gradient(1200px 800px at 30% 20%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(0,0,0,.35), transparent 50%),
    linear-gradient(160deg, #3b2a1c, #241709 70%);
  color: #eee;
  overflow: hidden;
  user-select: none;
}

/* ============ Setup screen ============ */
#setup-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  overflow: auto; padding: 24px; z-index: 50;
}
.setup-card {
  background: var(--cream); color: #222; border-radius: 14px; padding: 32px 38px;
  width: min(620px, 94vw); box-shadow: 0 24px 80px rgba(0,0,0,.6);
  animation: popIn .45s cubic-bezier(.2,1.4,.3,1);
}
.setup-card h2 { margin: 22px 0 10px; font-size: 15px; text-transform: uppercase; letter-spacing: 2px; color: #444; }
.tagline { text-align: center; color: #666; margin-top: 6px; font-style: italic; }

.logo-banner {
  background: var(--red); color: #fff; font-weight: 800; text-align: center;
  letter-spacing: 3px; padding: 8px 22px; border-radius: 6px;
  border: 3px solid #fff; outline: 2px solid #00000022;
  text-shadow: 1px 2px 0 rgba(0,0,0,.35); white-space: nowrap;
}
.logo-banner.big { font-size: 42px; transform: rotate(-2deg); margin: 0 auto; width: fit-content; }

.seat-row {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid #ddd;
  border-radius: 10px; padding: 8px 12px; margin-bottom: 8px;
}
.seat-row select, .seat-row input[type=text] {
  font: inherit; padding: 6px 8px; border-radius: 8px; border: 2px solid #ccc; background: #fafafa;
}
.seat-row input[type=text] { width: 130px; }
.seat-row .token-pick { font-size: 22px; width: 58px; text-align: center; }
.seat-row .remove-seat { margin-left: auto; }
.seat-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px; color: #fff; }

.rule-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 2px; cursor: pointer; font-size: 14px; color: #333; }
.rule-row input { margin-top: 3px; transform: scale(1.2); }

/* ============ Buttons ============ */
.btn {
  font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 10px; cursor: pointer;
  border: 0; background: #d8d2bd; color: #222; transition: transform .12s, box-shadow .12s, filter .12s;
  box-shadow: 0 3px 0 rgba(0,0,0,.25);
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 5px 0 rgba(0,0,0,.25); filter: brightness(1.05); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--red); color: #fff; }
.btn.danger { background: #7c1a1a; color: #fff; }
.btn.ghost { background: transparent; border: 2px dashed #999; box-shadow: none; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.big-btn { width: 100%; margin-top: 26px; font-size: 20px; padding: 14px; }
.icon-btn { background: none; border: 0; font-size: 20px; cursor: pointer; filter: grayscale(.2); }
.icon-btn:hover { transform: scale(1.15); }

/* ============ Layout ============ */
#table { display: flex; height: 100vh; align-items: center; }
#board-scaler {
  flex: 1; display: flex; align-items: center; justify-content: center; height: 100%;
}
#board {
  width: var(--board-size); height: var(--board-size); flex: none;
  display: grid;
  grid-template-columns: var(--corner) repeat(9, var(--tile)) var(--corner);
  grid-template-rows: var(--corner) repeat(9, var(--tile)) var(--corner);
  background: var(--board-bg);
  border: 3px solid var(--line);
  box-shadow: 0 30px 90px rgba(0,0,0,.65), inset 0 0 0 2px #ffffff33;
  position: relative;
  transform: scale(var(--scale, 1));
  transform-origin: center center;
  border-radius: 4px;
}

/* ============ Tiles ============ */
.tile { position: relative; border: 1px solid var(--line); background: var(--board-bg); }
.tile .inner {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; overflow: hidden;
}
.tile.side-left .inner  { width: var(--tile); height: var(--corner); transform: translate(-50%,-50%) rotate(90deg); }
.tile.side-right .inner { width: var(--tile); height: var(--corner); transform: translate(-50%,-50%) rotate(-90deg); }
.tile.side-top .inner   { transform: translate(-50%,-50%) rotate(180deg); }

.tile .bar {
  width: 100%; height: 26px; border-bottom: 1px solid var(--line); flex: none;
  display: flex; align-items: center; justify-content: center; gap: 2px;
}
.tile-name {
  font-size: 9px; font-weight: 700; text-transform: uppercase; text-align: center;
  color: #1a1a1a; padding: 3px 2px 0; line-height: 1.15; letter-spacing: .2px;
}
.tile-price { font-size: 9px; color: #333; margin-top: auto; padding-bottom: 4px; font-weight: 600; }
.tile-icon { font-size: 22px; margin: 2px 0; }
.tile-icon.small { font-size: 18px; }

/* houses & hotel pips on the color bar */
.house-pip {
  width: 10px; height: 10px; background: #1fa32e; border: 1px solid #0b5c16; border-radius: 2px;
  box-shadow: 0 1px 1px rgba(0,0,0,.4);
  animation: popIn .35s cubic-bezier(.2,1.6,.3,1);
}
.house-pip.hotel { width: 26px; background: #d5202a; border-color: #7c0d13; }

/* owner ribbon on the inward edge */
.owner-ribbon {
  position: absolute; bottom: -1px; left: 8%; width: 84%; height: 7px; border-radius: 4px 4px 0 0;
  box-shadow: 0 0 6px rgba(0,0,0,.5);
}
.tile .mort-overlay {
  position: absolute; inset: 0; background: repeating-linear-gradient(45deg, #d022224d 0 8px, #ffffff33 8px 16px);
  display: none; pointer-events: none;
}
.tile.mortgaged .mort-overlay { display: block; }

.tile.flash { animation: tileFlash 1s ease; z-index: 2; }
@keyframes tileFlash {
  0% { box-shadow: inset 0 0 0 3px gold, 0 0 24px gold; }
  100% { box-shadow: none; }
}
.tile.clickable { cursor: pointer; }
.tile.clickable:hover { filter: brightness(1.08); }

/* corners */
.tile.corner .inner { justify-content: center; }
.corner-label { font-size: 13px; font-weight: 800; text-transform: uppercase; text-align: center; line-height: 1.2; }
.corner-icon { font-size: 34px; }
.tile.corner .rot { transform: rotate(45deg); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tile.corner.go .rot { transform: rotate(-45deg); }
.go-text { color: var(--red); font-size: 30px; font-weight: 900; letter-spacing: 1px; }
.go-arrow { color: var(--red); font-size: 18px; }
.jail-box {
  background: #f7941d; border: 2px solid var(--line); width: 68px; height: 68px; border-radius: 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: absolute; top: 6px; right: 6px;
}
.jail-box .bars { font-size: 26px; letter-spacing: -2px; }
.just-visiting { position: absolute; left: 6px; bottom: 6px; font-size: 9px; font-weight: 700; color: #1a1a1a; transform: rotate(-45deg); transform-origin: left bottom; }

/* ============ Center ============ */
#center {
  grid-area: 2 / 2 / 11 / 11; position: relative; background: var(--board-bg);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
#board-logo { font-size: 52px; transform: rotate(-45deg); position: absolute; z-index: 1; pointer-events: none; }
.deck {
  position: absolute; width: 150px; height: 96px; border-radius: 8px; border: 2px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.25), 5px 5px 0 rgba(0,0,0,.15);
}
.deck-label { font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.deck-icon { font-size: 30px; font-weight: 900; }
.chest-deck { top: 15%; left: 12%; transform: rotate(-45deg); background: #9fd3f0; color: #103a52; }
.chance-deck { bottom: 15%; right: 12%; transform: rotate(-45deg); background: #f7941d; color: #5b3000; }
.chance-deck .deck-icon { font-size: 40px; color: #fff; text-shadow: 1px 2px 0 rgba(0,0,0,.3); }

#event-caption {
  position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
  background: #ffffffd9; color: #222; font-weight: 700; font-size: 15px;
  padding: 7px 16px; border-radius: 20px; border: 2px solid var(--line);
  max-width: 84%; text-align: center; opacity: 0; transition: opacity .3s; z-index: 3;
}
#event-caption.show { opacity: 1; }

#pot-display {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #fff8; border: 2px solid var(--line); color: #143; font-weight: 800;
  border-radius: 18px; padding: 4px 14px; z-index: 3;
}

/* ============ Dice ============ */
#dice-area {
  position: absolute; bottom: 24%; left: 24%; display: flex; gap: 26px; z-index: 3;
  perspective: 600px;
}
.die { width: 54px; height: 54px; position: relative; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3,1.3,.4,1); }
.die .face {
  position: absolute; width: 54px; height: 54px; background: #fdfdf5; border: 2px solid #999;
  border-radius: 9px; display: grid; grid-template: repeat(3,1fr)/repeat(3,1fr); padding: 7px;
  box-shadow: inset 0 0 8px rgba(0,0,0,.12);
}
.die .pip { width: 9px; height: 9px; background: #222; border-radius: 50%; align-self: center; justify-self: center; }
.die .f1 { transform: rotateY(0deg) translateZ(27px); }
.die .f2 { transform: rotateY(90deg) translateZ(27px); }
.die .f3 { transform: rotateX(90deg) translateZ(27px); }
.die .f4 { transform: rotateX(-90deg) translateZ(27px); }
.die .f5 { transform: rotateY(-90deg) translateZ(27px); }
.die .f6 { transform: rotateY(180deg) translateZ(27px); }
.die.rolling { animation: diceSpin .5s linear infinite; }
@keyframes diceSpin {
  0% { transform: rotateX(0) rotateY(0) rotateZ(0) translateY(0); }
  25% { transform: rotateX(180deg) rotateY(90deg) rotateZ(45deg) translateY(-22px); }
  50% { transform: rotateX(360deg) rotateY(180deg) rotateZ(90deg) translateY(0); }
  75% { transform: rotateX(540deg) rotateY(270deg) rotateZ(135deg) translateY(-14px); }
  100% { transform: rotateX(720deg) rotateY(360deg) rotateZ(180deg) translateY(0); }
}

/* ============ Tokens ============ */
#token-layer, #fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.token {
  position: absolute; width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff, #d9d9d9);
  border: 3px solid #555; display: flex; align-items: center; justify-content: center;
  font-size: 20px; box-shadow: 0 4px 10px rgba(0,0,0,.45);
  transition: left .16s ease, top .16s ease;
  z-index: 5;
}
.token.hop { animation: hop .16s ease; }
@keyframes hop {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-14px) scale(1.12); }
}
.token.jump { transition: left .7s cubic-bezier(.3,-.4,.4,1.4), top .7s cubic-bezier(.3,-.4,.4,1.4); }
.token.active-glow { box-shadow: 0 0 0 3px currentColor, 0 0 18px currentColor, 0 4px 10px rgba(0,0,0,.45); }
.token.dead { filter: grayscale(1); opacity: .35; }

/* money fly chips */
.money-chip {
  position: fixed; z-index: 200; font-weight: 900; font-size: 17px; padding: 5px 12px;
  border-radius: 18px; background: #ffe9a8; color: #6b4d00; border: 2px solid #c9a227;
  box-shadow: 0 6px 16px rgba(0,0,0,.4); pointer-events: none;
  transition: left .8s cubic-bezier(.4,0,.3,1), top .8s cubic-bezier(.4,0,.3,1), opacity .8s;
}
.money-chip.neg { background: #ffb1b1; color: #7c0d13; border-color: #c33; }

/* ============ Card overlay ============ */
#card-overlay {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25);
}
#card-overlay[hidden] { display: none; }
#card-flip { width: 320px; height: 200px; position: relative; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3,1.2,.4,1); }
#card-flip.flipped { transform: rotateY(180deg); }
.card-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 12px;
  border: 3px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.5); padding: 18px;
}
.card-back { font-size: 60px; font-weight: 900; color: #fff; text-shadow: 2px 3px 0 rgba(0,0,0,.3); }
.card-back.chance { background: #f7941d; }
.card-back.chest { background: #9fd3f0; }
.card-front { background: var(--cream); color: #222; transform: rotateY(180deg); gap: 14px; }
.card-front p { font-size: 17px; font-weight: 700; text-align: center; line-height: 1.4; }

/* ============ Side panels ============ */
#sidebar {
  width: 316px; flex: none; height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #191c20, #101214); border-left: 3px solid #000;
  padding: 10px 12px; gap: 8px;
}
#left-panel {
  width: 258px; flex: none; height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #191c20, #101214); border-right: 3px solid #000;
  padding: 12px; gap: 12px;
}
#topbar { display: flex; align-items: center; justify-content: space-between; }
#action-zone { display: flex; flex-direction: column; gap: 8px; }
.btn.huge { font-size: 22px; padding: 22px 10px; width: 100%; }
.action-row { display: flex; gap: 8px; }
.action-row .btn { flex: 1; font-size: 13px; padding: 11px 4px; }
.action-row .btn.ghost { color: #ccc; }

/* ---- my hand (fanned card stack) ---- */
#hand-area { margin-top: auto; }
#hand-label { font-size: 10px; letter-spacing: 2px; color: #999; font-weight: 800; margin-bottom: 8px; }
#hand-hint { font-size: 10px; color: #666; margin-top: 8px; text-align: center; }
#hand-stack { position: relative; height: 152px; }
#hand-stack .mini-deed { position: absolute; bottom: 0; transform-origin: bottom center; cursor: pointer; }
#hand-stack .mini-deed:hover { transform: translateY(-16px) scale(1.08) !important; z-index: 40 !important; }
.hand-empty { font-size: 12px; color: #777; font-style: italic; padding-top: 60px; text-align: center; }

/* ---- mini title deed ---- */
.mini-deed {
  width: 88px; height: 120px; background: #fff; border: 2px solid #222; border-radius: 6px;
  overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,.45);
  display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s;
  position: relative;
}
.mini-deed .md-bar {
  height: 26px; flex: none; display: flex; align-items: center; justify-content: center; gap: 2px;
  border-bottom: 2px solid #222; font-size: 14px;
}
.mini-deed .md-name {
  font-size: 8.5px; font-weight: 800; text-transform: uppercase; color: #222;
  text-align: center; padding: 4px 3px 0; line-height: 1.25;
}
.mini-deed .md-price { margin-top: auto; font-size: 9px; color: #555; text-align: center; padding-bottom: 4px; font-weight: 700; }
.mini-deed .pip-house { width: 9px; height: 9px; background: #1fa32e; border: 1px solid #0b5c16; border-radius: 2px; }
.mini-deed .pip-hotel { width: 24px; height: 10px; background: #d5202a; border: 1px solid #7c0d13; border-radius: 2px; }
.mini-deed.mort::after {
  content: 'MORTGAGED'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.55); color: #a11; font-size: 8px; font-weight: 900; letter-spacing: 1px;
  transform: rotate(-25deg);
}
.mini-deed.sm { width: 66px; height: 90px; }
.mini-deed.sm .md-bar { height: 18px; font-size: 11px; }
.mini-deed.sm .md-name { font-size: 6.8px; }
.mini-deed.sm .md-price { font-size: 8px; }
.mini-deed.sm .pip-house { width: 7px; height: 7px; }
.mini-deed.sm .pip-hotel { width: 18px; height: 8px; }
.mini-deed.sm:hover { transform: translateY(-3px) scale(1.12); z-index: 3; }

/* ---- hand viewer (card carousel) ---- */
#hand-viewer {
  position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.68);
  animation: fadeIn .2s;
}
#hv-track { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.hv-card {
  position: absolute;
  transition: transform .32s cubic-bezier(.25,1,.35,1), opacity .32s, filter .32s;
}
.hv-card .deed { width: 272px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.hv-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 160;
  background: #ffffff22; color: #fff; border: 2px solid #ffffff55; border-radius: 50%;
  width: 54px; height: 54px; font-size: 30px; cursor: pointer; line-height: 1;
  transition: background .15s, transform .15s;
}
.hv-nav:hover { background: #ffffff44; transform: translateY(-50%) scale(1.1); }
.hv-prev { left: calc(50% - 330px); }
.hv-next { right: calc(50% - 330px); }
.hv-close {
  position: absolute; top: 22px; right: 26px; z-index: 160;
  background: #ffffff22; color: #fff; border: 2px solid #ffffff55; border-radius: 50%;
  width: 44px; height: 44px; font-size: 20px; cursor: pointer;
}
.hv-close:hover { background: #e21c25; }
.hv-counter {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 160;
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: 2px; text-shadow: 0 2px 6px #000;
}
#speed-toggle { display: flex; gap: 4px; }
.speed-btn {
  background: #2b3036; color: #aaa; border: 0; border-radius: 6px; padding: 4px 10px;
  font-weight: 700; cursor: pointer; font-size: 12px;
}
.speed-btn.active { background: var(--red); color: #fff; }

#player-panels { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; }
.pp {
  background: var(--panel); border-radius: 10px; padding: 8px 10px; border-left: 5px solid;
  transition: box-shadow .3s, transform .3s; position: relative;
}
.pp.active { box-shadow: 0 0 0 2px #ffd54a, 0 0 20px #ffd54a55; transform: translateX(-3px); }
.pp.dead { opacity: .4; filter: grayscale(1); }
.pp-head { display: flex; align-items: center; gap: 8px; }
.pp-token { font-size: 20px; }
.pp-name { font-weight: 800; font-size: 14px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-badge { font-size: 9px; font-weight: 800; text-transform: uppercase; padding: 2px 7px; border-radius: 10px; background: #444; color: #ddd; letter-spacing: .5px; }
.pp-badge.easy { background: #2e7d32; } .pp-badge.medium { background: #b98a00; } .pp-badge.hard { background: #b3261e; }
.pp-badge.human { background: #1565c0; }
.pp-money { font-size: 20px; font-weight: 900; color: #9be49b; margin: 3px 0 1px; font-variant-numeric: tabular-nums; }
.pp-money.flash-up { animation: moneyUp .8s; } .pp-money.flash-down { animation: moneyDown .8s; }
@keyframes moneyUp { 30% { color: #4caf50; transform: scale(1.15); } }
@keyframes moneyDown { 30% { color: #ff6b6b; transform: scale(1.15); } }
.pp-sub { font-size: 10px; color: #888; }
.pp-props { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.prop-chip {
  width: 16px; height: 22px; border-radius: 3px; border: 1px solid #000; cursor: pointer;
  position: relative; pointer-events: auto; transition: transform .1s;
  display: flex; align-items: flex-end; justify-content: center; font-size: 8px; font-weight: 900; color: #fff;
}
.prop-chip:hover { transform: scale(1.35); z-index: 2; }
.prop-chip.mort { opacity: .4; background-image: linear-gradient(45deg, transparent 44%, #f00 44%, #f00 56%, transparent 56%); }
.pp-jail { position: absolute; top: 6px; right: 8px; font-size: 14px; }

/* ============ Action bar / raise banner / log ============ */
#action-bar { display: flex; gap: 6px; }
#action-bar .btn { flex: 1; padding: 12px 6px; font-size: 14px; }
#btn-roll.pulse { animation: pulseBtn 1.2s infinite; }
@keyframes pulseBtn { 50% { box-shadow: 0 0 0 6px #e21c2555, 0 3px 0 rgba(0,0,0,.25); } }

#raise-banner {
  background: #4a1313; border: 2px solid #a33; border-radius: 10px; padding: 10px; font-size: 13px;
  animation: popIn .3s;
}
.raise-actions { display: flex; gap: 8px; margin-top: 8px; }

#log {
  flex: 1; overflow-y: auto; background: #0b0d0f; border-radius: 10px; padding: 8px 10px;
  font-size: 12px; line-height: 1.55; color: #bbb; min-height: 60px;
}
#log .good { color: #7ddc7d; } #log .bad { color: #ff8484; }
#log div { animation: logIn .25s ease; }
@keyframes logIn { from { opacity: 0; transform: translateX(8px); } }

/* ============ Modals ============ */
#modal-root:empty { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100;
  display: flex; align-items: center; justify-content: center; animation: fadeIn .2s;
}
.modal {
  background: var(--cream); color: #222; border-radius: 14px; padding: 22px 26px;
  min-width: 340px; max-width: 92vw; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.7); animation: popIn .35s cubic-bezier(.2,1.4,.3,1);
}
.modal h3 { margin-bottom: 12px; font-size: 18px; }
.modal .modal-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; }
@keyframes popIn { from { opacity: 0; transform: scale(.7); } }
@keyframes fadeIn { from { opacity: 0; } }

/* Title deed card */
.deed { width: 250px; border: 2px solid #222; border-radius: 8px; background: #fff; margin: 0 auto; overflow: hidden; }
.deed-head { padding: 10px 8px; text-align: center; border-bottom: 2px solid #222; }
.deed-head .sub { font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.deed-head .name { font-size: 15px; font-weight: 900; text-transform: uppercase; line-height: 1.15; }
.deed-body { padding: 10px 14px; font-size: 12px; }
.deed-body table { width: 100%; border-collapse: collapse; }
.deed-body td { padding: 2px 0; }
.deed-body td:last-child { text-align: right; font-weight: 700; }
.deed-foot { font-size: 10px; color: #555; text-align: center; padding: 6px 10px 10px; }
.deed-status { text-align: center; font-size: 11px; font-weight: 800; padding: 4px; }
.deed-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 8px; border-top: 1px dashed #999; }

/* Auction */
.auction-bidders { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; }
.auction-bidder { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 8px; background: #fff; border: 2px solid #ddd; font-size: 14px; }
.auction-bidder.leader { border-color: #2e7d32; background: #e6f7e6; }
.auction-bidder.out { opacity: .35; text-decoration: line-through; }
.auction-bid-now { font-size: 30px; font-weight: 900; text-align: center; color: #2e7d32; margin: 6px 0; }
.auction-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* Trade modal */
.trade-cols { display: flex; gap: 16px; }
.trade-col { flex: 1; background: #fff; border: 2px solid #ddd; border-radius: 10px; padding: 10px; min-width: 200px; }
.trade-col h4 { font-size: 13px; margin-bottom: 8px; }
.trade-prop-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 3px 0; cursor: pointer; }
.trade-prop-row .swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid #333; flex: none; }
.trade-cash { margin-top: 8px; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.trade-cash input { width: 90px; font: inherit; padding: 4px 6px; border: 2px solid #ccc; border-radius: 6px; }

/* ============ Game over ============ */
.gameover-backdrop {
  position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center; animation: fadeIn .5s;
}
.gameover-card {
  background: var(--cream); color: #222; padding: 44px 60px; border-radius: 18px; text-align: center;
  animation: popIn .6s cubic-bezier(.2,1.4,.3,1); box-shadow: 0 30px 100px #000;
}
.gameover-card .trophy { font-size: 74px; animation: hop 1s infinite; display: inline-block; }
.gameover-card h1 { font-size: 34px; margin: 10px 0 4px; }
.gameover-card p { color: #555; margin-bottom: 22px; }
.confetti {
  position: fixed; top: -20px; width: 12px; height: 12px; z-index: 299; pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: .7; }
}

/* toast for AI-only notices */
#event-caption strong { color: var(--red); }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }

/* ============ Multiplayer screens ============ */
.mp-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  overflow: auto; padding: 24px; z-index: 50;
}
.setup-card.narrow { width: min(420px, 94vw); }
.field-col { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.field-col input {
  font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 10px; border: 2px solid #ccc;
  background: #fff; text-align: center;
}
.field-col input:focus { outline: none; border-color: var(--red); }
.mp-error { color: #c22; font-weight: 700; font-size: 13px; text-align: center; min-height: 18px; }
#mp-toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 400;
  background: #222; color: #fff; padding: 10px 22px; border-radius: 24px; font-weight: 700;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); animation: popIn .3s;
}

.mode-btns { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.mode-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  font: inherit; padding: 16px 20px; border-radius: 12px; border: 2px solid #ddd; background: #fff;
  cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s;
}
.mode-btn:hover { transform: translateY(-2px); border-color: var(--red); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.mode-btn strong { font-size: 17px; }
.mode-btn small { color: #777; }
.mode-btn .mode-icon { font-size: 26px; }

#lobby-members .seat-row strong, #lobby-bots .seat-row strong { font-size: 15px; }
#lobby-host-actions { margin-top: 18px; }

/* host in-game tools & spectate requests */
#host-tools { display: flex; gap: 6px; }
#host-tools .btn { flex: 1; font-size: 12px; }
#spec-reqs {
  background: #14273a; border: 2px solid #2d5a8a; border-radius: 10px; padding: 8px 10px;
  font-size: 12.5px; animation: popIn .3s;
}
.spec-title { font-weight: 800; margin-bottom: 6px; }
.spec-row { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.spec-row span { flex: 1; font-weight: 700; }
.spec-row .btn { padding: 3px 10px; }
