.pg-hud{
  margin: 10px 0 14px;
  display: flex;
  justify-content: center;
}

.pg-hearts{
  display: flex;
  gap: 8px;
  font-size: 22px;
  line-height: 1;
}

.pg-photo{
  width: min(420px, 92vw);
  aspect-ratio: 1 / 1;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: #e5e7eb;
  border: 1px solid #e5e7eb;

  /* 背景图显示题面 */
  background-image: none;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: cover; /* 第1步先整图显示 */
}

.pg-input-row{
  justify-content: center;
}

.pg-input-row input{
  max-width: 420px;
}

.pg-overlay{
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.pg-overlay-text{
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px 20px;
  font-weight: 700;
  color: #111827;
}

.pg-overlay[hidden] {
  display: none !important;
}

.header{
  text-align: center;
}
.header a{
  display: inline-block; 
  margin-top: 6px;
}

.pg-autocomplete{
  position: relative;
  width: min(420px, 92vw);
}

.pg-autocomplete input{
  width: 100%;
}

.pg-suggestions{
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  padding: 6px;
  margin: 0;
  list-style: none;
  z-index: 50;
  max-height: 240px;
  overflow: auto;
}

.pg-suggestions li{
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.pg-suggestions li:hover{
  background: #f3f4f6;
}

/* ==难度提升 Toast */
.difficulty-toast{
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 1000;

  padding: 16px 22px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(17,24,39,0.88);
  color: white;

  font-weight: 900;
  font-size: 28px;
  letter-spacing: 1px;

  pointer-events: none;
  opacity: 0;
}

.difficulty-toast[hidden]{
  display: none !important;
}

.difficulty-toast.show{
  animation: difficultyPop 1000ms ease-out both;
}

@keyframes difficultyPop{
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.78); filter: blur(2px); }
  18%  { opacity: 1; transform: translate(-50%, -50%) scale(1.06); filter: blur(0); }
  55%  { opacity: 1; transform: translate(-50%, -50%) scale(1.00); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
}

/* 左右按钮 中间图片布局  */
.pg-arena{
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  gap: 14px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.pg-choices{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pg-choice-btn{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #111827;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.pg-choice-btn:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.pg-choice-btn:disabled{
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

/* 反馈按钮变色 */
.pg-choice-btn.correct{
  background: var(--ok);
}

.pg-choice-btn.wrong{
  background: var(--bad);
}

/* 小屏适配 */
@media (max-width: 820px){
  .pg-arena{
    grid-template-columns: 1fr;
  }
  .pg-choices{
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .pg-choice-btn{
    width: calc(50% - 10px);
  }
}

/* ===== 结算页 Overlay ===== */
.pg-end{
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 18px;
}

.pg-end[hidden]{ display:none !important; }

.pg-end-card{
  width: min(920px, 96vw);
  max-height: min(86vh, 900px);
  overflow: auto;
  background: rgba(255,255,255,0.96);
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 18px 18px 16px;
}

.pg-end-title{
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  color: #111827;
}

.pg-mistakes{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pg-mistake{
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 10px;
  text-align: center;
}

.pg-mistake img{
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain; /* 原图完整显示 */
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.pg-mistake-name{
  margin-top: 8px;
  font-weight: 800;
  color: #111827;
}

.pg-end-actions{
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.pg-score{
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #d1d5db;
  text-align: center;
}

.pg-score-title{
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 900;
}

.pg-score-tier{
  font-weight: 800;
}

.pg-score-msg{
  margin: 6px 0 0;
  color: #374151;
  font-weight: 700;
}

/* 小屏：错题改成 1 列 */
@media (max-width: 720px){
  .pg-mistakes{ grid-template-columns: 1fr; }
}

/* ===== 截图海报卡（更大、更炫） ===== */
.pg-poster{
  width: min(820px, 96vw);
  padding: 26px 24px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 18px 60px rgba(0,0,0,0.25);
  text-align: center;
}

.pg-poster-score{
  font-size: 44px;
  font-weight: 1000;
  letter-spacing: 1px;
  margin-top: 4px;
}

.pg-poster-tier{
  font-size: 34px;
  font-weight: 950;
  margin-top: 10px;
}

.pg-poster-msg{
  margin: 12px auto 0;
  max-width: 34em;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
  opacity: 0.95;
}

.pg-poster-footer{
  margin-top: 18px;
  font-weight: 850;
  font-size: 13px;
  opacity: 0.82;
}

/* 主题 */
.pg-poster.theme-newbie{
  background: linear-gradient(135deg, #f9ed08, #f68b08);
  color: #e5e7eb;
}
.pg-poster.theme-rookie{
  background: linear-gradient(135deg, #60a5fa, #22c55e);
  color: #052012;
}
.pg-poster.theme-entry{
  background: linear-gradient(135deg, #f6fa8b, #3af429);
  color: #0b1020;
}
.pg-poster.theme-skilled{
  background: linear-gradient(135deg, #2feb9a, #2ccff7);
  color: #1a0b05;
}
.pg-poster.theme-pro{
  background: linear-gradient(135deg, #ff89d0, #b773e4);
  color: #ffffff;
}
.pg-poster.theme-master{
  background: linear-gradient(135deg, #000000, #111827);
  color: #f9fafb;
}

.pg-score{
  border-top: none;
  padding-top: 0;
}

/* 结算页 */
.pg-end-card.show-score-only .pg-end-title,
.pg-end-card.show-score-only .pg-mistakes,
.pg-end-card.show-score-only #endContinueBtn,
.pg-end-card.show-score-only #endContinueBtn.parentNode {
  display: none !important;
}

.pg-end-card.show-score-only .pg-end-actions:has(#endContinueBtn){
  display: none !important;
}

.pg-end-card.show-score-only{
  max-height: none;
  overflow: visible;
  padding-top: 28px;
}

.pg-end-card.show-score-only .pg-score{
  margin-top: 0;
}

.pg-end-card.show-score-only{
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  max-height: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pg-end-card.show-score-only .pg-poster{
  margin: 0 auto;
}




