*{box-sizing:border-box}body{margin:0;background:#142820;color:#fff4d3;font:16px/1.4 Georgia,serif}main{max-width:840px;margin:auto;padding:14px}h1{margin:0;font-size:25px}header p{margin:4px 0 10px}.toolbar{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-bottom:10px}button{min-height:44px;border:2px solid #d1ab64;border-radius:5px;background:#523720;color:#fff4d3;padding:8px 14px;font:bold 15px Georgia,serif;cursor:pointer}button:hover{background:#74502f}button:focus-visible,summary:focus-visible,.node:focus-visible{outline:3px solid #fff;outline-offset:3px}button:disabled{opacity:.5;cursor:not-allowed}#position{font-weight:bold}#map-viewport{overflow:auto;max-height:75vh}#map{position:relative;width:100%;aspect-ratio:760/660;overflow:hidden;background:#2b5139;border:3px solid #a17e49}#swf,#nodes{position:absolute;inset:0}ruffle-player{display:block;width:100%;height:100%}#nodes{pointer-events:none}.node{position:absolute;width:4.5%;height:5.2%;transform:translate(-50%,-50%);border:0;border-radius:50%;background:transparent;padding:0;pointer-events:auto}.node:hover,.node:focus-visible{outline:2px solid #fff6cf;outline-offset:1px;background:#ffda572e}.node.current{outline:2px solid #f2c95d;outline-offset:1px}.node.visited:not(.current){box-shadow:inset 0 0 0 2px #b8dd8d8a}#avatar{position:absolute;z-index:2;width:3.8%;height:4.1%;transform:translate(-50%,-90%);pointer-events:none;transition:left .6s linear,top .6s linear;filter:drop-shadow(1px 2px 2px #172116)}#avatar span{display:block;width:100%;height:100%;background:url('archive/assets/world/locationIcon.png') center/contain no-repeat}#location{position:absolute;z-index:4;width:min(280px,52%);padding:10px 12px;background:#252b29f2;border:2px solid #c3a268;color:#fff7dd;box-shadow:3px 5px 8px #161a18a8}#location h2{font-size:19px;margin:0 0 6px}#location p{font-size:13px;margin:4px 0}#location-art{display:block;width:100%;height:75px;object-fit:cover;border:1px solid #a79769}#location-art[hidden]{display:none}.panel-actions{display:flex;gap:6px;margin-top:10px}.panel-actions button{min-height:38px;padding:5px 9px;font-size:13px}#status{min-height:26px;font-weight:bold}details{border:1px solid #8d794d;padding:0 12px;margin-top:10px}summary{cursor:pointer;min-height:44px;padding-top:10px}dialog{max-width:min(90vw,430px);background:#222d28;color:#fff4d3;border:3px solid #cfaf6b}dialog::backdrop{background:#101a17a8}@media(max-width:560px){main{padding:8px}#map{width:760px;height:660px;aspect-ratio:auto}#location{width:280px}#location p{font-size:13px}.panel-actions button{min-height:44px}.node{width:44px;height:44px}}

/* The original SWFs supply the panel and walking marker artwork. */
#avatar{width:56px;height:62px;transform:translate(-50%,-82%);overflow:hidden;transition:left .65s linear,top .65s linear}
#marker-swf{position:absolute;width:550px;height:400px;left:-247px;top:-290px;pointer-events:none}
#marker-moga{position:absolute;width:34px;height:34px;left:11px;top:1px;overflow:hidden;pointer-events:none}
#marker-moga ruffle-player{width:100%;height:100%}
#location{width:280px;min-height:220px;padding:12px 16px;border:0;background:transparent;box-shadow:none;isolation:isolate}
#location-swf{position:absolute;inset:0;z-index:-1;pointer-events:none}
#location-content{position:relative}
#location h2{font-size:16px;line-height:1.1;margin:0 0 4px}
#location p{font-size:12px;margin:3px 0}
#location-art{height:60px}
#location .panel-actions{margin-top:5px}
#location .panel-actions button{min-height:30px;font-size:12px}
#marker-swf{display:none}
#avatar{width:42px;height:56px;overflow:visible;transform:translate(-50%,-88%)}
#marker-moga{left:4px;top:0;width:34px;height:34px;background-position:center;background-size:contain;background-repeat:no-repeat;filter:drop-shadow(1px 2px 2px #112)}
#location .location-content{position:relative;background:#222825f5;margin:-3px;padding:4px 5px 7px;min-height:190px}
#location{pointer-events:none}
#location button{pointer-events:auto}
#location{width:240px;min-height:200px;padding:12px 14px}
#location .location-content{min-height:190px}
#marker-moga{left:4px}

#swf{pointer-events:auto}
#avatar{width:48px;height:73px;transform:translate(-50%,-90%);transition:left var(--walk-ms,850ms) linear,top var(--walk-ms,850ms) linear;z-index:3}
#marker-moga{left:4px;top:0;width:40px;height:42px;background-size:contain;background-position:center bottom}
#avatar #marker-arrow{display:block;position:absolute;left:14px;top:42px;width:19px;height:23px;background:url('assets/current-location-arrow.png') center/19px 23px no-repeat}
#avatar.walking #marker-moga{animation:map-moga-step .38s ease-in-out infinite alternate}
@keyframes map-moga-step{from{transform:translateY(0) rotate(-3deg)}to{transform:translateY(-3px) rotate(3deg)}}

#location{width:240px;height:316px;min-height:0;padding:0;pointer-events:none;filter:drop-shadow(2px 4px 4px #1119)}
#location .location-card{position:relative;width:240px;height:316px;background:#08090a url('assets/locationInfo-frame.png') 0 0/240px 200px no-repeat;border:3px solid #08090a;border-radius:8px;overflow:hidden;pointer-events:none}
#location button{pointer-events:auto}
#location-photo{display:block}
#location .location-photo{position:absolute;left:7px;top:7px;width:220px;height:140px;overflow:hidden;background:#303733}
#location-art,#location-art[hidden]{display:block;width:220px;height:140px;object-fit:cover;border:0}
#location .location-caption{position:absolute;left:0;right:0;bottom:0;min-height:30px;padding:11px 5px 2px;background:linear-gradient(transparent,#171914e8);display:flex;justify-content:space-between;align-items:end;gap:5px}
#location h2{margin:0;font:700 13px/1.1 Arial,sans-serif;color:#e4f2cb;text-shadow:1px 1px #111}
#location-difficulty{font:italic 900 15px/1 Arial,sans-serif;color:#e94c74;text-shadow:1px 1px #24080e;text-transform:uppercase}
#location-difficulty.easy{color:#72dd46}#location-difficulty.medium{color:#f6cf45}
#location #close{position:absolute;z-index:2;right:1px;top:0;width:28px;height:28px;min-height:28px;padding:0;border:0;border-radius:50%;background:transparent;color:transparent;font-size:20px}
#location #close:focus-visible{outline:2px solid #fff;outline-offset:-1px}
#location .location-reward{position:absolute;left:5px;right:5px;top:194px;height:77px;padding:6px 5px;background:#303136;color:#f1f2ee;font:11px/1.2 Arial,sans-serif;overflow:hidden}
#location .location-reward p{margin:0 0 3px;font:inherit}
#location .location-reward #location-mogas{color:#d5e9e5}
#location .location-reward #location-demo{color:#76e7ed}
#location #go{position:absolute;left:72px;bottom:8px;width:96px;height:29px;min-height:29px;padding:2px 5px;border:1px solid #266a83;border-radius:5px;background:linear-gradient(#3e8399,#17617b);font:bold 15px Arial,sans-serif;color:#e4fafb;box-shadow:0 2px 2px #000}
#location #go:hover{filter:brightness(1.18)}
#location #go:disabled{filter:grayscale(1);opacity:.65}
#avatar{transition:none}
#location .mastery-row{position:absolute;inset:0;z-index:1;pointer-events:none}
#mastery-stars{position:absolute;left:12px;top:156px;display:flex;gap:7px;color:#f7d17e;font:26px/30px Arial,sans-serif;text-shadow:1px 1px #111}
#mastery-stars span{width:23px;text-align:center}
#location .mastery-track{position:absolute;left:106px;top:162px;width:124px;height:17px;background:#5d5d5d;box-shadow:inset 0 0 0 1px #171717}
#mastery-fill{display:block;height:100%;background:url('assets/locationInfo-frame.png') -106px -162px/240px 200px no-repeat;transition:width .2s}
#location #close{z-index:5;color:transparent;border:0;background:url('assets/locationInfo-frame.png') -208px 0/240px 200px no-repeat}
#location #close:hover{filter:brightness(1.2)}
#location{width:240px;height:290px;padding:0;filter:drop-shadow(2px 4px 4px #1119)}
#location-swf,#location-swf ruffle-player{display:block;width:240px;height:290px;pointer-events:none}
#location #close{position:absolute;top:0;right:0;z-index:5;width:33px;height:33px;min-height:33px;padding:0;background:transparent;border:0;color:transparent;cursor:pointer}
#location #card-go{position:absolute;left:94px;top:253px;z-index:5;width:74px;height:30px;min-height:30px;padding:0;background:transparent;border:0;color:transparent;cursor:pointer}
#location #card-go:focus-visible,#location #close:focus-visible{outline:2px solid #fff;outline-offset:-2px}
#location.locked,#location.locked #location-swf,#location.locked #location-swf ruffle-player{height:320px}
#location.locked #card-go{top:283px}
#location-swf{clip-path:inset(3px 3px 0 3px round 5px)}
#surprise-effect{position:absolute;z-index:4;width:200px;height:200px;pointer-events:none}
#surprise-effect[hidden]{display:none}
.node:hover,.node.current,.node.visited:not(.current){background:transparent;outline:0;box-shadow:none}
#battle-frame{display:block;width:100%;border:0;min-height:900px;background:#172925}#transition{position:absolute;z-index:2147483647;pointer-events:auto;background:#000;opacity:1;transition:opacity .35s ease}#transition.leaving{opacity:0}#transition ruffle-player{width:100%;height:100%;background:transparent}#battle-view.preparing{position:absolute;left:-10000px;top:0;width:800px}
#dex-stage{width:100%;aspect-ratio:760/660;border:3px solid #a17e49;background:#000}#dex-stage ruffle-player{width:100%;height:100%}#dex-view.preparing{position:absolute;left:-10000px;top:0;width:800px}
#home-stage{width:100%;aspect-ratio:760/660;border:3px solid #a17e49;background:#000}#home-stage ruffle-player{width:100%;height:100%}#home-view.preparing{position:absolute;left:-10000px;top:0;width:800px}#travel-layer{position:absolute;z-index:46}#travel-layer ruffle-player{width:100%;height:100%;background:transparent}
#location.home,#location.home #location-swf{height:199px;overflow:hidden}#location.home #card-go{top:165px}
/* One screen: every view (map, Dex, Home, battle) uses the same 760x660 stage, scaled to fit the window. */
:root{--stage-w:min(calc(100vw - 16px),calc((100vh - 16px) * 760 / 660));--stage-h:calc(var(--stage-w) * 660 / 760)}
main{max-width:none;padding:8px}
#map-viewport{max-height:none;overflow:visible}
#map,#dex-stage,#home-stage,#panel-stage{width:var(--stage-w);height:var(--stage-h);aspect-ratio:auto;margin:0 auto;border-width:0}
#battle-frame{width:var(--stage-w);height:var(--stage-h);min-height:0;margin:0 auto}
.toolbar,#status,header,details{max-width:var(--stage-w);margin-left:auto;margin-right:auto}
@media(max-width:560px){#map-viewport{overflow:auto;max-height:75vh}#map{width:760px;height:660px;margin:0}}
/* Public play (not localhost / ?dev=1): only the game screen, no HTML text or controls. */
.play-only .toolbar,.play-only header,.play-only details{display:none!important}
.play-only body{overflow:hidden}
.play-only #status{display:none!important}
/* Sign-in (account.js): the original title screen with the login panels, same stage as every other view. */
#login-stage{width:var(--stage-w);height:var(--stage-h);margin:0 auto;background:#000}#login-stage ruffle-player{width:100%;height:100%}
.signing-in #map-view,.signing-in #status{display:none!important}

#panel-layer{position:absolute;z-index:45}#panel-layer ruffle-player{width:100%;height:100%;background:transparent}
#friend-dialog{position:fixed;z-index:60;left:50%;top:50%;transform:translate(-50%,-50%);width:min(440px,calc(100vw - 32px));max-height:min(560px,calc(100vh - 32px));overflow:auto;box-sizing:border-box;padding:18px 20px;background:#5c0b0b;border:4px solid #f6941d;border-radius:14px;color:#fff;font:15px/1.35 "Trebuchet MS",Arial,sans-serif;box-shadow:0 10px 40px rgba(0,0,0,.6)}
#friend-dialog[hidden]{display:none}
#friend-dialog h2{margin:0 0 10px;font-size:24px;color:#ffcc33;text-shadow:0 2px 0 #7a3b00}#friend-dialog h3{margin:14px 0 6px;font-size:16px;color:#ffcc33}

#friend-dialog .friend-row{display:flex;gap:8px}#friend-search{flex:1;min-width:0;padding:8px 10px;border-radius:8px;border:2px solid #f6941d;font:inherit}
#friend-dialog li button,#friend-search-go{padding:6px 12px;border-radius:8px;border:2px solid #1d6b16;background:#2fb52a;color:#fff;font:inherit;font-weight:bold;cursor:pointer}
#friend-dialog button[data-decline],#friend-dialog button[data-remove]{background:#8a8a8a;border-color:#555}
#friend-dialog ul{list-style:none;margin:0;padding:0}#friend-dialog li{display:flex;align-items:center;gap:8px;padding:6px 8px;margin:4px 0;background:rgba(0,0,0,.25);border-radius:8px}
#friend-dialog li span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}#friend-dialog li small{color:#ffcc33}#friend-dialog li.empty{color:#e8c9a0;font-style:italic}#friend-dialog em{color:#ffcc33}
#friend-note{min-height:1.2em;margin:8px 0 4px;color:#ffe08a}
.x-close{position:absolute;right:10px;top:10px;width:30px;height:30px;padding:0;display:grid;place-items:center;border:0;border-radius:6px;background:transparent;color:#ffcc33;font:bold 28px/1 Arial,sans-serif;cursor:pointer}
.x-close:hover{background:rgba(255,255,255,.12);color:#fff}
#friend-menu{position:absolute;z-index:58;width:230px;box-sizing:border-box;padding:12px;background:#5c0b0b;border:3px solid #f6941d;border-radius:12px;color:#fff;font:14px/1.3 "Trebuchet MS",Arial,sans-serif;box-shadow:0 6px 24px rgba(0,0,0,.55)}
#friend-menu[hidden],#settings-window[hidden]{display:none}
#friend-menu .x-close{right:4px;top:4px;width:26px;height:26px;font-size:24px}
.friend-menu-head{display:flex;gap:10px;align-items:center;margin-right:22px}.friend-menu-head img{width:48px;height:48px;border-radius:8px;background:#2b0505}
.friend-menu-head strong{display:block;font-size:16px;color:#ffcc33}.friend-menu-head small{color:#e8c9a0}
.friend-menu-buttons{display:flex;gap:8px;margin-top:10px}.friend-menu-buttons button{flex:1;white-space:nowrap;padding:7px 6px;border-radius:8px;border:2px solid #1d6b16;background:#2fb52a;color:#fff;font:inherit;font-weight:bold;cursor:pointer}
.friend-menu-buttons button:disabled{background:#777;border-color:#555;cursor:default}
#friend-menu-note{margin:8px 0 0;min-height:1.1em;color:#ffe08a;font-size:13px}
#settings-window{position:fixed;z-index:62;left:50%;top:50%;transform:translate(-50%,-50%);width:clamp(320px,50vw,760px);max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);overflow:auto;box-sizing:border-box;padding:20px 22px;background:#5c0b0b;border:4px solid #f6941d;border-radius:14px;color:#fff;font:15px/1.35 "Trebuchet MS",Arial,sans-serif;box-shadow:0 10px 40px rgba(0,0,0,.6)}
#settings-window h2{margin:0 0 12px;font-size:26px;color:#ffcc33;text-shadow:0 2px 0 #7a3b00}#settings-window h3{margin:0 0 8px;font-size:17px;color:#ffcc33}
.settings-grid{display:grid;grid-template-columns:1.3fr 1fr;gap:18px}@media (max-width:640px){.settings-grid{grid-template-columns:1fr}}
.settings-grid>div{background:rgba(0,0,0,.25);border-radius:10px;padding:12px}
.profile-card{display:flex;gap:12px;align-items:center}.profile-card img{width:72px;height:72px;border-radius:10px;background:#2b0505;border:2px solid #f6941d}
.profile-card strong{display:block;font-size:20px}.profile-card small{color:#e8c9a0}
.settings-hint{margin:10px 0 6px;color:#e8c9a0;font-size:13px}
#profile-choices{display:grid;grid-template-columns:repeat(auto-fill,minmax(52px,1fr));gap:6px;max-height:190px;overflow:auto;padding:2px}
#profile-choices button{padding:0;aspect-ratio:1;border-radius:8px;border:2px solid transparent;background:#2b0505;cursor:pointer}
#profile-choices button img{width:100%;height:100%;display:block;border-radius:6px}#profile-choices button[aria-selected=true]{border-color:#ffcc33;box-shadow:0 0 0 2px #2fb52a}
#profile-note{min-height:1.1em;margin:6px 0 0;color:#ffe08a;font-size:13px}
.settings-game label{display:flex;flex-direction:column;gap:4px;margin:0 0 12px}.settings-game label.check{flex-direction:row;align-items:center;gap:8px}
.settings-game select{padding:6px;border-radius:6px;font:inherit}.settings-game input[type=range]{accent-color:#f6941d}
#set-logout{margin-top:6px;padding:8px 16px;border-radius:8px;border:2px solid #7a1d1d;background:#c0392b;color:#fff;font:inherit;font-weight:bold;cursor:pointer}
#panel-stage{background:#000 url('archive/images/location_thumb/3_BG.jpg') center/cover}
.shop-section #panel-stage{background:#081822 url('archive/images/message_center_bg_760x744.png') center/cover}
#input-block{position:fixed;inset:0;z-index:44;background:transparent}#input-block[hidden]{display:none}#input-block.loading{z-index:1000;cursor:wait}
.dex-naming-open #dex-view{position:relative;z-index:45}
#friend-menu{width:178px;padding:8px}
#friend-menu .friend-menu-buttons{flex-direction:column;gap:6px;margin:0}
#friend-menu .friend-menu-buttons button{display:flex;align-items:center;gap:8px;padding:6px 10px;text-align:left}
#friend-menu .friend-menu-buttons button img,#friend-menu .friend-menu-buttons button svg{width:24px;height:24px;flex:none;object-fit:contain}
#friend-menu-pvp{background:#d9822b !important;border-color:#8a4a10 !important}
#friend-menu-note{margin:6px 2px 0;font-size:12px}#friend-menu-note:empty{display:none}
/* the game's own fonts (from the original UI files): VAG Rounded for text, VAG Rounded Bold for buttons and titles */
@font-face{font-family:"MG VAG";src:url("assets/ui-icons/vag-rounded.ttf") format("truetype");font-display:swap}
@font-face{font-family:"MG VAG Bold";src:url("assets/ui-icons/vag-rounded-bold.ttf") format("truetype");font-display:swap}
#friend-dialog,#friend-menu,#settings-window{font-family:"MG VAG","Trebuchet MS",Arial,sans-serif}
#friend-dialog h2,#friend-dialog h3,#settings-window h2,#settings-window h3,#friend-dialog button,#friend-menu button,#settings-window button,.profile-card strong{font-family:"MG VAG Bold","MG VAG","Trebuchet MS",Arial,sans-serif;font-weight:normal}
#friend-menu .friend-menu-buttons button img{width:26px;height:26px;object-fit:contain}
/* Message Center (inbox.js): the original speech-bubble button and window art */
#inbox-button{position:absolute;z-index:43;padding:0;border:0;background:transparent;cursor:pointer}#inbox-button[hidden]{display:none}
#inbox-button .inbox-icon{display:block;width:100%;height:100%;background:url("assets/ui-icons/message.png") center/contain no-repeat;filter:drop-shadow(0 2px 2px rgba(0,0,0,.6));transition:transform .12s}
#inbox-button:hover .inbox-icon{transform:scale(1.1)}
#inbox-badge{position:absolute;right:-4px;top:-4px;min-width:20px;height:20px;padding:0 4px;box-sizing:border-box;border-radius:10px;background:#e01b1b url("archive/images/notification_redbox_18x18.png") center/cover;color:#fff;font:bold 12px/20px "MG VAG Bold",Arial,sans-serif;text-align:center;box-shadow:0 0 0 2px #fff}
#inbox-badge[hidden]{display:none}
#inbox-window{position:fixed;z-index:61;left:50%;top:50%;transform:translate(-50%,-50%);width:clamp(320px,56vw,720px);max-width:calc(100vw - 32px);height:min(80vh,680px);display:flex;flex-direction:column;box-sizing:border-box;padding:16px 18px;border:4px solid #3fd0e8;border-radius:14px;background:#0d1530 url("archive/images/message_center_bg_760x744.png") center/cover;color:#fff;font-family:"MG VAG","Trebuchet MS",Arial,sans-serif;box-shadow:0 10px 40px rgba(0,0,0,.7)}
#inbox-window[hidden]{display:none}
#inbox-window h2{margin:0 0 8px}#inbox-window h2 img{height:42px;display:block}
#inbox-toolbar{display:flex;align-items:flex-start;gap:12px}
#inbox-tabs{display:flex;gap:6px;flex-wrap:wrap;flex:1;min-width:0}
#inbox-accept-all{flex:none;margin-left:auto}
#inbox-tabs button,#inbox-list button{padding:6px 12px;border-radius:8px;border:2px solid #1d6b16;background:#2fb52a;color:#fff;font:15px "MG VAG Bold","MG VAG",Arial,sans-serif;cursor:pointer}
#inbox-tabs button{background:#1d3b6b;border-color:#3fd0e8}#inbox-tabs button[aria-selected=true]{background:#3fd0e8;color:#0d1530}
#inbox-list button.grey{background:#7a7a7a;border-color:#555}
#inbox-note{min-height:1.2em;margin:8px 0 4px;color:#ffe08a}#inbox-note:empty{min-height:0;margin:4px 0}
#inbox-list{list-style:none;margin:0;padding:0 4px 0 0;overflow:auto;flex:1}
#inbox-list li{display:flex;gap:10px;align-items:center;margin:0 0 8px;padding:10px;border-radius:10px;background:rgba(10,20,50,.72);border:2px solid rgba(63,208,232,.25)}
#inbox-list li.new{border-color:#ffcc33;background:rgba(40,30,70,.85)}
#inbox-list li.empty{justify-content:center;color:#b9c9e8;font-style:italic}
#inbox-list .inbox-kind{width:44px;height:44px;object-fit:contain;flex:none}
#inbox-list .inbox-body{flex:1;min-width:0}#inbox-list strong{font:17px "MG VAG Bold",Arial,sans-serif;color:#ffcc33}
#inbox-list p{margin:2px 0 4px;color:#e9f1ff;font-size:14px;line-height:1.3}#inbox-list small{color:#9fb3d9;font-size:12px}
#inbox-list .inbox-item{display:inline-flex;align-items:center;gap:4px;margin:0 10px 4px 0;font-size:13px}#inbox-list .inbox-item img{width:26px;height:26px;object-fit:contain}
#inbox-list .inbox-actions{display:flex;flex-direction:column;gap:6px;flex:none}
#inbox-list .inbox-bubble{display:block;background:url("archive/images/message_icon.png") 50% 0/70% 200% no-repeat}
#inbox-list .inbox-moga img{width:34px;height:34px;border-radius:6px;background:#0d1530}

/* page background around the game (owner 2026-10-02): the original Message Center art from the game archive, shown only
   beside the stages (map, Home, battle, Dex and the panels keep their own opaque backgrounds) */
body{background:#142820 url("archive/images/message_center_bg_760x744.png") center/cover no-repeat fixed}

/* PvP panel (island / PVP menu) open: only the panel inside the map SWF answers clicks */
.pvp-modal-open #nodes,.pvp-modal-open #inbox-button,.pvp-modal-open #location{pointer-events:none!important}
#pvp-window{position:fixed;z-index:61;left:50%;top:50%;transform:translate(-50%,-50%);width:clamp(320px,56vw,720px);max-width:calc(100vw - 32px);max-height:80vh;overflow:auto;padding:28px 24px;border:4px solid #3fd0e8;border-radius:14px;background:#0d1530 url("archive/images/message_center_bg_760x744.png") center/cover;color:#fff;font-family:"MG VAG","Trebuchet MS",Arial,sans-serif;box-shadow:0 10px 40px rgba(0,0,0,.7)}
#pvp-window[hidden]{display:none}
#pvp-window h2{margin:0 44px 24px 0;font-size:26px;color:#baf3ff}
#pvp-close{position:absolute;right:10px;top:10px;width:44px;height:44px;padding:0;background:#183653;border:2px solid #3fd0e8;border-radius:50%;color:#fff;font:30px Arial,sans-serif}
.pvp-options{display:flex;gap:16px;flex-wrap:wrap}
.pvp-options button{flex:1;min-width:140px;padding:18px;border:2px solid #3fd0e8;border-radius:8px;background:#1d3b6b;color:#fff;font:20px "MG VAG Bold","MG VAG",Arial,sans-serif}
.pvp-options button:hover{background:#28578f}
#pvp-note{margin:24px 0 0;color:#fff4cf;font-size:16px}
.pvp-modal-open #input-block{background:rgba(0,0,0,.65);z-index:60}
.pvp-modal-open #inbox-button{z-index:43;opacity:1}
#pvp-window{min-height:440px}
#pvp-header{display:flex;align-items:center;gap:14px;padding-right:48px;margin-bottom:24px}
#pvp-header img{width:48px;height:56px;object-fit:contain;flex:none;image-rendering:pixelated}
#pvp-header h2{margin:0;font-size:28px}
#pvp-back{width:44px;height:44px;padding:0;min-height:44px;background:#183653;border:2px solid #3fd0e8;color:#fff;font:30px Arial,sans-serif}
#pvp-content button{font:19px "MG VAG Bold","MG VAG",Arial,sans-serif}
.pvp-leaderboards{width:100%;margin-bottom:24px;background:#465364;border-color:#6b7989;color:#c8d0dc}
.pvp-leaderboards:disabled{opacity:1}
.pvp-columns{display:grid;grid-template-columns:1fr 1fr;gap:24px}
.pvp-choice{text-align:center;padding:8px 12px 16px}
.pvp-choice+.pvp-choice,.pvp-room-side+.pvp-room-side{border-left:2px solid #3fd0e84d}
.pvp-art{height:160px;display:flex;align-items:center;justify-content:center;margin-bottom:18px}
.pvp-art img{height:150px;max-width:100%;object-fit:contain}
.pvp-art img.pvp-custom-icon{width:112px;height:112px;image-rendering:pixelated}
.pvp-choice button,.pvp-room-side button{width:100%;background:#2fb52a;border:2px solid #1d6b16;border-radius:8px;color:#fff}
.pvp-choice p,.pvp-room-side p{font-size:16px;color:#e9f1ff;line-height:1.4}
.pvp-room-side{padding:10px 8px}
.pvp-room-side h3{margin:0 0 16px;font-size:22px}
.pvp-room-code{padding:16px 8px;text-align:center;border:2px solid #3fd0e8;border-radius:8px;color:#becde2;background:#0b1835;font-size:17px}
.pvp-room-side input{width:100%;padding:14px 12px;border:2px solid #3fd0e8;border-radius:8px;background:#08162d;color:#fff;font:19px "MG VAG",Arial,sans-serif;text-transform:uppercase}
.pvp-room-side button{margin-top:12px}
#pvp-room-status{color:#ffe08a}
.pvp-search{text-align:center;padding:36px 0}
.pvp-search img{width:78px;height:78px;image-rendering:pixelated}
.pvp-search h3{font-size:26px;color:#baf3ff}
@media(max-width:540px){#pvp-window{padding:20px 16px;min-height:0}.pvp-columns{gap:10px}.pvp-art{height:120px}.pvp-art img{height:110px}.pvp-art img.pvp-custom-icon{width:90px;height:90px}#pvp-header h2{font-size:23px}.pvp-choice,.pvp-room-side{padding:8px}.pvp-choice p{font-size:14px}}

#pvp-window{scrollbar-width:none;-ms-overflow-style:none}
#pvp-window::-webkit-scrollbar{display:none}
#pvp-window{overflow:clip;min-height:0;max-height:none;padding:clamp(10px,3vh,28px) clamp(12px,2vw,24px);width:min(720px,calc(100vw - 24px))}
#pvp-header{margin-bottom:clamp(8px,2vh,24px)}
.pvp-leaderboards{margin-bottom:clamp(6px,2vh,24px)}
.pvp-art{height:clamp(48px,20vh,160px);margin-bottom:clamp(4px,1.5vh,18px)}
.pvp-art img{height:100%}
.pvp-art img.pvp-custom-icon{height:min(100%,112px);width:auto;max-height:100%}
.pvp-choice{padding:4px 8px}
.pvp-choice p,.pvp-room-side p{margin:6px 0;font-size:clamp(12px,2vh,16px)}
.pvp-search{padding:clamp(6px,3vh,36px) 0}
.pvp-search img{width:clamp(32px,12vh,78px);height:auto}
.pvp-search h3{margin:10px 0;font-size:clamp(18px,4vh,26px)}
.pvp-room-side{padding:4px}
.pvp-room-side h3{margin:0 0 8px;font-size:20px}
.pvp-room-code,.pvp-room-side input{padding:8px;font-size:16px}
.pvp-room-side button{margin-top:6px}
#pvp-room-status{margin:6px 0 0;font-size:14px}
@media(max-height:450px){#pvp-header img{width:36px;height:36px}#pvp-header h2{font-size:22px}.pvp-columns{gap:10px}#pvp-content button{font-size:16px}.pvp-choice p br{display:none}}

.arena-battle-active #inbox-button{pointer-events:auto;opacity:1}

.pvp-leaderboards:not(:disabled){background:#24577b;border:2px solid #3fd0e8;color:#fff;cursor:pointer}
#rank-window{position:fixed;z-index:61;left:50%;top:50%;transform:translate(-50%,-50%);width:min(720px,calc(100vw - 24px));box-sizing:border-box;padding:16px 20px;border:4px solid #3fd0e8;border-radius:14px;background:#0d1530 url("archive/images/message_center_bg_760x744.png") center/cover;color:#fff;font-family:"MG VAG",Arial,sans-serif;box-shadow:0 10px 40px rgba(0,0,0,.7);overflow:clip}
#rank-window[hidden]{display:none}
#rank-window button{font-family:"MG VAG Bold","MG VAG",Arial,sans-serif;color:#fff;background:#24577b;border:2px solid #3fd0e8;border-radius:6px;cursor:pointer}
#rank-window button:disabled{opacity:.4;cursor:default}
#rank-window button:focus-visible{outline:3px solid #ffe08a;outline-offset:2px}
#rank-window #rank-close{position:absolute;right:10px;top:10px;width:44px;height:44px;padding:0;background:#183653;border:2px solid #3fd0e8;border-radius:50%;color:#fff;font:30px Arial,sans-serif}
.rank-header{display:flex;align-items:center;gap:12px;padding-right:38px}
.rank-header h2{font:clamp(20px,3.7vh,28px) "MG VAG Bold","MG VAG",Arial,sans-serif;color:#baf3ff;margin:0}
#rank-window #rank-back{width:44px;height:44px;padding:0;background:#183653;flex:none}
.rank-season{display:flex;justify-content:space-between;margin:8px 0;color:#baf3ff;font-size:clamp(12px,2.2vh,16px)}
.rank-tabs{display:flex;gap:8px;margin-bottom:8px}
.rank-tabs button{flex:1;padding:6px;font-size:clamp(13px,2.5vh,18px)}
.rank-tabs button[aria-pressed="true"]{background:#2fb52a!important;border-color:#1d6b16!important}
.rank-table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0 3px;font-size:clamp(12px,2.4vh,17px)}
.rank-table th{color:#baf3ff;text-align:left;font-family:"MG VAG Bold","MG VAG",Arial,sans-serif;font-weight:normal}
.rank-table th:first-child{width:52px}.rank-table th:nth-last-child(-n+2){width:70px;text-align:center}
.rank-table td{background:rgba(8,22,45,.75);padding:2px 8px;height:clamp(18px,3.5vh,31px)}
.rank-table td:first-child{border-radius:6px 0 0 6px}.rank-table td:last-child{border-radius:0 6px 6px 0}
.rank-table td:nth-last-child(-n+2){text-align:center}
.rank-player{display:flex;align-items:center;gap:8px;min-width:0}
.rank-player img{width:clamp(18px,3.5vh,29px);height:clamp(18px,3.5vh,29px);object-fit:contain;flex:none}
.rank-player span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.rank-top-1{color:#ffe08a}.rank-top-2{color:#dce6f5}.rank-top-3{color:#edb995}
.rank-top-1 td{background:rgba(113,83,21,.45)}.rank-top-2 td{background:rgba(85,103,127,.45)}.rank-top-3 td{background:rgba(117,70,44,.45)}
.rank-me td{border-top:1px solid #3fd0e8;border-bottom:1px solid #3fd0e8}
.rank-pages{display:flex;align-items:center;justify-content:center;gap:16px;margin:6px 0;font-size:14px}
.rank-pages button{width:32px;height:28px;padding:0;font-size:22px}
#rank-window #rank-back,#rank-window #rank-prev,#rank-window #rank-next{display:inline-flex;align-items:center;justify-content:center;font-size:0;line-height:0}
#rank-back::before,#rank-prev::before,#rank-next::before{content:"";display:block;width:22px;height:22px;background:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 5L8.5 12l7 7' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
#rank-next::before{transform:rotate(180deg)}
.rank-own{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 10px;background:#15364b;border:2px solid #3fd0e8;border-radius:7px;font-size:clamp(12px,2.1vh,15px)}
.rank-own strong{font-family:"MG VAG Bold","MG VAG",Arial,sans-serif;font-weight:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rank-footnote,.rank-rules{font-size:clamp(11px,2vh,14px);line-height:1.4;text-align:center;margin:7px 0 0;color:#d7edf5}
.rank-rules{margin:10px 0}
.rank-rewards th{width:auto!important;text-align:center!important}.rank-rewards th img{width:clamp(26px,5vh,40px);height:clamp(26px,5vh,40px);object-fit:contain}
.rank-rewards td{text-align:center;height:clamp(24px,5vh,42px)}
.rank-empty{text-align:center!important;padding:20px!important}
@media(max-width:540px){#rank-window{padding:12px 10px}.rank-header{gap:7px}.rank-header h2{font-size:20px}.rank-table th:first-child{width:36px}.rank-table th:nth-last-child(-n+2){width:48px}.rank-table td{padding:2px 4px}.rank-player{gap:4px}.rank-own{flex-direction:column;gap:3px}.rank-table{font-size:13px}}
/* a Mastered location card has no progress bar or reward row: the SWF plate is 224px with GO at y 187 (Playtest #3 report) */
#location.mastered,#location.mastered #location-swf{height:225px;overflow:hidden}#location.mastered #card-go{top:188px}


.home-storage-open #home-stage{position:relative;z-index:43}
.home-storage-open #inbox-button{z-index:42;pointer-events:none}

.leaderboard-title-art{display:block;width:min(100%,255px);height:auto;margin-inline:auto}
.rank-header #rank-title{flex:1;min-width:0;padding-right:12px;box-sizing:border-box}
.pvp-leaderboards{padding-block:6px}
#pvp-header.pvp-menu-header{justify-content:center;padding-inline:44px;gap:10px}
#pvp-content .pvp-leaderboards{position:relative;display:block;width:min(100%,340px);margin:0 auto 24px;padding:8px 28px;border:2px solid #efa538;border-radius:5px;background:#102f3b;box-shadow:inset 0 -4px 0 #071d28;color:#fff;transition:background .15s,transform .15s}
.pvp-leaderboards::before,.pvp-leaderboards::after{content:"";position:absolute;top:calc(50% - 6px);width:12px;height:12px;background:#efa538;transform:rotate(45deg)}
.pvp-leaderboards::before{left:-7px}.pvp-leaderboards::after{right:-7px}
#pvp-content .pvp-leaderboards:hover{background:#184052;transform:translateY(-2px);border-color:#fff0ac}
#pvp-content .pvp-leaderboards:active{transform:translateY(1px)}
.pvp-mode-cards{gap:20px}
.pvp-mode-cards .pvp-choice{display:flex;flex-direction:column;align-items:center;padding:18px 16px 12px;border:1px solid #34788b;background:#0b2135}
.pvp-mode-cards .pvp-art{height:144px;width:100%;margin-bottom:14px}
.pvp-mode-cards .pvp-art img{width:128px;height:128px;object-fit:contain}
.pvp-mode-cards .pvp-art img.pvp-custom-icon{width:104px;height:104px;image-rendering:auto}
.pvp-mode-cards .pvp-choice button{min-height:44px;margin:0}
.pvp-mode-cards .pvp-choice p{min-height:44px;margin:10px 0 0}
@media(max-width:540px){#pvp-header.pvp-menu-header{padding-inline:40px;gap:6px}#pvp-header.pvp-menu-header h2{font-size:18px;text-align:center;min-width:0;max-width:190px}#pvp-header.pvp-menu-header img{width:28px;height:34px}#pvp-content .pvp-leaderboards{width:min(100%,280px);padding:5px 18px;margin-bottom:18px}.pvp-mode-cards{gap:12px}.pvp-mode-cards .pvp-choice{padding:12px 8px}.pvp-mode-cards .pvp-art{height:104px;margin-bottom:10px}.pvp-mode-cards .pvp-art img{width:96px;height:96px}.pvp-mode-cards .pvp-art img.pvp-custom-icon{width:80px;height:80px}.pvp-mode-cards .pvp-choice p{font-size:13px;min-height:54px}}
@media(prefers-reduced-motion:reduce){#pvp-content .pvp-leaderboards{transition:none}#pvp-content .pvp-leaderboards:hover{transform:none}}

#account-contact label{display:grid;gap:6px}#account-email{width:100%;box-sizing:border-box;padding:8px;border:2px solid #f6941d;border-radius:6px;background:#2b0505;color:white;font:inherit}#account-contact button{margin-top:8px;padding:8px 14px;background:#149c36;border:2px solid #7fe29a;border-radius:7px;color:white;font:inherit;cursor:pointer}#account-contact-note{min-height:1.3em;color:#ffe08a}

.profile-avatar{display:flex;flex-direction:column;align-items:center;gap:8px;flex-shrink:0}
#profile-change,#account-password button{padding:8px 12px;background:#149c36;border:2px solid #7fe29a;border-radius:7px;color:white;font:inherit;cursor:pointer}
#account-contact,#account-password{display:grid;gap:10px;margin-top:18px}
#account-password{padding-top:16px;border-top:1px solid #a44836}
#account-contact label,#account-password label{display:grid;gap:6px}
#account-contact input,#account-password input{width:100%;min-width:0;box-sizing:border-box;padding:8px;border:2px solid #f6941d;border-radius:6px;background:#2b0505;color:white;font:inherit}
#account-contact button,#account-password button{justify-self:start;margin:0}
#account-contact-note,#account-password-note,#profile-picker-note{min-height:1.3em;margin:0;color:#ffe08a}
#profile-picker{width:min(440px,calc(100vw - 32px));max-height:calc(100vh - 48px);box-sizing:border-box;padding:20px 22px;background:#5c0b0b;border:4px solid #f6941d;border-radius:14px;color:white;font:15px/1.35 "MG VAG","Trebuchet MS",Arial,sans-serif}
#profile-picker::backdrop{background:rgba(0,0,0,.65)}
#profile-picker h2{margin:0 28px 12px 0;color:#ffcc33;font-family:"MG VAG Bold","MG VAG",Arial,sans-serif;font-weight:normal}
#profile-picker #profile-choices{max-height:300px;margin-bottom:10px}
#profile-choices button:focus-visible,#profile-change:focus-visible{outline:3px solid white;outline-offset:2px}
#settings-window button:disabled{opacity:.65;cursor:wait}

#account-username{display:grid;gap:10px;margin-top:18px}
#account-username label{display:grid;gap:6px}
#account-username-input{width:100%;min-width:0;box-sizing:border-box;padding:8px;border:2px solid #f6941d;border-radius:6px;background:#2b0505;color:white;font:inherit}
#account-username-save{justify-self:start;padding:8px 12px;background:#149c36;border:2px solid #7fe29a;border-radius:7px;color:white;font:inherit;cursor:pointer}
#account-username-note{min-height:1.3em;margin:0;color:#ffe08a}
#account-username-rule{margin:0}

.settings-server-buttons{display:flex;flex-wrap:wrap;align-items:center;gap:10px}#set-beta{padding:8px 16px;border:2px solid #45c5dc;border-radius:8px;background:#143448;color:#fff;font:inherit;font-weight:bold;cursor:pointer}#set-beta:disabled{opacity:.4;cursor:not-allowed}

.pvp-arena-options .pvp-choice{display:flex;flex-direction:column;align-items:stretch;text-align:center}
.pvp-arena-options .pvp-choice h3{margin:12px 0 20px}
.pvp-arena-options .pvp-choice p{display:grid;gap:5px;margin:0 0 16px}
.pvp-arena-options .pvp-choice p span{display:block}
.pvp-arena-options .pvp-choice button{margin-top:auto}
@media(max-width:700px){.pvp-arena-options{grid-template-columns:1fr}.pvp-arena-options .pvp-choice+.pvp-choice{border-left:0;border-top:2px solid #3fd0e84d}.pvp-arena-options .pvp-choice p{font-size:13px}}

:root{--stage-w:min(calc(100vw - 136px),calc((100vh - 16px) * 760 / 660))}
.pvp-arena-options{position:relative;gap:32px}
.pvp-arena-options::before{content:"";position:absolute;left:50%;top:0;bottom:0;width:2px;transform:translateX(-50%);background:#3fd0e84d}
.pvp-arena-options .pvp-choice+.pvp-choice{border:0}
@media(max-width:700px){.pvp-arena-options::before{display:none}.pvp-arena-options .pvp-choice+.pvp-choice{border-top:2px solid #3fd0e84d}:root{--stage-w:min(calc(100vw - 128px),calc((100vh - 16px) * 760 / 660))}}
@media(max-width:560px){#map{width:var(--stage-w);height:var(--stage-h);margin:0 auto}#map-viewport{overflow:hidden;max-height:none}}

#battle-view:not([hidden]):not(.preparing){position:fixed;left:50%;top:8px;transform:translateX(-50%);width:var(--stage-w);z-index:30}
