/* Layout only; all panel and button pixels come from preserved native artwork. */
.native-ui #modal.realm-modal .realm-panel :is(.realm-ranking,.realm-achievement,.realm-offer,.realm-starter).native-panel{background-image:var(--native-panel-image)!important}
.realm-panel .realm-ranking{padding-top:24px;padding-bottom:24px}
.realm-chat-launcher{position:fixed;z-index:64;right:calc(env(safe-area-inset-right) + 14px);bottom:calc(env(safe-area-inset-bottom) + 14px);width:44px;height:44px;padding:5px;border:0;background:var(--native-button) center/100% 100% no-repeat;image-rendering:pixelated;cursor:pointer}
.realm-chat-launcher[hidden]{display:none!important}.realm-chat-launcher img{width:100%;height:100%;object-fit:contain;image-rendering:pixelated}
/* The global launcher remains available in gameplay; modal surfaces own their
   full reading area and expose their own close/back controls. */
body:has(#overlay:not([hidden])) .realm-chat-launcher,body:has(#modal:not([hidden])) .realm-chat-launcher{visibility:hidden;pointer-events:none}
body.boot-active .realm-chat-launcher{z-index:540}
.in-game .realm-chat-launcher{position:static;flex:0 0 44px;width:44px;height:44px;align-self:center}
.in-game .game-actions{align-items:center}
.realm-chat-launcher:focus-visible{outline:2px solid #e7d78e;outline-offset:3px}
.native-ui #modal.realm-modal .modal-panel{width:min(680px,calc(100vw - 32px));max-height:calc(100dvh - 30px)}
.realm-panel{display:grid;gap:12px;min-width:0;line-height:1.4;color:#e8e2c8}
.realm-panel>img{width:84px;height:84px;object-fit:contain;justify-self:center;image-rendering:pixelated}
.realm-tabs{display:flex;gap:6px;flex-wrap:wrap}.realm-tabs button{flex:1 1 130px}
.realm-panel button{min-height:48px;min-width:0;height:auto;padding:12px 26px;line-height:1.3;white-space:normal;overflow-wrap:anywhere;border:0!important;border-radius:0!important;box-shadow:none!important;background:var(--native-button) center/100% 100% no-repeat!important;color:#eee2bc;font:inherit;cursor:pointer}
.realm-panel button:disabled{opacity:1;color:#cbded2;cursor:default}.realm-panel .realm-tabs button[aria-pressed=true]{background-image:var(--native-selected)!important;color:#fff2bd}.realm-note,.realm-status{margin:0;font-size:15px;line-height:1.4;overflow-wrap:anywhere}.realm-status{color:#ffe5a3}
.realm-chat-log{height:clamp(110px,32dvh,310px);overflow-y:auto;overflow-x:hidden;padding:10px 14px;border:14px solid transparent;border-image:url('assets/ui/arena-jade-quiet.png') 40 95 fill / 14px 29px / 0 stretch;scrollbar-gutter:stable;box-sizing:border-box;image-rendering:pixelated}
.realm-chat-log p{margin:0 0 9px;overflow-wrap:anywhere;font-size:16px;line-height:1.4}.realm-chat-log strong{color:#8ce5d5}
.realm-chat-form,.realm-offer-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;min-width:0}.realm-chat-form label{grid-column:1/-1}.realm-chat-form input,.realm-panel select{min-width:0;width:100%;box-sizing:border-box;min-height:56px;font:inherit;font-size:16px;color:#eee6c9;background:none;border:9px solid transparent;border-image:url('assets/ui/arena-jade-quiet.png') 40 95 fill / 9px 24px / 0 stretch;border-radius:0;box-shadow:none;padding:8px 18px;image-rendering:pixelated}.realm-chat-form button{min-width:100px}.realm-panel input:focus,.realm-panel select:focus{outline:2px solid #c2d88d;outline-offset:2px}
.realm-choice-summary{display:block;max-width:100%;color:#d3dcc3;font-size:13px;line-height:1.4;overflow-wrap:anywhere}
.realm-offer-form{grid-template-columns:minmax(0,1fr)}.realm-offer-form label{font-size:15px}.realm-offers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.realm-offer{display:grid;justify-items:center;gap:6px;padding:24px 26px;background:var(--native-card) center/100% 100% no-repeat;min-width:0;text-align:center}.realm-offer img{width:48px;height:48px;object-fit:contain;image-rendering:pixelated}.realm-offer strong,.realm-offer span,.realm-offer small{overflow-wrap:anywhere;max-width:100%}.realm-offer strong{font-size:17px}.realm-offer span{font-size:15px}.realm-offer small{font-size:13px;color:#b6cebf}.realm-offer button{width:100%}.realm-account{color:#97efda;font-size:18px;min-height:44px;padding:12px}
@media(max-width:500px){.realm-chat-form{grid-template-columns:minmax(0,1fr)}.realm-chat-form button{width:100%}.realm-offers{grid-template-columns:minmax(0,1fr)}.realm-tabs button{flex-basis:100px;padding:12px 20px}.realm-chat-log{padding:14px 16px}.realm-panel{gap:9px}.realm-note{font-size:14px}.realm-chat-log p{font-size:15px}}
@media(max-width:900px){.in-game .game-screen:has(.game-actions .realm-chat-launcher:not([hidden])) .experience-controls{top:104px}}
@media(max-width:900px){.in-game:not(.touch-ui):has(.game-actions .realm-chat-launcher:not([hidden])) #online-status{top:144px}}
@media(max-height:500px) and (orientation:landscape){.realm-chat-log{height:120px}.realm-modal .modal-panel{max-height:calc(100dvh - 16px)}.realm-panel{gap:8px}.realm-chat-form{grid-template-columns:minmax(0,1fr) auto}}
.realm-starters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;min-width:0}
.realm-enrollment{display:grid;gap:9px;min-width:0}.realm-enrollment input{min-width:0;width:100%;box-sizing:border-box;min-height:56px;font:inherit;font-size:17px;color:#eee6c9;background:none;border:9px solid transparent;border-image:url('assets/ui/arena-jade-quiet.png') 40 95 fill / 9px 24px / 0 stretch;border-radius:0;box-shadow:none;padding:8px 18px;image-rendering:pixelated}
.realm-panel .realm-starter{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:178px;padding:24px 20px;background:var(--native-card) center/100% 100% no-repeat!important}
.realm-panel .realm-starter[aria-pressed=true]{background-image:var(--native-selected)!important}
.realm-starter img{width:64px;height:64px;object-fit:contain;image-rendering:pixelated}.realm-starter strong{font-size:17px;line-height:1.2;max-width:100%;overflow-wrap:anywhere}.realm-starter small{font-size:12px;line-height:1.25}
.realm-rank-controls{display:flex;gap:6px;flex-wrap:wrap}.realm-rank-controls button{flex:1 1 130px}.realm-rank-controls button[aria-pressed=true]{background-image:var(--native-selected)!important}
.realm-rank-list{display:grid;gap:8px;margin:0;padding:0;list-style:none;min-width:0}.realm-ranking{display:grid;grid-template-columns:40px minmax(0,1fr);gap:5px 10px;min-width:0;padding:18px 28px;background:var(--native-card) center/100% 100% no-repeat;image-rendering:pixelated}.realm-ranking[data-mine=true]{background-image:var(--native-selected)}.realm-rank-position{grid-row:1/3;align-self:center;color:#f4d790;font-size:18px}.realm-ranking strong{font-size:17px;overflow-wrap:anywhere;line-height:1.3}.realm-rank-score,.realm-ranking small{font-size:13px;line-height:1.3;overflow-wrap:anywhere}.realm-ranking small{grid-column:2;color:#bdeba4}
.realm-achievements{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;min-width:0}.realm-achievement{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:0;padding:25px 28px;background:var(--native-card) center/100% 100% no-repeat;image-rendering:pixelated;overflow-wrap:anywhere}.realm-achievement[data-unlocked=true]{background-image:var(--native-selected)}.realm-achievement img{width:36px;height:36px;object-fit:contain;image-rendering:pixelated}.realm-achievement strong{font-size:17px;line-height:1.25}.realm-achievement p{font-size:14px;line-height:1.4;margin:0}.realm-achievement small{font-size:13px;color:#d1e5ba}
.native-ui .game-selection[data-selection-mode=idle] .roster-heading{height:auto;min-height:32px;flex-wrap:wrap}.native-ui .game-selection[data-selection-mode=idle] .roster-panel{grid-template-rows:auto minmax(0,1fr) auto}.native-ui .game-selection[data-selection-mode=idle] .roster-heading h2{font-size:19px;line-height:1.25}.native-ui .game-selection[data-selection-mode=idle] .search-field{display:none}
.native-ui #lobby .game-selection[data-selection-mode=idle] #roster{gap:8px;align-items:center}
.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card{height:min(300px,100%);gap:10px;padding:28px 20px!important;background:none!important;overflow:visible}
.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card:is(.selected,:hover,:focus-visible){background:none!important}
.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card img{width:clamp(48px,8vw,120px);height:clamp(48px,8vw,120px);max-height:50%;max-width:100%;border-radius:0}
.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card strong,.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card small{display:block!important;max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.25;text-align:center}
.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card strong{font-size:21px}.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card small{font-size:13px}.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .card-number{position:static;font-size:12px}
@media(max-width:600px){.realm-starters{grid-template-columns:1fr}.realm-panel .realm-starter{min-height:132px;display:grid;grid-template-columns:64px minmax(0,1fr);text-align:left;padding:22px 28px}.realm-starter img{grid-row:1/3}.realm-starter small{align-self:start}.realm-starter strong{align-self:end}.realm-achievements{grid-template-columns:1fr}.realm-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.realm-tabs button{padding:14px 18px;font-size:15px}.realm-ranking{padding:22px 25px}.native-ui #lobby .game-selection[data-selection-mode=idle] #roster{grid-template-columns:1fr;grid-template-rows:repeat(3,minmax(0,1fr));gap:6px}.native-ui #lobby .game-selection[data-selection-mode=idle] #roster:has(>.pokemon-card:only-child){grid-template-rows:1fr}.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card{height:100%;display:grid;grid-template-columns:56px minmax(0,1fr);grid-template-rows:auto auto;gap:2px 10px;padding:20px 24px!important}.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card img{grid-column:1;grid-row:1/3;width:56px;height:56px;max-height:100%}.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card strong{grid-column:2;font-size:18px;align-self:end}.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card small{grid-column:2;font-size:12px;align-self:start}.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .card-number{display:none}}
@media(max-height:500px) and (min-width:601px){.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card{padding:18px 20px!important;gap:5px}.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card strong{font-size:17px}.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card small{font-size:11px}}
@media(max-width:600px){.native-ui #lobby .game-selection[data-selection-mode=idle] #roster{grid-template-rows:repeat(3,minmax(112px,1fr));overflow-y:auto!important;overscroll-behavior:contain;scrollbar-gutter:stable}.native-ui #lobby .game-selection[data-selection-mode=idle] #roster:has(>.pokemon-card:only-child){grid-template-rows:minmax(112px,1fr)}.native-ui #lobby .game-selection[data-selection-mode=idle] #roster .pokemon-card{min-height:112px}}
.realm-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.realm-tabs button{padding:14px 22px;font-size:15px}
@media(max-width:600px){.realm-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}.realm-tabs button{padding:14px 18px}}
@media(max-width:400px){.realm-tabs{grid-template-columns:1fr}}
.native-ui #lobby .game-selection[data-selection-mode=idle] .local-favorite-selected{display:none!important}
.realm-market-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.realm-market-modes button[aria-pressed=true]{background-image:var(--native-selected)!important}
.realm-world{display:grid;grid-template-columns:32px minmax(0,1fr);align-items:center;gap:8px 10px;padding:12px 28px;background:none;border:20px solid transparent;border-image:url('assets/ui/arena-jade-quiet.png') 40 95 fill / 20px 40px / 0 stretch;image-rendering:pixelated;min-width:0;overflow-wrap:anywhere}.realm-world>img{width:32px;height:32px;object-fit:contain;image-rendering:pixelated}.realm-world>strong{font-size:19px;line-height:1.2}.realm-world-counts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;grid-column:1/-1}.realm-world-counts>div{display:flex;flex-direction:column;gap:4px;min-width:0}.realm-world-counts strong{font-size:23px;color:#f5d58d;line-height:1.2}.realm-world-counts span,.realm-world>small{font-size:12px;line-height:1.35}.realm-world>small{grid-column:1/-1;color:#c5d9c3}
.realm-sale-form{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;min-width:0}.realm-sale-form input{min-width:0;width:100%;box-sizing:border-box;min-height:56px;font:inherit;font-size:17px;color:#eee6c9;background:none;border:9px solid transparent;border-image:url('assets/ui/arena-jade-quiet.png') 40 95 fill / 9px 24px / 0 stretch;border-radius:0;box-shadow:none;padding:8px 18px;image-rendering:pixelated}.realm-sale-form input:read-only{opacity:.65}.realm-sale p{margin:0;font-size:13px;line-height:1.4;overflow-wrap:anywhere}
@media(max-width:500px){.realm-market-modes{grid-template-columns:1fr}.realm-world-counts{grid-template-columns:1fr;gap:8px}.realm-world-counts>div{display:grid;grid-template-columns:64px minmax(0,1fr);align-items:center}.realm-world{padding:12px 20px}}
