/* Paper labels, pale limestone and the cool water of the survey chart. */
:root { --ink:#34473f; --leaf:#486751; --paper:#faf5e6; --line:#b6baa0; }
body,body.in-island,body.in-sky {background:radial-gradient(ellipse at 18% 17%,#f8efd8 0%,transparent 45%),radial-gradient(ellipse at 82% 74%,#abc6bb 0%,transparent 53%),linear-gradient(142deg,#d5e3d6,#e4e8d4 52%,#c7dad3);}
body.in-sky::before, #login::before {content:"";inset:0;position:absolute;pointer-events:none;opacity:.36;background-image:repeating-radial-gradient(ellipse at 4% 118%,transparent 0 44px,#96b6a15a 45px,transparent 46px 57px);}
.panel {border:1px solid #adb49a98; background:rgba(251,248,235,.94); color:var(--ink); box-shadow:0 5px 20px #374d3f14; border-radius:10px;}
button, #btnGo {background:#476950;color:#fffaf0;}
button:focus-visible,select:focus-visible,input:focus-visible {outline:3px solid #b47438;outline-offset:2px;}
button:disabled {opacity:.54;cursor:default;}
#topbar {border-radius:24px;}
#btnIsles,#btnBag,#btnShop {white-space:nowrap;}
#side {width:175px;}
#sideToggle {color:var(--ink);}
#vault {width:190px;}
#vault .vbar i {background:linear-gradient(90deg,#718c68,#c8a16a);}
#bar .tip,#sceneLabel {color:#526653;}
#login {display:grid;place-items:center; z-index:20;background:radial-gradient(ellipse at 28% 38%,#ffefd6 0%,transparent 58%),linear-gradient(125deg,#e8ecda,#d0dfd2 72%,#b6d1c5);}
#login .welcome {position:relative;width:min(1010px,94vw);display:grid;grid-template-columns:1.45fr 1fr;align-items:center;gap:24px;}
#login #cover {width:100%;height:auto;}
#login .box {width:auto;text-align:left;background:transparent;border:0;box-shadow:none;backdrop-filter:none;padding:20px;}
#login h2,#atlasTitle h1,#isleSheet h2 {font-family:"Songti SC","SimSun",serif;font-weight:700;letter-spacing:.06em;}
#login h2 {font-size:clamp(34px,4.2vw,63px);line-height:1.14;margin:8px 0 12px;color:#364d40;}
#login .chapterLine,#atlasTitle small,#sheetKind {font-size:11px;letter-spacing:.19em;font-weight:700;color:#687958;}
#login p {font-size:14px;line-height:1.8;margin:10px 0 24px;color:#536454;}
#login label {display:block;font-size:12px;font-weight:600;color:var(--ink);margin:9px 0 4px;}
#login input {background:#fcfaecb8;border:1px solid #9caa92;color:#34473f;border-radius:7px;margin:0;width:100%;}
#login #btnGo {padding:11px 16px;border-radius:7px;font-size:15px;margin:15px 0 0;}
#atlasTitle {position:fixed;top:106px;left:clamp(20px,5vw,80px);pointer-events:none;display:none;color:#3b5143;}
body.in-sky #atlasTitle {display:block;}
#atlasTitle h1 {font-size:clamp(23px,3vw,41px);letter-spacing:.1em;line-height:1.13;margin:4px 0;}
#atlasTitle p {font-size:12px;margin:6px 0;color:#405649;}
body.in-sky #vault {display:none!important;}
#islePicker {position:fixed;z-index:5;bottom:16px;left:50%;transform:translateX(-50%);display:flex;max-width:90vw;align-items:center;gap:7px;background:#fbf8e9e8;border:1px solid var(--line);border-radius:22px;padding:6px 13px;color:var(--ink);font-size:12px;white-space:nowrap;}
#islePicker[hidden],body:has(#bar[style*="block"]) #islePicker {display:none;}
#islePicker select {font:inherit;color:inherit;max-width:54vw;background:#f4f1e1;border:1px solid #c0c5ac;border-radius:10px;padding:3px;}
#islePicker button {margin:0;}
#isleSheet {color:#394b3f;background:#faf6e8;border:1px solid #aab59c;width:min(400px,91vw);max-height:87svh;overflow-y:auto;border-radius:16px;padding:25px;box-shadow:0 20px 90px #223e3a40;}
#isleSheet::backdrop {background:#253d3663;backdrop-filter:blur(3px);}
#sheetClose {position:absolute;top:8px;right:10px;border-radius:50%;width:32px;height:32px;background:transparent;color:#4e6354;font-size:19px;padding:0;}
#isleSheet h2 {font-size:30px;margin:6px 0 4px;}
#sheetLandmark {font-size:13px;color:#566d59;margin:0 0 15px;}
#sheetProgress {line-height:1.65;font-size:14px;}
#sheetProgress {color:#6b633d;}
#sheetControls {display:flex;gap:7px;align-items:center;flex-wrap:wrap;}
#sheetControls button {margin:0;padding:9px 14px;}
#sheetControls label {font-size:13px;}
#sheetAmount {width:80px;padding:8px;border:1px solid var(--line);border-radius:6px;background:#fffdf6;}
#sheetFeedback {font-size:13px;line-height:1.5;margin:8px 0 0;color:#7c4b31;}
#sceneNav button,#btnBack {color:#324e3b;background:#d9dfcb;}
@media(max-width:779px){
 #login .welcome {max-width:420px;grid-template-columns:1fr;gap:0;}
 #login #cover {height:min(33svh,260px);width:100%;}
 #login .box {padding:0 24px 14px;}
 #login p {margin:5px 0 13px;}
 #login h2 {font-size:36px;margin:4px 0;}
 #topbar {left:6px;top:8px;gap:4px;}
 #meName {max-width:58px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
 #sideToggle {right:5px;top:7px;}
 #sceneTop {top:52px;}
 #atlasTitle {left:16px;top:100px;} #atlasTitle h1 {font-size:25px;}
 #atlasTitle p {font-size:11px;} #vault {width:143px;}
 #islePicker {bottom:max(10px,env(safe-area-inset-bottom));}
}
@media(max-height:570px) and (orientation:landscape){#login .welcome{grid-template-columns:1fr 1fr;max-width:760px;} #login #cover{height:70vh;} #atlasTitle{display:none!important;}}
@media(prefers-reduced-motion:reduce){*,*::before {transition:none!important;}}

/* A misty horizon keeps the soft silhouettes readable against the cloud layer. */
body,body.in-island {
  background:radial-gradient(ellipse at 17% 9%,#f7ead4 0%,transparent 46%),radial-gradient(ellipse at 86% 30%,#c1d7d2 0%,transparent 48%),linear-gradient(165deg,#e5ead9 22%,#d5e4dc 62%,#bfd4c8);
}
body.in-cellar {background:radial-gradient(ellipse at 48% 47%,#514d4a,#262d34 65%,#1a232c);}
body.starry:not(.in-cellar) {background:radial-gradient(ellipse at 55% 66%,#556b6a 0%,#2e4354 61%,#182c40);}
#login .welcome {width:min(1140px,96vw);grid-template-columns:1.65fr 1fr;gap:10px;}
#login #cover {object-fit:contain;}
@media(max-width:779px) and (orientation:portrait){#login .welcome{width:min(430px,97vw);grid-template-columns:1fr;}#login #cover{height:min(36svh,285px);}}

/* The same paper stock as the chart, with room for a route price and an order. */
.shoreSheet,#isleSheet {
  width:min(435px,94vw);max-height:88svh;overflow:auto;overscroll-behavior:contain;
  margin:auto;padding:24px;color:#394b3f;background:#faf6e8;border:1px solid #aab59c;
  border-radius:15px;box-shadow:0 20px 90px #223e3a40;
}
.shoreSheet::backdrop {background:#253d3663;backdrop-filter:blur(3px);}
.shoreClose,#sheetClose {
  position:absolute;top:6px;right:6px;height:40px;width:40px;margin:0;padding:0;
  background:transparent;color:#475c4b;border-radius:50%;font-size:21px;
}
.shoreSheet h2 {font:700 25px/1.3 "Songti SC","SimSun",serif;margin:4px 23px 8px 0;}
#routePurse,#vaultPlan {font-size:14px;line-height:1.65;margin:8px 0 15px;}
#routeList {display:grid;gap:7px;}
#routeList button {
  display:grid;grid-template-columns:auto 1fr;align-items:center;gap:2px 12px;text-align:left;
  margin:0;padding:10px 12px;border:1px solid #b5bba7;border-radius:8px;
  color:#3d5547;background:#ecf0e2;
}
#routeList .unopenedRoad {border-style:dashed;border-color:#b6a581;background:#f3ecda;color:#63523a;}
#routeList button span {grid-row:span 2;font-size:13px;padding-right:9px;border-right:1px solid #bcb9a3;}
#routeList strong {font-size:15px;}
#routeList small {font-size:12px;line-height:1.5;}
#routesOpen,#sheetRoutes {color:#36543e;background:#e0e5d3;white-space:nowrap;}
#sheetName {padding-right:22px;}
#sheetKind {display:block;max-width:calc(100% - 28px);line-height:1.6;}
#sheetProgress {padding:10px 12px;background:#efe9d5;border-left:3px solid #b4975c;color:#514c37;margin:10px 0 7px;}
#sheetFund,#vaultFund {margin:13px 0 6px;}
.shorePayment {display:flex;align-items:center;gap:8px;margin:5px 0;}
#sheetFund label,#vaultFund label {display:block;font-size:12px;font-weight:600;color:#536650;}
.shorePayment input,#sheetAmount {
  min-width:0;width:9em;max-width:48%;height:40px;padding:7px 10px;color:var(--ink);
  font:inherit;border:1px solid #a4af99;border-radius:7px;background:#fffdf6;
}
.shorePayment button,#sheetControls button {margin:0;min-height:40px;padding:7px 13px;}
.shoreBalance,#vaultFeedback {font-size:12px;color:#5c654d;line-height:1.55;margin:6px 0 10px;}
#sheetFeedback:empty,#vaultFeedback:empty {display:none;}
#sheetEntries h4,#vaultEntries h4 {margin:0 0 5px;font-size:13px;color:#50644e;}
#sheetLedger {margin-top:12px;padding-top:9px;border-top:1px solid #cbd0b9;color:#53634d;font-size:13px;}
#sheetLedger summary {cursor:pointer;padding:6px 0;font-weight:600;overflow-wrap:anywhere;}
#sheetLedger p {margin:5px 0;}
#sheetLedger ul,#sheetLedger ol,#vaultEntries ol {margin:5px 0 8px;padding-left:22px;line-height:1.65;overflow-wrap:anywhere;}
#vaultEntries h4 {margin-top:15px;}
@media(max-width:779px){
  #islePicker {width:min(95vw,415px);max-width:none;gap:5px;padding:5px 8px;border-radius:12px;}
  #isleSelect {min-width:0;flex:1;}
  #islePicker button,#islePicker select {height:36px;}
  .shoreSheet,#isleSheet {padding:18px 17px;max-height:89svh;}
  .shorePayment input,#sheetAmount {font-size:16px;}
  .shorePayment button,#sheetControls button,.shoreClose,#sheetClose {min-height:44px;}
}

#siteMarkers {position:fixed;inset:0;z-index:3;pointer-events:none;overflow:hidden;}
#siteMarkers button {
  position:absolute;left:0;top:0;margin:0;padding:3px 9px;pointer-events:auto;
  color:#34463a;background:#faf3dfef;border:1px solid #8a957b;border-radius:9px;
  box-shadow:0 2px 5px #293c3129;white-space:nowrap;font-size:12px;line-height:1.35;
}
#siteMarkers button::after {
  content:"";position:absolute;height:4px;width:1px;background:#718168;
  left:50%;bottom:-5px;
}
#siteSheet {width:min(420px,94vw);background:#faf5e5;}
#sitePlace {font-size:12px;color:#62745e;letter-spacing:.12em;}
#siteSheet h2 {margin-top:6px;}
#sitePortrait {width:100%;height:auto;margin:2px 0 0;border-radius:7px;background:#d4dec4;}
#siteDetail,#siteEcho {font:16px/1.75 "Songti SC","SimSun",serif;color:#35483b;margin:12px 0;}
#siteActions,#siteObjects {display:flex;flex-wrap:wrap;gap:7px;}
#siteSheet button:not(.shoreClose) {margin:0;min-height:40px;padding:6px 13px;}
#siteObjects button,#siteLookBack,#siteListen {color:#405942;background:#e3e7d4;}
#siteSheet #siteLookBack,#siteSheet #siteListen {margin-top:12px;}
#siteFeedback {font-size:14px;line-height:1.65;color:#5d533b;margin:10px 0 3px;}
#siteFeedback:empty {display:none;}
#siteEcho {white-space:pre-line;border-left:2px solid #c4ae7c;padding-left:12px;}
body.in-island #vault {display:none!important;}
@media(max-width:779px){
  #siteSheet button:not(.shoreClose) {min-height:44px;}
  #siteMarkers button {font-size:11px;padding:4px 7px;}
}
