/* Custom stick port tu project game: can co dinh + cum 6 nut + COIN/START.
   Overlay nam trong #wrap (tren iframe), vung trong suot de tap xuyen qua iframe. */
#stickLayer{position:absolute;inset:0;z-index:6;pointer-events:none;overflow:hidden;display:none;touch-action:none;-webkit-touch-callout:none}
/* Dang Do nut: mo khoa clip cua layer + nhac layer len tren cung de nut keo
   di dau cung thay. KHONG duoc doi bottom cua .dst-zone (se lam cum nut nhay). */
body.arranging #stickLayer{z-index:70;overflow:visible}
body.arranging #stickComboBar{z-index:80}
body.stick-on #stickLayer{display:block}
.dst-zone{position:absolute;bottom:calc(12px + env(safe-area-inset-bottom,0px));pointer-events:auto;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
.dst-zone-stick{left:12px;width:min(46vw,196px);height:min(46vw,196px)}
.dst-stick{position:absolute;left:50%;top:50%;width:min(34vmin,152px);height:min(34vmin,152px);transform:translate(-50%,-50%);border-radius:50%;border:2px solid rgba(255,255,255,.28);background:radial-gradient(circle,rgba(20,20,28,.55) 0%,rgba(22,22,30,.8) 100%);opacity:.85;touch-action:none;-webkit-touch-callout:none}
.dst-stick[data-engaged=true]{opacity:1;border-color:#22c55e}
.dst-gate{position:absolute;inset:0;pointer-events:none}
.dst-dir{position:absolute;font-size:15px;color:rgba(255,255,255,.75);line-height:1;transform:translate(-50%,-50%);pointer-events:none}
.dst-dir[data-dir=UP]{left:50%;top:11%}
.dst-dir[data-dir=RIGHT]{left:89%;top:50%}
.dst-dir[data-dir=DOWN]{left:50%;top:89%}
.dst-dir[data-dir=LEFT]{left:11%;top:50%}
.dst-dir[data-on=true]{color:#22c55e}
.dst-knob{position:absolute;left:50%;top:50%;width:44%;height:44%;border-radius:50%;background:radial-gradient(circle at 35% 30%,#52525b,#16161c);border:2px solid rgba(255,255,255,.35);transform:translate(-50%,-50%);pointer-events:none;box-shadow:0 2px 8px rgba(0,0,0,.55);touch-action:none;-webkit-touch-callout:none}
.dst-zone-cluster{right:12px;width:min(54vw,236px);display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.dst-zone-cluster .dst-key:nth-child(3n+2){transform:translateY(-9%)}
.dst-zone-cluster .dst-key:nth-child(3n){transform:translateY(-16%)}
.dst-key{position:relative;aspect-ratio:1/1;border-radius:50%;border:2px solid rgba(255,255,255,.28);background:rgba(20,20,28,.62);color:#fff;display:flex;align-items:center;justify-content:center;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;padding:0;cursor:pointer}
.dst-cap{font-size:15px;font-weight:700;line-height:1;pointer-events:none;color:rgba(255,255,255,.92);-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.dst-key[data-off="1"]{opacity:.18!important;border-style:dashed}
.dst-zone-stick[data-off="1"]{opacity:.35}
.dst-zone-stick[data-off="1"] .dst-stick{border-style:dashed}
.dst-key[data-pressed=true]{border-color:#2563eb;background:rgba(37,99,235,.6)}
.dst-key[data-pressed=true] .dst-cap{color:#fff}
/* Nut dang duoc keo (che do Do nut): noi len tren moi thu + vien sang de thay ro */
.dst-dragging{position:relative;z-index:999;box-shadow:0 0 0 2px #2563eb,0 8px 24px rgba(0,0,0,.55)}
.dst-zone-system{left:50%;transform:translateX(-50%);display:flex;gap:10px;bottom:calc(24px + env(safe-area-inset-bottom,0px) + min(46vw,196px))}
/* Dai nut combo: tren hang COIN/START, keo ngang duoc */
/* Dai nut combo: tren hang COIN/START. KHONG dung overflow scroll (se cat nut
   da doi vi tri bang transform) — thay bang wrap nhieu dong, luon thay du nut. */
#stickComboBar{position:absolute;left:50%;transform:translateX(-50%);bottom:calc(64px + env(safe-area-inset-bottom,0px) + min(46vw,196px));z-index:6;display:flex;flex-wrap:wrap;justify-content:center;gap:8px;max-width:94vw;overflow:visible;padding:4px;pointer-events:auto}
#stickComboBar[hidden]{display:none}
.dst-combo{min-width:52px;height:40px;border-radius:12px;padding:0 10px;font-size:12px;font-weight:700;aspect-ratio:auto;touch-action:none;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none}
.dst-combo[data-pressed=true]{border-color:#2563eb;background:rgba(37,99,235,.6)}
/* Panel combo: tai su dung kieu .dstp-* san co */
#comboPanel{position:absolute;top:8px;right:8px;z-index:61;width:min(80vw,264px);max-height:calc(100% - 16px);overflow:auto;background:#101015;border:1px solid #26262e;border-radius:10px;padding:10px 12px;font-size:13px;color:#eee}
#comboPanel[hidden]{display:none}
.dstp-listrow{display:flex;align-items:center;gap:6px;padding:6px 0;border-top:1px solid #26262e;cursor:pointer}
.dstp-lname{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.dstp-lname small{display:block;font-weight:400;color:#aaa;font-size:11px;white-space:normal}
.dstp-mini{width:30px;height:30px;border-radius:8px;border:1px solid #444;background:#16161c;color:#eee;cursor:pointer;font-size:12px;flex:0 0 auto;white-space:nowrap;padding:0 4px;overflow:hidden}
.dstp-mini.active{background:#2563eb;border-color:#2563eb}
.dstp-chips{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.dstp-chip{min-width:40px;height:30px;padding:0 10px;border-radius:8px;border:1px solid #444;background:#16161c;color:#eee;cursor:pointer;font-size:13px}
.dstp-chip.on{background:#2563eb;border-color:#2563eb}
.dstp-preview{font-size:12px;color:#4ade80;min-height:18px;margin:4px 0;word-break:break-word}
.dstp-wide{width:100%}
.dst-key-pill{aspect-ratio:auto;width:auto;height:auto;border-radius:999px;padding:8px 14px}
.dst-key-pill .dst-cap{font-size:11px;letter-spacing:.5px}
/* Panel cai dat joystick (gear): nam trong #wrap de hien ca khi fullscreen */
#stickPanel{position:absolute;top:8px;right:8px;z-index:60;width:min(80vw,264px);max-height:calc(100% - 16px);overflow:auto;background:#101015;border:1px solid #26262e;border-radius:10px;padding:10px 12px;font-size:13px;color:#eee}
#stickPanel[hidden]{display:none}
.dstp-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px;font-weight:700;touch-action:none;cursor:move}
.dstp-x{width:30px;height:30px;border-radius:8px;border:1px solid #444;background:#16161c;color:#eee;cursor:pointer;font-size:14px;line-height:1}
.dstp-row{display:flex;align-items:center;gap:8px;margin:8px 0}
.dstp-row>span:first-child{flex:0 0 62px;color:#aaa}
.dstp-row input[type=range]{flex:1;min-width:0;accent-color:#2563eb}
.dstp-row input[type=text]{flex:1;min-width:0;font-size:16px;height:28px;padding:0 8px;border:1px solid #444;background:#16161c;color:#eee;border-radius:8px}
.dstp-row input[type=text]:disabled{opacity:.4}
.dstp-row select{flex:1;min-width:0;font-size:13px;height:28px;padding:0 6px;border:1px solid #444;background:#16161c;color:#eee;border-radius:8px}
.dstp-val{min-width:36px;text-align:right}
.dstp-btns{justify-content:stretch}
.dstp-btn{flex:1;height:30px;padding:0 10px;border:1px solid #444;background:#16161c;color:#eee;border-radius:8px;cursor:pointer;font-size:13px;white-space:nowrap}
.dstp-btn.active{background:#2563eb;border-color:#2563eb}
.dstp-hint{margin-top:6px;font-size:11px;line-height:1.5;color:#888}
