/* v11: readable source selection, six real levels and comfortable touch targets. */
#pexefy .pxf-ready h3 {
  text-align: center;
  margin-top: 26px;
}
#pexefy .pxf-ready-note {
  text-align: center;
  color: #527064;
  font:
    14px/1.5 Nunito,
    system-ui;
  margin: 4px 0 19px;
}
#pexefy .pxf-ready-art img {
  object-fit: cover;
  border-radius: 12px;
  height: 154px;
}
#pexefy .pxf-art span {
  font:
    800 14px/1.4 Nunito,
    system-ui;
  letter-spacing: 0;
  color: #315b62;
}
#pexefy .pxf-ready-gallery {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
#pexefy .pxf-resume {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  flex-wrap: wrap;
  max-width: 100%;
  font-size: 15px;
}
#pexefy .pxf-resume img {
  height: 65px;
  width: 90px;
  object-fit: cover;
  border-radius: 8px;
}
#pexefy .pxf-resume span {
  display: flex;
  flex-direction: column;
  text-align: left;
  max-width: 240px;
  line-height: 1.5;
}
#pexefy .pxf-resume small {
  font:
    600 12px Nunito,
    system-ui;
}
#pexefy .pxf-counts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}
#pexefy .pxf-counts button {
  min-height: 80px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 28px !important;
  gap: 5px;
  padding: 9px;
}
#pexefy .pxf-counts small {
  font:
    700 12px/1.2 Nunito,
    system-ui;
  max-width: 100%;
  overflow-wrap: anywhere;
}
@media (max-width: 1000px) {
  #pexefy .pxf-ready-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  #pexefy .pxf-ready-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #pexefy .pxf-ready-art img {
    height: 120px;
  }
  #pexefy .pxf-art span {
    font-size: 12px;
  }
  #pexefy .pxf-counts {
    gap: 8px;
  }
  #pexefy .pxf-counts button {
    min-height: 74px !important;
    font-size: 25px !important;
  }
  #pexefy .pxf-counts small {
    font-size: 10px;
  }
  #pexefy .pxf-resume {
    font-size: 14px;
    padding: 14px;
    gap: 9px;
  }
  #pexefy .pxf-resume img {
    height: 51px;
    width: 70px;
  }
  #pexefy .pxf-resume span {
    max-width: 165px;
  }
}
/* Critical play pass: stable controls, large mobile tray, explicit assistance and durable finish. */
#pexefy .pxf-play-toolbar {
  gap: 8px;
}
#pexefy .pxf-play-toolbar > button {
  flex-shrink: 0;
  min-height: 44px;
}
#pexefy .pxf-progress {
  display: grid;
  grid-template-columns: auto 90px;
  gap: 3px 10px;
  max-width: 240px;
  min-width: 85px;
}
#pexefy .pxf-playing-title {
  grid-column: 1/-1;
  font:
    700 12px/1.3 Nunito,
    system-ui;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
#pexefy .pxf-progress strong {
  font-size: 18px;
}
#pexefy .pxf-progress progress {
  width: 90px;
  align-self: center;
}
#pexefy .pxf-progress strong {
  min-width: 0;
}
#pexefy .pxf-board [data-target].pxf-hint-target > path {
  fill: #f4c95e66;
  stroke: #0b8b9a;
  stroke-width: 4px;
  stroke-dasharray: 8 5;
}
#pexefy .pxf-piece {
  min-height: 44px !important;
}
#pexefy .pxf-board g:focus-visible > path {
  stroke: #0b8296;
  stroke-width: 4px;
}
#pexefy .pxf-paging button {
  min-height: 44px !important;
  height: 44px;
}
#pexefy .pxf-play-foot {
  min-height: 48px;
  line-height: 1.3;
}
#pexefy .pxf-save {
  min-height: 44px !important;
  overflow-wrap: anywhere;
  max-width: 42%;
  line-height: 1.3;
}
#pexefy .pxf-status {
  white-space: normal;
  font-size: 12px;
  line-height: 1.3;
  padding: 5px 10px;
}
#pexefy[open] {
  grid-template-rows: 68px minmax(0, 1fr) minmax(28px, auto);
}
#pexefy[data-screen="play"] .pxf-content {
  grid-template-rows: 72px minmax(0, 1fr) 52px;
}
#pexefy .pxf-confirm,
#pexefy .pxf-win {
  position: fixed;
  margin: 0;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  border: 1px solid #c5ba8e;
  border-image: none;
  background: #fffaf0;
  border-radius: 23px;
  max-height: 92dvh;
  overflow-y: auto;
  max-width: calc(100vw - 28px);
  box-shadow: 0 18px 80px #163e5577;
  color: #315664;
}
#pexefy .pxf-confirm::backdrop,
#pexefy .pxf-win::backdrop {
  background: #173f5c88;
  backdrop-filter: blur(3px);
}
#pexefy .pxf-confirm h2 {
  font-size: 25px;
  line-height: 1.2;
}
#pexefy .pxf-confirm p {
  font:
    15px/1.6 Nunito,
    system-ui;
}
#pexefy .pxf-win .pxf-star {
  font-size: 34px;
}
#pexefy .pxf-finished-picture {
  display: block;
  width: 100%;
  height: min(27dvh, 230px);
  object-fit: contain;
  border-radius: 12px;
  margin: 14px 0;
}
#pexefy .pxf-win h2 {
  font-size: 30px !important;
}
#pexefy .pxf-win p {
  font:
    14px/1.5 Nunito,
    system-ui;
}
#pexefy .pxf-storage-retry {
  display: block;
  margin: 8px auto;
  min-height: 44px;
  padding: 10px 20px;
}
@media (max-width: 1000px) {
  #pexefy .pxf-play-toolbar > button {
    padding: 7px 14px;
  }
  #pexefy .pxf-playing-title {
    max-width: 140px;
  }
  #pexefy .pxf-progress {
    grid-template-columns: auto;
  }
  #pexefy .pxf-progress progress {
    display: none;
  }
}
@media (max-width: 700px) {
  #pexefy[open] {
    grid-template-rows: 58px minmax(0, 1fr) minmax(28px, auto);
  }
  #pexefy[data-screen="play"] .pxf-content {
    grid-template-rows: 88px minmax(0, 1fr) 54px;
  }
  #pexefy .pxf-play-toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 3px 5px;
    min-width: 0;
  }
  #pexefy .pxf-progress {
    grid-column: 1/-1;
    display: flex;
    max-width: none;
    align-items: center;
    gap: 10px;
    margin: 0;
    justify-content: space-between;
  }
  #pexefy .pxf-playing-title {
    max-width: 70%;
    font-size: 12px;
  }
  #pexefy .pxf-progress strong {
    font-size: 14px;
  }
  #pexefy .pxf-play-toolbar > button {
    padding: 5px !important;
    min-height: 44px;
    font-size: 10px !important;
    white-space: normal;
    line-height: 1.2;
    min-width: 0;
  }
  #pexefy .pxf-reference-thumb {
    width: 100%;
    height: 33px;
    max-width: 60px;
  }
  #pexefy .pxf-reference {
    justify-content: center;
  }
  #pexefy .pxf-workspace {
    grid-template-rows: minmax(0, 1fr) 224px;
  }
  #pexefy .pxf-tray {
    grid-template-rows: 40px minmax(0, 1fr) 44px;
    gap: 3px;
  }
  #pexefy .pxf-pieces {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }
  #pexefy .pxf-tray-top button {
    min-height: 40px !important;
  }
  #pexefy .pxf-play-foot {
    font-size: 10px;
  }
  .pxf-help {
    max-width: 58%;
  }
}
@media (max-height: 550px) and (min-width: 701px) {
  #pexefy[open] {
    grid-template-rows: 48px minmax(0, 1fr) minmax(26px, auto);
  }
  #pexefy[data-screen="play"] .pxf-content {
    grid-template-rows: 55px minmax(0, 1fr) 48px;
  }
  #pexefy .pxf-play-toolbar {
    gap: 5px;
  }
  #pexefy .pxf-pieces {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
}
#pexefy .pxf-pieces {
  grid-template-rows: repeat(var(--pxf-tray-rows, 4), minmax(0, 1fr));
}
/* Keep selected difficulty unmistakable under the shared hub skin. */
body.hatchling-v2 #pexefy.pxf .pxf-counts button[aria-pressed="true"] {
  background: #21616b;
  color: #fff9e7 !important;
  border: 2px solid #286c73;
  box-shadow: 0 0 0 3px #beded1;
}
body.hatchling-v2 #pexefy.pxf .pxf-piece[aria-pressed="true"] {
  background: #428b8b88;
  border: 2px solid #267c87;
  box-shadow: 0 0 0 2px #ffe4a7;
}
