/* UI palettes never filter the 3D canvas or the player's selected color. */
:root[data-theme=green]{--ui-gold:#b8ed67;--ui-red:#41875a;--ui-cream:#eff6df;--ui-dark:#0b1812;--ui-border:#52765a;--muted:#b8cbb1;--cyan:#b8ed67;color-scheme:dark}
:root[data-theme=green] .screen{background:linear-gradient(90deg,#07160ff5,#07160fdc 35%,#07160f55 65%,transparent)}
:root[data-theme=green] .titleBar{background:#2e6943;color:#efffdc}
:root[data-theme=green] .bigTitle{text-shadow:4px 3px 0 #24452b}
:root[data-theme=green] :is(.mode.active,.characterChoice[aria-pressed=true],.mpModeCards button[aria-pressed=true]){background:#b8ed67;color:#163018;border-color:#defba7}
:root[data-theme=green] :is(.mode.active small,.mode.active strong,.characterChoice[aria-pressed=true] small,.characterChoice[aria-pressed=true] b,.mpModeCards button[aria-pressed=true] small,.characterChoice[aria-pressed=true] .seisPerk){color:#28422c}
:root[data-theme=green] :is(#multiplayerBtn,#mpPrivate,#mpJoinForm>button,#profileMenuBtn,#hunterAbility){background:#265b3e;color:#efffdc;border-color:#7abb85}
:root[data-theme=green] #mpScreen{background:radial-gradient(ellipse at top left,#23452c,#09130e 70%)}
:root[data-theme=green] #mpStatus{background:#1e3b29;color:#e0efcc}
:root[data-theme=green] :is(.mpSetup,#mpBrowser,#mpLobby,#profileDialog,.heroColorPanel,#paperPanel){background:#13251bee;border-color:#52785b;color:#f0f6e5}
:root[data-theme=green] #profileDialog p{color:#bfceb5}
:root[data-theme=green] .achievement{background:#213b29;border-color:#52775a}
:root[data-theme=green] .achievement.unlocked{border-color:#b8ed67}
:root[data-theme=green] :is(#profileDialog button,#profileDialog select){background:#264831;border-color:#67936b;color:#f0f9e2}
:root[data-theme=green] :is(#controlEditor,#paperHead>span){background:#163521f5;color:#e2f5cf;border-color:#7bb15e}
:root[data-theme=green] #paperPanel h2{color:#dff4c1}
:root[data-theme=green] .touchButton{background:linear-gradient(145deg,#315b3eef,#122a1cef)!important;border-color:#90b77b!important;color:#eff6df}
:root[data-theme=green] :is(.touchButton.touchPressed,.touchButton[aria-pressed=true]){background:#b8ed67!important;color:#17351c!important}
:root[data-theme=green] .stick{background:radial-gradient(#659a4770,#18352290)!important;border-color:#b8ed6799!important}
:root[data-theme=green] .stickKnob{background:#b8ed67bb!important;border-color:#d9f7b0!important}
:root[data-theme=green] .heroColorSwatch[aria-pressed=true]{background:#365333}
:root[data-theme=green] #game :is(.start,#mpPublic,#mpStart,#saveProfile,#finishControls){color:#163018!important;border-color:#dbf8b4}
:root[data-theme=green] #game :is(.start:hover,#mpPublic:hover,#mpStart:hover,#saveProfile:hover){background:#d0f69b!important}

#profileDialog .preferenceCheck{display:flex;align-items:center;gap:12px;margin:20px 0}
.preferenceCheck input{width:20px;height:20px;accent-color:var(--ui-gold)}
.keyboardSettings{border-block:1px solid var(--ui-border);padding:16px 0;margin-bottom:22px}
.keyboardSettings summary{cursor:pointer;font-weight:bold;min-height:32px}
#keyBindings{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
#keyBindings button{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:48px;text-align:left}
#keyBindings kbd{font-size:12px;border:1px solid var(--ui-border);padding:3px 7px;border-radius:4px;color:var(--ui-gold)}
#bindingStatus{min-height:24px}
#controlEditor{inset:max(12px,env(safe-area-inset-top)) 18px auto;grid-template-columns:1fr auto auto auto;align-items:center;text-align:left;gap:12px;padding:12px 16px}
#controlEditor>span{display:none}
#controlEditor>strong{font-size:12px}
.editorScale{font:11px system-ui;display:grid;gap:6px;max-width:170px}
.editorScale select{max-width:135px;background:var(--ui-dark);color:var(--ui-cream);border:1px solid var(--ui-border);padding:6px}
.editorScale input{width:100%;accent-color:var(--ui-gold)}
.editingControls .editingSelected{outline:3px solid var(--ui-gold)!important;outline-offset:5px}
.editingControls #controlEditor{z-index:110}

#toast{display:flex;align-items:center;gap:16px;max-width:min(640px,85vw);padding:12px 12px 12px 18px;pointer-events:auto}
#toast:not(.show){pointer-events:none}
#toast>span{flex:1;line-height:1.5}
.dismissMessage,#dismissHints{flex-shrink:0;width:36px;height:36px;border:1px solid #ffffff55;background:#111b;color:white;font:24px/1 system-ui;border-radius:50%;pointer-events:auto;touch-action:manipulation}
.bottomHud{padding:12px 48px 12px 12px;background:linear-gradient(90deg,#06080bc9,#06080b80);border-radius:8px;pointer-events:none}
#dismissHints{position:absolute;right:6px;top:6px}
.compactHelp .bottomHud,.compactHelp #hint{display:none!important}
#restoreHints{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);border:1px solid var(--ui-border);border-radius:20px;background:var(--ui-dark);color:var(--ui-cream);padding:10px 16px;pointer-events:auto;font:11px system-ui}
#restoreHints[hidden]{display:none}

/* Two thumb zones: left movement + run, right actions, free middle for aiming. */
@media(pointer:coarse),(max-width:1024px){
 #touchUI{left:max(22px,env(safe-area-inset-left));right:max(22px,env(safe-area-inset-right));bottom:max(22px,env(safe-area-inset-bottom));align-items:flex-end;pointer-events:none}
 #touchUI .touchButtons{display:grid;grid-template-columns:repeat(3,66px);grid-template-rows:repeat(2,66px);gap:14px}
 #touchUI .touchButton{width:66px;height:66px;min-width:66px;min-height:66px;border-radius:18px;font-size:10px;line-height:1.6;pointer-events:auto;touch-action:none;user-select:none}
 #touchUI #sprintTouch{position:fixed;left:max(48px,env(safe-area-inset-left));bottom:max(162px,calc(env(safe-area-inset-bottom) + 142px));width:66px;height:56px;min-height:56px;border-radius:16px}
 #jumpTouch{grid-column:3;grid-row:1}#attackTouch{grid-column:2;grid-row:1}#flashTouch{grid-column:1;grid-row:2}#crouchTouch{grid-column:2;grid-row:2}#hideTouch{grid-column:3;grid-row:2}
 #touchUI .stick{width:120px;height:120px;pointer-events:auto;touch-action:none}
 #touchUI .mobileHint{display:none}
 .bottomHud{bottom:235px;font-size:10px;max-width:calc(100% - 44px);left:22px;right:22px}
 .bottomHud .status{max-width:45%;font-size:10px}
 #profileMenuBtn{top:auto;bottom:206px;left:22px;padding:10px 12px;font-size:10px;border-radius:16px}
 #restoreHints{bottom:190px;font-size:10px}
 #doorAction{bottom:190px;left:50%;transform:translateX(-50%);max-width:42vw}
 .rightHud .actionRow{gap:9px;grid-template-columns:repeat(3,40px)}
 .actionRow .mini{width:40px;min-width:40px;height:40px;min-height:40px;border-radius:12px}
 #hunterAbility{top:auto;bottom:190px;right:22px;max-width:160px;padding:12px;font-size:10px}
 #toast{top:45%;bottom:auto;max-width:85vw;font-size:11px}
 #hint{max-width:58vw;font-size:9px}
}
@media(pointer:coarse) and (orientation:landscape){
 .bottomHud{left:180px;right:260px;bottom:16px;max-width:none;font-size:9px}
 .bottomHud .status{display:none}
 #profileMenuBtn{bottom:230px}
 #hunterAbility{bottom:190px}
 #fogStatus{top:24px;max-width:32%;font-size:10px}
 #toast{top:40%;max-width:55vw}
 #restoreHints{bottom:20px}
}
@media(max-width:600px) and (orientation:portrait){
 #touchUI{left:18px;right:18px;bottom:max(24px,env(safe-area-inset-bottom))}
 #touchUI .touchButtons{grid-template-columns:repeat(2,64px);grid-template-rows:repeat(3,64px);gap:14px}
 #touchUI .touchButton{width:64px;height:64px;min-width:64px;min-height:64px}
 #jumpTouch{grid-column:2;grid-row:1}#attackTouch{grid-column:1;grid-row:1}#crouchTouch{grid-column:1;grid-row:2}#hideTouch{grid-column:2;grid-row:2}#flashTouch{grid-column:2;grid-row:3}
 #touchUI #sprintTouch{left:40px;bottom:170px}
 #touchUI .stick{width:112px;height:112px}
 .bottomHud{bottom:278px;left:18px;right:18px;max-width:none}
 .bottomHud .status{display:none}
 #profileMenuBtn{left:24px;bottom:242px}
 #restoreHints{bottom:257px;left:auto;right:22px;transform:none}
 #doorAction{bottom:330px;max-width:75vw}
 #hunterAbility{bottom:260px;right:18px}
 #controlEditor{grid-template-columns:1fr 1fr;gap:10px;inset:10px;padding:10px;bottom:auto}
 #controlEditor strong{font-size:10px}#finishControls{font-size:10px}
 #keyBindings{grid-template-columns:1fr}
}
@media(pointer:coarse) and (min-width:1000px){
 #touchUI{left:38px;right:38px;bottom:32px}
 #touchUI .touchButtons{grid-template-columns:repeat(3,76px);grid-template-rows:repeat(2,76px);gap:20px}
 #touchUI .touchButton{width:76px;height:76px;min-width:76px;min-height:76px;font-size:11px}
 #touchUI .stick{width:142px;height:142px}
 #touchUI #sprintTouch{left:76px;bottom:205px}
 #profileMenuBtn{left:48px;bottom:280px}
 #hunterAbility{right:38px;bottom:235px}
}
