/* Scoped feedback UI; typography inherits the game's current design. */
#feedback-button{position:fixed;left:max(10px,env(safe-area-inset-left));top:calc(max(10px,env(safe-area-inset-top)) + 54px);width:44px;height:44px;display:grid;place-items:center;z-index:25}
#feedback-button svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round}
#feedback-panel{position:fixed;left:0;top:var(--feedback-top,0px);width:100%;height:var(--feedback-height,100dvh);z-index:40;background:#21172fcc;display:flex;padding:12px max(12px,env(safe-area-inset-right)) 12px max(12px,env(safe-area-inset-left));overscroll-behavior:contain;touch-action:pan-y}
#feedback-panel .feedback-paper{width:min(100%,480px);max-height:100%;overflow:auto;overscroll-behavior:contain;margin:auto;padding:20px;border:2px solid #ac8154;border-radius:14px;background:#f5e7c8;color:#3c2c39;box-shadow:0 12px 40px #0008;display:flex;flex-direction:column;gap:12px;touch-action:pan-y}
#feedback-panel h2{font-size:24px;line-height:1.2}
#feedback-panel p{font-size:15px;line-height:1.4}
#feedback-panel textarea{font:inherit;font-size:16px;line-height:1.4;min-height:92px;width:100%;resize:vertical;border:1px solid #9b724a;border-radius:8px;padding:10px;color:#3c2c39;background:#fff9ed;user-select:text;-webkit-user-select:text;touch-action:pan-y}
#feedback-panel .feedback-picture{display:flex;align-items:center;gap:12px}
#feedback-panel img{width:112px;max-height:70px;object-fit:contain;border:1px solid #ac8154;border-radius:4px}
#feedback-panel label{display:flex;gap:8px;align-items:center;min-height:44px;font-size:15px}
#feedback-panel input{width:20px;height:20px;accent-color:#62416e}
#feedback-panel footer{display:flex;justify-content:flex-end;gap:10px}
#feedback-panel button{min-height:44px;min-width:80px;padding:8px 16px;border:1px solid #9b724a;border-radius:8px;background:#fff4db;color:#50384f;font-weight:700}
#feedback-panel button[type=submit]{background:#62416e;color:#fff}
#feedback-panel button:disabled{opacity:.55;cursor:wait}
#feedback-panel :focus-visible,#feedback-button:focus-visible{outline:3px solid #9b6ad0;outline-offset:3px}
#feedback-panel [role=status]:empty{display:none}
/* Sent acknowledgement: the game's toast look and place, popping in; it never takes input. */
#feedback-ack{position:fixed;left:50%;top:58%;translate:-50% 0;z-index:26;max-width:90vw;padding:12px 20px;font-size:20px;font-weight:800;text-align:center;color:#ffe066;opacity:0;transition:opacity .4s;pointer-events:none;user-select:none;-webkit-user-select:none}
#feedback-ack:empty{padding:0;border:0}
#feedback-ack.on{opacity:1;transition:none;animation:feedback-pop .35s cubic-bezier(.3,1.6,.5,1)}
@keyframes feedback-pop{from{scale:.6}to{scale:1}}
@media(prefers-reduced-motion:reduce){#feedback-ack.on{animation:none}}
@media(max-height:500px){#feedback-panel .feedback-paper{padding:12px;gap:8px}#feedback-panel img{width:72px;max-height:44px}#feedback-panel textarea{min-height:64px}}

/* The storybook Pause control shares this corner. Keep a clear gap below feedback. */
body[data-scene=tidbit] #tidbit-controls[data-production=true] #tidbit-pause{top:max(142px,calc(env(safe-area-inset-top) + 132px))}
/* Blocking choices, transitions, fatal errors and Tidbit settings retain input ownership. */
body:has(#choices:not([hidden])) #feedback-button,body:has(#scene-fade.on) #feedback-button,body:has(#fatal:not([hidden])) #feedback-button,body:has(#tidbit-controls[data-paused=true]):not(:has(#tidbit-album:not([hidden]))) #feedback-button{z-index:6}

body:has(#hud[hidden]) #feedback-button{display:none}
