/* Projects v2.1: progressive enhancement of the existing Hex Board UI.
   Mobile reading/interaction order is always map -> actions -> details -> optional projects. */
:root{--project:#5ed2c6;--project-dark:#103b43;--parchment:#f2e4c1;--project-ink:#173b40}
html{scroll-padding-top:12px}
button,[role=button],summary{touch-action:manipulation}
button:focus-visible,[role=button]:focus-visible,summary:focus-visible,canvas:focus-visible{outline:3px solid #f4c95d;outline-offset:3px}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.page.in-match{max-width:1520px;padding:12px 18px 24px}
.page.in-match .topbar{align-items:center;margin-bottom:10px;gap:10px}
.page.in-match .topbar h1{font-family:Georgia,'Times New Roman',serif;font-size:1.9rem;color:#f6e5bc}
.page.in-match .topbar .eyebrow{font-size:10px;margin:0 0 2px;color:#ccb988}
.page.in-match .hero-copy{display:none}
.current-match-panel{padding:12px}
.current-match-head h2{font-size:1rem}
.current-match-head p{font-size:12px}
.match-game{gap:10px}
.match-status-bar{padding:6px;gap:8px;border-radius:12px}
.status-chip{min-width:110px;padding:6px 12px;border-radius:9px;gap:2px}
#turnChip{flex:1;border-color:#356177}
#phaseChip{min-width:90px}
.status-chip strong{font-size:15px}.chip-sub{font-size:12px}.status-progress{height:4px}
.turn-order-bar{display:none}
.match-workspace{grid-template-columns:minmax(0,1fr) 330px;grid-template-areas:"board players" "actions projects" "detail projects" "log projects";gap:12px;align-items:start}
.board-stage{grid-area:board;min-width:0;scroll-margin-top:12px}
.action-ribbon-card{grid-area:actions!important;min-width:0}
.detail-rail{grid-area:detail;min-width:0;scroll-margin-top:12px}
.project-rail{grid-area:projects;min-width:0;align-self:start}
.players-rail{grid-area:players;min-width:0}
.log-card{grid-area:log}
.action-log-stack{display:contents!important}
.board-frame{padding:8px;min-height:0;border-radius:16px;border:2px solid #80613c;background:linear-gradient(135deg,#3b3023,#191f25);box-shadow:inset 0 0 0 2px #242118,0 12px 30px #0004}
.board-frame:before{display:none}
#boardCanvas{height:430px;border-radius:8px;touch-action:none;cursor:grab}
#boardCanvas:active{cursor:grabbing}
.board-inspector{position:absolute;top:18px;left:18px;max-width:calc(100% - 125px);font-size:12px;padding:6px 9px;pointer-events:none}
.board-zoom{position:absolute;right:15px;top:15px;display:flex;gap:4px;z-index:2}
.board-zoom button{min-width:44px;min-height:44px;padding:0;border:1px solid #af9064;border-radius:9px;background:#292d29ed;color:#fff0ce;font-size:21px;font-weight:700}
.board-zoom #fitMapBtn{font-size:14px}
.board-hint{font-size:12px;line-height:1.4;padding:7px 10px;margin-top:6px;background:#111f2bed;border-radius:8px;min-height:31px}
.board-confirm{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--project);border-radius:10px;background:#12343b;margin-top:6px}
.board-confirm>div{flex:1;display:grid;gap:3px;font-size:13px}
.board-confirm span{font-size:12px;color:#d1e4e3}
.board-confirm button{min-height:44px;white-space:nowrap}
.play-hud{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.compact-scores{display:flex;gap:6px;min-width:0}
.compact-score{display:grid;grid-template-columns:auto 1fr;gap:2px 7px;flex:1;min-width:0;color:var(--ink);background:#111f32;border:1px solid #344759;border-radius:9px;padding:7px 9px;align-items:center;text-align:left}
.compact-score.current{border-color:var(--player-color);box-shadow:0 0 0 1px var(--player-color) inset}
.compact-score>span:nth-child(2){font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.compact-score b{font-size:16px;grid-column:2}.compact-score small{font-size:10px;font-weight:400;color:#bbcede}
.player-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--player-color,#aaa);flex:0 0 auto;vertical-align:middle;margin-right:5px}
.personal-resource-bar{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px;padding:6px;border-radius:10px;background:linear-gradient(#263242,#172535);border:1px solid #3e4b56;align-items:center}
.hud-resource,.hud-worker{display:flex;align-items:center;justify-content:center;gap:3px;min-width:0}
.hud-resource img{width:27px;height:29px;object-fit:contain}.hud-worker img{width:22px;height:28px;object-fit:contain}
.hud-resource b,.hud-worker b{font-size:14px}.hud-worker{border-right:1px solid #61717a;padding-right:4px}
.action-ribbon-card{padding:10px;border-radius:14px;border-color:#9d794951;background:linear-gradient(#233247,#142234)}
.action-ribbon-card .ribbon-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-bottom:8px}
.ribbon-head h3{font-family:Georgia,serif;color:#f1d69f;font-size:19px;margin:0}
.ribbon-head p{font-size:12px;margin-top:3px}
.action-ribbon-card .action-tabs{width:auto;display:flex;flex-wrap:nowrap;overflow-x:auto;gap:6px;max-width:100%;scrollbar-width:thin}
.action-tab{min-height:44px;padding:8px 12px;font-size:13px;border-radius:8px;white-space:nowrap;flex:0 0 auto}
.action-tab.active{background:#594b30;color:#fff0ca;border-color:#b39253}
.action-strip,.action-group-row{grid-auto-columns:110px;gap:8px;scrollbar-width:thin;overscroll-behavior-x:contain}
.action-strip.all-actions-view{grid-auto-columns:auto}
.action-chip{min-height:0;gap:4px;padding:5px;border-radius:10px;background:#102036}
.action-thumb-wrap{height:94px;padding:0;border:0;border-radius:6px;background:none}
.action-chip-title{display:block;font-size:11px;line-height:1.2;text-align:center;min-height:27px;overflow-wrap:anywhere}
.action-chip-meta{justify-content:center;gap:3px}
.action-open-tag{font-size:10px;padding:2px 5px}
.action-occupant{right:3px;bottom:3px;padding:2px}.action-occupant img{width:24px;height:24px}
.action-chip.selected{border-color:#e9ba57;box-shadow:0 0 0 2px #dbb75555,0 0 12px #c5a75322}
.selected-action-card{position:static;min-height:0;gap:10px;padding:12px;border:1px solid #a484505c;border-radius:14px;display:grid;grid-template-columns:1fr}
.selected-action-card .action-hero{display:grid;grid-template-columns:80px minmax(0,1fr);gap:12px}
.action-art-large{width:80px;height:80px;padding:0;background:none;border:0;border-radius:8px}
.action-meta{gap:4px}.action-selected-label{font-size:11px;color:#d3bd87;text-transform:uppercase;letter-spacing:.08em}
.action-title{font-family:Georgia,serif;font-size:22px;color:#ffebbb}
.action-desc{font-size:14px;line-height:1.45}
.action-cost-summary .detail-section{margin:0;padding:8px 10px;background:#0d1b2e;border-radius:9px}
.action-cost-summary .detail-section-title{font-size:11px;margin-bottom:4px}
.action-cost-summary .cost-block{padding:5px 0}.action-cost-summary .cost-note{font-size:13px;line-height:1.4}
.action-cost-summary .cost-empty{font-size:13px;padding:0;border:0;background:none}
.use-btn-row{display:flex;width:100%;margin:0;gap:8px}.use-btn-row .primary-btn{min-height:48px;flex:1;font-size:15px}
.action-extra{color:#bfcfe3;font-size:13px}.action-extra summary{min-height:44px;padding:12px 4px;cursor:pointer;font-weight:600}
.action-extra p{line-height:1.5}.action-extra .detail-section{margin-top:8px}
.guild-rewards{display:grid;gap:12px;border:1px solid #607084;border-radius:12px;padding:14px}
.guild-rewards label{display:flex;align-items:center;gap:12px;min-height:44px;color:var(--ink)}
.guild-rewards input{width:22px;height:22px;padding:0}
.primary-btn,.ghost-btn{min-height:44px}
.project-eyebrow{font-size:10px;letter-spacing:.13em;text-transform:uppercase;font-weight:700;color:#81cfc6}
.project-rail{padding:12px;border:1px solid #457773;border-radius:14px;background:linear-gradient(#19313a,#11212d)}
.project-rail-head{display:flex;justify-content:space-between;gap:8px;align-items:center}
.project-rail h3{margin:3px 0 0;font-family:Georgia,serif;font-size:22px;color:#e9dfb9}
.project-rail-summary{font-size:12px;color:#b2cdc9;margin:10px 0}
.project-rail-tiles{display:grid;gap:10px}
.project-tile{position:relative;display:grid;grid-template-columns:75px minmax(0,1fr);gap:9px;align-items:center;width:100%;padding:10px;color:var(--project-ink);border:3px double #326466;border-radius:12px;background:radial-gradient(ellipse at 20% 10%,#f9f0d8,#e8d6ac);box-shadow:inset 0 0 0 1px #eddfbc;text-align:left}
.project-tile.open{border-color:#57cfbf;box-shadow:0 0 10px #66d9c22c,inset 0 0 0 1px #fdedd0}
.project-tile.locked{background:linear-gradient(#d7d9d1,#c9c6b7);border-color:#728986}
.project-tile.closed,.project-tile.scored{background:linear-gradient(#d9dac8,#bfc6b9)}
.project-scene{width:75px;height:98px;object-fit:contain;filter:drop-shadow(0 2px 2px #29332a66)}
.project-tile.locked .project-scene{filter:saturate(.45)}
.project-tile-copy{display:grid;gap:5px;min-width:0}
.project-tile strong{font:700 16px/1.1 Georgia,serif}
.project-state{font-size:10px;text-transform:uppercase;letter-spacing:.04em;font-weight:700;line-height:1.4;color:#285f60}
.project-caption{font-size:11px;line-height:1.45}
.project-tile.mystery{background:#14434c;color:#ddeddd;border-color:#54827c}
.project-tile.mystery .project-state{color:#b8e0d5}
.companion-dialog{padding:0;width:min(830px,calc(100% - 32px));max-height:calc(100dvh - 32px);border:1px solid #63958d;border-radius:20px;background:#111f30;color:var(--ink);box-shadow:0 30px 100px #000b;overflow:hidden}
.companion-dialog::backdrop{background:#030b16cc;backdrop-filter:blur(3px)}
.companion-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;background:linear-gradient(120deg,#173c44,#193344);border-bottom:1px solid #426767}
.companion-dialog-head h2{font-family:Georgia,serif;font-size:24px;margin:4px 0 0;color:#f3e4be}
.project-dialog-content,.players-dialog-content{padding:16px 20px;max-height:calc(100dvh - 140px);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
.players-dialog-content{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.project-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:14px}
.project-tab{display:grid;align-content:start;gap:4px;min-height:64px;padding:9px;border:1px solid #47716e;background:#162d39;border-radius:9px;color:#e2e5d9;text-align:left;min-width:0}
.project-tab>span{font-size:10px;text-transform:uppercase;color:#9ccac4}.project-tab strong{font-family:Georgia,serif;font-size:14px;line-height:1.2}
.project-tab.active{border-color:#63d7c9;background:#275053;box-shadow:0 0 0 1px #63d7c944}
.project-detail-hero{display:flex;gap:16px;align-items:center;padding:16px;border:4px double #487b79;background:radial-gradient(ellipse at top left,#faf0d6,#d9e0cd);border-radius:15px;color:#24484b}
.project-detail-hero img{width:110px;height:125px;object-fit:contain}.project-detail-hero h3{font-family:Georgia,serif;font-size:28px;margin:5px 0}.project-detail-hero p{font-size:14px;margin:6px 0;font-style:italic}
.project-detail-hero.locked{background:linear-gradient(#d8ddd4,#c9cdbe)}.project-detail-hero.locked img{filter:saturate(.5)}
.project-reward{margin:14px 0;padding:14px;border-radius:10px;background:#17343c;border:1px solid #497b75;display:grid;gap:7px}
.project-reward>strong{font-family:Georgia,serif;font-size:20px;line-height:1.3;color:#f1e6c8}
.project-reward p{font-size:13px;line-height:1.6;margin:0;color:#d0e2df}
.project-personal{display:flex;gap:10px;flex-wrap:wrap;font-size:13px;margin-bottom:12px}
.project-personal>span{padding:9px;background:#213b46;border-radius:7px;flex:1}.project-personal strong{color:#b3efe2;white-space:nowrap}
.project-leader-line{font-size:13px;line-height:1.5;color:#c5e1db}
.project-table-wrap{overflow:auto;border:1px solid #3a5862;border-radius:10px;margin:10px 0}
.project-table{width:100%;border-collapse:collapse;font-size:13px}
.project-table th,.project-table td{padding:10px 8px;text-align:left;white-space:nowrap;border-bottom:1px solid #3b505a}
.project-table thead{background:#213b46;color:#d9e4d9}.project-table tbody th{font-weight:500}.project-table tr:last-child>*{border-bottom:0}
.contribution-dot{display:inline-block;width:13px;height:13px;border-radius:50%;border:1px solid #adc8c5;margin:0 2px;background:transparent}
.contribution-dot.filled{background:var(--player-color);box-shadow:inset 0 0 0 1px #ffffff40}
.project-limits{font-size:12px;line-height:1.5;padding:12px;background:#162a3b;border:1px solid #374d62;border-radius:9px;margin:12px 0}
.project-limits p{margin:5px 0;color:#c0d1e2}
.project-deliveries{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px}
.project-delivery{padding:12px;border:1px solid #526c68;border-radius:12px;background:#1b323a;display:flex;flex-direction:column;gap:10px}
.project-delivery.done{border-color:#519685;background:#153b35}
.delivery-head{display:grid;gap:4px}.delivery-head>strong{font-family:Georgia,serif;color:#eee6cb;font-size:18px}.delivery-head>span{font-size:11px;color:#a7c6bf}
.project-cost{display:flex;align-items:center;gap:5px;flex-wrap:wrap;font-size:12px}
.project-resource{display:inline-flex;align-items:center;gap:5px;background:#10242e;border:1px solid #405b61;padding:4px;border-radius:6px}
.project-resource img{width:22px;height:28px;object-fit:contain}.project-resource span{white-space:nowrap}
.project-delivery p{font-size:12px;line-height:1.5;margin:0}.project-contribute{background:linear-gradient(135deg,#27766f,#185059);border:1px solid #6eb7a9;font-size:13px;min-height:48px;margin-top:auto}
.delivery-block{font-size:12px;line-height:1.45;color:#d9d2ad}.delivery-confirm{font-size:12px;line-height:1.5;color:#fae9b4;display:grid;gap:6px}
.project-mystery-detail{display:grid;justify-items:center;text-align:center;padding:20px;gap:10px}
.project-mystery-detail img{width:170px;max-height:225px;object-fit:contain}.project-mystery-detail h3{font-family:Georgia,serif;font-size:24px;margin:0}.project-mystery-detail p{max-width:450px;color:#ccdcdb;line-height:1.6}
.export-checks{display:flex;flex-wrap:wrap;gap:7px}.export-checks span{font-size:12px;padding:8px;border:1px solid #486468;border-radius:7px}.export-checks .checked{background:#1a594b;color:#e7f9dd}
.project-final-breakdown{display:grid;gap:6px;font-size:12px;border:1px solid #4e7470;background:#153239;border-radius:10px;padding:12px}
.project-final-breakdown>div{display:flex;justify-content:space-between;gap:10px;line-height:1.4}.project-final-breakdown>strong{color:#d9ebd9;font-family:Georgia,serif;font-size:16px;margin-bottom:5px}.project-final-breakdown small{color:#a9cac3}
.mobile-game-nav{display:none}
.modal-card{max-height:calc(100dvh - 24px);overflow:auto}.modal-close{min-width:44px;min-height:44px}
.modal-backdrop{z-index:90}.toast{z-index:200}.feedback-tray{z-index:80}
.match-game[data-phase="placement"] .action-ribbon-card{display:none}
@media(min-width:981px){
  .project-rail{position:sticky;top:12px}
  .players-rail .rail-head p{display:none}.player-tab-btn{min-width:105px}
  .players-rail .rail-card{padding:10px;border-radius:14px}
  .player-card{padding:10px}.player-card .resource-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
  .player-card .resource-pill{gap:2px;padding:5px}.player-card .resource-pill-label{font-size:10px}
  .players-rail .vp-crest{width:64px;min-width:64px}.players-rail .worker-tray{padding:6px}
  .players-rail .player-tech-grid{max-height:100px;overflow:auto}
}
@media(max-width:980px){
  .page.in-match{padding:8px 8px calc(85px + env(safe-area-inset-bottom))}
  .page.in-match .topbar{flex-direction:row;gap:8px;margin-bottom:8px}
  .page.in-match .topbar h1{font-size:21px}.page.in-match .top-actions{gap:5px}
  .page.in-match .top-actions a{font-size:12px;padding:7px 10px;min-height:40px;display:flex;align-items:center}
  .page.in-match .user-badge{display:none}
  .current-match-panel{padding:0;border:0;background:none;box-shadow:none}
  .current-match-head{padding:0 2px;margin:0;align-items:center;gap:8px;flex-wrap:wrap}
  .current-match-head h2{display:none}.current-match-head p{font-size:10px;margin:0}
  .current-match-head .split-actions{gap:5px}.current-match-head .small{font-size:11px;padding:6px 9px;min-height:40px}
  .current-match-head{margin-bottom:6px}
  .match-status-bar{position:static;backdrop-filter:none;gap:5px;padding:5px;border-radius:10px;flex-wrap:nowrap}
  .status-chip{min-width:0!important;flex:0 0 auto;padding:5px 8px}
  #phaseChip{display:none}#roundChip{width:76px;flex:0 0 76px}#turnChip{min-width:0;flex:1}
  .status-chip .chip-label{font-size:9px}.status-chip strong{font-size:14px}.chip-sub{font-size:11px}
  .match-game{gap:8px}
  .play-hud{grid-template-columns:1fr;gap:5px}
  .compact-scores{gap:4px}.compact-score{padding:5px;grid-template-columns:8px 1fr;gap:0 4px;min-height:44px}
  .compact-score>span:nth-child(2){font-size:10px}.compact-score b{font-size:14px}.compact-score .player-dot{width:7px;height:7px;margin:0}
  .personal-resource-bar{padding:4px;gap:2px}.hud-resource img{width:24px;height:25px}.hud-worker img{height:25px;width:19px}.hud-resource b,.hud-worker b{font-size:13px}
  .match-workspace{grid-template-columns:minmax(0,1fr)!important;grid-template-areas:"board" "actions" "detail" "projects" "log"!important;gap:8px}
  .players-rail{display:none}
  .board-frame{padding:5px;border-radius:12px}
  #boardCanvas{height:clamp(265px,38dvh,380px);min-height:0;border-radius:7px}
  .board-inspector{top:10px;left:10px;font-size:10px;max-width:calc(100% - 150px);padding:5px 6px;gap:3px}
  .board-inspector strong{font-size:11px}.board-inspector span{font-size:10px}
  .board-zoom{right:10px;top:10px;gap:3px}.board-zoom button{min-width:40px;min-height:44px}
  .board-hint{font-size:11px;margin-top:4px;padding:6px 8px;min-height:26px}
  .board-confirm{padding:8px;flex-wrap:wrap}.board-confirm>div{flex-basis:100%}.board-confirm button{flex:1}
  .action-ribbon-card{padding:8px;border-radius:12px}
  .action-ribbon-card .ribbon-head{display:grid;grid-template-columns:1fr;margin-bottom:7px;gap:6px}
  .action-ribbon-card .ribbon-head p{display:none}.ribbon-head h3{font-size:18px}
  .action-ribbon-card .action-tabs{width:100%;max-width:100%;flex-wrap:nowrap;gap:5px}
  .action-tab{font-size:12px;padding:7px 11px;min-height:44px}
  .action-strip,.action-group-row{grid-auto-columns:98px;gap:6px;padding-bottom:3px}
  .action-strip.all-actions-view{grid-auto-columns:auto}
  .action-chip{padding:4px;gap:3px;min-height:0}.action-thumb-wrap{height:82px;padding:0}
  .action-chip-title{font-size:11px;min-height:27px}.action-chip-meta{gap:3px}.action-open-tag{font-size:9px;padding:1px 4px}
  .selected-action-card{padding:10px;gap:8px;border-radius:12px;min-height:0}
  .selected-action-card .action-hero{grid-template-columns:64px minmax(0,1fr);gap:9px}
  .action-art-large{width:64px;height:64px}.action-selected-label{font-size:9px}.action-title{font-size:20px}.action-desc{font-size:13px;line-height:1.45}
  .action-cost-summary .cost-note{font-size:12px}.action-cost-summary .cost-block-label{font-size:11px}
  .use-btn-row .primary-btn{min-height:50px}.action-extra summary{padding:11px 3px;font-size:12px}
  .project-rail{position:static;padding:10px;border-radius:12px}
  .project-rail-tiles{display:none}.project-rail h3{font-size:18px}.project-rail-summary{margin:5px 0 0;font-size:12px}
  .project-rail-head>.ghost-btn{min-width:90px}
  .log-card{padding:10px}.log-card .rail-head p{display:none}.log-card .event-log{max-height:110px;font-size:11px}
  .mobile-game-nav{display:grid;grid-template-columns:1fr 1.2fr 1.1fr 1fr;position:fixed;bottom:0;left:0;right:0;padding:6px 8px calc(6px + env(safe-area-inset-bottom));gap:4px;background:#0d1b2cf5;border-top:1px solid #78674b;z-index:60;backdrop-filter:blur(12px)}
  .mobile-game-nav button{position:relative;min-height:52px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:4px;background:transparent;border:1px solid transparent;border-radius:9px;color:#c8d7dd;font-size:12px}
  .mobile-game-nav button>span{font-size:20px;line-height:1.1}.mobile-game-nav button.nav-primary{background:#3b463c;border-color:#c2a260;color:#ffeab5;font-weight:700}
  .mobile-game-nav small{position:absolute;top:4px;right:16px;padding:0 4px;border-radius:6px;background:#2f6864;color:#def7ef;font-size:10px}
  .companion-dialog{width:100%;max-width:100%;height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);margin:0;left:0;right:0;top:auto;bottom:0;border-radius:18px 18px 0 0}
  .companion-dialog-head{padding:10px 12px;min-height:72px}.companion-dialog-head h2{font-size:22px}.companion-dialog-head .project-eyebrow{font-size:9px}
  .project-dialog-content,.players-dialog-content{padding:12px 12px calc(22px + env(safe-area-inset-bottom));height:calc(100% - 72px);max-height:none}
  .project-tabs{gap:5px}.project-tab{padding:8px 6px;min-height:72px}.project-tab strong{font-size:13px}.project-tab>span{font-size:9px}
  .project-detail-hero{padding:10px;gap:10px}.project-detail-hero img{width:82px;height:94px}.project-detail-hero h3{font-size:23px}.project-detail-hero p{font-size:12px}
  .project-reward{padding:12px}.project-reward>strong{font-size:19px}
  .project-personal{gap:6px;font-size:12px}.project-personal>span{padding:8px;min-width:90px}
  .project-table{font-size:11px}.project-table td,.project-table th{padding:9px 5px}.contribution-dot{width:10px;height:10px;margin:0 1px}
  .project-deliveries{grid-template-columns:1fr;gap:10px}
  .project-delivery{display:grid;grid-template-columns:1fr auto;gap:8px;padding:12px}
  .delivery-head{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:6px}.delivery-head strong{font-size:18px}
  .project-cost{grid-column:1/-1}.project-resource{padding:5px;font-size:13px}.project-resource img{width:25px;height:30px}
  .project-delivery>p{align-self:center;font-size:12px}.project-contribute{min-width:140px;min-height:48px;white-space:normal}
  .delivery-block,.delivery-confirm{grid-column:1/-1}.players-dialog-content{grid-template-columns:1fr;align-content:start}
  .modal-backdrop{padding:8px;align-items:end}.modal-card{width:100%;border-radius:16px;max-height:calc(100dvh - 16px)}
  .modal-body{max-height:calc(100dvh - 110px);overflow:auto}.modal-body input,.modal-body select{font-size:16px}
  .feedback-tray{bottom:calc(70px + env(safe-area-inset-bottom));max-height:26dvh;overflow:auto;pointer-events:none}
  .toast{bottom:calc(80px + env(safe-area-inset-bottom));max-width:calc(100% - 24px)}
}
@media(max-width:360px){
  .page.in-match{padding-left:5px;padding-right:5px}.top-actions .ghost-btn{font-size:11px!important}
  .project-delivery{grid-template-columns:1fr}.project-contribute{width:100%}.project-personal{display:grid;grid-template-columns:1fr}
  .compact-score>span:nth-child(2){max-width:48px}
}
@media(max-width:980px) and (orientation:landscape){#boardCanvas{height:65dvh;min-height:240px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

/* Keep the first grid row sized by the map, never by long player inventories. */
@media(min-width:981px){.players-rail{max-height:480px;overflow:auto;scrollbar-width:thin;overscroll-behavior:contain}.players-rail .rail-card{min-height:0}}
.festival-cap-tag{font-size:9px;line-height:1.1;padding:3px;color:#ffeab3;background:#544423;border:1px solid #ac9157;border-radius:5px}
.hud-resource img,.project-resource img{border-radius:4px}

.project-limits summary{min-height:36px;cursor:pointer;font-weight:700;padding:7px 0;color:#d6e2dc}
