:root {
  --oak-face:#4e3426;
  --aged-gold:#bb9059;
  --old-ink:#482c1d;
  --voyage-paper:url("../img/ui/parchment.webp");
  --carved-menu:url("../img/ui/carved-menu.webp");
  --carved-wood:linear-gradient(180deg,#4b230c18,#200d04be),url("../img/ui/wood.webp");
  --serif-title:"Cormorant Garamond",Georgia,serif;
  --gilded-border:#eeb159;
  --gilded-edge:inset 0 0 0 1px #fff0ae,inset 0 0 0 4px #79400e,0 0 0 2px #512a11,0 6px 14px #180900a8;
}
.game-shell::before {
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:linear-gradient(180deg,#5f351c08 7%,#4229215c 39%,#261e1be7 95%),var(--scene-art) var(--scene-position)/cover no-repeat;
}
.game-shell :is(.topbar,.nav) {
  overflow:visible;
  isolation:isolate;
  border:0;
  border-radius:0;
  background:none;
  box-shadow:none;
}
.game-shell .nav::before {
  content:"";
  position:absolute;
  inset:2px clamp(2px,.6vw,10px) 1px;
  z-index:-1;
  pointer-events:none;
  border:solid transparent;
  border-width:0 clamp(23px,4vw,65px);
  border-image:var(--carved-menu) 0 170 fill / 0 clamp(23px,4vw,65px) stretch;
  filter:drop-shadow(0 3px 5px #100b06ab);
}
.game-shell .nav::before { bottom:calc(1px + env(safe-area-inset-bottom)); transform:scaleY(-1); }
.game-shell .nav {
  display:grid; grid-template-columns:repeat(5,minmax(0,1fr));
  gap:2px; padding:4px clamp(14px,3.8vw,68px) calc(7px + env(safe-area-inset-bottom));
}
.game-shell .nav button {
  min-width:0; max-width:none; flex-direction:column; overflow:visible;
  gap:2px; padding:2px 0; color:#ffedc3; inset-block-start:0;
}
.game-shell .nav button :is(small,.nav-art) { z-index:1; }
.game-shell .nav button small {
  padding:2px clamp(2px,.6vw,9px); border-radius:22px;
  color:#ffedc3; font:700 clamp(13px,1.55vw,21px)/1 var(--serif-title);
  text-shadow:0 2px 2px #301500;
}
.game-shell .nav button .nav-art {
  width:clamp(42px,4.6vw,60px); height:clamp(38px,3.6vw,46px);
  filter:drop-shadow(0 3px 2px #1f1008);
}
.game-shell .nav button.active { background:none; box-shadow:none; border-color:transparent; }
.game-shell .nav button.active::before { content:none; }
.game-shell .nav button.active small {
  color:#fff3c7; background:linear-gradient(#c3833678,#b57022d6,#ac571765);
  box-shadow:inset 0 1px 3px #ffe5a2b5,0 0 10px #ffa43f9a;
}
.game-shell .nav button:not(:last-child)::after {
  content:""; width:8px; height:8px; position:absolute; top:calc(50% - 4px); left:calc(100% - 3px);
  inset-inline-end:auto; background:#ffe8a0; animation:none; transform:rotate(45deg);
  box-shadow:0 0 5px #fff0b7,0 0 11px #e3913a; border-radius:1px; pointer-events:none;
}
.game-shell .nav button:last-child::after { content:none; }
.game-shell .nav button:is(:hover,:focus-visible) .nav-art { transform:translateY(-1px); filter:drop-shadow(0 0 5px #ffc277aa); }
.flag-picker { margin:14px 0; border:1px solid #b78d57; border-radius:8px; background:#c7985f22; }
.flag-picker summary { display:flex; align-items:center; gap:8px; padding:8px 10px; cursor:pointer; font-weight:700; }
.flag-picker summary::after { content:'▾'; margin-inline-start:auto; }
.flag-picker[open] summary::after { transform:rotate(180deg); }
.flag-picker canvas { width:21.5px; height:auto; }
.flag-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(48px,1fr)); gap:4px; max-height:200px; overflow-y:auto; padding:6px 8px; overscroll-behavior:contain; }
.dialog .flag-options label { position:relative; display:grid; margin:0; place-items:center; padding:3px 1px; border:1px solid #ac805238; border-radius:5px; cursor:pointer; }
.dialog .flag-options input[type="radio"] { position:absolute; inset:0; width:100%; height:100%; min-height:0; padding:0; opacity:0; margin:0; cursor:pointer; }
.flag-options label:has(:checked), .flag-options label:has(:focus-visible) { border-color:#9f6528; background:#e5b56970; }
@media(max-width:720px){
  :root { --top-h:61px; --nav-h:75px; }
  .game-shell .nav button { gap:0; }
  .game-shell .nav button .nav-art { height:37px; width:min(100%,44px); }
  .game-shell .nav button small { font-size:clamp(9px,2.7vw,15px); }
  .game-shell .nav button:not(:last-child)::after { width:4px; height:4px; left:calc(100% - 1px); }
}
@media(max-width:360px){
 .game-shell .nav { padding-inline:10px; }
}
.sheet[data-scene] { background:none; padding-block-start:0; }
.sheet #sheetContent { background:linear-gradient(141deg,#4b362be8,#2d2824f4 72%,#211d20f5); border-color:#b38b5b; }
.sheet[data-scene="shop"] #sheetContent,.sheet[data-scene="help"] #sheetContent,
.sheet[data-view-key^="build"] #sheetContent,
.sheet[data-view-key^="ships:"]:not([data-view-key="ships:list"]) #sheetContent,
.sheet[data-view-key^="islands:"]:not([data-view-key="islands:list"]) #sheetContent {
  padding:0; background:none; box-shadow:none; border:0;
}
.sheet[data-view-key^="build"],.sheet[data-view-key^="ships:"]:not([data-view-key="ships:list"]),
.sheet[data-view-key^="islands:"]:not([data-view-key="islands:list"]) { --sheet-opening-gap:clamp(8px,3vh,30px); }
.sheet[data-scene] .section-glow { background:radial-gradient(ellipse at 29% 34%,#eec48535,transparent 46%); }
#sheet :is(.voyage-header,.directory-heading,.guide-toolbar) {
  position:sticky; inset-block-start:0; z-index:6;
}
#sheetContent .guide-page :is(h2,h3), #sheetContent .guide-index summary {
  font-family:var(--serif-title)!important;
  font-weight:500;
}
#sheetContent .guide-page p { white-space:pre-line; }
#sheetContent .guide-page .guide-note { border-left:2px solid #ba9167; padding-left:11px; }
.resource-values { display:flex; flex-wrap:wrap; align-items:center; gap:5px 12px; }
.resource-amount { display:inline-flex; align-items:center; gap:4px; min-width:0; font-size:13px; white-space:nowrap; }
.resource-icon,.resource-amount .icon { width:27px; height:24px; object-fit:contain; vertical-align:middle; }
.resource-amount strong { font-variant-numeric:tabular-nums; }
.notice-jump:focus-visible,.battle-jump:focus-visible { outline:2px solid #ffd98e; outline-offset:3px; }
.battle-result {
  width:max-content; max-width:min(380px,100%);
}
.battle-jump {
  display:grid; gap:5px; width:100%; padding:10px 13px; text-align:left; pointer-events:auto;
  border:1px solid #c3945c; border-radius:10px; background:linear-gradient(145deg,#624631,#31282c);
  color:#ffedcb; box-shadow:inset 0 1px #ebcb8a79,0 6px 16px #1a1516a8;
}
.battle-result .resource-values { gap:4px 9px; justify-content:center; }
.battle-jump { text-align:center; }
.log-details { display:grid; gap:2px; font-size:12px; margin:5px 0; }
.log-details div { display:flex; justify-content:space-between; gap:12px; }
.log-details dd { margin:0; text-align:right; font-weight:600; }

.voyage-profile {
  width:min(100%,660px);
  margin:0 auto;
  padding:4px;
  color:var(--old-ink);
  background:linear-gradient(#6f5032,#30221c);
  border:1px solid #bb8f58;
  box-shadow:0 8px 23px #1f1719bc,inset 0 0 0 2px #c69b6269;
  border-radius:17px;
  overflow:clip;
}
#sheetContent .voyage-profile.ship-profile { max-width:620px; }
.voyage-header {
  display:flex; align-items:center; justify-content:center; min-height:45px; padding:4px 42px;
  background:linear-gradient(180deg,#704a2e98,#32241de3),url("../img/ui/wood.webp");
  color:#ffe7ae; border:1px solid #906235; border-radius:12px 12px 2px 2px; box-shadow:inset 0 1px 2px #ddad6f50;
}
#sheetContent .voyage-header h2 { display:flex; justify-content:center; align-items:center; gap:9px; margin:0; color:#ffedcb; font-size:clamp(17px,4vw,24px); line-height:1.16; text-align:center; }
.voyage-header h2 span { height:1px; width:clamp(8px,5vw,36px); background:linear-gradient(90deg,transparent,#c99b5b); }
.voyage-header h2 span:last-child { transform:scaleX(-1); }
.voyage-header button { position:absolute; inset-block-start:50%; inset-inline-start:8px; transform:translateY(-50%);
  display:grid; place-items:center; width:28px; height:27px; padding:0;
  border:1px solid #bd9565; border-radius:5px; color:#ffe5ac; background:#64452c; box-shadow:inset 0 1px #e0b7846a; }
.voyage-header button .icon { width:18px; height:18px; }
.voyage-hero { position:relative; min-height:210px; background:#183c51; overflow:hidden; margin:0; border:1px solid #b48959; border-radius:4px; }
.ship-hero {
  isolation:isolate;
  min-height:0;
  height:clamp(225px,57vw,392px);
  background:linear-gradient(180deg,#d5e5df66,#22465627 43%,#0a324d95),url("../img/ocean.webp") 48% 46%/cover no-repeat;
}
.ship-hero .ship-illustration { position:absolute; inset:5% 13%; width:74%; height:90%; object-fit:contain; animation:none; filter:drop-shadow(0 5px 7px #1c3449be); }
.voyage-stats {
  position:absolute; inset:10px 8px; display:grid; grid-template-columns:clamp(36px,11vw,66px) 1fr clamp(36px,11vw,66px);
  grid-template-rows:repeat(3,1fr); z-index:1; margin:0; pointer-events:none;
}
.voyage-stats > div { align-self:center; justify-self:center; grid-column:1; text-align:center; pointer-events:auto; cursor:help; }
.voyage-stats > div:nth-child(n+4) { grid-column:3; }
.voyage-stats > div:nth-child(3n+1){grid-row:1}.voyage-stats > div:nth-child(3n+2){grid-row:2}.voyage-stats > div:nth-child(3n){grid-row:3}
.voyage-stats dt {
  width:clamp(31px,9vw,52px); height:clamp(31px,9vw,52px); margin:0 auto;
  border:2px solid #b38856; border-radius:50%;
  background:radial-gradient(circle at 36% 20%,#b0cdd1,#365766 55%,#302c2b 92%);
  box-shadow:inset 0 0 0 1px #2c2826,inset 0 -2px 3px #2e2522ba,0 2px 4px #102e3db5;
  display:grid; place-items:center;
}
.voyage-stats dt img { width:78%; height:78%; object-fit:contain; filter:drop-shadow(0 1px 2px #342c25b2); }
.voyage-stats dd {
  margin:-2px auto 0; padding:1px 4px; color:#ffefce; background:#263d49eb; border:1px solid #bf976675; border-radius:6px;
  font:700 clamp(10px,2.5vw,14px)/1.2 var(--read-font);
}
.voyage-parchment {
  background:linear-gradient(90deg,#c4966527,transparent 13% 86%,#92613f3a),var(--voyage-paper);
  color:var(--old-ink); border-radius:3px 3px 11px 11px; padding:clamp(8px,2.1vw,18px);
}
#sheetContent .voyage-parchment :is(h3,p),.dialog .voyage-profile :is(h3,p) { color:var(--old-ink); }
.voyage-heading,#sheetContent .voyage-heading { margin:2px 0 7px; text-align:center; font-size:clamp(13px,3.1vw,18px); font-weight:700; }
.voyage-rows { display:grid; gap:0; margin:0 0 7px; }
.voyage-rows div { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:6px;
  padding:3px 0; font-size:clamp(11px,3vw,14px); border-bottom:1px solid #aa7a4b61; }
.voyage-rows dt { display:flex; align-items:center; gap:6px; }
.voyage-rows dt img { width:19px; height:19px; object-fit:contain; }
.voyage-rows dd { margin:0; font-weight:700; text-align:right; }
.voyage-captain {
  display:grid; grid-template-columns:clamp(65px,25%,123px) minmax(0,1fr); align-items:start;
  gap:clamp(10px,2vw,18px); margin:8px 0 14px;
}
.voyage-captain > img { display:block; width:100%; aspect-ratio:1; object-fit:cover; border:2px solid #9b6d45; border-radius:9px; }
.voyage-captain-details { display:grid; min-width:0; gap:7px; }
.voyage-captain-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.voyage-captain-heading strong { display:block; font-size:clamp(15px,2.5vw,19px); overflow-wrap:anywhere; }
.voyage-captain-heading small { display:block; margin-top:4px; color:#705039; font-size:clamp(13px,2vw,16px); }
.voyage-captain-heading .fleet-quick-actions { flex:none; padding-top:0; }
.voyage-captain-heading .helm-action[aria-disabled="true"] { opacity:.63; cursor:default; }
.voyage-ship-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin:8px 0; }
.voyage-button {
 display:inline-flex; align-items:center; justify-content:center; gap:4px; min-height:34px; padding:5px 3px;
 border:1px solid #c59b63; border-radius:6px; color:#ffecc4; background:linear-gradient(#775333,#39281d 73%);
 box-shadow:inset 0 0 0 1px #291f17,inset 0 1px #dfb47b8a,0 2px 3px #5c3b2f56;
 font-size:clamp(10px,2.8vw,13px); font-weight:600;
}
.voyage-button .icon { width:16px; height:16px; }
.voyage-button[data-action="ship.sail"] { background:linear-gradient(#527587,#274c64); }
.voyage-button[data-action="ship.fire"] { background:linear-gradient(#9a5846,#65392f); }
.voyage-button[aria-pressed="true"] { box-shadow:inset 0 0 0 1px #ffdb93,0 0 7px #c79342; }
.island-hero { min-height:0; height:clamp(190px,48vw,275px); background:#0b4c62 url('../img/ocean.webp') center/cover; }
.island-hero > img { width:100%; height:100%; padding:5px 10px 15px; object-fit:contain; object-position:center; }
.island-hero > img { filter:saturate(.86) contrast(.92) blur(.35px); }
.voyage-box,.island-protection { padding:6px 8px; border:1px solid #b78d65; border-radius:8px; margin:6px 0 8px; background:#f9e9c5a1; }
#sheetContent .voyage-box h3 { margin:1px 0 4px; font-size:clamp(12px,3vw,15px); color:#5e3d26; }
.voyage-box h3 .helpLink { width:19px; height:19px; }
.voyage-box h3 .helpLink .icon { width:12px; height:12px; }
.island-resources { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:3px; }
.island-resources :is(.resource-icon,.icon) { width:clamp(34px,12.2vw,58px); height:clamp(34px,12.2vw,56px); }
.island-resources .resource-amount { display:grid; justify-items:center; gap:1px; font-size:clamp(10px,2.6vw,14px); }
.island-building-list { display:grid; gap:4px; }
#sheetContent .island-building {
  display:grid; grid-template-columns:clamp(46px,17vw,100px) minmax(0,1.02fr) minmax(0,1fr) 8px;
  align-items:center; gap:clamp(4px,1.2vw,9px); min-width:0; width:100%; padding:2px 5px 2px 2px;
  border:1px solid #ba9065; border-radius:7px; color:#4d3124; background:linear-gradient(#fff3d3,#e9cf9f); text-align:left;
}
#sheetContent .island-building.building-affordable {
  position:relative;
  border-color:#c99520;
  box-shadow:inset 0 0 0 1px #e6bd52,0 0 3px #dcae4966;
}
#sheetContent .island-building.building-affordable::after {
  content:"";
  position:absolute; top:7px; left:9px;
  width:14px; height:14px; z-index:1; pointer-events:none;
  background:center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10.8' fill='%23fffbea' stroke='%2349a94c' stroke-width='2'/%3E%3Cpath d='M12 5.2 18 12H15v6H9v-6H6Z' fill='%2349a94c' stroke='%2349a94c' stroke-linejoin='round' stroke-width='.7'/%3E%3C/svg%3E");
}
#sheetContent .island-building .diorama { width:100%; height:clamp(38px,11vw,66px); object-fit:contain; border-radius:4px; }
.island-building :is(strong,small),.island-registry-item :is(strong,small) { display:block; }
.island-building strong { overflow-wrap:anywhere; font:700 clamp(10px,2.8vw,15px)/1.21 Arial,sans-serif; }
#sheetContent .island-building > span:nth-child(2) > small { font:400 clamp(9px,2.4vw,12px)/1.21 'Segoe UI',sans-serif; color:#765239; }
.island-building small,.current-building-effect { font-size:clamp(9px,2.4vw,12px); line-height:1.21; }
#sheetContent .building-production-amount { display:inline-block; white-space:nowrap; }
#sheetContent .building-production-amount .resource-icon { width:1.5em; height:1.5em; object-fit:contain; vertical-align:middle; }
:is(.construction-progress,.treasure-track) {
 --gold-progress-fill:linear-gradient(#ffe398,#da8b29 60%,#aa5317);
 border:1px solid #8f5929;
 background-color:#8b5f3c54;
 box-shadow:inset 0 1px 2px #59260c45;
}
.construction-progress {
 grid-column:1/-1; margin:3px 5px 5px; display:block; padding:5px 8px; border-radius:7px;
 background-image:var(--gold-progress-fill);
 background-size:var(--progress,0%) 100%;
 background-repeat:no-repeat;
 color:#523318; text-align:center; font-size:clamp(11px,2.8vw,15px);
}
#sheetContent :is(.island-building,.fleet-ship-text) > .construction-progress {
 padding-block:3px;
 font-size:13.333px;
 line-height:1.2;
 overflow-wrap:anywhere;
}
#sheetContent :is(.island-building,.fleet-ship-text) > .construction-progress b {
 font:inherit;
 font-weight:700;
}
.resource-art { position:relative; display:inline-grid; }
.island-resources .production-badge {
 position:absolute; inset:45% -8px auto auto; min-width:21px; min-height:21px;
 display:grid; place-items:center; padding:1px 3px; border:1px solid #eed38a; border-radius:99px;
 background:#38613b; color:#fff8d5; font-size:11px; line-height:1;
}
.voyage-chevron { color:#895935; font-weight:700; }
.island-services { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-block:8px; }
.island-services > :is(button,.island-service-unbuilt) {
 display:grid; grid-template-rows:auto minmax(44px,95px) auto; gap:0; min-width:0; overflow:hidden;
 padding:0; border:1px solid #946541; border-radius:8px; color:#ffe8c1; background:linear-gradient(#694933,#3a2a21); text-align:center;
}
.island-services img { width:100%; height:100%; object-fit:cover; }
.island-services .island-service-unbuilt img { filter:grayscale(1); opacity:.8; }
.island-services :is(strong,span){ padding:4px 1px; font-size:12px; }
.last-known { padding:0; border:0; color:#625c56; background:transparent; font-size:12px; }
.island-registry { display:grid; }
.building-portrait { min-height:134px; padding:10px; display:grid; justify-items:center; gap:6px; color:#ffeac2;
 background:radial-gradient(ellipse at 40% 20%,#b5895548,transparent 65%),linear-gradient(#68503a,#493328); }
.building-portrait img { width:min(100%,275px); height:clamp(100px,30vw,205px); object-fit:contain; }
.building-portrait span { font-size:12px; }
.voyage-parchment .building-comparison { padding:0; grid-template-columns:repeat(2,minmax(0,1fr)); }
.voyage-parchment .building-comparison div { background:#ddc29d; border:1px solid #b48a60; }
.voyage-parchment .building-comparison div+div { background:#e6dbb6; }
.voyage-parchment .building-comparison :is(dt,dd),.voyage-parchment .building-comparison div+div dd { color:#573926; }
.cost-amount { flex-wrap:wrap; padding:1px 1px 3px; }
.cost-amount small { display:block; min-width:100%; font-size:10px; color:#6f523a; }
.cost-short strong { color:#9d3b2c; }
.voyage-parchment .build-time { font-size:12px; margin:7px 0; }
#sheetContent .voyage-parchment .scene-action-grid { --pictogram-ink:#50341f; grid-template-columns:repeat(auto-fit,minmax(125px,1fr)); }
.voyage-parchment .advanced-actions { color:#5c3d2a; padding:5px; }
@media (max-width:420px) {
  .island-services > :is(button,.island-service-unbuilt) { grid-template-rows:auto minmax(44px,65px) auto; }
  .voyage-header { min-height:38px; }
}
.ship-hero::after {
  content:"";
  position:absolute;
  inset:2px;
  z-index:2;
  border:1px solid #bb914fa6;
  border-radius:6px;
  box-shadow:inset 0 0 0 2px #29271e95,inset 0 0 16px #321e1b69;
  pointer-events:none;
}
.voyage-stats > div:first-child dt { background:radial-gradient(circle at 33% 19%,#dfa783,#75463e 65%,#332822); }
.voyage-stats > div:nth-child(3) dt { background:radial-gradient(circle at 33% 19%,#d4a66e,#785b3e 65%,#332822); }
#sheetContent .island-building small { color:#765239; }
#sheetContent .island-building .diorama { display:block; }

/* Painted buttons are shared by panels, dialogs and the handbook. */
:is(.game-shell,.dialog) :is(.helpLink,.action-info,.dismiss-icon),.dialog .head > .dismiss-icon {
  background:var(--utility-art) center/contain no-repeat;
  border:0; border-radius:0; box-shadow:none; padding:0;
  background-color:transparent;
}
:is(.game-shell,.dialog) :is(.helpLink,.action-info) { --utility-art:url("../img/ui/button-help.webp"); }
:is(.game-shell,.dialog) .dismiss-icon,.dialog .head > .dismiss-icon { --utility-art:url("../img/ui/button-close.webp"); }
:is(.game-shell,.dialog) :is(.helpLink,.action-info,.dismiss-icon)::after,.dialog .dismiss-icon::after { content:none; }
:is(.game-shell,.dialog) :is(.helpLink,.action-info,.dismiss-icon) .icon,.dialog .dismiss-icon .icon { opacity:0; }
:is(.game-shell,.dialog) :is(.helpLink,.action-info,.dismiss-icon):is(:hover,:focus-visible),.dialog .dismiss-icon:is(:hover,:focus-visible) {
  filter:brightness(1.18) drop-shadow(0 0 3px #ffbf63a0);
  background:var(--utility-art) center/contain no-repeat;
}
.game-shell .top-action:focus-visible,.game-shell .nav button:focus-visible,
:is(.island-directory,.tavern-hall,.voyage-profile,.boutique) button:focus-visible {
  outline:2px solid #ffdd87; outline-offset:2px;
}

.sheet:is([data-view-key="islands:list"],[data-view-key="tavern"]) {
  top:env(safe-area-inset-top);
  --sheet-opening-gap:clamp(6px,1.25vw,18px);
  padding-inline:var(--sheet-opening-gap);
  padding-block-end:var(--sheet-opening-gap);
}
.game-shell:has(#sheet:not([hidden]):is([data-view-key="islands:list"],[data-view-key="tavern"])) .topbar { display:none; }
.sheet:is([data-view-key="islands:list"],[data-view-key="tavern"]) #sheetContent {
  min-height:100%; padding:0; background:none; box-shadow:none; border:0;
}
.island-directory,.tavern-hall {
  min-height:calc(100dvh - var(--nav-h) - 30px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  border:2px solid var(--gilded-border); border-radius:clamp(13px,2.5vw,24px); box-shadow:var(--gilded-edge);
  overflow:clip;
}
.island-directory {
  background-color:#12343e;
  background-image:linear-gradient(#10262a80,transparent 32%),url("../img/scenes/island-directory.webp");
  background-position:center,center 55%; background-size:cover; background-repeat:no-repeat;
}
.directory-heading {
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  padding:clamp(7px,1.4vw,17px) clamp(10px,2vw,25px); border-bottom:3px ridge #edba6b;
  background:var(--carved-wood); box-shadow:0 4px 8px #160b06b5;
}
#sheetContent .directory-heading .section-heading {
  --section-heading-gap:clamp(5px,1.3vw,14px);
  margin:0;
  gap:var(--section-heading-gap);
}
#sheetContent .directory-heading .section-heading h2 {
  margin:0; color:#ffe5b1; font:700 clamp(28px,5vw,53px)/1 var(--chrome-font); text-shadow:0 2px 2px #311207;
}
.directory-heading .section-emblem {
  margin-inline-end:var(--section-heading-gap);
  width:clamp(43px,7.2vw,77px); height:clamp(43px,7.2vw,77px);
  display:grid; place-items:center; border:2px solid #f2b558; border-radius:50%;
  background:radial-gradient(#52301b,#201109); box-shadow:var(--gilded-edge);
}
.directory-heading .section-emblem img { width:84%; height:84%; object-fit:contain; }
.directory-heading .relief-icon { width:clamp(31px,5vw,49px); height:clamp(31px,5vw,49px); flex:none; }
.sheet:is([data-view-key="ships:list"],[data-view-key="market"]) #sheetContent { padding:0; overflow:clip; }
.sheet:is([data-view-key="market"],[data-view-key="ships:list"]) { --sheet-opening-gap:0px; }
.directory-content { padding:clamp(14px,3vw,32px); }
.island-registry { gap:clamp(8px,1.25vw,16px); padding:clamp(5px,1.15vw,12px); }
.island-registry-item {
  position:relative;
  display:block;
  container-type:inline-size;
  width:100%;
  padding:0;
  aspect-ratio:1556 / 1112;
  border:0;
  border-radius:clamp(12px,3vw,35px);
  background:url("../img/ui/island-registry-frame.webp") center / 100% 100% no-repeat;
  color:#301b0b;
  text-align:left;
  filter:drop-shadow(0 4px 5px #180c04b5);
}
.island-registry-art {
  position:absolute; inset:3.5% auto auto 4%;
  width:31%; height:31%; object-fit:contain;
  filter:saturate(1.13) contrast(1.05) drop-shadow(0 3px 3px #057f9a7a);
}
.island-registry-name {
  position:absolute; inset:6.5% 26% 63% 36%;
  display:flex; flex-direction:column; align-items:flex-start; justify-content:center; min-width:0;
}
.island-registry-item .island-registry-name strong {
  font:700 clamp(15px,4.8cqw,58px)/.98 var(--serif-title);
  overflow-wrap:anywhere;
}
.island-registry-item .island-registry-name small {
  display:inline-flex; gap:.37em; align-items:center;
  margin:.38em 0 0; padding:.13em .7em;
  border:1px solid #ae6e27; border-radius:1em; color:#3c250d;
  background:linear-gradient(#ffedb8,#ecc378);
  box-shadow:inset 0 0 0 1px #ffedc3,0 1px 1px #72441d65;
  font:700 clamp(10px,2.7cqw,33px)/1.14 var(--serif-title);
}
.island-registry-name small span {
  color:#b96b13; text-shadow:0 1px #fff4b1,0 -1px #633909; font-size:1.22em;
}
.island-stele > span {
  position:absolute; left:84.8%; transform:translate(-50%,-50%);
  white-space:nowrap; font-family:var(--serif-title);
}
.island-stele-level {
  top:17%; color:#ffde83; font-size:clamp(24px,8.25cqw,99px);
  font-weight:700; line-height:1; text-shadow:0 2px 2px #321708,0 -1px #fff0ae;
}
.island-stele-label {
  top:28.5%; color:#45260d; font-size:clamp(10px,3.03cqw,36px);
  font-weight:700; line-height:1;
}
.island-registry-stats {
  position:absolute; inset-block:51% 8.6%; display:grid; grid-auto-rows:minmax(min-content,1fr);
  font:600 clamp(8.5px,2.67cqw,34px)/1.59 var(--serif-title);
}
.island-registry-defense { inset-inline:7% 53.6%; }
.island-registry-economy { inset-inline:53.5% 7%; }
.island-registry-stat {
  display:grid; grid-template-columns:24% minmax(0,1fr); gap:7%;
  min-height:0; align-items:center;
}
.island-registry-stat + .island-registry-stat { border-top:1px solid #ad73377a; }
.island-registry-stat > :is(img,svg) {
  display:block; width:100%; height:88%; min-height:0; object-fit:contain;
  filter:drop-shadow(0 1px 1px #60360780);
}
.island-registry-stat b { font-size:1.15em; font-weight:700; white-space:nowrap; }
.treasure-search {
  position:relative; margin:17px 2px 14px; padding:clamp(10px,2vw,19px);
  border:5px solid transparent; border-radius:clamp(16px,3vw,25px);
  background:linear-gradient(105deg,#f4ca887a,#fff2cd70 40% 65%,#d79b594d) padding-box,
    var(--voyage-paper) padding-box,linear-gradient(150deg,#ffe5a1,#9a4914 19%,#f5be55 38%,#79400e 63%,#fada85 91%) border-box;
  box-shadow:0 0 0 1px #4b240b,0 4px 9px #4a1f0c61,inset 0 0 0 1px #784419,inset 0 0 0 3px #ffde91;
  text-align:center;
}
.treasure-main { display:grid; grid-template-columns:32% minmax(0,1fr); align-items:center; }
.treasure-art-column { display:flex; flex-direction:column; align-items:center; align-self:start; gap:4px; min-width:0; }
.treasure-art { width:100%; height:auto; display:block; object-fit:contain; max-height:170px; }
.treasure-controls {
  display:grid; justify-items:center; align-content:center; gap:6px; min-height:105px;
  padding:7px 0 7px clamp(8px,2vw,18px); border-inline-start:1px solid #a6713b70;
}
#sheetContent .treasure-controls h3 { margin:0; font:700 clamp(17px,4.3vw,31px)/1.05 var(--serif-title); }
.treasure-controls h3::after {
  content:''; display:block; margin:7px auto 0; width:84%; height:1px;
  background:linear-gradient(90deg,transparent,#ad7638,transparent);
}
.treasure-status { margin:0; font:700 clamp(14px,3.2vw,20px)/1.2 var(--serif-title); }
#sheetContent .treasure-search .treasure-status { color:#57351c; text-shadow:none; opacity:1; }
#sheetContent .treasure-size {
  display:grid; grid-template-columns:minmax(0,1fr) 27px; align-items:center; column-gap:8px;
  margin:7px 0 5px;
  padding-bottom:6px;
  border-bottom:1px solid #a6713b62;
  font:600 clamp(12px,3.2vw,17px)/1.18 var(--read-font);
}
.treasure-countdown { width:min(100%,244px); display:grid; gap:5px; }
.treasure-track {
  height:10px;
  overflow:hidden;
  border-radius:99px;
}
.treasure-track span {
  display:block;
  width:0;
  height:100%;
  border-radius:inherit;
  background:var(--gold-progress-fill);
  transition:width 1s linear;
}
@media (prefers-reduced-motion:reduce) {
  .treasure-track span { transition:none; }
}
.treasure-collect {
  position:relative;
  width:min(100%,230px); min-height:44px; padding:5px 15px; border:3px ridge #f6c468; border-radius:99px;
  background:linear-gradient(#a66122,#6c340b 42%,#421900 56%,#78350a); color:#ffefc2;
  box-shadow:inset 0 1px #ffd481,0 2px 5px #5e2a1578;
  font:700 clamp(20px,4.7vw,30px)/1 var(--serif-title); text-shadow:0 1px 2px #462209;
}
.treasure-collect::before,.treasure-collect::after {
  content:''; position:absolute; top:50%; width:7px; height:7px; transform:translateY(-50%) rotate(45deg);
  border:1px solid #ffde81; background:linear-gradient(135deg,#ffde81,#9b5a1b); box-shadow:0 0 1px #49250b;
}
.treasure-collect::before { inset-inline-start:6px; }
.treasure-collect::after { inset-inline-end:6px; }
.treasure-collect:disabled { filter:grayscale(.55); opacity:.68; cursor:default; }
.treasure-collect:focus-visible { outline:2px solid #3f250e; outline-offset:2px; }
.treasure-details { border-top:1px solid #a6713b62; padding-top:3px; }
#sheetContent .treasure-details p { margin:5.5px 0; line-height:1.375; }
#sheetContent .treasure-details .treasure-streak-note { font-size:.8em; line-height:1.3; }
.treasure-search { padding-bottom:clamp(5px,1vw,9.5px); }
.treasure-size-text { grid-column:1; min-width:0; text-align:start; margin-inline-start:5px; }
#sheetContent .treasure-size > .helpLink {
  grid-column:2;
  position:static;
  justify-self:end;
  align-self:center;
  width:27px; height:27px;
  translate:0 -2px;
}
#app .treasure-search :is(h3,.treasure-status,.treasure-collect) { font-family:var(--serif-title)!important; }

:is(.island-profile,.ship-profile) {
  border:2px solid var(--gilded-border); border-radius:clamp(13px,2vw,24px);
  padding:clamp(5px,1.2vw,12px); box-shadow:var(--gilded-edge); background:var(--carved-wood);
}
:is(.island-profile,.ship-profile) .voyage-header {
  border:2px solid #d99746; border-radius:16px 16px 7px 7px; background:var(--carved-wood);
  min-height:clamp(43px,7vw,70px); box-shadow:inset 0 0 0 1px #fee4a7;
}
#sheetContent :is(.island-profile,.ship-profile) .voyage-header h2 {
  font:700 clamp(22px,4.4vw,49px)/1 var(--chrome-font); color:#ffe8b5;
  text-shadow:0 2px 2px #321208;
}
:is(.island-profile,.ship-profile) .voyage-header button {
  width:clamp(28px,5vw,45px); height:clamp(28px,5vw,43px); border:2px solid #e3a953;
  background:var(--carved-wood); box-shadow:inset 0 0 0 1px #9a5923,0 2px 3px #1e0c03;
}
.island-profile .voyage-header .dismiss-icon {
  inset-inline:auto 8px; border:0; background:var(--utility-art) center/contain no-repeat; box-shadow:none;
}
:is(.island-profile,.ship-profile) .voyage-hero {
  margin-top:5px; border:2px solid #f3b352; border-radius:14px;
  box-shadow:inset 0 0 0 2px #fff0ab,0 0 0 2px #794317;
}
.island-profile .island-hero { height:clamp(215px,51vw,456px); }
.island-nameplate {
  position:relative;
  z-index:1;
  display:grid;
  place-items:center;
  container-type:inline-size;
  aspect-ratio:6.4;
  min-height:45px;
  margin:clamp(-26px,-5vw,-13px) -2px -5px;
  background:url('../img/ui/island-nameplate.webp') center / 100% 100% no-repeat;
  color:#442911;
  text-align:center;
}
.island-nameplate > div { display:grid; width:67%; gap:2px; padding:6px 0 8px; }
#sheetContent .island-nameplate h2 {
  margin:0;
  color:#442911;
  font:700 clamp(17px,5.4cqw,43px)/.98 var(--serif-title);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-shadow:none;
}
#sheetContent .island-nameplate p {
  margin:0;
  color:#533218;
  font:500 clamp(10px,3.35cqw,23px)/1.04 var(--serif-title);
}
.island-owner {
  display:grid;
  gap:2px;
  margin:clamp(8px,2.1vw,18px) 0 8px 3px;
  color:#4e2d17;
  font:600 clamp(13px,2.9vw,20px)/1.15 var(--serif-title);
  overflow-wrap:anywhere;
}
.island-owner > strong { font-size:110%; }
.island-owner small { font:400 .77em/1.15 var(--read-font); }
:is(.island-profile,.ship-profile) .voyage-parchment {
  border:1px solid #c89349; border-radius:12px; box-shadow:inset 0 0 0 2px #ffde9b80;
  background:linear-gradient(90deg,#bb7c473f,transparent 17% 83%,#bb7c4730),var(--voyage-paper);
}
.spending-confirmation { text-align:center; }
.spending-confirmation .resource-values,.spending-confirmation .row { justify-content:center; }
.confirmation-icon { display:inline-grid; place-items:center; width:52px; height:52px; border:2px solid #ad743a; border-radius:50%; color:#955b24; }
.confirmation-icon .icon { width:31px; height:31px; }
.cargo-proceeds { display:block; margin:4px 0; text-align:right; color:#703b13; font-weight:700; }
.cargo-proceeds[hidden] { display:none; }
.ship-list-tools { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:4px 0 10px; }
.ship-list-tools label { display:grid; gap:3px; color:inherit; font-size:13px; }
.ship-list-tools select { min-width:0; width:100%; padding:6px; border:1px solid #b1814d; border-radius:7px; background:#fff0d1; color:#422921; }

.ship-profile .ship-hero {
  height:clamp(228px,56vw,480px);
  background:linear-gradient(#14506c1a,#0d31424d),url("../img/ui/world_landscape.webp") center 43%/cover;
}
.ship-profile .voyage-stats dt { border-color:#ffcd73; background:radial-gradient(at 35% 30%,#875737,#3a1f15 68%); }
.ship-profile .voyage-stats dd {
  margin:-3px auto 0; border:1px solid #e7b667; background:var(--carved-wood);
  font:700 clamp(12px,2.8vw,22px)/1.1 var(--chrome-font); box-shadow:0 2px 3px #210d06; white-space:nowrap;
}
.voyage-identity {
  position:relative; z-index:1; display:grid; justify-items:center; gap:2px;
  width:min(87%,490px); padding:4px 10px 6px; margin:-15px auto -2px;
  background:var(--carved-wood); color:#fff0c9; border:2px solid #e9b362; border-radius:16px 16px 12px 12px;
  box-shadow:0 2px 5px #2c1309a8; font:600 clamp(13px,2.7vw,21px)/1.1 var(--chrome-font);
}
.voyage-identity strong { color:#48250d; background:var(--voyage-paper); padding:3px 18px; border-radius:12px; font-size:1.55em; text-align:center; }
.voyage-identity > span { font-size:1.5em; text-align:center; overflow-wrap:anywhere; }
.voyage-identity small { font-size:.8em; text-align:center; overflow-wrap:anywhere; }
.ship-profile .voyage-parchment { padding-top:12px; }
.ship-profile .voyage-rows { column-gap:clamp(8px,2vw,30px); }
.ship-profile .voyage-rows div { padding:5px 4px; font:400 clamp(13px,2.1vw,20px)/1.2 var(--read-font); }
@media(min-width:590px){
 .ship-profile .voyage-rows:not(.ship-resource-rows) { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(3,auto); grid-auto-flow:column; }
}
.voyage-ship-actions { gap:clamp(5px,1vw,12px); }
.ship-action-tile {
  display:grid; gap:3px; min-width:0; place-items:center; background:none; border:0; padding:0;
  color:#4d270c; font:700 clamp(12px,2vw,19px)/1.05 var(--chrome-font); text-align:center;
}
.ship-action-tile img { display:block; width:min(100%,110px); aspect-ratio:1.3; object-fit:contain; filter:drop-shadow(0 2px 2px #562a123c); }
.ship-listing-art {
  display:grid; place-items:center; width:min(100%,110px); aspect-ratio:1.3;
  color:#795024;
}
.ship-listing-art .icon { width:40%; height:auto; aspect-ratio:1; }

.tavern-hall {
  background:linear-gradient(#260f0626,#1e0e0550),url("../img/scenes/tavern.webp") center/cover;
  display:flex; flex-direction:column; align-items:center; justify-content:space-between; gap:10px;
  padding:clamp(10px,2vw,22px);
}
.tavern-actions {
  --tavern-action-gap:clamp(6px,1.6vw,18px);
  display:grid; width:min(93%,690px); grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--tavern-action-gap);
}
.tavern-actions button { padding:0; background:none; border:0; }
.tavern-actions button:last-child:nth-child(odd) {
  grid-column:1/-1; justify-self:center; width:calc((100% - var(--tavern-action-gap)) / 2);
}
.tavern-actions img { width:100%; display:block; aspect-ratio:1; object-fit:contain; }
.tavern-limits { display:flex; justify-content:center; padding:.45rem 0 .25rem; }
#sheetContent .tavern-location {
  display:block; margin:0; padding:5px 9px; color:#fff0c3; background:#251309d4;
  border-radius:6px; font:600 clamp(24px,3.2vw,34px)/1.2 var(--chrome-font); text-align:center;
}

#app :is(.nav small,.directory-heading h2,
 .voyage-header h2,
 .voyage-identity *,.ship-profile .voyage-stats dd,.ship-action-tile span),
#overlay .ship-profile :is(.voyage-identity *,.voyage-stats dd) { font-family:var(--serif-title)!important; }
.ship-profile .voyage-rows :is(dt,dd) { font-family:var(--read-font); font-weight:400; }
.ship-profile .voyage-rows dt img { flex:none; }

.voyage-can-rename .voyage-header { padding-inline: max(76px, calc(2 * clamp(28px, 5vw, 45px) + 21px)); }
.voyage-can-rename .voyage-header :is(.rename-ship,.rename-island) {
  inset-inline: calc(13px + clamp(28px, 5vw, 45px)) auto;
}
.ship-profile .voyage-header .dismiss-icon {
  inset-inline: auto 8px;
  border: 0;
  background: var(--utility-art) center / contain no-repeat;
  box-shadow: none;
}
.voyage-can-rename .voyage-header h2 { overflow-wrap: anywhere; min-width: 0; }
.voyage-can-rename .voyage-header h2 span { flex-shrink: 1; min-width: 0; }
.ship-profile .voyage-captain { margin-top: calc(15px + clamp(16.9px, 4.03vw, 23.4px)); }
.ship-hold-summary { margin-top: 20px; }
.ship-hold-summary h3 { margin: 0 0 7px; font-size: clamp(14px, 3vw, 18px); }

/* Upgrade effects below the selected or installed upgrade name. */
#actorForm .ship-upgrade-effect {
  margin:.15em 0 .8em; text-align:center; color:#684627;
  font-size:.9em; line-height:1.35;
}
.installed-upgrade-list { list-style:none; margin:.45em 0 .8em; padding:0; }
.installed-upgrade-list li { padding:.42em 0; border-bottom:1px solid #ad7d4d52; }
.installed-upgrade-list li:last-child { border-bottom:0; }
.installed-upgrade-list strong,.installed-upgrade-list small { display:block; }
.installed-upgrade-list small { margin-top:.2em; color:#765239; line-height:1.35; }

/* Repair progress occupies the full row beneath the ship thumbnail and details. */
.fleet-ship-main > .construction-progress { grid-column:1/-1; display:block; margin:0 3px 0; padding-block:3px; font-size:13.333px; line-height:1.2; overflow-wrap:anywhere; }
.fleet-ship-main > .construction-progress b { font:inherit; font-weight:700; }
.fleet-ship-main:has(> .construction-progress) { row-gap:4px; }
.voyage-captain-details > .captain-traits { margin-top:2.5px; gap:3px 6px; }
.voyage-captain-details > .captain-traits .captain-bonus { margin-top:2px; }

/* Shipyard queues: each ship name sits above a full-width progress bar. */
#sheetContent .yard-ship-entry {
  display:grid; grid-template-columns:minmax(0,1fr); grid-column:1/-1;
  align-items:stretch; justify-items:stretch; gap:4px; min-width:0; width:100%; box-sizing:border-box;
}
#sheetContent .yard-ship-entry > strong { display:block; min-width:0; overflow-wrap:anywhere; }
#sheetContent .yard-ship-entry > .construction-progress {
  display:block; grid-column:1/-1; width:100%; box-sizing:border-box; margin:0;
  padding:6px 8px; min-height:28px; font-size:13.333px; line-height:1.2; overflow-wrap:anywhere;
}
#sheetContent .yard-ship-entry > .construction-progress b { font:inherit; font-weight:700; }
#sheetContent .island-building > .yard-ship-entry { padding:2px 3px 4px; }

#sheetContent .captain-inline-stats { display:inline; font-size:.78em; font-weight:400; color:#705039; }


/* Daily trader: content stays inside the usable center of the decorative scroll. */
#sheetContent .voyage-parchment .daily-trader-card {
  position:relative;
  isolation:isolate;
  display:grid;
  justify-items:stretch;
  align-content:center;
  gap:clamp(9px,2.4vw,14px);
  min-width:0;
  min-height:clamp(210px,48vw,248px);
  box-sizing:border-box;
  margin:clamp(10px,2vw,16px) 0;
  padding:clamp(44px,11vw,56px) clamp(38px,10.5vw,56px) clamp(31px,7vw,39px);
  border:0;
  border-radius:0;
  background:url("../img/shop/feature-parchment.webp") center/100% 100% no-repeat;
  box-shadow:none;
  filter:drop-shadow(0 3px 4px #6a3b1b38);
  color:#53351b;
}
#sheetContent .voyage-parchment .daily-trader-title {
  margin:0;
  color:#603716;
  font:700 clamp(14px,3.55vw,19px)/1.2 var(--serif-title);
  text-align:center;
  text-wrap:balance;
  text-shadow:0 1px #fff1cd;
}
#sheetContent .voyage-parchment .daily-trader-offer {
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:clamp(5px,1.5vw,10px);
  min-width:0;
  color:#58391c;
  text-align:center;
  font:600 clamp(14px,3.2vw,17px)/1.3 var(--read-font);
}
#sheetContent .voyage-parchment .daily-trader-offer .resource-icon {
  flex:none;
  width:clamp(24px,6vw,32px);
  height:clamp(24px,6vw,32px);
}
#sheetContent .voyage-parchment .daily-trader-offer strong {
  color:#542b0f;
  font-weight:800;
}
#sheetContent .voyage-parchment .daily-trader-note {
  margin:0;
  color:#79542b;
  text-align:center;
  font:500 clamp(12px,2.8vw,15px)/1.35 var(--read-font);
}
#sheetContent .voyage-parchment .daily-trader-action {
  justify-self:center;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:max-content;
  max-width:100%;
  min-width:0;
  min-height:clamp(37px,8.5vw,44px);
  margin:3px 0 0;
  padding:8px clamp(15px,4vw,25px);
  border:3px solid transparent;
  border-radius:10px;
  background:
    linear-gradient(180deg,#647b35,#344b21 58%,#243416) padding-box,
    linear-gradient(145deg,#fff1ad,#b27126 30%,#f8cb6d 55%,#7d471a 85%,#ffe8a0) border-box;
  box-shadow:inset 0 1px 0 #f7e7b77d,inset 0 0 0 1px #192a144d,0 2px 0 #845321,0 4px 5px #5b2f1755;
  color:#fff1cd;
  font:700 clamp(14px,3vw,17px)/1.1 var(--serif-title);
  text-shadow:0 1px 1px #1c230d;
  white-space:normal;
  text-align:center;
}
#sheetContent .voyage-parchment .daily-trader-action:not(:disabled):hover {
  filter:brightness(1.09);
}
#sheetContent .voyage-parchment .daily-trader-action:disabled {
  opacity:.65;
  cursor:not-allowed;
}
@media (max-width:360px) {
  #sheetContent .voyage-parchment .daily-trader-card {
    padding-inline:clamp(31px,10vw,40px);
    padding-block:46px 32px;
    min-height:230px;
  }
}

/* Starter program below the complete island registry: opaque parchment for readable text. */
#sheetContent .directory-content .starter-program {
 box-sizing:border-box;width:auto;max-width:760px;margin:12px auto 16px;
 margin-inline:max(12px,calc((100% - 760px)/2));
 padding:12px clamp(12px,3vw,22px);border:2px solid #b88a4d;border-radius:12px;
 background:linear-gradient(155deg,#f9edcf,#ead5ab);
 color:#432b19;box-shadow:inset 0 0 0 1px #fff3d4,0 5px 13px #12202980;
 font:500 clamp(13px,3.4vw,16px)/1.45 var(--read-font);overflow-wrap:anywhere;
}
#sheetContent .directory-content .starter-program h3.maritime-heading {
 margin:0 0 20px;padding:7px 10px;color:#563519;
 font-size:clamp(17px,4.2vw,24px);line-height:1.15;
}
#sheetContent .starter-program :is(p,b,span) {color:inherit;text-shadow:none;}
#sheetContent .starter-program p {margin:8px 0;line-height:1.45;}
#sheetContent .starter-program p.starter-intro {font-size:90%;margin-bottom:16px;}
#sheetContent .starter-program .starter-stage {color:#54361d;font-weight:600;}
#sheetContent .starter-program :is(.starter-stage,.starter-reward,.starter-materials) {margin:3px 0 8px;padding:8px 10px;background:#fff3d8;border:1px solid #d5b67c;border-radius:7px;}
#sheetContent .starter-program :is(.starter-stage,.starter-reward).starter-available {
 background:#fff0c8;border-color:#c49a46;color:#634019;
 box-shadow:inset 0 0 0 1px #fff8df,0 1px 3px #a77a3333;
}
#sheetContent .starter-program :is(.starter-stage,.starter-reward).starter-unavailable {
 background:transparent;border-color:#b8b2a8;color:#5f5a55;box-shadow:none;
}
#sheetContent .starter-program .starter-reward {display:grid;gap:5px;}
#sheetContent .starter-program .starter-reward span {font-weight:500;}
#sheetContent .starter-program :is(.starter-stage,.starter-reward) {display:grid;gap:5px;}
#sheetContent .starter-program .starter-task-heading {display:flex;align-items:center;flex-wrap:wrap;gap:4px;font-weight:700;font-size:clamp(13px,3.4vw,16px);line-height:1.3;}
#sheetContent .starter-program .starter-task-heading .resource-icon {width:23px;height:19px;object-fit:contain;vertical-align:middle;}
#sheetContent .starter-program .starter-task-description {margin:0;font:400 clamp(14px,3.8vw,18px)/1.4 var(--read-font);}
#sheetContent .starter-program .starter-unavailable .starter-task-description {font-size:clamp(11.2px,3.04vw,14.4px);}
#sheetContent .starter-program .starter-unavailable .resource-icon {filter:grayscale(1);opacity:1;}
#sheetContent .starter-program :is(.starter-stage,.starter-reward).starter-unavailable:not(:has(.starter-claim)) {opacity:.5;}
#sheetContent .starter-program .starter-unavailable:has(.starter-claim) {border-color:#b8b2a880;}
#sheetContent .starter-program .starter-unavailable:has(.starter-claim) :is(.starter-task-heading,.starter-task-description) {opacity:.5;}

#sheetContent .starter-program .starter-progress-info {margin:14px 0 8px;padding:12px;background:#e6dbc4;border:1px solid #aa9270;border-radius:8px;color:#523d29;font-weight:400;}
#sheetContent .starter-program .starter-progress-info h3 {margin:0 0 10px;font:700 1.05em/1.3 var(--read-font);}
#sheetContent .starter-program .starter-progress-info h4 {margin:8px 0 5px;font:700 1em/1.3 var(--read-font);}
#sheetContent .starter-program .starter-progress-info dl {margin:0;}
#sheetContent .starter-program .starter-progress-info dl>div {display:flex;justify-content:space-between;align-items:center;gap:8px;padding:4px 0;border-bottom:1px solid #ac977a55;}
#sheetContent .starter-program .starter-progress-info dt {display:flex;align-items:center;gap:5px;}
#sheetContent .starter-program .starter-progress-info dd {margin:0;white-space:nowrap;font-variant-numeric:tabular-nums;}
#sheetContent .starter-program .starter-voyage-info {margin-top:12px;padding-top:8px;border-top:1px solid #aa9270;}
#sheetContent .starter-program .starter-voyage-info.starter-voyage-done {color:#5f5a55;}
#sheetContent .starter-program .starter-voyage-done .resource-icon {filter:grayscale(1);opacity:1;}
#sheetContent .starter-program .starter-voyage-done:not(:has(.starter-claim)) {opacity:.5;}
#sheetContent .starter-program .starter-voyage-done:has(.starter-claim) :is(h4,p) {opacity:.5;}
#sheetContent .starter-program button.starter-claim {width:100%;max-width:100%;margin-top:5px;white-space:normal;font-size:clamp(15px,4.2vw,20px);min-height:36px;}
#sheetContent .starter-program button.starter-claim:disabled {opacity:.55;cursor:default;}

/* Match the material summary to the adjacent starter stages; center only the harbor action. */
#sheetContent .directory-content .starter-program :is(.starter-stage,.starter-materials) {
 font-size:clamp(13px,3.4vw,16px);
 line-height:1.45;
}
#sheetContent .directory-content .starter-program .starter-materials :is(b,span) {font-size:inherit;line-height:inherit;}
#sheetContent .starter-program .starter-harbor-action {display:flex;justify-content:center;margin-top:8px;}

/* Construction is unavailable until all required materials and doubloons are available. */
#sheetContent .building-cost-panel .building-upgrade:disabled {
  filter:grayscale(1);
  opacity:.65;
  cursor:not-allowed;
  transform:none;
}
