/* The rim always means player identity; a gold card means card ownership. */
.identity-avatar{display:inline-grid;place-items:center;position:relative;flex:0 0 auto;width:30px;height:30px;box-sizing:border-box;overflow:hidden;border:2px solid var(--player-color);border-radius:50%;background:#203b43;color:var(--player-color);font:600 16px/1 'Barlow Condensed',sans-serif;vertical-align:middle}
.identity-avatar img{display:block;width:100%;height:100%;object-fit:cover}
/* Align the left edge with the rondel while preserving the compact chat width. */
.command-view #table-feed,.command-view.map-expanded #table-feed{left:var(--ribbon-left,10px);max-width:calc(100vw - var(--ribbon-left,10px) - 10px);box-sizing:border-box}
#table-feed .feed-player{display:inline-flex;align-items:center;gap:7px;max-width:none}
#table-feed .feed-player::before{display:none}
#table-feed .feed-player-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#table-feed:not(.is-open){background:#edf0e5;color:#203643;height:46px;min-height:46px;border-color:#9fae9e;border-radius:5px}
#table-feed:not(.is-open) #feed-latest{padding:0;height:100%}
#table-feed:not(.is-open) .feed-entry,#table-feed:not(.is-open) .feed-entry:last-child{padding:0 48px 0 10px;gap:10px;box-sizing:border-box;width:100%;height:100%;border-left-width:4px}
#table-feed:not(.is-open) .feed-player{max-width:180px;overflow:visible;font-size:12px}
#table-feed:not(.is-open) .feed-player-name{max-width:125px}
#table-feed:not(.is-open)>header{top:0;right:0;bottom:0;display:flex;padding:0 5px;background:transparent}
#table-feed:not(.is-open) .hud-disclosure{width:32px;height:34px;color:#203643;background:transparent;border:0}
#table-feed:not(.is-open) .hud-disclosure:hover{background:#20364312}
#table-feed:not(.is-open) .feed-empty{padding:0 48px 0 12px;color:#40565c;line-height:44px}
#table-feed:not(.is-open) .feed-text{line-height:44px;flex:1}
@media(max-width:760px){#table-feed:not(.is-open) .feed-player-name{display:none}#table-feed:not(.is-open) .feed-entry{gap:7px}#table-feed:not(.is-open) .feed-nation{max-width:80px;overflow:hidden;white-space:nowrap}}
.command-view:not(.board-lab) .topbar.has-player-roster{display:grid;grid-template-columns:auto minmax(210px,1fr) minmax(130px,210px) auto;grid-template-rows:1fr;align-items:center;gap:10px;height:58px;min-height:58px;max-height:58px;box-sizing:border-box;padding:0 14px;overflow:visible}
.command-view.remote-view:not(.board-lab) .topbar.has-player-roster{grid-template-columns:auto minmax(210px,1fr) minmax(130px,210px) auto auto}
.has-player-roster .brand h1{font-size:22px!important}
.has-player-roster #player-roster{display:flex;justify-content:center;align-items:center;gap:2px;min-width:0;flex-wrap:nowrap}
#player-roster .player-seat{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;flex:0 1 48px;min-width:0;height:52px;min-height:0;padding:2px 1px;border:0;border-radius:6px;background:transparent;color:#eae5d6;transition:background .15s}
#player-roster .player-seat:hover{background:#ffffff0c}
#player-roster .player-seat:focus-visible{outline:2px solid #ebd195;outline-offset:1px}
.player-avatar{position:relative;display:block;flex-shrink:0;width:34px;height:34px}
.player-portrait{position:relative;display:grid;place-items:center;width:100%;height:100%;overflow:hidden;border:2px solid var(--player-color);border-radius:50%;box-sizing:border-box;background:radial-gradient(circle at 35% 25%,#395860,#172b32);box-shadow:0 2px 5px #06151b66}
.player-portrait img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.player-monogram{font:600 18px/1 'Barlow Condensed',sans-serif;color:var(--player-color)}
.player-seat-name{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:500 9px/1.2 'DM Sans',sans-serif}
#player-roster .is-deciding .player-seat-name{color:#fff5d8}
#player-roster .is-deciding::after{content:'';position:absolute;bottom:0;left:calc(50% - 8px);width:16px;height:2px;border-radius:2px;background:var(--player-color)}
.player-investor-card{position:absolute;right:-4px;bottom:-1px;display:block;width:14px;height:19px;border:1px solid #edd28d;border-radius:1px;background:linear-gradient(115deg,#e5cb87,#c7a253);box-shadow:0 1px 2px #0005;transform:rotate(6deg)}
.player-investor-card svg{display:none}
.has-player-roster #turn-panel{min-width:0;justify-content:center;grid-column:auto;grid-row:auto}
.has-player-roster .turn-context small{display:none}
.has-player-roster .turn-owner>strong{font-size:18px}
.has-player-roster .turn-beacon{padding:5px 8px;gap:7px;max-width:100%}
.has-player-roster .turn-context{padding-left:7px;margin:0}
.command-view.remote-view:not(.board-lab) .has-player-roster #remote-bar{gap:6px;min-width:max-content}
.command-view.remote-view:not(.board-lab) .has-player-roster #remote-bar>div{flex:0 0 auto}
.command-view.remote-view:not(.board-lab) .has-player-roster #remote-bar button{font-size:14px;padding:0 10px}
.has-player-roster .top-actions{gap:6px!important;flex-wrap:nowrap}
/* One shared control height, including the separately mounted players button. */
.command-view:not(.board-lab) .topbar.has-player-roster{--header-control-height:34px;column-gap:6px}
.command-view:not(.board-lab) .topbar.has-player-roster :is(#remote-diplomacy,#power-race-open,#music-menu,#help,#new-game){display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;height:var(--header-control-height);min-height:var(--header-control-height);padding-block:0;line-height:1;border-radius:4px}
#remote-diplomacy svg{display:none}
#player-card-dialog{width:min(350px,calc(100vw - 32px));box-sizing:border-box;padding:28px 24px 22px;overflow-y:auto;text-align:center;color:#f3ead6;background:linear-gradient(140deg,#28464d,#142d35);border:1px solid #b59a63;border-radius:12px}
#player-card-dialog::backdrop{background:#0b202a99;backdrop-filter:blur(3px)}
#player-card-dialog .close{color:#f1e5cc}
.player-card-face{width:116px;height:116px;margin:0 auto 18px}.player-card-face .player-portrait{border-width:3px}.player-card-face .player-monogram{font-size:38px}
#player-card-dialog .section-label{color:#c8c7ad;margin-bottom:5px}#player-card-dialog h2{color:#f4e5bf;margin:0;font:600 32px/1.2 'Barlow Condensed',sans-serif}
.player-card-state{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:9px;margin:12px 0;color:#d8d8be;font-size:12px}.player-card-holder{display:flex;align-items:center;gap:6px;color:#ecd18f}.player-card-holder svg{width:17px;height:23px;fill:none;stroke:currentColor;stroke-width:1.2}
#player-card-dialog dl{margin:16px 0 0;border-top:1px solid #c5b27d40;text-align:left}#player-card-dialog dl>div{display:flex;align-items:baseline;justify-content:space-between;gap:15px;padding-top:13px}#player-card-dialog dt{font-size:12px;color:#c0cec9}#player-card-dialog dd{margin:0;font-size:14px;text-align:right;overflow-wrap:anywhere}
.player-card-governments{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px 12px}
.player-card-governments>span{display:inline-flex;align-items:center;gap:7px}
.player-card-governments img{width:24px;height:16px;object-fit:cover;border-radius:2px;flex-shrink:0}
.player-card-bonds{margin-top:18px;padding-top:14px;border-top:1px solid #c5b27d40;text-align:left}
#player-card-dialog .player-card-bonds h3{margin:0 0 12px;color:#c0cec9;font:400 12px/1.4 'DM Sans',sans-serif}
#player-card-dialog .player-bond-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 10px;list-style:none;margin:0;padding:0}
#player-card-dialog .player-bond-list li{display:flex;align-items:center;gap:7px;margin:0;padding:0;color:#f3ead6;font-size:15px;line-height:1.4;font-variant-numeric:tabular-nums;white-space:nowrap}
.player-bond-list img{width:24px;height:16px;object-fit:cover;border-radius:2px;flex-shrink:0}
.player-card-bonds small{font-size:10px;font-weight:400;color:#c0cec9}
.player-bonds-total{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-top:14px;color:#c0cec9;font-size:12px}
.player-bonds-total strong{color:#f4e5bf;font-size:20px;font-weight:500;font-variant-numeric:tabular-nums}
#player-card-dialog .player-bonds-empty{margin:0;color:#c0cec9;font-size:13px}
@media(max-width:370px){#player-card-dialog .player-bond-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Compact labels before ever spending another row on desktop. */
@media(max-width:1150px){
 .command-view:not(.board-lab) .topbar.has-player-roster{gap:7px;padding:0 10px}
 .has-player-roster .brand h1{font-size:20px!important}
 .command-view.remote-view:not(.board-lab) .has-player-roster #remote-identity .personal-money>span>small{display:none}
 .command-view.remote-view:not(.board-lab) .has-player-roster #remote-diplomacy{width:30px;min-width:30px;padding:4px}
 .has-player-roster #remote-diplomacy span{display:none}
 .has-player-roster #remote-diplomacy svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round}
}
.has-player-roster #new-game::before{content:'';display:none;width:18px;height:18px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E") center/contain no-repeat}
@media(max-width:960px){
 .command-view:not(.board-lab) .topbar.has-player-roster{--header-control-height:30px}
 .command-view:not(.board-lab) .topbar.has-player-roster{gap:6px;padding:0 8px}
 .has-player-roster .brand h1{font-size:18px!important}
 .has-player-roster .top-actions #power-race-open,.has-player-roster .top-actions #new-game{width:30px;min-width:30px;padding:4px;font-size:0;gap:0}
 .has-player-roster #new-game::before{display:block}
 .has-player-roster .top-actions #music-menu,.has-player-roster .top-actions #help{width:30px;min-width:30px}
 .has-player-roster .turn-beacon{gap:5px;padding:4px 5px}
 .has-player-roster .turn-context{padding-left:5px}.has-player-roster .turn-context strong{font-size:10px}
 .has-player-roster .turn-emblem{width:27px}.has-player-roster .turn-emblem img{width:25px;height:17px}
 .has-player-roster .turn-owner>strong{font-size:17px}
}
/* Phones keep the pre-avatar compact mobile allowance, with exactly two rows. */
@media(max-width:760px){
 .command-view:not(.board-lab) .topbar.has-player-roster,.command-view.remote-view:not(.board-lab) .topbar.has-player-roster{grid-template-columns:repeat(12,minmax(0,1fr));grid-template-rows:44px 40px;height:96px;min-height:96px;max-height:96px;padding:4px 8px;gap:2px 4px;align-content:center}
 .has-player-roster .brand{grid-column:1/4;grid-row:1}.has-player-roster .brand h1{font-size:16px!important;line-height:1.05}.has-player-roster .brand em{display:block;font-size:12px;letter-spacing:3px;margin-top:3px}
 .has-player-roster #player-roster{grid-column:4/-1;grid-row:1;gap:1px;justify-content:flex-end;padding:0;border:0}
 #player-roster .player-seat{height:44px;flex:0 1 42px;padding:0 1px;gap:1px}.player-avatar{width:30px;height:30px}.player-seat-name{font-size:8px;line-height:10px}
 .player-investor-card{right:-3px;width:12px;height:17px}.player-investor-card svg{width:10px;height:14px}
 .command-view:not(.board-lab) .has-player-roster #turn-panel,.command-view.remote-view:not(.board-lab) .has-player-roster #turn-panel{grid-column:1/6;grid-row:2;min-width:0;width:100%;justify-content:flex-start;order:0}
 .has-player-roster .turn-beacon{height:38px;width:100%;box-sizing:border-box;gap:4px;padding:3px 4px}.has-player-roster .turn-state{font-size:7px;letter-spacing:.4px}.has-player-roster .turn-emblem{width:24px;height:27px}.has-player-roster .turn-emblem img{width:22px;height:15px}.has-player-roster .turn-owner>strong{font-size:17px}.has-player-roster .turn-context{display:none}
 .command-view.remote-view:not(.board-lab) .has-player-roster #remote-bar{grid-column:6/9;grid-row:2;min-width:0;width:100%;gap:3px;flex-wrap:nowrap;justify-content:center;order:0}
 .command-view.remote-view:not(.board-lab) .has-player-roster #remote-bar>div{margin:0;flex:0 1 auto;min-width:0}
 .command-view.remote-view:not(.board-lab) .has-player-roster #remote-identity .personal-money{height:32px;min-height:32px;padding:4px;gap:0}
 .command-view.remote-view:not(.board-lab) .has-player-roster #remote-identity .personal-money>span{flex-direction:row;gap:0}
 .command-view.remote-view:not(.board-lab) .has-player-roster #remote-identity .personal-money>span>small,.command-view.remote-view:not(.board-lab) .has-player-roster #remote-identity .personal-money svg{display:none}
 .command-view.remote-view:not(.board-lab) .has-player-roster #remote-diplomacy{min-width:24px;width:24px;height:30px;padding:2px}
 .has-player-roster .top-actions{grid-column:9/-1;grid-row:2;order:0!important;justify-content:flex-end;margin:0!important;gap:2px!important}
 .command-view:not(.board-lab) .has-player-roster .top-actions :is(#power-race-open,#music-menu,#help,#new-game){width:26px;min-width:26px;min-height:30px;height:30px;padding:3px}
 .command-view:not(.board-lab) .has-player-roster .top-actions #power-race-open,.command-view:not(.board-lab) .has-player-roster .top-actions #new-game{font-size:0;gap:0}
 .command-view:not(.board-lab) .has-player-roster:not(:has(#remote-bar)) #turn-panel{grid-column:1/9}
 /* A pending command stays actionable without changing the header height. */
 .has-player-roster #remote-retry:not([hidden]){position:absolute;right:8px;top:calc(100% + 8px);z-index:1}
}
@media(max-width:360px){
 .command-view:not(.board-lab) .has-player-roster .top-actions :is(#power-race-open,#music-menu,#help,#new-game){width:22px;min-width:22px;padding:2px}.has-player-roster .top-actions{gap:1px!important}
 .has-player-roster #player-roster{gap:0}.player-seat-name{font-size:7.5px}
}

/* Expanded conversations keep the face outside the speech bubble. */
#table-feed.is-open .feed-message,#table-feed.is-open .feed-message:last-child{display:flex;align-items:flex-start;gap:10px;padding:4px 0;background:none;border:0;box-shadow:none}
#table-feed.is-open .feed-message>.identity-avatar{width:36px;height:36px;margin-top:5px}
.feed-bubble{position:relative;flex:1;min-width:0;padding:12px 14px;border:1px solid color-mix(in srgb,var(--feed-country) 55%,#fffdf5);border-radius:2px 12px 12px 12px;background:color-mix(in srgb,var(--feed-country) 18%,#fffdf5)}
.feed-bubble::before{content:'';position:absolute;left:-7px;top:11px;width:12px;height:12px;transform:rotate(45deg);background:inherit;border-left:inherit;border-bottom:inherit}
#table-feed .feed-bubble .feed-text{margin:7px 0 0}
#table-feed .feed-kind{cursor:help}
#player-roster .player-seat-tooltip{display:none;position:absolute;top:calc(100% + 8px);left:50%;transform:translateX(-50%);z-index:100;width:210px;max-width:calc(100vw - 24px);padding:14px;box-sizing:border-box;border:1px solid #c7b77e;border-radius:7px;background:#17323d;color:#f5eddb;box-shadow:0 8px 25px #071a2470;text-align:left;white-space:normal;font:12px/1.5 'DM Sans',sans-serif;cursor:default}
#player-roster .player-seat-tooltip::before{content:'';position:absolute;top:-9px;left:0;width:100%;height:10px}
#player-roster .player-seat:hover .player-seat-tooltip,#player-roster .player-seat:focus-visible .player-seat-tooltip{display:flex;flex-direction:column;gap:5px}
.player-seat-tooltip strong{font-size:15px}.player-tip-government{display:flex;align-items:center;gap:7px}.player-tip-government img{width:24px;height:16px;object-fit:cover}
@media(min-width:1400px){
 .command-view:not(.board-lab) .topbar.has-player-roster{grid-template-columns:auto minmax(210px,1fr) max-content auto}
 .command-view.remote-view:not(.board-lab) .topbar.has-player-roster{grid-template-columns:auto minmax(210px,1fr) max-content auto auto}
 .has-player-roster .turn-context small{display:block}
 .has-player-roster .turn-context strong,.has-player-roster .turn-context small,.has-player-roster .turn-owner>strong{max-width:none;overflow:visible;white-space:nowrap}
 .has-player-roster .turn-beacon{max-width:none}
}
@media(max-width:760px){#player-roster .player-seat-tooltip{position:fixed;top:54px;left:auto;right:10px;transform:none}}

#table-feed.is-open{max-height:calc(100dvh - var(--header-bottom,58px) - var(--ribbon-space,160px) - 24px - var(--feed-return-space,0px))}
