/* Shared reading surfaces: never place learning text directly on scene art.
   Scope to text, leaving puzzle geometry, illustrations and color clues intact. */
.game-dialog {
 --reading-ink: #302440;
 --reading-paper: #fffdf6;
}
.game-dialog[data-world] .game-body :is(
 .picnic-prompt, .harbor-prompt, .harbor-note, .cv-prompt, .sm-note,
 .orchard-banner > p, .terrace-board > p,
 .adv-prompt, .adv-mission, .adv-position, .adv-balance-total, .adv-word,
 .wonder-question, .enrich-mission, .discovery-clue, .fest-prompt,
 .g4-mission, .g4-formula, .quiz-prompt,
 .studio-heading, .studio-note, .studio-target, .studio-clue,
 .court-note, .grove-heading, .grove-note, .lantern-heading,
 .lantern-note, .lantern-question, .orchard-note, .orchard-clue,
 .skybridge-readout, .wonder-graph-note, .explorer-count,
 .g4-map-caption, .code-caption, .play-tip,
 .adv-stage > p, .adv-pipe-labels, .adv-row-sum, .adv-col-sum
) {
 color: var(--reading-ink);
 background: var(--reading-paper);
 border: 2px solid #d7c4e5;
 border-radius: 20px;
 padding: 12px 18px;
 box-shadow: 0 3px 0 #b9a0cb;
 font-family: 'Fredoka', Arial, sans-serif;
 font-size: clamp(1.25rem, 1.05rem + .8vw, 1.65rem);
 font-weight: 500;
 line-height: 1.65;
 text-shadow: none;
 text-align: center;
 max-width: 100%;
 min-width: 0;
 height: auto;
 max-height: none;
 white-space: normal;
 overflow: visible;
 overflow-wrap: anywhere;
 text-overflow: clip;
 opacity: 1;
}
/* Longer stories and clues keep their layout but receive solid reading paper. */
.game-dialog[data-world] .game-body :is(
 .bridge-story, .trail-story, .cv-clues, .harbor-ledger, .terrace-notebook,
 .adv-clues, .studio-story, .voyage-story, .mead-story-card,
 .court-story, .skybridge-story, .fest-story, .explorer-notebook,
 .grove-cross-clues, .exp-clue, .g4-clues, .g4-help,
 .g4-facts, .code-legend
) {
 background: var(--reading-paper);
 color: var(--reading-ink);
 border: 2px solid #d7c4e5;
 border-radius: 20px;
 padding: 16px 20px;
 font-size: clamp(1.125rem, 1rem + .5vw, 1.4rem);
 line-height: 1.8;
 overflow-wrap: anywhere;
 text-shadow: none;
 opacity: 1;
}
.game-dialog[data-world] .game-body :is(.adv-clues, .g4-clues) {
 padding-inline-start: 2.25em;
}
/* Paragraph styles in individual game packs must not shrink reading passages. */
.game-dialog[data-world] .game-body :is(
 .bridge-story, .trail-story, .cv-clues, .harbor-ledger, .terrace-notebook,
 .g4-mission, .studio-story, .voyage-story, .mead-story-card,
 .court-story, .skybridge-story, .fest-story, .explorer-notebook,
 .g4-facts, .g4-help
) :is(p, li, q) {
 color: var(--reading-ink);
 font-size: inherit;
 font-weight: 500;
 line-height: 1.8;
 height: auto;
 max-height: none;
 white-space: normal;
 overflow: visible;
 overflow-wrap: anywhere;
 text-shadow: none;
}
.game-dialog[data-world] .game-body :is(.adv-mission, .g4-mission, .quiz-prompt) :is(strong, b, span) {
 color: inherit;
}
/* Questions in the original quizzes include words, equations and picture tracks.
   Only textual questions receive a surface; never obscure the toy tracks. */
.game-dialog[data-world] .quiz-question:not(.quiz-token-track) {
 color: var(--reading-ink);
 background: var(--reading-paper);
 border: 2px solid #d7c4e5;
 border-radius: 20px;
 padding: 12px 18px;
 font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.4rem);
 line-height: 1.6;
 white-space: normal;
 overflow-wrap: anywhere;
}
.game-dialog[data-world] .game-meta #gameInstruction {
 color: var(--reading-ink);
 font-size: 1.125rem;
 line-height: 1.7;
}
.game-dialog[data-world] .game-status:not(:empty) {
 color: #234b32;
 background: var(--reading-paper);
 border: 2px solid #c5d7c7;
 border-radius: 16px;
 padding: 12px 18px;
 font-size: 1.125rem;
 line-height: 1.7;
}
.game-dialog[data-world] .game-status.error { color: #792c21; }
.game-dialog[data-world] .game-status.hint { color: var(--reading-ink); }
/* Compact board coordinates have their own solid chips without oversized padding. */
.game-dialog[data-world] .game-body :is(.adv-row-sum, .adv-col-sum) {
 padding: 3px;
 border-radius: 8px;
 font-size: 1.125rem;
 line-height: 1.3;
}
@media (max-width:600px) {
 .game-dialog[data-world] .game-body :is(.fest-prompt, .adv-prompt, .wonder-question,
 .enrich-mission, .g4-mission, .quiz-prompt, .lantern-question,
 .picnic-prompt, .harbor-prompt, .harbor-note, .cv-prompt, .sm-note, .orchard-banner > p, .terrace-board > p) {
  padding: 12px;
  font-size: 1.25rem;
 }
 .game-dialog[data-world] .g4-mission { flex-wrap: wrap; }
}
@media (forced-colors:active) {
 .game-dialog { --reading-paper: Canvas; --reading-ink: CanvasText; }
 .game-dialog[data-world] .game-body :is(.fest-prompt, .adv-prompt, .wonder-question,
 .enrich-mission, .g4-mission, .quiz-prompt, .game-status) {
  border-color: CanvasText;
  box-shadow: none;
 }
}

.game-dialog[data-world] .orchard-banner > p > strong { color:inherit; font-size:inherit; line-height:1.65; }
