/* ==========================================================================
   Parsel — "deed cards on a tiled café table".
   A deep turquoise table with a faint çini star pattern; cream printed cards
   with heavy ink lines, colour bands and city stickers; pastel banknotes with
   slab numerals; ink-black action cards. Animations move transform/opacity only.
   ========================================================================== */

:root {
  --table: #0f3b3a;
  --table-2: #0a2a29;
  --paper: #fbf6ea;
  --paper-2: #efe6d0;
  --ink: #1b1d1f;
  --ink-2: #4a4f52;
  --muted: #9fc3bd;
  --saffron: #f6c445;
  --saffron-d: #b98a12;
  --red: #e5484d;
  --red-d: #9b1f24;
  --mint: #36c2b4;
  --slab: "Alfa Slab One", "Rockwell", Georgia, serif;
  --cond: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font: 500 16px/1.4 var(--body);
  color: var(--paper);
  background:
    radial-gradient(130% 80% at 50% 40%, transparent 55%, rgba(0, 0, 0, .35)),
    radial-gradient(circle, rgba(246, 196, 69, .07) 0 2px, transparent 2.5px) 0 0 / 32px 32px,
    conic-gradient(from 45deg, rgba(255, 255, 255, .035) 0 25%, transparent 0 50%, rgba(255, 255, 255, .035) 0 75%, transparent 0) 0 0 / 64px 64px,
    linear-gradient(180deg, var(--table), var(--table-2));
  background-attachment: fixed;
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }

/* ------------------------------------------------------------------ cards */
.card {
  --w: 72px;
  position: relative; flex: none;
  width: var(--w); height: calc(var(--w) * 1.42);
  border-radius: calc(var(--w) * .09);
  background: var(--paper); color: var(--ink);
  border: max(1.5px, calc(var(--w) * .028)) solid var(--ink);
  box-shadow: 0 calc(var(--w) * .035) 0 var(--ink), 0 calc(var(--w) * .08) calc(var(--w) * .16) rgba(0, 0, 0, .28);
  overflow: hidden;
  font-family: var(--cond);
  display: flex; flex-direction: column;
}
.card .val {
  position: absolute; left: calc(var(--w) * .04); top: calc(var(--w) * .04); z-index: 2;
  min-width: calc(var(--w) * .26); height: calc(var(--w) * .26); padding: 0 calc(var(--w) * .03);
  border-radius: 999px; display: grid; place-items: center;
  background: var(--paper); color: var(--ink); border: max(1px, calc(var(--w) * .02)) solid var(--ink);
  font: 400 calc(var(--w) * .13)/1 var(--slab);
}
/* deeds */
.k-prop .band, .k-wild .band {
  height: 27%; display: grid; place-items: center; padding: 0 6% 0 30%;
  background: var(--gc); color: #fff; border-bottom: max(1px, calc(var(--w) * .025)) solid var(--ink);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .45);
}
.k-prop .band b, .k-wild .band b { font: 800 calc(var(--w) * .145)/1 var(--cond); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.k-prop .pic, .k-wild .pic { flex: 1; display: grid; place-items: center; min-height: 0; background: radial-gradient(circle at 50% 55%, #fff, var(--paper) 70%); }
.k-prop .pic .art { width: 58%; height: auto; }
.k-wild .pic .ico { width: 44%; height: auto; fill: none; stroke: var(--ink); stroke-width: 2; }
.card .rent { display: grid; gap: 1px; padding: 4% 8% 6%; font: 700 calc(var(--w) * .095)/1.1 var(--cond); color: var(--ink-2); border-top: 1px dashed rgba(0, 0, 0, .2); }
.card .rent i { font-style: normal; display: flex; justify-content: space-between; }
.card .rent i span { color: var(--ink); }
.card .rent.two { grid-template-columns: 1fr 1fr; gap: 6%; }
.card .rent.two > div { border-top: calc(var(--w) * .03) solid var(--c); padding-top: 2px; display: grid; }
.k-wild .band { background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50%); }
.k-wild.placed { box-shadow: inset 0 0 0 calc(var(--w) * .05) var(--gc), 0 calc(var(--w) * .035) 0 var(--ink); }
.k-wild.rainbow .band { background: linear-gradient(90deg, #8b5e3c, #5fb0d6, #cc4d8c, #e8862a, #d6453a, #dfa521, #3a9a5e, #2d4f92); }
.k-wild.rainbow .rent { font-size: calc(var(--w) * .09); text-align: center; }
/* money: pastel banknotes */
.k-money { padding: calc(var(--w) * .05); background: var(--note); }
.k-money .note {
  flex: 1; position: relative; display: grid; place-items: center; border-radius: calc(var(--w) * .05);
  border: max(1px, calc(var(--w) * .018)) dashed rgba(0, 0, 0, .35);
  background:
    repeating-radial-gradient(circle at 50% 46%, transparent 0 calc(var(--w) * .05), rgba(0, 0, 0, .06) calc(var(--w) * .05) calc(var(--w) * .058)),
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, .7), transparent 60%);
}
.k-money .note b { font: 400 calc(var(--w) * .32)/1 var(--slab); color: var(--ink); text-shadow: 0 calc(var(--w) * .025) 0 rgba(255, 255, 255, .7); }
.k-money .note small { position: absolute; bottom: 8%; font: 800 calc(var(--w) * .075)/1 var(--cond); letter-spacing: .14em; color: rgba(0, 0, 0, .55); }
.k-money .corner { position: absolute; left: 7%; top: 5%; font: 400 calc(var(--w) * .12)/1 var(--slab); color: rgba(0, 0, 0, .6); }
.k-money .corner.br { left: auto; top: auto; right: 7%; bottom: 5%; transform: rotate(180deg); }
.k-money.n1 { --note: #efe2c4; } .k-money.n2 { --note: #f6c6c8; } .k-money.n3 { --note: #c8e7c2; }
.k-money.n4 { --note: #c3dbf2; } .k-money.n5 { --note: #dacbf3; } .k-money.n10 { --note: #f5cf7e; }
/* actions: ink cards with a coloured emblem */
.k-action { background: #1f2a2b; color: var(--paper); align-items: center; text-align: center; }
.k-action .top, .k-rent .top { margin-top: 8%; font: 800 calc(var(--w) * .085)/1 var(--cond); letter-spacing: .2em; opacity: .7; }
.k-action .emb { margin: 7% 0 5%; width: 46%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: var(--ac, var(--saffron)); border: max(1.5px, calc(var(--w) * .025)) solid var(--paper); box-shadow: 0 calc(var(--w) * .03) 0 #000; }
.k-action .emb .ico { width: 64%; height: 64%; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.k-action .nm, .k-rent .nm { font: 800 calc(var(--w) * .15)/1 var(--cond); text-transform: uppercase; letter-spacing: .02em; padding: 0 6%; }
.k-action .tx, .k-rent .tx { margin-top: 4%; padding: 0 8%; font: 600 calc(var(--w) * .095)/1.1 var(--cond); opacity: .8; }
.a-breaker { --ac: #e5484d; } .a-no { --ac: #f6c445; } .a-sly { --ac: #9b8cf2; } .a-forced { --ac: #5aa9ff; } .a-debt { --ac: #ef8a3c; }
.a-birthday { --ac: #f29ac3; } .a-passgo { --ac: #6fd28a; } .a-house { --ac: #3fb36b; } .a-hotel { --ac: #e5484d; } .a-double { --ac: #f6c445; }
.a-no { background: #3a1416; }
/* rent */
.k-rent { align-items: center; text-align: center; background: var(--paper); }
.k-rent .top { color: var(--ink); }
.k-rent .disc { margin: 6% 0 5%; width: 50%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: max(1.5px, calc(var(--w) * .028)) solid var(--ink); box-shadow: 0 calc(var(--w) * .03) 0 var(--ink); }
.k-rent .disc .ico { width: 54%; height: 54%; padding: 6%; border-radius: 50%; background: var(--paper); fill: none; stroke: var(--ink); stroke-width: 2.2; }
/* back */
.card.back { background: var(--table); border-color: var(--ink); }
.card.back .bk { flex: 1; margin: 7%; border-radius: calc(var(--w) * .05); display: grid; place-items: center; border: max(1px, calc(var(--w) * .02)) solid rgba(246, 196, 69, .7);
  background: conic-gradient(from 45deg, rgba(246, 196, 69, .16) 0 25%, transparent 0 50%, rgba(246, 196, 69, .16) 0 75%, transparent 0) 0 0 / calc(var(--w) * .2) calc(var(--w) * .2); }
.card.back .bk b { font: 400 calc(var(--w) * .34)/1 var(--slab); color: var(--saffron); text-shadow: 0 2px 0 #000; }
/* sizes and states */
.card.mini { --w: 46px; }
.card.mini .rent, .card.mini .tx, .card.mini .top { display: none; }
.card.mini .band b { font-size: calc(var(--w) * .16); }
.card.big { --w: 112px; }
.card.sel { outline: 3px solid var(--saffron); outline-offset: 2px; }

/* ------------------------------------------------------------------ menu + lobby */
.screen { position: fixed; inset: 0; overflow-y: auto; padding: calc(var(--safe-t) + 10px) 18px calc(var(--safe-b) + 18px); }
#menu, #lobby { display: flex; flex-direction: column; max-width: 440px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.tools { display: flex; gap: 8px; }
.link { background: none; border: 0; color: var(--muted); font: 600 15px var(--body); text-decoration: none; padding: 10px 2px; }
.link.center { align-self: center; margin-top: 10px; text-decoration: underline; text-underline-offset: 4px; }
.chip { min-width: 44px; height: 44px; padding: 0 12px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .15); font: 800 15px var(--cond); letter-spacing: .08em; }
.hero { position: relative; height: 200px; margin-top: 0; }
.hero .fan { position: absolute; left: 50%; top: 22px; transform-origin: 50% 160%; transform: translateX(-50%) rotate(calc((var(--k) - 1.5) * 13deg)); animation: deal .6s cubic-bezier(.2, 1.3, .4, 1) both; animation-delay: calc(var(--k) * 90ms); }
.hero .fan .card { --w: 80px; }
@keyframes deal { from { transform: translateX(-50%) translateY(80px) rotate(0); opacity: 0; } }
.logo { margin: 4px 0 0; text-align: center; font: 400 clamp(46px, 15vw, 64px)/1 var(--slab); letter-spacing: .03em; color: var(--paper); text-shadow: 0 5px 0 var(--ink), 0 10px 22px rgba(0, 0, 0, .35); }
.logo.small { font-size: 38px; margin-bottom: 8px; }
.stripes { display: grid; grid-template-columns: repeat(10, 1fr); width: 70%; height: 8px; margin: 12px auto 0; border-radius: 4px; overflow: hidden; box-shadow: 0 3px 0 var(--ink); }
.stripes i:nth-child(1) { background: #8b5e3c; } .stripes i:nth-child(2) { background: #5fb0d6; } .stripes i:nth-child(3) { background: #cc4d8c; } .stripes i:nth-child(4) { background: #e8862a; } .stripes i:nth-child(5) { background: #d6453a; }
.stripes i:nth-child(6) { background: #dfa521; } .stripes i:nth-child(7) { background: #3a9a5e; } .stripes i:nth-child(8) { background: #2d4f92; } .stripes i:nth-child(9) { background: #2a2d33; } .stripes i:nth-child(10) { background: #8b8f98; }
.tagline { text-align: center; margin: 12px 0 14px; color: var(--muted); font: 700 17px var(--cond); letter-spacing: .08em; text-transform: uppercase; }
.label { display: block; margin: 14px 2px 8px; font: 800 13px var(--cond); letter-spacing: .2em; text-transform: uppercase; color: var(--saffron); }
.input { width: 100%; height: 52px; padding: 0 16px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .22); color: var(--paper); font-size: 18px; font-weight: 700; outline: none; }
.input:focus { border-color: var(--saffron); }
.input.code { text-align: center; font: 400 28px var(--slab); letter-spacing: .3em; padding-left: .3em; }
.seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.seg button { min-height: 54px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .2); font: 400 24px var(--slab); }
.seg button.on { border-color: var(--ink); background: var(--saffron); color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.actions { display: grid; gap: 10px; margin-top: 22px; }
.btn {
  min-height: 48px; padding: 0 16px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .18);
  font: 800 18px var(--cond); letter-spacing: .05em; text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .1s;
}
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .45; }
.btn.primary { border-color: var(--ink); background: var(--saffron); color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.btn.danger { border-color: var(--ink); background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--ink); }
.btn.on { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn.big { min-height: 60px; font-size: 22px; }
.btn .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.or { text-align: center; color: var(--muted); margin: 18px 0 10px; font: 700 14px var(--cond); letter-spacing: .14em; text-transform: uppercase; }
.join { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.room-code { display: flex; flex-direction: column; align-items: center; margin: 8px 0 10px; color: var(--muted); font: 800 13px var(--cond); letter-spacing: .24em; text-transform: uppercase; }
.room-code b { font: 400 60px/1.05 var(--slab); letter-spacing: .12em; color: var(--paper); text-shadow: 0 4px 0 var(--ink); }
#btnShare { align-self: center; }
.seats { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.seats li { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 14px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font: 800 20px var(--cond); }
.seats li .av, .who .av, .whob .av { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--pc); color: var(--ink); border: 2px solid var(--ink); font: 400 15px var(--slab); }
.seats li small { margin-left: auto; color: var(--ink-2); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.seats li.bot { background: var(--paper-2); }
.seats li.you { outline: 3px solid var(--saffron); }
.botbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
[data-pane="room"] { display: flex; flex-direction: column; padding-bottom: 76px; }
[data-pane="room"] .btn { width: 100%; }
#btnShare { width: auto !important; }
#btnStart { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 14px); z-index: 5; width: min(404px, calc(100vw - 36px)) !important; transform: translateX(-50%); box-shadow: 0 4px 0 var(--ink), 0 10px 30px rgba(0, 0, 0, .45); }
#btnStart:active { transform: translateX(-50%) translateY(2px); }
.hint { text-align: center; color: var(--muted); margin: 12px 0 0; }
.msg { text-align: center; min-height: 22px; color: var(--saffron); margin: 14px 0 0; font-weight: 700; }

/* ------------------------------------------------------------------ game */
#game { padding: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; height: 100dvh; overflow: hidden; }
.top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; padding: calc(var(--safe-t) + 6px) 10px 2px; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .2); font-size: 18px; color: var(--muted); }
.status { text-align: center; line-height: 1.05; }
.status b { display: block; font: 800 19px var(--cond); letter-spacing: .04em; text-transform: uppercase; }
.status b.you { color: var(--saffron); }
.status small { font: 700 13px var(--cond); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }

.plates { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 6px; padding: 4px 8px; }
.plates[data-n="1"] { --cols: 1; } .plates[data-n="2"] { --cols: 2; } .plates[data-n="3"] { --cols: 3; } .plates[data-n="4"] { --cols: 4; }
.plate { position: relative; min-width: 0; padding: 6px 7px 7px; border-radius: 12px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); cursor: pointer; transition: transform .2s, box-shadow .2s; }
.plate::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: 10px 0 0 10px; background: var(--pc); }
.plate .who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.plate .who .av { width: 24px; height: 24px; font-size: 12px; }
.plate .who b { font: 800 16px/1 var(--cond); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate .meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font: 800 14px/1 var(--cond); }
.plate .hc { display: inline-flex; align-items: center; gap: 3px; }
.plate .hc i { width: 9px; height: 13px; border-radius: 2px; background: var(--table); border: 1.5px solid var(--ink); }
.plate .bk { color: #1c7a43; }
.plate .stars { margin-left: auto; color: var(--saffron-d); letter-spacing: -.05em; }
.plate .msets { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; min-height: 9px; }
.ms { display: inline-flex; gap: 1px; padding: 1px; border-radius: 3px; background: rgba(0, 0, 0, .12); position: relative; }
.ms s { width: 5px; height: 7px; border-radius: 1px; background: rgba(0, 0, 0, .14); }
.ms s.on { background: var(--gc); }
.ms.full { background: var(--ink); box-shadow: 0 0 0 1.5px var(--saffron); }
.ms u { position: absolute; right: -3px; top: -4px; width: 6px; height: 6px; border-radius: 1px; background: #3fb36b; border: 1px solid var(--ink); }
@media (max-width: 360px) {
  .hand .card { --w: 70px; margin: 0 calc(-1 * max(0px, (var(--n) * 70px - 100cqw) / (2 * (var(--n) - 1)))); }
}
@media (max-width: 420px) {
  .plates[data-n="4"] .plate .who .av, .plates[data-n="3"] .plate .who .av { display: none; }
  .plates[data-n="4"] .plate { padding-left: 9px; }
  .plates[data-n="4"] .plate .who b { font-size: 15px; }
  .plates[data-n="4"] .plate .meta { gap: 4px; font-size: 13px; }
}
.plate.on { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink), 0 0 0 3px var(--pc); }
.plate.on::after { content: ""; position: absolute; right: 7px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--pc); border: 1.5px solid var(--ink); animation: pulse 1s ease-in-out infinite; }
.plate.away { opacity: .6; }
.plate.away .who b::after { content: " ⚡"; }
.plate.won { box-shadow: 0 0 0 3px var(--saffron), 0 3px 0 var(--ink); }
@keyframes pulse { 50% { opacity: .3; } }

.center { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 6px 10px; min-height: 120px; }
.pile { position: relative; }
.pile .card { --w: 70px; }
.deck .card { box-shadow: 0 2px 0 var(--ink), 3px 5px 0 -1px var(--table-2), 3px 5px 0 1px var(--ink), 6px 9px 0 -1px var(--table-2), 6px 9px 0 1px var(--ink); }
.deck.empty .card { opacity: .3; }
.deck .cnt { position: absolute; right: -8px; bottom: -6px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; display: grid; place-items: center; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); font: 400 13px var(--slab); }
.discard { width: 70px; height: 100px; border-radius: 6px; border: 2px dashed rgba(255, 255, 255, .2); }
.discard .card { position: absolute; left: -2px; top: -2px; transform: rotate(4deg); }
.turnbox { display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity .25s, transform .25s; }
.turnbox.on { opacity: 1; pointer-events: auto; transform: none; }
.pips { display: flex; gap: 6px; }
.pips i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--paper); background: transparent; transition: background .2s, transform .2s; }
.pips i.on { background: var(--saffron); border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.btn.end { min-height: 44px; font-size: 16px; padding: 0 14px; background: var(--paper); color: var(--ink); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.stage { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .2s; z-index: 20; }
.stage.show { opacity: 1; }
.ann { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 16px; background: rgba(10, 26, 26, .92); border: 2px solid var(--pc); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); max-width: calc(100vw - 24px); animation: annIn .3s cubic-bezier(.2, 1.4, .4, 1); position: relative; }
.ann .who { position: absolute; left: 12px; top: -12px; padding: 2px 10px; border-radius: 8px; background: var(--pc); color: var(--ink); border: 2px solid var(--ink); font: 800 14px var(--cond); text-transform: uppercase; }
.ann .card.big { --w: 84px; transform: rotate(-4deg); }
.ann .line { display: flex; flex-direction: column; min-width: 0; }
.ann .line b { font: 400 21px/1.1 var(--slab); color: var(--paper); }
.ann .line small { font: 700 16px/1.2 var(--cond); color: var(--muted); letter-spacing: .03em; }
@keyframes annIn { from { transform: scale(.7); opacity: 0; } }
.stamp { position: absolute; left: 50%; top: 50%; z-index: 30; padding: 6px 18px 4px; border: 5px solid var(--red); border-radius: 12px; color: var(--red); background: rgba(251, 246, 234, .95); font: 400 40px/1 var(--slab); letter-spacing: .04em; white-space: nowrap; box-shadow: 0 0 0 3px var(--ink), 0 14px 30px rgba(0, 0, 0, .5); pointer-events: none; }
.stamp.back { color: #1c7a43; border-color: #1c7a43; }
.stamp.big { font-size: 34px; color: var(--ink); border-color: var(--saffron); }

.mine { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; align-items: end; padding: 4px 10px; }
.mybank { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.mybank .stack { position: relative; width: 50px; height: 70px; border-radius: 6px; }
.mybank .stack.empty { border: 2px dashed rgba(255, 255, 255, .22); }
.mybank .stack .card { position: absolute; left: 0; top: 0; }
.mybank .stack i { position: absolute; left: 3px; top: 4px; width: 46px; height: 66px; border-radius: 5px; border: 2px solid var(--ink); background: var(--paper-2); z-index: -1; transform: rotate(-5deg); }
.bank-sum { text-align: center; line-height: 1; }
.bank-sum small { display: block; font: 800 11px var(--cond); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.bank-sum b { font: 400 22px var(--slab); color: var(--paper); text-shadow: 0 2px 0 var(--ink); }
.mysets { display: flex; gap: 8px; align-items: flex-end; overflow-x: auto; overflow-y: visible; padding: 14px 4px 4px; min-height: 118px; scrollbar-width: none; }
.mysets::-webkit-scrollbar { display: none; }
.set { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.set .cards { position: relative; width: 46px; height: calc(65px + (var(--m) - 1) * 15px); }
.set .cards .card { position: absolute; left: 0; top: calc(var(--j) * 15px); }
.set.full .cards::after { content: "★"; position: absolute; right: -8px; top: -10px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--saffron); color: var(--ink); border: 2px solid var(--ink); font-size: 12px; z-index: 5; }
.set.full .cards .card { box-shadow: 0 2px 0 var(--ink), 0 0 0 2px var(--saffron); }
.set .lbl { display: flex; align-items: center; gap: 4px; font: 800 12px/1 var(--cond); color: var(--muted); }
.set .lbl b { color: var(--paper); }
.set .bld { width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; border: 1.5px solid var(--ink); }
.set .bld.house { background: #3fb36b; } .set .bld.hotel { background: var(--red); }
.set .bld .ico { width: 12px; height: 12px; fill: none; stroke: var(--ink); stroke-width: 2.4; }
.empty-note { margin: 0; align-self: center; color: var(--muted); font: 600 14px var(--body); opacity: .8; }

.handbar { min-height: 0; padding: 0 10px; transform: translateY(8px); opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; }
.handbar.show { opacity: 1; transform: none; pointer-events: auto; padding-top: 4px; }
.handbar .hint { margin: 0 0 6px; font: 600 14px var(--body); color: var(--muted); text-align: center; }
.handbar .opts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.handbar .btn { min-height: 44px; font-size: 16px; padding: 0 12px; background: var(--paper); color: var(--ink); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.handbar .btn.primary { background: var(--saffron); }
.handbar .btn.on { background: var(--ink); color: var(--saffron); }
.sw { width: 14px; height: 14px; border-radius: 4px; background: var(--gc); border: 1.5px solid var(--ink); flex: none; }

.hand { container-type: inline-size; display: flex; justify-content: center; align-items: flex-end; padding: 10px 12px calc(var(--safe-b) + 10px); min-height: 136px; }
.hand .card { --w: 84px; margin: 0 calc(-1 * max(0px, (var(--n) * 84px - 100cqw) / (2 * (var(--n) - 1)))); transition: transform .18s, filter .2s; transform-origin: 50% 120%; filter: saturate(.75) brightness(.9); }
.hand.live .card { filter: none; cursor: pointer; }
.hand.live .card:hover { transform: translateY(-6px); }
.hand .card.sel { transform: translateY(-18px) scale(1.05); z-index: 5; filter: none; }
.hand .empty-note { margin: auto; }

.chatbar { position: fixed; left: 8px; right: 8px; bottom: calc(var(--safe-b) + 8px); z-index: 60; padding: 10px; border-radius: 16px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
.chatbar .quick { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; }
.chatbar .quick .chip { flex: none; background: var(--paper-2); border-color: var(--ink); color: var(--ink); font-size: 14px; }
.chatbar .row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.chatbar .input { background: #fff; color: var(--ink); border-color: var(--ink); font-size: 16px; height: 46px; }
.say { position: fixed; z-index: 70; transform: translate(-50%, 0); max-width: 220px; padding: 7px 12px; border-radius: 14px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink), 0 0 0 3px var(--pc); font: 700 15px/1.2 var(--body); animation: say 3.6s ease-out forwards; pointer-events: none; }
.say.me { transform: translate(-50%, -100%); }
@keyframes say { 0% { opacity: 0; margin-top: 8px; } 8%, 85% { opacity: 1; margin-top: 0; } 100% { opacity: 0; } }
.net { position: fixed; left: 50%; top: calc(var(--safe-t) + 56px); transform: translateX(-50%); z-index: 75; padding: 8px 14px; border-radius: 10px; background: var(--saffron); color: var(--ink); font: 800 15px var(--cond); border: 2px solid var(--ink); }

/* ------------------------------------------------------------------ effects */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 80; }
.flyer { position: fixed; left: 0; top: 0; will-change: transform; }
.flyer .card { --w: inherit; }
.floater { position: fixed; transform: translate(-50%, -50%); font: 400 20px var(--slab); color: var(--paper); text-shadow: 0 2px 0 var(--ink); white-space: nowrap; animation: float 1.2s ease-out forwards; }
.floater.plus { color: #7ef0a6; } .floater.minus { color: #ff9b97; }
.floater.set { color: var(--saffron); font-size: 22px; }
@keyframes float { from { opacity: 0; margin-top: 10px; } 15% { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -40px; } }
.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 60px); z-index: 90; transform: translateX(-50%); max-width: calc(100vw - 24px); padding: 10px 16px; border-radius: 12px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 4px 0 var(--ink); font: 800 16px var(--cond); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: toast 1.8s ease-out forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -8px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.banner { position: fixed; left: 50%; top: 40%; z-index: 85; transform: translate(-50%, -50%) rotate(-3deg); padding: 12px 26px 10px; border-radius: 8px; background: var(--saffron); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); font: 400 30px/1 var(--slab); white-space: nowrap; pointer-events: none; animation: banner 1.3s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-3deg) scale(.6); } 18%, 75% { opacity: 1; transform: translate(-50%, -50%) rotate(-3deg) scale(1); } 100% { opacity: 0; transform: translate(-50%, -60%) rotate(-3deg) scale(.95); } }
.confetti { position: fixed; top: -12px; width: 9px; height: 14px; border-radius: 2px; z-index: 95; animation: fall 2.8s cubic-bezier(.3, .4, .6, 1) forwards; }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(var(--r)); } }

/* ------------------------------------------------------------------ sheets */
.sheet { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(4, 16, 16, .5); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet .panel { width: 100%; max-width: 480px; max-height: 88dvh; overflow: auto; padding: 18px 16px calc(var(--safe-b) + 16px); border-radius: 22px 22px 0 0; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-bottom: 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, .45); animation: up .3s cubic-bezier(.2, 1, .3, 1); }
@keyframes up { from { transform: translateY(100%); } }
.panel h2 { margin: 0 0 6px; font: 400 26px/1.1 var(--slab); }
.panel h2.tname { padding-left: 12px; border-left: 6px solid var(--pc); }
.panel h4 { margin: 12px 0 6px; font: 800 13px var(--cond); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.panel p { margin: 0 0 6px; }
.panel .sub { color: var(--ink-2); }
.panel .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.panel .row:has(> :only-child) { grid-template-columns: 1fr; }
.panel .btn { color: var(--ink); border-color: var(--ink); background: var(--paper-2); }
.panel .btn.primary { background: var(--saffron); }
.panel .btn.danger { background: var(--red); color: #fff; }
.pick-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; }
.pick-row.wrap { flex-wrap: wrap; overflow: visible; justify-content: center; }
.pick-sets { display: flex; gap: 10px; flex-wrap: wrap; }
.pset { position: relative; display: flex; gap: 4px; padding: 6px; border-radius: 12px; background: color-mix(in srgb, var(--gc) 18%, transparent); border: 2px solid color-mix(in srgb, var(--gc) 70%, var(--ink)); }
.pset.full { box-shadow: 0 0 0 3px var(--saffron); }
.pset.whole { cursor: pointer; padding-bottom: 26px; }
.pset .tag { position: absolute; left: 8px; bottom: 5px; font: 800 13px var(--cond); text-transform: uppercase; }
.pc { padding: 0; border: 0; background: none; border-radius: 8px; position: relative; }
.pc .card { --w: 58px; }
button.pc { transition: transform .12s; }
button.pc.on { transform: translateY(-6px); }
button.pc.on::after { content: "✓"; position: absolute; right: -4px; top: -6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--saffron); border: 2px solid var(--ink); font-weight: 800; font-size: 13px; z-index: 3; }
button.pc:disabled { opacity: .45; }
.paybar { position: sticky; bottom: -16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px -16px -16px; padding: 12px 16px calc(var(--safe-b) + 12px); background: var(--paper-2); border-top: 2px solid var(--ink); font: 800 18px var(--cond); }
.paybar .ok { color: #1c7a43; }
.who-list { display: grid; gap: 8px; margin-top: 8px; }
.whob { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--ink); background: #fff; box-shadow: 0 3px 0 var(--ink); font: 800 20px var(--cond); text-align: left; }
.whob small { margin-left: auto; color: var(--ink-2); font-size: 16px; }
.ask-no { text-align: center; }
.ask-no .lead { display: grid; place-items: center; margin: 2px 0 12px; }
.ask-no .lead .card { --w: 78px; transform: rotate(-6deg); }
.result { text-align: center; }
.result .medal { width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; background: var(--saffron); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); }
.result.lost .medal { background: var(--paper-2); }
.result .pick-sets { justify-content: center; margin-top: 10px; }
.rules ul { padding-left: 18px; margin: 8px 0 0; } .rules li { margin: 6px 0; }

@media (min-width: 760px) {
  #game { max-width: 760px; margin: 0 auto; }
  .hand .card { --w: 92px; margin: 0 calc(-1 * max(0px, (var(--n) * 92px - 100cqw) / (2 * (var(--n) - 1)))); }
  .center { min-height: 170px; }
  .pile .card { --w: 76px; }
  .discard { width: 76px; height: 108px; }
}
/* big screens: the same table, scaled up (flights measure the scaled layout, so they still land right) */
@media (min-width: 1000px) and (min-height: 700px) {
  #game { zoom: 1.3; height: calc(100dvh / 1.3); }
}
@media (min-width: 1400px) and (min-height: 900px) {
  #game { zoom: 1.5; height: calc(100dvh / 1.5); }
}
@media (prefers-reduced-motion: reduce) { .hero .fan, .ann, .say, .banner { animation: none !important; } }
