/* The game screen keeps decisions close to the board. The lobby retains its simple layout. */
.in-game .layout { grid-template-columns:minmax(0,1fr) 248px; }
.in-game .panel { padding:18px 14px; }
.in-game .board-caption, .in-game #error, .in-game .panel>.hint,
.in-game .panel>.section:has(#mode), .in-game .panel>.section:has(#status) { display:none; }
.in-game .panel .player .resources { display:none; }
.in-game .panel .player { padding:12px; }
.in-game .panel .player .nameRow { flex-direction:column;align-items:start;gap:6px; }
.in-game .panel .player .name { font-size:16px; }
.in-game .panel .player .tag { font-size:14px;line-height:1.6; }
.in-game .panel>.section:has(#you) { color:var(--muted);font-size:14px; }
.in-game .panel #players { gap:10px; }
#gameTools { position:absolute;top:14px;left:16px;right:180px;display:flex;flex-wrap:wrap;gap:6px;z-index:5; }
#gameTools button { min-height:40px;padding:8px 11px;font-size:13px;background:#18333b; }
#gameTools button.has-offer { background:#e2b86d;color:#232d28;border-color:#ffe7a4; }
.in-game #board,.in-game.waiting #board { inset:140px 0 250px;height:calc(100% - 390px);margin:0; }
.in-game .turn-banner,.in-game.waiting .turn-banner { top:76px;bottom:auto;left:16px;right:16px;text-align:left;font-size:16px;line-height:1.45;padding:13px 16px;pointer-events:none;border-color:#608087; }
.in-game .turn-banner.my-turn { color:#fff0c8;border-color:#e7c584;background:#283a38; }
#diceResult { position:absolute;top:12px;right:16px;display:flex;gap:6px;align-items:center;padding:8px 12px;background:#14292e;border:1px solid #6f8885;border-radius:10px;z-index:4; }
.dice-caption { position:absolute;top:-8px;left:9px;padding:0 4px;font-size:11px;background:#14292e;color:#b9ceca; }
.die { color:#ffedc8;font-size:34px;line-height:1; }
#diceResult strong { font-size:25px;border-left:1px solid #ffffff26;margin-left:4px;padding-left:9px;color:#ffe1a0; }
#diceResult.seven { border-color:#efb18f; }
@keyframes roll-result { 0% {transform:scale(.85);box-shadow:0 0 0 9px #ffe4a066} 100% {transform:scale(1);box-shadow:none} }
#diceResult.just-rolled { animation:roll-result .6s ease-out; }
.in-game .hand { left:280px;right:16px;bottom:80px;transform:none;max-width:none;display:block;text-align:center;z-index:4; }
.hand-caption { font-size:12px;letter-spacing:.03em;color:#d0dfd4;margin-bottom:12px; }
.card-fan { display:flex;justify-content:center;align-items:end;min-height:132px;padding:22px 12px 0;isolation:isolate; }
.hand-card { position:relative;display:flex;flex-direction:column;justify-content:space-between;align-items:center;flex:0 0 96px;height:128px;border:2px solid #eddfb6;border-radius:10px;background:linear-gradient(145deg,color-mix(in srgb,var(--resource) 80%,#fff4cd),var(--resource));box-shadow:0 5px 12px #0006;color:#122d2b;padding:12px 5px 10px;transform:rotate(var(--angle));transform-origin:50% 140%;transition:transform .16s ease,box-shadow .16s ease;font-size:14px;font-weight:650; }
.hand-card+.hand-card { margin-left:calc(-1 * var(--card-overlap)); }
.card-icon { font:44px Georgia,serif;color:#193e35; }
.hand-card:hover,.hand-card:focus-visible { transform:translateY(-28px) rotate(0deg);z-index:2;box-shadow:0 10px 24px #0008;outline:3px solid #ffe6a0;outline-offset:2px; }
.hand-counters { display:none; }
.empty-hand { color:#b3cbc2;align-self:center;font-size:15px; }
.in-game .board-actions { left:280px;right:16px;bottom:14px;z-index:6;gap:7px; }
.board-actions button { min-height:48px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px; }
.board-actions button small { font-size:11px;font-weight:400;color:#d3d5c7;max-width:180px; }
.board-actions button:disabled { opacity:.64; }
.board-actions button:disabled small { color:#e7b6a2; }
.board-actions button.active { background:#5c5036;border:2px solid #ffe4a0; }
#cancelBuildMode { background:transparent;font-size:12px; }
#actionNotice { position:absolute;bottom:244px;left:50%;transform:translateX(-50%);width:min(560px,calc(100% - 32px));background:#683e36;color:#fff4e9;border:1px solid #ffbd99;border-radius:10px;box-shadow:0 8px 28px #0005;padding:12px 14px;z-index:30;display:flex;align-items:center;gap:12px;font-size:15px; }
#actionNotice button { margin-left:auto;flex-shrink:0;min-height:34px;font-size:12px;background:#442b28; }
#tradeWindow { position:absolute;right:16px;top:138px;width:365px;max-width:calc(100% - 32px);max-height:calc(100% - 156px);overflow:auto;background:#202d29;color:#f0f3e7;border:1px solid #aeb898;border-radius:12px;box-shadow:0 16px 50px #0007;padding:18px;z-index:20; }
#tradeWindow header,.game-dialog header { display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px; }
#tradeWindow h2,.game-dialog h2 { font-size:21px;margin:0; }
#tradeWindow header button,.game-dialog header button { font-size:24px;min-height:36px;width:36px;padding:0;background:transparent; }
.trade-tabs { display:flex;gap:8px;margin-bottom:12px; }
.trade-tabs button { flex:1;font-size:13px;padding:8px; }
#tradeAlert { font-size:14px;line-height:1.5;color:#e3c88f;margin-bottom:14px; }
#tradeWindow details { padding:0;background:none;border:0;margin:0; }
#tradeWindow details>summary { display:none; }
.tradeRow { align-items:end; }
.trade-field { display:flex;flex-direction:column;gap:6px;min-width:0;font-size:13px;color:#b8c5b7; }
.trade-field select,.trade-field input { font-size:15px; }
#tradePending { border-left:3px solid #e3c68d;padding:8px 10px;margin:12px 0;color:#ffedc9; }
#tradePending:empty { display:none; }
#acceptTrade { background:#365d49;border-color:#82c29a; }
#tradeWindow .error,.game-dialog .error { margin-bottom:16px; }
.game-dialog { width:min(520px,calc(100% - 24px));max-height:calc(100dvh - 32px);overflow:auto;background:#202d29;color:#f1f1e7;border:1px solid #88998b;border-radius:14px;padding:24px;box-shadow:0 20px 70px #0008; }
.game-dialog::backdrop { background:#071819b8;backdrop-filter:blur(3px); }
.game-dialog .section { margin-bottom:14px; }
.game-dialog details { background:none;border:0;padding:0; }
.game-dialog details>summary { display:none; }
.event-description { font-size:16px;line-height:1.6;color:#d4dfd3;margin-bottom:20px; }
.game-dialog #discardPanel>.small,.game-dialog #robberPanel>.small { display:none; }
.game-dialog #discardHint { color:#ffe2a2;font-size:16px; }
.game-dialog #discardBtn { width:100%;margin-top:14px;background:#e1b76e;color:#233125; }
.game-dialog .dialog-content>button { width:100%;margin-top:14px; }
#chatPanel { position:absolute;left:16px;bottom:16px;width:248px;max-width:calc(100% - 32px);z-index:10;background:#162c30f5;border:1px solid #68817b;border-radius:10px;padding:12px;box-shadow:0 6px 24px #0004; }
#chatPanel summary { font-size:14px; }
#chatPanel[open] { width:300px; }
#chatPanel .chatMessages { height:180px;font-size:14px; }
#chatPanel .chatRow { margin-bottom:0; }
#chatPanel input { min-height:40px;padding:8px;font-size:14px; }
#chatPanel button { min-height:40px;padding:8px; }
#accessibleTargets { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%); }
#accessibleTargets:focus-within { clip-path:none;left:12px;top:145px;width:230px;height:auto;max-height:45%;overflow:auto;z-index:35;padding:12px;background:#203d39;border:2px solid #ffe4a0; }
#accessibleTargets button { display:block;width:100%;margin:4px 0;text-align:left; }
body:not(.in-game) #gameTools,body:not(.in-game) #diceResult,body:not(.in-game) #chatPanel { display:none; }
@media (max-width:1100px) and (min-width:851px) {
 .in-game .layout { grid-template-columns:minmax(0,1fr) 205px; }
 #gameTools { right:157px;gap:4px; }
 #gameTools button { font-size:12px;padding:8px; }
 .in-game .hand,.in-game .board-actions { left:16px; }
 #chatPanel { bottom:244px;width:150px; }
 #chatPanel[open] { width:285px; }
 .hand-card { flex-basis:82px;height:115px; }
}
@media (max-width:850px) {
 .in-game .layout { display:flex;flex-direction:column;height:auto; }
 .in-game .tabletop { height:calc(100dvh - 56px);min-height:660px; }
 .in-game .panel { padding:12px;border-top:1px solid #ffffff24; }
 .in-game .panel>.section:has(#you) { display:none; }
 .in-game #players { display:flex;overflow:auto; }
 .in-game #players>.player { flex:0 0 155px; }
 #gameTools { top:12px;left:12px;right:130px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin;padding-bottom:6px; }
 #gameTools button { flex-shrink:0;font-size:12px;min-height:38px; }
 #diceResult { right:10px;top:13px;gap:2px;padding:8px; }
 .die { font-size:24px; }
 #diceResult strong { font-size:22px;margin-left:2px;padding-left:6px; }
 .dice-caption { font-size:10px; }
 .in-game .turn-banner,.in-game.waiting .turn-banner { left:12px;right:12px;top:72px;font-size:14px;padding:10px 12px; }
 .in-game #board,.in-game.waiting #board { inset:142px 0 230px;height:calc(100% - 372px); }
 .in-game .hand { left:12px;right:12px;bottom:94px; }
 .hand-caption { margin-bottom:8px;font-size:12px; }
 .card-fan { display:none; }
 .hand-counters { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px; }
 .resource-counter { display:flex;flex-direction:column;gap:3px;border:1px solid #8da49b;border-top:4px solid var(--resource);border-radius:8px;padding:8px 2px;background:#152d30; }
 .resource-counter strong { font-size:25px;line-height:1; }
 .resource-counter span { font-size:11px;color:#e2e8da; }
 .in-game .board-actions { left:12px;right:12px;bottom:12px;gap:5px; }
 .board-actions button { padding:8px;min-height:48px;font-size:13px;flex:1; }
 .board-actions button small { font-size:10px;max-width:110px; }
 #cancelBuildMode { flex-basis:100%;min-height:30px;font-size:11px;padding:4px; }
 body:has(#cancelBuildMode:not([hidden])) .hand { bottom:126px; }
 #chatPanel { left:12px;bottom:194px;width:94px;padding:9px; }
 #chatPanel[open] { width:calc(100% - 24px);bottom:194px; }
 #chatPanel .chatMessages { height:145px; }
 #tradeWindow { position:fixed;top:126px;right:12px;width:365px;max-height:calc(100dvh - 150px); }
 #actionNotice { position:fixed;bottom:180px;font-size:14px; }
 .game-dialog { padding:20px; }
 .game-dialog h2 { font-size:20px; }
}
@media (prefers-reduced-motion:reduce) {
 #diceResult.just-rolled { animation:none; }
 .hand-card { transition:none; }
}
.in-game #board,.in-game.waiting #board { inset:132px 0 210px;height:calc(100% - 342px); }
@media (max-width:850px) {
 .in-game #board,.in-game.waiting #board { inset:136px 0 230px;height:calc(100% - 366px); }
}
.in-game.phase-setup #board { bottom:112px;height:calc(100% - 244px); }
.in-game.waiting #board { bottom:30px;height:calc(100% - 162px); }
.phase-setup .hand { bottom:16px; }
.phase-setup .hand-caption,.phase-setup .card-fan { display:none; }
.phase-setup .hand-counters { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;max-width:400px;margin:auto; }
.phase-setup .resource-counter { background:#173137;border-top:3px solid var(--resource);border-radius:8px;display:flex;justify-content:center;align-items:center;gap:6px;padding:8px;font-size:12px; }
.phase-setup .resource-counter strong { font-size:20px; }
@media (max-width:850px) {
 .in-game.phase-setup #board { bottom:142px;height:calc(100% - 278px); }
 .phase-setup .hand { bottom:26px; }
 .phase-setup .resource-counter { flex-direction:column;padding:7px 2px;gap:3px; }
 .phase-setup #chatPanel { bottom:115px; }
}
@media (max-width:850px) {
 .in-game .hand { bottom:118px; }
 .in-game .board-actions { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:stretch; }
 .board-actions button { min-width:0; }
 .board-actions button small { overflow-wrap:anywhere; }
 .board-actions button:first-child:last-child { grid-column:1/-1; }
 #cancelBuildMode { grid-column:1/-1; }
 body:has(#cancelBuildMode:not([hidden])) .hand { bottom:158px; }
 .in-game.phase-setup .hand { bottom:26px; }
 .in-game #board { bottom:254px;height:calc(100% - 390px); }
 .in-game.phase-setup #board { bottom:142px;height:calc(100% - 278px); }
 .in-game.waiting #board { bottom:30px;height:calc(100% - 166px); }
}
#tradeExchange { display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:16px; }
.exchange-card { display:flex;flex-direction:column;gap:8px;padding:12px;border:1px solid #6f8274;border-top:4px solid var(--resource);border-radius:8px;background:#172b25; }
.exchange-card small { font-size:12px;color:#c1d0be; }
.exchange-card strong { font-size:17px;color:#fff0c8; }
.incoming-offer #playerTradePanel .tradeRow,.incoming-offer #playerTradePanel .buttons:has(#offerTrade) { display:none; }
#acceptTrade,#declineTrade { min-height:48px; }
.in-game .turn-banner { display:flex;justify-content:space-between;align-items:center;gap:12px; }
.turn-countdown { flex-shrink:0;border-left:1px solid #ffffff36;padding-left:12px;font-size:14px;color:#ffe5a7; }
.turn-countdown.urgent { color:#ffb89a;font-weight:700; }
@media (min-width:851px) { .hand-caption { display:none; } }
/* Development cards expose both ownership and the reason a card is locked. */
.game-dialog:has(#devCardPanel:not([hidden])) { width:min(820px,calc(100% - 24px)); }
.dev-rule { color:#d5ddcf;font-size:15px;line-height:1.65;margin-bottom:14px; }
.dev-summary { padding:12px 14px;border:1px solid #aeb995;border-radius:8px;color:#ffe4a0;font-size:16px;font-weight:600;margin-bottom:18px; }
.development-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px; }
.development-card { display:flex;flex-direction:column;gap:10px;background:#1a2420;border:1px solid #758376;border-radius:10px;padding:18px; }
.development-card h3 { font-size:19px;margin:0;color:#efe9d4; }
.development-card .dev-count { font-size:32px;line-height:1.1;color:#e3c88e; }
.development-card .dev-quantities { font-size:13px;color:#b9c9b8; }
.development-card .dev-effect { font-size:14px;line-height:1.6;color:#d6dfd0; }
.development-card .dev-status { padding:9px 10px;background:#313830;border-radius:6px;color:#e3cda9;font-size:13px;line-height:1.5;margin-top:auto; }
.development-card.ready { border:2px solid #a8d59b;background:#223c2d; }
.development-card.ready .dev-status { background:#345a3b;color:#e0ffd4;font-weight:650; }
.development-card.fresh:not(.ready) .dev-status { color:#d6e5ff;background:#2c3b4e; }
.development-card.unowned .dev-count { color:#8c9d8d; }
.development-card.unowned h3 { color:#bdc9b9; }
.development-card button { margin:0!important;min-height:44px; }
.development-card.ready button { background:#deb973;color:#253021; }
.dev-choice { display:flex;flex-direction:column;gap:6px;color:#c5d3c0;font-size:13px; }
.dev-buy { margin-top:20px;padding-top:18px;border-top:1px solid #758376; }
.dev-buy p { font-size:14px;color:#dedbc5;margin-bottom:12px; }
.dev-buy button { width:100%;margin:0!important; }
#chatPanel.has-unread { border-color:#ef8f89;box-shadow:0 0 0 2px #d4515138; }
.chat-unread-badge { display:inline-flex;align-items:center;justify-content:center;min-width:23px;height:23px;padding:0 6px;background:#c63842;color:#fff;border:1px solid #ffabae;border-radius:20px;margin-left:auto;font-size:12px;font-weight:750; }
#tradeOutcome { border:1px solid #a8b99a;background:#283e2c;color:#ecffe4;padding:14px;border-radius:8px;margin-bottom:14px;font-size:16px;line-height:1.6;font-weight:600; }
#tradeOutcome.declined { border:2px solid #ea8e87;background:#58312e;color:#ffe5de; }
#tradeResponses { display:grid;gap:7px;margin-bottom:14px; }
.trade-response { display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid #ffffff20;padding:8px 0;font-size:14px; }
.trade-response strong { font-size:12px;border-radius:5px;padding:5px 8px; }
.trade-response .declined { background:#65362f;color:#ffd2c5; }
.trade-response .accepted { background:#32523b;color:#d7f8c7; }
.trade-response .waiting { background:#343d35;color:#ced5c7; }
#actionNotice.notice-status { background:#304d3a;border-color:#b3d49e;color:#ecffe3; }
@media (max-width:850px) {
 .development-grid { grid-template-columns:1fr; }
 .development-card { padding:16px; }
}
.player-hand-counts { display:flex;flex-wrap:wrap;gap:7px;margin-top:8px; }
.player-hand-counts span { border:1px solid #6c7f73;background:#182b25;border-radius:6px;padding:5px 7px;font-size:12px;color:#cad7c7; }
.player-hand-counts strong { color:#f8e6bb;font-size:15px;margin-left:4px; }
.dev-buy { margin-top:0;margin-bottom:20px;padding:12px 0 16px; }
.game-dialog header { position:sticky;top:0;background:#202d29;z-index:2;padding:4px 0 10px; }
.in-game .panel>.section:has(#you) { display:none; }
@media (min-width:851px) {
}
#diceResult { min-width:106px;min-height:44px;justify-content:center; }
.dice-caption { white-space:nowrap; }
@media (min-width:851px) {
}
.dev-buy .dev-purchase-notice { margin:12px 0 0;padding:12px;border:1px solid #acbfdf;background:#293b4f;border-radius:7px;color:#e3efff;font-size:15px;line-height:1.55; }
@media (max-width:850px) { #chatPanel:not([open]) { width:128px; } }
.player-hand-counts { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px; }
.player-hand-counts span { display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 3px;font-size:11px; }
.player-hand-counts strong { margin:0;font-size:18px;line-height:1; }
@media (max-width:850px) { .player-hand-counts span { font-size:10px; } }
/* Keep the dialog header out of the scrolling text area. */
.game-dialog { overflow:hidden; }
.game-dialog[open] { display:flex;flex-direction:column; }
.game-dialog header { position:static;flex:0 0 auto;margin:0 0 14px;padding:4px 0 14px;border-bottom:1px solid #6d8071; }
.game-dialog>.dialog-content { min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:8px;scrollbar-width:thin; }
.game-dialog>.dialog-error { flex:0 0 auto;max-height:140px;overflow:auto; }
.mode-help { margin:0 0 14px;font-size:13px; }
#gameModeBadge { min-height:28px;padding:4px 10px;font-size:12px;border-color:#aaa376;background:#3a4536;color:#f6e5bb; }
.mode-rules h3 { margin:0 0 8px;font-size:18px; }
.mode-rules p { font-size:15px;line-height:1.6;color:#d4dfca; }
.robbery-flight { position:fixed;width:76px;height:108px;display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:8px 4px;pointer-events:none;z-index:1000;border:2px solid #ffe6aa;border-radius:9px;box-shadow:0 12px 30px #0008;background:linear-gradient(145deg,color-mix(in srgb,var(--resource) 75%,#fff5ce),var(--resource));color:#153b30;will-change:transform,opacity; }
.robbery-flight small { max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;font-weight:650; }
.robbery-flight strong { font:34px Georgia,serif; }
.robbery-flight span { font-size:12px;font-weight:700; }
@keyframes resource-arrival { 0%,100% {filter:brightness(1)} 40% {filter:brightness(1.5);box-shadow:0 0 20px #ffe4a0aa} }
.resource-arrival { animation:resource-arrival .9s ease-out; }
@media (max-width:850px) { #gameModeBadge { font-size:10px;padding:4px 7px; } }
@media (prefers-reduced-motion:reduce) { .resource-arrival { animation:none; } }
/* Personal decisions belong beside the hand; the top menu contains information. */
#personalActions { position:absolute;left:16px;bottom:16px;width:248px;display:grid;gap:8px;z-index:7; }
#personalActions button { display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-height:60px;padding:12px 14px;text-align:left;background:#263a35;border-color:#819186; }
#personalActions strong { font-size:15px;color:#f2e7cd; }
#personalActions small { color:#bfcfc1;font-size:12px;font-weight:400; }
#personalActions .dev-ready { background:#344c37;border-color:#a9c68d; }
#personalActions .dev-ready small { color:#d5efbe; }
#personalActions .has-offer { background:#665234;border-color:#e4c080; }
#personalActions button:disabled { opacity:.6; }
body:not(.in-game) #personalActions,.waiting #personalActions { display:none; }
#chatPanel { bottom:160px; }
.dev-filters { display:flex;gap:8px;margin:0 0 20px; }
.dev-filters button { background:transparent;font-size:13px; }
.dev-filters button[aria-pressed=true] { border-color:#c5b07d;background:#3a4030;color:#ffedc4; }
.dev-empty-state { padding:24px;border:1px dashed #7a8a7a;border-radius:10px;color:#cbd5c5;line-height:1.6;margin-bottom:20px; }
.development-grid { grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch;gap:16px; }
.development-card { position:relative;overflow:hidden;padding:18px 16px;gap:9px;border-radius:12px;background:#27332e;border:1px solid #6c7f70;border-top:4px solid var(--card-accent,#9aaa92); }
.development-card[data-type=KNIGHT] { --card-accent:#a9bace; }
.development-card[data-type=ROAD_BUILDING] { --card-accent:#d0ad87; }
.development-card[data-type=YEAR_OF_PLENTY] { --card-accent:#a7c996; }
.development-card[data-type=MONOPOLY] { --card-accent:#b9a2c6; }
.development-card[data-type=VICTORY_POINT] { --card-accent:#e0c47b; }
.dev-emblem { width:64px;height:64px;display:grid;place-items:center;align-self:center;border:1px solid var(--card-accent);border-radius:50%;color:var(--card-accent);font:42px Georgia,serif;margin:12px 0; }
.development-card h3 { font:600 19px system-ui;text-align:center; }
.development-card .dev-count { position:absolute;top:10px;right:12px;font:600 17px system-ui;color:#eee4ca;background:#17241e;padding:4px 7px;border-radius:5px; }
.development-card .dev-quantities { font-size:12px;text-align:center;line-height:1.5;min-height:36px; }
.development-card .dev-effect { font-size:13px;line-height:1.6;min-height:84px; }
.development-card .dev-status { font-size:12px;min-height:48px;display:flex;align-items:center; }
.development-card.ready { border:1px solid #a7c38d;border-top:4px solid var(--card-accent);background:#2c3d30; }
.development-card.unowned { background:#242e29; }
.dev-summary { padding:0;border:0;background:none;color:#d9c99e;font-size:14px;font-weight:500; }
.dev-rule { font-size:13px;line-height:1.6;color:#b8c5b6; }
.dev-buy { display:flex;flex-wrap:wrap;gap:12px;align-items:center;padding:16px;background:#18271f;border:1px solid #536952;border-radius:9px;margin:0 0 22px; }
.dev-buy p { flex:1;margin:0;font-size:13px;line-height:1.6; }
.dev-buy button { width:auto;max-width:100%;font-size:13px; }
.dev-buy .dev-purchase-notice { flex-basis:100%; }
@media (max-width:1100px) and (min-width:851px) {
 #personalActions { width:198px; }
 .in-game .hand,.in-game .board-actions { left:230px; }
 #chatPanel { bottom:160px;width:198px; }
}
@media (max-width:850px) {
 #personalActions { left:12px;right:12px;bottom:82px;width:auto;grid-template-columns:1fr 1fr;gap:8px; }
 #personalActions button { padding:9px 10px;min-height:54px;gap:4px; }
 #personalActions strong { font-size:13px; }
 #personalActions small { font-size:10px; }
 .in-game .hand { bottom:148px; }
 body:has(#cancelBuildMode:not([hidden])) .hand { bottom:185px; }
 .in-game #board { bottom:280px;height:calc(100% - 416px); }
 .in-game.phase-setup .hand { bottom:148px; }
 .in-game.phase-setup #board { bottom:248px;height:calc(100% - 384px); }
 .in-game.waiting #board { bottom:30px;height:calc(100% - 166px); }
 #chatPanel,#chatPanel[open],.phase-setup #chatPanel { bottom:246px; }
 .development-grid { grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }
 .development-card { padding:12px; }
 .development-card h3 { font-size:16px; }
 .dev-emblem { width:52px;height:52px;font-size:34px;margin:18px 0 5px; }
 .development-card .dev-effect { min-height:110px; }
 .dev-buy { display:block; }
 .dev-buy button { width:100%;margin-top:12px!important; }
}
@media (max-width:390px) { .development-grid { grid-template-columns:1fr; }.development-card .dev-effect { min-height:0; } }
@media (max-width:600px) {
 .development-grid { grid-template-columns:1fr; }
 .development-card .dev-effect { min-height:0; }
 .development-card .dev-quantities { min-height:0; }
}
/* Multi-card offers keep both baskets readable, including on narrow screens. */
.trade-rule-option { margin:16px 0;align-items:flex-start; }
.trade-rule-option small { display:block;font-size:12px;line-height:1.55;color:var(--muted);margin-top:5px; }
#tradeWindow { width:420px; }
.trade-basket { min-width:0;margin:0;padding:12px;border:1px solid #6e8375;border-radius:9px;background:#1a2a23; }
.trade-basket legend { padding:0 6px;font-size:14px;font-weight:650;color:#ede0bb; }
.basket-lines { display:grid;gap:12px; }
.basket-line { display:grid;grid-template-columns:minmax(0,1fr) 68px 32px;column-gap:6px;row-gap:4px; }
.basket-line select,.basket-line input { min-height:42px;padding:8px;font-size:14px;border-radius:6px; }
.basket-line select { padding-right:22px; }
.basket-line input { text-align:center; }
.basket-remove { min-height:42px;padding:0;font-size:22px;background:transparent; }
.basket-remove:disabled { visibility:hidden; }
.basket-stock { grid-column:1/3;font-size:11px;color:#b5c7b5; }
.basket-stock:empty { display:none; }
.basket-add { background:transparent;border-style:dashed;font-size:12px;padding:8px;min-height:36px;width:100%;margin-top:12px;color:#cbd9c1; }
.trade-direction { text-align:center;color:#c7b589;font-size:24px;padding:5px; }
.trade-card-rule { font-size:12px!important;line-height:1.5!important;margin:12px 0 16px; }
.exchange-basket { display:flex;flex-direction:column;gap:7px;min-width:0; }
.exchange-basket>small { color:#c4cdbd;font-size:12px; }
.exchange-basket .exchange-card { padding:10px;font-size:14px;line-height:1.5;overflow-wrap:anywhere; }
.has-pending-offer #playerTradePanel>.trade-basket,.has-pending-offer #playerTradePanel>.trade-direction,.has-pending-offer #playerTradePanel>.trade-card-rule,.has-pending-offer #playerTradePanel>.tradeRow { display:none; }
@media (max-width:850px) {
 #tradeWindow { width:420px; }
 .trade-basket { padding:10px; }
 .basket-line { grid-template-columns:minmax(0,1fr) 62px 30px; }
}
/* A quiet finish with the island still visible behind the result. */
#tool-victory { color:#ffe7b0;border-color:#c8ab6e;background:#3c402e; }
#victoryDialog { width:min(680px,calc(100% - 24px));border-color:#ad9b6e;background:#202d27; }
#victoryDialog header { margin-bottom:8px; }
#victoryDialog header h2 { font-size:15px;color:#c7cfbc; }
.victory-hero { text-align:center;padding:0 12px 16px; }
.victory-emblem { width:64px;height:64px;margin:0 auto 8px;border:1px solid #bba16a;border-radius:50%;display:grid;place-items:center;background:#333c2b;animation:victory-arrive .45s ease-out; }
.victory-emblem svg { width:48px;height:48px;stroke:#e6c47b;stroke-width:2;stroke-linecap:round;stroke-linejoin:round; }
.victory-emblem .trophy-star { stroke-width:1;fill:#e6c47b; }
.victory-eyebrow { color:#bdaa7e;font-size:10px;font-weight:650;letter-spacing:2px;margin-bottom:8px; }
#victoryDialog .victory-hero h2 { font:600 clamp(25px,4vw,36px) system-ui;color:#f6e8c9;margin:0 0 10px;overflow-wrap:anywhere;line-height:1.2; }
.victory-subtitle { color:#c6d0be;font-size:14px;line-height:1.5; }
.victory-facts { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-top:1px solid #75826966;border-bottom:1px solid #75826966;margin-bottom:14px;padding:14px 0; }
.victory-facts>div { display:flex;flex-direction:column;align-items:center;gap:4px;padding:0 6px;text-align:center; }
.victory-facts>div+div { border-left:1px solid #75826966; }
.victory-facts strong { font-size:17px;font-weight:600;color:#e8dfc7; }
.victory-facts span { font-size:11px;color:#aebda8; }
.victory-standings { list-style:none;padding:0;margin:0;display:grid;gap:7px; }
.victory-player { display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:12px;border:1px solid #5d715766;border-radius:8px;padding:11px 14px;background:#1a2921; }
.victory-player.champion { border-color:#c6ae73;background:#35402c; }
.victory-rank { color:#b1bfaa;text-align:center;font-size:15px; }
.champion .victory-rank { color:#f0d48b;font-size:23px; }
.victory-player>div:not(.victory-points) { display:flex;flex-direction:column;gap:5px;min-width:0; }
.victory-player strong { font-size:15px;overflow-wrap:anywhere; }
.victory-player small { color:#adbea5;font-size:11px;line-height:1.45; }
.victory-points { display:flex;flex-direction:column;align-items:center;min-width:40px; }
.victory-points strong { font-size:24px;color:#eddfb6;font-weight:600;line-height:1.1; }
.victory-points small { font-size:10px; }
.victory-actions { display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:20px; }
.victory-actions button { min-height:46px; }
.victory-saved { font-size:11px;line-height:1.5;color:#a8b7a0;text-align:center;margin-top:12px; }
@keyframes victory-arrive { from {opacity:0;transform:translateY(8px) scale(.93);} to {opacity:1;transform:none;} }
@media (max-width:600px) {
 #victoryDialog { padding:18px; }
 .victory-hero { padding:0 0 16px; }
 .victory-emblem { width:64px;height:64px; }
 .victory-emblem svg { width:46px;height:46px; }
 .victory-subtitle { font-size:13px; }
 .victory-player { padding:10px;gap:8px;grid-template-columns:22px minmax(0,1fr) auto; }
 .victory-player strong { font-size:14px; }
 .victory-points strong { font-size:22px; }
 .victory-facts strong { font-size:15px; }
 .victory-actions button { font-size:13px;padding:10px; }
}
@media (prefers-reduced-motion:reduce) { .victory-emblem { animation:none; } }

/* Keep the optional mode badge at the right edge without a connected label. */
#gameModeBadge { margin-left:auto; }
