/* Named cards: content-sized header, independent artwork, compact ability plaque. */
.card.painted-card{border:2px solid #c8a254!important;background:#f2e4c8;border-radius:10px!important;isolation:isolate;display:grid!important;grid-template-rows:auto minmax(0,1fr);padding:0!important}
.cat-harvest{--category:#174e29}.cat-explore{--category:#174f87}.cat-ship{--category:#d2a029}.cat-pirate{--category:#171916}.cat-defence{--category:#9c2926}.cat-store{--category:#71583d}.cat-island{--category:#206d66}
.card.painted-card .card-heading{position:relative;inset:auto;height:auto;min-height:0;background:linear-gradient(115deg,#ffffff0a,transparent),var(--category);border-bottom:1px solid #d9ad51;color:#fff2da;text-align:left;z-index:1;padding:7px 7px 5px;display:flex;flex-direction:column;gap:3px;grid-row:1}
.card.painted-card .card-heading strong{position:static!important;inset:auto!important;max-width:none!important;font:bold 15px/1.1 Georgia,serif!important;background:none!important;border:0!important;padding:0!important;margin:0!important;box-shadow:none!important;color:inherit!important;border-radius:0;white-space:normal;letter-spacing:-.3px;display:block!important}
.card.painted-card .card-heading:has(.points) strong{margin-right:33px!important;min-height:17px}
.card.painted-card .card-heading:has(.points){min-height:42px}
.card.painted-card .card-heading .cost{position:static!important;inset:auto!important;display:flex!important;gap:3px!important;flex-wrap:nowrap!important;padding:0!important;background:none!important;border:0!important;max-width:none!important;margin:0!important;height:22px;align-items:center}
.cost-picture{display:inline-block;width:23px;height:22px;object-fit:contain;background:none;vertical-align:middle;flex:none;border-radius:0}.cost-any{display:inline-grid;width:23px;height:22px;place-items:center;background:#f2e4c8;color:#453922;border:1px solid #c8a254;border-radius:3px;font:bold 17px Georgia}
.card.painted-card .card-heading .points{position:absolute;right:5px;top:5px;width:31px;height:31px;padding:0;border-radius:50%;border:1px solid #6b451e;background:radial-gradient(ellipse at 30% 20%,#fff4bf 0%,#ebc66c 34%,#c59439 72%,#f5d894 100%);box-shadow:inset 0 0 0 1px #fff0b6,inset 0 0 0 3px #b78938,0 1px 3px #0007;display:grid!important;place-items:center;z-index:2;color:#654016}
.points>svg,.points>b{grid-area:1/1}.points>svg{width:29px;height:29px;fill:none;stroke:#78521f;stroke-width:1.1;stroke-linecap:round}.points>b{font:bold 16px/1 Georgia;color:#503817;text-shadow:0 1px #fff1ba;padding:0 0 1px}
.card.painted-card .art{position:relative!important;inset:auto!important;grid-row:2;width:100%!important;height:100%!important;min-height:0;object-fit:cover;object-position:center top;background-image:none!important;background-repeat:no-repeat;background-color:#d6ceaf}
.cat-ship .card-heading{color:#293521!important}
.card.painted-card .text{position:absolute;bottom:5px!important;left:5px!important;right:5px!important;border:1px solid #b98d40!important;border-radius:6px!important;background:rgb(255 241 220 / 84%)!important;padding:6px!important;font:13px/1.2 Georgia,serif!important;max-height:45%!important;text-align:center;box-shadow:0 1px 3px #3e2b2522;z-index:1}
.card.painted-card .text:empty{display:none!important}
:is(.map-mini,#dock,.picker-hand) .card.painted-card .card-heading{padding:0!important;height:calc(var(--mini-w)*.20)!important;min-height:0!important;gap:0;border-bottom-width:1px}
:is(.map-mini,#dock,.picker-hand) .card.painted-card .card-heading strong,:is(.map-mini,#dock,.picker-hand) .card.painted-card .card-heading .cost,:is(.map-mini,#dock,.picker-hand) .card.painted-card .card-heading .points{display:none!important}
:is(.map-mini,#dock,.picker-hand) .card.painted-card .art{height:100%!important}
.choice .cost-picture{width:18px;height:18px}
/* Approved resource faces remain unchanged. */
.res-timber{--resource-art:url('assets/restored-timber.jpg')}.res-fish{--resource-art:url('assets/restored-fish.jpg')}.res-sugar{--resource-art:url('assets/restored-sugar.jpg')}.res-stone{--resource-art:url('assets/restored-stone.jpg')}.res-gold{--resource-art:url('assets/restored-gold.jpg')}
:is(#dock,#drawer,#card-focus,#collection) .resource,.resource{background-image:var(--resource-art)!important;background-size:cover!important;background-position:center!important}
/* Islands lie across the table; buildings stand upright beneath them. */
.card.painted-card.cat-island{--island-w:min(315px,calc(100vw - 44px));width:var(--island-w)!important;min-width:var(--island-w)!important;height:calc(var(--island-w)*63/88)!important;aspect-ratio:88/63!important}
.card.painted-card.cat-island .art{object-position:center top}
:is(.map-mini,#dock,.picker-hand) .card.painted-card.cat-island{width:calc(var(--mini-w)*88/63)!important;min-width:calc(var(--mini-w)*88/63)!important;height:var(--mini-w)!important}
.map-island-card{margin-bottom:7px;width:max-content}
.map-island-card .card.painted-card.cat-island{width:calc(var(--mini-w)*2)!important;min-width:calc(var(--mini-w)*2)!important;height:calc(var(--mini-w)*126/88)!important;border-radius:4px!important}
.map-island-card .card.painted-card .card-heading{height:5px;min-height:0;padding:0;border-bottom:0}
.map-island-card .card.painted-card .card-heading strong,.map-island-card .card.painted-card .card-heading .cost,.map-island-card .card.painted-card .card-heading .points,.map-island-card .card.painted-card .text{display:none!important}
#card-focus.landscape-focus{width:min(335px,calc(100vw - 24px))!important}
#card-focus.landscape-focus .focus-moves{width:100%}
.island-table-card{margin:12px 0;display:flex;justify-content:flex-start}
.island-panel .island-buildings{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;overflow-x:auto;gap:10px;padding-bottom:8px}
.map-miniatures{flex-wrap:nowrap!important;overflow-x:auto;max-width:240px;padding-bottom:3px}
#collection:has(.cat-island){grid-template-columns:repeat(auto-fit,minmax(min(315px,100%),1fr))}
.mini-resource{background-image:var(--resource-art)!important;background-size:cover!important;background-position:center!important}

.cat-goal{--category:#53446b}.goal-label{font:9px system-ui,sans-serif;letter-spacing:1.4px;text-transform:uppercase;color:#e9d7a6}.card.cat-goal .card-heading{min-height:58px!important}

/* Resource pictograms flow with text without changing spoken labels. */
.resource-inline{display:inline-block!important;width:1.35em!important;height:1.35em!important;max-width:none!important;object-fit:contain!important;vertical-align:-.3em;margin:0 .1em;background:transparent;border-radius:0;padding:0;box-sizing:border-box;filter:none!important}

/* Building levels sit beside the title, distinct from the victory-point medallion. */
.card.painted-card .card-heading strong:has(.card-level){display:flex!important;align-items:center;gap:.4em}
.card-level{flex:none;font:normal .9em/1 Georgia,serif;color:#efd390;letter-spacing:.03em;border-right:1px solid #efd39080;padding:.1em .4em .1em 0}
.card-name{min-width:0}
.cat-ship .card-level{color:#493d20;border-right-color:#493d2060}
#dock .card.painted-card .card-heading strong:has(.card-level){gap:3px}
#dock .card-level{font-size:.85em;padding-right:3px;letter-spacing:0}

/* Fortune rewards share the painted deck, with richer metalwork and value seals. */
.card.painted-card.fortune-card{--category:#173c47;border:3px solid #d6af5a!important;outline:1px solid #71501e;outline-offset:-1px;box-shadow:0 3px 9px #20170940,inset 0 0 0 1px #fff1bc;position:relative}
.card.painted-card.fortune-5{--category:#591f2e;border:4px double #f0cf76!important;box-shadow:0 3px 12px #6b451e55,inset 0 0 0 1px #fff2bd}
.card.painted-card.fortune-card .card-heading{padding:9px 52px 8px 9px;min-height:55px;background:linear-gradient(115deg,#ffffff10,transparent),var(--category);border-bottom:2px solid #c99d45;justify-content:center}
.card.painted-card.fortune-card .card-heading strong{font:bold 22px/1 Georgia,serif!important;color:#ffe4a0!important;letter-spacing:.2px;margin:0!important}
.fortune-value{position:absolute;top:6px;right:6px;display:grid;place-items:center;width:39px;height:39px;border-radius:50%;border:3px double #80551c;background:radial-gradient(circle at 30% 20%,#fff5c1,#e4b44f 62%,#a36b20);box-shadow:0 1px 3px #0007,inset 0 0 0 2px #ffdc87;color:#452b13;font:bold 30px/1 Georgia,serif;text-shadow:0 1px #ffecb3;z-index:3}
.card.painted-card.fortune-card .art{object-position:center 52%}
.card.painted-card.fortune-5:after{content:'';pointer-events:none;position:absolute;inset:2px;border:1px solid #f4d58099;border-radius:5px;z-index:4}
/* Landscape islands: floating title and separate information plaques. */
.card.painted-card.cat-island{display:block!important;position:relative;overflow:hidden}
.card.painted-card.cat-island .art{position:absolute!important;inset:0!important;object-fit:cover;width:100%!important;height:100%!important}
.card.painted-card.cat-island .card-heading{position:absolute;inset:0;display:block;background:none;border:0;padding:0;pointer-events:none}
.card.painted-card.cat-island .card-heading strong{position:absolute!important;top:7px!important;left:7px!important;max-width:calc(100% - 52px)!important;width:max-content;background:#164f48ed!important;border:1px solid #d3ad68!important;border-radius:5px;padding:6px 9px!important;margin:0!important;min-height:0;box-shadow:0 2px 6px #0003!important}
.card.painted-card.cat-island .card-heading .cost{display:none!important}
.island-footer{position:absolute;bottom:5px;left:5px;right:5px;display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:5px;z-index:1;color:#293c32;font:11px/1.2 Georgia,serif}
.island-facts,.island-price,.island-ability{background:rgb(255 241 220 / 84%);border:1px solid #b98d40;border-radius:5px;padding:4px 5px}
.island-facts{display:flex;align-items:center;gap:7px}.island-facts>span{display:flex;align-items:center;gap:2px}
.island-price{display:flex;align-items:center;gap:1px}.island-price small{font-size:9px;margin-right:2px}
.card.painted-card .island-footer .cost-picture{width:17px;height:17px}.island-ability{flex-basis:100%;font:13px/1.2 Georgia,serif;text-align:center}
:is(.map-mini,#dock,.picker-hand,.map-island-card) .island-footer{display:none!important}
:is(.map-mini,#dock,.picker-hand,.map-island-card) .card.painted-card.cat-island .card-heading{display:none!important}
/* Open corners: each symbol keeps a consistent position on physical cards too. */
.card.painted-card.cat-island .card-heading .cost{display:flex!important;position:absolute!important;top:38px!important;left:7px!important;right:auto!important;bottom:auto!important;background:#143a35bd!important;padding:2px 4px!important;border:1px solid #d3ad6877!important;border-radius:4px;height:25px;gap:2px!important}
.card.painted-card.cat-island .card-heading .cost .cost-picture{width:20px;height:20px}
.island-facts{background:none;border:0;padding:0;gap:5px;align-items:center}
/* Approved outlined foundation: artwork and numeral share one coordinate system. */
.island-plots{position:relative;background:none;border:0;border-radius:0;padding:0;display:block!important;width:44px;height:44px;flex:none;filter:drop-shadow(0 2px 2px #041d20)}
.island-plots svg{display:block;width:100%;height:100%;overflow:visible}
.island-fort{display:block!important;width:32px;height:36px;background:none;filter:drop-shadow(0 1px 1px #092f30)}
.island-yield{display:flex;align-items:center;justify-content:center;width:38px;height:38px;padding:4px;border:1px solid #d3ad68;border-radius:50%;background:#164f48ed;box-shadow:inset 0 0 0 2px #183e36}
.card.painted-card .island-yield .cost-picture{width:27px;height:27px}.island-yield:has(img+img){width:65px;border-radius:23px}
:is(.map-mini,#dock,.picker-hand,.map-island-card) .card.painted-card.cat-island .card-heading{display:none!important}
.card.painted-card.cat-island .card-heading strong{position:relative!important}
.card.painted-card.cat-island .card-heading .cost{position:relative!important;top:11px!important;width:max-content!important}

/* Approved unified card design — docs/card-design-rules.md. */
.card.painted-card{--card-symbol-size:26px;--inline-symbol-size:1.35em}
.card-symbol{display:inline-block;position:relative;flex:none;width:var(--inline-symbol-size,1.35em);height:var(--inline-symbol-size,1.35em);vertical-align:-.3em}
.card-symbol svg,.card-symbol .symbol-art{display:block;width:100%;height:100%;object-fit:contain}
.card-symbol.action{border-radius:50%;background:var(--symbol-colour);box-shadow:inset 0 0 0 1px #f1d394;padding:1px}
.symbol-harvest{--symbol-colour:#174e29;--sprite:0%}.symbol-explore{--symbol-colour:#174f87;--sprite:50%}.symbol-ship{--symbol-colour:#d2a029;--sprite:100%}.symbol-defence{--symbol-colour:#9c2926}.symbol-pirate{--symbol-colour:#171916}.symbol-store{--symbol-colour:#71583d}
.action:is(.symbol-harvest,.symbol-explore,.symbol-ship):before{content:"";position:absolute;inset:1px;background:url('assets/card-symbols/actions.png') var(--sprite) center/300% 100% no-repeat}
.fortune-chest text{fill:#fff0ce;font:bold 280px Georgia;stroke:none}
.card.painted-card .card-heading strong{white-space:nowrap!important;font-size:var(--card-title-size,15px)!important;margin:0!important;min-height:0;line-height:1.2!important;gap:5px!important}
.card.painted-card .card-name{white-space:nowrap;flex:none}
.card.painted-card .card-heading{padding:7px 8px 5px;gap:2px}
.card.painted-card .card-heading:has(>.card-symbol){min-height:calc(var(--card-symbol-size) + 6px)!important}
.card.painted-card .card-heading:has(>.card-symbol) strong{padding-right:calc(var(--card-symbol-size) + 5px)!important}
.card.painted-card .card-heading:has(>.fortune-chest):has(>.action) strong{padding-right:calc(var(--card-symbol-size)*2 + 9px)!important}
.card.painted-card .card-heading>.card-symbol{position:absolute;right:5px;top:3px;width:var(--card-symbol-size);height:var(--card-symbol-size);background:none;box-shadow:none;padding:0}
.card.painted-card .card-heading>.action:before{inset:0}
.card.painted-card .card-heading:has(>.action)>.fortune-chest{right:calc(var(--card-symbol-size) + 8px)}
.card.painted-card.has-cost .card-heading{padding-top:7px}
.card.painted-card.has-cost .card-heading strong{min-height:calc(var(--card-symbol-size) - 3px)}
.card.painted-card .text{left:50%!important;right:auto!important;transform:translateX(-50%);width:max-content;max-width:calc(100% - 12px);box-sizing:border-box}
.card.painted-card .text .card-symbol,.island-ability .card-symbol{width:var(--inline-symbol-size,1.35em);height:var(--inline-symbol-size,1.35em);vertical-align:-.3em}
.card.painted-card.fortune-card .card-heading{padding:6px 8px!important;min-height:calc(var(--card-symbol-size) + 6px)!important;justify-content:center}
.card.painted-card.fortune-card .card-heading strong{font-size:17px!important;line-height:1.2!important}
.card.painted-card.cat-island .card-heading strong{padding:3px 5px!important;top:5px!important;left:5px!important;max-width:calc(100% - var(--card-symbol-size) - 14px)!important;min-height:0!important;line-height:1.05!important}
.card.painted-card.cat-island .card-heading .cost{top:8px!important;left:5px!important;height:23px!important;padding:1px 3px!important}
.island-ability{flex-basis:auto;width:max-content;max-width:100%;margin-inline:auto}
:is(.map-mini,#dock,.picker-hand,.map-island-card) .card.painted-card .card-heading>.card-symbol{display:none!important}
/* Miniatures retain their compact coloured strip, with full detail in focus views. */
:is(.map-mini,#dock,.picker-hand) .card.painted-card .card-heading:has(>.card-symbol){min-height:0!important}

/* Approved 25 October: larger corner emblems, compact vertically centered headers. */
.card.painted-card{--card-symbol-size:31.2px}
.card.painted-card:not(.cat-island) .card-heading{padding:3px 8px!important;gap:1px;min-height:calc(var(--card-symbol-size) + 4px)!important;justify-content:center}
.card.painted-card.has-cost .card-heading strong{min-height:0!important}
.card.painted-card:not(.cat-island) .card-heading>.card-symbol{top:50%;transform:translateY(-50%)}
/* Preserve the miniature strips in hands and on the table. */
:is(.map-mini,#dock,.picker-hand) .card.painted-card:not(.cat-island) .card-heading{padding:0!important;min-height:0!important;gap:0}

/* Explicit sprite viewports render identically in the browser and printed PDF. */
.card-symbol.action:has(>.symbol-art):before{content:none}

.island-fort svg{display:block;width:100%;height:100%}

/* Approved raid option A: keep the black category, integrate a label and fine accent. */
.card.painted-card.is-raid .card-heading{box-shadow:inset 4px 0 #9b3043}
.card.painted-card.is-raid .raid-label{display:block;color:#efd08d;font:bold 9px Arial,sans-serif;letter-spacing:2px;line-height:1.1}
:is(.map-mini,#dock,.picker-hand) .card.painted-card.is-raid .raid-label{display:none}

/* Lower, wider effect plaques: keep short powers fitted to their text. */
.card.painted-card .text{bottom:3px!important;max-width:calc(100% - 8px);padding:4px!important}
.island-ability{padding:3px 4px}
