/* Scrollable illustrated tower; every destination is a real accessible button. */
body:is([data-screen=castle],[data-screen=summon]){padding-bottom:calc(70px + env(safe-area-inset-bottom));background:#173845;overflow:hidden}
body:is([data-screen=castle],[data-screen=summon]) .app-header{display:none}
body:is([data-screen=castle],[data-screen=summon]) .campaign-wallet{position:relative;z-index:42;background:linear-gradient(#344d60,#192e3d);border-color:#96b9c966;color:#cfdae1;text-shadow:0 1px 2px #000}
body:is([data-screen=castle],[data-screen=summon]) .campaign-wallet b{color:#fff1c5}
.castle-screen{display:grid;grid-template-columns:minmax(0,1fr) 290px;max-width:1100px;margin:auto;height:calc(100dvh - var(--resource-bar-height,64px) - 70px - env(safe-area-inset-bottom));min-height:0;background:#173845;box-shadow:0 0 60px #0006;border-inline:1px solid #a6c5c62b}
.castle-world{position:relative;width:min(100%,580px);height:100%;min-height:0;justify-self:center;overflow:hidden;isolation:isolate;background:linear-gradient(#315967 0,#193b49 68px,#77c9d6 68px)}
.castle-scroll{width:100%;height:calc(100% - 68px);margin-top:68px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;scrollbar-color:#dcc389 #285466;outline:0}
.castle-scroll:focus-visible{box-shadow:inset 0 0 0 3px #ffe49c}
.castle-map{position:relative;width:100%;aspect-ratio:1/6;isolation:isolate}
.castle-art{position:absolute;top:0;left:0;width:100%;height:50%;object-fit:fill;pointer-events:none}
#castle-art-lower{top:50%}
.castle-map::after{content:'';position:absolute;top:49.2%;left:0;right:0;height:1.6%;z-index:1;pointer-events:none;background:linear-gradient(transparent,#83d2d8aa,transparent)}
.castle-atmosphere{position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,#10243f30,transparent 18%,transparent 85%,#0c202630)}
.castle-heading{position:absolute;z-index:4;top:8px;left:10px;color:#fff4cc;text-shadow:0 2px 8px #071f34;pointer-events:none}
.castle-heading>span{font-size:8px;letter-spacing:2px;font-weight:700;color:#e5f7fa}
.castle-heading h1{font:700 24px Georgia,serif;margin:4px 0 3px;line-height:1.05}
.castle-heading p{font-size:10px;margin:0;color:#ebf5f7}
.castle-free-call{position:absolute;z-index:4;right:10px;top:10px;max-width:150px;display:flex;align-items:center;gap:7px;min-height:40px;padding:7px 10px;border-radius:7px;border:1px solid #f9e4a88c;background:linear-gradient(#624a35ee,#322735ee);color:#fff2bc;font-size:10px;line-height:1.3;box-shadow:0 3px 10px #06233066;cursor:pointer}
.castle-free-call>span:first-child{font-size:23px;color:#ffdb7d}
.castle-buildings{position:absolute;inset:0;z-index:2;pointer-events:none}
.castle-building{position:absolute;transform:translate(-50%,-50%);width:62%;height:5%;min-height:64px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;padding:0 4px 4px;border:0;border-radius:16px;background:none;color:#fff7da;text-shadow:0 2px 2px #0009;pointer-events:auto;cursor:pointer;transition:filter .18s}
.castle-building::before{content:'';position:absolute;inset:5px;z-index:-1;border:2px solid transparent;border-radius:24px;transition:border-color .18s,box-shadow .18s}
.castle-building:hover{filter:brightness(1.13)}
.castle-building:focus-visible{outline:0}.castle-building:focus-visible::before{border-color:#ffe49c;box-shadow:0 0 20px #ffe49c66}
.castle-building.guide-target{position:absolute}
.castle-building strong{max-width:100%;min-width:130px;padding:4px 12px 2px;border-radius:5px 5px 0 0;background:linear-gradient(90deg,transparent,#132b3bf2 22%,#132b3bf2 78%,transparent);font-size:clamp(12px,1.3vw,17px);white-space:nowrap;line-height:1.3}
.castle-building-status{max-width:100%;padding:0 9px 3px;border-radius:0 0 5px 5px;background:#132b3be8;font-size:10px;line-height:1.3;color:#c8dce3;white-space:nowrap}
.castle-building-icon{font-size:22px;color:#ebcf86;line-height:1;filter:drop-shadow(0 1px 2px #0008)}
.castle-building>.castle-building-icon{display:none}
.castle-building[data-ready=true]::after{content:'';position:absolute;right:14%;bottom:28px;width:11px;height:11px;background:#94eeac;border:2px solid #ffe49c;border-radius:50%;box-shadow:0 0 12px #79f8a8;animation:castle-signal 2.5s ease-in-out infinite alternate}
.castle-building[data-ready=true] small{color:#c5ffc8}
.castle-income{left:60%;top:6.5%;height:4%}.castle-expedition{left:34%;top:11%;height:4%}.castle-formation{left:69%;top:19.5%}
.castle-mastery{left:32%;top:26.5%}.castle-quests{left:66%;top:34%}.castle-market{left:34%;top:42%}
.castle-archive{left:60%;top:55.5%}.castle-training{left:40%;top:61.5%}.castle-altar{left:67%;top:69.5%}
.castle-summon{left:44%;top:77%}.castle-treasury{left:66%;top:85%}.castle-forge{left:40%;top:92.5%}
.castle-directory{align-self:stretch;min-height:0;overflow:auto;padding:23px 20px;color:#e8efd9}
.castle-directory .eyebrow{color:#c5b781;font-size:9px;letter-spacing:2px}
.castle-directory h2{font:25px/1.2 Georgia,serif;margin:12px 0;color:#f2e7bf}
.castle-directory>p{color:#a9c2c6;font-size:11px;line-height:1.7;margin-bottom:16px}
.castle-shortcuts{display:grid;gap:5px}
.castle-shortcut{display:flex;gap:13px;align-items:center;text-align:left;width:100%;min-height:44px;background:linear-gradient(110deg,#2b4e56,#193440);border:1px solid #90b0a82f;color:#f4e5be;border-radius:7px;padding:8px;cursor:pointer}
.castle-shortcut>span:last-child{display:grid;gap:4px}.castle-shortcut strong{font-size:12px}.castle-shortcut small{font-size:9px;color:#b0c9cb}
.castle-shortcut:hover{background:#345b64}.castle-shortcut:focus-visible,.castle-free-call:focus-visible,.castle-battle-link:focus-visible{outline:3px solid #ffe49c;outline-offset:3px}
.castle-battle-link{display:flex;justify-content:space-between;width:100%;min-height:44px;border:0;border-top:1px solid #d1b77944;margin-top:16px;padding:16px 0 0;background:none;color:#e9cd8c;font-size:12px;cursor:pointer}
@media(min-width:761px){body[data-screen=castle] .quest-launcher{display:none}}
.castle-building-dialog{background:radial-gradient(circle at 50% 30%,#325c66,#192f3b 70%);border:2px solid #bdab76;max-width:440px}
.castle-building-dialog h2{font-size:27px}.castle-building-dialog .eyebrow{font-size:9px;color:#cbbb8e}
.castle-building-emblem{display:grid;place-items:center;width:82px;height:82px;margin:23px auto 18px;border:1px solid #e8d393;border-radius:22px;transform:rotate(-4deg);background:radial-gradient(#537377,#263c51);font-size:44px;color:#ffe2a1;box-shadow:0 0 35px #9acccc22}
.castle-building-dialog>p{color:#dfebdf;font-size:13px;line-height:1.75;text-align:center}.castle-building-dialog .castle-building-state{font-size:11px;padding:12px;border-radius:6px;background:#061a2566;color:#e9cd95}
.castle-building-dialog>.primary-button{background:linear-gradient(#f4de9c,#c19b54);border:1px solid #ffebb8;color:#302a20;box-shadow:0 4px 0 #79582f}
.castle-art-error{position:absolute;z-index:4;bottom:35px;left:8px;right:8px;padding:10px;background:#142f3bed;font-size:11px;text-align:center;color:#fff3d4}.castle-art-error button{display:block;margin:5px auto 0;background:#eee0b9;color:#23313b;border:0;padding:7px;border-radius:4px}
#summon-back{align-self:flex-start;color:#e2cca0;font-size:12px;min-height:40px}
@keyframes castle-signal{to{box-shadow:0 0 20px #afffc0;filter:brightness(1.2)}}
@media(max-width:760px){
 .castle-screen{display:block;max-width:540px;border:0}.castle-world{width:100%}.castle-directory{display:none}
 .castle-heading h1{font-size:21px}.castle-heading>span{font-size:7px}.castle-heading p{font-size:9px}
 .castle-free-call{max-width:140px;font-size:9px;padding:5px 8px}.castle-building strong{font-size:13px}.castle-building-status{font-size:9px}
 body:is([data-screen=castle],[data-screen=summon]) .guide{bottom:79px}
}
@media(max-width:380px){.castle-heading h1{font-size:19px}.castle-heading p{font-size:9px}.castle-free-call{max-width:132px}.castle-building strong{min-width:115px;font-size:12px}}
@media(prefers-reduced-motion:reduce){.castle-building,.castle-building::after,.castle-building::before{animation:none!important;transition:none}}
