/* Picture quiz player: same frame as the hangman and scramble players (title, instruction, progress, one card). */

main.player-main {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 32px;
  box-sizing: border-box;
}

.lh-player {
  width: 100%;
  margin: 0 auto;
  color: #212529;
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.lh-player *,
.lh-player *::before,
.lh-player *::after { box-sizing: border-box; }

.lh-player [hidden] { display: none !important; }

.lh-player h1 {
  margin: 0;
  padding: 8px 0 4px;
  color: #212529;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
}

.player-instruction { margin: 0 0 8px; color: #212529; }

.player-progress { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 6px 0; }
.progress-track { flex: 1; height: 6px; overflow: hidden; border-radius: 99px; background: #e8f2ff; }
.progress-fill { width: 0; height: 100%; background: #1875d0; transition: width 200ms ease; }
#pqLabel { min-width: 3.5em; color: #495057; font-size: 14px; font-weight: 600; text-align: right; }

.lh-player button { width: auto; height: auto; margin: 0; font-family: inherit; line-height: 1.2; box-shadow: none; transform: none; }

.lh-player .text-link,
.lh-player .text-link:hover {
  padding: 8px;
  border: 0;
  background: transparent;
  color: #1875d0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.lh-player .text-link:hover { text-decoration: underline; }
.lh-player .text-link:disabled { color: #adb5bd; cursor: default; text-decoration: none; }

.pq-message { margin: 24px 0; color: #6c757d; }

.pq-card {
  padding: 20px 24px;
  border: 1px solid #e2e6ea;
  border-radius: 12px;
  background: #fff;
}

.pq-stage { display: flex; align-items: center; gap: 8px; }

.lh-player .pq-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #ced4da;
  border-radius: 50%;
  background: #fff;
  color: #1875d0;
  cursor: pointer;
}
.lh-player .pq-nav:hover:not(:disabled) { background: #f4f8fc; border-color: #1875d0; }
.lh-player .pq-nav:focus-visible { outline: 2px solid #1875d0; outline-offset: 2px; }
.lh-player .pq-nav:disabled { color: #ced4da; cursor: default; }

.lh-player .pq-pic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 200px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #f8f9fa;
  cursor: zoom-in;
}

.lh-player .pq-pic:focus-visible { outline: 2px solid #1875d0; outline-offset: 2px; }

.pq-pic img {
  display: block;
  max-width: 100%;
  max-height: min(48vh, 420px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.pq-form { display: flex; gap: 10px; margin: 16px 0 0; }

.pq-form input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  background: #fff;
  color: #212529;
  font-family: inherit;
  font-size: 18px;
  width: auto;
}

.pq-form input[type="text"]:focus { outline: none; border-color: #1875d0; box-shadow: 0 0 0 3px rgba(24, 117, 208, 0.25); }
.pq-form input[type="text"].is-wrong { border-color: #c0392b; animation: pqShake 300ms ease; }
.pq-form input[type="text"].is-right { border-color: #2e8b57; background: #f1faf4; }
.pq-form input[type="text"][readonly] { color: #212529; }

.lh-player .pq-primary,
.lh-player .pq-primary:hover {
  min-width: 112px;
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: #1875d0;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.lh-player .pq-primary:hover { background: #135ba2; }
.lh-player .pq-primary:focus-visible { outline: 2px solid #1875d0; outline-offset: 2px; }

.pq-feedback { min-height: 1.45em; margin: 12px 0 0; color: #495057; font-weight: 600; }
.pq-feedback.is-right { color: #146c3a; }
.pq-feedback.is-wrong { color: #c0392b; }

.pq-actions { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 0; }
.pq-done .pq-actions { justify-content: space-between; flex-direction: row-reverse; margin-top: 16px; }

.pq-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Results ---------- */
.pq-done h2 { margin: 0 0 4px; font-size: 24px; font-weight: 700; color: #212529; }
.pq-score { margin: 0 0 16px; color: #495057; font-weight: 600; }
.pq-results { margin: 0; padding: 0; list-style: none; border-top: 1px solid #e9ecef; }
.pq-results li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid #e9ecef; }
.pq-results img { flex: 0 0 auto; width: 72px; height: 54px; object-fit: cover; border-radius: 6px; background: #f1f3f5; }
.pq-results .pq-r-word { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.pq-results .pq-r-state { flex: 0 0 auto; font-size: 14px; font-weight: 600; }
.pq-results .is-ok { color: #146c3a; }
.pq-results .is-shown { color: #6c757d; }

/* ---------- Enlarged picture ---------- */
#pqLightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
  cursor: zoom-out;
}
#pqLightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; }

@keyframes pqShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@media (prefers-reduced-motion: reduce) {
  .pq-form input[type="text"].is-wrong { animation: none; }
  .progress-fill { transition: none; }
}

@media (max-width: 480px) {
  .pq-card { padding: 14px; }
  .pq-stage { gap: 4px; }
  .lh-player .pq-nav { width: 34px; height: 34px; }
  .lh-player h1 { font-size: 26px; }
  .pq-form { flex-direction: column; }
  .lh-player .pq-primary { width: 100%; }
  .pq-pic img { max-height: 40vh; }
}
