/* Picture Perfect menu and modal. */
#uaGamesPanel[hidden], .pp-dialog[hidden], .pp-dialog [hidden] { display: none !important; }
html body #uaExplorePanel #uaGamesPanel {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  padding: 16px 18px 24px;
  color: #f7fbff;
}
#uaGamesPanel h2 { margin: 0 0 8px; color: #a2d3ff; }
#uaGamesPanel label { display: block; margin: 12px 0 5px; font-weight: 700; }
#uaGamesPanel select {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #75bdff66;
  border-radius: 8px;
  background: #10243b;
  color: #fff;
  color-scheme: dark;
  font: inherit;
}
#uaGamesPanel > button {
  margin-top: 18px;
  width: 100%;
  min-height: 44px;
  border: 1px solid #75bdff;
  border-radius: 10px;
  background: #165887;
}
#uaExplorePanel .ua-explore-section:last-child:nth-child(7) { grid-column: 1 / -1; }
body.ua-picture-perfect-open { overflow: hidden; }
.pp-dialog {
  position: fixed;
  inset: 0;
  z-index: 50000;
  box-sizing: border-box;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #081422;
  color: #f7fbff;
  font: 15px/1.45 Arial, sans-serif;
}
.pp-dialog button, .pp-dialog a {
  box-sizing: border-box;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #75bdff66;
  border-radius: 9px;
  background: #12314c;
  color: #f7fbff;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.pp-dialog button:focus-visible, .pp-dialog a:focus-visible { outline: 3px solid #ffd37b; outline-offset: -3px; }
.pp-dialog button:disabled { cursor: default; }
.pp-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; max-width: 1440px; margin: auto; }
.pp-title { flex: 1; min-width: 180px; margin: 0 8px; font-size: 19px; color: #a2d3ff; }
.pp-status { max-width: 1440px; margin: 12px auto; min-height: 22px; color: #b9d1e8; }
.pp-area { max-width: 1440px; margin: auto; display: grid; grid-template-columns: minmax(0, 3fr) minmax(210px, 1fr); gap: 18px; align-items: start; }
.pp-board { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #102236; border: 1px solid #75bdff77; border-radius: 8px; overflow: hidden; }
.pp-board::before { content: ""; display: block; padding-top: 75%; }
.pp-board > canvas, .pp-preview, .pp-grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.pp-preview { opacity: .48; object-fit: contain; }
.pp-grid { display: grid; }
.pp-grid button { min-height: 0; padding: 0; border: 1px dashed #75bdff22; border-radius: 0; background: transparent; touch-action: manipulation; }
.pp-grid button:disabled { border-color: transparent; }
.pp-tray-wrap { min-width: 0; }
.pp-tray-wrap h3 { margin: 0 0 8px; font-size: 15px; color: #a2d3ff; }
.pp-tray { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; max-height: 68vh; overflow-y: auto; padding: 8px; background: #0c1d30; border-radius: 10px; }
.pp-dialog .pp-piece { padding: 3px; min-width: 0; min-height: 44px; border-color: transparent; background: #112940; touch-action: none; }
.pp-piece canvas { display: block; width: 100%; height: auto; pointer-events: none; }
.pp-dialog .pp-piece[aria-pressed="true"] { border-color: #ffd37b; background: #24405b; }
.pp-ghost { position: fixed; z-index: 1; pointer-events: none; transform: translate(-50%, -50%); opacity: .9; }
.pp-complete { max-width: 1440px; margin: 20px auto 0; padding: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border: 1px solid #ffd37b77; border-radius: 10px; background: #1b2c38; }
.pp-complete strong { color: #ffd37b; font-size: 22px; margin-right: auto; }
@media (max-width: 700px) {
  .pp-area { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pp-title { order: -1; flex-basis: 100%; margin: 0 0 4px; font-size: 16px; }
  .pp-tray { grid-template-columns: repeat(4, minmax(0, 1fr)); max-height: 30vh; gap: 8px; }
  .pp-dialog { font-size: 13px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .pp-area { grid-template-columns: minmax(0, 3fr) minmax(170px, 2fr); max-width: 850px; }
  .pp-tray { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 62vh; }
}

.pp-countdown { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; background: #081422ed; color: #cce8ff; font-size: clamp(18px, 3vw, 32px); text-align: center; }
.pp-countdown strong { font-size: clamp(64px, 12vw, 140px); line-height: 1; color: #fff; text-shadow: 0 0 30px #63baff88; }
.pp-status.pp-urgent { color: #ffd37b; font-weight: bold; }
