/* Display branding is independent of the server-gated expedition interface. */
body:has(.sp-expedition-dialog[open]){overflow:hidden}
.sp-expedition-dialog{color-scheme:dark;scrollbar-width:thin;scrollbar-color:#788577 #13212a}
.spellPiratesWordmark{display:inline-block;font:700 clamp(38px,5.8vw,78px)/1 Georgia,serif!important;letter-spacing:.065em!important;color:#ebd4a0!important;text-transform:uppercase;text-shadow:0 3px 12px #09151e;margin:0!important;width:auto!important;max-width:100%}
.spellmendHubHeader .spellPiratesWordmark{font-size:29px!important;letter-spacing:.025em!important}
.sp-expedition-hud,.sp-expedition-dialog{--sp-line:#b49a6269;--sp-gold:#efcf8b;--sp-text:#f0e8d7;--sp-muted:#b2c1c4;box-sizing:border-box;color:var(--sp-text);font:13px/1.5 system-ui,sans-serif}
.sp-expedition-hud[hidden]{display:none!important}
.sp-seal-drop-review{margin-top:12px;padding:12px;border:1px solid #dcab7777;border-radius:6px;background:#482e26}.sp-seal-drop-review>strong{font-size:14px;color:#ffe0ba}.sp-seal-drop-review p{font-size:13px;line-height:1.55}.sp-seal-drop-review .sp-actions{flex-wrap:wrap}.sp-expedition-dialog .sp-danger{background:#6b352c;color:#ffebd1;border-color:#cb8e70}.sp-expedition-dialog .sp-danger:hover:not(:disabled){background:#884638}.sp-seal-drop-review button{min-height:44px}
.sp-expedition-hud .sp-sealed-summary{display:block;width:100%;margin-top:5px;padding:5px 7px;min-height:30px;font-size:11px;color:#f2d69c;background:#3a3224}.sp-expedition-hud .sp-sealed-summary[hidden]{display:none!important}.sp-sealed-pouch{border-color:#c5a367!important}.sp-sealed-card{padding:12px;margin-top:12px;border:1px solid #9c855b55;border-radius:6px;background:#2c2b22}.sp-sealed-card h3{color:#efdaad;font:19px Georgia,serif;margin:0}.sp-sealed-card>p{font-size:12px;color:#d6cdb7}
.sp-expedition-hud .sp-status-toggle[hidden]{display:none!important}.sp-expedition-hud .sp-status-toggle{display:flex;align-items:center;gap:6px;width:100%;margin-top:6px;padding:4px 6px;text-align:left;min-height:32px;font-size:11px;line-height:1.35;background:#162a2a}.sp-status-toggle>.sp-item-icon{width:23px;height:23px}.sp-status-toggle>.sp-item-icon img{width:23px;height:23px}.sp-status-toggle>span:not(.sp-item-icon){min-width:0}.sp-status-inspect{margin-left:auto;font:700 20px/1 Georgia;color:#e8c887}.sp-status-icons{display:grid;gap:9px;margin:12px 0}.sp-status-identity{display:flex;align-items:center;gap:10px;font-size:12px;color:#eee3c9}
.sp-expedition-hud{position:absolute;top:10px;left:50%;transform:translateX(-50%);z-index:16;width:min(530px,calc(100% - 500px));min-width:300px;padding:7px 10px;border:1px solid var(--sp-line);border-radius:7px;background:linear-gradient(135deg,#21322ff5,#101c29f5);box-shadow:0 5px 20px #0005;pointer-events:auto}
.sp-expedition-hud[data-safety=danger]{border-color:#c094617a;background:linear-gradient(135deg,#302728f5,#17232ff5)}
.sp-hud-heading,.sp-hud-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}
.sp-hud-heading>strong{font-size:11px;letter-spacing:.06em;color:#bed5c2}.sp-expedition-hud[data-safety=danger] .sp-hud-heading>strong{color:#f0c78d}.sp-hud-heading>span{font-size:11px;color:#c9d5d3}
.sp-expedition-hud button,.sp-expedition-dialog button{font:650 12px/1.35 system-ui;border:1px solid #a78d626e;border-radius:5px;color:#f0dfba;background:#26383d;padding:8px 11px;cursor:pointer;touch-action:manipulation}
.sp-expedition-hud button:hover:not(:disabled),.sp-expedition-dialog button:hover:not(:disabled){background:#3e504d;border-color:#e7c27e}.sp-expedition-hud button:focus-visible,.sp-expedition-dialog :is(button,input):focus-visible{outline:2px solid #ffe1a1;outline-offset:3px}
.sp-expedition-hud button:disabled,.sp-expedition-dialog button:disabled{cursor:default;opacity:.62}.sp-hud-heading button{padding:3px 7px;font-size:10px}
.sp-balances{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:7px 0;margin:5px 0;border-block:1px solid #8a9e9635}.sp-balances>div{display:flex;align-items:baseline;justify-content:center;gap:7px}.sp-balances span{font-size:11px;color:#c0c9c9}.sp-balances strong{font:700 16px/1.2 Georgia,serif;color:var(--sp-gold);overflow-wrap:anywhere}
.sp-hud-actions button{font-size:11px;white-space:nowrap;padding:5px 8px}.sp-hud-actions>span{color:#b9c9c8;text-align:center;font-size:11px;line-height:1.3;min-width:0}
.sp-expedition-dialog{width:min(660px,calc(100vw - 28px));max-width:none;max-height:calc(100dvh - 28px);padding:0;border:1px solid #bda06a;border-radius:9px;background:#13212a;box-shadow:0 25px 90px #0009;overflow:auto;overscroll-behavior:contain}
.sp-expedition-dialog::backdrop{background:#07121bc4;backdrop-filter:blur(3px)}
.sp-expedition-dialog>header{position:sticky;top:0;z-index:2;display:flex;justify-content:space-between;align-items:center;gap:18px;background:#18272e;padding:17px 22px;border-bottom:1px solid var(--sp-line)}
.sp-expedition-dialog>header button{border-radius:50%;width:36px;height:36px;flex:none;padding:0;font-size:23px}.sp-expedition-dialog h2{font:400 29px/1.2 Georgia,serif;color:#f1dfb7;margin:5px 0 0}.sp-eyebrow{font:750 9px/1.5 system-ui;letter-spacing:.14em;color:#c4af82}
.sp-dialog-body{padding:18px 22px}.sp-dialog-body>p{margin:12px 0}.sp-block{border:1px solid #9a956046;border-radius:6px;padding:15px;margin:0 0 14px;background:#23312f4d}.sp-block h3{font:400 22px/1.25 Georgia,serif;color:#ecdbb8;margin:0 0 10px}.sp-block p{font:13px/1.6 system-ui;color:#becdcd;margin:7px 0 12px}
.sp-metric{display:flex;align-items:baseline;justify-content:space-between;gap:16px;padding:9px 0;border-top:1px solid #82908036}.sp-metric strong{color:#ecd09a;white-space:nowrap}.sp-metric>span{color:#cbd5d3}
.sp-items{list-style:none;padding:0;margin:7px 0 0;display:grid;gap:6px}.sp-items li{display:flex;align-items:center;gap:10px;min-height:36px;padding:5px 8px;border-radius:4px;background:#0b182473}.sp-items li>span:not(.sp-item-icon){flex:1;min-width:0;overflow-wrap:anywhere}.sp-items li>strong{font-size:12px;color:#ead4a4}.sp-item-icon{display:grid;place-items:center;width:28px;height:28px;flex:none}.sp-item-icon :is(svg,img){width:27px;height:27px;object-fit:contain}.sp-muted{color:#a5b8bd;font-size:12px}
.sp-warning{padding:13px 15px;border-left:3px solid #d1a064;background:#94713b21;color:#ecd4a8;line-height:1.65;font-size:13px}.sp-actions{display:flex;flex-wrap:wrap;gap:9px;margin:16px 0}.sp-expedition-dialog .sp-primary{background:#d8bd85;color:#182a2d;border-color:#ead39c;font-weight:750}
.sp-lock{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:9px 0;border-top:1px solid #82908036}.sp-lock span{font-variant-numeric:tabular-nums;color:#e8c891}.sp-lock strong{font-size:13px;font-weight:650}.sp-lock+button{margin-top:12px}
.sp-acknowledgment{display:flex;align-items:start;gap:11px;margin:16px 0;padding:13px;border:1px solid #ab996462;border-radius:5px;cursor:pointer}.sp-acknowledgment input{width:21px;height:21px;flex:none;margin:1px 0;accent-color:#d9bd85}.sp-acknowledgment span{font:13px/1.55 system-ui;color:#dfd8c5}.sp-rules{padding-left:22px;margin:0;color:#c8d4d1}.sp-rules li{padding:6px 0 8px;line-height:1.6}
.sp-notice{padding:12px 22px;background:#35463c;border-top:1px solid #769d8057;color:#d8e4cf;font:12px/1.5 system-ui;overflow-wrap:anywhere}.sp-notice[hidden]{display:none}.sp-notice button{display:block;margin-top:9px}.sp-receipt-id{font:11px/1.5 ui-monospace,monospace;overflow-wrap:anywhere;color:#9eafb2}.sp-expedition-dialog>footer{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 22px;border-top:1px solid var(--sp-line);background:#101d25}.sp-expedition-dialog>footer span{font-size:11px;color:#a6b9bc}
.sp-packing-list{display:grid;gap:8px}.sp-packing-row{display:grid;grid-template-columns:28px minmax(0,1fr) 74px;align-items:center;gap:10px;padding:10px 8px;background:#0b182473;border:1px solid #8fa49726;border-radius:5px}.sp-packing-description{min-width:0;overflow-wrap:anywhere}.sp-packing-description strong{display:block;font:650 13px/1.4 system-ui;color:#efe3c8}.sp-packing-description small{display:block;margin-top:4px;font:11px/1.45 system-ui;color:#b4c9c9}.sp-packing-row input{box-sizing:border-box;width:74px;min-width:0;min-height:40px;padding:7px 8px;border:1px solid #ba9a676e;border-radius:5px;background:#101e25;color:#f1d9a8;font:650 15px/1.4 system-ui;text-align:center;color-scheme:dark}.sp-packing-row input:disabled{opacity:.5}.sp-patrol-progress{display:flex;flex-wrap:wrap;gap:9px 20px;margin:12px 0;color:#d0dfda;font-size:12px}.sp-block .sp-next-contact{color:#f1d4a1;font-size:15px;font-weight:650}.sp-block>button+button{margin-left:8px}
.sp-pouch-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.sp-pouch-card{min-width:0;border:1px solid #b49a624a;border-radius:7px;padding:14px;background:#1f302f}.sp-pouch-item-heading{display:flex;align-items:center;gap:10px;margin-bottom:10px}.sp-pouch-item-heading>div{min-width:0}.sp-pouch-item-heading h3{font:400 20px/1.25 Georgia,serif;color:#edd9ad;margin:0 0 5px;overflow-wrap:anywhere}.sp-pouch-card>p{font:12px/1.55 system-ui;margin:10px 0}.sp-pouch-effect{color:#d7e1d6}.sp-block .sp-pouch-health{font-size:17px;color:#bfe3c5;font-variant-numeric:tabular-nums}.sp-pouch-drop{display:flex;align-items:end;gap:10px;padding-top:12px;margin-top:14px;border-top:1px solid #8d9c8733}.sp-pouch-drop>label{display:grid;gap:5px;min-width:0;flex:1;font:11px/1.4 system-ui;color:#bdcfcd}.sp-pouch-drop input{box-sizing:border-box;width:100%;min-width:0;max-width:100px;min-height:40px;padding:7px 8px;border:1px solid #ba9a676e;border-radius:5px;background:#101e25;color:#f1d9a8;font:650 15px/1.4 system-ui;text-align:center;color-scheme:dark}.sp-pouch-drop button{min-height:40px;white-space:nowrap}.sp-pouch-drop input:disabled{opacity:.5}
@media(max-width:520px){.sp-pouch-items{grid-template-columns:minmax(0,1fr)}.sp-pouch-card{padding:13px}.sp-pouch-drop input,.sp-pouch-drop button{min-height:44px}.sp-pouch-card>button{width:100%}}
@media(max-width:1000px){.sp-expedition-hud{left:220px;right:76px;width:auto;min-width:0;transform:none}.sp-balances>div{display:block;text-align:center}.sp-balances span{display:block}.sp-balances strong{font-size:15px}}
@media(max-width:700px){.sp-expedition-hud{left:max(8px,env(safe-area-inset-left,0px));right:70px;top:max(7px,env(safe-area-inset-top,0px));padding:5px 8px}.sp-hud-heading{gap:6px}.sp-hud-heading>strong,.sp-hud-heading>span{font-size:10px}.sp-hud-actions{gap:5px}.sp-hud-actions>span{font-size:10px}.sp-balances{padding:4px 0;margin:4px 0}.sp-balances>div{display:flex;gap:5px}.sp-balances span{font-size:10px}.sp-balances strong{font-size:14px}.sp-expedition-hud button{min-height:36px}.sp-hud-heading button{min-height:28px}
  #gameFrame.sp-expedition-active #hudJourneyStack{top:calc(var(--sp-expedition-height,120px) + max(14px,env(safe-area-inset-top,0px)))}
  #gameFrame.sp-expedition-active>.runToggleButton{left:auto;right:max(8px,env(safe-area-inset-right,0px));top:max(7px,env(safe-area-inset-top,0px));bottom:auto;width:54px;min-height:54px;box-sizing:border-box;display:grid;justify-items:center;gap:3px;padding:5px 3px;font-size:10px}
  .sp-expedition-dialog{width:calc(100vw - 16px);max-height:calc(var(--mobile-visual-height,100dvh) - 16px)}.sp-expedition-dialog>header{padding:12px 15px}.sp-expedition-dialog h2{font-size:24px}.sp-dialog-body{padding:14px}.sp-block{padding:12px}.sp-expedition-dialog button{min-height:44px}.sp-expedition-dialog>header button{width:44px;height:44px}.sp-actions>*{flex:1}.sp-expedition-dialog>footer{padding:11px 15px}.sp-metric{gap:10px}.sp-metric strong{white-space:normal;text-align:right}}
@media(max-width:420px){.spellPiratesWordmark{font-size:37px!important}.spellmendHubHeader .spellPiratesWordmark{font-size:23px!important}.sp-hud-actions>span{max-width:82px}.sp-hud-actions button{padding-inline:5px}.sp-balances>div{display:block}.sp-balances{gap:3px}.sp-expedition-dialog>footer span{display:none}.sp-expedition-dialog>footer button{width:100%}}
@media(max-height:520px){.sp-expedition-dialog>header{position:static;padding:10px 15px}.sp-expedition-dialog h2{font-size:22px}.sp-expedition-dialog>footer{padding:9px 15px}.sp-eyebrow{font-size:8px}.sp-dialog-body{padding:14px}.sp-expedition-hud{padding-block:4px}.sp-balances{padding-block:3px}}
@media(prefers-reduced-motion:reduce){.sp-expedition-hud,.sp-expedition-dialog{scroll-behavior:auto}}
/* Portrait windows reserve separate space for the ledger, map and controls.
   Keep the game canvas's original ratio so pointer-to-world aiming is stable. */
@media(max-width:700px) and (orientation:portrait){
  body:has(#gameFrame.sp-expedition-active)>.page{width:100%;max-width:100%}
  body:has(#gameFrame.sp-expedition-active)>.page::before{width:100%}
  body:not(.touchDevice) #gameFrame.sp-expedition-active{min-height:max(610px,calc(100dvh - 155px));background:#0e1420;border-radius:16px;overflow:hidden}
  body:not(.touchDevice) #gameFrame.sp-expedition-active>#game{position:absolute;top:calc(50% + 20px);left:0;transform:translateY(-50%);width:100%;height:auto;box-sizing:border-box}
  #gameFrame.sp-expedition-active .sp-expedition-hud{right:94px}
  #gameFrame.sp-expedition-active #hudJourneyStack{width:142px}
  #gameFrame.sp-expedition-active #exploreMinimapHud .exploreMinimapCanvas,
  #gameFrame.sp-expedition-active #exploreMinimapHud .exploreMinimapHead,
  #gameFrame.sp-expedition-active #exploreMinimapHud .exploreMinimapArea,
  #gameFrame.sp-expedition-active #exploreMinimapHud .exploreMinimapGuidance,
  #gameFrame.sp-expedition-active #exploreMinimapHud .exploreMinimapHint{display:none!important}
  #gameFrame.sp-expedition-active #exploreMinimapHud .exploreMapOpen{display:block;width:100%;min-height:38px;background:#1b2b37;color:#efd5a0;border:1px solid #b49a6269;border-radius:5px}
  #gameFrame.sp-expedition-active #exploreMinimapHud .exploreMapOpen::before{content:'Map & routes';font:650 12px system-ui}
}
.sp-protection-choice{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:14px;padding:13px 0;border-top:1px solid #a5b4a72e}.sp-protection-choice strong{color:#e9dfc5;font-size:14px}.sp-protection-choice p{margin:5px 0 0;line-height:1.5}.sp-protection-choice button{min-width:94px;min-height:44px}.sp-block .sp-success{color:#aedbc4;line-height:1.6}@media(max-width:420px){.sp-protection-choice{grid-template-columns:1fr;gap:9px}.sp-protection-choice button{width:100%}}
.sp-departure-routes{display:grid;gap:12px;margin:15px 0}.sp-route-card{padding:16px;border:1px solid #b49a6259;border-radius:8px;background:linear-gradient(125deg,#263a39,#12232d);min-width:0}.sp-route-heading{display:flex;gap:12px;align-items:center}.sp-route-heading h3{margin:0;color:#eedbb1;font:22px/1.2 Georgia,serif}.sp-route-floor{display:grid;place-items:center;width:38px;height:38px;flex:none;border:1px solid #d7b9798c;border-radius:50%;background:#101d25;color:#edd29d;font:700 13px system-ui}.sp-route-card .sp-route-stake{color:#e0ceaa;font-size:12px}.sp-route-card button{min-height:44px;margin:4px 12px 5px 0}.sp-route-card .sp-muted{font-size:12px;line-height:1.55}.sp-route-card:has(button:disabled){background:#17262d;border-color:#8a999745}@media(max-width:520px){.sp-route-card{padding:13px}.sp-route-card button{width:100%;margin-right:0}.sp-route-heading h3{font-size:20px}}

/* Dungeon decisions live in the entry dialog; gameplay keeps one compact dock. */
#gameFrame .sp-expedition-hud{left:auto;right:110px;top:10px;transform:none;width:auto;min-width:0;max-width:calc(100% - 100px);display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:5px;padding:0;border:0;background:none;box-shadow:none;font-size:12px;pointer-events:none}
#gameFrame .sp-expedition-hud>button{pointer-events:auto;min-height:36px;padding:6px 9px;margin:0;width:auto;border-radius:7px;background:#152830ed;box-shadow:0 2px 6px #0004;font-size:11px;white-space:nowrap}
#gameFrame .sp-expedition-hud>button[hidden]{display:none!important}
#gameFrame .sp-expedition-hud .sp-status-toggle{gap:4px;min-width:0;font-variant-numeric:tabular-nums}
#gameFrame .sp-expedition-hud .sp-status-toggle>.sp-item-icon{width:22px;height:22px}
.sp-entry-statements{list-style:none;padding:0;margin:0 0 16px;display:grid;gap:10px;font:14px/1.5 system-ui;color:#e0e8e2}
.sp-entry-statements li{padding-left:16px;position:relative}.sp-entry-statements li::before{content:'•';position:absolute;left:0;color:#e2c18b}.sp-entry-statements li:first-child{font-weight:700;color:#f3e4bd}
.sp-entry-deposit{padding:4px 13px 10px;border:1px solid #ab94624a;border-radius:7px;background:#27383070}.sp-entry-deposit .sp-metric:first-child{border-top:0}.sp-entry-deposit p{margin:0;font-size:12px;color:#c4cebf}
.sp-entry-protection{padding:8px 0 0;margin:17px 0;border:0;min-width:0}.sp-entry-protection legend{font-size:12px;font-weight:700;color:#d2b984}.sp-entry-choice{display:flex;align-items:center;gap:10px;padding:10px 12px;margin-top:6px;border:1px solid #7a96774d;border-radius:6px;cursor:pointer;background:#182a30}.sp-entry-choice:has(input:checked){border-color:#dcbd7c;background:#334438}.sp-entry-choice:has(input:disabled){opacity:.65;cursor:default}.sp-entry-choice input{width:19px;height:19px;margin:0;flex:none;accent-color:#ecd195}.sp-entry-choice span{min-width:0}.sp-entry-choice strong{display:block;font-size:13px}.sp-entry-choice small{display:block;margin-top:3px;font-size:11px;line-height:1.45;color:#bccdc8}
.sp-entry-details{margin-top:14px;border-top:1px solid #85977840;padding-top:10px}.sp-entry-details summary{cursor:pointer;color:#dbc698;font-weight:650;padding:4px 0}.sp-entry-details p,.sp-skull-legend{font-size:12px;line-height:1.5;color:#b8cbc7}.sp-skull-legend dt{font-weight:700;margin-top:10px;color:#e0d8bb}.sp-skull-legend dd{margin:3px 0 0}
.sp-protected-selection{min-width:0;margin:16px 0;padding:0;border:0}.sp-protected-selection legend{font:650 13px/1.5 system-ui;color:#ecd7a9}.sp-protected-choice{min-height:54px;box-sizing:border-box;gap:11px}.sp-protected-choice input{width:22px;height:22px}.sp-protected-choice>span:last-child{flex:1;overflow-wrap:anywhere}.sp-protected-badge,.sp-equipped-badge{display:inline-block;margin:4px 0 0 7px;padding:2px 6px;border:1px solid #8ac7aa66;border-radius:4px;color:#c8ebd8;font:650 10px/1.4 system-ui;vertical-align:middle}.sp-equipped-badge{color:#d7d8e3;border-color:#9baccf55}.sp-pouch-item-heading .sp-protected-badge{margin-left:0;display:table}.sp-backpack-risk{border-color:#cfa56777;background:#47382335}.sp-backpack-risk .sp-items{margin-bottom:10px}.sp-backpack-risk>button{min-height:44px}
.sp-expedition-dialog .sp-primary:hover:not(:disabled){background:#eed7a6;color:#152a2c;border-color:#ffe5ad}
.sp-expedition-dialog[data-mode=quote]{width:min(600px,calc(100vw - 24px))}.sp-expedition-dialog[data-mode=quote] .sp-entry-actions{position:sticky;bottom:-18px;z-index:2;background:#13212a;margin:14px -22px -18px;padding:14px 22px;border-top:1px solid #a894604d;justify-content:flex-end}.sp-entry-actions button{min-height:44px;min-width:126px}.sp-entry-actions .sp-primary{font-size:14px}
.sp-expedition-dialog>footer[hidden]{display:none}
@media(max-width:700px){#gameFrame .sp-expedition-hud{right:100px;top:7px;max-width:calc(100% - 150px);gap:4px}#gameFrame .sp-expedition-hud>button{min-height:40px;padding:5px 7px}#gameFrame.sp-expedition-active #hudJourneyStack{top:calc(var(--sp-expedition-height,40px) + max(14px,env(safe-area-inset-top,0px)))}.sp-expedition-dialog[data-mode=quote] .sp-entry-actions{margin-inline:-14px;margin-bottom:-14px;bottom:-14px;padding:10px 14px}.sp-entry-statements{font-size:13px;gap:8px}.sp-entry-actions button{min-width:0;flex:1}}
@media(max-height:520px){.sp-expedition-dialog[data-mode=quote] .sp-dialog-body{padding:12px 16px}.sp-expedition-dialog[data-mode=quote] .sp-entry-actions{bottom:-12px;margin:12px -16px -12px;padding:9px 16px}.sp-entry-statements{gap:6px}}
