/* Pinha Grande: persistent landscape and independent moving actors. */
.island-panel{background:#132c29;color:#efe6c7;border:1px solid #716d48;padding:0!important;position:relative;overflow:hidden}
.island-heading{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:#132622}
.island-heading h2{font:600 22px Georgia,serif;letter-spacing:.04em;margin:3px 0;color:#f1e2b2}
.island-heading small{color:#aaba9b;letter-spacing:.12em;font-size:10px;text-transform:uppercase}
.island-viewport{height:calc(100dvh - 240px);min-height:300px;max-height:850px;position:relative;overflow:clip;touch-action:none;background:#163c49;cursor:grab;isolation:isolate;outline-offset:-3px}
.island-viewport:active{cursor:grabbing}
.island-stage{position:absolute;left:0;top:0;transform-origin:0 0;will-change:transform;contain:layout style}
.island-terrain{position:absolute;inset:0;pointer-events:none}
.island-actors{position:absolute;inset:0;pointer-events:none}
.island-actor{position:absolute;transform:translate(-50%,-75%);border:0!important;background:none!important;box-shadow:none!important;padding:0!important;display:flex;align-items:center;flex-direction:column;pointer-events:auto;color:#fff4cd;cursor:pointer;min-width:44px;min-height:44px;width:max-content;max-width:150px;z-index:3}
.island-actor .pixel-sprite{width:48px!important;height:54px!important;filter:drop-shadow(2px 5px 2px #0007);background-size:contain;background-repeat:no-repeat;background-position:center}
.island-actor label{font:10px/1.2 Verdana,sans-serif;background:#10251dde;padding:3px 5px;border:1px solid #98a17c66;border-radius:4px;max-width:145px;white-space:normal;color:#f4e6bd;pointer-events:none}
.island-city .pixel-sprite{width:96px!important;height:96px!important}
.island-portal .pixel-sprite{width:54px!important;height:62px!important}
.island-hero,.island-npc{z-index:8;transition:left .17s linear,top .17s linear}
.island-hero:before{content:'';position:absolute;width:31px;height:13px;background:#d5c17666;border:1px solid #f8e7ad;border-radius:50%;top:40px;z-index:-1}
.island-hero .pixel-sprite{width:48px!important;height:56px!important}
.island-npc .pixel-sprite{width:44px!important;height:52px!important}
.island-hero .pixel-sprite,.island-npc .pixel-sprite{transform:scaleX(var(--actor-facing,1));transform-origin:50% 90%}
.island-actor.is-walking .pixel-sprite{animation:island-step .18s ease-in-out infinite}
@keyframes island-step{0%,100%{transform:translateY(0) scaleX(var(--actor-facing,1)) rotate(-2deg)}50%{transform:translateY(-2px) scaleX(var(--actor-facing,1)) rotate(2deg)}}
.island-actor[hidden]{display:none!important}
.island-tools{display:flex;gap:6px;align-items:center;flex-wrap:wrap;padding:8px 12px;background:#172e29;border-top:1px solid #65714d}
.island-tools button,.island-status button{border:1px solid #8b8b61;background:#30463b;color:#f6e8c0;border-radius:5px;min-height:38px;padding:6px 12px;font-size:12px}
.island-camera-hint{margin-right:auto;font-size:11px;color:#b7c7a5}
.island-status{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;background:#10221f;min-height:55px}
.island-status b{font-size:13px;color:#e9d5a0}.island-message{margin:4px 0;color:#b7c9b5;font-size:11px}
.island-minimap{position:absolute;right:12px;top:76px;width:112px;height:112px;border:2px solid #9d9d6c;border-radius:4px;pointer-events:none;opacity:.94;box-shadow:0 3px 10px #0008;z-index:12}
body.island-active .screen{overflow:hidden;padding-bottom:0;min-height:0}body.island-active .app{max-width:none;height:100dvh;min-height:0;box-sizing:border-box}
body.island-active .island-panel{height:100%;box-sizing:border-box;display:flex;flex-direction:column;margin:0}
body.island-active .island-viewport{flex:1;height:auto;min-height:0;max-height:none}
.island-heading,.island-tools,.island-status{flex-shrink:0}
@media(max-width:600px){.island-heading{padding:8px 12px}.island-heading h2{font-size:19px}.island-minimap{width:76px;height:76px;top:66px;right:8px}.island-tools{gap:4px;padding:6px 8px}.island-tools button{padding:5px 8px;min-height:36px}.island-viewport{height:calc(100dvh - 265px);min-height:230px}.island-status{padding:7px 10px;min-height:48px}.island-camera-hint{width:100%;font-size:10px}}
@media(prefers-reduced-motion:reduce){.island-hero,.island-npc{transition:none}.island-actor.is-walking .pixel-sprite{animation:none}}
.island-map-button{position:absolute;right:12px;top:76px;z-index:12;padding:0;border:2px solid #9d9d6c;border-radius:5px;background:#10221f;color:#efe6c7;cursor:pointer;box-shadow:0 3px 10px #0008;overflow:hidden}
.island-map-button .island-minimap{position:static;display:block;width:112px;height:112px;border:0;box-shadow:none;opacity:1}
.island-map-button span{display:block;font-size:11px;padding:3px}
.island-map-dialog{width:min(420px,calc(100vw - 40px));max-height:85dvh;box-sizing:border-box;overflow:auto;padding:16px;background:#132c29;color:#efe6c7;border:2px solid #9d9d6c;border-radius:10px}
.island-map-dialog::backdrop{background:#06110fbb}
.island-map-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.island-map-dialog h2{margin:0;font:22px Georgia,serif}
.island-map-dialog button{min-height:44px;padding:8px 14px;background:#30463b;color:#f6e8c0;border:1px solid #8b8b61;border-radius:5px}
.island-map-large{display:block;width:100%;height:auto;aspect-ratio:1;image-rendering:pixelated;background:#10221f}
.island-map-legend{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px;font-size:13px}
.map-hero{color:#ffe17a}.map-bot{color:#ff6c72}.map-city{color:#72d4ff}.map-portal{color:#d0a0ff}
.island-map-dialog p{font-size:12px;line-height:1.5;color:#c7d3bd;margin-bottom:0}
.island-bot:before{content:'';position:absolute;inset:auto 0 12px;margin:auto;width:32px;height:12px;border:1px solid #ff777a;border-radius:50%;background:#b9313130;z-index:-1}
.island-actor:focus-visible,.island-map-button:focus-visible{outline:3px solid #ffe17a;outline-offset:3px}
@media(max-width:600px){.island-map-button{top:66px;right:8px}.island-map-button .island-minimap{width:76px;height:76px}}
.island-route{position:absolute;inset:0;pointer-events:none;overflow:visible}
.island-route polyline{fill:none;stroke:#ffe6a8;stroke-width:3;stroke-dasharray:5 9;stroke-linecap:round;opacity:.85}
.island-route circle{fill:#ffe6a822;stroke:#ffe6a8;stroke-width:2}
.island-actor.is-selected label{border-color:#ffe6a8;background:#433e23;color:#fff6d6}
.encounter-sheet{display:grid;gap:16px;min-width:0;background:#10251d;padding:14px;border-radius:8px;color:#efe6c7}
.encounter-sheet b,.encounter-heading span{color:#efe6c7}
.encounter-heading{display:flex;gap:18px;align-items:center;padding:16px;background:#17392c;border:1px solid #728563;border-radius:8px}
.encounter-heading>div{display:grid;gap:6px}.encounter-heading small{letter-spacing:.12em;color:#adc4aa;font-size:10px}
.encounter-heading strong{color:#f0dfad;font-size:18px}.encounter-heading span{font-size:13px}
.encounter-roster{display:grid;gap:8px}.encounter-roster article{display:flex;align-items:center;gap:14px;padding:12px;border:1px solid #65735366;border-radius:6px;background:#0e231c}
.encounter-roster article>div{display:grid;gap:5px}.encounter-roster small{font-size:12px;color:#bdcbb8}.encounter-sheet p{font-size:12px;line-height:1.5;color:#c6cdbd;margin:0}
.city-hub-summary{position:relative;display:flex;gap:10px;flex-wrap:wrap;margin:12px 0;padding:14px;background:#10221fdf;border:1px solid #7f805355;border-radius:8px;font-size:13px;color:#d4dec8}
.city-hub-summary b{color:#ffe1a1}.city-services-title{position:relative;font:19px Georgia,serif;margin:20px 0 10px;color:#f1dfad}
.city-future{position:relative;margin-top:20px;background:#122820df;border:1px solid #7f805355;border-radius:8px;padding:14px;color:#bdcbb8}
.city-future summary{cursor:pointer;font-size:13px;min-height:24px}.city-future>div{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px;padding-top:14px}
.city-future>div>span{display:flex;align-items:center;flex-direction:column;gap:6px;padding:12px;opacity:.65}.city-future small{font-size:11px}.city-future .city-building-icon{width:40px;height:40px}
.city-r41>.city-scene{padding:6px 0 12px;gap:10px}
.city-r41>.city-hub-summary,.city-r41>.city-services-title,.city-r41>.city-future{z-index:5}
.city-r41 .city-building-card,.city-r41 .city-building-card.portal-exit{flex-direction:row;justify-content:flex-start;min-height:78px;gap:14px;padding:12px 16px;box-shadow:0 3px 10px #0003}
.city-r41 .city-building-card span:last-child{text-align:left;gap:5px}
.city-r41 .city-building-card .city-building-icon{width:48px;height:48px;flex:0 0 48px}
.city-r41 .city-building-card b{font-size:15px}.city-r41 .city-building-card small{font-size:12px}
.city-r41 .city-building-card.portal-exit{border-color:#dccb88;background:#1d3e37}
@media(max-width:600px){.city-r41>.city-scene{grid-template-columns:1fr}.city-r41 .city-building-card,.city-r41 .city-building-card.portal-exit{min-height:68px;padding:10px 12px}.city-r41 .city-building-card .city-building-icon{width:40px;height:40px;flex-basis:40px}.city-hub-summary{font-size:12px;padding:10px}.city-services-title{font-size:17px}}
/* Two authored walking poses; elven heroes and NPCs share this cycle. */
:is(.island-hero,.island-npc).is-walking .pixel-sprite[style*="hero_elves.svg"]{animation:elven-stride .36s steps(1,end) infinite;transform:scaleX(var(--actor-facing,1))}
@keyframes elven-stride{0%,100%{background-image:url('sprites/hero_elves_walk_1.svg')}50%{background-image:url('sprites/hero_elves_walk_2.svg')}}
@media(prefers-reduced-motion:reduce){:is(.island-hero,.island-npc).is-walking .pixel-sprite[style*="hero_elves.svg"]{animation:none}}
/* Directional poses for elven heroes and NPCs. Horizontal movement mirrors the profile. */
:is(.island-hero,.island-npc)[data-direction="north"]:not(.is-walking) .pixel-sprite[style*="hero_elves.svg"]{background-image:url('sprites/hero_elves_back.svg')!important}
:is(.island-hero,.island-npc):is([data-direction="east"],[data-direction="west"]):not(.is-walking) .pixel-sprite[style*="hero_elves.svg"]{background-image:url('sprites/hero_elves_side.svg')!important}
:is(.island-hero,.island-npc)[data-direction="north"].is-walking .pixel-sprite[style*="hero_elves.svg"]{animation-name:elven-back-stride}
:is(.island-hero,.island-npc):is([data-direction="east"],[data-direction="west"]).is-walking .pixel-sprite[style*="hero_elves.svg"]{animation-name:elven-side-stride}
@keyframes elven-back-stride{0%,100%{background-image:url('sprites/hero_elves_back_walk_1.svg')}50%{background-image:url('sprites/hero_elves_back_walk_2.svg')}}
@keyframes elven-side-stride{0%,100%{background-image:url('sprites/hero_elves_side_walk_1.svg')}50%{background-image:url('sprites/hero_elves_side_walk_2.svg')}}
@media(prefers-reduced-motion:reduce){
 :is(.island-hero,.island-npc).is-walking .pixel-sprite[style*="hero_elves.svg"]{animation:none}
 :is(.island-hero,.island-npc)[data-direction="north"] .pixel-sprite[style*="hero_elves.svg"]{background-image:url('sprites/hero_elves_back.svg')!important}
 :is(.island-hero,.island-npc):is([data-direction="east"],[data-direction="west"]) .pixel-sprite[style*="hero_elves.svg"]{background-image:url('sprites/hero_elves_side.svg')!important}
}

/* Keep depth sorting local, below the map controls. */
.island-actors{z-index:2}
.island-route{z-index:1}
/* Two authored walking poses; human heroes and NPCs share this cycle. */
:is(.island-hero,.island-npc).is-walking .pixel-sprite[style*="hero_humans.svg"]{animation:human-stride .36s steps(1,end) infinite;transform:scaleX(var(--actor-facing,1))}
@keyframes human-stride{0%,100%{background-image:url('sprites/hero_humans_walk_1.svg')}50%{background-image:url('sprites/hero_humans_walk_2.svg')}}
@media(prefers-reduced-motion:reduce){:is(.island-hero,.island-npc).is-walking .pixel-sprite[style*="hero_humans.svg"]{animation:none}}
/* Directional poses for human heroes and NPCs. Horizontal movement mirrors the profile. */
:is(.island-hero,.island-npc)[data-direction="north"]:not(.is-walking) .pixel-sprite[style*="hero_humans.svg"]{background-image:url('sprites/hero_humans_back.svg')!important}
:is(.island-hero,.island-npc):is([data-direction="east"],[data-direction="west"]):not(.is-walking) .pixel-sprite[style*="hero_humans.svg"]{background-image:url('sprites/hero_humans_side.svg')!important}
:is(.island-hero,.island-npc)[data-direction="north"].is-walking .pixel-sprite[style*="hero_humans.svg"]{animation-name:human-back-stride}
:is(.island-hero,.island-npc):is([data-direction="east"],[data-direction="west"]).is-walking .pixel-sprite[style*="hero_humans.svg"]{animation-name:human-side-stride}
@keyframes human-back-stride{0%,100%{background-image:url('sprites/hero_humans_back_walk_1.svg')}50%{background-image:url('sprites/hero_humans_back_walk_2.svg')}}
@keyframes human-side-stride{0%,100%{background-image:url('sprites/hero_humans_side_walk_1.svg')}50%{background-image:url('sprites/hero_humans_side_walk_2.svg')}}
@media(prefers-reduced-motion:reduce){
 :is(.island-hero,.island-npc).is-walking .pixel-sprite[style*="hero_humans.svg"]{animation:none}
 :is(.island-hero,.island-npc)[data-direction="north"] .pixel-sprite[style*="hero_humans.svg"]{background-image:url('sprites/hero_humans_back.svg')!important}
 :is(.island-hero,.island-npc):is([data-direction="east"],[data-direction="west"]) .pixel-sprite[style*="hero_humans.svg"]{background-image:url('sprites/hero_humans_side.svg')!important}
}



/* Keep exit labels inside the loaded sector at all four boundaries. */
.island-passage[data-edge="west"]{transform:translate(0,-50%);align-items:flex-start}
.island-passage[data-edge="east"]{transform:translate(-100%,-50%);align-items:flex-end}
.island-passage[data-edge="north"]{transform:translate(-50%,0);flex-direction:row;gap:4px}
.island-passage[data-edge="south"]{transform:translate(-50%,-100%);flex-direction:row;gap:4px}
.island-passage[data-edge="north"] label,.island-passage[data-edge="south"] label{max-width:110px}
.sector-atlas-list{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:0;list-style:none;font-size:12px;text-align:left}
.sector-atlas-list li{padding:8px;background:#213e34;border:1px solid #6d7961;border-radius:4px}
.sector-atlas-list [aria-current]{border-color:#f5dd91;color:#f5dd91;font-weight:bold}

.island-map-dialog .island-map-large{display:block;width:min(100%,42dvh);height:auto;margin:0 auto;image-rendering:pixelated}

/* Keep nearby encounter names above the troop, away from the hero's nameplate. */
.island-bot label{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);width:max-content;max-width:132px;background:#322b24ed;border-color:#caa9779c;box-shadow:0 2px 4px #0005;text-align:center}
.island-hero label{background:#1d382cf0;border-color:#d8c58c;color:#fff0bc}
.island-bot:focus-visible label,.island-bot.is-selected label{background:#5b3928;border-color:#f3ce85}
.island-bot[data-label-side="below"] label{top:calc(100% + 3px);bottom:auto}
/* Orc expedition poses share the existing movement clock, with no new timers. */
:is(.island-hero,.island-npc).is-walking .pixel-sprite[style*="hero_orcs.svg"]{animation:orc-stride .36s steps(1,end) infinite;transform:scaleX(var(--actor-facing,1))}
:is(.island-hero,.island-npc)[data-direction="north"]:not(.is-walking) .pixel-sprite[style*="hero_orcs.svg"]{background-image:url('sprites/hero_orcs_back.svg')!important}
:is(.island-hero,.island-npc):is([data-direction="east"],[data-direction="west"]):not(.is-walking) .pixel-sprite[style*="hero_orcs.svg"]{background-image:url('sprites/hero_orcs_side.svg')!important}
:is(.island-hero,.island-npc)[data-direction="north"].is-walking .pixel-sprite[style*="hero_orcs.svg"]{animation-name:orc-back-stride}
:is(.island-hero,.island-npc):is([data-direction="east"],[data-direction="west"]).is-walking .pixel-sprite[style*="hero_orcs.svg"]{animation-name:orc-side-stride}
@keyframes orc-stride{0%,100%{background-image:url('sprites/hero_orcs_walk_1.svg')}50%{background-image:url('sprites/hero_orcs_walk_2.svg')}}
@keyframes orc-back-stride{0%,100%{background-image:url('sprites/hero_orcs_back_walk_1.svg')}50%{background-image:url('sprites/hero_orcs_back_walk_2.svg')}}
@keyframes orc-side-stride{0%,100%{background-image:url('sprites/hero_orcs_side_walk_1.svg')}50%{background-image:url('sprites/hero_orcs_side_walk_2.svg')}}
@media(prefers-reduced-motion:reduce){
 :is(.island-hero,.island-npc).is-walking .pixel-sprite[style*="hero_orcs.svg"]{animation:none}
 :is(.island-hero,.island-npc)[data-direction="north"] .pixel-sprite[style*="hero_orcs.svg"]{background-image:url('sprites/hero_orcs_back.svg')!important}
 :is(.island-hero,.island-npc):is([data-direction="east"],[data-direction="west"]) .pixel-sprite[style*="hero_orcs.svg"]{background-image:url('sprites/hero_orcs_side.svg')!important}
}
.kingdoms-reference{margin-top:12px}.kingdoms-reference summary{cursor:pointer;padding:10px 0}.kingdoms-reference img{display:block;width:100%;height:auto;margin-bottom:8px}.kingdoms-reference a{color:#d9e7ba}
