.game-tools {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 80;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(92vw, 520px);
}
.game-tool {
  border: 2px solid #d8ad59;
  border-radius: 999px;
  background: #2c211acc;
  color: #fff4d2;
  padding: 9px 12px;
  font:
    700 14px Georgia,
    serif;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px #0005;
}
.game-tool:hover {
  background: #583d27;
}
.game-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0f1715dd;
  display: grid;
  place-items: center;
  padding: 18px;
}
.game-modal[hidden] {
  display: none;
}
.game-card {
  width: min(680px, 96vw);
  max-height: 88vh;
  overflow: auto;
  background: linear-gradient(135deg, #fff8df, #e8cf94);
  border: 3px solid #b17a35;
  border-radius: 22px;
  padding: 22px;
  color: #2a1d14;
  box-shadow: 0 20px 70px #0009;
}
.game-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.game-card h2 {
  margin: 0.2em 0;
}
.game-close {
  border: 0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  background: #8b382b;
  color: white;
  font-size: 20px;
  cursor: pointer;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}
.tool-option {
  border: 2px solid #a8793d;
  border-radius: 14px;
  background: #fffaf0;
  padding: 12px;
  cursor: pointer;
  font-weight: bold;
}
.tool-option.active {
  background: #d7e6c9;
  border-color: #365c3d;
}
.tool-option img {
  width: 58px;
  height: 72px;
  object-fit: contain;
  display: block;
  margin: auto;
}
.chapter-report {
  display: grid;
  gap: 9px;
}
.report-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff9e9;
  border: 1px solid #c69a56;
}
.collectibles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.collectible {
  min-width: 94px;
  text-align: center;
  background: #fff9e9;
  border: 2px solid #c99a4b;
  border-radius: 13px;
  padding: 9px;
}
.collectible.locked {
  filter: grayscale(1);
  opacity: 0.48;
}
.mission-count {
  font-weight: bold;
  color: #7a3328;
}
.listen-station {
  margin: 0 0 10px;
  border: 1px solid #9c713d;
  border-radius: 999px;
  background: #fff8df;
  padding: 7px 11px;
  cursor: pointer;
}
.score-rule {
  font-size: 0.92rem;
  background: #fff8e5;
  border-left: 4px solid #c18a38;
  padding: 9px 12px;
  margin: 10px 0;
}
/* Keep decorative mission avatars from falling back to their large source size.
   The exclusions retain the intentionally sized map, picker and reward avatars. */
img[src$="avatar.png"]:not(#avatar):not(.avatar-choice img):not(.finish-avatar):not(.book-avatar img):not(.tool-option img),
img[src$="avatar-female.png"]:not(#avatar):not(.avatar-choice img):not(.finish-avatar):not(.book-avatar img):not(.tool-option img),
img[src$="avatar-monster.png"]:not(#avatar):not(.avatar-choice img):not(.finish-avatar):not(.book-avatar img):not(.tool-option img) {
  display: block;
  width: 72px;
  height: 92px;
  max-width: 72px;
  max-height: 92px;
  object-fit: contain;
}
@media (max-width: 620px) {
  .game-tools {
    right: 8px;
    bottom: 8px;
  }
  .game-tool {
    padding: 8px 10px;
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }
  .game-card {
    padding: 17px;
  }
  .report-row {
    grid-template-columns: 1fr;
  }
}
