:root {
  --green: #00a862;
  --bg: #030b12;
  --surface: #0b2133;
  --surface2: #10293d;
  --tile: #0f2539;
  --tile-hi: #17324a;
  --green-d: #0a3d2a;
  --green-dd: #062619;
  --ivory: #fbf5e6;
  --ivory-d: #efe4c8;
  --gold: #89aae6;          /* highlight colour (logo, selected player, prices, wildcard…) */
  --select: #cdd5df;        /* light grey for selected items */
  /* Glossy liquid glass, the shared recipe (use the .liquid-glass class, or these tokens on elements
     that can't take a class, such as #chat-input). Smooth tint, soft sheen fading from the top,
     faint blue glow from below, 24px backdrop blur, crisp bright rim. No frost grain. */
  --glass-fill:
    linear-gradient(180deg, rgba(255,255,255,.15) 0%, rgba(255,255,255,.08) 25%, rgba(255,255,255,.025) 55%, rgba(255,255,255,0) 80%),
    radial-gradient(ellipse at 50% 125%, rgba(137,170,230,.16), rgba(137,170,230,0) 60%),
    rgba(12, 32, 50, .42);
  --glass-blur: blur(24px) saturate(180%);
  --glass-border: 1px solid rgba(255,255,255,.18);
  --glass-rim: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -1px 0 rgba(255,255,255,.08);
  --glass-shadow: 0 8px 22px rgba(0,0,0,.28);
  --ink: #1b1b16;
  --muted: #8ea6bd;
  --panel: #0b2133;
  --line: rgba(255, 255, 255, 0.09);
  --danger: #e5484d;
  font-family: 'Inter', system-ui, sans-serif;
  --font-display: 'Inter', system-ui, sans-serif;
  color: #eef4fa;
}

/* reusable glossy liquid glass: add class="liquid-glass" to any panel or control */
.liquid-glass {
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
          backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-rim), var(--glass-shadow);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(circle at 50% 0%, rgba(137,170,230,.12), transparent 55%),
    var(--bg);
  overflow: hidden;
}
[hidden] { display: none !important; }
/* display font for headings, logo and buttons — one place to change it */
h1, h2, h3, .logo, .btn { font-family: var(--font-display); letter-spacing: -0.01em; }
input, button, select, textarea { font-family: inherit; }
input { font: inherit; }

/* flag stripe */
.flag-stripe { display: flex; height: 8px; width: 84px; border-radius: 4px; overflow: hidden; }
.flag-stripe i { flex: 1; background: var(--green); }
.flag-stripe i:nth-child(2) { background: #fff; }
.flag-stripe.small { height: 6px; width: 40px; }

/* buttons */
.btn {
  border: 0; cursor: pointer; border-radius: 12px; padding: 10px 16px; font-weight: 600; font-size: 15px;
  background: rgba(255,255,255,.1); color: #fff; transition: transform .08s, background .15s, opacity .15s;
}
.btn:hover { background: rgba(255,255,255,.18); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #19b36b, var(--green)); box-shadow: 0 4px 0 #005a36, 0 8px 20px rgba(0,0,0,.25); }
.btn.primary:hover { background: linear-gradient(180deg, #22c578, #009a5c); }
.btn.gold { background: linear-gradient(180deg, #a9c2ef, #7799d8); color: #061826; box-shadow: 0 4px 0 #46669f, 0 8px 20px rgba(0,0,0,.25); }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn.big { width: 100%; padding: 14px; font-size: 17px; }
.btn.tiny { padding: 6px 10px; font-size: 12px; border-radius: 8px; }

/* ---------------------------------------------------------------- home */
#home { display: grid; place-items: center; height: 100%; padding: 20px; }
.home-card {
  width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 32px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45); backdrop-filter: blur(8px);
}
.logo { font-size: 54px; line-height: .9; margin: 18px 0 6px; font-weight: 800; letter-spacing: -1.5px; }
.logo span { color: var(--gold); }
.tag { color: var(--muted); margin: 0 0 22px; }
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .join-row input, .share-row input, #chat-input, .modal input[type=number] {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: #fff; outline: none;
}
.field input:focus, .join-row input:focus { border-color: var(--green); }
.token-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.token-pick button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; color: #cfdbe7; font: 600 12px 'Inter'; padding: 8px 0; border-radius: 12px; border: 2px solid transparent; background: rgba(0,0,0,.25); cursor: pointer;
}
.token-pick .ava { width: 40px; height: 40px; }
.token-pick button.sel { border-color: var(--select); background: rgba(205,213,223,.12); }
.token-pick button:disabled { opacity: .25; cursor: not-allowed; }
.or { text-align: center; margin: 16px 0; color: var(--muted); font-size: 13px; position: relative; }
.or::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.or span { position: relative; background: var(--surface); padding: 0 10px; }
.join-row { display: flex; gap: 8px; }
.joining { color: var(--muted); }

/* ---------------------------------------------------------------- game layout */
#game { display: grid; grid-template-columns: 300px 1fr 330px; height: 100vh; gap: 16px; padding: 14px; }
.col { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }
.card { background: var(--surface); border-radius: 16px; padding: 14px 16px; }
.card h3 { margin: 0 0 10px; text-align: center; font-size: 19px; font-weight: 600; color: #cfdbe7; }
.muted { color: var(--muted); font-size: 14px; text-align: center; margin: 4px 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 4px 2px; }
/* one wordmark everywhere: "Empire" in white, "Board" in gold, Inter extra-bold */
.wordmark { font-family: var(--font-display); font-weight: 800; letter-spacing: -1.5px; }
.wordmark span { color: var(--gold); }
.brand .wordmark { font-size: 30px; letter-spacing: -1px; line-height: 1; }
.share-row { display: flex; gap: 8px; }
.share-row input { padding: 9px 12px; font-size: 13px; background: var(--surface2); border: 0; }
.share-row .btn { background: var(--surface2); }

.chat { flex: 1; display: flex; flex-direction: column; min-height: 240px; }
#chat-list { flex: 1; list-style: none; margin: 0 0 10px; padding: 0; overflow-y: auto; font-size: 15px; }
#chat-list:empty::before { content: '💬 No messages yet'; display: block; text-align: center; color: var(--muted); margin-top: 20px; }
#chat-list li { padding: 4px 0; }
#chat-list b { margin-right: 6px; }
/* chat box: glossy liquid glass (shared recipe from :root, --glass-*) */
#chat-input {
  border-radius: 999px; padding-left: 20px; padding-right: 20px; color: #fff;
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
          backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-rim), var(--glass-shadow);
  transition: border-color .2s, box-shadow .2s;
}
#chat-input::placeholder { color: rgba(238,244,250,.55); }
#chat-input:focus { outline: none; border-color: rgba(255,255,255,.32); box-shadow: inset 0 1px 0 rgba(255,255,255,.42), inset 0 0 22px rgba(255,255,255,.07), 0 0 0 3px rgba(205,213,223,.18), 0 8px 22px rgba(0,0,0,.28); }

.players { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.player {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; position: relative;
}
.player.turn { background: var(--surface2); }
.player.turn::before { content: ''; position: absolute; left: -16px; top: 10%; bottom: 10%; width: 4px; border-radius: 2px; background: var(--gold); }
.player.off { opacity: .55; }
.player.out { opacity: .35; text-decoration: line-through; }
.avatar { width: 44px; height: 44px; }
.ava { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.pname { font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmeta { font-size: 12.5px; color: var(--muted); }
.pmoney { font-weight: 700; font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.pmoney.neg { color: var(--danger); }
.delta { display: block; font-size: 13px; color: #3ddc84; animation: fadeUp 2.5s forwards; }
.delta.neg { color: var(--danger); }
@keyframes fadeUp { 70% { opacity: 1; } to { opacity: 0; transform: translateY(-4px); } }
.player .btn.tiny { margin-top: 4px; padding: 3px 9px; }
.pot { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; padding: 10px 12px 0; margin-top: 8px; border-top: 1px solid var(--line); }
.pot b { color: var(--gold); font-size: 17px; }

.trades { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.trades li { background: var(--surface2); border-radius: 10px; padding: 10px; line-height: 1.45; }
.trades .row { display: flex; gap: 6px; margin-top: 8px; }
#btn-forfeit { display: block; margin: 14px auto 0; width: auto; }
/* red, so nobody gives up their empire by accident */
/* hug-width pill: sized by its label plus padding, soft red fill so the pill shape shows */
#btn-forfeit { color: var(--danger); border-color: transparent; border-radius: 999px; padding: 9px 22px; background: rgba(229, 72, 77, .12); }
#btn-forfeit:hover { background: rgba(229, 72, 77, .22); border-color: transparent; color: #ff6b6f; }

/* ---------------------------------------------------------------- board */
.board-col { display: grid; place-items: center; min-width: 0; min-height: 0; }
.board {
  position: relative; container-type: inline-size;
  width: min(100%, calc(100vh - 28px)); aspect-ratio: 1;
  display: grid; grid-template-columns: 1.6fr repeat(9, 1fr) 1.6fr; grid-template-rows: 1.6fr repeat(9, 1fr) 1.6fr; gap: .35cqw;
}
.tile { position: relative; background: var(--tile); color: #f1f7f3; cursor: pointer; border-radius: .7cqw; transition: background .2s; }
.tile:hover { background: var(--tile-hi); z-index: 4; }
.tile.sel { box-shadow: 0 0 0 .25cqw var(--select); z-index: 4; }
.tile-in {
  position: absolute; left: 50%; top: 50%; width: calc(100cqw / var(--units, 12.2)); height: calc(100cqw / var(--units, 12.2) * 1.6);
  transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; text-align: center;
}
.side-left .tile-in { transform: translate(-50%, -50%) rotate(90deg); }
.side-right .tile-in { transform: translate(-50%, -50%) rotate(-90deg); }
.side-top .tile-in { flex-direction: column-reverse; }
.band { width: 100%; height: 21%; flex-shrink: 0; background: var(--g); display: grid; place-items: center; border-radius: .7cqw .7cqw 0 0; }
.side-top .band { border-radius: 0 0 .7cqw .7cqw; }
.houses { display: flex; gap: .2cqw; align-items: center; }
.houses .h { width: 1cqw; height: 1cqw; background: #3ddc84; border-radius: .15cqw; box-shadow: 0 0 0 .12cqw #fff; }
.houses .hotel { width: 2.4cqw; height: 1.1cqw; background: #ff4d5e; border-radius: .2cqw; box-shadow: 0 0 0 .12cqw #fff; }
.tcity { font-size: 1cqw; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--g); margin-top: 7%; line-height: 1; filter: brightness(1.25); }
.side-top .tcity { margin: 0 0 7%; }
.tname { font-family: 'Barlow Condensed', sans-serif; font-size: 1.75cqw; font-weight: 600; line-height: .95; padding: 3% 4% 0; flex: 1; display: flex; align-items: flex-start; justify-content: center; }
.side-top .tname { align-items: flex-end; padding: 0 4% 3%; }
.ticon { font-size: 2.8cqw; flex: 1; display: grid; place-items: center; line-height: 1; }
.tprice {
  font-family: 'Barlow Condensed', sans-serif; font-size: 1.45cqw; font-weight: 700; margin: 0 0 8%; padding: .1cqw .6cqw; border-radius: .4cqw;
  background: rgba(255,255,255,.1); color: #fff;
}
.tprice.ghost { visibility: hidden; }
.side-top .tprice { margin: 8% 0 0; }
.board .tile.owned { background: var(--owner); box-shadow: inset 0 0 0 .3cqw rgba(255,255,255,.55); }
.board .tile.owned:hover { background: var(--owner); filter: brightness(1.1); }
.tile.owned .tcity { color: #fff; filter: none; opacity: .9; }
.tile.owned .tname { color: #fff; text-shadow: 0 .1cqw .2cqw rgba(0,0,0,.35); }
.tile.owned .tprice { background: rgba(0,0,0,.3); }
.tile.mortgaged .tile-in { filter: grayscale(1); opacity: .4; }
.tile.mortgaged::after { content: 'MORTGAGED'; position: absolute; inset: 0; display: grid; place-items: center; font-size: .8cqw; font-weight: 800; color: var(--danger); transform: rotate(-35deg); letter-spacing: .1em; }
.tile.special .tile-in { justify-content: center; gap: 3%; padding: 10% 0 0; }
.tile.special .tname { flex: 0; }
.tile.t-jara .tname { color: var(--gold); }
.tile.t-ajo .tname { color: #3ddc84; }
.tile.t-transport, .tile.t-utility { background: #1a2b30; }
.tile.corner .tile-in { width: 100%; height: 100%; justify-content: center; gap: 4%; transform: translate(-50%, -50%); padding: 0; }
.corner .ticon { font-size: 3.6cqw; flex: 0; }
.corner .tname { font-size: 2.1cqw; flex: 0; }
.corner .tsub { font-size: 1.1cqw; color: var(--muted); padding: 0 8%; }
.corner.t-start { background: radial-gradient(circle, #1f4a35, var(--tile) 70%); }
.corner.t-jail { background: repeating-linear-gradient(90deg, var(--tile) 0 11%, #243546 11% 13%); }
.corner.t-owambe { background: radial-gradient(circle, #4a3d14, var(--tile) 70%); }
.corner.t-gotojail { background: radial-gradient(circle, #4a1f22, var(--tile) 70%); }

/* center */
.center { grid-area: 2 / 2 / 11 / 11; position: relative; overflow: hidden; border-radius: 1cqw; background: var(--bg); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.ankara {
  position: absolute; inset: 0; opacity: .07; pointer-events: none;
  background:
    radial-gradient(circle at 0 0, transparent 22%, var(--gold) 23% 25%, transparent 26% 34%, #ff7a1a 35% 37%, transparent 38%) 0 0 / 7cqw 7cqw,
    radial-gradient(circle at 50% 50%, #fff 6%, transparent 7% 14%, var(--gold) 15% 17%, transparent 18%) 0 0 / 7cqw 7cqw;
}
.center-logo { position: absolute; left: 50%; top: 31%; transform: translate(-50%, -50%); pointer-events: none; opacity: .045; }
.center-logo h2 { margin: 0; font-size: 7cqw; font-weight: 800; letter-spacing: -.2cqw; line-height: .9; text-align: center; }
.center-logo h2 span { display: block; color: var(--gold); }
#dice-stage { position: absolute; left: 3%; right: 3%; top: 3%; height: 54%; z-index: 3; pointer-events: none; }
#dice-stage canvas { width: 100% !important; height: 100% !important; display: block; }
.roll-result {
  position: absolute; z-index: 4; left: 50%; top: 56%; transform: translate(-50%, -50%) scale(.8); font-weight: 700;
  font-size: max(13px, 1.5cqw); color: #fff; background: rgba(255,255,255,.08); padding: .3cqw 1.2cqw; border-radius: 99px; opacity: 0; transition: all .25s; pointer-events: none;
}
.roll-result.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.actions {
  position: absolute; z-index: 5; left: 50%; bottom: 30.5%; transform: translateX(-50%); width: 80%;
  display: flex; flex-direction: column; align-items: center; gap: .9cqw; text-align: center;
}
.actions .row { display: flex; gap: 1cqw; flex-wrap: wrap; justify-content: center; }
.actions .btn { font-size: max(15px, 1.7cqw); padding: 1.1cqw 2.4cqw; }
.actions .msg { font-size: max(15px, 1.65cqw); color: #e6fff1; }
.actions .msg.small { font-size: max(13px, 1.3cqw); color: var(--muted); }
.actions .msg a { color: var(--gold); }
.actions .msg.warn {
  background: rgba(229, 72, 77, .2); color: #ffd6d7; font-weight: 600; border: 1px solid rgba(255, 110, 115, .55);
  padding: .9cqw 2cqw; border-radius: 12px; backdrop-filter: blur(6px);
  box-shadow: 0 .45cqw 0 rgba(140, 25, 30, .45), 0 1cqw 2cqw rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.12);
}
.actions .btn.raise { font-size: max(12px, 1.2cqw); padding: .6cqw 1.2cqw; border-radius: 10px; }
.actions .row:has(.raise) { gap: .6cqw; }
.actions .btn.raise b { color: #9dffc6; margin-left: .3cqw; }
.actions .btn.primary.raise b { color: #fff; }
.actions .btn.link-danger { background: none; box-shadow: none; color: rgba(255, 150, 152, .75); font-size: max(12px, 1.1cqw); font-weight: 500; padding: .2cqw .6cqw; text-decoration: underline; text-underline-offset: 3px; }
.actions .btn.link-danger:hover { color: #ff8a8d; background: none; }
.playing { font-size: max(16px, 2cqw); font-weight: 500; display: flex; align-items: center; gap: .8cqw; }
.playing .dot { width: 3cqw; height: 3cqw; display: block; }
.log {
  position: absolute; z-index: 4; left: 12%; right: 12%; top: 71%; bottom: 2%; margin: 0; padding: 0; list-style: none; overflow: hidden;
  font-size: max(10px, calc(1.55cqw - 4px)); color: rgba(255,255,255,.8); text-align: center;
  mask-image: linear-gradient(to bottom, #000 45%, transparent);
}
.log li { padding: .25cqw 0; }
.log li:first-child { color: #fff; }

/* lobby panel */
.lobby {
  /* glossy liquid glass: shared recipe from :root (--glass-*) */
  position: relative; isolation: isolate; overflow: hidden; width: 100%;
  padding: calc(2cqw + 18px) 2cqw; border-radius: 36px;
  font-size: max(14px, calc(1.25cqw + 2px));
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
          backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-rim), 0 22px 54px rgba(0,0,0,.45);
}
.lobby h4 { margin: 0 0 1.2cqw; font-family: var(--font-display); font-size: max(19px, calc(1.8cqw + 4px)); }
.lobby label { display: flex; justify-content: space-between; align-items: center; gap: 1cqw; padding: .55cqw 0; text-align: left; }
.lobby .pmeta { font-size: 14.5px; }
/* dropdowns: our own chevron with room on the right, so the arrow lines up with the text */
.lobby select {
  font: inherit; color: #fff; -webkit-appearance: none; appearance: none; cursor: pointer;
  background: rgba(255,255,255,.08) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%23eef4fa' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 14px center / 12px 8px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 7px 38px 7px 12px;
}
.lobby select:hover { background-color: rgba(255,255,255,.12); }
.lobby select:focus-visible { outline: 2px solid var(--select); outline-offset: 1px; }
.lobby select option { color: #061826; }

/* auction */
.auction { background: rgba(3, 14, 24, .72); backdrop-filter: blur(4px); border-radius: 1.4cqw; padding: 1.6cqw; width: 100%; box-shadow: 0 1cqw 3cqw rgba(0,0,0,.4); }
.auction .big { font-size: max(18px, 2.4cqw); font-weight: 800; font-family: var(--font-display); color: var(--gold); }
.timer { height: 6px; background: rgba(255,255,255,.12); border-radius: 3px; overflow: hidden; margin: 1cqw 0; }
.timer i { display: block; height: 100%; background: var(--gold); transition: width .25s linear; }

/* card popup */
.card-pop {
  position: absolute; z-index: 8; left: 50%; top: 45%; width: 34cqw; min-height: 18cqw; transform: translate(-50%, -50%);
  background: var(--ivory); color: var(--ink); border-radius: 1.4cqw; padding: 2cqw; text-align: center; box-shadow: 0 2cqw 5cqw rgba(0,0,0,.6);
  animation: flip .5s cubic-bezier(.2,1.4,.4,1); cursor: pointer; border-top: 1.2cqw solid #f08a24;
}
.card-pop.ajo { border-top-color: var(--green); }
.card-pop h5 { margin: 0 0 1cqw; font-family: var(--font-display); font-size: 2.2cqw; letter-spacing: .15em; }
.card-pop p { font-size: max(13px, 1.6cqw); margin: 0; line-height: 1.35; }
.card-pop .who { font-size: max(11px, 1.1cqw); opacity: .6; margin-top: 1.2cqw; }
@keyframes flip { from { transform: translate(-50%, -50%) rotateY(90deg) scale(.6); opacity: 0; } }

/* tokens */
.token-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.token {
  position: absolute; width: 3.8cqw; height: 3.8cqw; margin: -1.9cqw 0 0 -1.9cqw;
  transition: left .16s ease-out, top .16s ease-out;
}
.token.hop { animation: hop .16s ease-out; }
@keyframes hop { 50% { transform: translateY(-1.2cqw) scale(1.12); } }
.token.to-jail { transition: left .7s cubic-bezier(.5,0,.3,1), top .7s cubic-bezier(.5,0,.3,1); }

/* jail cell door */
.jail-door { position: absolute; z-index: 3; perspective: 26cqw; pointer-events: none; display: none; }
.jail-door.open, .jail-door.slam, .jail-door.shut, .jail-door.opening { display: block; }
.jd-leaf { position: absolute; inset: 0; transform-origin: 0 50%; filter: drop-shadow(0 .4cqw .5cqw rgba(0,0,0,.7)); }
.jd-leaf svg { width: 100%; height: 100%; display: block; }
.jail-door.open .jd-leaf { transform: rotateY(-100deg); opacity: 0; }
.jail-door.slam .jd-leaf { animation: door-slam .9s forwards; }
.jail-door.opening .jd-leaf { animation: door-open .6s ease-in forwards; }
@keyframes door-slam {
  0%   { transform: rotateY(-100deg); opacity: 0; animation-timing-function: cubic-bezier(.6,0,1,.6); }
  8%   { opacity: 1; }
  37%  { transform: rotateY(0); animation-timing-function: ease-out; }   /* SLAM */
  50%  { transform: rotateY(-14deg); animation-timing-function: ease-in; }
  62%  { transform: rotateY(0); animation-timing-function: ease-out; }
  72%  { transform: rotateY(-4deg); animation-timing-function: ease-in; }
  80%, 100% { transform: rotateY(0); opacity: 1; }
}
@keyframes door-open { to { transform: rotateY(-100deg); opacity: 0; } }
/* sparks + dust when the door hits the frame */
.jd-spark { position: absolute; inset: -20%; opacity: 0; pointer-events: none;
  background:
    radial-gradient(circle at 100% 50%, rgba(255,240,180,.95) 0 3%, transparent 4%),
    conic-gradient(from 0deg at 100% 50%, transparent 0 20deg, rgba(255,220,120,.9) 21deg 23deg, transparent 24deg 60deg, rgba(255,220,120,.8) 61deg 62deg, transparent 63deg 110deg, rgba(255,220,120,.85) 111deg 113deg, transparent 114deg 150deg, rgba(255,220,120,.8) 151deg 152deg, transparent 153deg);
  -webkit-mask: radial-gradient(circle at 100% 50%, transparent 8%, #000 9% 30%, transparent 40%);
          mask: radial-gradient(circle at 100% 50%, transparent 8%, #000 9% 30%, transparent 40%); }
.jail-door.slam .jd-spark { animation: spark .45s .3s ease-out; }
@keyframes spark { 0% { opacity: 1; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.25); } }
.jail-door.shut .jd-leaf { transform: none; opacity: 1; }
.board.jolt { animation: jolt .32s ease-out; }
@keyframes jolt { 20% { transform: translate(.35cqw, -.2cqw); } 40% { transform: translate(-.3cqw, .2cqw); } 60% { transform: translate(.18cqw, .1cqw); } 80% { transform: translate(-.08cqw, -.05cqw); } }
@media (prefers-reduced-motion: reduce) { .jail-door.slam .jd-leaf, .board.jolt { animation-duration: .01s; } }

/* deed popover */
.deed-pop { position: absolute; z-index: 9; left: 50%; top: 4%; transform: translateX(-50%); width: min(46cqw, 92%); max-height: 92%; overflow: auto; border-radius: 14px; box-shadow: 0 2cqw 5cqw rgba(0,0,0,.65); animation: drop .2s; }
.deed-pop .deed { position: relative; }
.deed-x { position: absolute; z-index: 3; right: 8px; top: 8px; border: 0; padding: 0; background: rgba(0,0,0,.3); color: #fff; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 15px; display: grid; place-items: center; }
.deed-x::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; }
.deed-x:hover { background: rgba(0,0,0,.5); }
.deed-pop .deed-head b { font-size: max(20px, 2.4cqw); }
.deed-pop .deed-head small { font-size: max(12px, 1.2cqw); }
.deed-pop .deed td { font-size: max(14px, 1.5cqw); padding: .45cqw 1.6cqw; }
.deed-pop .deed tr.sep td { border-top: 1px solid var(--line); padding-top: .9cqw; }
.deed-pop .deed td small { color: var(--muted); font-weight: 400; }
.deed-pop .foot { font-size: max(14px, 1.4cqw); padding: 1cqw 1.6cqw; }
.deed-pop .foot.big { font-size: max(15px, 1.6cqw); line-height: 1.4; padding: 1.6cqw; }
.deed-pop .acts { padding: 0 1.6cqw 1.4cqw; }
.deed-pop .acts .btn { font-size: max(13px, 1.3cqw); }
.owner-tag { display: inline-flex; align-items: center; gap: 6px; }
.owner-tag .ava { width: 24px; height: 24px; }
.red { color: var(--danger); }
.hint { position: absolute; top: 1.2%; left: 0; right: 0; text-align: center; color: var(--muted); font-size: max(12px, 1.15cqw); opacity: .7; pointer-events: none; }

/* right panel */
.tile-info .empty { color: var(--muted); font-size: 13px; padding: 6px; text-align: center; }
.deed { background: var(--surface2); border-radius: 12px; overflow: hidden; }
.deed-head { padding: 12px; text-align: center; color: #fff; }
.deed-head small { display: block; font-size: 10px; letter-spacing: .15em; opacity: .85; text-transform: uppercase; }
.deed-head b { font-family: var(--font-display); font-size: 20px; }
.deed table { width: 100%; border-collapse: collapse; font-size: 13px; }
.deed td { padding: 4px 12px; color: #d6e8de; font-size: 14px; }
.deed td:last-child { text-align: right; font-weight: 600; color: #fff; }
.deed tr.on td { background: rgba(137,170,230,.22); }
.deed .foot { padding: 8px 12px 12px; font-size: 12px; border-top: 1px solid var(--line); color: #cfdbe7; }
.deed .acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.portfolio { display: flex; flex-wrap: wrap; gap: 5px; }
/* owned-property chips: 8% white pills; the colour set shows as a dot (a side stripe would curl round a pill end) */
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.08); cursor: pointer; transition: background .15s; }
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c, #888); flex-shrink: 0; box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
.chip:hover { background: rgba(255,255,255,.13); }
.chip.m { opacity: .45; }
.portfolio .empty { color: var(--muted); font-size: 12px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: grid; place-items: center; z-index: 50; backdrop-filter: blur(3px); }
.modal-box { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; width: min(720px, 94vw); max-height: 90vh; overflow: auto; }
.modal-box h3 { margin: 0 0 14px; font-size: 22px; }
.trade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.trade-col { background: var(--surface2); border-radius: 14px; padding: 12px; }
.trade-col h4 { margin: 0 0 8px; }
.trade-col label.p { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.trade-col label.p:hover { background: rgba(255,255,255,.05); }
.trade-col label.p i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.trade-col label.p.dis { opacity: .35; cursor: not-allowed; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* toasts */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--surface2); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 14px; animation: drop .25s; border-left: 4px solid var(--green); }
.toast.err { border-left-color: var(--danger); }
@keyframes drop { from { transform: translateY(10px); opacity: 0; } }

.winner { background: var(--surface2); border-radius: 2cqw; padding: 2.4cqw; }
.winner .big { font-size: 4cqw; }
.winner h4 { margin: .6cqw 0; font-family: var(--font-display); font-size: 2.6cqw; color: var(--gold); }

@media (max-width: 1150px) {
  body { overflow: auto; }
  #game { grid-template-columns: 1fr; height: auto; }
  /* board width on narrow screens: see .board-vp in the zoom section */
  .col.left { order: 3; } .col.right { order: 2; }
}

/* ---------------------------------------------------------------- character animation */
.ava { overflow: visible; }
.ava .body { transform-box: fill-box; transform-origin: 50% 100%; animation: ava-bob 2.6s ease-in-out infinite; animation-delay: var(--bd, 0ms); }
.ava .eyes { transform-box: fill-box; transform-origin: center; animation: ava-blink 5.2s infinite; animation-delay: var(--bd, 0ms); }
.ava .pupils { animation: ava-glance 9s ease-in-out infinite; animation-delay: var(--gd, 0ms); }
.ava .brow, .ava .m-smirk { opacity: 0; transition: opacity .15s; }
.ava .m-normal { transition: opacity .15s; }
@keyframes ava-bob {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  50% { transform: translateY(-2.5px) scale(1.02, .975); }
}
@keyframes ava-blink {
  0%, 44%, 49%, 90%, 94.5%, 100% { transform: scaleY(1); }
  46.5% { transform: scaleY(.08); }   /* blink */
  92% { transform: scaleY(.08); }     /* double blink */
  93.2% { transform: scaleY(1); }
  93.8% { transform: scaleY(.1); }
}
@keyframes ava-glance {
  0%, 18%, 100% { transform: translate(0, 0); }
  22%, 38% { transform: translate(-4px, 0); }
  42%, 60% { transform: translate(0, 0); }
  64%, 78% { transform: translate(3px, -2px); }
  82% { transform: translate(0, 0); }
}

/* smirk reaction (bought a property) */
.ava.smirk .m-normal { opacity: 0; }
.ava.smirk .m-smirk, .ava.smirk .brow { opacity: 1; }
.ava.smirk .body { animation: ava-smirk 1.9s cubic-bezier(.3,1.5,.5,1) both; animation-delay: var(--sd, 0ms); }
.ava.smirk .eyes { animation: ava-squint 1.9s ease both; animation-delay: var(--sd, 0ms); }
.ava.smirk .pupils { animation: ava-sideeye 1.9s ease both; animation-delay: var(--sd, 0ms); }
.ava.smirk .brow { animation: ava-brow 1.9s ease both; animation-delay: var(--sd, 0ms); transform-box: fill-box; transform-origin: center; }
@keyframes ava-smirk {
  0% { transform: rotate(0) scale(1); }
  12% { transform: rotate(-12deg) scale(1.12); }
  22% { transform: rotate(-8deg) scale(1.05); }
  70% { transform: rotate(-9deg) scale(1.05); }
  100% { transform: rotate(0) scale(1); }
}
@keyframes ava-squint { 0%, 100% { transform: scaleY(1); } 14%, 80% { transform: scaleY(.62); } }
@keyframes ava-sideeye { 0%, 100% { transform: translate(0, 0); } 14%, 80% { transform: translate(4px, 1px); } }
@keyframes ava-brow { 0% { transform: translateY(4px); } 15%, 40% { transform: translateY(-2px); } 27% { transform: translateY(0); } 55% { transform: translateY(-3px); } 100% { transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .ava .body, .ava .eyes, .ava .pupils { animation: none !important; }
}
.room-code { text-align: center; color: var(--muted); font-size: 14px; margin: -4px 0 10px; }
.room-code b { color: var(--gold); font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 20px; letter-spacing: .12em; margin-left: 6px; }
.room-code { display: flex; align-items: center; justify-content: center; }
#btn-copy-code { background: var(--surface2); margin-left: 10px; padding: 5px 10px; }
#join-code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .06em; }
#join-code::placeholder { font-family: 'Inter', sans-serif; letter-spacing: 0; }

/* laugh reaction (big wins: rent collected, auction won, Owambe pot, game won) */
.ava .eyes-laugh, .ava .m-laugh, .ava .tears { opacity: 0; }
.ava.laugh .eyes, .ava.laugh .m-normal, .ava.laugh .m-smirk, .ava.laugh .brow { opacity: 0; animation: none; }
.ava.laugh .eyes-laugh, .ava.laugh .m-laugh { opacity: 1; }
.ava.laugh .body { animation: ava-laugh 2.6s ease-out both; animation-delay: var(--sd, 0ms); }
.ava.laugh .m-laugh { transform-box: fill-box; transform-origin: 50% 0; animation: ava-chatter .2s ease-in-out infinite alternate; }
.ava.laugh .tears { animation: ava-tears 2.6s ease both; animation-delay: var(--sd, 0ms); }
.ava.laugh .eyes-laugh { transform-box: fill-box; transform-origin: center; animation: ava-squeeze .2s ease-in-out infinite alternate; }
.ava.laugh.loop .body { animation: ava-laugh-loop 1.3s ease-in-out infinite; }
.ava.laugh.loop .tears { animation: ava-tears-loop 1.3s ease infinite; }
@keyframes ava-laugh {
  0% { transform: translateY(0) rotate(0) scale(1); }
  6% { transform: translateY(-7px) rotate(-8deg) scale(1.12, 1.08); }
  12% { transform: translateY(0) rotate(6deg) scale(1.08, .94); }
  18% { transform: translateY(-6px) rotate(-7deg) scale(1.1, 1.06); }
  24% { transform: translateY(0) rotate(6deg) scale(1.08, .95); }
  30% { transform: translateY(-5px) rotate(-6deg) scale(1.09, 1.05); }
  36% { transform: translateY(0) rotate(5deg) scale(1.06, .96); }
  44% { transform: translateY(-4px) rotate(-5deg) scale(1.07, 1.04); }
  52% { transform: translateY(0) rotate(4deg) scale(1.05, .97); }
  62% { transform: translateY(-3px) rotate(-3deg) scale(1.04); }
  74% { transform: translateY(0) rotate(2deg) scale(1.02); }
  100% { transform: translateY(0) rotate(0) scale(1); }
}
@keyframes ava-laugh-loop {
  0%, 100% { transform: translateY(0) rotate(0) scale(1); }
  15% { transform: translateY(-6px) rotate(-7deg) scale(1.1, 1.06); }
  30% { transform: translateY(0) rotate(5deg) scale(1.06, .95); }
  45% { transform: translateY(-5px) rotate(-6deg) scale(1.09, 1.05); }
  60% { transform: translateY(0) rotate(4deg) scale(1.05, .96); }
}
@keyframes ava-chatter { from { transform: scaleY(1); } to { transform: scaleY(.72); } }
@keyframes ava-squeeze { from { transform: scaleY(1); } to { transform: scaleY(.8) translateY(1px); } }
@keyframes ava-tears { 0%, 15% { opacity: 0; transform: translateY(0); } 30%, 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }
@keyframes ava-tears-loop { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  .ava.laugh .body, .ava.laugh .m-laugh, .ava.laugh .eyes-laugh { animation: none !important; }
}

/* sad reaction (lost money: rent, tax, fines, bail; forever when bankrupt) */
.ava .sad-face, .ava .tear-sad { opacity: 0; }
.ava.sad .m-normal, .ava.sad .m-smirk, .ava.sad .brow { opacity: 0; }
.ava.sad .sad-face { opacity: 1; }
.ava.sad .body { animation: ava-sad 2.6s ease-in-out both; animation-delay: var(--sd, 0ms); }
.ava.sad .pupils { animation: ava-lookdown 2.6s ease both; animation-delay: var(--sd, 0ms); }
.ava.sad .eyes { animation: ava-droop 2.6s ease both; animation-delay: var(--sd, 0ms); }
.ava.sad .tear-sad { animation: ava-tear-fall 2.6s ease-in both; animation-delay: var(--sd, 0ms); }
.ava.sad.loop .body { animation: ava-sad-loop 3s ease-in-out infinite; }
.ava.sad.loop .pupils { animation: none; transform: translate(0, 4px); }
.ava.sad.loop .eyes { animation: none; transform: scaleY(.85); }
.ava.sad.loop .tear-sad { animation: ava-tear-fall 3s ease-in infinite; }
.ava.sad.loop { filter: grayscale(.6) drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
@keyframes ava-sad {
  0% { transform: translateY(0) rotate(0) scale(1); }
  12% { transform: translateY(3px) rotate(0) scale(1.04, .9); }
  26% { transform: translateY(3px) rotate(-6deg) scale(1.02, .93); }
  40% { transform: translateY(3px) rotate(6deg) scale(1.02, .93); }
  54% { transform: translateY(3px) rotate(-4deg) scale(1.02, .93); }
  68% { transform: translateY(3px) rotate(0) scale(1.02, .93); }
  100% { transform: translateY(0) rotate(0) scale(1); }
}
@keyframes ava-sad-loop {
  0%, 100% { transform: translateY(3px) rotate(0) scale(1.02, .93); }
  30% { transform: translateY(3px) rotate(-5deg) scale(1.02, .93); }
  60% { transform: translateY(3px) rotate(4deg) scale(1.02, .93); }
}
@keyframes ava-lookdown { 0%, 100% { transform: translate(0, 0); } 12%, 85% { transform: translate(-1px, 4px); } }
@keyframes ava-droop { 0%, 100% { transform: scaleY(1); } 12%, 85% { transform: scaleY(.85); } }
@keyframes ava-tear-fall { 0%, 15% { opacity: 0; transform: translateY(0); } 25% { opacity: 1; } 80% { opacity: 1; transform: translateY(16px); } 100% { opacity: 0; transform: translateY(22px); } }
@media (prefers-reduced-motion: reduce) { .ava.sad .body, .ava.sad.loop .body { animation: none !important; } }

/* board picker (home) */
.board-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.board-pick button {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  padding: 10px 12px; border-radius: 12px; border: 2px solid transparent; background: rgba(0,0,0,.25); color: #eef4fa; cursor: pointer; font: inherit;
}
.board-pick button:hover { background: rgba(255,255,255,.06); }
.board-pick button.sel { border-color: var(--select); background: rgba(205,213,223,.1); }
.board-pick .bflag { grid-row: span 2; font-size: 26px; line-height: 1; }
.board-pick b { font-family: var(--font-display); font-size: 16px; }
.board-pick small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-pick .bcur { position: absolute; top: 8px; right: 10px; font-style: normal; font-weight: 700; color: var(--gold); font-size: 13px; }
#home { overflow-y: auto; }

/* home globe logo with cycling currency */
.globe-logo { position: relative; width: 64px; height: 64px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.45)); }
/* the globe: a lit sphere drawn and turned by public/globe.js (white continents on a glossy blue ocean) */
.globe-logo .globe-img { width: 100%; height: 100%; display: block; user-select: none; } /* spun by globe.js */
.globe-cur {
  position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 26px;
  color: #061826; text-shadow: 0 0 3px #fff, 0 0 6px #fff, 0 0 10px rgba(255,255,255,.9); transition: transform .26s ease, opacity .26s ease;
}
#globe-cur.out { transform: translateY(-10px) scale(.6) rotateX(70deg); opacity: 0; }
#globe-cur.in { transform: translateY(10px) scale(.6) rotateX(-70deg); opacity: 0; transition: none; }
@keyframes globe-tilt { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .globe-logo .globe-img { animation: none; } }

/* Roll dice, Buy and the big home buttons (.shine): rich green with a white shimmer sweeping left → right */
.btn.roll-btn, .btn.buy-btn, .btn.shine {
  position: relative; overflow: hidden; isolation: isolate; color: #fff; text-shadow: 0 1px 2px rgba(0,60,25,.55);
  background: linear-gradient(180deg, #2fd26f 0%, #16a34a 50%, #0e7c36 100%);
  box-shadow: 0 .6cqw 0 #0a5527, 0 1.2cqw 2.4cqw rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.6);
}
.btn.roll-btn:hover, .btn.buy-btn:hover, .btn.shine:hover { background: linear-gradient(180deg, #3ee07d 0%, #1cb455 50%, #108a3c 100%); }
.btn.roll-btn:active, .btn.buy-btn:active, .btn.shine:active { transform: translateY(.4cqw); box-shadow: 0 .2cqw 0 #0a5527, 0 .6cqw 1.2cqw rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.6); }
.btn.roll-btn::after, .btn.buy-btn::after, .btn.shine::after {
  content: ''; position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,0) 20%, rgba(255,255,255,.45) 50%, rgba(255,255,255,0) 80%, transparent 100%);
  transform: translateX(-120%) skewX(-18deg); animation: roll-shimmer 2.6s ease-in-out infinite;
}
@keyframes roll-shimmer {
  0% { transform: translateX(-120%) skewX(-18deg); }
  55%, 100% { transform: translateX(260%) skewX(-18deg); }
}
.btn.roll-btn:disabled::after, .btn.buy-btn:disabled::after, .btn.shine:disabled::after { animation: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .btn.roll-btn::after, .btn.buy-btn::after, .btn.shine::after { animation: none; opacity: 0; } }

/* bright, glossy 3D icon badges on special tiles */
.icon3d {
  position: relative; display: grid; place-items: center; width: 3.7cqw; height: 3.7cqw; border-radius: 1.1cqw;
  background: radial-gradient(120% 120% at 30% 20%, var(--c1) 0%, var(--c2) 75%);
  box-shadow:
    inset 0 .25cqw .2cqw rgba(255,255,255,.65),      /* top rim light */
    inset 0 -.35cqw .4cqw rgba(0,0,0,.25),           /* bottom inner shade */
    0 .45cqw 0 color-mix(in srgb, var(--c2) 65%, black), /* extruded base */
    0 .9cqw 1.2cqw rgba(0,0,0,.45);                   /* drop shadow */
  transform: translateY(-.2cqw);
}
.icon3d::before {
  content: ''; position: absolute; left: 12%; right: 12%; top: 7%; height: 38%; border-radius: 50% 50% 40% 40% / 70% 70% 30% 30%;
  background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0)); pointer-events: none;
}
.icon3d i {
  position: relative; font-style: normal; font-size: 2.25cqw; line-height: 1;
  filter: saturate(1.45) brightness(1.15) contrast(1.05) drop-shadow(0 .18cqw .12cqw rgba(0,0,0,.35));
}
.corner .icon3d { width: 5.4cqw; height: 5.4cqw; border-radius: 1.5cqw; }
.corner .icon3d i { font-size: 3.3cqw; }
.tile:hover .icon3d { transform: translateY(-.45cqw) scale(1.06); transition: transform .15s; }
.ticon { overflow: visible; }

/* house / hotel icons */
.houses { gap: .1cqw; }
.houses .hico { width: 1.35cqw; height: 1.35cqw; display: block; filter: drop-shadow(0 .1cqw .1cqw rgba(0,0,0,.45)); }
.houses .hico.hotel { width: 2.6cqw; height: 1.55cqw; }

/* full colour set completed: 4s glow in the set colour */
.board .tile.set-glow { z-index: 5; animation: set-glow 4s ease-in-out both; }
@keyframes set-glow {
  0%   { box-shadow: 0 0 0 0 transparent; }
  10%  { box-shadow: 0 0 0 .35cqw var(--glow), 0 0 2.4cqw .8cqw var(--glow); transform: scale(1.06); }
  25%  { box-shadow: 0 0 0 .25cqw var(--glow), 0 0 1.2cqw .3cqw var(--glow); transform: scale(1.02); }
  40%  { box-shadow: 0 0 0 .35cqw var(--glow), 0 0 2.4cqw .8cqw var(--glow); transform: scale(1.05); }
  55%  { box-shadow: 0 0 0 .25cqw var(--glow), 0 0 1.2cqw .3cqw var(--glow); transform: scale(1.02); }
  70%  { box-shadow: 0 0 0 .35cqw var(--glow), 0 0 2.4cqw .8cqw var(--glow); transform: scale(1.04); }
  100% { box-shadow: 0 0 0 0 transparent; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .board .tile.set-glow { animation-duration: .01s; } }

/* make characters pop on tiles of the same colour */
.ava .ring { display: none; }
.token .ava .ring { display: inline; }
.token .ava {
  filter:
    drop-shadow(0 0 .12cqw rgba(0,0,0,.95))
    drop-shadow(0 0 .12cqw rgba(0,0,0,.95))
    drop-shadow(0 .45cqw .5cqw rgba(0,0,0,.65));
}
.avatar .ava, .owner-tag .ava, .playing .dot .ava {
  filter: drop-shadow(0 0 1px rgba(0,0,0,.9)) drop-shadow(0 3px 4px rgba(0,0,0,.5));
}

.ankara { display: none; }

/* icons sit directly on the tile: no badge background */
.icon3d { background: none !important; box-shadow: none !important; width: auto; height: auto; border-radius: 0; transform: none; }
.icon3d::before { display: none; }
.icon3d i { font-size: 2.7cqw; filter: saturate(1.45) brightness(1.15) contrast(1.05) drop-shadow(0 .25cqw .25cqw rgba(0,0,0,.5)); }
.corner .icon3d { width: auto; height: auto; }
.corner .icon3d i { font-size: 3.9cqw; }
.tile:hover .icon3d { transform: translateY(-.3cqw) scale(1.08); }

/* the dice total pill is removed; the roll is recorded in the game feed */
#roll-result { display: none !important; }
.houses .hcount { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 1.25cqw; line-height: 1; color: #fff; margin-left: .15cqw; text-shadow: 0 .1cqw .15cqw rgba(0,0,0,.6); }
/* legible house counter */
.houses { gap: .25cqw; background: rgba(0,0,0,.55); padding: .15cqw .45cqw; border-radius: 99px; box-shadow: 0 .1cqw .3cqw rgba(0,0,0,.4); }
.houses:empty { display: none; }
.houses .hico { width: 1.75cqw; height: 1.75cqw; }
.houses .hico.hotel { width: 3cqw; height: 1.8cqw; }
.houses .hcount { font-size: 1.75cqw; margin-left: 0; letter-spacing: .02em; }
/* simple tiles: just the name, centred, a bit larger */
.tile:not(.special):not(.corner) .tname { align-items: center; font-size: 1.85cqw; padding: 0 5%; }
/* property name sits right under the colour band */
.tile:not(.special):not(.corner) .tname { align-items: flex-start; padding: 9% 5% 0; }
.side-top.tile:not(.special):not(.corner) .tname { align-items: flex-end; padding: 0 5% 9%; }

/* someone is behind bars: the cell goes dark so the prisoner stands out */
.tile.locked { background: radial-gradient(circle at 50% 45%, #22323f, #060d14 75%); }
.tile.locked .tile-in { opacity: .18; transition: opacity .4s; }


/* ---------- corner animations ---------- */
.tile .fx { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; overflow: hidden; z-index: 2; }

/* Vacation */
/* pot-corner dress-up (per country, see potFx.wear): hat drops on, then the shades slide down */
.token .wear { position: absolute; pointer-events: none; z-index: 2; filter: drop-shadow(0 .08cqw .1cqw rgba(0,0,0,.6)); }
.token .wear.safari-hat { left: -6%; width: 112%; top: -25%; transform: rotate(-9deg); animation: hat-on .45s cubic-bezier(.3,1.6,.5,1) both; }
.token .wear.sunglasses { inset: 0; width: 100%; height: 100%; animation: shades-on .5s cubic-bezier(.3,1.4,.5,1) .3s both; }
.token .wear.off { animation: wear-off .25s ease-in forwards; }
@keyframes hat-on { from { transform: translateY(-60%) rotate(-25deg) scale(.6); opacity: 0; } }
@keyframes shades-on { from { transform: translateY(-38%); opacity: 0; } 60% { opacity: 1; } }
@keyframes wear-off { to { transform: translateY(-45%) scale(.8); opacity: 0; } }
.ticon i.spin { display: inline-block; transform-origin: 50% 60%; animation: umb-spin 1.6s cubic-bezier(.15,.7,.25,1); }
@keyframes umb-spin { 0% { transform: rotate(0) scale(1); } 30% { transform: rotate(400deg) scale(1.2); } 100% { transform: rotate(1080deg) scale(1); } }
.fx-sun { position: absolute; right: 9%; top: 8%; width: 26%; aspect-ratio: 1; pointer-events: none; z-index: 0; }
.fx-sun::before { content: ''; position: absolute; inset: -18%; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255,214,64,.38) 0 7deg, transparent 7deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 38%, #000 40% 62%, transparent 70%);
          mask: radial-gradient(circle, transparent 38%, #000 40% 62%, transparent 70%); }
.fx-sun i { position: absolute; inset: 18%; border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #fff8c8, #ffd43b 45%, #f59f00);
  box-shadow: 0 0 .8cqw .1cqw rgba(255,196,0,.4); opacity: .9; }
.fx-sun.rise { animation: sun-rise 2s cubic-bezier(.25,.8,.3,1) both; }
@keyframes sun-rise { from { transform: translate(-40%, 120%) scale(.6); opacity: 0; } 40% { opacity: 1; } }
.fx-sun.shine::before { animation: sun-rays 40s linear infinite, sun-pulse 5s ease-in-out infinite; }
.fx-sun.shine i { animation: sun-glow 5s ease-in-out infinite; }
@keyframes sun-rays { to { transform: rotate(360deg); } }
@keyframes sun-pulse { 50% { opacity: .7; } }
@keyframes sun-glow { 50% { box-shadow: 0 0 1.1cqw .2cqw rgba(255,196,0,.5); } }
.fx-sun.set { animation: sun-set .8s ease-in forwards; }
@keyframes sun-set { to { transform: translateY(160%) scale(.5); opacity: 0; } }
.tile .tile-in { z-index: 1; }
/* soft glowing sun (potFx.sun 'glow'): no rays, just a warm orb that breathes */
.fx-sun.glow::before { display: none; }
.fx-sun.glow i { inset: 22%; background: radial-gradient(circle at 40% 38%, #fff6c4, #ffd75a 55%, #f2b632); box-shadow: 0 0 1.2cqw .4cqw rgba(255,200,60,.35); opacity: .85; }
.fx-sun.glow.rise { animation: glow-rise 2.2s ease-out both; }
@keyframes glow-rise { from { transform: translateY(40%) scale(.8); opacity: 0; } }
.fx-sun.glow.shine i { animation: glow-breathe 6s ease-in-out infinite; }
@keyframes glow-breathe { 50% { box-shadow: 0 0 2cqw .7cqw rgba(255,200,60,.45); opacity: 1; } }
.corner.t-owambe.sunny { background: radial-gradient(circle at 78% 18%, #4a3d18, #2e2a17 40%, var(--tile) 75%); transition: background 1.2s; }

/* Go to Jail: police car */
.tile.car-out .ticon { opacity: 0; transition: opacity .15s; }
.police-car { position: absolute; width: 5cqw; height: 5cqw; margin: -2.5cqw 0 0 -2.5cqw; z-index: 8;
  display: grid; place-items: center; font-size: 3.6cqw; line-height: 1;
  filter: drop-shadow(0 .4cqw .4cqw rgba(0,0,0,.7)); animation: car-pop .2s ease-out; }
.police-car i { position: relative; z-index: 1; animation: car-rumble .12s linear infinite alternate; }
.police-car::before, .police-car::after { content: ''; position: absolute; inset: -60%; border-radius: 50%; animation: cop-flash .36s steps(1) infinite; }
.police-car::before { background: radial-gradient(circle at 35% 40%, rgba(255,40,60,.75), transparent 55%); }
.police-car::after  { background: radial-gradient(circle at 65% 40%, rgba(40,110,255,.8), transparent 55%); animation-delay: -.18s; }
.police-car .lights { position: absolute; top: 4%; left: 50%; transform: translateX(-50%); display: flex; gap: .5cqw; z-index: 2; }
.police-car .lights b { width: .8cqw; height: .8cqw; border-radius: 50%; background: #ff2d48; box-shadow: 0 0 1cqw .4cqw #ff2d48; animation: cop-flash .36s steps(1) infinite; }
.police-car .lights b + b { background: #2f7bff; box-shadow: 0 0 1cqw .4cqw #2f7bff; animation-delay: -.18s; }
@keyframes cop-flash { 50% { opacity: 0; } }
@keyframes car-rumble { to { transform: translateY(-.12cqw) rotate(-1.5deg); } }
@keyframes car-pop { from { transform: scale(.4); opacity: 0; } }
.police-car.park { animation: car-park .26s ease-in forwards; }
@keyframes car-park { to { transform: scale(.6); opacity: 0; } }

/* Payday: the tile glows green for 2s */
.corner.t-start.pay-glow { animation: pay-glow 2s ease-in-out; z-index: 5; }
@keyframes pay-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,242,154,0); }
  30%, 70% { box-shadow: 0 0 0 .3cqw #7CF29A, 0 0 3cqw 1cqw rgba(124,242,154,.65), inset 0 0 3cqw rgba(124,242,154,.45); background: radial-gradient(circle, #2f7a52, #1d4a34 75%); }
}

/* a dark seam keeps the property band separate from an owner-coloured tile body */
.board .tile .band { box-shadow: inset 0 -.28cqw 0 rgba(0,0,0,.38); }
.board .side-top .band { box-shadow: inset 0 .28cqw 0 rgba(0,0,0,.38); }

/* owner colours are pastel: use dark text on owned tiles */
.tile.owned .tname { color: #0b1a26; text-shadow: none; }
.tile.owned .tcity { color: #0b1a26; }
.tile.owned .tprice { background: rgba(8,20,32,.82); color: #fff; }
.board .tile.owned { box-shadow: inset 0 0 0 .2cqw rgba(0,0,0,.18); }

/* ---------------------------------------------------------------- Grand / Mega boards
   More tiles per side → smaller tiles. --k is a tile's size relative to the classic board
   (set from JS); text shrinks a little less than the tile so names stay readable. */
.board[data-size="grand"], .board[data-size="mega"] { --kt: calc(.15 + .85 * var(--k)); gap: calc(.35cqw * var(--k)); }
.board[data-size="grand"] .tile, .board[data-size="mega"] .tile { border-radius: calc(.7cqw * var(--k)); }
.board[data-size="grand"] .tname, .board[data-size="mega"] .tname { font-size: calc(1.75cqw * var(--kt)); }
.board[data-size="grand"] .tile:not(.special):not(.corner) .tname,
.board[data-size="mega"] .tile:not(.special):not(.corner) .tname { font-size: calc(1.85cqw * var(--kt)); padding: 0 3%; }
.board[data-size="grand"] .tprice, .board[data-size="mega"] .tprice { font-size: calc(1.45cqw * var(--kt)); padding: .1cqw calc(.6cqw * var(--k)); }
.board[data-size="grand"] .icon3d i, .board[data-size="mega"] .icon3d i { font-size: calc(2.7cqw * var(--k)); }
.board[data-size="grand"] .corner .icon3d i, .board[data-size="mega"] .corner .icon3d i { font-size: calc(3.9cqw * var(--k)); }
.board[data-size="grand"] .corner .tname, .board[data-size="mega"] .corner .tname { font-size: calc(2.1cqw * var(--kt)); }
.board[data-size="grand"] .corner .tsub, .board[data-size="mega"] .corner .tsub { font-size: calc(1.1cqw * var(--kt)); }
.board[data-size="grand"] .houses .hico, .board[data-size="mega"] .houses .hico { width: calc(1.75cqw * var(--k)); height: calc(1.75cqw * var(--k)); }
.board[data-size="grand"] .houses .hico.hotel, .board[data-size="mega"] .houses .hico.hotel { width: calc(3cqw * var(--k)); height: calc(1.8cqw * var(--k)); }
.board[data-size="grand"] .houses .hcount, .board[data-size="mega"] .houses .hcount { font-size: calc(1.75cqw * var(--kt)); }
.board[data-size="grand"] .token, .board[data-size="mega"] .token {
  width: calc(3.8cqw * var(--kt)); height: calc(3.8cqw * var(--kt)); margin: calc(-1.9cqw * var(--kt)) 0 0 calc(-1.9cqw * var(--kt));
}
.board[data-size="grand"] .tile.mortgaged::after, .board[data-size="mega"] .tile.mortgaged::after { font-size: calc(.8cqw * var(--kt)); }
/* names with a 10+ letter word shrink to fit (after the size rules above so it wins) */
#board .tile.long-name:not(.corner) .tname { font-size: calc(1.5cqw * var(--kt, 1)); }

/* ---------------------------------------------------------------- zoom view (zoom.js)
   The viewport is the board's size and clips it; the board inside is scaled with a transform. */
.board-vp {
  position: relative; container-type: inline-size; overflow: hidden;
  width: min(100%, calc(100vh - 28px)); aspect-ratio: 1; touch-action: pan-y;
}
.board-vp > .board { width: 100%; transform-origin: 0 0; }
.board-vp.zoomed { touch-action: none; }
.board.zoom-anim { transition: transform .35s cubic-bezier(.3,.7,.3,1); }
/* popups now live in the viewport: place them over the board's centre panel as before */
.board-vp > .card-pop { top: 46%; }
.board-vp > .deed-pop { top: 16%; max-height: 70%; }
.zoom-ctl { position: absolute; right: 2.2%; bottom: 2.2%; z-index: 12; display: none; gap: 6px; }
.zoom-ctl button {
  min-width: 40px; height: 40px; padding: 0 10px; border: 0; border-radius: 12px; cursor: pointer;
  background: rgba(5,14,22,.82); color: #fff; font: 700 20px/1 var(--font-display);
  box-shadow: 0 2px 10px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.12); backdrop-filter: blur(6px);
}
.zoom-ctl .zfit { font-size: 14px; display: none; }
.board-vp.zoomed .zoom-ctl .zfit { display: block; }
/* controls show on touch screens and narrow windows (always available via pinch / ctrl+scroll) */
@media (pointer: coarse), (max-width: 1150px) { .zoom-ctl { display: flex; } }
.board-vp.zoomed .zoom-ctl { display: flex; }
@media (max-width: 1150px) { .board-vp { width: min(100%, 96vw); } }

/* the small globe next to the in-game wordmark (shows the room's currency) */
.globe-logo.small { width: 38px; height: 38px; flex-shrink: 0; filter: drop-shadow(0 3px 8px rgba(0,0,0,.4)); }
.globe-logo.small .globe-cur { font-size: 16px; text-shadow: 0 0 2px #fff, 0 0 5px #fff, 0 0 8px rgba(255,255,255,.9); }

/* every text field is a pill: fully rounded ends, with a little extra side padding so text clears the curve */
input:not([type=checkbox]):not([type=radio]):not([type=range]) { border-radius: 999px; padding-left: 18px; padding-right: 18px; }
