.festival-return { max-width: 1040px; margin: 0 auto; padding: 18px 20px 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; }
.festival-return div { display: flex; gap: 10px; flex-wrap: wrap; }
.festival-return a, .game-site-footer a { color: var(--ink); text-decoration: none; border: 1px solid var(--line); padding: 12px; display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; }
.festival-return a:hover, .game-site-footer a:hover { background: var(--panel2); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ETH); outline-offset: 3px; }
.game-site-footer { max-width: 980px; margin: 20px auto 0; padding: 20px; color: var(--muted); font: 11px/1.7 var(--mono); }
.game-site-footer a { margin: 0 8px 8px 0; }
.game-site-footer p { max-width: 620px; }
.game-noscript { padding: 20px; color: var(--ink); }
#story-dialog { color: var(--ink); background: var(--bg); border: 1px solid var(--line); padding: 20px; box-sizing: border-box; width: min(560px, calc(100vw - 24px)); max-height: 90vh; max-height: 90dvh; overflow: auto; }
#story-dialog::backdrop { background: rgba(0,0,0,.85); }
.story-dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.story-dialog-top h2 { font: 800 19px var(--display); margin: 0; }
#story-close { width: auto; margin: 0; }
.story-help { color: var(--muted); font: 12px/1.6 var(--mono); }
#story-preview { display: block; width: min(100%, 324px); height: auto; aspect-ratio: 9/16; margin: 16px auto; border: 1px solid var(--line); }
.story-actions { display: grid; gap: 10px; margin-top: 18px; }
.story-actions a { text-align: center; text-decoration: none; box-sizing: border-box; }
.story-open { overflow: hidden; }
#story-result-status:empty, #story-status:empty { display: none; }
@media (max-width: 380px) { .festival-return { padding-inline: 12px; gap: 6px; } .festival-return a { padding-inline: 10px; } #story-dialog { padding: 14px; } .story-dialog-top h2 { font-size: 16px; } }
/* The uploaded game centered one child with flex. Keep the added site chrome vertical. */
body { display: block; height: auto; min-height: 100%; }
#app { margin-inline: auto; min-height: auto; }
.festival-return, .game-site-footer { max-width: 560px; box-sizing: border-box; width: 100%; }
@media (max-width: 420px) { .wheel { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* In-app browsers must be able to expose the native image-saving callout. */
#story-preview { -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; touch-action: auto; }
#story-preview:not([src]) { display: none; }
.story-browser-fallback { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.story-browser-fallback h3 { font: 600 14px var(--mono); margin: 0; }
.story-browser-fallback label { display:block; margin-bottom:6px; font:12px var(--mono); }
#story-result-link { display:block; width:100%; min-width:0; box-sizing:border-box; min-height:44px; padding:10px; background:var(--panel); color:var(--ink); border:1px solid var(--line); font:16px var(--mono); -webkit-user-select:text; user-select:text; -webkit-touch-callout:default; }
#story-copy-link { margin-top:10px; }
.story-restore-note { box-sizing:border-box; width:min(560px,100%); padding:12px 20px; margin:auto; font:12px/1.6 var(--mono); }
.story-restore-note .btn { width:auto; }
