/* Existing C09/C10/C21/C05 own their visuals; this file positions story-owned compositions. */
#story-surface{position:absolute;inset:0;pointer-events:none}#story-surface>*{pointer-events:auto}#story-surface>#selfie-stage{pointer-events:none}
#choices{position:absolute;inset:0;z-index:45;pointer-events:none}#choices wqxt-story-choice-list{pointer-events:auto}
#gift-panel{position:absolute;inset:0;z-index:50;display:grid;place-items:center;background:#050a15a8;overflow:hidden;padding: max(24px,env(safe-area-inset-top)) max(32px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(32px,env(safe-area-inset-left))}
.gift-content{width:min(680px,100%);max-height:100%;overflow:auto;text-align:center;padding:24px;border:1px solid var(--line);border-radius:6px;background:#0b0e17ed}
.gift-content header span{font:10px/1.2 var(--mono);letter-spacing:.2em;color:var(--gold)}.gift-content h2{font:600 24px/1.4 var(--serif);margin:8px 0 24px}.gift-content h3{font:600 20px/1.4 var(--serif);margin:0 0 12px}
#gift-items{display:flex;gap:24px;justify-content:center}#gift-items>button{flex:1;max-width:172px;min-width:0;display:flex;flex-direction:column;align-items:center;gap:12px;border:1px solid var(--line);border-radius:6px;background:#141925;padding:16px 8px;cursor:pointer}#gift-items b{font:600 14px/1.4 var(--serif)}#gift-items small,#gift-status,#gift-detail>small{font:12px/1.5 var(--sans);color:var(--soft)}
.primary-action{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:48px;min-width:172px;padding:12px 24px;border:1px solid var(--gold);border-radius:6px;background:var(--gold);color:#24201a;font:600 14px/1.4 var(--serif);cursor:pointer}.primary-action:disabled{opacity:.45;cursor:default}#gift-status{margin:16px 0;min-height:18px}#gift-detail>small{display:block;margin:8px 0 16px}#anchor-description{max-width:520px;margin:12px auto;font:500 18px/1.75 var(--serif)}
#anchor-inspect{position:relative;display:grid;place-items:center;width:160px;height:136px;margin:auto;touch-action:none;cursor:grab}#anchor-inspect .anchor-object{position:relative;left:auto;top:auto;translate:none;width:96px;height:96px}#anchor-inspect:focus-visible{outline:2px solid var(--gold);outline-offset:4px}
#selfie-stage{position:absolute;z-index:22;left:64%;top:14%;width:24%;height:54%;display:flex;flex-direction:column;align-items:center;gap:12px}#selfie-stage img{width:100%;height:calc(100% - 36px);object-fit:contain}#selfie-stage span{font:600 14px/1.4 var(--serif);color:var(--gold)}
#entropy-tip{position:absolute;z-index:32;right:max(32px,env(safe-area-inset-right));bottom:max(32px,env(safe-area-inset-bottom));min-height:44px;padding:8px 16px;border:1px solid var(--line);border-radius:6px;background:#111623;color:var(--gold);font:14px/1.4 var(--serif)}
#workcard-avatar{width:100%;height:100%;object-fit:cover}.workcard-details{display:grid;gap:12px}.workcard-details label{display:flex;align-items:center;justify-content:space-between;font:14px/1.5 var(--serif);gap:12px}.workcard-details select,.workcard-details input,.workcard-details button{min-height:44px;font:14px/1.4 var(--serif);border:1px solid #a0b0c3;border-radius:3px;padding:8px;color:#293b56;background:#fff9}.workcard-details input[type=file]{max-width:300px;font-size:12px}#avatar-error{margin:0;color:#96394e;font:12px/1.5 var(--sans)}
#certificate-actions{gap:8px}#certificate-note b{font-weight:500}#certificate-emblem svg[hidden]{display:none}#restart-story{position:absolute;z-index:2;left:50%;bottom:16%;translate:-50% 0;min-height:44px;padding:8px 24px;border:0;background:transparent;color:var(--soft);font:14px/1.4 var(--serif);cursor:pointer}.film-start small{display:block;color:var(--soft);font:12px/1.5 var(--sans)}
#game[data-story-id="p102"] .system-dialogue-video-layer,#game[data-story-id="p103"] .system-dialogue-video-layer,#game[data-story-id="p104"] .system-dialogue-video-layer,#game[data-story-id="p105"] .system-dialogue-video-layer{opacity:0}
@media(max-width:1000px),(max-height:560px){#gift-panel{padding: max(16px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left))}.gift-content{width:min(560px,100%);padding:16px}.gift-content h2{font-size:20px;margin:4px 0 16px}.gift-content h3{font-size:17px;margin-bottom:8px}#gift-items{gap:16px}#gift-items>button{padding:12px 8px;gap:8px}#gift-items b{font-size:13px}#gift-items small,#gift-status,#gift-detail>small{font-size:10px}#gift-items wqxt-item-frame{--wqxt-item-size:56px}.primary-action{min-height:44px;font-size:13px;padding:8px 16px}#gift-status{margin:12px 0;min-height:15px}#anchor-inspect{width:120px;height:88px}#anchor-inspect .anchor-object{width:72px;height:72px}#anchor-description{font-size:16px;margin:8px auto;line-height:1.75}#gift-detail>small{margin:4px 0 8px}.gift-content:has(#gift-detail:not([hidden])) header{display:none}.workcard-details{gap:8px}.workcard-details label,.workcard-details input,.workcard-details select,.workcard-details button{font-size:13px}#certificate-actions .certificate-info-button{font-size:12px;padding-inline:8px}#certificate-actions #sign-button{min-width:132px}#certificate-note{font-size:10px}#selfie-stage{top:12%;height:52%;width:24%}}

#restart-story{left:auto;right:max(24px,env(safe-area-inset-right));top:max(24px,env(safe-area-inset-top));bottom:auto;translate:none}

/* Screenshot corrections; crop state belongs to the workcard draft. */
#gift-items button[data-viewed="false"] small{color:#ff8e9c}#gift-items button[data-viewed="true"] small{color:var(--gold)}
#gift-continue:not([hidden]){margin-top:20px}
.avatar-editor{display:grid;grid-template-columns:112px 1fr;gap:16px;align-items:start}.avatar-editor>div:first-child{display:grid;gap:8px}#avatar-preview{width:96px;height:96px;object-fit:contain;border:1px solid #a0b0c3;background:#cedfea}#avatar-canvas{display:block;width:144px;height:144px;max-width:100%;touch-action:none;cursor:move;border:1px solid #a0b0c3}#avatar-crop{display:grid;gap:8px}#avatar-crop[hidden]{display:none}.crop-actions{display:flex;gap:8px}.crop-actions button{flex:1}#avatar-zoom{width:130px;padding:0;accent-color:#455e79}#avatar-canvas:focus-visible{outline:2px solid #455e79;outline-offset:2px}
#registration-info:popover-open{display:flex;flex-direction:column;overflow:hidden}#registration-info>header{flex-shrink:0}.workcard-details{overflow:auto;min-height:0;padding:2px 2px 4px}.workcard-details>button:last-child{position:sticky;bottom:0;background:#eaf0f6;z-index:1}
@media(max-height:560px){.avatar-editor{grid-template-columns:96px 1fr;gap:12px}#avatar-preview{width:80px;height:80px}#avatar-canvas{width:112px;height:112px}.avatar-editor button{font-size:12px}}

#workcard-avatar{object-fit:contain;min-height:0;flex-shrink:0}#workcard-avatar[hidden]{display:none}
.workcard-details:has(#avatar-crop:not([hidden]))>label,.workcard-details:has(#avatar-crop:not([hidden]))>input,.workcard-details:has(#avatar-crop:not([hidden]))>button{display:none}#avatar-error:empty{display:none}
/* The patting shot needs its head ornament retained in wide landscape. */
#game[data-video-cue^="S2-08-"] #story-video,#game[data-video-cue^="S2-08-"] #story-video-poster{object-position:center top}

/* Approved single-frame stage assets; existing C10 readability remains above the stage. */
#story-still-frame{position:absolute;inset:0;z-index:17;width:100%;height:100%;object-fit:cover;object-position:center 30%;pointer-events:none}
#game[data-still-frame]:not([data-still-frame=""]) .system-dialogue-video-layer,#game[data-still-frame]:not([data-still-frame=""]) .male-dialogue-video-layer,#game[data-still-frame]:not([data-still-frame=""]) .system-actor,#game[data-still-frame]:not([data-still-frame=""]) .mystery-actor,#game[data-still-frame]:not([data-still-frame=""]) #identity-stream,#game[data-still-frame]:not([data-still-frame=""]) #anomaly-screen,#game[data-still-frame]:not([data-still-frame=""]) #explain-layer{visibility:hidden}
#game:is([data-still-frame="03"],[data-still-frame="17"]) #anchor-hold{background:linear-gradient(0deg,#050914b0,transparent 34%);backdrop-filter:none}
#game[data-still-frame="03"] #anchor-hold>:not(#hold-status){visibility:hidden}
#game[data-still-frame="03"] #hold-status{position:absolute;left:24px;right:24px;bottom:max(24px,env(safe-area-inset-bottom));margin:0;font:600 18px/1.5 var(--serif);color:var(--gold);text-shadow:0 2px 6px #000}
#anchor-inspect .anchor-image{display:block;width:128px;height:128px;transform-origin:center;filter:drop-shadow(0 0 12px #cfe5ff44)}
.anchor-image img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
@media(max-width:1000px),(max-height:560px){#anchor-inspect .anchor-image{width:88px;height:88px}#game[data-still-frame="03"] #hold-status{font-size:16px;bottom:max(16px,env(safe-area-inset-bottom))}}

/* Approved selfie frame already contains the photo; do not duplicate the legacy overlay. */
#game[data-still-frame="18"] #selfie-stage{visibility:hidden}
/* Keep the ready-scene visible while retaining contrast for the centered hold prompt. */
#game[data-still-frame="17"] #anchor-hold{background:rgba(5,9,20,.6);backdrop-filter:none}

/* Existing C05 inspector, reused during the imported anchor dialogue. */
#game>#anchor-inspect.in-story{position:absolute;z-index:35;left:50%;top:36%;translate:-50% -50%;margin:0}
#game.ui-hidden>#anchor-inspect.in-story,body.wqxt-story-ui-hidden #anchor-inspect.in-story{visibility:hidden}

/* Anchor inspection does not inherit the identity loading cards or actor. */
#game[data-presentation="anchor-inspect"] .system-actor{opacity:0;pointer-events:none}
