:root {
  --night: #0c2a33; --deep: #0f3a45; --ocean: #145566; --foam: #e8f3ef;
  --sand: #f6eddc; --sand2: #efe2c8; --line: #c9b896; --ink: #1d2a2e; --muted-ink: #5f6b66;
  --sunset: #e8743b; --sunset2: #f29a54; --lava: #2b1e1a; --gold: #f2c14e;
  --text: #f3efe6; --muted: #a9bcb8; --panel: #133f4b; --panel2: #184a57; --edge: #2a6070;
  --p0: #e4572e; --p1: #2a9d8f; --p2: #e9b730; --p3: #8e5bd6; --p4: #3a86ff; --p5: #ef6f9c;
  /* the kit's lobby and chat */
  --kit-bg: var(--panel); --kit-ink: var(--text); --kit-muted: var(--muted); --kit-line: var(--edge); --kit-accent: var(--sunset);
  --kit-p0: var(--p0); --kit-p1: var(--p1); --kit-p2: var(--p2); --kit-p3: var(--p3); --kit-p4: var(--p4); --kit-p5: var(--p5);
  --serif: "Noto Serif Display", Georgia, serif;
  --sans: "Noto Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; background: radial-gradient(120% 80% at 50% -10%, #17505e 0%, var(--night) 60%) fixed; color: var(--text); font: 15px/1.45 var(--sans); }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--edge); border-radius: 10px; padding: 9px 14px; }
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--sunset2); }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.primary { background: var(--sunset); border-color: var(--sunset); color: #23130a; font-weight: 700; }
.primary:hover:not(:disabled) { background: var(--sunset2); }
.ghost { background: transparent; border-color: transparent; padding: 6px 10px; color: var(--muted); }
.ghost:hover { color: var(--text); }
.danger { border-color: #b8553f; color: #ffb7a3; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.error { color: #ffab8f; min-height: 1.4em; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* ---------- title ---------- */
#title { max-width: 1060px; margin: 0 auto; padding: 0 16px 40px; }
.hero { position: relative; margin: 0 -16px; padding: 56px 24px 70px; overflow: hidden;
  background: linear-gradient(180deg, #f6b26b 0%, #e8743b 38%, #a6455a 70%, #1f4a5c 100%); color: #2a160d; }
.hero-sky { position: absolute; inset: 0; pointer-events: none; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 12%; }
.hero-img ~ .hero-sky { display: none; }
.hero:has(.hero-img) { min-height: clamp(260px, 40vw, 470px); padding-top: 40px; }
.hero:has(.hero-img) .hero-text { max-width: 520px; }
.hero:has(.hero-img) .eyebrow { display: inline-block; background: #fff; color: #c8352a; padding: 4px 10px; border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.hero:has(.hero-img) h1 { display: inline-block; background: #c8352a; color: #fff; text-transform: uppercase; letter-spacing: .05em; padding: 4px 26px 8px;
  border: 5px solid #fff; outline: 3px solid #c8352a; box-shadow: 0 10px 24px rgba(0,0,0,.35); transform: rotate(-3deg); margin: 14px 0 18px; text-shadow: 3px 3px 0 rgba(0,0,0,.3); }
.hero:has(.hero-img) .tag { display: inline-block; background: rgba(255,255,255,.92); color: var(--ink); text-shadow: none; padding: 8px 14px; border-radius: 8px; font-weight: 500; max-width: 30em; }
.lobby-uncle { float: right; width: 150px; border-radius: 14px; margin: 0 0 10px 14px; box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.win-art { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px 16px 0 0; }
.hero-isles { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 55%; fill: #123a46; opacity: .92; }
.hero-text { position: relative; max-width: 640px; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 600; color: #3b1c10; }
.hero h1 { font: 800 clamp(3rem, 9vw, 5.6rem)/1 var(--serif); margin: 6px 0 10px; color: #fff7ea; text-shadow: 0 2px 0 rgba(60,20,10,.25); letter-spacing: .01em; }
.tag { font-size: 1.12rem; max-width: 34em; margin: 0; color: #fff3e2; text-shadow: 0 1px 2px rgba(40,10,10,.35); }
.title-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-top: -34px; position: relative; }
@media (max-width: 820px) { .title-grid { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; padding: 18px; display: grid; gap: 12px; align-content: start; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.panel h2 { margin: 0; font: 700 1.35rem var(--serif); }
.seats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.seats li { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 8px; align-items: center; }
.seats input { min-width: 0; }
.tok { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 17px; line-height: 1; border: 2px solid rgba(255,255,255,.85); box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.x { padding: 6px 10px; }
.opts { display: grid; gap: 8px; }
.opts label, .field { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); }
.online form input { flex: 1; text-transform: uppercase; letter-spacing: .15em; min-width: 0; }
.foot { margin-top: 18px; }

.lobby-wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px 80px; }
.lobby-title { font: 700 1.6rem var(--serif); }

/* ---------- table: wood felt, board in the middle, plaques in the corners, tiles along the bottom ---------- */
#play { position: fixed; inset: 0; overflow: hidden; }
.felt { position: absolute; inset: 0; --S: min(calc(100vh - 150px), calc(100vw - 600px)); --side: calc((100vw - var(--S)) / 2);
  background: #5a2e1a url("art/board/table.webp") center / cover no-repeat; }
.felt::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(255,220,170,.10), rgba(0,0,0,.45) 85%); pointer-events: none; }

.banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: min(calc(var(--S) * .78), 92vw); min-height: 40px; z-index: 5;
  background: linear-gradient(#fffdf7, #f1e9d6); color: var(--ink); border: 2px solid #3b2a1c; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.45);
  display: flex; align-items: center; gap: 10px; padding: 6px 14px; font: 600 1.02rem/1.25 var(--sans); }
.banner .tok { flex: none; }
.banner .hint { margin-left: auto; color: var(--sunset); font-weight: 700; white-space: nowrap; }

.board-wrap { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); width: var(--S); height: var(--S); z-index: 1; }
.board { container-type: inline-size; width: 100%; height: 100%; display: grid; position: relative;
  --u: calc(100cqw / 12.1); --c: calc(var(--u) * 1.55);
  grid-template-columns: 1.55fr repeat(9, 1fr) 1.55fr; grid-template-rows: 1.55fr repeat(9, 1fr) 1.55fr;
  background: #1c1c1c; gap: 1px; border: 3px solid #1c1c1c; box-shadow: 0 0 0 1px #6b5130, 0 22px 50px rgba(0,0,0,.6); }

.sp { position: relative; background: #f2ecdc; color: #161616; overflow: hidden; min-width: 0; min-height: 0; }
.sp.buyable { cursor: pointer; }
.sp.buyable:hover { background: #fffaf0; }
.sp .in { position: absolute; display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; height: 100%; left: 0; top: 0; }
.side-l .in, .side-r .in { width: var(--u); height: var(--c); left: 50%; top: 50%; }
.side-l .in { transform: translate(-50%, -50%) rotate(90deg); }
.side-r .in { transform: translate(-50%, -50%) rotate(-90deg); }
.side-t .in { transform: rotate(180deg); }
.sp .bar { flex: 0 0 21%; width: 100%; border-bottom: 1px solid #1c1c1c; display: flex; align-items: center; justify-content: center; gap: 4%; }
.sp .nm { font: 700 max(5.5px, 1.05cqw)/1.08 var(--sans); text-transform: uppercase; letter-spacing: .01em; margin-top: 7%; padding: 0 5%; overflow-wrap: break-word; }
.sp .pic { flex: 1; min-height: 0; width: 72%; display: flex; align-items: center; justify-content: center; }
.sp .pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sp .pic .em { font-size: max(10px, 2.6cqw); }
.sp .pr { font: 600 max(5px, .95cqw) var(--sans); margin-bottom: 9%; }
.sp .ownbar { position: absolute; left: 0; right: 0; bottom: 0; height: 7%; }
.sp.mort .in { filter: grayscale(1) opacity(.5); }
.sp.mort::after { content: "MORTGAGED"; position: absolute; inset: 0; display: grid; place-items: center; font: 800 max(5px, .8cqw) var(--sans); color: #a0281a; transform: rotate(-35deg); pointer-events: none; }
.house { width: 17%; aspect-ratio: 1; background: #22913f; border: 1px solid #0b3b18; border-radius: 1px; clip-path: polygon(50% 0, 100% 40%, 100% 100%, 0 100%, 0 40%); }
.hotel { width: 50%; height: 62%; background: #d42c20; border: 1px solid #5a120c; border-radius: 1px; }
.sp.hl { outline: 3px solid var(--gold); outline-offset: -3px; z-index: 2; }

.corner .cart { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.corner .clab { position: absolute; left: 0; right: 0; bottom: 0; padding: 3% 4% 4%; text-align: center; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75) 45%);
  font: 800 max(7px, 1.35cqw)/1.05 var(--serif); text-shadow: 0 1px 2px #000; }
.corner .clab small { display: block; font: 600 max(5px, .85cqw) var(--sans); opacity: .9; }
.corner .cem { position: absolute; inset: 0; display: grid; place-items: center; font-size: max(16px, 4cqw); }

/* tokens: pewter pieces on a disc of the player's colour */
.tok { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--pc) 55%, #fff), var(--pc) 70%); border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,.5); overflow: hidden; }
.tok b { font-size: 17px; line-height: 1; font-weight: 400; }
.tok img { position: absolute; inset: 4%; width: 92%; height: 92%; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.toks { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 1px; pointer-events: none; padding: 4%; z-index: 3; }
.toks .tok { width: max(16px, calc(var(--u) * .62)); height: max(16px, calc(var(--u) * .62)); }
.toks .tok b { font-size: max(9px, calc(var(--u) * .36)); }
.toks .tok.now { box-shadow: 0 0 0 2px var(--gold), 0 3px 8px rgba(0,0,0,.6); z-index: 2; }
.toks .tok.jailed::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 22%, rgba(30,30,30,.8) 22% 30%); }

/* the middle of the board */
.center { grid-row: 2 / 11; grid-column: 2 / 11; position: relative; overflow: hidden; background: #cfe3d3; }
.center-map { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.logo { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%) rotate(-38deg); background: #c8352a; color: #fff; text-align: center;
  padding: 1.1cqw 4cqw 1.3cqw; border: .45cqw solid #fff; outline: .25cqw solid #c8352a; box-shadow: 0 .8cqw 1.6cqw rgba(0,0,0,.35); white-space: nowrap; }
.logo b { display: block; font: 800 7.4cqw/1 var(--serif); letter-spacing: .04em; text-transform: uppercase; text-shadow: .3cqw .3cqw 0 rgba(0,0,0,.35); }
.logo small { display: block; font: 600 1.25cqw var(--sans); letter-spacing: .12em; text-transform: uppercase; margin-top: .4cqw; }
.pile { position: absolute; width: 20cqw; aspect-ratio: 4 / 3; border: .4cqw dashed rgba(30,60,50,.45); border-radius: 1cqw; padding: .6cqw; }
.pile img { width: 100%; height: 100%; object-fit: cover; border-radius: .7cqw; box-shadow: .3cqw .4cqw 0 #fff, .6cqw .8cqw 0 #ddd, .4cqw 1.2cqw 1.6cqw rgba(0,0,0,.35); }
.pile span { position: absolute; inset: 0; display: grid; place-items: center; font: 800 2cqw var(--serif); color: rgba(20,60,50,.6); z-index: -1; }
.pile.holo { left: 9%; top: 11%; transform: rotate(135deg); }
.pile.ohana { right: 9%; bottom: 11%; transform: rotate(-45deg); }

.drawn { position: absolute; left: 50%; top: 4%; transform: translateX(-50%); width: 58%; z-index: 4; }
.drawn:empty { display: none; }
.drawn .cardface { background: #fffdf6; color: var(--ink); border-radius: 1.2cqw; border: .5cqw solid var(--dc); box-shadow: 0 1.2cqw 2.4cqw rgba(0,0,0,.4); padding: 1.6cqw 2.2cqw; text-align: center; animation: flip .45s ease-out; }
.drawn .cardface b { display: block; font: 800 2.3cqw var(--serif); color: var(--dc); margin-bottom: .6cqw; }
.drawn .cardface p { margin: 0; font: 500 max(11px, 1.75cqw)/1.35 var(--sans); }
@keyframes flip { from { transform: rotateY(90deg) scale(.8); } to { transform: none; } }

.prompt { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); width: 66%; max-height: 58%; overflow: auto; z-index: 5;
  background: linear-gradient(#fffdf7, #efe6d1); color: var(--ink); border: 2px solid #3b2a1c; border-radius: 1cqw; box-shadow: 0 1.4cqw 3cqw rgba(0,0,0,.45);
  padding: 1.6cqw 2cqw; display: grid; gap: 1.1cqw; justify-items: center; text-align: center; font-size: max(12px, 1.7cqw); }
.prompt:empty { display: none; }
.prompt h3 { margin: 0; font: 800 max(15px, 2.5cqw)/1.15 var(--serif); }
.prompt p { margin: 0; }
.prompt .note { color: var(--muted-ink); font-size: .88em; }
.prompt .btns, .bidrow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.prompt button { color: var(--ink); background: #fffaf0; border: 2px solid #3b2a1c; border-radius: 6px; padding: max(6px, .8cqw) max(12px, 1.8cqw); font-weight: 600; }
.prompt button.primary { background: #2f8f4e; border-color: #1b5a30; color: #fff; }
.prompt button.danger { color: #8c2416; }
.prompt .who { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; vertical-align: middle; }
.prompt .who .tok { width: 24px; height: 24px; } .prompt .who .tok b { font-size: 13px; }
.prompt .deal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; text-align: left; }
.prompt .deal div { background: #fff; border: 1px solid #d8c7a2; border-radius: 8px; padding: 8px 10px; }
.prompt .deal b { display: block; font-size: .78em; text-transform: uppercase; letter-spacing: .1em; color: var(--ocean); }
.prompt .minideed { display: flex; gap: 12px; align-items: center; text-align: left; }
.prompt .minideed img { width: 42%; border-radius: 6px; border: 1px solid #c9b896; }
.bidrow input { width: 7em; color: var(--ink); background: #fff; border: 2px solid #3b2a1c; border-radius: 6px; }

/* player plaques down the sides, deeds fanned beside them */
.col { position: absolute; top: 10px; bottom: 92px; width: calc(var(--side) - 24px); max-width: 330px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; z-index: 2; }
.col.left { left: 12px; } .col.right { right: 12px; }
.slot { display: flex; flex-direction: column; gap: 8px; }
.slot.low { flex-direction: column-reverse; margin-top: auto; }
.plaque { position: relative; display: grid; grid-template-columns: 76px 1fr; border-radius: 10px; overflow: hidden; background: linear-gradient(#f8f3e6, #ddd2b8);
  border: 2px solid #2b1d12; box-shadow: 0 6px 14px rgba(0,0,0,.5); color: var(--ink); min-height: 86px; }
.plaque .face { grid-row: 1 / 3; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #fff, #cfc5ad); border-right: 2px solid #2b1d12; }
.plaque .face .tok { width: 62px; height: 62px; } .plaque .face .tok b { font-size: 32px; }
.plaque .pn { padding: 6px 10px 2px; font: 700 1rem/1.15 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plaque .pn small { display: block; font: 500 .74rem var(--sans); color: var(--muted-ink); overflow: hidden; text-overflow: ellipsis; }
.plaque .cash { align-self: end; background: var(--pc); color: #fff; font: 800 1.45rem/1 var(--sans); padding: 6px 10px; text-shadow: 0 1px 2px rgba(0,0,0,.5); font-variant-numeric: tabular-nums; }
.plaque.now { box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(242,193,78,.7), 0 6px 14px rgba(0,0,0,.5); }
.plaque.out { filter: grayscale(1) opacity(.55); }
.plaque .think { position: absolute; right: 8px; top: 6px; font-size: .8rem; color: var(--sunset); font-weight: 700; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.deeds { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.dgroup { display: flex; }
.dgroup .mini + .mini { margin-left: -20px; }
.mini { width: 40px; height: 54px; background: #fffdf6; border: 1px solid #333; border-radius: 3px; box-shadow: 1px 2px 3px rgba(0,0,0,.45); cursor: pointer; padding: 0; overflow: hidden; display: flex; flex-direction: column; color: var(--ink); }
.mini:hover { transform: translateY(-4px); z-index: 2; }
.mini i { display: block; height: 11px; flex: none; border-bottom: 1px solid #333; }
.mini span { font: 700 6.5px/1.1 var(--sans); text-transform: uppercase; padding: 2px 1px; text-align: center; word-break: break-word; }
.mini.m { filter: grayscale(.9) opacity(.6); }
.mini .hh { margin-top: auto; font-size: 7px; color: #22913f; text-align: center; letter-spacing: -1px; }

/* the action tiles */
.tools { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 8px; z-index: 6; }
.tile { width: 74px; height: 70px; padding: 4px 2px; border-radius: 8px; display: grid; place-items: center; align-content: center; gap: 2px;
  background: linear-gradient(#6fbf86, #2f7d4a); border: 2px solid #12391f; color: #fff; box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 4px 8px rgba(0,0,0,.5); }
.tile .ti { font-size: 26px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.tile .tl { font: 700 .74rem var(--sans); text-shadow: 0 1px 1px rgba(0,0,0,.6); }
.tile:hover:not(:disabled) { background: linear-gradient(#86d39b, #3a9259); border-color: #12391f; }
.tile:disabled { background: linear-gradient(#8a948c, #5c665f); opacity: .7; }
.tile.go { animation: pulse 1.4s infinite; background: linear-gradient(#ffb36b, #e0661f); border-color: #6a2a08; }
@keyframes pulse { 50% { box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 0 0 5px rgba(255,190,90,.55), 0 4px 8px rgba(0,0,0,.5); } }

/* narrow or tall screens: banner, board, tiles, then the plaques in two columns */
@media (max-width: 1000px), (max-aspect-ratio: 5/4) {
  #play { position: static; }
  .felt { position: relative; min-height: 100vh; --S: min(100vw - 12px, 760px); display: flex; flex-direction: column; align-items: center; padding: 8px 6px 20px; gap: 8px; }
  .banner, .board-wrap, .tools, .col { position: relative; left: auto; right: auto; top: auto; bottom: auto; transform: none; }
  .banner { order: 1; width: var(--S); font-size: .92rem; }
  .board-wrap { order: 2; }
  .tools { order: 3; }
  .col.left { order: 4; left: auto; } .col.right { order: 5; right: auto; }
  .col { width: var(--S); max-width: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .slot.low { flex-direction: column; margin-top: 0; }
  .plaque { grid-template-columns: 56px 1fr; min-height: 66px; }
  .plaque .face .tok { width: 46px; height: 46px; } .plaque .face .tok b { font-size: 24px; }
  .plaque .cash { font-size: 1.1rem; }
  .tile { width: 62px; height: 60px; } .tile .ti { font-size: 22px; }
  .prompt { width: 84%; max-height: 80%; bottom: 3%; }
  .drawn { width: 80%; }
}

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: #4a1f15; color: #ffd8cc; border: 1px solid #b8553f; border-radius: 10px; padding: 8px 14px; margin: 0; max-width: 90vw; z-index: 20; }
.toast:empty { display: none; }
.landlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 60vh; overflow: auto; }
.landlist li { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; }
.landlist .sw { width: 12px; height: 22px; border-radius: 2px; border: 1px solid #333; }
.landlist .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.landlist .acts button { padding: 4px 9px; font-size: .82rem; border-radius: 7px; }
.landlist li.m .nm { text-decoration: line-through; color: var(--muted-ink); }
.loglist { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 4px; max-height: 65vh; overflow: auto; font-size: .92rem; }
.loglist li { border-bottom: 1px dotted #d3c3a2; padding-bottom: 3px; }
.deed-art { width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- dialogs ---------- */
.sheet { border: 0; border-radius: 16px; padding: 0; background: var(--sand); color: var(--ink); width: min(360px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.sheet.wide { width: min(720px, 96vw); }
.sheet::backdrop { background: rgba(5, 20, 25, .6); }
.sheet .in { padding: 16px 18px 18px; display: grid; gap: 10px; }
.sheet h3 { margin: 0; font: 700 1.3rem var(--serif); }
.sheet button { color: var(--ink); background: #fffaf0; border-color: #c9b896; }
.sheet button.primary { background: var(--sunset); border-color: #c45a26; }
.sheet input, .sheet select { color: var(--ink); background: #fff; border-color: #c9b896; }
.sheet .field, .sheet .muted { color: var(--muted-ink); }
.deed-head { padding: 16px 18px 12px; color: #fff; text-align: center; border-radius: 16px 16px 0 0; }
.deed-head small { display: block; letter-spacing: .14em; text-transform: uppercase; font-size: .7rem; opacity: .9; }
.deed-head strong { font: 800 1.6rem/1.1 var(--serif); }
.rent { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rent td { padding: 3px 0; border-bottom: 1px dotted #d3c3a2; }
.rent td:last-child { text-align: right; font-weight: 600; }
.rent tr.now td { color: var(--sunset); }
.deed .meta { font-size: .85rem; color: var(--muted-ink); }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .trade-cols { grid-template-columns: 1fr; } }
.trade-cols h4 { margin: 0 0 6px; }
.picks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 230px; overflow: auto; }
.picks label { display: grid; grid-template-columns: auto 10px 1fr auto; gap: 8px; align-items: center; font-size: .9rem; cursor: pointer; }
.picks .sw { width: 10px; height: 16px; border-radius: 2px; }
.partner { display: flex; gap: 6px; flex-wrap: wrap; }
.partner button.on { border-color: var(--sunset); background: #ffe7d6; font-weight: 700; }
.standings { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.standings li { display: flex; justify-content: space-between; gap: 12px; }

/* ---------- polish: title and lobby on the wood table, cream cards with coloured headers ---------- */
body { background: #4a2616 url("art/board/table.webp") center / cover fixed; }
body::before { content: ""; position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(255,220,170,.08), rgba(0,0,0,.5) 90%); pointer-events: none; z-index: -1; }
#title, #lobbyScreen { --text: var(--ink); --muted: var(--muted-ink); --panel: #fffaf0; --panel2: #fff; --edge: #b9a57e;
  --kit-bg: #fffaf0; --kit-ink: var(--ink); --kit-muted: var(--muted-ink); --kit-line: #c9b896; --kit-accent: #2f8f4e; color: var(--ink); }
#title .panel { background: linear-gradient(#fffdf6, #f3ead6); border: 3px solid #2b1d12; border-radius: 12px; box-shadow: 0 14px 30px rgba(0,0,0,.45); }
#title .panel h2 { margin: -18px -18px 4px; padding: 10px 18px; background: #c8352a; color: #fff; border-radius: 8px 8px 0 0; border-bottom: 3px solid #2b1d12;
  font: 800 1.15rem var(--serif); text-transform: uppercase; letter-spacing: .08em; text-shadow: 1px 1px 0 rgba(0,0,0,.3); }
#title .panel.online h2 { background: #1f7f86; }
#title .hero { border-radius: 0 0 14px 14px; box-shadow: 0 14px 30px rgba(0,0,0,.4); }
#title .foot, #title .error { color: #f5e8d2; text-shadow: 0 1px 2px #000; }
.primary, .sheet button.primary { background: linear-gradient(#6fbf86, #2f7d4a); border: 2px solid #12391f; color: #fff; font-weight: 700; text-shadow: 0 1px 1px rgba(0,0,0,.5);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 3px 6px rgba(0,0,0,.25); }
.primary:hover:not(:disabled), .sheet button.primary:hover:not(:disabled) { background: linear-gradient(#86d39b, #3a9259); border-color: #12391f; }
#title button:not(.primary), #title input, #title select { border: 2px solid #b9a57e; }
#lobbyScreen .lobby-wrap { background: linear-gradient(#fffdf6, #f3ead6); border: 3px solid #2b1d12; border-radius: 12px; margin-top: 24px; padding: 0 18px 18px; box-shadow: 0 14px 30px rgba(0,0,0,.45); }
#lobbyScreen .lobby-title { margin: 0 -18px 14px; padding: 10px 18px; background: #c8352a; color: #fff; border-radius: 8px 8px 0 0; border-bottom: 3px solid #2b1d12;
  font: 800 1.15rem var(--serif); text-transform: uppercase; letter-spacing: .08em; }
#lobbyScreen .lobby-wrap { position: relative; }
#lobbyScreen .lobby-uncle { float: none; position: absolute; left: calc(100% + 22px); top: 40px; width: 220px; margin: 0; border: 3px solid #2b1d12; }
@media (max-width: 1150px) { #lobbyScreen .lobby-uncle { display: none; } }

/* money flying off the plaques */
.moneyfly { position: fixed; z-index: 30; pointer-events: none; font: 900 1.35rem var(--sans); padding: 2px 10px; border-radius: 8px; transform: translate(-50%, -50%);
  animation: fly 1.7s ease-out forwards; text-shadow: 0 1px 2px rgba(0,0,0,.6); white-space: nowrap; }
.moneyfly.up { color: #fff; background: #2f8f4e; border: 2px solid #12391f; }
.moneyfly.down { color: #fff; background: #c8352a; border: 2px solid #5a120c; }
@keyframes fly { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
.plaque .cash.bump { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.08); filter: brightness(1.3); } }

/* the uncle pops up from the bottom of the board to react */
.uncle { position: absolute; left: 1%; bottom: 0; height: 52%; z-index: 4; pointer-events: none; display: flex; align-items: flex-start; transform: translateY(105%); transition: transform .35s cubic-bezier(.3,1.5,.6,1); }
.uncle.show { transform: translateY(0); }
.uncle img { height: 100%; filter: drop-shadow(0 6px 10px rgba(0,0,0,.4)); }
.uncle .bubble { margin-top: 6%; margin-left: -4%; background: #fff; color: var(--ink); border: 2px solid #2b1d12; border-radius: 14px; padding: 1cqw 1.6cqw; font: 700 max(12px, 1.8cqw)/1.25 var(--sans);
  max-width: 34cqw; box-shadow: 0 4px 10px rgba(0,0,0,.3); position: relative; }
.uncle .bubble::before { content: ""; position: absolute; left: -10px; top: 14px; border: 8px solid transparent; border-right-color: #2b1d12; }

/* the drawn card shows its deck's art */
.drawn .cardface { padding: 0 0 1.6cqw; overflow: hidden; }
.drawn .cardface .cf-art { display: block; width: 100%; height: 9cqw; object-fit: cover; margin-bottom: 1cqw; }
.drawn .cardface b, .drawn .cardface p { padding: 0 2.2cqw; }

/* ---------- polish 2 ---------- */
.sp.owned { background: color-mix(in srgb, var(--oc) 13%, #f2ecdc); }
.sp.owned .ownbar { height: 9%; box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.sp.owned .in::after { content: ""; position: absolute; right: 0; bottom: 9%; width: 0; height: 0; border-left: max(6px, calc(var(--u) * .22)) solid transparent; border-bottom: max(6px, calc(var(--u) * .22)) solid var(--oc); }
.house, .hotel { background: url("art/pieces/house.webp") center / contain no-repeat; border: 0; clip-path: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.45)); }
.house { width: 22%; aspect-ratio: 1; }
.hotel { background-image: url("art/pieces/hotel.webp"); width: 58%; height: 90%; }
.toks .tok.hop { animation: hop .15s ease-out; }
@keyframes hop { 50% { transform: translateY(-38%) scale(1.12); } }
.bill { position: fixed; left: 0; top: 0; width: 42px; height: 22px; margin: -11px 0 0 -21px; z-index: 31; pointer-events: none; border-radius: 3px;
  background: linear-gradient(135deg, #bfe3b4, #86c27a); border: 2px solid #3f7a35; box-shadow: 0 2px 4px rgba(0,0,0,.35); }
.bill::after { content: "$"; position: absolute; inset: 0; display: grid; place-items: center; font: 900 13px var(--sans); color: #2f5f28; }
.standings { list-style: none; padding: 0; gap: 10px; }
.standings li { display: grid; grid-template-columns: 22px 30px 1fr auto; gap: 10px; align-items: center; }
.standings li .place { font: 800 1.1rem var(--serif); color: var(--muted-ink); text-align: center; }
.standings li.first .place { color: #c8352a; }
.standings .who2 { display: grid; gap: 3px; min-width: 0; }
.standings .who2 small { color: var(--muted-ink); font-size: .78rem; }
.standings .bar { height: 8px; background: #e4d8bf; border-radius: 4px; overflow: hidden; }
.standings .bar i { display: block; height: 100%; border-radius: 4px; }
.standings .worth { font-variant-numeric: tabular-nums; }
.sp.owned .pr { margin-bottom: 14%; }
.house { width: 25%; }

/* ---------- trade screen ---------- */
.trade .partner button small { color: var(--muted-ink); margin-left: 4px; }
.tside { display: grid; gap: 8px; align-content: start; background: #fffdf7; border: 1px solid #d8c7a2; border-radius: 10px; padding: 10px; }
.tside h4 { margin: 0; }
.tdeeds { display: flex; flex-wrap: wrap; gap: 6px; max-height: 230px; overflow: auto; padding: 2px; }
.tdeed { width: 74px; min-height: 76px; padding: 0 0 4px; display: flex; flex-direction: column; align-items: stretch; text-align: center; border: 2px solid #8d7b58; border-radius: 6px; background: #fff; overflow: hidden; color: var(--ink); }
.tdeed i { height: 14px; border-bottom: 1px solid #333; }
.tdeed b { font: 700 .66rem/1.15 var(--sans); text-transform: uppercase; padding: 5px 3px 2px; word-break: break-word; }
.tdeed small { font-size: .68rem; color: var(--muted-ink); margin-top: auto; }
.tdeed.m { opacity: .7; }
.tdeed.on { border-color: #2f8f4e; box-shadow: 0 0 0 3px rgba(47,143,78,.35); transform: translateY(-2px); background: #effaf0; }
.tsum { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; background: #fff; border: 1px solid #d8c7a2; border-radius: 10px; padding: 8px 12px; }
.tsum b { margin-right: 6px; } .tsum small { display: block; color: var(--muted-ink); font-size: .78rem; }
.tsum p { grid-column: 1 / -1; margin: 0; font-weight: 700; }
.tsum .good { color: #2f8f4e; } .tsum .warn { color: #b0461f; }

.prompt .bidnow { display: grid; gap: 2px; justify-items: start; }
.prompt .bidnow small { color: var(--muted-ink); font-size: .78em; text-transform: uppercase; letter-spacing: .08em; }
.prompt .bidnow b { font: 800 max(18px, 2.8cqw)/1.1 var(--serif); color: #2f8f4e; }

/* ---------- 3D dice ---------- */
.dice { position: absolute; inset: 0; z-index: 3; pointer-events: none; perspective: 900px; --aw: 1%; --ah: 1%; container-type: size; }
.dice { --aw: 1cqw; --ah: 1cqh; }
.dthrow { position: absolute; width: var(--ds); height: var(--ds); margin: calc(var(--ds) / -2) 0 0 calc(var(--ds) / -2); --ds: max(34px, 10.5cqw); transform-style: preserve-3d; }
.dshadow { position: absolute; left: 8%; top: 22%; width: 100%; height: 100%; border-radius: 30%; background: rgba(20, 40, 30, .55); filter: blur(5px); opacity: .55; transform-origin: center; }
.cube { position: absolute; inset: 0; transform-style: preserve-3d; }
.cube .face { position: absolute; inset: 0; border-radius: 20%; backface-visibility: hidden;
  background: radial-gradient(circle at 30% 25%, #ffffff 0%, #faf6ec 55%, #e9e1cf 100%);
  box-shadow: inset 0 0 0 1px rgba(150, 130, 100, .35), inset -3px -4px 6px rgba(120, 100, 70, .18), inset 3px 3px 5px rgba(255, 255, 255, .9);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 15%; }
.cube .face i { width: 74%; aspect-ratio: 1; border-radius: 50%; place-self: center; visibility: hidden;
  background: radial-gradient(circle at 40% 35%, #4a4a4a, #111 70%); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .7); }
.cube .face.f1 i { background: radial-gradient(circle at 40% 35%, #e0574a, #a3160d 70%); width: 92%; }
.cube .face i.on { visibility: visible; }
/* inner planes fill the gaps at the rounded corners while the cube turns */
.cube .core { position: absolute; inset: 6%; background: #ece4d2; border-radius: 12%; }
.cube .cx { transform: rotateY(90deg); } .cube .cy { transform: rotateX(90deg); } .cube .cz { transform: none; }
.dtotal { position: absolute; transform: translate(-50%, -50%) scale(0); background: #fff; color: var(--ink); border: 2px solid #2b1d12; border-radius: 999px;
  padding: .35cqw 1.4cqw; font: 800 max(14px, 2.6cqw) var(--serif); box-shadow: 0 4px 10px rgba(0,0,0,.3); opacity: 0; transition: opacity .2s; white-space: nowrap; }
.dtotal.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.dtotal.pop { animation: totalpop .45s cubic-bezier(.3,1.6,.6,1); }
.dtotal.dbl { background: linear-gradient(#ffd86b, #f2b31f); border-color: #7a4d00; color: #4a2a00; }
@keyframes totalpop { 0% { transform: translate(-50%, -50%) scale(0); } 100% { transform: translate(-50%, -50%) scale(1); } }
.board.thud { animation: thud .22s ease-out; }
@keyframes thud { 40% { transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .board.thud, .dtotal.pop { animation: none; } }

.prompt.afterroll, .drawn.afterroll { animation: appear .3s ease-out 1.15s both; }
@keyframes appear { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%); } }

/* ---------- how to play ---------- */
.sheet.help { width: min(860px, 96vw); }
.helpgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-height: 64vh; overflow: auto; padding-right: 4px; }
@media (max-width: 700px) { .helpgrid { grid-template-columns: 1fr; } }
.helpgrid section { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: start; background: #fffdf7; border: 1px solid #d8c7a2; border-radius: 12px; padding: 10px 12px; }
.helpgrid .hu { width: 74px; height: auto; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.helpgrid h4 { margin: 0 0 4px; font: 800 1.05rem var(--serif); color: #c8352a; }
.helpgrid ul { margin: 6px 0; padding-left: 18px; }
.helpgrid li { margin: 3px 0; }
.help .in > p.muted { margin: 0; }

/* ---- landing moments (app.js moments): rent card, turn slide, coins at Aloha, Hale Paʻahao bars, houses dropping in */
.moment { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 8; perspective: 900px; visibility: hidden; }
.moment.in, .moment.out { visibility: visible; }
.rentcard { width: min(62%, 230px); background: #fbf6e9; border: 2px solid #2b1d12; border-radius: 8px; padding: 0 0 10px; text-align: center;
  box-shadow: 0 14px 30px rgba(0,0,0,.45); font-family: var(--sans); color: #2b1d12; overflow: hidden; }
.rentcard .rc-top { padding: 8px 6px; font: 800 clamp(.8rem, 3.4cqw, 1.1rem)/1.1 var(--serif, serif); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.55);
  border-bottom: 2px solid #2b1d12; }
.rentcard .rc-lab { margin-top: 8px; font: 700 .72rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #8a6a3a; }
.rentcard .rc-amt { font: 800 clamp(1.6rem, 8cqw, 2.6rem)/1.05 var(--serif, serif); color: #b0281f; font-variant-numeric: tabular-nums; }
.rentcard .rc-who { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 6px; padding: 0 8px; font: 600 .8rem var(--sans); flex-wrap: wrap; }
.rentcard .rc-who .tok { width: 22px; height: 22px; } .rentcard .rc-who .tok b { font-size: 12px; }
.rentcard .rc-who > b { color: #8a6a3a; }
.moment.flip .rentcard { transform: rotateY(-100deg) scale(.7); opacity: 0; transition: transform .45s cubic-bezier(.2,1.4,.4,1), opacity .2s; }
.moment.flip.in .rentcard { transform: none; opacity: 1; }
.moment.flip.out .rentcard { transform: translateY(-30px) scale(.9); opacity: 0; transition: transform .25s ease-in, opacity .25s; }
.turnslide { display: flex; align-items: center; gap: 12px; width: 100%; justify-content: center; padding: 12px 0;
  background: linear-gradient(90deg, transparent, rgba(43,29,18,.88) 18%, rgba(43,29,18,.88) 82%, transparent);
  border-top: 3px solid var(--pc); border-bottom: 3px solid var(--pc); color: #fff8e6;
  font: 800 clamp(1.1rem, 5.5cqw, 2rem)/1 var(--serif, serif); text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.turnslide .tok { width: clamp(30px, 8cqw, 46px); height: clamp(30px, 8cqw, 46px); box-shadow: 0 0 0 3px var(--pc); }
.moment.slide .turnslide { transform: translateX(-110%); transition: transform .32s cubic-bezier(.2,.9,.3,1.1); }
.moment.slide.in .turnslide { transform: none; }
.moment.slide.out .turnslide { transform: translateX(110%); transition: transform .25s ease-in; }
.plaqueglow { position: fixed; pointer-events: none; z-index: 40; border-radius: 10px; animation: plaqueglow 1.1s ease-out forwards; }
@keyframes plaqueglow { 0% { box-shadow: 0 0 0 0 var(--pc), 0 0 0 0 rgba(242,193,78,0); } 30% { box-shadow: 0 0 0 5px var(--pc), 0 0 34px 10px rgba(242,193,78,.85); }
  100% { box-shadow: 0 0 0 14px transparent, 0 0 40px 18px rgba(242,193,78,0); } }
.coinfx { position: fixed; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; pointer-events: none; z-index: 60;
  background: radial-gradient(circle at 35% 30%, #fff6c4, #f2c14e 45%, #b8862a 80%); box-shadow: inset 0 0 0 2px #a37620, 0 2px 4px rgba(0,0,0,.4); }
.barsfx { position: absolute; z-index: 6; pointer-events: none; overflow: hidden; }
.barsfx::before { content: ""; position: absolute; inset: 0; transform: translateY(-105%); animation: barsdown 1.7s cubic-bezier(.5,0,.6,1.4) forwards;
  background: repeating-linear-gradient(90deg, transparent 0 9%, #3a3a3e 9% 13%, #8d8d95 13% 14%, transparent 14% 20%),
    linear-gradient(transparent 0 6%, #3a3a3e 6% 10%, transparent 10% 90%, #3a3a3e 90% 94%, transparent 94%); }
@keyframes barsdown { 0% { transform: translateY(-105%); } 22% { transform: translateY(0); } 80% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(0); opacity: 0; } }
.bar > span.drop { animation: dropin .5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes dropin { 0% { transform: translateY(-260%) scale(1.4); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .moment * { transition: none !important; } .bar > span.drop, .barsfx::before, .plaqueglow { animation: none; } }
.endstats { list-style: none; margin: 4px 0 14px; padding: 10px 12px; display: grid; gap: 6px; background: rgba(43,29,18,.06); border-radius: 10px; }
.endstats li { display: grid; grid-template-columns: 1.6em 9.5em 1fr; gap: 6px; align-items: baseline; font-size: .9rem; }
.endstats .ek { color: var(--muted-ink, #6b5a44); font-weight: 600; }
.endstats .ev { font-weight: 600; }
@media (max-width: 520px) { .endstats li { grid-template-columns: 1.6em 1fr; } .endstats .ev { grid-column: 2; } }

/* link back to the punatic.org home page (title screen and results box) */
.homerow { display: flex; justify-content: center; margin: 4px 0 24px; }
.homelink { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 10px;
  background: #fbf6e9; color: #2b1d12; border: 2px solid #2b1d12; font: 700 .95rem var(--sans); text-decoration: none; box-shadow: 0 2px 0 #2b1d12; }
.homelink:hover { background: #fff; } .homelink:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
#endDlg { width: min(520px, 94vw); }
#endDlg .win-art { aspect-ratio: 16 / 6; object-position: center 30%; }
#endDlg .row { flex-wrap: wrap; gap: 8px; }
#endDlg .row .homelink { flex: 1 0 100%; }
@media (max-width: 520px) {
  #endDlg .win-art { aspect-ratio: 16 / 4.5; }
  #endDlg .row button { padding-inline: 10px; font-size: .86rem; }
}
