/* A full-screen illustrated episode board, with one consistent 5 x 2 level grid. */
#campaignmap.storybook-map{--tile-color:#007f80;position:fixed;inset:0;margin:0;width:100%;max-width:none;height:var(--app-height,100dvh);max-height:none;border:0;border-radius:0;padding:calc(12px + var(--safe-top,0px)) calc(20px + var(--safe-right,0px)) calc(10px + var(--safe-bottom,0px)) calc(20px + var(--safe-left,0px));overflow:hidden;background:linear-gradient(180deg,#061d3940,#09254208 35%,#071c3e70),var(--map-art) center/cover no-repeat,#193e62;color:#fff;box-shadow:none}
#campaignmap.storybook-map[open]{display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px}
#campaignmap.storybook-map::backdrop{background:#122942}
#campaignmap.storybook-map .mapheader{display:grid;grid-template-columns:minmax(110px,1fr) minmax(0,5fr) minmax(110px,1fr);align-items:center;gap:16px;padding:0;border:0;background:none;box-shadow:none}
#campaignmap.storybook-map .mapheader>div{text-align:center}
#campaignmap.storybook-map .atlaslabel{display:none}
#campaignmap.storybook-map #atlastitle{font-size:clamp(26px,4vw,48px);line-height:1.05;font-weight:950;text-transform:uppercase;letter-spacing:.015em;color:#fff9dd;margin:0;text-shadow:0 3px 0 #15304e,0 5px 14px #071d4490}
#campaignmap.storybook-map .mapheader button{min-height:44px;font-size:14px;padding:8px 12px;border-radius:24px;border:3px solid #fff3d8;color:#fff;background:#5940a8;box-shadow:0 4px 0 #36276b;white-space:nowrap;letter-spacing:0}
#campaignmap.storybook-map #atlasback{justify-self:start}#campaignmap.storybook-map #closemap{justify-self:end}
#campaignmap.storybook-map .mapbody{display:block;min-height:0;padding:0;overflow:hidden;background:none}
#campaignmap.storybook-map .worlddetail{position:relative;display:block;width:100%;height:100%;min-height:0;background:none;padding:0;overflow:visible}
#campaignmap.storybook-map .worldswitch,#campaignmap.storybook-map #worldpages{display:contents;background:none;border:0;padding:0;margin:0}
#campaignmap.storybook-map #worldselect{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0;border:0}
#campaignmap.storybook-map #worldselect:focus-visible{clip-path:none;width:260px;height:44px;left:calc(50% - 130px);top:0;z-index:5;background:#163f56;color:white}
#campaignmap.storybook-map #worldprevious,#campaignmap.storybook-map #worldnext{position:absolute;top:42%;transform:translateY(-50%);width:clamp(44px,6vw,80px);height:clamp(68px,16vh,120px);font-size:clamp(52px,8vw,90px);line-height:1;padding:0;color:#fff9e8;background:linear-gradient(135deg,#987de9,#54339e);border:4px solid #fff6df;border-radius:45% 45% 45% 45%;box-shadow:0 6px 0 #372966,0 8px 20px #092f4340;z-index:3}
#campaignmap.storybook-map #worldprevious{left:0}#campaignmap.storybook-map #worldnext{right:0}
#campaignmap.storybook-map #worldprevious:disabled,#campaignmap.storybook-map #worldnext:disabled{opacity:.3;box-shadow:none}
#campaignmap.storybook-map .levelcontent{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:12px;width:min(850px,calc(100% - 150px));height:100%;margin:auto;min-height:0;justify-content:stretch;background:none}
#campaignmap.storybook-map .worldrouteheader{display:flex;justify-content:center;gap:20px;align-items:center;margin:0;color:#fff9dc;font-size:16px;text-shadow:0 2px 4px #163151}
#campaignmap.storybook-map #atlasstars{font-size:20px;color:#ffe388}#campaignmap.storybook-map #worldcompletion{font-size:14px;color:#fff}
#campaignmap.storybook-map #levellist{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:clamp(10px,2.4vh,24px) clamp(12px,2vw,32px);padding:5px 8px 9px;min-height:0;height:100%;max-height:440px;align-self:center;overflow:visible;background:none;align-content:stretch}
#campaignmap.storybook-map #levellist button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:0;min-width:0;padding:8px 4px;border:4px solid #fff6d7;border-radius:10px;background:var(--tile-color);color:#fffef1;box-shadow:0 6px 0 #102f5390,0 8px 14px #08244335;transform:none;text-shadow:0 2px 0 #102e4d55;transition:transform .12s,box-shadow .12s;overflow:hidden}
#campaignmap.storybook-map #levellist button:nth-child(even){transform:none}
#campaignmap.storybook-map #levellist button:hover:not(:disabled),#campaignmap.storybook-map #levellist button:focus-visible{transform:translateY(-4px) rotate(0);outline:4px solid #ffdd61;outline-offset:3px}
#campaignmap.storybook-map #levellist button:active:not(:disabled){transform:translateY(3px);box-shadow:0 2px 0 #102f5390}
#campaignmap.storybook-map #levellist button:disabled{background:#25434f;opacity:.8}
#campaignmap.storybook-map #levellist .levelnumber{font-size:clamp(32px,7.6vh,70px);font-weight:950;line-height:1;color:#fff}
#campaignmap.storybook-map .levelstatus{font-size:12px;letter-spacing:.1em;font-weight:800;line-height:1.2;color:#d0eee9}
#campaignmap.storybook-map .levelmedals{display:flex;justify-content:center;gap:3px;font-size:clamp(18px,4vh,32px);line-height:1.05;text-shadow:0 2px 0 #74531c}
#campaignmap.storybook-map .levelmedals .earned{color:#ffd34c}#campaignmap.storybook-map .levelmedals .empty{color:#071e38;opacity:.55;text-shadow:none}
#campaignmap.storybook-map #levellist button.nextlevel{background:#d56b12;border-color:#fff0aa;box-shadow:0 6px 0 #85401b,0 0 0 3px #ffc74460}
#campaignmap.storybook-map #worlddots{display:flex;justify-content:center;align-items:center;gap:4px;margin:0;min-height:36px}
#campaignmap.storybook-map #worlddots button{display:grid;place-items:center;width:34px;height:34px;min-height:34px;padding:0;border-radius:50%;border:2px solid #fff2d5;background:#1d54719e;color:white;font-size:14px;font-weight:900}
#campaignmap.storybook-map #worlddots button[aria-pressed=true]{background:#ffce55;color:#193549;box-shadow:0 0 0 3px #fff2b750}
#campaignmap.storybook-map .atlas-rewards{display:flex;justify-content:center;gap:8px;flex-wrap:nowrap;padding:0;margin:0}
#campaignmap.storybook-map .atlas-rewards button{width:auto;min-height:44px;flex:1;max-width:190px;margin:0;padding:6px 8px;border:2px solid #fff1d0a0;border-radius:12px;background:#163b58e8;color:#fff2d6;font-size:14px;line-height:1.1;font-weight:800;letter-spacing:0;box-shadow:0 3px 0 #0d2345}
#campaignmap.storybook-map .atlas-rewards button:disabled{opacity:.72}
#campaignmap.storybook-map[data-view=levels] .worldcatalog{display:none}
#campaignmap.storybook-map[data-view=worlds] .worlddetail{display:none}
#campaignmap.storybook-map[data-view=worlds] .worldcatalog{display:flex;flex-direction:column;height:100%;min-height:0;gap:10px}
#campaignmap.storybook-map .worldbrowsehint{color:#fff;text-shadow:0 2px 3px #122842}
#campaignmap.storybook-map #worldlist{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;overflow:auto;min-height:0;flex:1;background:none}
#campaignmap.storybook-map .worldcard{min-height:120px;background:#133e59e8;border:3px solid #ffefcd;border-radius:12px;overflow:hidden;box-shadow:0 4px 0 #193755}
#campaignmap.storybook-map .worldpicturewrap{height:90px;min-height:0}#campaignmap.storybook-map .worldcardname{font-size:16px}
@media(orientation:landscape) and (max-height:500px){
 #campaignmap.storybook-map{padding-top:calc(8px + var(--safe-top,0px));padding-bottom:calc(8px + var(--safe-bottom,0px))}
 #campaignmap.storybook-map[open]{gap:5px}
 #campaignmap.storybook-map #atlastitle{font-size:clamp(23px,4vw,34px)}
 #campaignmap.storybook-map .levelcontent{gap:4px;width:min(750px,calc(100% - 120px))}
 #campaignmap.storybook-map .worldrouteheader{gap:16px;min-height:19px}#campaignmap.storybook-map #atlasstars{font-size:16px}
 #campaignmap.storybook-map #levellist{gap:10px 20px;padding:3px 8px 6px;max-height:none}
 #campaignmap.storybook-map #levellist button{padding:3px 2px;gap:2px;border-width:3px}
 #campaignmap.storybook-map #levellist .levelnumber{font-size:clamp(28px,8.2vh,42px)}
 #campaignmap.storybook-map .levelstatus{font-size:12px}
 #campaignmap.storybook-map .levelmedals{font-size:clamp(17px,4.8vh,23px)}
 #campaignmap.storybook-map #worlddots{min-height:30px;gap:3px}#campaignmap.storybook-map #worlddots button{width:30px;height:30px;min-height:30px;font-size:12px}
 #campaignmap.storybook-map .atlas-rewards button{min-height:38px;font-size:13px}
 #campaignmap.storybook-map #worldlist{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));overflow:hidden}
 #campaignmap.storybook-map .worldcard{min-height:0;display:flex;flex-direction:column}
 #campaignmap.storybook-map .worldpicturewrap{height:60px;flex:1}#campaignmap.storybook-map .worldcardname{font-size:14px}
 #campaignmap.storybook-map .worldcardmeta{font-size:12px}
}
@media(orientation:portrait){#campaignmap.storybook-map .mapheader{grid-template-columns:auto 1fr auto;gap:8px}#campaignmap.storybook-map .mapheader button{font-size:12px;padding:6px}#campaignmap.storybook-map #atlastitle{font-size:23px}#campaignmap.storybook-map .levelcontent{width:calc(100% - 76px)}#campaignmap.storybook-map #levellist{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(5,minmax(0,1fr));gap:10px}#campaignmap.storybook-map #levellist button{flex-direction:row;gap:8px}#campaignmap.storybook-map #levellist .levelnumber{font-size:26px}#campaignmap.storybook-map .levelstatus{display:none}#campaignmap.storybook-map .levelmedals{font-size:15px}#campaignmap.storybook-map #worlddots{flex-wrap:wrap}#campaignmap.storybook-map .atlas-rewards{display:grid;grid-template-columns:1fr 1fr}#campaignmap.storybook-map #worldlist{grid-template-columns:1fr 1fr}#campaignmap.storybook-map #worldprevious,#campaignmap.storybook-map #worldnext{width:34px;height:65px;font-size:40px}}
@media(prefers-reduced-motion:reduce){#campaignmap.storybook-map #levellist button{transition:none}}

#campaignmap.storybook-map #levellist .bosslevel{border-color:#ffd56e}#campaignmap.storybook-map #levellist .bosslevel .levelstatus{color:#ffdf79}
@media(orientation:landscape) and (max-height:350px){#campaignmap.storybook-map #levellist .levelstatus{display:none}#campaignmap.storybook-map #levellist .levelnumber{font-size:28px}#campaignmap.storybook-map #levellist .levelmedals{font-size:18px}}

#campaignmap.storybook-map #levellist .levelcoin{font-size:9px;line-height:1;margin:0} @media(orientation:landscape) and (max-height:500px){#campaignmap.storybook-map #levellist .levelnumber{font-size:clamp(24px,7vh,36px)}#campaignmap.storybook-map #levellist .levelstatus{font-size:10px}}

#campaignmap.storybook-map #levellist .levelroute{font-size:12px;line-height:1.1;font-weight:800;max-width:100%;text-wrap:balance}#campaignmap.storybook-map #levellist .levelstatus{display:none}#campaignmap.storybook-map #levellist .levelnumber{font-size:clamp(22px,5.5vh,48px)}#campaignmap.storybook-map #levellist .levelmedals{font-size:clamp(15px,3vh,24px)}@media(orientation:portrait){#campaignmap.storybook-map #levellist .levelroute{font-size:11px;max-width:86px}#campaignmap.storybook-map #levellist .levelcoin{display:none}}

/* Records remain readable on phones: let the level grid scroll instead of clipping. */
#campaignmap.storybook-map .levelcontent{overflow-y:auto;overscroll-behavior:contain}
#campaignmap.storybook-map #levellist{height:auto;min-height:420px;max-height:none;grid-template-rows:repeat(2,minmax(200px,auto));align-self:stretch}
#campaignmap.storybook-map #levellist .levelrecord,#campaignmap.storybook-map #levellist .levelchallenge{font-size:14px;line-height:1.25;white-space:normal}
@media(orientation:portrait){#campaignmap.storybook-map #levellist{grid-template-rows:repeat(5,minmax(190px,auto))}#campaignmap.storybook-map #levellist button{flex-direction:column}}
