/* v2.20.6 — one final responsive contract for the in-game HUD and heavy windows. */

.world-minimap-weather-v2206 {
  --weather-ink:#ffe172;
  --weather-fill:rgba(255,209,73,.22);
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  flex:0 0 24px;
  border-radius:8px;
  color:var(--weather-ink);
  background:color-mix(in srgb,var(--weather-ink) 10%,transparent);
}
.world-minimap-weather-v2206 .weather-icon-v2206 { display:block;width:21px;height:21px;overflow:visible; }
.world-minimap-weather-v2206 .weather-icon-v2206 path,
.world-minimap-weather-v2206 .weather-icon-v2206 circle {
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.world-minimap-weather-v2206 .weather-icon-v2206 .weather-fill { fill:var(--weather-fill); }
.world-minimap-weather-v2206 .weather-icon-v2206 .weather-bolt { fill:#ffd54f;stroke:#ffd54f; }
.world-minimap-weather-v2206[data-weather="cloud"] { --weather-ink:#d8edf5;--weather-fill:rgba(216,237,245,.16); }
.world-minimap-weather-v2206[data-weather="rain"] { --weather-ink:#77d5ff;--weather-fill:rgba(119,213,255,.15); }
.world-minimap-weather-v2206[data-weather="storm"] { --weather-ink:#a7bbff;--weather-fill:rgba(167,187,255,.14); }
.world-minimap-weather-v2206[data-weather="snow"] { --weather-ink:#eafcff;--weather-fill:rgba(234,252,255,.14); }
.world-minimap-weather-v2206[data-weather="wind"] { --weather-ink:#c6eef2;--weather-fill:transparent; }
.world-minimap-weather-v2206[data-weather="fog"] { --weather-ink:#cfdee3;--weather-fill:transparent; }
.world-minimap-weather-v2206[data-weather="motes"] { --weather-ink:#ffe581;--weather-fill:rgba(255,229,129,.18); }
.world-minimap-weather-v2206[data-weather="indoor"] { --weather-ink:#9fe0ff;--weather-fill:rgba(159,224,255,.12); }

@media (min-width:761px) {
  .game-screen {
    --world-hud-width:clamp(286px,17vw,324px)!important;
    --world-hud-map-height:clamp(184px,11vw,210px)!important;
    --world-hud-gap:10px!important;
  }
  .game-screen .world-minimap {
    top:max(14px,env(safe-area-inset-top))!important;
    right:max(14px,env(safe-area-inset-right))!important;
    width:var(--world-hud-width)!important;
    height:var(--world-hud-map-height)!important;
    grid-template-rows:32px minmax(0,1fr) 34px!important;
    border-radius:18px!important;
  }
  .game-screen .world-minimap-topbar { min-height:32px!important;padding-inline:11px 9px!important;border-radius:18px 18px 0 0!important; }
  .game-screen .world-minimap-place b { font-size:9.5px!important; }
  .game-screen .world-minimap-topbar time { min-width:34px!important;font-size:8.5px!important; }
  .game-screen .world-minimap-server-meta { gap:4px!important; }
  .game-screen .world-minimap-weather-v2206 { width:22px;height:22px;flex-basis:22px;border-radius:7px; }
  .game-screen .world-minimap-weather-v2206 .weather-icon-v2206 { width:19px;height:19px; }
  .game-screen .world-minimap-map-surface,
  .game-screen .world-minimap-frame { width:100%!important;height:auto!important;min-height:0!important; }
  .game-screen .world-minimap-bottombar { min-height:34px!important;border-radius:0 0 18px 18px!important; }
  .game-screen .world-minimap-channel,
  .game-screen .world-minimap-ping { height:33px!important;min-height:33px!important; }
  .game-screen .world-minimap-channel { padding-inline:9px!important;border-radius:0 0 0 18px!important; }
  .game-screen .world-minimap-channel-menu { top:calc(100% + 6px)!important; }

  .game-screen #questWidget.quest-widget-list-v87,
  .game-screen #questWidget.quest-widget-list-v87.is-collapsed {
    top:calc(max(14px,env(safe-area-inset-top)) + var(--world-hud-map-height) + var(--world-hud-gap))!important;
    right:max(14px,env(safe-area-inset-right))!important;
    width:var(--world-hud-width)!important;
    max-width:var(--world-hud-width)!important;
    border-radius:17px!important;
  }
  .game-screen #questWidget.quest-widget-list-v87:not(.is-collapsed) { max-height:min(270px,calc(100dvh - var(--world-hud-map-height) - 132px))!important; }
  .game-screen #questWidget.quest-widget-list-v87:not(.is-collapsed)>.quest-tracker-head-v57 { min-height:42px!important;padding:7px 9px!important; }
  .game-screen #questWidget.quest-widget-list-v87:not(.is-collapsed)>.quest-tracker-list-v57 { max-height:226px!important; }
  .game-screen #questWidget.quest-widget-list-v87:not(.is-collapsed) .quest-tracker-row-v57 {
    grid-template-columns:28px minmax(0,1fr) 58px!important;
    gap:8px!important;
    min-height:78px!important;
    padding:8px 8px 11px!important;
  }
  .game-screen #questWidget.quest-widget-list-v87 .quest-tracker-row-v57>.quest-type-graphic-v61 { width:28px!important;height:28px!important; }
  .game-screen #questWidget.quest-widget-list-v87 .quest-tracker-row-v57>span>small { font-size:7.5px!important; }
  .game-screen #questWidget.quest-widget-list-v87 .quest-tracker-row-v57>span>b { font-size:12px!important;line-height:1.2!important; }
  .game-screen #questWidget.quest-widget-list-v87 .quest-tracker-row-v57>span>em { font-size:9.5px!important;line-height:1.3!important; }
  .game-screen #questWidget.quest-widget-list-v87 .quest-tracker-row-v57>span>u { font-size:8.5px!important; }
  .game-screen #questWidget.quest-widget-list-v87 .quest-tracker-choice-v62>strong { font-size:11px!important; }
  .game-screen #questWidget.quest-widget-list-v87 .quest-tracker-choice-v62 {
    display:grid!important;
    grid-template-columns:25px 25px!important;
    align-content:start!important;
    justify-content:end!important;
    gap:4px!important;
    height:auto!important;
  }
  .game-screen #questWidget.quest-widget-list-v87 .quest-tracker-choice-v62>strong { grid-column:1/-1;width:auto!important;text-align:right!important; }
  .game-screen #questWidget.quest-widget-list-v87 .quest-primary-badge-v62 { display:none!important; }
  .game-screen #questWidget.quest-widget-list-v87 .quest-tracker-choice-v62>button { min-width:25px!important;min-height:25px!important;padding:4px!important; }
  .game-screen #questWidget.quest-widget-list-v87.is-collapsed { height:56px!important;max-height:56px!important; }

  /* The three most frequently opened windows appear immediately at the visual centre. */
  html .game-screen #sidePanel.side-panel.is-open:is(.is-inventory-panel,.is-pokedex-panel,.is-pokedex-detail,.is-team-panel,.is-pokemon-detail-panel) {
    left:50%!important;
    top:50%!important;
    right:auto!important;
    bottom:auto!important;
    margin:0!important;
    transform:translate(-50%,-50%)!important;
    transform-origin:center!important;
    transition:none!important;
    animation:none!important;
    will-change:auto!important;
  }
  html .game-screen #sidePanel.side-panel.is-open.is-inventory-panel { width:min(1080px,calc(100vw - 64px))!important;height:min(720px,calc(100dvh - 112px))!important; }
  html .game-screen #sidePanel.side-panel.is-open.is-pokedex-panel { width:min(1080px,calc(100vw - 64px))!important;height:min(720px,calc(100dvh - 112px))!important; }
  html .game-screen #sidePanel.side-panel.is-open:is(.is-pokedex-detail,.is-pokemon-detail-panel) { width:min(860px,calc(100vw - 64px))!important;height:min(700px,calc(100dvh - 112px))!important; }
  html .game-screen #sidePanel.side-panel.is-open.is-team-panel { width:min(720px,calc(100vw - 64px))!important;height:min(520px,calc(100dvh - 112px))!important; }
  html .game-screen #sidePanel.side-panel.is-open:is(.is-inventory-panel,.is-pokedex-panel,.is-pokedex-detail,.is-team-panel,.is-pokemon-detail-panel) #sidePanelContent {
    overscroll-behavior:contain;
  }

  /* Messenger stays useful without covering half of a laptop screen. */
  html .game-screen #chatPanel.chat-panel.chat-messenger:not(.is-minimized) {
    left:clamp(12px,var(--chat-x,16px),calc(100vw - 616px))!important;
    top:clamp(58px,var(--chat-y,72px),calc(100dvh - 516px))!important;
    width:min(600px,calc(100vw - 32px))!important;
    height:min(500px,calc(100dvh - 116px))!important;
    min-width:min(500px,calc(100vw - 32px))!important;
    min-height:min(390px,calc(100dvh - 116px))!important;
    max-width:600px!important;
    max-height:500px!important;
    transition:none!important;
  }
  html .game-screen #chatPanel.chat-panel.chat-messenger.is-minimized {
    left:max(14px,env(safe-area-inset-left))!important;
    bottom:max(14px,env(safe-area-inset-bottom))!important;
    width:300px!important;
    min-width:300px!important;
    max-width:300px!important;
    height:50px!important;
    min-height:50px!important;
    max-height:50px!important;
    border-radius:15px!important;
    transition:none!important;
  }
  html .game-screen #chatPanel.is-minimized>.chat-head { min-height:48px!important;padding:6px 7px 6px 11px!important; }
  html .game-screen #chatPanel.is-minimized .chat-title-copy>b { font-size:13px!important; }
  html .game-screen #chatPanel.is-minimized .chat-title-copy>small { display:none!important; }
  html .game-screen #chatPanel.is-minimized .chat-title-icon { width:23px!important;height:23px!important; }
  html .game-screen #chatPanel.is-minimized .chat-head-actions>button { width:32px!important;height:32px!important; }
  html .game-screen #chatPanel.is-minimized .chat-head-actions>button::before { content:none!important;display:none!important; }
  html .game-screen #chatPanel.is-minimized .chat-head-actions .ui-icon { display:block!important;width:16px!important;height:16px!important; }

  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .player-chip {
    width:356px!important;min-width:356px!important;min-height:104px!important;
    grid-template-columns:66px minmax(0,1fr)!important;gap:11px!important;padding:10px 13px 10px 10px!important;
  }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .player-chip-avatar { width:64px!important;height:64px!important; }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .player-chip-progress { grid-template-columns:68px minmax(0,1fr) 59px!important;gap:7px!important; }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .player-stamina-hud,
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .party-hud[data-count="1"]+.player-stamina-hud,
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .party-hud[data-count="2"]+.player-stamina-hud {
    top:calc(max(14px,env(safe-area-inset-top)) + 112px + var(--hud70-party-offset,0px))!important;
    width:356px!important;min-width:356px!important;min-height:50px!important;
    grid-template-columns:140px minmax(0,1fr)!important;gap:9px!important;padding:6px 12px 6px 9px!important;
  }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .party-hud { top:calc(max(14px,env(safe-area-inset-top)) + 112px)!important; }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .desktop-dock {
    --desktop-action-size:70px!important;--desktop-action-height:74px!important;
    grid-template-columns:repeat(5,70px)!important;gap:8px!important;
  }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .desktop-dock button {
    width:70px!important;min-width:70px!important;max-width:70px!important;height:74px!important;min-height:74px!important;
    grid-template-rows:41px auto!important;padding:6px 5px 7px!important;
  }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .desktop-dock button>span { width:40px!important;height:40px!important; }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .desktop-dock button>b { font-size:9.5px!important; }
}

@media (min-width:2200px) and (min-height:1200px) {
  .game-screen { --world-hud-width:348px!important;--world-hud-map-height:232px!important;--world-hud-gap:12px!important; }
}

@media (min-width:761px) and (max-width:1500px),
       (min-width:761px) and (max-height:900px) {
  .game-screen { --world-hud-width:286px!important;--world-hud-map-height:178px!important;--world-hud-gap:8px!important; }
  html .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .world-minimap { top:max(14px,env(safe-area-inset-top))!important;right:max(14px,env(safe-area-inset-right))!important;grid-template-rows:29px minmax(0,1fr) 31px!important; }
  .game-screen .world-minimap-topbar { min-height:29px!important; }
  .game-screen .world-minimap-bottombar,
  .game-screen .world-minimap-channel,
  .game-screen .world-minimap-ping { min-height:31px!important;height:30px!important; }
  .game-screen #questWidget.quest-widget-list-v87,
  .game-screen #questWidget.quest-widget-list-v87.is-collapsed { top:calc(max(14px,env(safe-area-inset-top)) + var(--world-hud-map-height) + var(--world-hud-gap))!important;right:max(14px,env(safe-area-inset-right))!important; }
  .game-screen #questWidget.quest-widget-list-v87:not(.is-collapsed) { max-height:min(220px,calc(100dvh - var(--world-hud-map-height) - 104px))!important; }
  .game-screen #questWidget.quest-widget-list-v87:not(.is-collapsed)>.quest-tracker-list-v57 { max-height:178px!important; }
  .game-screen #questWidget.quest-widget-list-v87:not(.is-collapsed) .quest-tracker-row-v57 { min-height:70px!important;padding-block:7px 9px!important; }
  html .game-screen #chatPanel.chat-panel.chat-messenger:not(.is-minimized) { width:min(540px,calc(100vw - 28px))!important;height:min(450px,calc(100dvh - 100px))!important;min-width:min(470px,calc(100vw - 28px))!important;min-height:min(350px,calc(100dvh - 100px))!important;max-width:540px!important;max-height:450px!important; }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .player-chip { width:318px!important;min-width:318px!important;min-height:96px!important;grid-template-columns:60px minmax(0,1fr)!important; }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .player-chip-avatar { width:58px!important;height:58px!important; }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .player-stamina-hud,
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .party-hud[data-count="1"]+.player-stamina-hud,
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .party-hud[data-count="2"]+.player-stamina-hud { top:calc(max(10px,env(safe-area-inset-top)) + 104px + var(--hud70-party-offset,0px))!important;width:318px!important;min-width:318px!important; }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .party-hud { top:calc(max(10px,env(safe-area-inset-top)) + 104px)!important; }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .desktop-dock { --desktop-action-size:62px!important;--desktop-action-height:67px!important;grid-template-columns:repeat(5,62px)!important;gap:6px!important; }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .desktop-dock button { width:62px!important;min-width:62px!important;max-width:62px!important;height:67px!important;min-height:67px!important;grid-template-rows:36px auto!important;padding:5px 4px 6px!important; }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .desktop-dock button>span { width:35px!important;height:35px!important; }
  .game-screen[data-main-hud="v70"][data-hud-revision="v71"] .desktop-dock button>b { font-size:8.5px!important; }
  html .game-screen #sidePanel.side-panel.is-open:is(.is-inventory-panel,.is-pokedex-panel) { width:min(960px,calc(100vw - 48px))!important;height:min(620px,calc(100dvh - 92px))!important; }
}

/* During combat the collapsed messenger becomes one clear, clickable chat button. */
@media (min-width:761px) {
  body.is-battling .game-screen #chatPanel.chat-panel.chat-messenger.is-minimized {
    left:max(12px,env(safe-area-inset-left))!important;
    right:auto!important;
    top:auto!important;
    bottom:max(12px,env(safe-area-inset-bottom))!important;
    width:48px!important;min-width:48px!important;max-width:48px!important;
    height:48px!important;min-height:48px!important;max-height:48px!important;
    overflow:hidden!important;border-radius:15px!important;
    opacity:1!important;visibility:visible!important;pointer-events:auto!important;z-index:244!important;
  }
  body.is-battling .game-screen #chatPanel.is-minimized>.chat-head { display:grid!important;grid-template-columns:1fr!important;place-items:center!important;min-height:46px!important;padding:0!important;cursor:pointer!important; }
  body.is-battling .game-screen #chatPanel.is-minimized .chat-title-copy { display:grid!important;place-items:center!important; }
  body.is-battling .game-screen #chatPanel.is-minimized .chat-title-copy>b { display:grid!important;place-items:center!important;width:46px!important;height:46px!important;font-size:0!important; }
  body.is-battling .game-screen #chatPanel.is-minimized .chat-title-icon { display:grid!important;width:24px!important;height:24px!important;margin:0!important; }
  body.is-battling .game-screen #chatPanel.is-minimized .chat-title-icon .ui-icon { width:22px!important;height:22px!important; }
  body.is-battling .game-screen #chatPanel.is-minimized .chat-title-copy>small,
  body.is-battling .game-screen #chatPanel.is-minimized .chat-head-actions { display:none!important; }
  body.is-battling .game-screen #chatPanel.chat-panel.chat-messenger.is-open:not(.is-minimized) {
    left:12px!important;right:auto!important;top:58px!important;bottom:auto!important;
    width:min(500px,calc(100vw - 24px))!important;height:min(460px,calc(100dvh - 116px))!important;
    min-width:min(460px,calc(100vw - 24px))!important;min-height:min(350px,calc(100dvh - 116px))!important;
    max-width:500px!important;max-height:460px!important;z-index:244!important;
  }
}

@media (max-width:760px) {
  .world-minimap { width:88px!important;height:88px!important; }
  .world-topbar { right:max(100px,calc(env(safe-area-inset-right) + 96px))!important; }
  .player-chip { width:min(164px,calc(100vw - 104px))!important; }
  .game-screen #questWidget.quest-widget-list-v87:not(.is-collapsed) { top:max(101px,calc(env(safe-area-inset-top) + 96px))!important;max-height:min(300px,calc(100dvh - 210px))!important; }
  .game-screen #questWidget.quest-widget-list-v87.is-collapsed { top:max(100px,calc(env(safe-area-inset-top) + 94px))!important;right:max(16px,calc(env(safe-area-inset-right) + 11px))!important; }
  html .game-screen #sidePanel.side-panel.is-open:is(.is-inventory-panel,.is-pokedex-panel,.is-pokedex-detail,.is-team-panel,.is-pokemon-detail-panel) {
    top:max(7px,env(safe-area-inset-top))!important;
    right:7px!important;
    bottom:calc(94px + env(safe-area-inset-bottom))!important;
    left:7px!important;
    width:auto!important;
    height:auto!important;
    max-width:none!important;
    max-height:none!important;
    transform:none!important;
    transition:none!important;
    animation:none!important;
  }
  body.is-battling .game-screen #chatPanel.chat-panel.chat-messenger.is-open:not(.is-minimized) {
    top:auto!important;right:6px!important;bottom:calc(94px + env(safe-area-inset-bottom))!important;left:6px!important;
    width:auto!important;height:min(62dvh,520px)!important;min-height:300px!important;max-height:min(62dvh,520px)!important;
    border-radius:18px!important;z-index:244!important;transition:none!important;
  }
}

@media (max-width:430px) {
  .world-minimap { width:82px!important;height:82px!important; }
  .world-topbar { right:max(93px,calc(env(safe-area-inset-right) + 89px))!important; }
  .player-chip { width:min(158px,calc(100vw - 97px))!important; }
  .game-screen #questWidget.quest-widget-list-v87:not(.is-collapsed) { top:max(94px,calc(env(safe-area-inset-top) + 89px))!important; }
  .game-screen #questWidget.quest-widget-list-v87.is-collapsed { top:max(92px,calc(env(safe-area-inset-top) + 87px))!important; }
}

@media (prefers-reduced-motion:reduce) {
  html .game-screen #sidePanel.side-panel,
  html .game-screen #chatPanel.chat-panel { transition:none!important;animation:none!important; }
}
