/* Native app link in the menu on the map and player pages. */
html[data-theme] #world .shell nav .face-paint-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: none;
  white-space: nowrap;
  font: 12px/1.3 var(--desktop-font);
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--paper-text);
  min-height: 26px;
  text-decoration: none;
}
html[data-theme] #world .shell nav .face-paint-link img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
html[data-theme] #world .shell nav .face-paint-link:hover {
  background: var(--paper-panel);
  border-color: var(--desktop-rim);
}
html[data-theme] #world .shell nav .face-paint-link:focus-visible {
  outline: 2px solid var(--paper-accent);
  outline-offset: -2px;
}
@media (max-width: 620px) {
  html[data-theme] #world .shell nav {
    min-width: 0;
    overflow-x: auto;
  }
  html[data-theme] #world .shell nav .face-paint-link {
    font-size: 10px;
    padding: 3px 5px;
    min-height: 44px;
  }
}

/* Paint keeps XP chrome inside the site's window manager. The extra id wins over the
   desktop's global Aqua titlebar and phone control rules, including their !important resets. */
html[data-theme] #world #home #desk-face-paint {
  left: max(16px, calc(50% - 530px));
  top: 90px;
  width: min(1060px, calc(100vw - 40px));
  height: min(720px, calc(100dvh - 190px));
  max-width: calc(100vw - 16px);
  min-width: 0;
  min-height: 0;
  max-height: calc(100dvh - 100px);
  box-sizing: border-box;
  padding: 3px;
  border: 1px solid #0845c4;
  border-radius: 8px 8px 0 0;
  background: #0054e3;
  box-shadow: 3px 4px 12px #0006;
  overflow: hidden;
  outline: 0;
  rotate: none;
}
html[data-theme] #world #home #desk-face-paint:not([hidden]) {
  display: flex;
  flex-direction: column;
}
html[data-theme] #world #home #desk-face-paint > .desktop-titlebar {
  position: relative;
  display: flex;
  flex: 0 0 30px;
  flex-direction: row;
  gap: 5px;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 2px 3px;
  border: 0;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(#3492ff 0%, #0865ed 12%, #0054e3 85%, #0349cc 100%) !important;
  box-shadow: none;
  filter: none;
  color: white;
}
html[data-theme] #world #home #desk-face-paint:not(.is-front) > .desktop-titlebar {
  background: linear-gradient(#83a9e4, #628bd4) !important;
}
html[data-theme] #world #home #desk-face-paint .window-grab {
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;
  flex: 1;
  order: 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0 4px;
  color: white;
  background: none;
  border: 0;
  border-radius: 0;
  /* The site pins its own control font with !important; Paint keeps the XP family. */
  font: bold 13px/1.2 Tahoma, Verdana, sans-serif !important;
  text-shadow: 1px 1px #17478c;
  text-align: left;
}
html[data-theme] #world #home #desk-face-paint .window-grab img { width: 16px; height: 16px; flex: none; }
html[data-theme] #world #home #desk-face-paint .window-grab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-theme] #world #home #desk-face-paint > .desktop-titlebar > div {
  position: static;
  display: flex;
  flex: none;
  flex-direction: row;
  order: 1;
  align-items: center;
  gap: 2px;
  height: auto;
  top: auto;
  left: auto;
  translate: none;
}
html[data-theme] #world #home #desk-face-paint > .desktop-titlebar > div > button {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 23px !important;
  height: 23px !important;
  min-width: 23px !important;
  min-height: 23px !important;
  padding: 0;
  border: 1px solid white;
  border-radius: 3px;
  background: linear-gradient(135deg, #68a6ff, #2467df 50%, #0643bc);
  color: white;
  font: bold 20px/1 Arial, sans-serif !important;
  text-shadow: 1px 1px #163a78;
  box-shadow: inset 1px 1px #ffffff70;
  opacity: 1;
  transform: none;
  cursor: pointer;
}
html[data-theme] #world #home #desk-face-paint > .desktop-titlebar > div > [data-close-window] {
  background: linear-gradient(135deg, #f5ad8a, #d6472d 50%, #b51a12);
}
html[data-theme] #world #home #desk-face-paint > .desktop-titlebar > div > button::before,
html[data-theme] #world #home #desk-face-paint > .desktop-titlebar > div > button::after { display: none; content: none; }
html[data-theme] #world #home #desk-face-paint > .desktop-titlebar > div > button:hover { filter: brightness(1.15); }
html[data-theme] #world #home #desk-face-paint > .desktop-titlebar > div > button:focus-visible,
html[data-theme] #world #home #desk-face-paint .window-grab:focus-visible { outline: 1px dotted white; outline-offset: -4px; }
html[data-theme] #world #home #desk-face-paint > .desktop-window-body {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #ece9d8;
  padding: 0;
}
html[data-theme] #world #home #desk-face-paint iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1;
  border: 0;
  background: #ece9d8;
}
html[data-theme] #world #home #desk-face-paint.is-dragging iframe { pointer-events: none; }
html[data-theme] #world #home #desk-face-paint.face-paint-maximized {
  position: fixed;
  left: var(--face-paint-max-left, 8px) !important;
  top: var(--face-paint-max-top, 8px) !important;
  right: auto;
  bottom: auto;
  width: var(--face-paint-max-width, calc(100vw - 16px)) !important;
  height: var(--face-paint-max-height, calc(100dvh - 100px)) !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
}
html[data-theme] #world #home #desk-face-paint.face-paint-maximized .window-grab { cursor: default; }
@media (max-width: 620px) {
  html[data-theme] #world #home .mobile-desktop #desk-face-paint:not(.face-paint-maximized) {
    left: 0;
    top: 0;
    width: calc(100vw - 16px);
    height: min(650px, var(--mobile-window-height, calc(100dvh - 100px)));
    max-height: var(--mobile-window-height, calc(100dvh - 100px));
  }
  html[data-theme] #world #home #desk-face-paint > .desktop-titlebar { flex-basis: 36px; height: 36px !important; min-height: 36px !important; }
  html[data-theme] #world #home #desk-face-paint > .desktop-titlebar > div > button { width: 30px !important; height: 30px !important; min-width: 30px !important; min-height: 30px !important; }
}
