/* ── 통일 게임 결과 모달 ── */
.game-result-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(20, 16, 12, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.game-result-modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 결과 모달 위에 오답 복습 상세를 겹쳐 표시 */
#gameResultReviewModal {
  z-index: 11100;
}

.game-result-card {
  width: min(100%, 400px);
  max-height: min(92vh, 640px);
  overflow-y: auto;
  border-radius: 16px;
  background: #fffbf7;
  border: 2px solid rgba(139, 94, 60, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  padding: 1.35rem 1.4rem 1.4rem;
}

.game-result-title {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: #4a3428;
}

.game-result-sub {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: #6b5a4a;
  line-height: 1.45;
}

.game-result-score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.game-result-score-box {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(139, 94, 60, 0.08);
  border: 1px solid rgba(139, 94, 60, 0.15);
}

.game-result-score-box--highlight {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

.game-result-score-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #8b7355;
  margin-bottom: 0.2rem;
}

.game-result-score-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: #4a3428;
  line-height: 1.1;
}

.game-result-rank-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: #f5f0eb;
  font-size: 0.85rem;
  color: #666;
}

.game-result-rank-row span {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.game-result-rank-badge {
  font-weight: 700;
  color: #8b5e3c;
}

.game-result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.game-result-btn {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.game-result-btn--primary {
  background: linear-gradient(180deg, #8b5e3c 0%, #734e32 100%);
  color: #fff;
}

.game-result-btn--secondary {
  background: #fff;
  border: 1px solid rgba(139, 94, 60, 0.35);
  color: #5c4033;
}

.game-result-btn--muted {
  background: transparent;
  border: 1px solid rgba(139, 94, 60, 0.2);
  color: #888;
}

/* 서바이벌 HUD */
.ex4-escape-scene-wrap,
.ex4-villain-portrait {
  display: none !important;
}

.survival-hud {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(139, 94, 60, 0.2);
  font-size: 0.88rem;
  font-weight: 700;
  color: #4a3428;
  white-space: nowrap;
  flex-shrink: 0;
}

.survival-hud.is-visible {
  display: inline-flex;
}

.survival-hud__lives {
  color: #dc2626;
}

.survival-hud__score {
  color: #8b5e3c;
}

.golden-answer-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.golden-answer-type-btn {
  flex: 1;
  min-width: 7rem;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  border: 2px solid rgba(139, 94, 60, 0.25);
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.golden-answer-type-btn.active {
  background: linear-gradient(135deg, #8b5e3c, #a67c52);
  border-color: transparent;
  color: #fff;
}
