.portfolio-game-nav {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 10000;
  display: flex;
  gap: 0.5rem;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.portfolio-game-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(130, 111, 89, 0.35);
  border-radius: 999px;
  color: #675747;
  background: rgba(250, 247, 239, 0.88);
  box-shadow: 0 4px 18px rgba(49, 39, 29, 0.1);
  backdrop-filter: blur(10px);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.challenge-choice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.challenge-btn {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding: 0.7rem 1.25rem;
  border: 2px solid #8c6b45;
  border-radius: 4px;
  color: #6f5236;
  background: rgba(247, 244, 237, 0.65);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.challenge-btn:hover {
  color: #fffaf0;
  background: #8c6b45;
  transform: translateY(-2px);
}

.challenge-btn small {
  margin-top: 0.2rem;
  font-family: Georgia, serif;
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.12em;
}

.challenge-hud {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  z-index: 9998;
  display: flex;
  gap: 1rem;
  align-items: center;
  min-height: 42px;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(179, 80, 75, 0.4);
  border-radius: 999px;
  color: #4a3b32;
  background: rgba(250, 247, 239, 0.92);
  box-shadow: 0 7px 24px rgba(52, 40, 28, 0.14);
  backdrop-filter: blur(10px);
  font-family: "Noto Serif SC", serif;
  transform: translateX(-50%);
}

.challenge-hud strong {
  color: #b3504b;
  font-family: ui-monospace, monospace;
  font-size: 1rem;
}

.challenge-hud span {
  color: #756657;
  font-size: 0.7rem;
  white-space: nowrap;
}

.challenge-hud .challenge-hearts {
  padding-left: 0.8rem;
  border-left: 1px solid rgba(117, 102, 87, 0.25);
  color: #b3504b;
  letter-spacing: 0.16em;
}

.challenge-time-low {
  animation: challenge-pulse 0.8s ease-in-out infinite;
}

.challenge-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(25, 18, 13, 0.78);
  backdrop-filter: blur(9px);
}

.challenge-panel {
  width: min(92vw, 520px);
  padding: 2.6rem;
  border: 3px double #b3504b;
  border-radius: 10px;
  color: #4a3b32;
  background: #f7f4ed;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.challenge-panel p:first-child {
  margin: 0;
  color: #b3504b;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
}

.challenge-panel h2 {
  margin: 0.8rem 0;
  font-size: 2.1rem;
}

.challenge-panel p {
  color: #746456;
  line-height: 1.7;
}

.challenge-panel-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.6rem;
}

.challenge-panel button,
.challenge-panel a {
  padding: 0.7rem 1.1rem;
  border: 1px solid #8c6b45;
  border-radius: 999px;
  color: #6f5236;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.challenge-panel button {
  color: #fff;
  background: #8c6b45;
}

.challenge-complete {
  margin: 0 0 1.4rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(179, 80, 75, 0.35);
  border-radius: 6px;
  color: #8a423d;
  background: rgba(179, 80, 75, 0.08);
  font-size: 0.78rem;
  text-align: center;
}

@keyframes challenge-pulse {
  50% {
    color: #fff;
    background: #b3504b;
    box-shadow: 0 0 20px rgba(179, 80, 75, 0.45);
  }
}

@media (max-width: 720px) {
  .portfolio-game-nav {
    top: 0.65rem;
    left: 0.65rem;
  }

  .portfolio-game-nav a {
    min-height: 34px;
    padding: 0.4rem 0.65rem;
    font-size: 0.62rem;
  }

  .challenge-hud {
    top: auto;
    bottom: 0.75rem;
    width: max-content;
    max-width: calc(100vw - 1.5rem);
  }
}
