/* Keep the inline help trigger visually as simple as surrounding text. */
.instructions-help-button {
  display: inline;
  width: auto;
  height: auto;
  margin: 0 1px;
  padding: 0;
  color: var(--color-text);
  font:
    800 1rem/1 Arial,
    sans-serif;
  vertical-align: baseline;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.instructions-help-button:hover {
  color: var(--color-text);
}

.instructions-help-button:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

.game-guide-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 40px));
  margin: auto;
  padding: 0;
  color: #183c29;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background: #f7fff9;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.game-guide-dialog::backdrop {
  background: rgba(3, 20, 12, 0.68);
  backdrop-filter: blur(3px);
}

.game-guide-panel {
  max-height: min(760px, calc(100dvh - 40px));
  overflow-y: auto;
}

.game-guide-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid #dceae0;
  background: rgba(247, 255, 249, 0.96);
}

.game-guide-heading h2 {
  margin: 0;
  font-size: 1.45rem;
}

.game-guide-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  color: #315a40;
  font-size: 1.65rem;
  line-height: 1;
  border: 0;
  border-radius: 50%;
  background: #e3f1e7;
  cursor: pointer;
}

.game-guide-close:hover {
  background: #d1e8d8;
}

.game-guide-close:focus-visible {
  outline: 3px solid #18733e;
  outline-offset: 2px;
}

.game-guide-content {
  padding: 20px 24px 26px;
  line-height: 1.5;
}

.game-guide-copy {
  margin: 0 0 20px;
}

.game-guide-list {
  display: grid;
  gap: 9px;
  margin: 0 0 22px;
  padding-left: 22px;
}

.game-guide-content h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.game-guide-effects {
  display: grid;
  gap: 8px;
  margin: 0;
}

.game-guide-effects > div {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eaf5ed;
}

.game-guide-effects dt {
  display: flex;
  justify-content: center;
}

.game-guide-effects dt img {
  display: block;
  width: 40px;
  height: auto;
  filter: drop-shadow(0 2px 3px rgba(10, 43, 25, 0.18));
}

.game-guide-effects dd {
  margin: 0;
}

@media (max-width: 600px) {
  .game-guide-heading {
    padding: 18px 18px 14px;
  }

  .game-guide-content {
    padding: 18px;
  }

  .game-guide-effects > div {
    grid-template-columns: 48px 1fr;
  }
}
