/* The introduction is a native dialog, outside the scaled game surface. */
.game-guide-managed #start-overlay { visibility: hidden !important; pointer-events: none !important; }
dialog.game-guide-dialog {
  position: fixed; inset: 0; width: min(460px, calc(100vw - 24px));
  max-width: none; max-height: min(680px, calc(100svh - 24px)); height: fit-content;
  margin: auto; padding: 0; overflow: hidden; box-sizing: border-box;
  border: 1px solid #fff8; border-radius: 24px; background: #fffaf6; color: #302b35;
  box-shadow: 0 24px 80px #21182540, 0 2px 8px #21182514;
  font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-align: left; user-select: text; touch-action: pan-y;
}
dialog.game-guide-dialog[open] { display: flex; flex-direction: column; animation: game-guide-enter .2s ease-out; }
.game-guide-dialog::backdrop { background: #241e314d; backdrop-filter: blur(4px); }
.game-guide-dialog *, .game-guide-dialog *::before, .game-guide-dialog *::after { box-sizing: border-box; }
.game-guide-dialog [hidden] { display: none !important; }
.game-guide-dialog button { font: inherit; cursor: pointer; text-transform: none; letter-spacing: normal; touch-action: manipulation; }
.game-guide-dialog button:focus-visible, .game-guide-dialog summary:focus-visible, .game-guide-help:focus-visible {
  outline: 3px solid #ae2344; outline-offset: 3px;
}
.game-guide-dialog .game-guide-close {
  position: absolute; right: 12px; top: 12px; z-index: 1; width: 40px; height: 40px;
  padding: 0; border: 0; border-radius: 50%; background: #eee6e2; color: #574952;
  font-size: 26px; font-weight: 400; line-height: 1; box-shadow: none;
}
.game-guide-header { display: flex; align-items: center; gap: 14px; flex-shrink: 0; padding: 26px 52px 20px 26px; }
.game-guide-art {
  display: grid; place-items: center; flex: 0 0 58px; width: 58px; height: 58px;
  border: 1px solid #ebd8c8; border-radius: 18px; background: #f5e9d8;
  font: 32px/1 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; transform: rotate(-5deg);
  box-shadow: 0 3px 0 #e6d5c5;
}
.game-guide-identity { min-width: 0; }
.game-guide-eyebrow { margin: 0 0 5px; color: #a54750; font-size: 10px; font-weight: 750; letter-spacing: .09em; }
.game-guide-dialog .game-guide-title { margin: 0; padding: 0; color: #302b35; font-size: 25px; font-weight: 800; letter-spacing: -.035em; line-height: 1.15; overflow-wrap: anywhere; text-shadow: none; }
.game-guide-title:focus { outline: none; }
.game-guide-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 26px 8px; scrollbar-width: thin; }
.game-guide-goal { margin: 0 0 20px; color: #645963; font-size: 14px; line-height: 1.65; }
.game-guide-inputs { padding: 15px; border: 1px solid #e8dfe4; border-radius: 16px; background: #f2edf3; }
.game-guide-control-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.game-guide-controls-title, .game-guide-difficulty-label { margin: 0; color: #4f414f; font-size: 12px; font-weight: 750; line-height: 1.4; }
.game-guide-dialog .game-guide-device { min-height: 32px; padding: 4px 9px; border: 1px solid #ddd1df; border-radius: 8px; background: #fff9; color: #655369; font-size: 11px; font-weight: 600; box-shadow: none; }
.game-guide-device:disabled { cursor: default; opacity: 1; }
.game-guide-keys { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0; padding: 0; list-style: none; }
.game-guide-key { display: flex; align-items: center; gap: 8px; }
.game-guide-keycap { display: inline-block; padding: 4px 7px; border: 1px solid #d7ccd9; border-bottom-width: 3px; border-radius: 6px; background: #fff; color: #514057; font: 650 11px/1.3 ui-monospace, 'SFMono-Regular', Consolas, monospace; white-space: nowrap; }
.game-guide-action { color: #65566a; font-size: 12px; }
.game-guide-pointer-label { margin: 14px 0 4px; color: #7a6a7e; font-size: 10px; font-weight: 700; }
.game-guide-gesture { margin: 0; color: #65566a; font-size: 12px; line-height: 1.6; }
.game-guide-inputs.is-touch .game-guide-keys, .game-guide-inputs.is-touch .game-guide-pointer-label { display: none; }
.game-guide-inputs.is-touch .game-guide-gesture { font-size: 14px; }
.game-guide-rules { margin-top: 14px; border-bottom: 1px solid #eee3df; }
.game-guide-rules summary { padding: 10px 2px; color: #66525c; font-size: 12px; font-weight: 650; cursor: pointer; }
.game-guide-rule-copy { padding: 0 2px 14px; color: #72636d; font-size: 13px; line-height: 1.8; }
.game-guide-rule-copy b { color: #453648; font-weight: 700; }
.game-guide-options { margin-top: 16px; }
.game-guide-difficulty-label { margin-bottom: 8px; }
.game-guide-options .diff-row, .game-guide-options .diffs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.game-guide-options button[data-diff] { flex: 1; min-height: 40px; margin: 0; padding: 8px; border: 1px solid #ddced4; border-radius: 9px; background: #fff; color: #6a5761; font-size: 11px; font-weight: 700; box-shadow: none; }
.game-guide-options button.active, .game-guide-options button.on { border-color: #b6384d; background: #fce7e8; color: #9f253e; }
.game-guide-footer { flex-shrink: 0; margin: 0; padding: 16px 26px 18px; background: #fffaf6; }
.game-guide-dialog .game-guide-play {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px;
  margin: 0; padding: 12px 18px; border: 1px solid #bd293b; border-radius: 13px;
  background: #d93649; color: #fff; box-shadow: 0 3px 0 #a32536;
  font-size: 15px; font-weight: 750; transition: background .15s, transform .15s;
}
.game-guide-dialog .game-guide-play:hover { background: #c62c40; transform: translateY(-1px); }
.game-guide-dialog .game-guide-play:active { transform: translateY(1px); box-shadow: 0 1px 0 #a32536; }
.game-guide-arrow { font-size: 21px; line-height: 1; }
.game-guide-note { margin: 12px 0 0; text-align: center; color: #83717c; font-size: 11px; line-height: 1.4; }
.game-guide-toolbar { display: flex; justify-content: flex-end; grid-column: 1; margin-bottom: 10px; }
.game-guide-toolbar + .wg-player { grid-column: 1; grid-row: 2; }
.game-guide-toolbar ~ .wg-discovery { grid-column: 2; grid-row: 1 / span 2; }
.game-guide-toolbar .game-guide-help { min-height: 40px; padding: 8px 14px; border: 1px solid #dfcfd5; border-radius: 10px; background: #fffaf6; color: #794255; font: 650 13px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; cursor: pointer; }
@media (max-width: 1100px) { .game-guide-toolbar ~ .wg-discovery { grid-column: 1; grid-row: auto; } }
@media (max-width: 360px), (max-height: 440px) {
  dialog.game-guide-dialog { border-radius: 18px; }
  .game-guide-header { padding: 18px 46px 14px 18px; gap: 10px; }
  .game-guide-art { width: 44px; height: 44px; flex-basis: 44px; border-radius: 13px; font-size: 27px; }
  .game-guide-dialog .game-guide-title { font-size: 21px; }
  .game-guide-body { padding-inline: 18px; }
  .game-guide-goal { margin-bottom: 12px; font-size: 13px; }
  .game-guide-footer { padding: 12px 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.game-guide-dialog[open] { animation: none; }
  .game-guide-dialog .game-guide-play { transition: none; }
}
@media (pointer: coarse) { .game-guide-dialog .game-guide-device, .game-guide-dialog .game-guide-close { min-height: 44px; min-width: 44px; } }
@keyframes game-guide-enter { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
