:root {
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ink: #1f2d3a;
  --ink-2: #44525f;
  --mute: #8794a1;
  --line: #e6e9ee;
  --line-2: #d9dee5;
  --panel: #ffffff;
  --panel-2: #f5f7fa;
  --panel-3: #eef1f5;
  --sea-1: #5fb3e2;
  --sea-2: #3a8fc8;
  --sea-3: #2a73a9;
  --accent: #ffb020;
  --accent-ink: #4a3000;
  --accent-2: #ffc95c;
  --good: #22a55b;
  --bad: #e5484d;
  --p0: #e5484d;
  --p1: #3e7bfa;
  --p2: #f08c00;
  --p3: #2f9e44;
  --r0: #3f8f4f;
  --r1: #c9573c;
  --r2: #8fc356;
  --r3: #eec043;
  --r4: #8592a6;
  --radius: 14px;
  --shadow-1: 0 1px 2px rgba(16, 32, 48, .06), 0 2px 8px rgba(16, 32, 48, .06);
  --shadow-2: 0 4px 12px rgba(16, 32, 48, .1), 0 12px 32px rgba(16, 32, 48, .12);
  --dock-h: 128px;
  --side-w: 340px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 600 14px/1.35 var(--font); color: var(--ink); background: var(--sea-2); overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
button:focus-visible { outline: 3px solid rgba(62, 123, 250, .5); outline-offset: 2px; }
.hidden { display: none !important; }
.i { width: 1em; height: 1em; fill: currentColor; flex: none; display: inline-block; vertical-align: -0.14em; }

#app { display: grid; grid-template-columns: 1fr var(--side-w); grid-template-rows: 1fr var(--dock-h); height: 100vh; }

/* ---------- Table ---------- */
#table { grid-column: 1; grid-row: 1; position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 45%, var(--sea-1) 0%, var(--sea-2) 55%, var(--sea-3) 100%); }
#table::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 2px, transparent 2px 22px); }
#board { position: absolute; inset: 56px 12px 8px; width: calc(100% - 24px); height: calc(100% - 64px); display: block; }
.topbar { position: absolute; top: 12px; left: 14px; right: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; z-index: 5; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 19px; background: rgba(255,255,255,.92); box-shadow: var(--shadow-1); font-weight: 800; color: var(--ink-2); transition: background .15s, transform .15s; }
.pill-btn:hover { background: #fff; transform: translateY(-1px); }
.pill-btn .i { font-size: 18px; }
.status { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 18px; border-radius: 20px; background: rgba(255,255,255,.95); box-shadow: var(--shadow-1); font-weight: 800; font-size: 15px; max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .2s, color .2s; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mute); flex: none; }
.status.mine { background: var(--accent); color: var(--accent-ink); }
.status.mine .status-dot { background: var(--accent-ink); animation: breathe 1.4s ease-in-out infinite; }
.status.waiting .status-dot { animation: breathe 1s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
.bank { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 10px; border-radius: 19px; background: rgba(255,255,255,.92); box-shadow: var(--shadow-1); }
.bank .lbl { color: var(--mute); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; }
.bank .b { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 800; color: var(--ink-2); padding: 0 3px; }

/* Board elements */
.coast { fill: #f0deaa; }
.shallow { fill: rgba(255,255,255,.18); }
.tile { stroke: rgba(0,0,0,.18); stroke-width: .018; }
.tile-shade { fill: url(#g-tile); pointer-events: none; }
.deco { pointer-events: none; }
.tile-g.hit .tile { stroke: #fff; stroke-width: .08; animation: hit 1.6s ease-out; }
@keyframes hit { 0% { stroke-opacity: 1; } 100% { stroke-opacity: 0; } }
.token-disc { fill: url(#g-token); stroke: #d6c7a0; stroke-width: .018; }
.token-num { font-family: var(--font); font-weight: 900; text-anchor: middle; dominant-baseline: central; fill: #33302a; }
.token.hot .token-num, .token.hot .pip { fill: #d23b30; }
.pip { fill: #33302a; }
.token.blocked { opacity: .55; }
.port-plank { stroke: #a57a4a; stroke-width: .075; stroke-linecap: round; }
.port-disc { fill: #fffaf0; stroke: #a57a4a; stroke-width: .03; }
.port-ratio { font-family: var(--font); font-weight: 900; text-anchor: middle; dominant-baseline: central; fill: #5a4026; }
.road-edge { stroke-linecap: round; }
.piece { stroke-linejoin: round; }
.robber { pointer-events: none; }
.spot-g { cursor: pointer; }
.spot-dot { fill: #fff; stroke: rgba(31,45,58,.35); stroke-width: .025; transition: r .12s; animation: spotpulse 1.4s ease-in-out infinite; }
.spot-ring { fill: none; stroke: #fff; stroke-width: .03; opacity: .9; animation: ring 1.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ring { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes spotpulse { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.spot-edge { stroke: #fff; stroke-opacity: .65; stroke-linecap: round; stroke-dasharray: .06 .07; animation: spotpulse 1.4s ease-in-out infinite; }
.spot-hit { fill: transparent; stroke: transparent; }
.ghost-piece { opacity: 0; transition: opacity .12s; pointer-events: none; }
.spot-g:hover .ghost-piece { opacity: .9; }
.spot-g:hover .spot-dot, .spot-g:hover .spot-ring, .spot-g:hover .spot-edge { opacity: 0; animation: none; }
.spot-hex { fill: rgba(255,255,255,.12); stroke: #fff; stroke-width: .05; stroke-dasharray: .12 .08; animation: spotpulse 1.4s ease-in-out infinite; }
.spot-g:hover .spot-hex { fill: rgba(255,255,255,.3); animation: none; }
.pop { animation: pop .55s cubic-bezier(.2, 1.6, .4, 1); transform-box: fill-box; transform-origin: center bottom; }
@keyframes pop { 0% { transform: scale(.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.roll-flash { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; pointer-events: none;
  background: rgba(255,255,255,.95); border-radius: 22px; padding: 10px 22px; box-shadow: var(--shadow-2); display: flex; align-items: center; gap: 12px; animation: flash 1.4s ease-out forwards; }
.roll-flash .num { font-size: 44px; font-weight: 900; line-height: 1; }
.roll-flash .who { font-size: 13px; color: var(--mute); font-weight: 800; }
.roll-flash.seven .num { color: var(--bad); }
@keyframes flash { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.8); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -55%); } }

/* Offer card (a bot offers you a trade) */
.offer-card { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); z-index: 6; background: #fff; border-radius: 16px; box-shadow: var(--shadow-2); padding: 14px 16px; min-width: 320px; animation: slidein .25s ease-out; }
@keyframes slidein { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.offer-card .head { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 10px; }
.offer-card .swap { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-bottom: 12px; }
.offer-card .side-lbl { font-size: 11px; color: var(--mute); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.offer-card .arrow { color: var(--mute); font-size: 20px; }
.offer-card .btns { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Side panel ---------- */
#side { grid-column: 2; grid-row: 1 / span 2; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; box-shadow: -4px 0 20px rgba(16,32,48,.08); z-index: 3; }
.players { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pcard { border-radius: var(--radius); background: var(--panel-2); padding: 10px 12px 10px 10px; display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; position: relative; border: 2px solid transparent; transition: border-color .2s, background .2s; }
.pcard.turn { border-color: var(--pc); background: #fff; box-shadow: var(--shadow-1); }
.pcard.me-card { background: #fff; }
.avatar { width: 44px; height: 44px; border-radius: 12px; background: var(--pc); display: grid; place-items: center; color: #fff; position: relative; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.avatar .i { font-size: 24px; }
.avatar .badge { position: absolute; bottom: -5px; right: -5px; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: var(--ink-2); font-size: 11px; font-weight: 900; display: grid; place-items: center; box-shadow: var(--shadow-1); }
.pname { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.pname .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pstats { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.pknown { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.kchip { min-width: 18px; height: 16px; padding: 0 4px; border-radius: 4px; color: #fff; font-size: 10.5px; font-weight: 900; display: inline-grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.kchip.unk { background: var(--panel-3); color: var(--ink-2); }
.stat { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--panel-3); color: var(--ink-2); font-size: 12px; font-weight: 800; }
.pcard.turn .stat, .pcard.me-card .stat { background: var(--panel-2); }
.stat .i { font-size: 13px; }
.stat.award { background: #fff2d6 !important; color: #8a5a00; }
.stat .mc { width: 9px; height: 12px; border-radius: 2px; background: #d9c49a; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.stat .mc.dev { background: #9b7fd1; }
.vpbox { text-align: center; min-width: 44px; }
.vpbox .v { font-size: 24px; font-weight: 900; line-height: 1; }
.vpbox .l { font-size: 10px; font-weight: 800; color: var(--mute); letter-spacing: .06em; }
.vpbar { position: absolute; left: 10px; right: 10px; bottom: 4px; height: 3px; border-radius: 2px; background: rgba(0,0,0,.05); overflow: hidden; }
.vpbar i { display: block; height: 100%; background: var(--pc); border-radius: 2px; transition: width .4s; }
.thinking { display: inline-flex; gap: 3px; margin-left: 2px; }
.thinking i { width: 5px; height: 5px; border-radius: 50%; background: var(--pc); animation: blink 1.1s infinite; }
.thinking i:nth-child(2) { animation-delay: .18s; } .thinking i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.answer { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11px; font-weight: 900; }
.answer.yes { background: #dcf5e6; color: #13703c; }
.answer.no { background: #fde4e4; color: #b4282d; }
.answer.wait { background: var(--panel-3); color: var(--mute); }

.log-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.side-title { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: var(--mute); padding: 12px 16px 6px; }
.log { flex: 1; overflow-y: auto; padding: 0 12px 16px; scroll-behavior: smooth; }
.log::-webkit-scrollbar { width: 8px; } .log::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.lturn { display: flex; align-items: center; gap: 8px; margin: 12px 4px 4px; font-size: 11px; font-weight: 900; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
.lturn::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lturn .dot { width: 8px; height: 8px; border-radius: 50%; }
.lrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 6px; border-radius: 8px; color: var(--ink-2); font-size: 13px; animation: fadein .25s ease-out; }
.lrow:hover { background: var(--panel-2); }
.lrow b.who { color: var(--pc); font-weight: 900; }
.lrow.note { color: var(--mute); font-size: 12px; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* resource chips (inline) */
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; color: #fff; font-size: 12px; font-weight: 900; box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); vertical-align: middle; }
.chip .i { font-size: 14px; }
.chip.lg { min-width: 36px; height: 36px; border-radius: 9px; font-size: 15px; padding: 0 8px; } .chip.lg .i { font-size: 22px; }
.r0 { background: var(--r0); } .r1 { background: var(--r1); } .r2 { background: var(--r2); } .r3 { background: var(--r3); } .r4 { background: var(--r4); }
.chips { display: inline-flex; gap: 3px; flex-wrap: wrap; }

/* ---------- Dock ---------- */
#dock { grid-column: 1; grid-row: 2; background: var(--panel); border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 0 18px; box-shadow: 0 -4px 20px rgba(16,32,48,.08); z-index: 4; }
.me { display: flex; align-items: center; gap: 10px; }
.me .avatar { width: 52px; height: 52px; border-radius: 14px; }
.me .avatar .i { font-size: 28px; }
.me .vp { font-size: 30px; font-weight: 900; line-height: 1; }
.me .vp small { font-size: 12px; color: var(--mute); font-weight: 800; margin-left: 2px; }
.me .sub { font-size: 12px; color: var(--mute); font-weight: 800; }
.hand { display: flex; align-items: flex-end; gap: 10px; align-self: stretch; min-width: 0; overflow-x: auto; padding: 14px 4px 8px; }
.hand-sep { width: 1px; align-self: stretch; background: var(--line); margin: 8px 6px; }
.rcard { width: 60px; height: 84px; border-radius: 10px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; flex: none;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.28), inset 0 -4px 0 rgba(0,0,0,.14), 0 2px 6px rgba(16,32,48,.15); transition: transform .15s, opacity .2s; user-select: none; }
.rcard .i { font-size: 32px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.2)); }
.rcard .nm { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; opacity: .92; }
.rcard .n { position: absolute; top: -9px; right: -9px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 900; display: grid; place-items: center; box-shadow: var(--shadow-1); }
.rcard.empty { opacity: .22; filter: saturate(.4); }
.rcard.empty .n { display: none; }
.rcard.gain { animation: gain .7s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes gain { 0% { transform: translateY(-18px) scale(1.06); } 100% { transform: none; } }
.rcard .plus { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); font-weight: 900; color: var(--good); font-size: 14px; animation: rise 1.2s ease-out forwards; }
@keyframes rise { 0% { opacity: 0; transform: translate(-50%, 6px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -12px); } }
.dcard { background: linear-gradient(160deg, #9c7fd6, #6a4fb0); }
.dcard.vp { background: linear-gradient(160deg, #f2b84b, #d48a12); }
.dcard.playable { cursor: pointer; box-shadow: 0 0 0 3px var(--accent), inset 0 -4px 0 rgba(0,0,0,.14), 0 4px 12px rgba(16,32,48,.2); }
.dcard.playable:hover { transform: translateY(-8px); }
.dcard.fresh { opacity: .5; }
.dcard .nm { font-size: 9px; text-align: center; line-height: 1.1; padding: 0 3px; }
.hand-empty { color: var(--mute); font-size: 14px; font-weight: 700; align-self: center; padding: 0 8px; }

.controls { display: flex; align-items: center; gap: 12px; }
.build { display: flex; gap: 6px; }
.bbtn { width: 66px; height: 84px; border-radius: 12px; background: var(--panel-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-2); position: relative; transition: background .15s, transform .15s, box-shadow .15s; }
.bbtn .i { font-size: 24px; }
.bbtn .lb { font-size: 11px; font-weight: 900; }
.bbtn .cost { display: flex; gap: 2px; }
.bbtn .cost i { width: 7px; height: 7px; border-radius: 2px; display: block; }
.bbtn .key { position: absolute; top: 4px; right: 6px; font-size: 9px; font-weight: 900; color: var(--mute); opacity: .7; }
.bbtn:not(:disabled):hover { background: #fff; box-shadow: var(--shadow-1); transform: translateY(-2px); color: var(--ink); }
.bbtn.on { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 2px rgba(74,48,0,.15); }
.bbtn:disabled { opacity: .45; }
.bbtn:disabled .cost { opacity: .8; }
.dice { position: absolute; right: 18px; bottom: 16px; z-index: 4; display: flex; gap: 8px; padding: 8px; border-radius: 16px; background: rgba(255,255,255,.22); backdrop-filter: blur(2px); }
.die { width: 46px; height: 46px; border-radius: 11px; background: #fff; position: relative; box-shadow: inset 0 -3px 0 #dfe3e8, 0 0 0 1px var(--line-2), 0 2px 4px rgba(16,32,48,.12); }
.die.red { background: #fff4f2; }
.die span { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); transform: translate(-50%, -50%); }
.die.red span { background: #d23b30; }
.die.rolling { animation: roll .55s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes roll { 0% { transform: rotate(-200deg) scale(.6); } 100% { transform: none; } }
.primary-btn { height: 84px; min-width: 132px; padding: 0 20px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-size: 17px; font-weight: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.12), 0 4px 14px rgba(255,176,32,.35); transition: transform .12s, box-shadow .12s, background .15s; }
.primary-btn .i { font-size: 26px; }
.primary-btn .hint { font-size: 10px; font-weight: 800; opacity: .65; }
.primary-btn:not(:disabled):hover { transform: translateY(-2px); background: var(--accent-2); }
.primary-btn:not(:disabled):active { transform: translateY(1px); }
.primary-btn:disabled { background: var(--panel-3); color: var(--mute); box-shadow: none; }

/* ---------- Buttons ---------- */
.btn { height: 40px; padding: 0 16px; border-radius: 11px; font-weight: 800; background: var(--panel-3); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, transform .12s, opacity .15s; }
.btn:not(:disabled):hover { background: var(--line-2); }
.btn:disabled { opacity: .4; }
.btn.go { background: var(--accent); color: var(--accent-ink); }
.btn.go:not(:disabled):hover { background: var(--accent-2); }
.btn.ok { background: var(--good); color: #fff; } .btn.ok:not(:disabled):hover { background: #1c9150; }
.btn.no { background: #fde4e4; color: #b4282d; } .btn.no:not(:disabled):hover { background: #fbd0d0; }
.btn.ghost { background: transparent; color: var(--mute); } .btn.ghost:not(:disabled):hover { background: var(--panel-2); color: var(--ink-2); }
.btn .i { font-size: 16px; }

/* ---------- Trade drawer ---------- */
.drawer { position: fixed; z-index: 10; bottom: calc(var(--dock-h) + 12px); left: calc((100vw - var(--side-w)) / 2); transform: translateX(-50%); width: min(640px, calc(100vw - var(--side-w) - 32px));
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-2); padding: 16px 18px 16px; animation: up .2s ease-out; }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes up { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer-head h3 { margin: 0; font-size: 17px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.drawer-head .sub { font-size: 12px; color: var(--mute); font-weight: 700; }
.icon-btn { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--mute); } .icon-btn:hover { background: var(--panel-2); color: var(--ink); }
.icon-btn .i { font-size: 18px; }
.tgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tcol { background: var(--panel-2); border-radius: 14px; padding: 10px 12px 12px; }
.tcol h4 { margin: 0 0 8px; font-size: 11px; font-weight: 900; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; display: flex; justify-content: space-between; }
.trow { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 8px; padding: 3px 0; }
.trow .meta { font-size: 11px; color: var(--mute); font-weight: 800; }
.trow.none .chip { opacity: .35; }
.trow.none .meta { opacity: .6; }
.stepper { display: inline-flex; align-items: center; background: #fff; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-2); }
.stepper button { width: 30px; height: 30px; font-size: 18px; font-weight: 900; color: var(--ink-2); border-radius: 10px; }
.stepper button:not(:disabled):hover { background: var(--panel-2); }
.stepper button:disabled { opacity: .25; }
.stepper span { width: 22px; text-align: center; font-weight: 900; font-size: 15px; }
.stepper.set { box-shadow: inset 0 0 0 2px var(--accent); }
.tfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.tnote { font-size: 12px; color: var(--mute); font-weight: 700; flex: 1; min-width: 180px; }
.tnote.warn { color: #b4282d; }
.tbtns { display: flex; gap: 8px; }
.responses { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.resp { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--panel-2); }
.resp .avatar { width: 36px; height: 36px; border-radius: 10px; } .resp .avatar .i { font-size: 20px; }
.summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel-2); border-radius: 12px; margin-bottom: 10px; font-weight: 800; color: var(--ink-2); }

/* ---------- Dialogs ---------- */
.overlay { position: fixed; inset: 0; z-index: 30; background: rgba(15, 28, 42, .42); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.dialog { background: #fff; border-radius: 20px; box-shadow: var(--shadow-2); padding: 22px 24px; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; animation: rise-in .25s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.dialog h2 { margin: 0 0 4px; font-size: 22px; font-weight: 900; }
.dialog p.lead { margin: 0 0 16px; color: var(--mute); font-weight: 700; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.field { margin: 14px 0; }
.field > label { display: block; font-size: 11px; font-weight: 900; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.seg { display: flex; background: var(--panel-3); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; height: 38px; border-radius: 9px; font-weight: 800; color: var(--ink-2); transition: background .15s, box-shadow .15s; padding: 0 8px; white-space: nowrap; }
.seg button:hover { background: rgba(255,255,255,.6); }
.seg button.sel { background: #fff; color: var(--ink); box-shadow: var(--shadow-1); }
.seg button small { display: block; font-size: 10px; color: var(--mute); font-weight: 700; margin-top: -2px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.brand-mark { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(150deg, var(--accent-2), var(--accent)); display: grid; place-items: center; color: var(--accent-ink); box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.brand-mark .i { font-size: 28px; }
.pick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
.pick { border-radius: 12px; height: 92px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; position: relative; transition: transform .12s, box-shadow .12s; box-shadow: inset 0 -4px 0 rgba(0,0,0,.14); }
.pick .i { font-size: 30px; }
.pick .nm { font-size: 11px; font-weight: 900; text-transform: uppercase; }
.pick .sub { font-size: 10px; font-weight: 800; opacity: .85; }
.pick:not(:disabled):hover { transform: translateY(-3px); box-shadow: inset 0 -4px 0 rgba(0,0,0,.14), 0 6px 14px rgba(16,32,48,.2); }
.pick:disabled { opacity: .3; }
.pick .n { position: absolute; top: -8px; right: -8px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 900; display: grid; place-items: center; }
.pick.sel { box-shadow: 0 0 0 3px var(--ink), inset 0 -4px 0 rgba(0,0,0,.14); }
.victims { display: flex; flex-direction: column; gap: 8px; }
.victim { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--panel-2); text-align: left; transition: background .15s, transform .12s; }
.victim:hover { background: var(--panel-3); transform: translateX(2px); }
.victim .nm { font-weight: 900; font-size: 15px; }
.victim .sub { color: var(--mute); font-size: 12px; font-weight: 700; }
.ranking { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.rank { display: grid; grid-template-columns: 28px 40px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--panel-2); }
.rank.win { background: #fff6e0; box-shadow: inset 0 0 0 2px var(--accent); }
.rank .pos { font-weight: 900; color: var(--mute); text-align: center; }
.rank .avatar { width: 40px; height: 40px; border-radius: 11px; } .rank .avatar .i { font-size: 22px; }
.rank .v { font-size: 20px; font-weight: 900; }
.rank .sub { font-size: 12px; color: var(--mute); font-weight: 700; }

.toast { position: fixed; z-index: 40; top: 64px; left: calc((100vw - var(--side-w)) / 2); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 800; box-shadow: var(--shadow-2); animation: drop .2s ease-out; max-width: calc(100vw - 32px); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  :root { --side-w: 320px; --dock-h: 118px; }
  .pcard { grid-template-columns: 40px 1fr auto; gap: 8px; }
  .pcard .avatar { width: 40px; height: 40px; }
  .stat { padding: 0 5px; gap: 3px; }
  .pstats { gap: 4px; flex-wrap: nowrap; }
  .vpbox { min-width: 34px; }
  .bbtn { width: 58px; height: 76px; }
  .rcard { width: 54px; height: 76px; }
  .primary-btn { height: 76px; min-width: 112px; }
  .me .sub, .me .meta { display: none; }
}
@media (max-width: 1060px) {
  .me { display: none; }
  #dock { grid-template-columns: 1fr auto; }
}
@media (max-width: 860px) {
  :root { --side-w: 0px; --dock-h: auto; }
  body { overflow: auto; }
  #app { grid-template-columns: 1fr; grid-template-rows: 62vh auto auto; height: auto; }
  #side { grid-column: 1; grid-row: 3; border-left: none; }
  .log { max-height: 320px; }
  #dock { grid-template-columns: 1fr; padding: 10px 16px 14px; gap: 10px; }
  .controls { flex-wrap: wrap; justify-content: space-between; }
  .build { flex: 1; justify-content: space-between; }
  .bbtn { flex: 1; width: auto; }
  .primary-btn { flex: 1 0 100%; height: 60px; flex-direction: row; gap: 10px; }
  .primary-btn .hint { display: none; }
  #menu span { display: none; }
  #menu { padding: 0 11px; }
  .drawer { left: 50%; bottom: 16px; width: calc(100vw - 32px); }
  .toast { left: 50%; }
  .dice { bottom: 10px; right: 10px; }
  .status { max-width: calc(100% - 64px); font-size: 13px; padding: 0 14px; }
  .topbar { justify-content: flex-start; }
  .bank { display: none; }
}

/* ---------- Effects: production ---------- */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.fx-card { position: fixed; left: 0; top: 0; width: 34px; height: 48px; border-radius: 7px; display: grid; place-items: center; color: #fff; will-change: transform, opacity;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.15), 0 6px 14px rgba(10,25,40,.35); }
.fx-card .i { font-size: 20px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.fx-burst { position: fixed; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: transparent; animation: burst .8s cubic-bezier(.2,.7,.3,1) forwards; }
.fx-burst::before, .fx-burst::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.fx-burst::before { border: 3px solid #fff; animation: burst-ring .8s cubic-bezier(.2,.7,.3,1) forwards; }
.fx-burst::after { background: radial-gradient(circle, rgba(255,255,255,.9), rgba(255,255,255,0) 70%); animation: burst-glow .7s ease-out forwards; }
.fx-burst.r0, .fx-burst.r1, .fx-burst.r2, .fx-burst.r3, .fx-burst.r4 { background: transparent; }
@keyframes burst { from { opacity: 1; } to { opacity: 0; } }
@keyframes burst-ring { from { transform: scale(1); opacity: 1; } to { transform: scale(7); opacity: 0; border-width: 1px; } }
@keyframes burst-glow { from { transform: scale(1); opacity: .9; } to { transform: scale(5); opacity: 0; } }
.fx-plus { position: fixed; transform: translate(-50%, -100%); display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px 3px 6px; border-radius: 10px; color: #fff; font-weight: 900; font-size: 14px;
  box-shadow: 0 4px 12px rgba(10,25,40,.25), inset 0 -2px 0 rgba(0,0,0,.15); animation: plus-rise 1.3s cubic-bezier(.2,.8,.3,1) forwards; white-space: nowrap; }
.fx-plus .i { font-size: 14px; }
@keyframes plus-rise { 0% { opacity: 0; transform: translate(-50%, -60%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -110%) scale(1.08); } 70% { opacity: 1; transform: translate(-50%, -150%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(.95); } }

/* ---------- Trades, top to bottom ---------- */
.swap-v { display: flex; flex-direction: column; gap: 0; margin: 4px 0 14px; }
.swap-row { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; }
.swap-row.get { background: #e8f7ee; }
.swap-row.give { background: #fdeeee; }
.swap-lbl { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; color: var(--mute); }
.swap-row.get .swap-lbl, .tband.get .swap-lbl { color: #15803d; }
.swap-row.give .swap-lbl, .tband.give .swap-lbl { color: #b4282d; }
.swap-cards { display: flex; gap: 5px; }
.swap-n { font-size: 12px; font-weight: 800; color: var(--ink-2); text-transform: capitalize; }
.tcard { width: 34px; height: 46px; border-radius: 7px; display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.3), inset 0 -3px 0 rgba(0,0,0,.14), 0 2px 5px rgba(16,32,48,.15); }
.tcard .i { font-size: 20px; }
.swap-mid { display: flex; justify-content: center; height: 0; position: relative; z-index: 1; }
.swap-mid span { width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); display: grid; place-items: center; color: var(--mute); }
.swap-mid .i { font-size: 15px; transform: rotate(90deg); }
.offer-card { min-width: 340px; }
.offer-card .swap-v { margin-bottom: 12px; }

.tstack { display: flex; flex-direction: column; }
.tband { border-radius: 14px; padding: 10px 12px 12px; }
.tband.get { background: #eef9f2; }
.tband.give { background: #fdf1f1; }
.tband .swap-lbl { display: block; margin-bottom: 8px; }
.ttiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ttile { display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.tface { width: 100%; max-width: 64px; height: 58px; border-radius: 11px; color: #fff; display: grid; place-items: center; position: relative;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.28), inset 0 -4px 0 rgba(0,0,0,.14), 0 2px 5px rgba(16,32,48,.12); transition: transform .12s, box-shadow .12s, opacity .15s; }
.tface .i { font-size: 26px; }
.tface:not(:disabled):hover { transform: translateY(-2px); box-shadow: inset 0 0 0 2px rgba(255,255,255,.45), inset 0 -4px 0 rgba(0,0,0,.14), 0 6px 12px rgba(16,32,48,.18); }
.tface:disabled { cursor: default; }
.ttile.none .tface, .ttile:not(.sel) .tface:disabled { opacity: .45; }
.ttile.sel .tface { opacity: 1; box-shadow: 0 0 0 3px var(--ink), inset 0 -4px 0 rgba(0,0,0,.14); }
.tcnt { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 900; display: grid; place-items: center; }
.tmeta { font-size: 10px; font-weight: 800; color: var(--mute); white-space: nowrap; text-align: center; line-height: 1.25; }
.tminus { width: 26px; height: 20px; border-radius: 7px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 900; color: var(--ink-2); line-height: 1; }
.tminus:disabled { visibility: hidden; }
.tstack .swap-mid span { margin-top: -10px; height: 24px; width: 24px; }
.tstack .tband.give { margin-top: 6px; }
.fx-plus.side { transform: translate(0, -50%); animation: plus-side 1.4s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes plus-side { 0% { opacity: 0; transform: translate(-8px, -50%) scale(.6); } 15% { opacity: 1; transform: translate(0, -50%) scale(1.08); } 75% { opacity: 1; transform: translate(4px, -50%) scale(1); } 100% { opacity: 0; transform: translate(10px, -50%) scale(.95); } }

/* ---------- Card back (hidden steals) ---------- */
.fx-card.back { background: linear-gradient(160deg, #c9a86a, #8f6d34); }

/* ---------- Dice tumble ---------- */
.dice.tumbling .die { animation: tumble .11s linear infinite alternate; }
.dice.tumbling .die.red { animation-delay: -.05s; }
@keyframes tumble { 0% { transform: translate(-3px, -5px) rotate(-22deg) scale(1.04); } 100% { transform: translate(3px, 2px) rotate(20deg) scale(.96); } }
.die.land { animation: land .32s cubic-bezier(.3,1.7,.5,1); }
.die.land.red { animation-delay: .04s; animation-fill-mode: backwards; }
@keyframes land { 0% { transform: translateY(-10px) scale(1.12) rotate(8deg); } 100% { transform: none; } }

/* ---------- The robber looms ---------- */
.loom { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; animation: loom-life 2.05s ease forwards; }
@keyframes loom-life { 0% { opacity: 0; } 12% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
.loom-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 60%, rgba(30, 6, 10, .25) 0%, rgba(8, 10, 18, .78) 70%, rgba(2, 3, 8, .92) 100%); }
.loom-fig { position: absolute; left: 50%; bottom: -6%; width: min(46vh, 42%); aspect-ratio: 200 / 260; transform-origin: 50% 100%; animation: loom-rise 2.05s cubic-bezier(.2,.8,.2,1) forwards; filter: drop-shadow(0 0 40px rgba(0,0,0,.8)); }
.loom-fig svg { width: 100%; height: 100%; display: block; }
@keyframes loom-rise { 0% { transform: translate(-50%, 40%) scale(.8); } 30% { transform: translate(-50%, 4%) scale(1.02); } 60% { transform: translate(-51%, 2%) scale(1.06) rotate(-1deg); } 100% { transform: translate(-50%, 0) scale(1.1) rotate(.5deg); } }
.loom-eyes { animation: eyes 2.05s ease forwards; }
@keyframes eyes { 0%, 22% { opacity: 0; } 32% { opacity: 1; } 45% { opacity: .55; } 55%, 85% { opacity: 1; } 100% { opacity: .7; } }
.loom-text { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; color: #ffe9e6; text-shadow: 0 2px 18px rgba(255, 40, 30, .55), 0 2px 4px rgba(0,0,0,.8); animation: loom-text 2.05s ease forwards; white-space: nowrap; }
.loom-text .loom-num { font-size: 72px; font-weight: 900; line-height: 1; color: #ff5a4e; }
.loom-text span:nth-child(2) { font-size: 22px; font-weight: 900; letter-spacing: .22em; text-transform: uppercase; margin-top: 4px; }
.loom-text small { font-size: 13px; font-weight: 800; opacity: .7; margin-top: 6px; letter-spacing: .06em; }
@keyframes loom-text { 0%, 15% { opacity: 0; transform: translate(-50%, 10px) scale(.96); } 30% { opacity: 1; transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -6px); } }
#board.quake { animation: quake .6s cubic-bezier(.36,.07,.19,.97); }
@keyframes quake { 10%, 90% { transform: translate(-1px, 0); } 20%, 80% { transform: translate(3px, 1px); } 30%, 50%, 70% { transform: translate(-5px, -1px); } 40%, 60% { transform: translate(5px, 1px); } }

/* ---------- Buildable spots: gentle glow, click, confirm ---------- */
.spot-g.passive .spot-dot { fill: rgba(255,255,255,.16); stroke: #fff; stroke-width: .028; animation: soft 2.4s ease-in-out infinite; }
.spot-g.passive .spot-ring { animation: ring 2.4s ease-out infinite; stroke-opacity: .7; }
.spot-g.passive .spot-edge { stroke-opacity: 1; animation: soft-edge 2.4s ease-in-out infinite; filter: drop-shadow(0 0 .04px #fff); }
@keyframes soft-edge { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
.spot-g.passive.city-spot .spot-ring { animation: soft 2.4s ease-in-out infinite; stroke-dasharray: .07 .05; transform: none; }
@keyframes soft { 0%, 100% { opacity: .45; } 50% { opacity: .95; } }
.spot-g.pending .ghost-piece { opacity: .95; }
.spot-g.pending .spot-dot, .spot-g.pending .spot-ring, .spot-g.pending .spot-edge { opacity: 0; animation: none; }
.confirm { position: absolute; z-index: 8; transform: translate(-50%, -100%); background: #fff; border-radius: 14px; box-shadow: var(--shadow-2); padding: 10px 10px 10px 12px; display: grid; grid-template-columns: auto auto; grid-template-areas: "t b" "c b"; column-gap: 12px; row-gap: 4px; align-items: center; white-space: nowrap; }
.confirm::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 2px; box-shadow: 3px 3px 6px rgba(16,32,48,.08); }
.confirm .c-title { grid-area: t; font-weight: 900; font-size: 14px; }
.confirm .c-cost { grid-area: c; display: flex; gap: 3px; }
.confirm .c-free { font-size: 12px; font-weight: 800; color: var(--good); }
.confirm .c-btns { grid-area: b; display: flex; gap: 6px; }
.confirm .btn { height: 36px; padding: 0 12px; position: relative; z-index: 1; }
.confirm .btn.ghost { padding: 0 10px; }

/* ---------- Hand cards start a trade ---------- */
.rcard.tradeable { cursor: pointer; }
.rcard.tradeable:hover { transform: translateY(-6px); box-shadow: inset 0 0 0 2px rgba(255,255,255,.5), inset 0 -4px 0 rgba(0,0,0,.14), 0 8px 16px rgba(16,32,48,.22); }

/* ---------- VP breakdown tooltip ---------- */
[data-vp] { cursor: help; }
.vptip { position: fixed; z-index: 60; width: 248px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-2); padding: 10px 12px; pointer-events: none; animation: fade .12s ease-out; }
.tip-head { display: flex; align-items: center; gap: 7px; font-weight: 900; font-size: 14px; padding-bottom: 7px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.tip-head .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--pc); }
.tip-total { margin-left: auto; font-size: 13px; color: var(--ink-2); }
.tip-row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 6px; padding: 4px 0; }
.tip-row.off { opacity: .45; }
.tip-ic { color: var(--ink-2); font-size: 15px; display: grid; place-items: center; }
.tip-l { font-weight: 800; font-size: 13px; display: flex; flex-direction: column; line-height: 1.15; }
.tip-l small { font-size: 11px; color: var(--mute); font-weight: 700; }
.tip-row b { font-size: 15px; font-weight: 900; min-width: 22px; text-align: right; }
.tip-foot { font-size: 11px; color: var(--mute); font-weight: 700; margin-top: 4px; border-top: 1px solid var(--line); padding-top: 6px; }

/* ---------- Results ---------- */
.topbar .mid { display: flex; align-items: center; gap: 8px; min-width: 0; }
.results-btn { background: var(--accent); color: var(--accent-ink); }
.results-btn:hover { background: var(--accent-2); }
.dialog.wide { width: min(760px, 100%); }
.over-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.over-head .icon-btn { margin-left: auto; align-self: flex-start; }
.brand-mark.win .i { font-size: 26px; }
.vp-table-wrap { overflow-x: auto; margin: 0 -4px; }
.vp-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-variant-numeric: tabular-nums; }
.vp-table th { font-size: 10px; font-weight: 900; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; padding: 0 8px 2px; text-align: center; white-space: nowrap; }
.vp-table th .th { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
.vp-table th .i { font-size: 16px; color: var(--ink-2); }
.vp-table td { background: var(--panel-2); padding: 8px; text-align: center; }
.vp-table td:first-child { border-radius: 12px 0 0 12px; }
.vp-table td:last-child { border-radius: 0 12px 12px 0; }
.vp-table td b { display: block; font-size: 17px; font-weight: 900; }
.vp-table td small { display: block; font-size: 10px; color: var(--mute); font-weight: 800; white-space: nowrap; }
.vp-table td.off b { color: var(--line-2); }
.vp-table td.pl { text-align: left; white-space: nowrap; }
.vp-table td.pl .plw { display: flex; align-items: center; gap: 10px; }
.vp-table td.pl b { display: inline; font-size: 15px; }
.vp-table td.pl .avatar { width: 36px; height: 36px; border-radius: 10px; } .vp-table td.pl .avatar .i { font-size: 20px; }
.vp-table td.pl .pos { width: 18px; text-align: center; font-weight: 900; color: var(--mute); }
.vp-table td.pl .pos .i { color: #d48a12; font-size: 18px; }
.vp-table td.tot, .vp-table th.tot { font-size: 22px; font-weight: 900; }
.vp-table th.tot { font-size: 10px; }
.vp-table tr.win td { background: #fff6e0; }
.vp-table tr.win td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.engine-note { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: var(--mute); background: var(--panel-2); border-radius: 10px; padding: 8px 10px; margin: 4px 0 2px; }
.engine-note.ok { color: #15803d; background: #eef9f2; }
.engine-note .i { font-size: 14px; }
.topbar .mid { max-width: 62%; }
.topbar .mid .status { max-width: none; }

/* ---------- Sound toggle ---------- */
.topbar .left { display: flex; align-items: center; gap: 8px; }
.topbar .right { display: flex; align-items: center; gap: 8px; }
a.pill-btn, a.btn { text-decoration: none; }
.dialog .actions .spacer { margin-right: auto; }
.icon-pill { width: 38px; padding: 0; justify-content: center; }
.icon-pill .i { font-size: 18px; }
.icon-pill.off { color: var(--mute); opacity: .8; }

/* ---------- Development card reveal ---------- */
.dcard.awaiting { visibility: hidden; }
.reveal { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; cursor: pointer; --c1: #9c7fd6; --c2: #5b3fa0; --glow: rgba(186, 156, 255, .75); }
.reveal.knight { --c1: #e0584a; --c2: #7d1c16; --glow: rgba(255, 110, 90, .7); }
.reveal.vp { --c1: #ffd36a; --c2: #c98a0b; --glow: rgba(255, 205, 90, .85); }
.reveal.roads { --c1: #b98a5e; --c2: #5d3f24; --glow: rgba(240, 190, 130, .65); }
.reveal.plenty { --c1: #5cc46a; --c2: #1d6b2c; --glow: rgba(120, 230, 140, .7); }
.reveal.monopoly { --c1: #a57ce8; --c2: #4a2c8a; --glow: rgba(190, 150, 255, .75); }
.reveal-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(20, 30, 45, .35), rgba(8, 12, 20, .78)); animation: fade .3s ease-out; transition: opacity .4s; }
.reveal.leaving .reveal-shade, .reveal.leaving .reveal-rays, .reveal.leaving .reveal-label { opacity: 0; transition: opacity .35s; }
.reveal-rays { position: absolute; left: 50%; top: 46%; width: 980px; height: 980px; margin: -490px 0 0 -490px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, var(--glow) 0deg 6deg, transparent 6deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 0%, rgba(0,0,0,.6) 30%, transparent 62%); mask: radial-gradient(circle, #000 0%, rgba(0,0,0,.6) 30%, transparent 62%); }
.reveal.revealed .reveal-rays { animation: rays-in .6s ease-out forwards, rays-spin 9s linear infinite; }
@keyframes rays-in { from { opacity: 0; transform: scale(.6); } to { opacity: .55; transform: scale(1); } }
@keyframes rays-spin { to { rotate: 360deg; } }
.reveal-stage { position: relative; width: 210px; height: 300px; perspective: 1100px; margin-top: -40px; will-change: transform; }
.flip { position: absolute; inset: 0; transform-style: preserve-3d; }
.face { position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08); }
.face.back { background: radial-gradient(circle at 50% 40%, #3d4f6b, #1c2638 70%); display: grid; place-items: center; border: 6px solid #d9b770; box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 0 40px rgba(255, 215, 130, .25); }
.face.back::before { content: ""; position: absolute; inset: 10px; border-radius: 10px; border: 2px solid rgba(217, 183, 112, .5);
  background: repeating-linear-gradient(45deg, rgba(217,183,112,.12) 0 2px, transparent 2px 14px), repeating-linear-gradient(-45deg, rgba(217,183,112,.12) 0 2px, transparent 2px 14px); }
.back-art { position: relative; width: 84px; height: 84px; border-radius: 50%; background: radial-gradient(circle, #f3d99a, #b8893a); display: grid; place-items: center; color: #3a2a10; box-shadow: 0 0 30px rgba(255, 215, 130, .5); animation: back-pulse 1.1s ease-in-out infinite; }
.back-art .i { font-size: 44px; }
@keyframes back-pulse { 0%, 100% { box-shadow: 0 0 22px rgba(255, 215, 130, .35); } 50% { box-shadow: 0 0 46px rgba(255, 215, 130, .8); } }
.face.front { transform: rotateY(180deg); background: linear-gradient(165deg, var(--c1), var(--c2)); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px 18px; text-align: center; border: 6px solid rgba(255,255,255,.85); }
.front-glow { position: absolute; inset: -40%; background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.55), transparent 45%); opacity: 0; }
.reveal.revealed .front-glow { animation: front-glow 1.2s ease-out forwards; }
@keyframes front-glow { 0% { opacity: 1; transform: scale(.6); } 100% { opacity: .25; transform: scale(1.2); } }
.front-icon { position: relative; width: 104px; height: 104px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; box-shadow: inset 0 0 0 3px rgba(255,255,255,.35), 0 8px 24px rgba(0,0,0,.2); margin-bottom: 16px; }
.front-icon .i { font-size: 60px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.front-name { position: relative; font-size: 22px; font-weight: 900; letter-spacing: .02em; text-shadow: 0 2px 6px rgba(0,0,0,.25); }
.front-help { position: relative; font-size: 13px; font-weight: 700; opacity: .9; margin-top: 8px; line-height: 1.35; }
.reveal.vp .face.front { color: #4a3000; border-color: #fff6d8; } .reveal.vp .front-name, .reveal.vp .front-help { text-shadow: none; }
.sparks { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.sparks i { position: absolute; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px var(--glow), 0 0 4px #fff; opacity: 0; }
.sparks i:nth-child(3n) { width: 6px; height: 6px; background: var(--c1); }
.sparks i:nth-child(4n) { border-radius: 2px; transform: rotate(45deg); }
.reveal.revealed .sparks i { animation: spark 1s cubic-bezier(.15,.7,.3,1) forwards; }
.reveal-label { position: absolute; left: 50%; top: calc(50% + 150px); transform: translateX(-50%); color: #fff; text-align: center; font-size: 22px; font-weight: 900; text-shadow: 0 2px 12px rgba(0,0,0,.5); opacity: 0; white-space: nowrap; }
.reveal-label small { display: block; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .7; margin-bottom: 2px; }
.reveal.revealed .reveal-label { animation: label-in .45s .15s cubic-bezier(.2,1.3,.4,1) forwards; }
@keyframes label-in { from { opacity: 0; transform: translate(-50%, 10px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.sparks i:nth-child(1) { --x: 189px; --y: -15px; animation-delay: 0.04s !important; }
.sparks i:nth-child(2) { --x: 191px; --y: 54px; animation-delay: 0.01s !important; }
.sparks i:nth-child(3) { --x: 210px; --y: 74px; animation-delay: 0.03s !important; }
.sparks i:nth-child(4) { --x: 191px; --y: 144px; animation-delay: 0.06s !important; }
.sparks i:nth-child(5) { --x: 88px; --y: 160px; animation-delay: 0.08s !important; }
.sparks i:nth-child(6) { --x: 90px; --y: 178px; animation-delay: 0.10s !important; }
.sparks i:nth-child(7) { --x: 24px; --y: 210px; animation-delay: 0.08s !important; }
.sparks i:nth-child(8) { --x: 2px; --y: 213px; animation-delay: 0.07s !important; }
.sparks i:nth-child(9) { --x: -40px; --y: 127px; animation-delay: 0.10s !important; }
.sparks i:nth-child(10) { --x: -117px; --y: 173px; animation-delay: 0.11s !important; }
.sparks i:nth-child(11) { --x: -183px; --y: 142px; animation-delay: 0.05s !important; }
.sparks i:nth-child(12) { --x: -165px; --y: 69px; animation-delay: 0.11s !important; }
.sparks i:nth-child(13) { --x: -140px; --y: 18px; animation-delay: 0.02s !important; }
.sparks i:nth-child(14) { --x: -235px; --y: 20px; animation-delay: 0.05s !important; }
.sparks i:nth-child(15) { --x: -157px; --y: -45px; animation-delay: 0.06s !important; }
.sparks i:nth-child(16) { --x: -152px; --y: -73px; animation-delay: 0.07s !important; }
.sparks i:nth-child(17) { --x: -168px; --y: -156px; animation-delay: 0.08s !important; }
.sparks i:nth-child(18) { --x: -103px; --y: -199px; animation-delay: 0.12s !important; }
.sparks i:nth-child(19) { --x: -45px; --y: -141px; animation-delay: 0.10s !important; }
.sparks i:nth-child(20) { --x: 4px; --y: -229px; animation-delay: 0.07s !important; }
.sparks i:nth-child(21) { --x: 28px; --y: -151px; animation-delay: 0.10s !important; }
.sparks i:nth-child(22) { --x: 61px; --y: -150px; animation-delay: 0.01s !important; }
.sparks i:nth-child(23) { --x: 156px; --y: -181px; animation-delay: 0.01s !important; }
.sparks i:nth-child(24) { --x: 141px; --y: -104px; animation-delay: 0.02s !important; }
.sparks i:nth-child(25) { --x: 183px; --y: -111px; animation-delay: 0.10s !important; }
.sparks i:nth-child(26) { --x: 184px; --y: -73px; animation-delay: 0.01s !important; }
@keyframes spark { 0% { opacity: 0; translate: 0 0; scale: .2; } 15% { opacity: 1; scale: 1.2; } 100% { opacity: 0; translate: var(--x) var(--y); scale: .4; } }

/* ---------- The robber takes one of your cards ---------- */
.thief-head { position: absolute; bottom: 0; width: 140px; z-index: 6; pointer-events: none; transform: translateY(100%); filter: drop-shadow(0 -6px 18px rgba(0,0,0,.35)); }
.thief-head svg { width: 100%; height: auto; display: block; }
.thief-arm { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 51; overflow: visible; }
.thief-arm .hand { filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
.thief-arm .hand.wiggle .fingers { animation: fingers .22s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 0; }
@keyframes fingers { from { transform: rotate(-5deg) scaleY(.94); } to { transform: rotate(5deg) scaleY(1.04); } }
.rcard.carried { position: fixed; margin: 0; z-index: 50; pointer-events: none; box-shadow: 0 10px 24px rgba(10,25,40,.35); }
