@font-face { font-family: Fredoka; src: url(fonts/Fredoka.ttf?v=071c16b87b) format('truetype'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: Nunito; src: url(fonts/Nunito.ttf?v=3aff2b496d) format('truetype'); font-weight: 200 1000; font-display: swap; }
:root {
  --ink: #1d2747; --ink2: #4b5680; --paper: #fff8ec; --card: #fffdf7; --gold: #f2b632; --gold2: #ffd76a; --red: #e03131; --green: #2f9e44;
  --line: rgba(29,39,71,.12); --shadow: 0 6px 0 rgba(29,39,71,.10), 0 10px 26px rgba(29,39,71,.14);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Nunito, system-ui, sans-serif; color: var(--ink); background: radial-gradient(ellipse at 30% 0%, #ffe9c2 0%, #f7d7b5 35%, #9fb3d9 100%) fixed; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, .btn, .title, .kick, .room-code { font-family: Fredoka, Nunito, sans-serif; }
h3 { margin: 0 0 8px; font-size: 18px; }
.hidden { display: none !important; }
.muted { color: var(--ink2); } .small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel { background: var(--card); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.kick { text-transform: uppercase; letter-spacing: 2px; font-size: 12px; color: var(--ink2); font-weight: 600; }
.btn { border: 0; border-radius: 14px; padding: 10px 16px; font-size: 16px; font-weight: 600; background: #2c3e78; color: #fff; cursor: pointer; box-shadow: 0 4px 0 #18234a; transition: transform .06s; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #18234a; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.gold { background: linear-gradient(#ffd76a, #f2b632); color: #4a2c00; box-shadow: 0 4px 0 #b9831b; }
.btn.green { background: linear-gradient(#5fd38a, #2f9e44); box-shadow: 0 4px 0 #1f6e2f; }
.btn.red { background: linear-gradient(#ff7b7b, #e03131); box-shadow: 0 4px 0 #9c1c1c; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.big { font-size: 20px; padding: 14px 22px; }
.btn.small { font-size: 13px; padding: 6px 10px; border-radius: 10px; }
.btn.roll { font-size: 28px; padding: 16px 30px; letter-spacing: 2px; background: linear-gradient(#ff8a5b, #e8590c); box-shadow: 0 5px 0 #a13d05; width: 100%; }
input, select { font: inherit; padding: 9px 12px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink); min-width: 0; }
label { display: block; font-weight: 700; margin-bottom: 10px; } label input { display: block; width: 100%; margin-top: 4px; }
.lbl { font-weight: 700; margin: 4px 0 6px; }

/* home */
#home { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.home-card { max-width: 440px; width: 100%; text-align: center; }
.home-bix { width: 110px; height: 110px; filter: drop-shadow(0 8px 12px rgba(0,0,0,.25)); }
.title { font-size: 46px; margin: 4px 0 0; line-height: 1; color: var(--ink); text-shadow: 0 3px 0 #fff; }
.title span { color: #e8590c; }
.tag { margin: 6px 0 14px; font-weight: 700; color: var(--ink2); }
#joinBox { text-align: left; }
.piece-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.piece-opt { border: 3px solid transparent; border-radius: 16px; background: #f3efe6; padding: 6px 2px 4px; cursor: pointer; text-align: center; font-size: 12px; font-weight: 700; color: var(--ink2); }
.piece-opt.sel { border-color: var(--ink); background: #fff; }
.piece-opt.taken { opacity: .3; pointer-events: none; }
.piece-opt svg { width: 40px; height: 40px; display: block; margin: 0 auto 2px; }
#codeIn { width: 130px; text-transform: uppercase; letter-spacing: 3px; font-weight: 800; }
.or { text-align: center; margin: 10px 0; color: var(--ink2); font-weight: 700; }
#createBtn, #watchBtn { width: 100%; margin-top: 6px; }

/* lobby */
#lobby { padding: 16px; }
.lobby-grid { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; }
.code-row { display: flex; gap: 12px; align-items: center; margin: 4px 0; flex-wrap: wrap; }
.room-code { font-size: 44px; letter-spacing: 6px; font-weight: 700; color: #e8590c; }
.countdown { font-family: Fredoka; font-size: 18px; margin: 6px 0 10px; color: var(--ink2); }
.seat-list { list-style: none; padding: 0; margin: 0 0 12px; }
.seat-list li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; background: #f6f2e9; margin-bottom: 6px; font-weight: 700; }
.seat-list li.empty { background: transparent; border: 2px dashed var(--line); color: var(--ink2); font-weight: 600; }
.tag-pill { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--gold2); color: #5b3b00; text-transform: uppercase; letter-spacing: .5px; }
.tag-pill.off { background: #dee2e6; color: #495057; } .tag-pill.bix { background: #c5f6fa; color: #0b7285; } .tag-pill.lock { background: #343a40; color: #fff; } .tag-pill.out { background: #ffc9c9; color: #a51111; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 14px; }
.settings label { margin: 0; font-size: 13px; } .settings select { width: 100%; margin-top: 3px; }

/* game */
.game-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; padding: 12px; max-width: 1500px; margin: 0 auto; }
.board-col { min-width: 0; }
.ticker { width: min(100%, calc((100vh - 128px) * var(--board-ar, 1.1328))); margin: 0 auto; display: flex; align-items: center; background: #1d2747; color: #ffe39a; border-radius: 12px 12px 0 0; overflow: hidden; height: 30px; font-family: Fredoka; }
.ticker-label { background: #e8590c; color: #fff; padding: 0 12px; height: 100%; display: flex; align-items: center; font-weight: 700; letter-spacing: 1px; flex: none; }
.ticker-track { overflow: hidden; flex: 1; white-space: nowrap; }
.ticker-text { display: inline-block; padding-left: 100%; animation: tick 40s linear infinite; font-size: 14px; }
@keyframes tick { to { transform: translateX(-100%); } }
.board-viewport { isolation: isolate; width: min(100%, calc((100vh - 128px) * var(--board-ar, 1.1328))); margin: 0 auto; position: relative; overflow: hidden; overflow: clip; background: #b9c6e4; border-radius: 0 0 16px 16px; box-shadow: var(--shadow); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: contain; }   /* the board handles its own pinch / pan (app.js, CAM); the rest of the page scrolls as usual. overflow: clip (swipefix-1128; hidden stays as the fallback for browsers without clip): a hidden box is still a scroll container, and Chromium latched page swipes that start just under the board (the Bix bar strip, where the zoomed board's overflow sits) onto it; it can't scroll and contain stops the chain, so the page did not move */
.board { position: relative; width: 100%; transform-origin: 0 0; transition: transform .5s ease; will-change: transform; }
.board.gesturing { transition: none !important; }
.board-img { display: block; width: 100%; height: auto; user-select: none; }
/* #motion fills the board (fix 2026-11-25): it was a static, zero-height div, so the Thanksgiving tint (a filter on #motion)
   made IT the containing block of every animation layer and collapsed their % heights and tops to 0 (rocket, Nexus canvas,
   rail and bus canvases all vanished while the event theme was on) */
#motion { position: absolute; inset: 0; z-index: 0; pointer-events: none; }   /* its own stacking context (as under the event tint): motion art stays below lots, plates and tokens */
#motion img { position: absolute; pointer-events: none; }
#motion .water-fx { position: absolute; pointer-events: none; }   /* moving water (water.js), board-art resolution, scaled with the board */
#tileLayer, #tokenLayer { position: absolute; inset: 0; }
#tokenLayer { pointer-events: none; }
.tile-hit { position: absolute; border-radius: 50%; cursor: pointer; transform: translate(-50%, -50%); }
.tile-hit:hover { box-shadow: 0 0 0 3px rgba(255,255,255,.85); }
.tile-hit.target { box-shadow: 0 0 0 3px #fff, 0 0 18px 6px rgba(255,215,90,.9); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px #fff, 0 0 6px 2px rgba(255,215,90,.6); } }
.own-flag { position: absolute; transform: translate(-50%, -50%); width: 34%; height: 34%; min-width: 7px; min-height: 7px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); pointer-events: none; }
/* living lots: one sprite per street tile, under the click targets and the tokens */
#lotLayer { position: absolute; inset: 0; pointer-events: none; container-type: inline-size; isolation: isolate; z-index: 0; }
.lot { position: absolute; pointer-events: none; }
.lot img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 .5px .5px rgba(0,0,0,.35)); }
/* the tile's info plate (front zone, always visible): colour band with the street name, price below. Above every lot so a
   tall building on the next tile never hides a name; under the click targets and the tokens. */
#plateLayer { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; z-index: 0; }   /* sized in board-art px, scaled to the board by fitPlates() */
.plate { position: absolute; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; font-family: Nunito, sans-serif; line-height: 1; text-align: center; white-space: nowrap;
  /* floating holo display: tinted glass in the street's colour, a lit rim, a soft glow and a shadow dropped well below it */
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.04) 45%), color-mix(in srgb, var(--band) 22%, rgba(12,18,36,.42));
  -webkit-backdrop-filter: blur(2.5px) saturate(1.35); backdrop-filter: blur(2.5px) saturate(1.35);
  border: var(--bw) solid color-mix(in srgb, var(--band) 75%, #fff); border-radius: var(--r);
  box-shadow: 0 0 calc(var(--bw) * 4) color-mix(in srgb, var(--band) 70%, transparent), inset 0 0 calc(var(--bw) * 3) color-mix(in srgb, var(--band) 45%, transparent), 0 calc(var(--bw) * 9) calc(var(--bw) * 5) calc(var(--bw) * -3) rgba(10,14,30,.38);
  animation: plateFloat 5s ease-in-out infinite; animation-delay: calc(var(--fd, 0) * -1s); }
.plate::before { content: ''; position: absolute; left: 6%; right: 6%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.9), transparent); pointer-events: none; }
.plate b { flex: 0 0 var(--bh); display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--band) 62%, transparent); color: #fff; font-weight: 900; letter-spacing: -.01em;
  border-bottom: calc(var(--bw) * .6) solid color-mix(in srgb, var(--band) 60%, #fff);
  text-shadow: 0 0 1px rgba(0,0,0,.95), 0 1px 1.5px rgba(0,0,0,.85), 0 0 4px rgba(0,0,0,.45); }
.plate span { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900;
  text-shadow: 0 0 1px rgba(0,0,0,.95), 0 1px 1.5px rgba(0,0,0,.85), 0 0 5px color-mix(in srgb, var(--band) 80%, transparent); }
@keyframes plateFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 calc(var(--bw) * -1.6); } }
@media (prefers-reduced-motion: reduce) { .plate { animation: none; } }
.lot.lot-mortgaged, .plate.lot-mortgaged { /* Piece 2 hook: mortgage art goes here */ }
.token { position: absolute; width: var(--tok); height: var(--tok); transform: translate(-50%, -88%); transition: left .2s ease, top .2s ease, width .5s ease, height .5s ease; z-index: 5; }
.token .disc { width: 100%; height: 100%; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.25), 0 4px 8px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.token .disc svg { width: 70%; height: 70%; }
.token .shadow { position: absolute; left: 15%; width: 70%; bottom: -18%; height: 22%; border-radius: 50%; background: rgba(0,0,0,.35); filter: blur(1px); z-index: -1; }
.token.active .disc { box-shadow: 0 0 0 3px var(--gold), 0 0 14px 4px rgba(255,210,80,.9); }
.token.hop { animation: hop .2s ease; }
.token.walking { transition: none !important; }
.token .disc, .token .lock { translate: 0 var(--lift, 0px); }   /* the hop lifts the piece; the token's spot (and its ground shadow) stays on the tile line */
.token.landed .disc { animation: tokLand .32s ease-out; }
@keyframes tokLand { 0% { scale: 1.12 .86; } 55% { scale: .95 1.06; } 100% { scale: 1 1; } }
#board.gesturing .token { transition: none; }
@keyframes hop { 50% { transform: translate(-50%, -125%); } }
.token .lock { position: absolute; right: -18%; top: -18%; width: 52%; height: 52%; border-radius: 50%; background: #343a40; border: 2px solid #fff; color: #fff; font: 800 9px Nunito; display: flex; align-items: center; justify-content: center; }
.token.gone { opacity: .35; filter: grayscale(1); }
.dice { position: absolute; left: 3%; bottom: 4%; display: flex; gap: 8px; pointer-events: none; }
.die { width: 44px; height: 44px; background: #fff; border-radius: 10px; box-shadow: 0 4px 0 #c8c8c8, 0 6px 12px rgba(0,0,0,.3); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 6px; }
.die i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); align-self: center; justify-self: center; }
.die.spin { animation: spin .5s linear infinite; }
@keyframes spin { 25% { transform: rotate(20deg) translateY(-6px); } 75% { transform: rotate(-20deg); } }
.zoom-btn { position: absolute; right: 10px; top: 10px; border: 0; border-radius: 10px; background: rgba(29,39,71,.8); color: #fff; font: 600 13px Fredoka; padding: 6px 10px; cursor: pointer; }
.pause-veil { position: absolute; inset: 0; background: rgba(29,39,71,.55); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 700 40px Fredoka; }
.pause-veil small { font: 600 15px Nunito; }
.bix-bar { width: min(100%, calc((100vh - 128px) * var(--board-ar, 1.1328))); margin-left: auto; margin-right: auto; display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.bix-bar img { width: 58px; height: 58px; flex: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); }
.bix-bubble { background: #fff; border-radius: 16px; padding: 10px 14px; font-weight: 700; box-shadow: var(--shadow); position: relative; flex: 1; min-height: 44px; }
.bix-bubble::before { content: ''; position: absolute; left: -8px; top: 16px; border: 8px solid transparent; border-right-color: #fff; border-left: 0; }
.bix-bubble.pop { animation: popin .3s ease; }
@keyframes popin { from { transform: scale(.92); opacity: .4; } }
.turn-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
#turnWho { font: 700 19px Fredoka; display: flex; align-items: center; gap: 8px; }
.timer { font: 700 18px Fredoka; padding: 4px 10px; border-radius: 99px; background: #edf2ff; min-width: 54px; text-align: center; }
.timer.low { background: #ffe3e3; color: var(--red); }
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions .row .btn { flex: 1; }
.offer-box { background: #fff4d6; border-radius: 12px; padding: 10px; font-weight: 700; }
.players { list-style: none; margin: 0; padding: 0; }
.players li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.players li.turn { background: #fff4d6; border-radius: 10px; }
.players .nm { font-weight: 800; flex: 1; min-width: 80px; }
.players .cash { font: 700 16px Fredoka; }
.players .cash.props { font: 600 13px Fredoka; color: var(--ink2); }
.players .worth { font-size: 11px; color: var(--ink2); width: 100%; padding-left: 36px; margin-top: -4px; }
.mini-piece { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mini-piece svg { width: 70%; height: 70%; }
.pots { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; }
.prop-list { list-style: none; margin: 0; padding: 0; }
.prop-list li { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-weight: 700; font-size: 14px; }
.sw { width: 14px; height: 14px; border-radius: 4px; flex: none; border: 1.5px solid rgba(0,0,0,.15); }
.prop-list .lv { margin-left: auto; font-size: 12px; color: var(--ink2); }
.held { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.held span { background: #e6fcf5; color: #087f5b; border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 800; }
.chat-log { height: 180px; overflow-y: auto; background: #f8f5ee; border-radius: 12px; padding: 8px; font-size: 14px; margin-bottom: 8px; }
#lobby .chat-log { height: 360px; }
.chat-log div { margin-bottom: 4px; word-wrap: break-word; } .chat-log b { color: #2c3e78; } .chat-log .sys { color: #0b7285; font-style: italic; }
.chat-form { display: flex; gap: 6px; } .chat-form input { flex: 1; }
.log { height: 150px; overflow-y: auto; font-size: 12.5px; color: var(--ink2); }
.log div { padding: 2px 0; border-bottom: 1px dotted var(--line); }
.foot { justify-content: flex-end; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(20,26,50,.55); display: flex; align-items: center; justify-content: center; z-index: 5000; padding: 16px; }
.modal-card { background: var(--card); border-radius: 22px; padding: 20px; max-width: 460px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.4); text-align: center; max-height: 92vh; overflow-y: auto; animation: popin .25s ease; }
.modal-card h2 { margin: 4px 0 6px; }
.card-art { width: 210px; height: 210px; border-radius: 50%; object-fit: cover; border: 8px solid var(--deck, #ffc93c); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.card-deck { font: 700 13px Fredoka; letter-spacing: 2px; text-transform: uppercase; color: var(--ink2); }
.card-text { font-size: 18px; font-weight: 700; margin: 6px 0 12px; }
.wheel-wrap { position: relative; width: 300px; height: 300px; margin: 8px auto; }
.wheel-wrap svg.wheel { width: 100%; height: 100%; transition: transform 3s cubic-bezier(.17,.67,.12,1); }
.wheel-ptr { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); width: 0; height: 0; border: 14px solid transparent; border-top: 26px solid var(--ink); border-bottom: 0; }
.deal-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; font-size: 14px; }
.deal-cols label { font-weight: 600; margin: 2px 0; display: flex; gap: 6px; align-items: center; }
.deal-cols input[type=number] { width: 100%; }
.standings { list-style: none; padding: 0; text-align: left; } .standings li { padding: 6px; font-weight: 800; display: flex; gap: 8px; align-items: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 14px; font-weight: 700; z-index: 6000; max-width: 90vw; }
.conn { position: fixed; top: 0; left: 0; right: 0; background: #e8590c; color: #fff; text-align: center; padding: 6px; font-weight: 800; z-index: 7000; }

/* motion layers (subtle; off for reduced motion) */
.m-smoke { animation: smoke 3.2s ease-in-out infinite; transform-origin: 30% 100%; }
@keyframes smoke { 0%,100% { opacity: .9; transform: translateY(0) scale(1); } 50% { opacity: .6; transform: translate(6px,-8px) scale(1.06); } }
.m-water { animation: water .9s steps(3) infinite; }
@keyframes water { 0% { transform: translateY(0); filter: brightness(1); } 33% { transform: translateY(2px); filter: brightness(1.08); } 66% { transform: translateY(1px); filter: brightness(.96); } }
.m-crane { animation: crane 8s ease-in-out infinite; transform-origin: 55% 95%; }
@keyframes crane { 50% { transform: rotate(2.5deg); } }
.m-bob { animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-2px); } }
.m-birds { animation: birds 6s ease-in-out infinite; }
@keyframes birds { 25% { transform: translate(8px,-5px); } 50% { transform: translate(14px,0); } 75% { transform: translate(6px,4px); } }
/* v6.2 Ironbrook: rush hour. Commuters drift to the bus-stop shelter and board; the bus (24 s cycle, same as the
   commuters) idles at the stop, pulls away along the ring road and a fresh one rolls back in. Moves stay a few px so
   nothing ever crosses a street tile. Percentages are of each layer's own size, so it scales with the board. */
.m-commute { animation: commute 24s linear infinite; }
@keyframes commute { 0% { opacity: 0; transform: translate(0,0); } 4% { opacity: 1; } 10% { transform: translate(.5%,.4%); } 15% { transform: translate(1%,.2%); } 20% { transform: translate(1.5%,1%); } 25% { transform: translate(2%,.8%); } 30% { transform: translate(2.5%,1.6%); } 35% { transform: translate(3%,1.4%); } 40% { transform: translate(3.5%,2.2%); } 45% { transform: translate(4%,2%); } 50%, 56% { transform: translate(4.4%,2.6%); opacity: 1; } 62%, 100% { transform: translate(4.4%,2.6%); opacity: 0; } }
.m-bikes { animation: bikes 9s ease-in-out infinite alternate; }
@keyframes bikes { from { transform: translate(0,0); } to { transform: translate(-3.5%,2.5%); } }
.m-van { animation: van 30s ease-in-out infinite; }
@keyframes van { 0%, 20% { transform: translate(0,0); opacity: 1; } 34% { transform: translate(28%,-14%); opacity: 1; } 40% { transform: translate(40%,-20%); opacity: 0; } 70% { transform: translate(-10%,5%); opacity: 0; } 76% { opacity: 1; transform: translate(-6%,3%); } 86%, 100% { transform: translate(0,0); opacity: 1; } }
/* Goldspire / Nexus (inert in Piece 1: those layers are not shipped until their islands are playable) */
.m-add { mix-blend-mode: screen; mix-blend-mode: plus-lighter; }
.m-glide { animation: glide 5.5s linear infinite; }
@keyframes glide { 0% { transform: translateX(-4%); opacity: .3; } 50% { opacity: .9; } 100% { transform: translateX(4%); opacity: .3; } }
.m-fountain { animation: fountain 1.5s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes fountain { 50% { transform: scaleY(1.12); opacity: .8; } }
.m-ducks { animation: ducks 20s ease-in-out infinite alternate; }
@keyframes ducks { 50% { transform: translate(-20%,8%); } 100% { transform: translate(-35%,-4%) scaleX(-1); } }
.m-row { animation: row 26s ease-in-out infinite alternate; }
@keyframes row { 50% { transform: translate(25%,10%); } 100% { transform: translate(10%,25%); } }
.m-padlights { animation: padlights 1s steps(2) infinite; }
@keyframes padlights { 50% { filter: brightness(1.12); } }
.m-countdown { animation: padlights .25s steps(2) infinite; }
.m-shake { animation: shake .12s linear infinite; }
@keyframes shake { 25% { transform: translate(1px,0); } 75% { transform: translate(-1px,0); } }
.m-event { opacity: 0; transition: opacity .6s; } .m-event.m-on { opacity: 1; }
.m-off { opacity: 0 !important; transition: opacity 2s; }
.m-ignite { animation: ignite 2s ease-out forwards; transform-origin: 50% 80%; }
@keyframes ignite { from { transform: scale(.6); } to { transform: scale(1.1); } }
.m-ignite.m-smokefade { animation: smokefade 4s ease-out forwards; }
@keyframes smokefade { from { transform: scale(1.1); opacity: 1; } to { transform: translate(6%,-6%) scale(1.5); opacity: 0; } }
.m-liftoff { animation: liftoff 4s cubic-bezier(.6,0,1,1) forwards; }
@keyframes liftoff { from { transform: translateY(0); } 85% { opacity: 1; } to { transform: translateY(-400%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #motion img, .ticker-text, .token, .die.spin { animation: none !important; transition: none !important; } }

@media (max-width: 900px) {
  .game-grid { grid-template-columns: 1fr; padding: 4px 0 6px; }
  .side-col { padding: 0 6px; } .board-tabs, .bix-bar { padding: 0 6px; box-sizing: border-box; } .board-viewport { border-radius: 0; } .ticker { height: 26px; border-radius: 0; }
  .lobby-grid { grid-template-columns: 1fr; }
  .side-col { display: flex; flex-direction: column; }
  .turn-card { position: fixed; left: 6px; right: 6px; bottom: 6px; z-index: 3000; margin: 0; max-height: 46vh; overflow-y: auto; box-shadow: 0 -6px 24px rgba(29,39,71,.25); }
  #game { padding-bottom: 200px; }
  .board-viewport, .ticker, .bix-bar { width: 100%; }
  .turn-head { margin-bottom: 6px; } .btn.roll { font-size: 22px; padding: 12px; }
  .die { width: 34px; height: 34px; padding: 4px; } .die i { width: 6px; height: 6px; }
  .room-code { font-size: 36px; }
}

/* ---------------------------------------------------------------- Piece 2 */
.board-tabs { width: min(100%, calc((100vh - 128px) * var(--board-ar, 1.1328))); margin: 0 auto 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.board-tabs .tab { border: 0; border-radius: 12px 12px 4px 4px; padding: 6px 14px; font: 700 15px Fredoka; background: #dfe5f5; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.board-tabs .tab.on { background: #1d2747; color: #ffe39a; }
.board-tabs .tab[data-board=goldspire].on { background: #8a6d1d; color: #fff8dc; } .board-tabs .tab[data-board=nexus].on { background: #3b1f74; color: #b8f3ff; }
.board-tabs .tab.follow { margin-left: auto; background: #fff4d6; font-size: 13px; }
.tab-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #fff; display: inline-block; }
.tag-pill.board { background: #edf2ff; color: #364fc7; } .tag-pill.title { background: #fff3bf; color: #8a6d1d; }
.tag-pill.boom { background: #d3f9d8; color: #2b8a3e; } .tag-pill.normal { background: #edf2ff; color: #364fc7; } .tag-pill.slump { background: #ffe3e3; color: #c92a2a; }
.tag-pill.contract { background: #e6fcf5; color: #087f5b; } .tag-pill.note { background: #fff3bf; color: #8a6d1d; } .tag-pill.iou { background: #ffe3e3; color: #c92a2a; } .tag-pill.ledger { background: #edf2ff; color: #364fc7; }
.token.cue-up .disc { outline: 2px solid #ffd43b; outline-offset: 3px; } .token.cue-down .disc { outline: 2px solid #74c0fc; outline-offset: 3px; }
.own-flag.mortgaged { opacity: .45; outline: 2px dashed #fff; }
.lot.lot-mortgaged img { filter: grayscale(.85) brightness(.85); } .plate.lot-mortgaged { opacity: .6; }
.plate.lot-mortgaged::after { content: 'MORTGAGED'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 900 8px Nunito; color: #c92a2a; transform: rotate(-12deg); }
.tile-hit.foreclosed { box-shadow: 0 0 0 2px #c92a2a; }
.explains { position: absolute; right: 8px; top: 48px; width: min(300px, 70%); display: flex; flex-direction: column; gap: 6px; z-index: 50; pointer-events: none; }
.explain { pointer-events: auto; display: flex; gap: 8px; align-items: flex-start; background: rgba(255,255,255,.96); border-radius: 14px; padding: 8px 10px; box-shadow: 0 6px 18px rgba(0,0,0,.25); font-size: 13px; cursor: pointer; animation: slidein .3s ease; border-left: 5px solid #74c0fc; }
.explain.big { border-left-color: #e8590c; } .explain img { width: 34px; height: 34px; flex: none; } .explain .x { margin-left: auto; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--ink2); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.coach { margin-top: 6px; background: #e3fafc; color: #0b7285; border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.choice-q { font-weight: 800; } .row.wrap { flex-wrap: wrap; } .choice-list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.choice-list .btn { padding: 6px 10px; font-size: 13px; }
.titles { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.title-badge { background: #343a40; color: #adb5bd; border-radius: 99px; padding: 3px 10px; font: 700 12px Fredoka; display: inline-flex; align-items: center; gap: 4px; }
.title-badge.on { background: #fff3bf; color: #8a6d1d; } .title-badge img { width: 18px; height: 18px; }
.ptabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.ptab { border: 0; border-radius: 10px; padding: 5px 10px; font: 700 13px Fredoka; background: #f1ece1; cursor: pointer; color: var(--ink); }
.ptab.on { background: #1d2747; color: #ffe39a; }
.xtable { width: 100%; border-collapse: collapse; font-size: 13px; } .xtable th { text-align: left; font-size: 11px; color: var(--ink2); }
.xtable td { padding: 3px 2px; border-bottom: 1px dotted var(--line); } .xtable a { color: var(--ink); font-weight: 700; text-decoration: none; }
.xtable .up { color: #2b8a3e; font-weight: 800; } .xtable .down { color: #c92a2a; font-weight: 800; } .nowrap { white-space: nowrap; }
.xtable .btn.small { padding: 2px 7px; font-size: 11px; }
.loan { background: #f8f5ee; border-radius: 10px; padding: 8px; margin: 6px 0; font-size: 13px; }
.files { list-style: none; padding: 0; margin: 0; max-height: 300px; overflow-y: auto; } .files li { padding: 4px 0; border-bottom: 1px dotted var(--line); }
.moment { font-size: 13px; padding: 4px 0; border-bottom: 1px dotted var(--line); }
.goal-box { background: #fff9db; border: 2px dashed #c99a06; border-radius: 12px; padding: 8px; margin-bottom: 8px; font-size: 13px; }
.prop-list li.mortgaged { opacity: .65; }
.card-shape { width: 220px; height: 220px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.card-shape .card-art { width: 210px; height: 210px; border-radius: 50%; }
.card-shape.rectangle .card-art { width: 230px; height: 160px; border-radius: 14px; } .card-shape.rectangle { height: 170px; }
.card-shape.diamond .card-art { width: 160px; height: 160px; border-radius: 14px; transform: rotate(45deg); }
.history { list-style: none; padding: 0; text-align: left; max-height: 60vh; overflow-y: auto; } .history li { padding: 8px; border-bottom: 1px solid var(--line); cursor: pointer; } .history li:hover { background: #fff4d6; }
.bix-answer p { text-align: left; }
.bix-bar #askBixBtn { flex: none; }
.board-viewport.crash { animation: crash .2s linear 6; } @keyframes crash { 50% { transform: translateX(4px); filter: hue-rotate(-30deg) saturate(1.4); } }
/* Goldspire / Nexus motion, with restraint */
.m-elevator { animation: elevator 14s ease-in-out infinite; } @keyframes elevator { 50% { transform: translateY(-6%); } }
.m-glow { animation: glow 4s ease-in-out infinite; } @keyframes glow { 50% { opacity: .55; } }
.m-swirl { animation: swirl 9s ease-in-out infinite; } @keyframes swirl { 50% { filter: hue-rotate(40deg) brightness(1.1); } }
.m-hover { animation: hover 5s ease-in-out infinite; } @keyframes hover { 50% { transform: translate(1.5%,-3%); } }
@media (prefers-reduced-motion: reduce) { .explain, .board-viewport.crash { animation: none !important; } }
@media (max-width: 900px) { .board-tabs { width: 100%; } .explains { top: 40px; width: 78%; } .board-tabs .tab { padding: 5px 10px; font-size: 14px; } }

/* invites: Send invite button + desktop popover (bottom sheet on narrow screens) */
.invite-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 4px; }
.btn.invite-btn { font-size: 18px; padding: 10px 20px; }
.invite-pop { position: fixed; z-index: 5500; width: 330px; max-width: calc(100vw - 16px); background: var(--card); border-radius: 18px; padding: 12px 14px 14px; box-shadow: 0 18px 50px rgba(20,26,50,.35), 0 0 0 1px var(--line); animation: invpop .16s ease-out; }
.invite-pop.sheet { left: 8px !important; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); top: auto !important; width: auto; max-width: 480px; margin: 0 auto; animation: invsheet .2s ease-out; }
@keyframes invpop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
@keyframes invsheet { from { opacity: 0; transform: translateY(24px); } }
.inv-head { display: flex; justify-content: space-between; align-items: center; font-family: Fredoka, Nunito, sans-serif; font-size: 17px; margin-bottom: 10px; }
.inv-head span { color: #e8590c; letter-spacing: 2px; }
.inv-x { border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--ink2); cursor: pointer; padding: 2px 6px; border-radius: 8px; }
.inv-x:hover { background: var(--line); }
.inv-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.inv-opt { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 9px 10px; text-decoration: none; border-radius: 12px; justify-content: flex-start; white-space: nowrap; }
.inv-ic { width: 20px; height: 20px; flex: none; display: inline-flex; } .inv-ic svg { width: 100%; height: 100%; }
.inv-qr { margin: 12px auto 4px; width: 180px; height: 180px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); background: #fff; }
.inv-qr svg { display: block; width: 100%; height: 100%; }
.inv-scan { text-align: center; }
.inv-link { margin-top: 6px; font-size: 12px; color: var(--ink2); text-align: center; word-break: break-all; user-select: all; }
.invite-pop :focus-visible, .btn:focus-visible { outline: 3px solid #4c6ef5; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .invite-pop, .invite-pop.sheet { animation: none !important; } }

/* sound settings (public/sound.js) */
.home-foot { justify-content: center; margin-top: 8px; gap: 8px; }
.sound-btn { display: inline-flex; align-items: center; gap: 6px; }
.sound-btn .snd-ic { width: 18px; height: 18px; flex: none; }
.sound-btn .snd-x { display: none; } .sound-btn.muted-on .snd-x { display: inline; } .sound-btn.muted-on .snd-waves { display: none; }
.sound-pop { position: fixed; z-index: 5600; background: var(--card); border-radius: 18px; padding: 12px 14px 14px; box-shadow: 0 18px 50px rgba(20,26,50,.35), 0 0 0 1px var(--line); animation: invpop .16s ease-out; }
.sound-pop.hidden { display: none; }
.sp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 17px; }
.sp-row { display: grid; grid-template-columns: 64px 1fr 34px; align-items: center; gap: 8px; margin: 10px 0; font-weight: 700; }
.sp-row input[type=range] { width: 100%; accent-color: #c99a06; height: 28px; }
.sp-row output { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink2); }
.sp-mute { width: 100%; margin-top: 4px; }
.sp-note { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .sound-pop { animation: none !important; } }

/* key art (title banner on the home screen; slim strip above the lobby, never over controls) */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.keyart { display: block; width: 100%; height: auto; }
.keyart-home { border-radius: 18px; aspect-ratio: 1920 / 1071; object-fit: cover; margin: 0 auto 10px; box-shadow: 0 10px 30px rgba(20,26,50,.25); }
.lobby-banner { max-width: 980px; margin: 0 auto 14px; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(20,26,50,.22); }
.keyart-strip { height: clamp(110px, 21vw, 220px); object-fit: cover; object-position: center 6%; }
@media (max-height: 560px) { .lobby-banner { display: none; } }

/* title deed presentation (app.js landDeed): flies up from the tile, flips, glows in the island colour */
.deed-layer { position: absolute; inset: 0; z-index: 2500; pointer-events: none; display: grid; place-items: center; }
.deed-wrap { pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; max-height: calc(100% - 12px); transform-origin: center;
  animation: deedIn .85s cubic-bezier(.2,.9,.25,1.15) both; --fx: 0px; --fy: 120px; }
.deed-wrap.out { animation: deedOut .45s ease-in both; pointer-events: none; }
.deed-wrap.sold { animation: deedSold .7s ease-in both; pointer-events: none; }
.deed-wrap.reduced, .deed-wrap.reduced .deed-flip { animation: deedFade .2s ease-out both !important; }
.deed-wrap.reduced.out, .deed-wrap.reduced.sold { animation: deedFadeOut .15s ease-in both !important; }
.deed-wrap.reduced .deed-sweep, .deed-wrap.reduced .deed-spark { display: none; }
@keyframes deedIn { 0% { transform: translate(var(--fx), var(--fy)) scale(.12); opacity: 0; } 15% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes deedOut { to { transform: translateY(30px) scale(.85); opacity: 0; } }
@keyframes deedSold { 30% { transform: scale(1.05); } to { transform: translateY(-40px) scale(.6); opacity: 0; } }
@keyframes deedFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes deedFadeOut { to { opacity: 0; } }
.deed-card { position: relative; width: min(340px, 74vw); perspective: 900px; }
@media (min-width: 601px) { .deed-name { font-size: 25px !important; } .deed-rows { font-size: 14px !important; } .deed-meta { font-size: 13px; } .deed-panel { width: min(360px, 86vw); } }
.deed-flip { position: relative; transform-style: preserve-3d; animation: deedFlip .85s cubic-bezier(.3,.8,.3,1) both; }
@keyframes deedFlip { 0%, 25% { transform: rotateY(180deg); } 100% { transform: rotateY(0); } }
.deed-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 16px; background: #fffdf4; color: var(--ink);
  box-shadow: 0 0 0 3px #fff, 0 0 26px 4px var(--glow), 0 18px 40px rgba(10,14,30,.45); overflow: hidden; }
.deed-back { position: absolute; inset: 0; transform: rotateY(180deg); display: grid; place-items: center; align-content: center; gap: 6px; font: 700 18px Fredoka, sans-serif; color: #fff;
  background: radial-gradient(circle at 50% 40%, var(--glow), #1d2747 70%); }
.deed-back img { width: 46%; }
.deed-band { padding: 10px 12px 9px; text-align: center; }
.deed-kick { font: 700 10px Nunito, sans-serif; letter-spacing: .12em; opacity: .85; }
.deed-name { font: 700 clamp(17px, 5vw, 21px) Fredoka, sans-serif; line-height: 1.1; margin-top: 2px; }
.deed-meta { display: flex; justify-content: space-between; padding: 6px 12px 2px; font-size: 12px; color: var(--ink2); }
.deed-meta b { color: var(--ink); font-size: 15px; }
.deed-rows { width: calc(100% - 20px); margin: 2px 10px; border-collapse: collapse; font-size: clamp(11px, 3.2vw, 13px); }
.deed-rows td { padding: 2px 4px; border-bottom: 1px dashed #e7dfcb; } .deed-rows td:last-child { text-align: right; font-weight: 800; white-space: nowrap; }
.deed-rows tr.on td { background: color-mix(in srgb, var(--glow) 35%, #fff); }
.deed-foot { font-size: 11px; color: var(--ink2); text-align: center; padding: 5px 10px 2px; }
.deed-owner { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; padding: 4px 10px 10px; }
.deed-owner .mini-piece { width: 22px; height: 22px; } .deed-owner.bank { color: var(--ink2); }
.deed-stamp { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%) rotate(-14deg); border: 4px solid #c92a2a; color: #c92a2a; font: 800 26px Fredoka, sans-serif;
  padding: 2px 12px; border-radius: 8px; background: rgba(255,255,255,.75); letter-spacing: .06em; animation: stampIn .35s .9s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes stampIn { from { transform: translate(-50%, -50%) rotate(-14deg) scale(2.2); opacity: 0; } }
.deed-sweep { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; pointer-events: none; }
.deed-sweep::before { content: ''; position: absolute; top: -20%; bottom: -20%; width: 40%; left: -60%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); animation: deedSweep 1.1s .75s ease-out both; }
@keyframes deedSweep { to { left: 130%; } }
.deed-spark { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.deed-spark i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(#fff, var(--glow)); box-shadow: 0 0 8px var(--glow);
  animation: spark var(--t) .7s ease-out both; transform: scale(var(--s)); opacity: 0; }
@keyframes spark { 0% { opacity: 1; transform: rotate(var(--a)) translateX(10px) scale(var(--s)); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) scale(.2); } }
.deed-panel { width: min(300px, 86vw); background: rgba(255,253,247,.97); border-radius: 14px; padding: 8px 10px; box-shadow: 0 10px 30px rgba(10,14,30,.35); text-align: center; animation: panelUp .3s ease-out both; }
@keyframes panelUp { from { transform: translateY(14px); opacity: 0; } }
.deed-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.deed-row .btn.big { min-height: 46px; min-width: 112px; font-size: 17px; }
.deed-wait { font-weight: 700; color: var(--ink2); padding: 4px; }
.deed-due { font-weight: 700; } .deed-due b { font-size: 18px; }
.deed-why { margin: 4px 0 6px; padding: 0; list-style: none; font-size: 12px; color: var(--ink2); } .deed-why li.rescue { color: #c92a2a; }
@media (max-width: 600px) {
  .deed-card { width: min(210px, 56vw); }
  .deed-rows { font-size: 10.5px; } .deed-rows td { padding: 1px 3px; } .deed-band { padding: 7px 8px; } .deed-foot { display: none; }
  .deed-wrap { gap: 5px; } .deed-panel { padding: 6px 8px; } .deed-row .btn.big { min-height: 44px; min-width: 104px; font-size: 16px; }
}
