/* Touch may be the active input even when the primary pointer is a mouse. */
body[data-input=touch] #pause-button{display:grid;place-items:center;min-width:44px;min-height:44px}
@media(orientation:landscape) and (max-height:500px){
 body[data-input=touch] #hud{padding-right:calc(128px + env(safe-area-inset-right))}
}

/* Dragging to look must not select the HUD underneath the gesture. */
body[data-paused="false"]{user-select:none;-webkit-user-select:none}
input,textarea,[contenteditable="true"]{user-select:text;-webkit-user-select:text}
#start .title-menu #start-button::after{display:grid}

/* Controller play is viewed farther away; keep vital labels readable. */
@media(min-width:1000px) and (min-height:600px){
 body[data-input=gamepad] #objective{max-width:360px}
 body[data-input=gamepad] #objective .eyebrow{font-size:12px}
 body[data-input=gamepad] #objective h2{font-size:26px}
 body[data-input=gamepad] #trail-guide{font-size:15px}
 body[data-input=gamepad] #hud .vitals label{font-size:13px}
 body[data-input=gamepad] .tool-slot span{font-size:13px}
 body[data-input=gamepad] #target-action{font-size:14px}
 body[data-input=gamepad] #save-label{font-size:13px}
}

@media(max-width:600px){.inventory-filters button,#close-panel{min-height:44px;min-width:44px}#panel .inventory-slot p{font-size:13px}}

/* Clean local screenshots retain the game HUD; only the collapsed QA launcher is hidden. */
body[data-gallery-capture=true] #prop-review-controls:not([open]){visibility:hidden}
/* Local 3D ship review keeps the established menu until the art is approved. */
body[data-ship-menu=true] #world{visibility:visible}
body[data-ship-menu=true] #start,body[data-ship-menu=true] #start::backdrop{background:transparent}
body[data-ship-menu=true] #start>.title-art{display:none}
body[data-ship-menu=true] #start>.title-shade{background:linear-gradient(90deg,#040709df 0%,#04070980 33%,transparent 62%),linear-gradient(0deg,#030507c9,transparent 25%)}
@media(max-aspect-ratio:1/1){body[data-ship-menu=true] #start>.title-shade{background:linear-gradient(0deg,#030507f0 0%,#03050799 28%,transparent 48%,#03050766 100%)}}
/* Mobile notices sit below the objective and above the thumb controls. */
@media(max-width:600px){
 #toast,#mission-notice{top:auto;bottom:clamp(240px,34dvh,330px);width:max-content;max-width:calc(100vw - 40px);font-size:13px;padding:10px 14px}
 #mission-notice{bottom:calc(clamp(240px,34dvh,330px) + 72px)}
}

#game-chat{position:fixed;bottom:160px;left:20px;z-index:90;width:min(420px,calc(100vw - 40px));font:14px/1.5 system-ui;color:#fff;pointer-events:none;text-shadow:0 1px 3px #000,0 0 5px #000}
body:not([data-world-visible=true]) #game-chat,body[data-gallery-capture=true] #game-chat{display:none}
.chat-log{max-height:170px;overflow:hidden;overflow-wrap:anywhere;display:flex;flex-direction:column;justify-content:flex-end}
.chat-log p{margin:2px 0;flex-shrink:0;opacity:1;transition:opacity 1.2s ease}
.chat-log p.expired{opacity:0}
#game-chat.is-open .chat-log{display:block;overflow:auto;scrollbar-width:none;pointer-events:auto}
#game-chat.is-open .chat-log::-webkit-scrollbar{display:none}
#game-chat.is-open .chat-log p{opacity:1;transition:none}
.chat-log strong{font-weight:600}
#game-chat form{display:none;margin-top:4px}
#game-chat.is-open form{display:block}
#game-chat input{box-sizing:border-box;width:100%;min-height:44px;padding:5px 0;background:transparent;color:#fff;border:0;border-radius:0;outline:none;font:16px/1.5 system-ui;text-shadow:0 1px 3px #000;pointer-events:auto;caret-color:#fff}
#game-chat input::placeholder{color:#ffffff90}
body[data-touch=true] #game-chat{bottom:250px}
body[data-touch=true] #game-chat form{display:block}
body[data-touch=true] #game-chat:not(.is-open) input{width:130px}
@media(max-width:600px) and (orientation:portrait){
  /* The touch vitals sit above the joystick. Keep chat on its own row. */
  body[data-touch=true] #game-chat{bottom:calc(352px + env(safe-area-inset-bottom))}
}
@media(min-width:601px) and (min-height:501px){
  /* Tablet landscape also needs a clear row above the touch vitals. */
  body[data-touch=true] #game-chat{bottom:calc(350px + env(safe-area-inset-bottom))}
}
@media(prefers-reduced-motion:reduce){.chat-log p{transition:none}}
#parasite-hit{position:fixed;inset:0;z-index:16;pointer-events:none;opacity:0;background:radial-gradient(ellipse at center,transparent 45%,#3f17294d 83%,#7d233880 100%)}
#parasite-hit.active{animation:parasite-impact .55s ease-out both}
@keyframes parasite-impact{0%{opacity:.85}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){#parasite-hit.active{animation-duration:.12s}}
#ink-hit-feedback{position:fixed;z-index:17;left:calc(50% + 24px);top:calc(50% + 24px);pointer-events:none;padding:5px 9px;border-left:2px solid #d9e8e6;background:#101a1ed9;color:#f1f4ed;font:600 12px/1.2 system-ui,sans-serif;letter-spacing:.12em;text-shadow:0 1px 3px #000;box-shadow:0 0 14px #a1dde158}
#ink-hit-feedback[hidden]{display:none}
#ink-hit-feedback.active{animation:ink-hit-confirm .28s ease-out}
@keyframes ink-hit-confirm{from{opacity:.35;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){#ink-hit-feedback.active{animation:none}}
/* The journey ends before the optional questionnaire begins. */
#playtest-survey[data-stage=complete] .survey-content{display:flex;flex-direction:column;align-items:stretch;gap:20px}
#playtest-survey .completion-follow{display:block;padding:15px 22px;border:1px solid #ffffffe0;border-radius:16px;background:#edf2ec;color:#15211c;text-align:center;text-decoration:none;font-weight:600;box-shadow:0 0 16px #ffffff24}
#playtest-survey .completion-follow:focus-visible{outline:3px solid white;outline-offset:4px}
#playtest-survey[data-stage=complete] .survey-content p{max-width:42ch;line-height:1.6}
