/* Shared desktop panel and mobile retro controller skins. */
.touch{display:flex;align-items:center;justify-content:space-between;position:relative;padding:12px 20px;background:#24231b;gap:16px;user-select:none;-webkit-user-select:none}
.system-buttons{display:flex;flex-direction:column;gap:7px}
.system-buttons button{font-size:10px;min-height:36px;padding:5px 12px;touch-action:none}
.dpad{width:132px;height:132px;position:relative;touch-action:none;flex-shrink:0}
.dpad button{position:absolute;width:44px;height:44px;padding:0;display:grid;place-items:center;font-size:20px;touch-action:none}
.dpad [data-code=ArrowUp]{left:44px;top:0}
.dpad [data-code=ArrowLeft]{left:0;top:44px}
.dpad [data-code=ArrowRight]{left:88px;top:44px}
.dpad [data-code=ArrowDown]{left:44px;top:88px}
.actions{display:flex;align-items:center;gap:12px}
.actions button{border-radius:50%;width:56px;height:56px;font:600 16px monospace;background:#4a342a;touch-action:none}
.actions button:nth-child(2){background:#3d4833}
.actions button:nth-child(3){background:#3b4046}
.pressed{filter:brightness(1.7);border-color:var(--gold)}
.expanded .touch{flex-shrink:0}
@media(min-width:800px) and (min-height:600px){.dpad{width:110px;height:100px;transform:scale(.72);transform-origin:left center;margin-right:-30px}
.touch{padding:3px 20px}
.system-buttons{flex-direction:row}
.actions button{width:44px;height:44px}
}
@media(max-width:600px){.touch{padding:10px;gap:8px;flex-wrap:wrap}
.system-buttons{flex-direction:row;width:100%;justify-content:center;order:-1}
.system-buttons button{flex:1}
.dpad{width:132px;height:132px}
.actions{gap:7px}
.actions button{width:46px;height:46px}
}
@media(orientation:landscape) and (max-height:600px){.touch,.expanded .touch{position:absolute;inset:44px 10px 0;padding:0;background:transparent;pointer-events:none;flex-wrap:nowrap}
.dpad,.actions{pointer-events:auto}
.system-buttons{position:absolute;bottom:5px;left:140px;right:140px;width:auto;flex-direction:row;justify-content:center;pointer-events:auto}
.system-buttons button{font-size:10px;padding:5px 9px}
.actions{width:135px;flex-wrap:wrap;justify-content:center;gap:8px}
.actions button{width:46px;height:46px}
}
.stick-shaft,.stick-ball{display:none}
html[data-controls=touch] .touch{position:absolute;inset:0;margin:0;padding:0;display:block;background:none;pointer-events:none;z-index:3}
html[data-controls=touch] .system-buttons button{font:700 10px/1.2 monospace;letter-spacing:.06em;color:#f9edce;background:linear-gradient(#645844e6,#302a20e6);border:2px solid #bba87999;border-bottom:4px solid #17130f;border-radius:5px;box-shadow:inset 0 1px #fff5,0 2px 0 #0009,0 3px 8px #0008;text-shadow:0 1px #000;min-height:37px;padding:7px 10px;touch-action:none}
html[data-controls=touch] .system-buttons{position:absolute;top:max(10px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:auto;bottom:auto;width:auto;display:flex;flex-direction:row;gap:8px;pointer-events:auto}
html[data-controls=touch] .system-buttons button{flex:none}
html[data-controls=touch] .system-buttons button:first-child{color:#ffdc74;border-color:#c49c42;}
html[data-controls=touch] .system-buttons button:nth-child(2){color:#aef0c4;border-color:#668d63}
html[data-controls=touch] .dpad{position:absolute;bottom:max(18px,env(safe-area-inset-bottom));left:max(18px,env(safe-area-inset-left));width:138px;height:138px;transform:none;margin:0;border-radius:50%;background:radial-gradient(circle,#1a1915a8 0 35%,#5c554570 36% 48%,#16151099 49% 65%,#c4b58b60 66% 68%,#17161288 69%);border:2px solid #a3946d66;box-shadow:inset 0 3px 7px #000b,0 2px 5px #0008;pointer-events:auto;touch-action:none}
html[data-controls=touch] .dpad::before{content:'';position:absolute;inset:17px;border-radius:50%;border:1px dashed #d8bd7466;pointer-events:none}
html[data-controls=touch] .dpad button{opacity:0;pointer-events:none}
html[data-controls=touch] .stick-shaft{display:block;position:absolute;left:calc(50% - 8px);top:calc(50% - 4px);width:16px;height:37px;border-radius:5px;background:linear-gradient(90deg,#444,#d7d1b7 45%,#77725c 65%,#222);transform:translate(var(--stick-x,0px),var(--stick-y,0px));box-shadow:2px 3px 3px #0008;pointer-events:none}
html[data-controls=touch] .stick-ball{display:block;position:absolute;left:calc(50% - 28px);top:calc(50% - 36px);width:56px;height:56px;border-radius:50%;background:radial-gradient(circle at 30% 23%,#ffbc9477 1%,#e9503e 16%,#ab201b 57%,#420e10 88%);border:1px solid #f48a6366;box-shadow:inset -5px -6px 8px #4f080b99,inset 2px 3px 4px #ffc98f88,4px 9px 10px #000a;transform:translate(var(--stick-x,0px),var(--stick-y,0px));pointer-events:none}
html[data-controls=touch] .actions{position:absolute;right:max(18px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(2,62px);gap:12px;width:auto;pointer-events:auto}
html[data-controls=touch] .actions button{--face:#ed5145;--shine:#ffb58e;--shade:#821c23;width:62px;height:62px;min-height:0;padding:0;border:4px solid #272019;border-radius:50%;background:radial-gradient(circle at 32% 23%,var(--shine),var(--face) 38%,var(--shade) 95%);box-shadow:0 0 0 2px #b4a17a77,inset 0 3px 3px #fff6,inset 0 -5px 1px #0005,0 6px 0 #070604aa,0 9px 9px #0007;color:#fff4d6;font:900 22px/1 monospace;text-shadow:0 2px 2px #000a;touch-action:none;filter:none}
html[data-controls=touch] .actions button[data-color=blue]{--face:#378bd2;--shine:#b4e5ff;--shade:#12446e}
html[data-controls=touch] .actions button[data-color=yellow]{--face:#e4b62e;--shine:#fff1ac;--shade:#7d5710}
html[data-controls=touch] .actions button.pressed{transform:translateY(4px);box-shadow:0 0 0 2px #d6bc7e99,inset 0 4px 8px #0005,0 2px 0 #070604aa;filter:brightness(1.15)}
html[data-controls=touch] .system-buttons button.pressed{transform:translateY(2px);filter:brightness(1.2);border-bottom-width:2px}
@media(max-width:500px){html[data-controls=touch] .dpad{width:118px;height:118px;left:14px;bottom:max(16px,env(safe-area-inset-bottom))}
html[data-controls=touch] .actions{grid-template-columns:repeat(2,54px);gap:10px;right:14px}
html[data-controls=touch] .actions button{width:54px;height:54px}
html[data-controls=touch] .system-buttons button{font-size:9px;padding:6px;min-height:35px}
html[data-controls=touch] .system-buttons{gap:5px;left:8px}
}

html[data-controls=touch] .arcade-controller .actions[data-count="3"] button:last-child{grid-column:2}
html[data-controls=touch] .arcade-controller .actions[data-count]:not([data-count="3"]) button:last-child{grid-column:auto}
html[data-controls=touch] .arcade-controller .actions button[data-color=green]{--face:#45b464;--shine:#bcf5bb;--shade:#20532c}
.rotate-tip{display:none}
@media(orientation:portrait){html[data-controls=touch] .rotate-tip{display:block;position:absolute;bottom:155px;left:0;right:0;text-align:center;color:#c5b792b3;font:10px/1.5 monospace;pointer-events:none;margin:0}}
/* Six-button fighting layout: punch row above kick row. */
.arcade-controller .actions[data-count="6"]{display:grid;grid-template-columns:repeat(3,44px);gap:9px;width:auto}
html[data-controls=touch] .arcade-controller .actions[data-count="6"]{grid-template-columns:repeat(3,54px);gap:10px}
html[data-controls=touch] .arcade-controller .actions[data-count="6"] button{width:54px;height:54px}
@media(max-width:600px){html[data-controls=touch] .arcade-controller .actions[data-count="6"]{grid-template-columns:repeat(3,46px);gap:7px;right:12px}html[data-controls=touch] .arcade-controller .actions[data-count="6"] button{width:46px;height:46px}}
