dialog.rules-help {
  box-sizing: border-box;
  width: min(94vw, 640px);
  max-width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 16px);
  max-height: min(92dvh, 940px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #d1bd99;
  border-radius: 18px;
  background: #fffaf0;
  color: #443322;
  font-size: 16px;
  line-height: 1.65;
}
dialog.rules-help[open] { display: flex; flex-direction: column; }
dialog.rules-help::backdrop { background: #2c231c8c; }
.rules-help .help-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e0d2b9;
  background: #fffaf0;
}
.rules-help .help-heading { min-width: 0; }
.rules-help .help-kicker { margin: 0; font-size: 16px; color: #725d47; }
.rules-help h2 { margin: 0; font-size: 24px; line-height: 1.35; }
.rules-help #close-help {
  position: static;
  inset: auto;
  flex: 0 0 auto;
  min-width: 94px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #bda886;
  border-radius: 12px;
  background: #efe6d7;
  color: #443322;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.rules-help .help-close:focus-visible, .rules-help summary:focus-visible { outline: 3px solid #526f53; outline-offset: 3px; }
.rules-help .help-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px max(22px, env(safe-area-inset-bottom));
  scrollbar-gutter: stable;
}
.rules-help p, .rules-help li, .rules-help figcaption, .rules-help summary { font-size: 16px; line-height: 1.65; }
.rules-help p { margin: 0 0 12px; }
.rules-help .help-purpose { font-weight: 700; }
.rules-help .help-limit { display: inline-block; padding: 5px 12px; border-radius: 99px; background: #eee3cf; }
.rules-help .help-figure { margin: 4px 0 20px; padding: 10px; border: 1px solid #e0d2b9; border-radius: 14px; background: #f7efdf; }
.rules-help .help-diagram { display: block; width: 100%; height: auto; font-family: system-ui, sans-serif; }
.rules-help figcaption { margin: 5px 0 0; }
.rules-help .help-section { margin: 20px 0; }
.rules-help h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.5; }
.rules-help ul { margin: 0; padding-left: 1.25em; }
.rules-help li + li { margin-top: 8px; }
.rules-help .help-current-phase { padding: 14px; border-left: 4px solid #b83535; border-radius: 0 10px 10px 0; background: #f5e9da; }
.rules-help .help-current-phase p:last-child { margin-bottom: 0; }
.rules-help .help-selection { margin-top: 10px; color: #725d47; }
.rules-help .help-camera { border: 1px solid #d4c4a8; border-radius: 12px; margin: 20px 0; padding: 0 12px; }
.rules-help summary { min-height: 44px; padding: 9px 0; box-sizing: border-box; font-weight: 700; cursor: pointer; }
.rules-help .help-camera p { margin: 5px 0 12px; }
@media (max-height: 500px) {
  dialog.rules-help { max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px); }
  .rules-help .help-header { padding-top: 8px; padding-bottom: 8px; }
  .rules-help .help-kicker { display: none; }
}
