:root {
	--bg: #0b1f2c;
	--bg-2: #0f2838;
	--panel: #133245;
	--panel-2: #183d53;
	--panel-3: #21506a;
	--line: rgba(255, 255, 255, .08);
	--text: #f1f5f2;
	--muted: #9db6bf;
	--faint: #6a8791;
	--accent: #3fb37a;
	--accent-2: #6fd29d;
	--gold: #e7b84a;
	--parch: #f3ead2;
	--good: #3fb37a;
	--warn: #e08a1e;
	--bad: #d9473c;
	--radius: 14px;
	color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
	background: radial-gradient(1400px 800px at 50% 30%, #12364a 0%, var(--bg) 70%) fixed, var(--bg);
	color: var(--text);
	font-family: 'Nunito', system-ui, sans-serif;
	font-weight: 700;
	overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { display: block; }

/* ---------- buttons ---------- */
.btn {
	border: 0; cursor: pointer; border-radius: 10px; padding: 9px 15px;
	background: #2f7fb0; color: #fff; font-weight: 800; letter-spacing: .2px;
	box-shadow: 0 3px 0 rgba(0, 0, 0, .3); transition: transform .08s, filter .15s;
	display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn.big { padding: 12px 22px; font-size: 16px; border-radius: 12px; }
.btn.good { background: #2f9d66; }
.btn.warn { background: #c97a17; }
.btn.bad { background: #c23b31; }
.btn.ghost { background: var(--panel-3); }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn svg { width: 17px; height: 17px; }
.icon-btn { background: var(--panel-3); border: 0; border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.chip { background: var(--panel-3); border: 0; border-radius: 999px; padding: 4px 11px; cursor: pointer; font-size: 13px; }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.pill { background: rgba(63, 179, 122, .2); color: var(--accent-2); padding: 1px 7px; border-radius: 999px; font-size: 12px; }

input.field, select.field {
	width: 100%; background: var(--bg-2); border: 2px solid var(--panel-3); border-radius: 10px;
	padding: 9px 11px; outline: none; transition: border-color .15s;
}
input.field:focus, select.field:focus { border-color: var(--accent); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: minmax(240px, 290px) 1fr minmax(250px, 310px); height: 100vh; gap: 12px; padding: 12px; }
.side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.center { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.card { background: var(--panel); border-radius: var(--radius); padding: 12px 13px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.card h3 { margin: 0 0 9px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 900; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.grow { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.muted { color: var(--muted); }
.small-note { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.neg { color: #ff8a7a; }
.empty { color: var(--faint); font-size: 13px; text-align: center; padding: 6px; }

.logo { display: flex; align-items: center; gap: 8px; padding: 2px 2px 0; font-family: 'Fraunces', serif; font-size: 25px; font-weight: 900; letter-spacing: -.5px; }
.logo .mark, .tb-title .mark { width: 34px; height: 34px; flex: none; }
.logo b, .hero-logo b, .tb-title b { color: var(--gold); font-weight: 900; }

/* share + chat */
.share { display: flex; gap: 8px; }
.share input { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; font-size: 14px; min-height: 60px; }
.chat-msg { line-height: 1.35; word-wrap: break-word; }
.chat-empty { color: var(--faint); text-align: center; margin: auto; font-size: 13px; }
.chat-form { display: flex; gap: 8px; margin-top: 8px; }
.chat-form input { flex: 1; min-width: 0; }

/* players */
.players { display: flex; flex-direction: column; gap: 6px; }
.player-row { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 12px; background: var(--panel-2); border-left: 4px solid var(--pc); }
.player-row.turn { background: var(--panel-3); box-shadow: inset 0 0 0 2px var(--gold); }
.player-row.bankrupt { opacity: .4; }
.player-row .avatar { width: 32px; height: 32px; flex: none; }
.pinfo { flex: 1; min-width: 0; }
.pname { display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; }
.pname svg { width: 14px; height: 14px; flex: none; }
.crown { color: var(--gold); }
.botic { color: var(--muted); }
.tag { font-size: 11px; background: var(--bg-2); color: var(--muted); padding: 1px 6px; border-radius: 6px; }
.offline { font-size: 11px; color: var(--bad); }
.pbar { height: 5px; background: var(--bg-2); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.pbar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.pstats { text-align: right; font-variant-numeric: tabular-nums; }
.pts { font-weight: 900; font-size: 17px; line-height: 1; }
.pts small { font-size: 11px; color: var(--muted); }
.cash { font-size: 12px; color: var(--parch); }
.cash.neg { color: #ff8a7a; }
.hc { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.hc svg { width: 12px; height: 12px; }
.kick { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 18px; }
.kick:hover { color: var(--bad); }

/* right panel */
.effects { display: flex; flex-direction: column; gap: 5px; max-height: 210px; overflow-y: auto; }
.effect { display: flex; gap: 8px; align-items: flex-start; background: var(--panel-2); border-left: 4px solid var(--cc); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.effect .eicon { color: var(--cc); font-weight: 900; width: 16px; text-align: center; filter: brightness(1.4); }
.effect .muted { font-size: 12px; font-weight: 600; }
.trade-list { display: flex; flex-direction: column; gap: 6px; }
.trade-item { background: var(--panel-2); border-radius: 10px; padding: 7px 9px; display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.trade-item:hover { background: var(--panel-3); }
.trade-item .avatar { width: 22px; height: 22px; }
.log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; min-height: 0; }
.log-entry { background: rgba(255, 255, 255, .035); padding: 5px 8px; border-radius: 7px; color: #d4e2e4; line-height: 1.3; font-weight: 600; }
.log-entry b { font-weight: 900; }
.side-actions { display: flex; gap: 8px; }
.side-actions .btn { flex: 1; }

/* settings */
.setting { display: flex; align-items: center; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.s-text { flex: 1; }
.s-title { font-size: 14px; }
.s-desc { font-size: 12px; color: var(--muted); font-weight: 600; }
.setting select { width: auto; padding: 6px 8px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--panel-3); border-radius: 12px; transition: background .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:disabled + span { cursor: not-allowed; opacity: .6; }
.rules-list { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.5; font-weight: 600; }
.rules-list li { margin-bottom: 4px; }
.rules-card { overflow-y: auto; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 18px; background: var(--panel); border-radius: 12px; padding: 7px 14px; flex-wrap: wrap; min-height: 46px; }
.tb-title { display: flex; align-items: center; gap: 8px; font-family: 'Fraunces', serif; font-size: 20px; font-weight: 900; }
.tb-group { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tb-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 900; }
.tracker { display: flex; gap: 2px; }
.infl { font-size: 12px; padding: 3px 6px; border-radius: 5px; background: var(--bg-2); color: var(--faint); font-variant-numeric: tabular-nums; }
.infl.low { color: #8fc7e8; }
.infl.high { color: #f0a46a; }
.infl.cur { background: var(--gold); color: #2a1d00; font-weight: 900; transform: scale(1.12); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }

/* ---------- stage / map ---------- */
.stage { position: relative; flex: 1; min-height: 0; border-radius: 16px; overflow: hidden; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); background: #0f4a73; }
.map { position: absolute; inset: 0; }
.hexmap { width: 100%; height: 100%; }
.hexmap .waves { animation: drift 14s linear infinite; }
@keyframes drift { to { transform: translateX(60px); } }
.hexmap .river-flow { stroke-dasharray: 6 14; animation: flow 2.4s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -40; } }
.hexmap .smoke { animation: smoke 3s ease-in-out infinite; }
.hexmap .smoke.s2 { animation-delay: 1.2s; }
@keyframes smoke { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.hexmap .tile { cursor: pointer; transition: opacity .2s; }
.hexmap .tile:hover .hex-base { filter: brightness(1.12); }
.hexmap .tile .art.unowned { opacity: .7; }
.hexmap .tile.dim { opacity: .45; }
.hexmap .tile.targetable .hex-base { stroke: #ffd34d; stroke-width: 4; }
.hexmap .tile.selected .hex-base { stroke: #fff; stroke-width: 5; }
.hexmap .tile.lot .hex-base { stroke: var(--gold); stroke-width: 6; animation: pulse 1.2s ease-in-out infinite; }
.hexmap .tile.queued .hex-base { stroke: rgba(231, 184, 74, .6); stroke-width: 3; stroke-dasharray: 6 4; }
@keyframes pulse { 50% { stroke-width: 2; } }
.hexmap .sp-label { font: 900 10px 'Nunito', sans-serif; fill: #3a2e20; text-anchor: middle; letter-spacing: .5px; }
.hexmap .sp-big { font: 900 20px 'Nunito', sans-serif; fill: #b2382f; text-anchor: middle; }
.hexmap .unknown { font: 900 26px 'Fraunces', serif; fill: rgba(255, 255, 255, .85); text-anchor: middle; }
.hexmap .blocked-x { font: 900 26px sans-serif; fill: rgba(255, 120, 110, .9); text-anchor: middle; }
.hexmap .compass-n { font: 900 11px 'Nunito', sans-serif; fill: #1d3b4c; text-anchor: middle; }
.hexmap .compass-l { font: 800 11px 'Nunito', sans-serif; fill: rgba(255, 255, 255, .7); text-anchor: middle; }
.hexmap .token { transition: transform .26s ease-in-out; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .5)); }
.hexmap .token.me { filter: drop-shadow(0 0 5px #fff) drop-shadow(0 3px 2px rgba(0, 0, 0, .5)); }
.hexmap .token.hop > g { animation: hop .26s ease-out; }
@keyframes hop { 50% { transform: translate(-16px, -34px) scale(.8); } }

.overlay-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.overlay-center > * { pointer-events: auto; }
.lobby-box { background: rgba(19, 50, 69, .94); backdrop-filter: blur(6px); border-radius: 16px; padding: 20px; width: min(92%, 380px); text-align: center; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.lobby-box h2 { margin: 0; font-family: 'Fraunces', serif; font-size: 22px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.colors { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.color-dot { width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: none; transition: transform .1s; }
.color-dot:hover { transform: scale(1.1); }
.color-dot .avatar { width: 100%; height: 100%; }
.color-dot.sel { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px #fff; }
.color-dot.taken { opacity: .25; cursor: not-allowed; transform: none; }
.winner .avatar { width: 90px; height: 90px; margin: 0 auto; animation: bounce 1s infinite alternate; }
@keyframes bounce { to { transform: translateY(-10px); } }

/* auction panel */
.auction-panel { position: absolute; top: 12px; right: 12px; width: min(330px, calc(100% - 24px)); background: rgba(19, 50, 69, .96); backdrop-filter: blur(6px); border: 2px solid var(--gold); border-radius: 14px; padding: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); display: flex; flex-direction: column; gap: 8px; animation: pop .25s ease-out; z-index: 5; }
.au-head { display: flex; justify-content: space-between; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--gold); font-weight: 900; }
.au-field { display: flex; gap: 10px; align-items: center; }
.au-name { font-size: 18px; font-weight: 900; }
.au-result { background: rgba(231, 184, 74, .15); color: var(--gold); padding: 8px; border-radius: 8px; text-align: center; }
.au-bid { display: flex; gap: 8px; }
.au-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.bar { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.bar > div { height: 100%; background: var(--gold); transition: width .2s linear; }
.bidders { display: flex; flex-direction: column; gap: 3px; }
.bidder { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 4px; border-radius: 6px; }
.bidder .avatar { width: 18px; height: 18px; }
.bidder span { flex: 1; }
.bidder.won { background: rgba(63, 179, 122, .25); }
.zicon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--zc); color: #1d2a20; flex: none; }
.zicon svg { width: 18px; height: 18px; }
.zicon.small { width: 18px; height: 18px; border-radius: 5px; }
.zicon.small svg { width: 12px; height: 12px; }

/* tile info */
.tileinfo { position: absolute; left: 12px; bottom: 12px; width: min(330px, calc(100% - 24px)); background: rgba(19, 50, 69, .96); backdrop-filter: blur(6px); border-radius: 14px; padding: 12px 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); display: flex; flex-direction: column; gap: 6px; animation: pop .2s ease-out; z-index: 4; font-size: 13px; }
.tileinfo .x { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, .25); border: 0; border-radius: 7px; width: 26px; height: 26px; cursor: pointer; color: #fff; }
.ti-name { font-size: 18px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.ti-owner { display: flex; align-items: center; gap: 6px; }
.ti-owner .avatar { width: 20px; height: 20px; }
.ti-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.lv-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.lv-table th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; padding: 4px; }
.lv-table td { padding: 3px 4px; border-top: 1px solid var(--line); }
.lv-table tr.cur td { color: var(--accent-2); }

.target-banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: rgba(40, 30, 5, .92); border: 2px solid #ffd34d; border-radius: 12px; padding: 9px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 6; max-width: calc(100% - 24px); text-align: center; font-size: 14px; }
.tb-players { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pick-player { display: flex; align-items: center; gap: 6px; background: var(--panel-3); border: 0; border-radius: 8px; padding: 5px 9px; cursor: pointer; }
.pick-player .avatar { width: 20px; height: 20px; }

/* ---------- HUD + hand ---------- */
.hud { display: flex; align-items: center; gap: 14px; background: var(--panel); border-radius: 12px; padding: 8px 12px; min-height: 58px; }
.hud:empty { display: none; }
.dice { display: flex; gap: 6px; }
.dice .die { width: 40px; height: 40px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); }
.dice.idle { opacity: .3; }
.dice.rolling .die { animation: roll .5s ease-out; }
@keyframes roll { 0% { transform: rotate(-220deg) scale(.5); } 70% { transform: rotate(12deg) scale(1.1); } 100% { transform: none; } }
.prompt { flex: 1; font-size: 15px; }
.hud-actions { display: flex; gap: 8px; }

.ecard { flex: none; width: 168px; min-height: 128px; background: var(--parch); color: #2b2418; border-radius: 12px; border-top: 8px solid var(--cc); padding: 7px 10px 9px; display: flex; flex-direction: column; gap: 3px; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); position: relative; transition: transform .15s, box-shadow .15s; }
.ecard.playable { cursor: pointer; }
.ecard.playable:hover { transform: translateY(-5px); }
.ecard.sel { transform: translateY(-8px); box-shadow: 0 0 0 3px var(--gold), 0 8px 18px rgba(0, 0, 0, .45); }
.ec-head { display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 900; letter-spacing: 1px; color: var(--cc); }
.cat-apokalypse .ec-head { color: #111; }
.cat-apokalypse { background: #e6dccb; }
.ec-n { color: rgba(0, 0, 0, .35); }
.ec-title { font-family: 'Fraunces', serif; font-size: 15px; font-weight: 900; line-height: 1.1; overflow-wrap: anywhere; hyphens: auto; }
.ec-text { font-size: 12.5px; font-weight: 700; line-height: 1.3; color: #4a4033; flex: 1; }
.ec-play { align-self: flex-start; margin-top: 4px; }
.reveal-h { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.reveal-h .avatar { width: 22px; height: 22px; }

/* ---------- landing ---------- */
/* Illustrated backdrop (public/img/landing.svg): dusk sky, sun behind the island's mountain. */
.landing {
	position: fixed; inset: 0; overflow-y: auto; padding: 5vh 24px 40px; display: grid; place-items: start center;
	background: linear-gradient(180deg, rgba(6, 22, 33, .55) 0%, rgba(6, 22, 33, .15) 55%, rgba(6, 22, 33, 0) 70%), url(../img/landing.svg) center bottom / cover no-repeat, var(--bg);
}
.landing-grid { width: min(100%, 1180px); display: grid; grid-template-columns: 1fr minmax(340px, 400px); gap: 48px; align-items: start; }
.landing-hero { display: flex; flex-direction: column; gap: 18px; text-shadow: 0 2px 12px rgba(0, 0, 0, .45); }
.landing-side { display: flex; flex-direction: column; gap: 14px; }
.hero-logo { font-family: 'Fraunces', serif; font-size: 64px; font-weight: 900; letter-spacing: -1.5px; display: flex; align-items: center; gap: 14px; line-height: 1; }
.hero-logo .mark { width: 70px; height: 70px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4)); }
.tagline { color: #e3eef0; margin: 0; font-size: 18px; line-height: 1.5; max-width: 34em; }
.hero-points { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hero-points li { display: flex; gap: 12px; align-items: flex-start; background: rgba(9, 30, 44, .55); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; padding: 11px 14px; max-width: 30em; text-shadow: none; }
.hero-points b { display: block; font-size: 15px; }
.hero-points span:not(.hp-ico) { color: var(--muted); font-size: 13.5px; }
.hp-ico { font-size: 22px; line-height: 1.2; }
.landing .card { width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 20px; background: rgba(15, 40, 56, .82); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .08); }
.landing .footer-note { text-align: left; color: #b6cbd1; }
@media (max-width: 860px) {
	.landing { place-items: start center; padding: 24px 16px; background: linear-gradient(180deg, rgba(6, 22, 33, .35), rgba(6, 22, 33, .85) 60%), url(../img/landing.svg) center top / cover no-repeat, var(--bg); }
	.landing-grid { grid-template-columns: 1fr; gap: 22px; }
	.landing-hero { align-items: center; text-align: center; }
	.hero-points { display: none; }
	.landing .footer-note { text-align: center; }
}
.preview { width: 72px; height: 72px; margin: 0 auto; }
.preview .avatar { width: 100%; height: 100%; }
.label { font-size: 13px; color: var(--muted); margin-bottom: -6px; }
.rooms { width: 100%; }
.room-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--panel-2); border-radius: 12px; font-size: 14px; }
.room-row + .room-row { margin-top: 8px; }
.room-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.room-title { display: flex; align-items: center; gap: 7px; font-weight: 800; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-status { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; padding: 2px 7px; border-radius: 999px; flex: none; }
.room-status.wait { background: rgba(63, 179, 122, .2); color: var(--accent-2); }
.room-status.live { background: rgba(231, 184, 74, .2); color: var(--gold); }
.room-seats { display: flex; gap: 4px; }
.seat { width: 24px; height: 24px; border-radius: 50%; flex: none; }
.seat .avatar { width: 100%; height: 100%; }
.seat.free { border: 2px dashed var(--panel-3); }
.seat.out { opacity: .35; }
.room-meta { font-size: 12px; color: var(--faint); }
.btn-note { font-size: 12px; font-weight: 700; opacity: .7; }

/* ---------- waiting room ---------- */
.waiting-room {
	width: 100%; height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 22px;
	background: rgba(11, 31, 44, .9); backdrop-filter: blur(8px);
}
.wr-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wr-head h2 { margin: 0; font-family: 'Fraunces', serif; font-size: 26px; }
.wr-copy { margin-left: auto; }
.wr-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.slot {
	position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px 12px;
	background: var(--panel); border-radius: var(--radius); border-top: 4px solid var(--pc); text-align: center;
}
.slot.free { background: rgba(19, 50, 69, .5); border: 2px dashed var(--panel-3); justify-content: center; }
.slot .kick { position: absolute; top: 4px; right: 6px; }
.slot-avatar { width: 64px; height: 64px; }
.slot-avatar .avatar { width: 100%; height: 100%; }
.slot-avatar.empty { border-radius: 50%; border: 3px dashed var(--panel-3); }
.slot-name { display: flex; align-items: center; justify-content: center; gap: 5px; font-weight: 800; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.slot-name svg { width: 14px; height: 14px; flex: none; }
.slot-tags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; font-size: 12px; }
.slot-state { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px; border-radius: 999px; background: var(--bg-2); color: var(--faint); }
.slot-state.host { background: rgba(231, 184, 74, .2); color: var(--gold); }
.wr-colors { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* The start button must stay reachable however small the stage gets. */
.wr-foot { margin-top: auto; position: sticky; bottom: -22px; margin-bottom: -22px; padding: 14px 0 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid var(--line); background: rgb(11, 31, 44); }
.wr-hint { color: var(--muted); font-weight: 700; }
/* Camera controls are meaningless while the waiting room covers the island. */
.stage:has(.waiting-room) .cam-hint { display: none; }
.footer-note { color: var(--faint); font-size: 12px; text-align: center; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(4, 14, 20, .7); display: grid; place-items: center; z-index: 50; animation: fade .15s; padding: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.modal { background: var(--panel); border-radius: 18px; width: min(100%, 440px); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: pop .2s ease-out; }
.modal.wide { width: min(100%, 760px); }
.modal-head { padding: 14px 18px; display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 900; background: var(--panel-3); border-radius: 18px 18px 0 0; font-family: 'Fraunces', serif; }
.modal-head .x { margin-left: auto; background: rgba(0, 0, 0, .25); border: 0; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; color: #fff; font-size: 18px; }
.modal-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; }
.rules-body p { margin: 0; font-size: 14px; line-height: 1.5; font-weight: 600; }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.trade-col { background: var(--panel-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.trade-col h5 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.trade-col h5 .avatar { width: 24px; height: 24px; }
.trade-props { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.trade-prop { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; background: var(--panel); cursor: pointer; font-size: 13px; border-left: 4px solid var(--c); user-select: none; }
.trade-prop .muted { margin-left: auto; font-size: 11px; }
.trade-prop.sel { background: #2f7fb0; }
.trade-cash { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.trade-cash input { flex: 1; min-width: 0; padding: 6px 8px; }
.partner-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.partner-pick button { background: var(--panel-2); border: 2px solid transparent; border-radius: 10px; padding: 6px 10px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.partner-pick button.sel { border-color: var(--accent); }
.partner-pick .avatar { width: 22px; height: 22px; }
.trade-summary ul { margin: 0; padding-left: 18px; font-size: 14px; }

/* toasts */
.toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 100; pointer-events: none; align-items: center; }
.toast { background: var(--panel-3); padding: 9px 15px; border-radius: 10px; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); animation: pop .2s; font-size: 14px; }
.toast.err { background: #9c2f28; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 1150px) {
	body { overflow: auto; }
	.app { grid-template-columns: 1fr; height: auto; padding: 8px 16px; }
	.center { order: -1; }
	.stage { flex: none; height: min(78vw, 76vh); min-height: 320px; }
	.chat-list { max-height: 200px; }
	.log { max-height: 260px; }
}
@media (max-width: 640px) {
	.topbar { gap: 10px; padding: 6px 10px; }
	.tb-group:nth-child(3), .tb-group:nth-child(4) { display: none; }
	.hud { flex-wrap: wrap; }
	.prompt { flex-basis: 100%; order: 3; font-size: 14px; }
	.ecard { width: 150px; }
	.trade-cols { grid-template-columns: 1fr; }
	.hero-logo { font-size: 42px; }
	/* Panels go below the map instead of covering it. */
	.stage { height: auto; min-height: 0; display: flex; flex-direction: column; overflow: visible; background: none; box-shadow: none; }
	.map { position: relative; height: 92vw; border-radius: 14px; overflow: hidden; }
	.auction-panel, .tileinfo { position: static; width: auto; margin-top: 8px; }
	.target-banner { top: 8px; }
	.overlay-center { bottom: auto; height: 92vw; }
	/* Phones: the waiting room replaces the square map instead of squeezing into it. */
	.stage:has(.waiting-room) .map { display: none; }
	.overlay-center:has(.waiting-room) { position: static; height: auto; }
	.waiting-room { padding: 14px; gap: 12px; height: auto; border-radius: 14px; }
	.wr-foot { position: static; margin-bottom: 0; padding-bottom: 0; background: none; }
	.wr-slots { grid-template-columns: repeat(2, 1fr); gap: 8px; }
	.slot { padding: 10px 6px 8px; }
	.slot-avatar { width: 44px; height: 44px; }
	.wr-foot .btn { flex: 1; }
}

/* ---------- 3D stage ---------- */
.map canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--parch); font-size: 15px; background: linear-gradient(#4f9fd8, #cde8f2); }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cam-hint { position: absolute; left: 12px; bottom: 10px; font-size: 11px; color: rgba(255, 255, 255, .85); text-shadow: 0 1px 3px rgba(0, 0, 0, .6); pointer-events: none; }
.tileinfo:not([hidden]) ~ .cam-hint { display: none; }
.tooltip { position: absolute; z-index: 7; pointer-events: none; background: rgba(12, 32, 44, .92); border: 1px solid rgba(255, 255, 255, .15); border-radius: 10px; padding: 7px 10px; font-size: 12.5px; max-width: 220px; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); line-height: 1.35; }
.tooltip b { font-size: 14px; }

/* Top-left corner, so the disaster animation on the island stays visible next to the card. */
.event-card { position: absolute; left: 14px; top: 14px; z-index: 8; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; perspective: 900px; max-width: calc(100% - 28px); }
.event-card .ev-fx { background: rgba(12, 32, 44, .92); border-radius: 12px; padding: 8px 14px; font-size: 13px; width: 260px; max-width: 100%; }
.event-card .ev-fx ul { margin: 4px 0 0; padding-left: 18px; }
.event-card .ev-fx li { margin: 2px 0; font-weight: 600; }
.event-card .ev-who { display: flex; align-items: center; gap: 8px; background: rgba(12, 32, 44, .9); padding: 6px 12px; border-radius: 999px; font-size: 14px; }
.event-card .ev-who .avatar { width: 22px; height: 22px; }
.event-card .ecard { width: 230px; min-height: 150px; padding: 12px 16px 16px; border-top-width: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.event-card .ec-title { font-size: 24px; }
.event-card .ec-text { font-size: 16px; }
.event-card .ec-head { font-size: 12px; }
.event-card.show .ecard { animation: flipin .6s cubic-bezier(.2, .9, .3, 1.2) both; }
.event-card.show .ev-who { animation: fade .4s .25s both; }
.event-card.leave { animation: shrink .45s ease-in forwards; }
@keyframes flipin { from { transform: rotateY(-100deg) scale(.6); opacity: 0; } }
@keyframes shrink { to { transform: translateY(-24px) scale(.6); transform-origin: top left; opacity: 0; } }

/* ---------- accounts ---------- */
.auth-tabs { display: flex; gap: 6px; background: var(--bg-2); padding: 4px; border-radius: 12px; margin-bottom: 6px; }
.auth-tab { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 800; }
.auth-tab.sel { background: var(--panel-3); color: var(--text); }
#auth-form { display: flex; flex-direction: column; gap: 6px; }
#auth-form .btn { margin-top: 8px; }
.auth-error { background: rgba(217, 71, 60, .18); color: #ffb3ab; border-radius: 9px; padding: 7px 10px; font-size: 13px; }
.account-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg-2); border-radius: 12px; padding: 9px 12px; }
.acc-name { font-size: 17px; font-weight: 900; }

/* ---------- strategy layer ---------- */
.pmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.title-badge { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: rgba(231, 184, 74, .2); color: var(--gold); letter-spacing: .2px; }
.title-badge.mission { background: rgba(63, 179, 122, .22); color: var(--accent-2); }
.missions, .titles { display: flex; flex-direction: column; gap: 6px; }
.mission { display: flex; gap: 9px; align-items: flex-start; background: var(--panel-2); border-radius: 10px; padding: 7px 9px; font-size: 13px; }
.mission .m-check { width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--panel-3); flex: none; display: grid; place-items: center; font-size: 12px; color: #fff; }
.mission.done .m-check { background: var(--good); border-color: var(--good); }
.mission.done b { text-decoration: line-through; opacity: .8; }
.title-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 2px 2px; }
.climate { display: flex; gap: 2px; }
.climate i { width: 8px; height: 16px; border-radius: 3px; background: rgba(255,255,255,.1); }
.climate i.on { background: hsl(calc(130 - var(--k) * 130), 70%, 52%); }
.forecast { padding: 3px 9px; border-radius: 10px; background: var(--panel-2); }
.forecast.storm { background: linear-gradient(90deg, #1d3d73, #3b2a6b); animation: stormPulse 1.6s ease-in-out infinite; }
@keyframes stormPulse { 50% { box-shadow: 0 0 0 3px rgba(140, 170, 255, .35), 0 0 18px rgba(140, 170, 255, .45); } }
.ti-status { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.pill.ins { background: rgba(80, 150, 255, .2); color: #a9ccff; }
.pill.mort { background: rgba(224, 138, 30, .22); color: #ffc98a; }
.pill.land { background: rgba(217, 194, 90, .2); color: #f1dc84; }
.rules-body h4 { margin: 16px 0 4px; color: var(--gold); }

/* ---------- action cards ---------- */
.acard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 116px; min-height: 136px; padding: 10px 8px 9px; border: 0; border-radius: 12px; cursor: pointer; font: inherit; color: #1f2a2f; text-align: center;
	background: linear-gradient(180deg, #fff9ea 0%, #f3e6c4 100%); box-shadow: 0 3px 0 #c9b483, 0 10px 22px rgba(0, 0, 0, .35); transition: transform .15s, box-shadow .15s; }
.acard::before { content: ''; position: absolute; inset: 4px; border-radius: 9px; border: 2px solid rgba(47, 157, 102, .45); pointer-events: none; }
.acard.attack::before { border-color: rgba(217, 71, 60, .6); }
.acard.passive::before { border-color: rgba(47, 125, 225, .55); border-style: dashed; }
.acard:not(:disabled):hover { transform: translateY(-8px) rotate(-1deg); box-shadow: 0 3px 0 #c9b483, 0 18px 30px rgba(0, 0, 0, .45); }
.acard:disabled { cursor: default; filter: saturate(.6) brightness(.82); }
.ac-icon { font-size: 30px; line-height: 1.1; }
.ac-name { font-family: 'Fraunces', serif; font-weight: 900; font-size: 14px; }
.ac-text { font-size: 10.5px; font-weight: 700; line-height: 1.25; color: #4b5a5f; }
.ac-note { margin-top: auto; font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; color: #2f7de1; }
.acard.big { width: 168px; min-height: 210px; padding: 16px 12px 12px; }
.acard.big .ac-icon { font-size: 46px; }
.acard.big .ac-name { font-size: 19px; }
.acard.big .ac-text { font-size: 12.5px; }

.hand { position: absolute; right: 12px; bottom: 10px; z-index: 5; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: none; }
.hand > * { pointer-events: auto; }
.hand:empty { display: none; }
.hand-label { font-size: 11px; color: #fff; background: rgba(12, 32, 44, .8); padding: 3px 10px; border-radius: 999px; }
.hand-cards { display: flex; gap: 6px; }
.hand-cards .acard { transform-origin: bottom center; }
.hand-cards .acard:nth-child(1) { transform: rotate(-3deg); }
.hand-cards .acard:nth-child(3) { transform: rotate(3deg); }
.hand-cards .acard:not(:disabled):hover { transform: translateY(-10px) scale(1.06); z-index: 2; }

.draft { position: absolute; inset: 0; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(closest-side, rgba(8, 24, 34, .75), rgba(8, 24, 34, .35)); animation: pop .25s ease-out; }
.draft-title { font-family: 'Fraunces', serif; font-weight: 900; font-size: 26px; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.draft-cards { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.draft-cards .acard { animation: deal .45s ease-out backwards; }
.draft-cards .acard:nth-child(2) { animation-delay: .08s; }
.draft-cards .acard:nth-child(3) { animation-delay: .16s; }
@keyframes deal { from { opacity: 0; transform: translateY(40px) rotate(-8deg) scale(.8); } }

.hcards { display: inline-flex; gap: 2px; margin-right: 4px; }
.hcards i { width: 8px; height: 11px; border-radius: 2px; background: #f3e6c4; box-shadow: 0 1px 0 #c9b483; }
.bounty { font-size: 10.5px; font-weight: 900; padding: 1px 6px; border-radius: 999px; background: #c23b31; color: #fff; margin-right: 4px; animation: bountypulse 1.6s ease-in-out infinite; }
@keyframes bountypulse { 50% { box-shadow: 0 0 0 4px rgba(194, 59, 49, .35); } }
.hud .btn .avatar { width: 18px; height: 18px; vertical-align: middle; }

/* ---------- big moments: wheel, duel, coin ---------- */
.showfx { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(8, 24, 34, .45); pointer-events: none; animation: pop .2s ease-out; }
.fx-box { display: flex; flex-direction: column; align-items: center; gap: 14px; background: rgba(19, 50, 69, .96); padding: 18px 26px 22px; border-radius: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.fx-title { font-family: 'Fraunces', serif; font-weight: 900; font-size: 20px; }
.fx-result { font-family: 'Fraunces', serif; font-weight: 900; font-size: 24px; color: var(--gold); animation: pop .35s ease-out backwards; }
.fx-result.good { color: var(--accent-2); }
.fx-result.bad { color: #ff7b6e; }
.wheel-wrap { position: relative; width: 240px; height: 240px; }
.wheel { width: 100%; height: 100%; border-radius: 50%; border: 6px solid #fff3d6; box-shadow: 0 8px 24px rgba(0, 0, 0, .5), inset 0 0 0 3px rgba(0, 0, 0, .15); transition: transform 3.1s cubic-bezier(.12, .7, .14, 1); position: relative; }
.wheel span { position: absolute; left: 50%; top: 0; height: 50%; width: 0; transform-origin: bottom center; }
.wheel span b { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); writing-mode: vertical-rl; text-orientation: mixed; font-size: 11px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); white-space: nowrap; }
.wheel-pin { position: absolute; left: 50%; top: -8px; z-index: 2; transform: translateX(-50%); width: 0; height: 0; border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 24px solid #fff3d6; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.duel { display: flex; align-items: center; gap: 22px; }
.duel-side { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 14px; opacity: .75; }
.duel-side .avatar { width: 46px; height: 46px; }
.duel-side.win { opacity: 1; background: rgba(231, 184, 74, .18); box-shadow: 0 0 0 2px var(--gold); }
.duel-sum { font-family: 'Fraunces', serif; font-size: 30px; font-weight: 900; }
.duel-vs { font-family: 'Fraunces', serif; font-weight: 900; font-size: 22px; color: #ff7b6e; }
.duel .dice { animation: shake .5s ease-in-out 2; }
@keyframes shake { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.coin { position: relative; width: 110px; height: 110px; transform-style: preserve-3d; animation: flip-heads 1.5s cubic-bezier(.2, .7, .3, 1) forwards; }
.coin.tails { animation-name: flip-tails; }
.coin-face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; font-family: 'Fraunces', serif; font-weight: 900; font-size: 36px; color: #6b4b06; backface-visibility: hidden;
	background: radial-gradient(circle at 35% 30%, #fff1b0, #e7b84a 55%, #b88a1c); box-shadow: inset 0 0 0 6px rgba(107, 75, 6, .35), 0 8px 20px rgba(0, 0, 0, .45); }
.coin-face.back { transform: rotateY(180deg); background: radial-gradient(circle at 35% 30%, #ffd0c8, #e0675b 55%, #a8382e); color: #fff; }
@keyframes flip-heads { from { transform: rotateY(0) translateY(0); } 50% { transform: rotateY(900deg) translateY(-40px); } to { transform: rotateY(1800deg) translateY(0); } }
@keyframes flip-tails { from { transform: rotateY(0) translateY(0); } 50% { transform: rotateY(990deg) translateY(-40px); } to { transform: rotateY(1980deg) translateY(0); } }

@media (max-width: 860px) {
	.acard { width: 84px; min-height: 104px; padding: 7px 5px; }
	.acard .ac-text { display: none; }
	.acard.big { width: 30vw; min-height: 170px; }
	.acard.big .ac-text { display: block; }
	.wheel-wrap { width: 200px; height: 200px; }
}

/* ---------- resources, building cards, bank ---------- */
.resbar { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 10px; background: rgba(0, 0, 0, .22); flex: none; }
.resbar.over { box-shadow: 0 0 0 2px #e08a1e; }
.resbar .money { font-weight: 900; margin-right: 6px; color: var(--gold); white-space: nowrap; }
.resbar .money.neg { color: #ff7b6e; }
.res { display: inline-flex; flex-direction: column; align-items: center; min-width: 30px; padding: 2px 4px; border-radius: 7px; background: color-mix(in srgb, var(--rc) 28%, transparent); line-height: 1.05; }
.res i { font-style: normal; font-size: 15px; }
.res b { font-size: 13px; }
.res-total { font-size: 11px; color: var(--muted); margin-left: 2px; }
.rc { display: inline-flex; align-items: center; gap: 1px; padding: 0 4px; margin: 0 1px; border-radius: 6px; background: rgba(255, 255, 255, .12); font-size: 12px; font-weight: 800; white-space: nowrap; }
.rc.miss { background: rgba(217, 71, 60, .45); }
.pcards { font-size: 11px; color: var(--muted); }
.warnc { color: #f0a040; }
.pstat { font-size: 11px; font-weight: 900; margin-right: 4px; }
.numtok { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 8px; border-radius: 50%; background: #f6ecd2; color: #3b2a1a; font-weight: 900; font-size: 13px; vertical-align: middle; }
.ti-cards { display: flex; flex-wrap: wrap; gap: 4px; }
.bcard { padding: 3px 8px; border-radius: 8px; font-size: 12px; font-weight: 800; }
.bcard.green { background: rgba(63, 179, 122, .3); box-shadow: inset 0 0 0 1px rgba(63, 179, 122, .7); }
.bcard.red { background: rgba(217, 71, 60, .3); box-shadow: inset 0 0 0 1px rgba(217, 71, 60, .7); }
.ti-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 4px; }
.ti-war { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 10px; background: rgba(217, 71, 60, .12); }
.unit-btn { display: inline-flex; align-items: center; gap: 4px; }
.pill.unit { box-shadow: inset 0 0 0 2px var(--pc); }
.res-btn { background: color-mix(in srgb, var(--rc) 45%, var(--panel-3)); }
.bcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bcard-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border: 0; border-radius: 12px; cursor: pointer; font: inherit; color: #1f2a2f; text-align: center; background: linear-gradient(180deg, #f2fbf2, #d8efd8); box-shadow: 0 3px 0 #9fc79f; }
.bcard-pick.red { background: linear-gradient(180deg, #fff1ef, #f6d3cd); box-shadow: 0 3px 0 #d79a90; }
.bcard-pick.match { outline: 3px solid var(--gold); }
.bcard-pick:disabled { opacity: .5; cursor: default; }
.bcard-pick .ac-text { font-size: 11px; color: #4b5a5f; }
.bcard-pick .cost .rc { background: rgba(0, 0, 0, .1); color: #1f2a2f; }
.bcard-pick .cost .rc.miss { background: rgba(217, 71, 60, .35); }
.replace-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.replace-pick button { border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; font: inherit; background: var(--panel-3); color: var(--text); }
.replace-pick button.sel { background: #c23b31; }
.bank-table td { padding: 4px 6px; }
.bank-get { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.trade-res { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.trade-res label { display: inline-flex; align-items: center; gap: 2px; }
.trade-res input { width: 52px; padding: 4px 6px; }

/* ---------- card half moon (building + development cards) ---------- */
.hand { left: 50%; right: auto; bottom: -26px; transform: translateX(-50%); align-items: center; }
.fan { display: flex; justify-content: center; align-items: flex-end; padding: 0 20px; }
.fan-slot { margin: 0 -14px; transform-origin: 50% 160%; transform: rotate(var(--a)) translateY(var(--y)); transition: transform .18s; }
.fan-slot:hover { transform: rotate(var(--a)) translateY(calc(var(--y) - 26px)) scale(1.08); z-index: 50 !important; }
.fan .acard, .fan .acard:not(:disabled):hover { transform: none; }
.hand .hand-label { order: -1; margin-bottom: 6px; }
.acard.bld.green { background: linear-gradient(180deg, #f2fbf2, #d3edd3); box-shadow: 0 3px 0 #94c494, 0 10px 22px rgba(0, 0, 0, .35); }
.acard.bld.red { background: linear-gradient(180deg, #fff1ef, #f4cfc8); box-shadow: 0 3px 0 #d79a90, 0 10px 22px rgba(0, 0, 0, .35); }
.acard.bld .ac-note .rc { background: rgba(0, 0, 0, .1); color: #1f2a2f; font-size: 10px; }
.acard.bld.sel { outline: 4px solid var(--gold); }
.stage:has(.hand .fan) .cam-hint { display: none; }
.stack-row { padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); margin-top: 8px; }
.stack-row.focus { box-shadow: 0 0 0 2px var(--gold); }
.stack-head { display: flex; align-items: center; gap: 10px; }
.stack-head .btn { margin-left: auto; }
.stack-cards { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.stack-card { border: 0; border-radius: 8px; padding: 4px 8px; cursor: pointer; font: inherit; font-size: 12px; color: #1f2a2f; }
.stack-card.green { background: #d3edd3; }
.stack-card.red { background: #f4cfc8; }
.stack-card:disabled { opacity: .55; cursor: default; }
@media (max-width: 860px) { .fan-slot { margin: 0 -18px; } }

/* ---------- Fürstentum, dice, card kinds, dragging ---------- */
.land { position: relative; display: inline-flex; flex-direction: column; align-items: center; min-width: 34px; padding: 2px 4px 3px; border-radius: 8px; background: color-mix(in srgb, var(--rc) 30%, transparent); line-height: 1; }
.land em { position: absolute; top: -6px; left: -4px; font-style: normal; font-size: 10px; font-weight: 900; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; background: #f6ecd2; color: #3b2a1a; }
.land i { font-style: normal; font-size: 15px; }
.land .pips { display: flex; gap: 2px; margin-top: 2px; }
.land .pips b { width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.land .pips b.o { background: rgba(255, 255, 255, .2); }
.land small { position: absolute; bottom: -6px; right: -4px; font-size: 10px; font-weight: 900; background: var(--panel-3); border-radius: 6px; padding: 0 3px; }
.dice .die { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; font-weight: 900; font-size: 18px; margin-left: 4px; }
.dice .die.prod { background: #f2cf44; color: #3b2a1a; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }
.dice .die.event { background: #5a3d8a; color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.acard.bld.unit { background: linear-gradient(180deg, #eef3ff, #d3dcf2); box-shadow: 0 3px 0 #9aa8cc, 0 10px 22px rgba(0, 0, 0, .35); }
.acard.bld.action { background: linear-gradient(180deg, #fff8dc, #f3e3a4); box-shadow: 0 3px 0 #cfb35a, 0 10px 22px rgba(0, 0, 0, .35); }
.ac-stats { font-size: 11px; font-weight: 900; color: #3b2a1a; }
.drag-ghost { position: fixed; z-index: 1000; pointer-events: none; transform: translate(-50%, -60%) rotate(-4deg) scale(1.05); opacity: .92; }
.acard.dragging { opacity: .35; }
.fan .acard { touch-action: none; }
.stack-card.unit { background: #d3dcf2; }
.stack-card.action { background: #f3e3a4; }
.stack-card.picked { outline: 3px solid var(--gold); }
/* HUD in two rows: dice + Fürstentum on top, prompt + buttons below */
.hud { flex-wrap: wrap; row-gap: 6px; }
.hud .prompt { flex: 1 1 320px; min-width: 260px; }
.hud .hud-actions { flex-wrap: wrap; justify-content: flex-end; }
