.game-page {
  --read-width: 700px;
  color: #211d39;
  width: min(980px, calc(100% - 40px));
  margin-inline: auto;
}
.game-lead { padding: 22px 0 18px; }
.game-lead nav { color: #655e76; font-size: 13px; margin: 0 0 13px; }
.game-lead nav a { text-decoration: underline; text-underline-offset: 3px; }
.game-lead h1 { font-size: clamp(32px, 4.2vw, 49px); line-height: 1.04; letter-spacing: -.05em; margin: 0 0 7px; }
.game-lead p { font-size: 16px; color: #514b61; line-height: 1.5; margin: 0; }
.play-stage { container-type: inline-size; overflow: hidden; border: 1px solid #ddd8e9; border-radius: 16px; background: #faf9fd; }
.play-stage iframe {
  --board-height: var(--round-wide);
  --tall-height: var(--extended-wide);
  display: block; width: 100%; height: var(--board-height); border: 0; background: white;
}
@container (max-width: 700px) {
  .play-stage iframe { --board-height: var(--round-phone); --tall-height: var(--extended-phone); }
}
@container (max-width: 355px) {
  .play-stage iframe { --board-height: var(--round-narrow); --tall-height: var(--extended-narrow); }
}
.play-stage.is-tall iframe { height: var(--tall-height); }
.stage-tools { display: flex; align-items: center; gap: 8px; padding: 2px 10px; border-top: 1px solid #e8e4ee; font-size: 14px; overflow-anchor: none; }
.stage-tools .save-large, .stage-tools button {
  position: static; display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: auto; min-height: 44px; min-width: 44px; height: auto;
  border: 0; border-radius: 7px; padding: 4px 9px; margin: 0; color: #514674; background: transparent; box-shadow: none; font: inherit; font-weight: 650; cursor: pointer; white-space: nowrap;
}
.stage-tools .save-large { margin-right: auto; }
.stage-tools .save-large svg { width: 17px; height: 17px; }
.stage-tools [data-fullscreen] svg, .stage-tools [data-taller] svg { flex: none; width: 19px; height: 19px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.stage-tools button[hidden], .screen-exit, .is-screen .screen-enter, .is-screen [data-taller] { display: none; }
.is-screen .screen-exit { display: inline; }
.stage-tools button:focus-visible { outline: 2px solid #6740cc; outline-offset: -2px; }
@media (hover: hover) {
  .stage-tools button:hover { color: #482ab9; background: #efeafa; }
}
.stage-tools [data-taller][aria-pressed="true"] { color: #482ab9; background: #efeafa; }
.play-stage.is-screen {
  display: flex; flex-direction: column; width: 100%; height: 100vh; height: 100dvh;
  margin: 0; border: 0; border-radius: 0; background: #faf9fd;
}
.play-stage.is-screen iframe { flex: 1; min-height: 0; height: 0; }
.is-screen .stage-tools { flex: none; padding-bottom: max(2px, env(safe-area-inset-bottom)); padding-inline: max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-right)); }
.play-stage.is-overlay { position: fixed; inset: 0; z-index: 10000; }
html.player-overlay-open, html.player-overlay-open body { overflow: hidden; }
.game-notes, .next-puzzle { max-width: var(--read-width); margin: 40px auto; }
.game-notes section { margin: 0 0 35px; }
.game-notes h2 { font-size: clamp(23px, 3vw, 31px); letter-spacing: -.04em; line-height: 1.18; margin: 0 0 12px; }
.game-notes p, .next-puzzle p { margin: 0 0 12px; font-size: 16px; line-height: 1.65; color: #494555; }
.game-notes figure { margin: 17px 0 0; }
.game-notes figure img { display: block; width: auto; max-width: 100%; max-height: 620px; object-fit: contain; height: auto; margin-inline: auto; border-radius: 12px; }
.game-notes figcaption { color: #635c71; font-size: 14px; line-height: 1.5; margin: 9px 0; }
.guide-faq details { border-block-end: 1px solid #e4dfed; }
.guide-faq summary { cursor: pointer; padding: 15px 0; font-size: 16px; font-weight: 650; }
.next-puzzle { display: flex; align-items: center; gap: 15px; padding: 17px; border-radius: 14px; background: #f5f2fc; }
.next-puzzle img { border-radius: 11px; }
.next-puzzle a { font-size: 18px; font-weight: 750; color: #4b32a9; }
.next-puzzle p { margin: 3px 0 0; font-size: 14px; }
.play-footer { display: flex; justify-content: center; gap: 24px; padding: 24px 12px; border-top: 1px solid #e4dfed; font-size: 14px; }
@media(max-width:600px) {
  .game-page { width: calc(100% - 28px); }
  .game-lead { padding: 14px 0 12px; }
  .game-lead nav { margin-bottom: 9px; }
  .play-stage { margin-inline: -10px; border-radius: 10px; }
  .stage-tools { gap: 3px; padding-inline: 5px; font-size: 13px; }
  .stage-tools button { padding-inline: 7px; }
  .play-stage.is-screen { margin: 0; border-radius: 0; }
  .game-notes { margin-block-start: 30px; }
}

.guide-photo { display: block; cursor: zoom-in; }
.photo-viewer { position: fixed; inset: 0; margin: auto; width: fit-content; max-width: min(94vw, 1080px); height: fit-content; max-height: 94vh; max-height: 94dvh; border: 1px solid #ded9ea; border-radius: 14px; padding: 0; background: white; color: #29233c; }
.photo-viewer::backdrop { background: #171226cc; }
.photo-viewer .photo-tools { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 3px 12px; }
.photo-tools a, .photo-tools button { display: inline-flex; align-items: center; min-height: 44px; border: 0; background: transparent; padding: 0 8px; color: #503397; cursor: pointer; font: inherit; }
.photo-tools a { text-decoration: underline; }
.photo-viewer figure { margin: 0; }
.photo-viewer figure img { display: block; width: auto; height: auto; max-width: 100%; max-height: 67vh; max-height: 67dvh; margin: auto; object-fit: contain; }
.photo-viewer figcaption { font-size: 14px; line-height: 1.45; max-width: 64ch; padding: 12px 16px; }
@media(max-width:600px) {
  .game-notes figure img { max-height: none; }
  .photo-viewer { max-width: calc(100vw - 12px); }
}
