/* The original components carry Kalypso's identity on a quiet playing surface. */
body.table-playing{isolation:isolate;position:relative}
body.table-playing::before{content:"";position:fixed;inset:0;background:#eef1e8b3;z-index:-1;pointer-events:none}
#game{max-width:1700px;padding:10px 20px 32px;color:#203b51}
#game .game-head{display:flex;align-items:center;gap:20px;margin:0 0 8px;min-height:44px}
#game .game-head>div:first-child{background:none;padding:0;flex:0 0 auto}
#game .game-head #day{font-size:12px;letter-spacing:.045em;margin:0;color:#203b51}
#game .game-head #phase{display:none}
#game #copyRoom{margin-left:auto;min-height:44px;background:#fffaf0;color:#203b51;border-color:#839699}
#tableNavigation{display:flex;align-items:center;gap:3px}
#tableNavigation button{min-height:44px;padding:6px 12px;background:none;border:0;box-shadow:none;color:#203b51;font-size:13px;border-radius:3px}
#tableNavigation button:hover{background:#fffaf0}
#tableCommand{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:18px;position:sticky;top:0;z-index:15;background:#fffaf0;border:1px solid #a8b4b0;box-shadow:0 3px 8px #16394a1f;margin-bottom:12px;min-height:62px;padding:9px 14px;border-radius:4px}
#tableCommand[hidden]{display:none}
#tableCommand #turnPrompt{margin:0;padding:0;border:0;background:none;box-shadow:none;color:#203b51;min-width:0}
#tableCommand #turnPrompt strong{font-size:16px;color:inherit}
#tableCommand #turnPrompt>span{display:block;font-size:12px;line-height:1.45;color:#425363;margin-top:3px}
#tableCommand #turnPrompt>button{margin-top:6px;min-height:44px}
#tableCommand #actions{margin:0;padding:0;min-width:0;max-width:320px}
#tableCommand #actions::before{display:none}
#tableCommand #actions:empty{display:none}
#tableCommand #actions>button{min-height:44px}
#tableCommand #actions>.fine{background:none;border-color:#a8b4b0;color:#425363;font-size:12px;box-shadow:none}
#tableCommand #ready{min-height:44px;font-size:15px;padding:10px 22px;border-radius:4px;animation:none;box-shadow:0 2px 0 #173e30;background:#286346;border:1px solid #163b2b;color:#fff}
#tableCommand:has(#ready){background:#f3f6e8;border-color:#6d8a72}
#tableCommand .waiting{margin:0;background:none;color:#425363;font-size:12px}
.command-back{border-left:1px solid #c4cbc1;padding-left:14px}
#tableCommand #undo{min-height:44px;color:#425363;background:none;border-color:transparent;box-shadow:none}
#tableCommand #undo:disabled{opacity:.45}
#game .table,#game.ocean-focused .table{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:18px 24px;align-items:start}
#game .ocean-area{grid-column:1;grid-row:1;min-width:0;width:100%;max-width:none}
#game .right{grid-column:2;grid-row:1/3;min-width:0;display:flex;flex-direction:column;gap:16px}
#crewPanel{padding:12px;background:#fffaf0;border:1px solid #a8b4b0;border-radius:4px}
#crewPanel h3{font:600 13px 'DM Sans',sans-serif;letter-spacing:.025em;margin:0 0 10px;color:#425363}
#game #players{display:grid;grid-template-columns:1fr;gap:8px}
#players .player{display:grid;grid-template-columns:32px minmax(0,1fr);gap:3px 9px;text-align:left;padding:9px 10px;min-width:0;min-height:70px;border-radius:3px;background:#f7f4e8;color:#203b51;border:1px solid #b0bdb8;box-shadow:none;width:100%;font-size:14px}
#players .player>.icon{grid-row:1/3;font-size:27px;align-self:center}
#players .player>span:not(.icon):not(.crew-resources){min-width:0;overflow-wrap:anywhere;font-weight:700}
#players .player small{display:block;font-size:11px;font-weight:400;color:#425363;line-height:1.4}
#players .player[aria-pressed=true]{border:2px solid #356754;padding:8px 9px;background:#edf1df}
.crew-resources{display:flex;gap:15px;grid-column:2;font-size:13px;line-height:1.2}
.crew-resources>span{display:inline-flex;align-items:center;gap:4px}
.crew-resources img{width:23px;height:23px;object-fit:contain}
#game .board-heading{display:flex;flex-wrap:wrap;gap:5px;align-items:center;min-height:44px;margin-bottom:7px;color:#203b51}
#game .board-heading>span{background:none;border-radius:0;padding:5px 0;font-size:14px;font-weight:700;margin-right:auto}
#game .board-heading>.row{gap:3px;flex-wrap:wrap}
#game .board-heading button{min-height:44px;min-width:44px;padding:5px 9px;background:#fffaf0;border-color:#8b9f9f;border-radius:3px;color:#203b51;font-size:12px;box-shadow:none}
.table-tools{margin-left:4px}
#game #viewport{border:4px solid #e9e0c9;border-radius:3px;outline:1px solid #526f75;max-height:none;box-shadow:0 5px 12px #183d4b2b;margin:0 auto}
#game .camera-hint{background:#fffaf0;font-size:11px;color:#425363!important;margin:6px auto;padding:4px 8px;line-height:1.4}
#game .hint{background:#fffaf0;color:#203b51!important;border:1px solid #b8c3ba;border-radius:3px;font-size:12px;padding:7px 10px;margin:6px auto;line-height:1.4}
#game .hint:empty{display:none}
#game #resources{background:#fffaf0;color:#203b51;border:1px solid #a8b4b0;border-radius:4px;padding:9px 12px;margin-top:8px;gap:12px;font-size:13px;box-shadow:none;flex-wrap:wrap}
#resources>span,#resources>button{min-height:40px;display:inline-flex;align-items:center;gap:5px}
#game .left{grid-column:1;grid-row:2;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start;min-width:0}
#game .left>.paper{background:#fffaf0;border:1px solid #a8b4b0;border-radius:4px;padding:16px!important;box-shadow:none;margin:0;min-width:0}
#game .left .eyebrow,#game #buildSection>.eyebrow{letter-spacing:.05em;font-size:12px;color:#425363;margin:0 0 12px}
#game #weather{font-size:13px}
#game #weather p{font-size:13px;line-height:1.5}
#game #weather h3{font-size:18px;line-height:1.2}
#game #weather .weather-requirement button{min-height:44px;font-size:12px;max-width:none}
#game #goals{display:flex;justify-content:center;gap:16px;flex-wrap:wrap}
#game #goals img{width:calc(50% - 8px);height:auto;max-height:250px;object-fit:contain;cursor:zoom-in;box-shadow:2px 4px 4px #203b5129}
#game .left>.fine{display:none}
#game .vortex-paper{margin:0;min-height:340px}
#game #handTitle{display:table;margin:0 auto 4px;background:#fffaf0;color:#203b51;border:1px solid #a8b4b0;border-radius:3px;padding:7px 10px;font-size:12px;letter-spacing:.035em}
#game .vortex-paper #hand.radial-hand{height:300px;min-height:300px}
#game .vortex-paper #hand.radial-hand .tile-cell{width:29px;height:29px}
#game #buildSection{background:#fffaf0;border:1px solid #a8b4b0;border-radius:4px;padding:14px!important;box-shadow:none;margin:0}
#game #buildSection[hidden]{display:none}
.material-reference,#tableRecap{background:#fffaf0;border:1px solid #a8b4b0;border-radius:4px;padding:8px 12px;color:#203b51;font-size:13px;margin:0}
.material-reference{grid-column:1/-1}
.material-reference summary,#tableRecap summary{cursor:pointer;min-height:44px;font-weight:700;line-height:1.4;display:flex;align-items:center;gap:8px;list-style:revert}
.material-reference summary::before,#tableRecap summary::before{content:'▸'}
.material-reference[open] summary::before,#tableRecap[open] summary::before{content:'▾'}
.material-reference .legend{margin-top:8px;gap:6px;background:none;box-shadow:none}
.material-reference .legend button{min-height:44px}
#tableRecapEntries{list-style:none;padding:0;margin:8px 0 0;display:grid;gap:8px}
#tableRecapEntries li{display:flex;align-items:center;gap:9px}
#tableRecapEntries img{width:32px;height:32px;object-fit:contain}
#game.ocean-focused .left{display:none}
#game.ocean-focused .table{grid-template-columns:minmax(0,1fr)}
#game.ocean-focused .right{display:none}
#game.ocean-focused #oceanFocus{background:#e6eddb;border:2px solid #356754}
.mobile-table-jump{display:none!important}
.ocean-area,.vortex-paper,.left{scroll-margin-top:95px}
#cardPeek{position:fixed;z-index:120;pointer-events:none;width:300px;max-width:40vw;background:#fffaf0;padding:8px;border:1px solid #6e8586;border-radius:4px;box-shadow:0 10px 24px #142f4540;color:#425363}
#cardPeek[hidden]{display:none}
#cardPeek img{display:block;width:100%;max-height:70vh;object-fit:contain}
#cardPeek span{display:block;font-size:12px;text-align:center;padding-top:7px}
.card-inspect{width:min(540px,calc(100vw - 24px));max-width:calc(100vw - 24px);padding:24px;background:#fffaf0;color:#203b51;border:1px solid #6e8586;border-radius:5px}
.card-inspect h2{font:600 17px 'DM Sans',sans-serif;padding-right:38px;margin:0 0 15px;line-height:1.4}
.card-inspect>img{display:block;width:100%;height:auto;max-height:74vh;object-fit:contain}
.card-inspect .close{min-width:44px;min-height:44px}
#goals img:focus-visible,#weather img[role=button]:focus-visible{outline:3px solid #286346;outline-offset:3px}
#modeReference{width:100%;min-height:44px;margin-top:7px;font-size:12px;background:#eef1e8;color:#203b51;border-color:#71838d}
.mode-reference-dialog{width:min(900px,94vw);max-width:94vw;background:#fffaf0;color:#203b51;border:1px solid #71838d;border-radius:6px;padding:28px}
.mode-reference-columns{display:grid;grid-template-columns:1fr 1fr;gap:26px;margin-bottom:20px}
.mode-reference-columns article{min-width:0}
.mode-reference-columns article+article{border-left:1px solid #a4acb0;padding-left:26px}
.mode-reference-columns p{font-size:14px;line-height:1.6}
.mode-reference-columns strong{font-size:13px}
.mode-reference-dialog a{color:#245a79;text-decoration:underline}
.survival-needs{display:grid;gap:10px}
.survival-needs>div{display:flex;align-items:center;gap:12px;font-size:14px}
.survival-needs img{width:54px;height:54px;object-fit:contain}
#forecastChoices button{width:200px;font-size:13px;min-height:44px}
.competitive-forecast{width:100%;aspect-ratio:754/580;overflow:hidden;border-radius:3px}
#forecastChoices .competitive-forecast img{width:100%;height:auto;max-height:none;display:block;border-radius:0}
@media(min-width:1500px){#game .table,#game.ocean-focused .table{grid-template-columns:minmax(0,1fr) 340px}#game .vortex-paper #hand.radial-hand{height:330px;min-height:330px}#game .vortex-paper #hand.radial-hand .tile-cell{width:32px;height:32px}}
@media(max-width:1020px){
 #game{padding:8px 14px 24px}
 #game .table,#game.ocean-focused .table{display:flex;flex-direction:column;gap:16px}
 #game .ocean-area,#game .left,#game .right{width:100%}
 #game .right{display:contents}
 #game.ocean-focused .right{display:contents}
 #crewPanel{order:0;width:100%;padding:10px;box-sizing:border-box}
 #crewPanel h3{display:none}
 #game #players{grid-template-columns:repeat(2,minmax(0,1fr))}
 #game .ocean-area{order:1}
 #game .vortex-paper{order:2;width:340px;max-width:100%;margin:auto}
 #game #buildSection{order:3;width:100%;box-sizing:border-box}
 #game .left{order:4;display:grid;grid-template-columns:1fr 1fr}
 #game.ocean-focused .left{display:grid}
 #tableRecap{order:5;width:100%;box-sizing:border-box}
 #game .game-head{flex-wrap:wrap;gap:0 10px}
 #tableNavigation{order:3;width:100%;justify-content:center}
 #tableNavigation button{flex:1}
 #tableCommand{grid-template-columns:minmax(0,1fr) auto;gap:8px 12px}
 #tableCommand #turnPrompt{grid-column:1/-1}
 #tableCommand #actions{max-width:none}
 .command-back{justify-self:end;border-left:0;padding-left:0}
 #game .table-tools{display:none}
 #game .board-heading>.row{gap:3px}
 #game .vortex-paper #hand.radial-hand{height:310px;min-height:310px}
 .foundation-picker{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
 #game{padding:6px 10px 20px}
 #game .game-head #day{font-size:11px}
 #tableCommand{padding:9px 10px}
 #tableCommand #turnPrompt strong{font-size:14px}
 #tableCommand #turnPrompt>span{font-size:12px}
 #tableCommand #ready{width:100%;font-size:14px;padding:10px 14px}
 #game .left{grid-template-columns:1fr}
 #game #goals img{max-height:280px}
 #players .player{font-size:13px;padding:7px;grid-template-columns:25px minmax(0,1fr);gap:3px 6px}
 #players .player[aria-pressed=true]{padding:6px}
 #players .player>.icon{font-size:22px}
 .crew-resources{gap:8px;grid-column:1/-1;justify-content:center}
 .crew-resources img{width:22px;height:22px}
 #game .board-heading>.row{width:100%;justify-content:center}
 #game .board-heading>span{flex:1 1 100%;text-align:center}
 #game .board-heading button{padding:5px 8px}
 #game #resources{font-size:12px;gap:6px 12px;padding:7px}
 #game .camera-hint{font-size:11px}
 .mode-reference-columns{grid-template-columns:1fr;gap:18px}
 .mode-reference-columns article+article{border-left:0;border-top:1px solid #a4acb0;padding:15px 0 0}
 .mode-reference-dialog{padding:22px}
 #forecastChoices button{width:calc(50% - 8px)}
}
@media(prefers-reduced-motion:reduce){#tableCommand,#tableCommand button{transition:none}}
