/* Help remains available at every viewport width. Only the mobile module may
   replace the heading trigger after its own working help control is mounted. */
.game-heading:has(#open-help) { flex-wrap: wrap; gap: 1rem; }
#open-help { flex: 0 0 auto; min-height: 44px; max-width: 100%; white-space: normal; }
#player-help-dialog {
  box-sizing: border-box;
  width: min(36rem, calc(100% - 2rem));
  min-width: 0;
  max-width: calc(100% - 2rem);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: clamp(1rem, 4vw, 1.75rem);
  border: 1px solid var(--line, #d6d0c4);
  border-radius: 1rem;
  background: var(--paper, #fffdf7);
  color: var(--ink, #243c35);
  overflow-y: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  box-shadow: 0 1rem 4rem #142d2933;
}
#player-help-dialog::backdrop { background: #142d2980; }
#player-help-dialog h2 { margin: 0 0 .75rem; font-size: 1.65rem; }
#player-help-dialog h3 { margin: 1.25rem 0 .5rem; font-size: 1.1rem; }
#player-help-dialog p { margin: .75rem 0; line-height: 1.55; }
#player-help-dialog button {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  height: auto;
  margin: .5rem 0;
  padding: .7rem 1rem;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
#player-help-dialog .player-help-link { text-decoration: underline; text-underline-offset: .2em; }
#player-help-close { position: sticky; top: 0; z-index: 1; background: #fbe9e7; color: #7e2522; border-color: #c56b62; }
#player-help-close:enabled:hover { background: #f7dbd5; }
#player-help-hint { background: var(--terra, #a6442e); border-color: var(--terra, #a6442e); color: #fffdf7; }
#player-help-hint:enabled:hover { background: var(--terra-dark, #843521); }
#player-help-bonus { background: #e3efff; color: #163e70; border-color: #799cc7; }
#player-help-bonus:enabled:hover { background: #d3e5ff; }
#player-help-dialog #player-help-bonus:disabled { background: #eef3fa; color: #4e6177; border-color: #c4cdd8; opacity: 1; }
#confirm-dialog #confirm-action.rewarded-confirm, #player-help-dialog .rewarded-help-action { background: #e3efff; color: #163e70; border-color: #799cc7; }
#player-help-clue { font-size: 1.1rem; font-weight: 600; }
#player-help-remaining { font-weight: 600; }
#player-help-dialog .player-help-optin {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 44px;
  padding: .5rem 0;
  line-height: 1.5;
}
#player-help-bonus-optin { flex: 0 0 24px; width: 24px; height: 24px; margin: 0; }
#player-help-dialog button:disabled { opacity: .75; cursor: not-allowed; }
#open-help:focus-visible,
#player-help-dialog :focus-visible { outline: 3px solid var(--terra, #a74430); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  #open-help, #player-help-dialog, #player-help-dialog * {
    scroll-behavior: auto;
    animation: none;
    transition: none;
  }
}
@media print { #open-help, #player-help-dialog { display: none !important; } }

#reward-simulation-dialog{width:min(36rem,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:20px;border:2px solid var(--terra);border-radius:16px;overflow:auto;background:var(--paper);color:var(--ink)}
#reward-simulation-dialog::backdrop{background:#142d2980}
#reward-simulation-dialog button{display:block;width:100%;min-height:44px;margin:10px 0;white-space:normal}
#reward-simulation-dialog h2{font-size:1.6rem}#reward-simulation-dialog p{font-size:.95rem}
#player-help-secondary{margin-top:14px}#player-help-secondary summary{min-height:44px;cursor:pointer}
#player-help-dialog{padding:16px}#player-help-dialog>p{margin:.4rem 0}#player-help-dialog>h3{margin:.8rem 0 .3rem}
@media(prefers-reduced-motion:reduce){#reward-simulation-dialog,*:focus{scroll-behavior:auto}}
