/* Touch controls (ui/touch.js): two thumb zones and a cluster of buttons over the game. */
.has-touch #canvas { touch-action: none; }
#touch { position: fixed; inset: 0; z-index: 5; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
	font: 700 13px/1 Xolonium, 'Trebuchet MS', system-ui, sans-serif; color: var(--cloud); }
#touch[hidden] { display: none; }
.tc-zone { position: absolute; top: 18%; bottom: 0; width: 50%; touch-action: none; }
.tc-move { left: 0; } .tc-look { right: 0; }
/* the ring appears where the thumb lands; the dot follows it */
.tc-zone b { position: fixed; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; border: 2px solid rgb(234 242 251 / .35); background: rgb(3 6 13 / .2);
	display: none; place-items: center; pointer-events: none; }
.tc-zone b.is-on { display: grid; }
.tc-zone i { width: 46px; height: 46px; border-radius: 50%; background: rgb(109 180 242 / .7); will-change: transform; }
/* at rest, a faint mark where each thumb goes */
.tc-zone::after { content: ''; position: absolute; bottom: max(26px, env(safe-area-inset-bottom)); width: 96px; height: 96px; border-radius: 50%; border: 2px dashed rgb(234 242 251 / .18); }
.tc-move::after { left: max(34px, env(safe-area-inset-left)); }
.tc-look::after { display: none; }
.tc-keys { position: absolute; inset: 0; pointer-events: none; }
/* --dx, --dy, --k and --tc-size, --tc-alpha are the player's own arrangement (the Controls page; kept by ui/touch.js) */
.tc-keys { opacity: var(--tc-alpha, 1); }
.tc-keys button { position: absolute; pointer-events: auto; touch-action: none; font: inherit; color: var(--cloud); background: rgb(3 6 13 / .42); border: 2px solid rgb(234 242 251 / .4);
	border-radius: 50%; width: 62px; height: 62px; padding: 0; -webkit-tap-highlight-color: transparent;
	transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(calc(var(--tc-size, 1) * var(--k, 1))); }
.tc-keys button[hidden] { display: none; }
.tc-keys button span { display: block; pointer-events: none; }
.tc-keys button.is-down { background: rgb(109 180 242 / .55); border-color: var(--cloud); }
.tc-keys { --r: max(22px, env(safe-area-inset-right)); --b: max(26px, env(safe-area-inset-bottom)); }
.tc-keys .tc-fire { right: calc(var(--r) + 70px); bottom: calc(var(--b) + 18px); width: 92px; height: 92px; font-size: 15px; background: rgb(255 122 92 / .3); border-color: rgb(255 122 92 / .75); }
.tc-keys .tc-fire.is-down { background: rgb(255 122 92 / .7); }
.tc-keys .tc-alt { right: var(--r); bottom: calc(var(--b) + 96px); }
.tc-keys .tc-jump { right: var(--r); bottom: calc(var(--b) + 18px); }
.tc-keys .tc-duck { right: calc(var(--r) + 174px); bottom: var(--b); width: 54px; height: 54px; font-size: 12px; }
/* off until switched on in the Controls page */
.tc-keys .tc-reload { right: var(--r); bottom: calc(var(--b) + 174px); width: 54px; height: 54px; font-size: 12px; }
.tc-keys .tc-hook { right: calc(var(--r) + 176px); bottom: calc(var(--b) + 64px); width: 54px; height: 54px; font-size: 12px; }
.tc-keys .tc-zoom { right: calc(var(--r) + 86px); bottom: calc(var(--b) + 124px); width: 54px; height: 54px; font-size: 12px; }
/* along the top: things pressed between fights */
.tc-keys :is(.tc-prev, .tc-next, .tc-scores, .tc-menu) { top: max(10px, env(safe-area-inset-top)); width: auto; height: 38px; padding: 0 14px; border-radius: 19px; font-size: 12px; }
.tc-keys .tc-menu { left: max(12px, env(safe-area-inset-left)); }
.tc-keys .tc-scores { left: calc(max(12px, env(safe-area-inset-left)) + 76px); }
.tc-keys .tc-next { right: max(12px, env(safe-area-inset-right)); }
.tc-keys .tc-prev { right: calc(max(12px, env(safe-area-inset-right)) + 104px); }
.tc-keys .tc-last { right: calc(max(12px, env(safe-area-inset-right)) + 212px); top: max(10px, env(safe-area-inset-top)); width: auto; height: 38px; padding: 0 14px; border-radius: 19px; font-size: 12px; }
/* left-handed: everything changes sides. The buttons are mirrored as a whole, and their words mirrored back. */
.tc-swap .tc-move { left: auto; right: 0; } .tc-swap .tc-look { right: auto; left: 0; }
.tc-swap .tc-move::after { left: auto; right: max(34px, env(safe-area-inset-right)); }
.tc-swap .tc-keys { transform: scaleX(-1); }
.tc-swap .tc-keys button span { transform: scaleX(-1); }

/* A picture of the layout, to scale, on the Controls page: its buttons can be moved. */
.tc-frame { position: relative; overflow: hidden; border: 1px solid rgb(147 166 192 / .45); border-radius: 10px; background: #070d18 url(backdrop.jpg) center / cover; }
.tc-frame::before { content: ''; position: absolute; inset: 0; background: var(--well); }
.tc-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; font: 700 13px/1 Xolonium, 'Trebuchet MS', system-ui, sans-serif; color: var(--cloud); user-select: none; -webkit-user-select: none; }
.tc-frame:not(.is-editable) { pointer-events: none; }
.tc-frame:not(.is-editable) .is-off { display: none; }
.tc-frame.is-editable button { cursor: grab; }
.tc-frame.is-editable .is-off { opacity: .32; border-style: dashed; }
.tc-frame .is-picked { outline: 3px solid var(--sun); outline-offset: 4px; }
/* where the thumbs go: a ring in the middle of each half */
.tc-hint { position: absolute; top: 56%; left: 25%; width: 112px; height: 112px; margin: -56px 0 0 -56px; display: grid; place-items: center; border-radius: 50%; border: 2px dashed rgb(234 242 251 / .3); color: rgb(234 242 251 / .6); font-weight: 400; font-size: 15px; }
.tc-hint-look { left: 62%; border-color: transparent; }
.tc-swap > .tc-hint-move { left: 75%; } .tc-swap > .tc-hint-look { left: 38%; }

/* the editor beside the picture */
.kc-touch { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(250px, 1fr); gap: 16px 22px; align-items: start; align-content: start; }
.kc-touch[hidden] { display: none; }
@media (max-width: 700px) { .kc-touch { grid-template-columns: minmax(0, 1fr); } }
.te-side, .te-all, .te-one { display: grid; gap: 6px; align-content: start; }
.te-side { gap: 14px; }
.te-one { padding: 12px 14px; border: 1px solid rgb(147 166 192 / .28); border-radius: 4px; background: rgb(12 20 34 / .7); min-height: 96px; }
.te-one h3 { margin: 0; }
.te-none { margin: 0; color: var(--haze); }
/* nothing picked on a small screen: a line of help, not an empty box */
@media (max-width: 700px), (max-height: 520px) { .te-one:has(.te-none) { padding: 0; border: 0; background: none; min-height: 0; } }
.te-does { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; color: var(--haze); }
.te-does select { width: 100%; min-height: 40px; }
.te-size { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.te-size button, .te-reset { min-height: 40px; }
.te-row { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 3.2em; gap: 10px; align-items: center; min-height: 40px; }
.te-row span { color: var(--haze); }
.te-row input { width: 100%; }
.te-row output { color: var(--haze); text-align: right; font-variant-numeric: tabular-nums; }
.te-check { display: flex; gap: 10px; align-items: center; min-height: 40px; cursor: pointer; }
.te-reset { justify-self: start; margin-top: 6px; }
/* while playing, the page's Maps and Controls buttons would sit under the weapon buttons: they come back with the menu */
.touch-play #corner { display: none; }

/* the request to turn an upright phone, once the game runs (the start page fits either way) */
#turn { display: none; }
@media (orientation: portrait) {
	.touch-on:not(.pre, .turn-no) #turn { position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px;
		background: var(--space); color: var(--cloud); text-align: center; font: 400 15px/1.4 Xolonium, 'Trebuchet MS', system-ui, sans-serif; }
}
#turn svg { width: 96px; height: 96px; fill: none; stroke: rgb(234 242 251 / .35); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#turn svg .to, #turn svg path { stroke: var(--sun); }
#turn p { margin: 6px 0 0; font-weight: 700; font-size: 20px; }
#turn small { color: rgb(234 242 251 / .65); font-size: 14px; }
#turn button { margin-top: 22px; font: inherit; font-size: 13px; color: rgb(234 242 251 / .7); background: none; border: 1px solid rgb(234 242 251 / .3); border-radius: 3px; padding: 9px 16px; }
