@import url(/static/fonts/fonts.css);

/* CAPITOLOGY: a navy boardroom at night, a cream board like old company
   brochures, gold like the bonus cheques. */
:root {
  --night: #13203a;
  --night-2: #1c2c4c;
  --mustard: #e9b949;
  --mustard-dk: #a77c18;
  --ink: #1d2433;
  --muted: #667085;
  --line: #e3e5ea;
  --paper: #ffffff;
  --cream: #f6efdc;
  --board: #e4ecd9;
  --good: #2b9348;
  --bad: #d62828;
  --blue: #2f6fd6;
  --radius: 14px;
  --display: Anton, Impact, 'Arial Narrow', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--night); }
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% 15%, rgba(233, 185, 73, .14), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 2px, transparent 2px 120px),
    var(--night);
  background-attachment: fixed;
  color: var(--ink); font-family: Montserrat, system-ui, sans-serif; font-size: 15px; line-height: 1.45;
}
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
main > h2 { color: #fff; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-weight: 800; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .5rem; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center, .center-text { text-align: center; }
.good-text { color: var(--good); font-weight: 700; }
.bad-text { color: var(--bad); }
.loading { display: grid; place-items: center; min-height: 60vh; }

/* ---------------------------------------------------------------- logo */
.logo { display: inline-flex; line-height: 1; white-space: nowrap; user-select: none; }
.logo-box { background: linear-gradient(#c8102e, #a40d26); padding: .14em .42em .1em; border-radius: .08em; box-shadow: 0 .06em 0 #6d0818, 0 .12em .3em rgba(0,0,0,.35); transform: rotate(-2deg); border: .045em solid #fff; outline: .03em solid #a40d26; }
.logo-word { font-family: var(--display); color: #fff; letter-spacing: .04em; text-shadow: .03em .04em 0 rgba(0,0,0,.35); }
.hero-logo { font-size: clamp(2.6rem, 11vw, 5.2rem); margin-top: 6px; }
.brand-logo, .gb-logo { font-size: 1.25rem; }

/* ---------------------------------------------------------------- topbar */
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(16, 22, 30, .8); color: #fff; flex-wrap: wrap; backdrop-filter: blur(6px); }
.topbar a, .topbar .linkbtn { color: #fff; text-decoration: none; font-weight: 600; }
.brand { display: flex; align-items: center; padding: 2px 6px; }
.topbar nav { margin-left: auto; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; box-shadow: none; }

/* ---------------------------------------------------------------- forms */
label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 4px; color: var(--ink); }
input, select { width: 100%; padding: 11px 12px; border: 2px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: none; border-color: var(--mustard); box-shadow: 0 0 0 3px rgba(244, 185, 66, .35); }
button, .btn { font: inherit; font-weight: 800; border: 0; border-radius: 12px; padding: 11px 18px; cursor: pointer; background: #34465a; color: #fff; text-decoration: none; display: inline-block; box-shadow: 0 3px 0 #16202b; transition: transform .08s, filter .15s; }
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(2px); box-shadow: 0 1px 0 #16202b; }
button:disabled { opacity: .45; cursor: default; }
.btn-accent, .btn-main { background: var(--mustard); color: #2a1d05; box-shadow: 0 3px 0 var(--mustard-dk); }
.btn-accent:active, .btn-main:active { box-shadow: 0 1px 0 var(--mustard-dk); }
.btn-main.dim { filter: saturate(.4) brightness(.9); }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn-small { padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.sso-btn::before { content: '🔑 '; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: auto; }
.code-input { text-transform: uppercase; letter-spacing: .3em; font-weight: 900; font-size: 1.4rem; text-align: center; }

/* ---------------------------------------------------------------- layout */
.panel { background: var(--paper); border-radius: var(--radius); padding: 18px; box-shadow: 0 10px 30px rgba(5, 10, 20, .4); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.notice { padding: 12px 14px; border-radius: 10px; background: #fff; border-left: 5px solid var(--blue); }
.notice.err { border-left-color: var(--bad); }
.notice.ok { border-left-color: var(--good); background: #f1faf2; }
.pill { display: inline-block; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #edf0f3; color: var(--ink); margin-right: 4px; }
.pill.off { background: #f3f3f3; color: #888; }
.pill.gold { background: var(--mustard); color: var(--ink); }
.dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.15); }
.copybox { display: flex; gap: 6px; }
.copybox input { font-size: .85rem; }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; border-left: 5px solid var(--mustard); z-index: 2000; max-width: calc(100vw - 32px); font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: toast-in .25s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.spinner { width: 14px; height: 14px; border: 3px solid rgba(255,255,255,.35); border-top-color: var(--mustard); border-radius: 50%; display: inline-block; vertical-align: -2px; margin-right: 8px; animation: spin .9s linear infinite; }
.panel .spinner { border-color: var(--line); border-top-color: var(--mustard-dk); }
@keyframes spin { to { transform: rotate(360deg); } }
.wait { color: var(--muted); font-weight: 600; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 3000; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 110vh; transform: rotate(720deg) translateX(40px); } }

/* ---------------------------------------------------------------- home */
.hero { text-align: center; margin: 10px 0 26px; color: #fff; }
.hero .subtitle { max-width: 680px; margin: 14px auto 0; color: #d7dee6; }
.hero-deeds { display: flex; justify-content: center; align-items: flex-start; margin: 14px 0 10px; --dw: clamp(78px, 15vw, 132px); }
.hero-deed { margin: 0 calc(var(--dw) * -.16); transform: rotate(var(--r)) translateY(var(--y)); animation: hero-in .7s cubic-bezier(.2,.8,.3,1.2) backwards; animation-delay: calc(var(--i) * 90ms); transition: transform .2s; }
.hero-deed .deed { width: var(--dw); font-size: calc(var(--dw) * .075); box-shadow: 0 10px 22px rgba(0,0,0,.45); }
.hero-deed .deed-row, .hero-deed .deed-sep { display: none; }
.hero-deed .deed-body { padding-top: 0; }
.hero-deed .deed-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.2em; }
.hero-deed:hover { transform: rotate(0) translateY(-14px) scale(1.06); z-index: 2; }
@keyframes hero-in { from { opacity: 0; transform: translateY(-120px) rotate(-30deg); } }
.hero-tokens { display: flex; justify-content: center; gap: 4px; margin-top: 14px; flex-wrap: wrap; }
.hero-tokens span { width: 44px; height: 44px; animation: bob 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.3s); }
.hero-tokens .token-img { width: 100%; height: 100%; filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); }
@keyframes bob { 50% { transform: translateY(-6px); } }
.rules { padding-left: 1.3rem; margin: 0; }
.rules li { margin-bottom: .55rem; }
.rules li::marker { color: #c8102e; font-weight: 900; }

/* ---------------------------------------------------------------- lobby */
.code-text { font-family: var(--display); font-size: clamp(2.4rem, 10vw, 3.4rem); letter-spacing: .18em; color: var(--ink); }
.qr { width: 170px; height: 170px; display: block; margin: 0 auto; border-radius: 12px; border: 6px solid #fff; box-shadow: 0 0 0 3px var(--mustard); }
.lobby-player { flex-direction: column; align-items: stretch !important; }
.row-line { display: flex; gap: 10px; align-items: center; }
.tags { margin-top: 2px; }
.grid-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.house-rules summary { cursor: pointer; font-weight: 700; font-size: .9rem; }
.house-rules[open] summary { margin-bottom: 6px; }
.p-token { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff, color-mix(in srgb, var(--pc) 35%, #fff) 70%); box-shadow: inset 0 0 0 3px var(--pc); }
.p-token .token-img { width: 80%; height: 80%; }
.token-img { object-fit: contain; display: block; }
.token-img.emoji { font-size: 1.4em; line-height: 1; text-align: center; }
.token-img.mini { width: 22px; height: 22px; display: inline-block; vertical-align: middle; }
.token-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tk { width: 44px; height: 44px; padding: 4px; border-radius: 10px; background: #f3f4f6; box-shadow: inset 0 0 0 2px var(--line); }
.tk .token-img { width: 100%; height: 100%; }
.tk.on { background: color-mix(in srgb, var(--pc) 20%, #fff); box-shadow: inset 0 0 0 3px var(--pc); }
.tk.used { opacity: .45; }

/* ---------------------------------------------------------------- deed card */
.deed { --gc: #888; width: 220px; background: #fffdf6; border-radius: 6px; padding: .55em; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.18); border: 1px solid #d9d2bf; position: relative; color: var(--ink); text-align: left; }
.deed-head { background: var(--gc); color: #fff; text-align: center; padding: .4em .3em .45em; border: .12em solid var(--ink); border-radius: 2px; }
.k-street .deed-head { color: color-mix(in srgb, var(--gc) 10%, #000); }
.k-street .deed-head .deed-kind { opacity: .75; }
.deed[style*="#9fd8f3"] .deed-head, .deed[style*="#f6dd1e"] .deed-head { color: var(--ink); }
.deed[style*="#8b4f2c"] .deed-head, .deed[style*="#1361b0"] .deed-head, .deed[style*="#e5261f"] .deed-head, .deed[style*="#d93a96"] .deed-head, .deed[style*="#1fa857"] .deed-head { color: #fff; }
.k-rail .deed-head, .k-util .deed-head { background: #2d3440; color: #fff; }
.deed-kind { font-size: .7em; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; }
.deed-name { font-family: var(--display); font-size: 1.35em; letter-spacing: .02em; line-height: 1.1; }
.deed-pic { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; margin-top: .45em; border-radius: 2px; }
.deed-body { padding: .35em .2em 0; }
.deed-row { display: flex; justify-content: space-between; gap: .5em; padding: .08em .3em; border-radius: 3px; }
.deed-row.on { background: color-mix(in srgb, var(--mustard) 45%, #fff); font-weight: 800; }
.deed-sep { border-top: 1px solid #d9d2bf; margin: .3em 0; }
.deed-price { text-align: center; font-weight: 800; margin-top: .35em; padding-top: .3em; border-top: 1px solid #d9d2bf; }
.deed-owner { display: flex; align-items: center; gap: .4em; margin-top: .45em; padding: .3em .45em; border-radius: 6px; background: color-mix(in srgb, var(--pc) 14%, #fff); font-weight: 700; font-size: .9em; box-shadow: inset 3px 0 0 var(--pc); }
.deed.mortgaged .deed-pic { filter: grayscale(1) contrast(.8); }
.deed.mortgaged::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(200, 16, 46, .08) 14px 28px); pointer-events: none; border-radius: 6px; }
.deed-inline { width: 100%; max-width: 260px; margin: 0 auto 10px; }
.deed-mini { width: 132px; font-size: 9px; flex: none; }
.deed-mini .deed-row, .deed-mini .deed-sep { display: none; }
.deed-mini .deed-name { font-size: 1.5em; }

/* ---------------------------------------------------------------- event cards */
.event-card { width: min(340px, 78%); background: #fffaf0; border-radius: 12px; padding: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.45); border: 3px solid var(--dc); --dc: #f08c00; text-align: center; }
.event-card.d-chest { --dc: #1c7ed6; }
.ec-head { font-family: var(--display); font-size: 1.4rem; letter-spacing: .05em; color: var(--dc); text-transform: uppercase; }
.ec-pic { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; display: block; margin: 6px 0 8px; }
.ec-text { font-weight: 600; font-size: .95rem; line-height: 1.35; }

/* ---------------------------------------------------------------- game layout */
body.in-game { overflow-x: hidden; }
.gamebar { display: flex; align-items: center; gap: 14px; padding: 6px 14px; padding-top: max(6px, env(safe-area-inset-top)); background: rgba(10, 16, 30, .85); color: #fff; flex-wrap: wrap; font-weight: 600; font-size: .9rem; }
.gamebar .linkbtn { color: #fff; font-weight: 700; }
.gb-brand { text-decoration: none; padding: 2px 4px; }
.gb-code { font-family: var(--display); letter-spacing: .15em; color: var(--mustard); }
.gb-stock { display: inline-flex; align-items: center; gap: 2px; opacity: .9; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 130%; background: #fff; border-radius: 12px; padding: 6px; z-index: 50; display: flex; flex-direction: column; min-width: 230px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.menu button { background: none; color: var(--ink); box-shadow: none; text-align: left; font-weight: 600; padding: 9px 12px; border-radius: 8px; }
.menu button:hover { background: #f1f3f5; filter: none; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 14px; padding: 12px; max-width: 1500px; margin: 0 auto; align-items: start; }
.board-wrap { display: flex; justify-content: center; }
.board { position: relative; width: min(100%, calc(100vh - 80px)); aspect-ratio: 1; background: var(--board); border: 3px solid #1d2433; border-radius: 6px; container-type: size; box-shadow: 0 20px 50px rgba(0,0,0,.55); user-select: none; --rot: 0deg; --fit: 1; transform: rotate(var(--rot)) scale(var(--fit)); touch-action: pan-x pan-y; }
.board.easing { transition: transform .4s ease-out; }
.board.turning { cursor: grabbing; }
.board.turning .tile { cursor: grabbing; }
.rot-ctl { display: inline-flex; align-items: center; gap: 6px; }
.rot-range { width: 110px; accent-color: var(--mustard); }
.rot-reset { min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.rot-reset:disabled { opacity: .5; cursor: default; }
.side { position: sticky; top: 12px; max-height: calc(100vh - 70px); overflow-y: auto; scrollbar-width: thin; }
.side-in > * + * { margin-top: 12px; }

/* ---------------------------------------------------------------- tiles
   1u = 100cqw / 12.2 (corners 1.6u, side spaces 1u x 1.6u) */
.tile { position: absolute; background: var(--cream); outline: 1px solid #1d2433; cursor: pointer; overflow: hidden; transition: filter .2s, opacity .2s; }
.tile:hover { filter: brightness(1.06); z-index: 2; }
/* .tin faces the centre with its top, as on a real board */
.tin { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.side-l .tin, .side-r .tin { inset: auto; left: 50%; top: 50%; width: calc(100% / 1.6); height: calc(100% * 1.6); }
.side-l .tin { transform: translate(-50%, -50%) rotate(90deg); }
.side-r .tin { transform: translate(-50%, -50%) rotate(-90deg); }
.side-t .tin { transform: rotate(180deg); }
/* corners sit diagonally like on a real board: a square over the tile's
   diagonal, turned towards the centre, with the label as a band across */
.tile.side-c .tin { inset: auto; left: 50%; top: 50%; width: 141.5%; height: 141.5%; transform: translate(-50%, -50%) rotate(var(--ca)); }
.k-go { --ca: -45deg; } .k-jail { --ca: 45deg; } .k-parking { --ca: 135deg; } .k-gojail { --ca: -135deg; }
.t-bar { width: 100%; height: 22%; background: var(--gc); border-bottom: 1px solid #1d2433; flex: none; display: flex; align-items: center; justify-content: center; gap: 1.5%; }
.t-name { font-size: 1.12cqw; font-weight: 800; line-height: 1.05; padding: 3% 4% 0; text-transform: uppercase; letter-spacing: -.01em; hyphens: auto; overflow-wrap: anywhere; color: #232a36; }
.t-pic { width: 92%; flex: 1; min-height: 0; object-fit: cover; margin: 3% 0; border-radius: 2px; }
.t-price { font-size: 1.05cqw; font-weight: 700; padding-bottom: 4%; white-space: nowrap; }
.t-owner { position: absolute; left: 0; right: 0; bottom: 0; height: 5%; background: var(--pc); }
.tile:has(.t-owner) { box-shadow: inset 0 0 0 .35cqw color-mix(in srgb, var(--pc) 85%, transparent); }
.tile.mortgaged .tin { filter: grayscale(.9) opacity(.6); }
.tile.mortgaged::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, transparent 0 .9cqw, rgba(200,16,46,.18) .9cqw 1.8cqw); pointer-events: none; }
.tile.hl { animation: hl 1.1s ease-in-out infinite; z-index: 3; }
@keyframes hl { 50% { box-shadow: inset 0 0 0 .6cqw var(--mustard); filter: brightness(1.12); } }
.tile.dim { opacity: .35; }
.tile.here { box-shadow: inset 0 0 0 .5cqw var(--mustard) !important; z-index: 3; }
.tile.flash { animation: flash .8s ease-out; }
@keyframes flash { 30% { filter: brightness(1.5) saturate(1.4); } }
.team, .hq { display: inline-block; width: 1.25cqw; height: 1.15cqw; background: #2f9e44; clip-path: polygon(50% 0, 100% 45%, 100% 100%, 0 100%, 0 45%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.3); }
.hq { width: 2.1cqw; height: 1.5cqw; background: #c8102e; clip-path: polygon(0 30%, 30% 30%, 30% 0, 70% 0, 70% 30%, 100% 30%, 100% 100%, 0 100%); }
.gamebar .team { width: 12px; height: 11px; } .gamebar .hq { width: 16px; height: 12px; }
.k-chance .t-pic, .k-chest .t-pic, .k-tax .t-pic { width: 86%; border-radius: 50%; aspect-ratio: 1; flex: none; height: auto; margin: 6% 0; }
.k-chance .t-name { color: #d9480f; } .k-chest .t-name { color: #1864ab; }
.tile.side-c .tin { justify-content: center; }
.tile.side-c .t-pic { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border-radius: 0; }
.corner-label { position: absolute; left: 0; right: 0; top: 53%; background: rgba(255, 250, 235, .93); border-block: .2cqw solid #1d2433; padding: 1.5% 18%; }
.t-name.big { font-family: var(--display); font-weight: 400; font-size: 1.7cqw; letter-spacing: .02em; }
.t-sub { font-size: .95cqw; font-weight: 700; }
.t-sub.pot { color: var(--good); font-size: 1.2cqw; }
.k-gojail .t-name.big { color: #c8102e; }

/* ---------------------------------------------------------------- centre */
.board-center { position: absolute; left: calc(100% * 1.6 / 12.2); top: calc(100% * 1.6 / 12.2); width: calc(100% * 9 / 12.2); height: calc(100% * 9 / 12.2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.center-art { position: absolute; inset: 8%; background: var(--center) center / cover no-repeat; opacity: .28; border-radius: 50%; filter: sepia(.2); mask-image: radial-gradient(closest-side, #000 60%, transparent); }
.center-rot { position: absolute; inset: 0; rotate: calc(var(--rot) * -1); }
.board.easing .center-rot { transition: rotate .4s ease-out; }
.board.easing .token { transition: left .16s ease-out, top .16s ease-out, transform .4s ease-out; }
.center-info { position: absolute; inset: 0; }
.board-logo { position: absolute; left: 50%; top: 42%; font-size: 5.6cqw; transform: translate(-50%, -50%) rotate(-38deg); }
.decks { position: absolute; inset: 0; pointer-events: none; }
.decks .deck { position: absolute; }
.decks .d-chance { left: 14%; top: 14%; }
.decks .d-chest { right: 14%; bottom: 30%; }
.deck { width: 15cqw; aspect-ratio: 3 / 2; border-radius: 1cqw; display: grid; place-items: center; font-family: var(--display); font-size: 1.6cqw; letter-spacing: .06em; text-transform: uppercase; color: #fff; border: .35cqw dashed rgba(255,255,255,.6); box-shadow: .4cqw .4cqw 0 rgba(0,0,0,.18), .8cqw .8cqw 0 rgba(0,0,0,.08); }
.deck.d-chance { background: #f08c00; transform: rotate(-38deg) rotate(90deg); }
.deck.d-chest { background: #1c7ed6; transform: rotate(-38deg) rotate(90deg); }
.c-status { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); white-space: nowrap; display: flex; align-items: center; gap: .8cqw; font-weight: 800; font-size: 1.9cqw; background: rgba(255,255,255,.85); padding: .6cqw 1.6cqw .6cqw .8cqw; border-radius: 999px; box-shadow: inset 0 0 0 .3cqw var(--pc, var(--mustard)); }
.c-status .token-img.mini { width: 3cqw; height: 3cqw; }
.c-status.win { box-shadow: inset 0 0 0 .3cqw var(--mustard); }
.dice { position: absolute; bottom: 13%; left: 50%; transform: translateX(-50%); display: flex; gap: 3cqw; perspective: 60cqw; }
.die-wrap { width: 6cqw; height: 6cqw; }
.die { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .85s cubic-bezier(.2, .7, .3, 1.05); }
.face { position: absolute; inset: 0; background: #fffdf6; border-radius: 1cqw; box-shadow: inset 0 0 0 .2cqw #c9c2b0, inset 0 -.4cqw .6cqw rgba(0,0,0,.12); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: .9cqw; backface-visibility: hidden; }
.face i { width: 1.2cqw; height: 1.2cqw; border-radius: 50%; background: #1d2433; place-self: center; }
.f1 { transform: translateZ(3cqw); } .f6 { transform: rotateY(180deg) translateZ(3cqw); }
.f2 { transform: rotateY(90deg) translateZ(3cqw); } .f5 { transform: rotateY(-90deg) translateZ(3cqw); }
.f3 { transform: rotateX(90deg) translateZ(3cqw); } .f4 { transform: rotateX(-90deg) translateZ(3cqw); }
.f1 i { grid-area: 2 / 2; background: #c8102e; }
.f2 i:nth-child(1) { grid-area: 1 / 1; } .f2 i:nth-child(2) { grid-area: 3 / 3; }
.f3 i:nth-child(1) { grid-area: 1 / 1; } .f3 i:nth-child(2) { grid-area: 2 / 2; } .f3 i:nth-child(3) { grid-area: 3 / 3; }
.f4 i:nth-child(1) { grid-area: 1 / 1; } .f4 i:nth-child(2) { grid-area: 1 / 3; } .f4 i:nth-child(3) { grid-area: 3 / 1; } .f4 i:nth-child(4) { grid-area: 3 / 3; }
.f5 i:nth-child(1) { grid-area: 1 / 1; } .f5 i:nth-child(2) { grid-area: 1 / 3; } .f5 i:nth-child(3) { grid-area: 2 / 2; } .f5 i:nth-child(4) { grid-area: 3 / 1; } .f5 i:nth-child(5) { grid-area: 3 / 3; }
.f6 i:nth-child(1) { grid-area: 1 / 1; } .f6 i:nth-child(2) { grid-area: 1 / 3; } .f6 i:nth-child(3) { grid-area: 2 / 1; } .f6 i:nth-child(4) { grid-area: 2 / 3; } .f6 i:nth-child(5) { grid-area: 3 / 1; } .f6 i:nth-child(6) { grid-area: 3 / 3; }
.dice.thrown .die-wrap { animation: throw .85s cubic-bezier(.3, .6, .4, 1); }
.dice.thrown .die-wrap:nth-child(2) { animation-delay: .05s; }
@keyframes throw { 0% { transform: translate(-14cqw, -22cqw) scale(1.4); } 60% { transform: translate(0, 1cqw) scale(1); } 80% { transform: translate(0, -1cqw); } }
.card-pop { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transform: scale(.6) rotateY(90deg); transition: opacity .25s, transform .4s cubic-bezier(.2, .8, .3, 1.2); z-index: 20; }
.card-pop.on { opacity: 1; transform: none; pointer-events: auto; cursor: pointer; }
.card-pop .event-card { font-size: clamp(11px, 1.8cqw, 16px); }
.card-pop .ec-head { font-size: 1.5em; }
.card-pop .ec-text { font-size: 1em; }

/* payment popup: the payer's hand passes notes to the payee's hand */
.pay-pop { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; z-index: 21; --dur: 1300ms; }
.pay-pop.on { pointer-events: auto; cursor: pointer; animation: pp-show var(--dur) ease-out forwards; }
@keyframes pp-show { 0% { opacity: 0; transform: scale(.85); } 10% { opacity: 1; transform: none; } 88% { opacity: 1; } 100% { opacity: 0; transform: translateY(-2cqw); } }
.pay-panel { width: 46cqw; background: var(--cream); border: .35cqw solid var(--ink); border-radius: 1.4cqw; box-shadow: 0 1cqw 2.4cqw rgba(0,0,0,.45), inset 0 0 0 .5cqw #fff; padding: 1.2cqw 1.6cqw 1cqw; text-align: center; }
.pp-parties { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1cqw; font-family: Montserrat, sans-serif; font-weight: 800; font-size: 1.7cqw; color: var(--ink); }
.pp-party { display: flex; align-items: center; gap: .6cqw; min-width: 0; }
.pp-party:last-child { flex-direction: row-reverse; }
.pp-party span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-party .token-img { width: 3.4cqw; height: 3.4cqw; flex: none; border-radius: 50%; padding: .3cqw; background: var(--pc); box-shadow: inset 0 0 0 .2cqw rgba(255,255,255,.7); object-fit: contain; }
.pp-party .token-img.emoji { display: grid; place-items: center; font-size: 2cqw; }
.pp-ico { font-size: 2.6cqw; line-height: 1; }
.pp-arrow { color: var(--mustard-dk); font-size: 2.4cqw; }
.pp-stage { margin: .4cqw -1.6cqw; overflow: hidden; }
.pp-stage svg { display: block; width: 100%; height: auto; }
.pp-amount { font-family: var(--display); font-size: 4.2cqw; line-height: 1.05; color: var(--ink); letter-spacing: .05em; }
.pp-amount.good { color: var(--good); } .pp-amount.bad { color: var(--bad); }
.pay-pop.on .giver { animation: pp-give var(--dur) ease-in-out both; }
.pay-pop.on .taker { animation: pp-take var(--dur) ease-in-out both; }
.pay-pop.on .pp-bill { animation: pp-fly var(--dur) cubic-bezier(.45, .05, .35, 1) both; animation-delay: calc(var(--i) * var(--dur) * .05); }
@keyframes pp-give { 0% { transform: translateX(-70px); } 18%, 42% { transform: none; } 55% { transform: translateX(14px) rotate(-3deg); } 75% { transform: translateX(-10px); } 100% { transform: translateX(-80px); } }
@keyframes pp-take { 0% { transform: translateX(-70px); } 22%, 55% { transform: none; } 64% { transform: translateY(5px) rotate(4deg); } 78% { transform: none; } 100% { transform: translateX(-30px); } }
@keyframes pp-fly {
  0%, 22% { transform: translate(0, 0) rotate(-8deg); }
  45% { transform: translate(60px, -26px) rotate(6deg); }
  62% { transform: translate(120px, 2px) rotate(calc(var(--i) * 5deg - 4deg)); }
  100% { transform: translate(120px, 2px) rotate(calc(var(--i) * 5deg - 4deg)); }
}
@media (prefers-reduced-motion: reduce) { .pay-pop.on .giver, .pay-pop.on .taker, .pay-pop.on .pp-bill { animation: none; } }

/* ---------------------------------------------------------------- tokens */
.tokens, .floats { position: absolute; inset: 0; pointer-events: none; }
.token { position: absolute; width: 5.4cqw; height: 5.4cqw; transform: translate(-50%, -50%) rotate(calc(var(--rot) * -1)); transition: left .16s ease-out, top .16s ease-out; z-index: 10; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--pc) 35%, #fff), var(--pc) 75%); box-shadow: 0 .3cqw .6cqw rgba(0,0,0,.5), inset 0 0 0 .25cqw rgba(255,255,255,.75); padding: .5cqw; }
.token .token-img { position: relative; width: 100%; height: 100%; filter: drop-shadow(0 .15cqw .15cqw rgba(0,0,0,.6)); }
.token.active { z-index: 12; }
.token.active::after { content: ''; position: absolute; inset: -18%; border-radius: 50%; border: .3cqw solid var(--pc); animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.token.jailed .token-img { filter: grayscale(.6) drop-shadow(0 .2cqw .2cqw rgba(0,0,0,.5)); }
.float { position: absolute; transform: translate(-50%, -50%) rotate(calc(var(--rot) * -1)); font-family: var(--display); font-size: 2.4cqw; color: #fff; padding: .2cqw 1cqw; border-radius: 999px; background: var(--good); animation: float-up 1.6s ease-out forwards; white-space: nowrap; z-index: 30; }
.float.bad { background: var(--bad); }
@keyframes float-up { from { opacity: 0; margin-top: 2cqw; } 15% { opacity: 1; } to { opacity: 0; margin-top: -6cqw; } }

/* ---------------------------------------------------------------- side panel */
.actions { background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.actions > * + * { margin-top: 10px; }
.actions h3 { margin: 0; }
.actions .row .btn-main, .actions .row .btn-ghost { white-space: nowrap; padding-left: 10px; padding-right: 10px; }
.btn-main.big { font-size: 1.15rem; padding: 14px; }
.row.wrap { flex-wrap: wrap; }
.manage .full { flex-basis: 100%; margin: 0; }
.clock-bar { height: 6px; border-radius: 3px; background: #edf0f3; overflow: hidden; position: relative; }
.clock-bar::after { content: ''; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--left, 1)); background: linear-gradient(90deg, var(--bad), var(--mustard) 40%, var(--good)); transition: transform .25s linear; }
.waiting .who, .who { display: flex; align-items: center; gap: 8px; }
.waiting .who .token-img.mini { width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--pc) 22%, #fff); box-shadow: inset 0 0 0 2px var(--pc); padding: 3px; }
.pill.warn { background: #fff0d6; color: #a15c00; }
.players { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.player { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; border-left: 5px solid var(--pc); }
.player:last-child { border-bottom: 0; }
.player.turn { background: color-mix(in srgb, var(--pc) 10%, #fff); }
.player.focus { box-shadow: inset 0 0 0 2px var(--pc); }
.player.out { opacity: .5; }
.player .p-token { width: 38px; height: 38px; }
.p-main { flex: 1; min-width: 0; }
.p-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-props { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 3px; min-height: 9px; }
.chip { display: inline-block; width: 11px; height: 9px; border-radius: 2px; background: var(--gc); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); flex: none; }
.chip.mort { opacity: .3; }
.chip.built { box-shadow: inset 0 0 0 1px rgba(0,0,0,.25), 0 -2px 0 #2f9e44; }
.p-cash { font-family: var(--display); font-size: 1.15rem; position: relative; white-space: nowrap; }
.float-cash { position: absolute; right: 0; top: -4px; font-family: Montserrat, sans-serif; font-weight: 800; font-size: .85rem; animation: cash-up 1.5s ease-out forwards; white-space: nowrap; }
.float-cash.good { color: var(--good); } .float-cash.bad { color: var(--bad); }
@keyframes cash-up { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-26px); } }
.log { background: rgba(255,255,255,.92); border-radius: var(--radius); padding: 10px 12px; font-size: .82rem; }
.log ul { list-style: none; margin: 6px 0 0; padding: 0; }
.log li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.log li:last-child { border-bottom: 0; }
.log-head { font-weight: 800; color: var(--ink); }
.auction-top { display: flex; gap: 12px; align-items: flex-start; }
.auction-state > * + * { margin-top: 4px; }
.auction-high { font-family: var(--display); font-size: 2rem; line-height: 1; }
.auction-clock { font-weight: 800; }
.bids button { flex: 1; }
.trade-box { border-radius: 10px; padding: 10px; background: #f6f8fb; box-shadow: inset 0 0 0 2px var(--line); }
.trade-box.incoming { background: #fff8e6; box-shadow: inset 0 0 0 2px var(--mustard); }
.trade-box > * + * { margin-top: 8px; }
.trade-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trade-list { list-style: none; padding: 0; margin: 4px 0 0; font-size: .85rem; }
.trade-list li { display: flex; align-items: center; gap: 5px; padding: 1px 0; }
.result h3 { font-size: 1.3rem; }
.ranking { padding-left: 1.4rem; }
.ranking li { padding: 4px 0; }
.ranking li > * { margin-right: 6px; }

/* ---------------------------------------------------------------- modals */
.modal { position: fixed; inset: 0; background: rgba(8, 12, 22, .6); z-index: 500; display: grid; place-items: center; padding: 16px; animation: fade .2s; backdrop-filter: blur(2px); }
@keyframes fade { from { opacity: 0; } }
.modal-box { background: #fff; border-radius: 16px; padding: 18px; max-width: min(680px, 100%); max-height: calc(100vh - 32px); overflow: auto; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: pop .22s cubic-bezier(.2, .8, .3, 1.2); }
.modal-box.narrow { max-width: 320px; }
.modal-box.wide { width: 720px; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.modal-x { position: absolute; right: 10px; top: 8px; font-size: 1.2rem; color: var(--muted); z-index: 2; }
.deed-dialog .deed { width: 100%; box-shadow: none; }
.deed-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.rules-modal .rules-panel { box-shadow: none; padding: 0; margin: 0 !important; }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.trade-props { display: flex; flex-wrap: wrap; gap: 5px; }
.tp { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 700; padding: 5px 9px 5px 6px; background: #f3f4f6; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); border-radius: 8px; }
.tp.on { background: color-mix(in srgb, var(--gc) 25%, #fff); box-shadow: inset 0 0 0 2px var(--gc); }
.tp .chip { width: 12px; height: 12px; }

/* ---------------------------------------------------------------- small screens */
@container (max-width: 560px) {
  .t-name:not(.big), .t-price { display: none; }
  .t-pic { margin: 6% 0; }
  .side-t .t-pic, .side-b .t-pic { margin: 6% 0; }
  .t-sub { display: none; }
  .t-name.big { font-size: 2.1cqw; }
  .corner-label { padding: 1% 18%; }
}
@media (max-width: 980px) {
  .game-layout { grid-template-columns: 1fr; padding: 6px; gap: 8px; }
  .board { width: min(100%, calc(100vh - 60px)); }
  .side { position: static; max-height: none; overflow: visible; }
  .gamebar { gap: 10px; padding: 6px 10px; }
  .gb-brand { display: none; }
}
@media (max-width: 560px) {
  .hero-tokens span { width: 34px; height: 34px; }
  main { padding: 10px; }
  .panel { padding: 14px; }
  .trade-cols { grid-template-columns: 1fr; }
  .modal { padding: 8px; }
  .modal-box { padding: 14px; }
  .deed-mini { width: 112px; }
  .auction-high { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
