/* =====================================================================
   IQStick NEO — shared control styles (companion to iqstick-neo.js)
   Canonical source: app-dev/iq-controls/iqstick-neo.css — vendor byte-identical.
   Adoption contract (class names are part of the standard):
     band    = .touch-controls        zone    = .joy-zone
     cluster = .joy-cluster           pad     = .joypad
     nub     = .joy-nub (+ .joy-hi)   ring    = .joy-ring
     pulse   = .joy-pulse             buttons = .tc
     diamond = .tc-diamond (.d-top/.d-left/.d-right/.d-bottom)
     super   = .tc-super              dash    = .tc-dash (pill, move cluster)
     move cluster = .tc-move          actions = .tc-actions
   NEO GLASS: flat translucent glass, solid IQ pink #FF00C6 edge-light on
   the ACTIVE control only, cool white on idle, rest opacity via --ctl-op.
   ===================================================================== */

/* — floating-spawn grab zone — */
.joy-zone{position:absolute;top:0;bottom:0;left:0;width:47%;z-index:0;touch-action:none}
.touch-controls.mirrored .joy-zone{left:auto;right:0}
.tc-cluster{position:relative;z-index:1}
body.hud-editing .joy-zone{display:none}
/* the stick cluster: editor offset (--hx/--hy) + spawn offset (--sx/--sy) + scale */
.joy-cluster{transform:translate(calc(var(--hx,0px) + var(--sx,0px)),calc(var(--hy,0px) + var(--sy,0px))) scale(var(--hs,1));transform-origin:left bottom}
.touch-controls.mirrored .joy-cluster{transform-origin:right bottom}
.joy-cluster.glide{transition:transform .22s ease-out}

/* — the NEO stick: base ring (deep) · direction ring (mid) · knob (top) — */
.joypad{position:relative;width:168px;height:168px;border-radius:50%;background:rgba(10,14,36,.55);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);border:1.5px solid rgba(255,255,255,.35);box-shadow:0 10px 30px rgba(0,0,0,.5),inset 0 1px 0 rgba(255,255,255,.18);opacity:var(--ctl-op,.7);touch-action:none;user-select:none;-webkit-user-select:none;flex:none;cursor:pointer}
.joypad::after{content:'';position:absolute;inset:-12px;border-radius:50%}
.joypad.on{opacity:1;border-color:#FF00C6;background:rgba(60,8,48,.55);box-shadow:0 10px 30px rgba(0,0,0,.5),0 0 0 1.5px rgba(255,0,198,.45),inset 0 1px 0 rgba(255,255,255,.2)}
.joy-ring{position:absolute;inset:9px;border-radius:50%;border:1.5px solid rgba(255,255,255,.22);pointer-events:none}
.joypad.rim .joy-ring{border-color:#FF00C6;border-width:3px}
.joy-tick{position:absolute;left:50%;top:50%;width:5px;height:12px;margin:-6px 0 0 -2.5px;border-radius:3px;background:rgba(255,255,255,.30);pointer-events:none;z-index:1}
.joy-tick.lit{background:#FF00C6;box-shadow:0 0 10px rgba(255,0,198,.95)}
.joy-pulse{position:absolute;left:50%;top:50%;width:60px;height:60px;margin:-30px 0 0 -30px;border-radius:50%;border:2.5px solid #FF00C6;opacity:0;pointer-events:none;z-index:1}
.joy-pulse.go{animation:joyPulse .34s ease-out}
@keyframes joyPulse{0%{opacity:.95;transform:scale(.45)}100%{opacity:0;transform:scale(2.3)}}
/* console thumbstick knob: concave dish + grip ring (DualSense / Xbox language) */
.joy-nub{position:absolute;left:50%;top:50%;width:78px;height:78px;border-radius:50%;background:radial-gradient(circle at 50% 46%,rgba(110,0,92,.92) 0 30%,rgba(214,0,174,.72) 58%,rgba(255,0,198,.6) 82%,rgba(255,140,230,.85) 100%);border:2px solid rgba(255,255,255,.6);box-shadow:inset 0 4px 9px rgba(0,0,0,.6),inset 0 -3px 6px rgba(255,255,255,.16),inset 0 0 0 5px rgba(0,0,0,.22),0 4px 14px rgba(0,0,0,.5);transform:translate(-50%,-50%);pointer-events:none;z-index:2}
.joy-hi{position:absolute;left:17%;top:11%;width:34%;height:24%;border-radius:50%;background:rgba(255,255,255,.8);filter:blur(3px);pointer-events:none}
.joy-hint{position:absolute;left:0;right:0;bottom:9px;text-align:center;font-size:9px;font-weight:900;letter-spacing:1.4px;color:#B9C6E8;pointer-events:none}

/* — buttons: NEO GLASS, 90ms depress travel, hit area 1.4× visual — */
.tc{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;line-height:1;width:72px;height:72px;border-radius:50%;background:rgba(10,14,36,.55);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);border:1.5px solid rgba(255,255,255,.35);opacity:var(--ctl-op,.7);box-shadow:0 8px 22px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.16);transition:transform .09s ease,opacity .15s ease;color:#fff;cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none}
.tc::after{content:'';position:absolute;inset:-14px;border-radius:50%}
.tc:active,.tc.held{opacity:1;background:rgba(255,0,198,.42);border-color:#FF00C6}
.tc-ic{font-size:24px;line-height:1}
.tc-lab{font-size:8.5px;font-weight:900;letter-spacing:1.2px;color:#B9C6E8}

/* — actions: Super pill over a console diamond — */
.tc-actions{position:relative;flex-direction:column;align-items:center;gap:8px}
.tc-super{width:232px;height:50px;border-radius:999px;flex-direction:row;gap:8px;border-color:rgba(255,217,74,.6)}
.tc-super .tc-ic{font-size:20px}
.tc-super .tc-lab{font-size:11px;letter-spacing:2px;color:#FFD94A}
.tc-super.ready{opacity:1;background:#FF00C6;border-color:#FF00C6;animation:neoMeterPulse .5s infinite alternate}
.tc-super.ready .tc-lab{color:#fff}
@keyframes neoMeterPulse{from{filter:brightness(1)}to{filter:brightness(1.7)}}
.tc-special{border-color:rgba(255,217,74,.7)}
.tc-special .tc-lab{color:#FFD94A}
.tc-diamond{position:relative;width:232px;height:232px;flex:none}
.tc-diamond .tc{position:absolute;width:80px;height:80px}
.tc-diamond .d-top{left:50%;top:0;transform:translateX(-50%)}
.tc-diamond .d-bottom{left:50%;bottom:0;transform:translateX(-50%)}
.tc-diamond .d-left{left:0;top:50%;transform:translateY(-50%)}
.tc-diamond .d-right{right:0;top:50%;transform:translateY(-50%)}
.tc-diamond .d-top:active,.tc-diamond .d-top.held,.tc-diamond .d-bottom:active,.tc-diamond .d-bottom.held{transform:translateX(-50%) translateY(2px) scale(.96)}
.tc-diamond .d-left:active,.tc-diamond .d-left.held,.tc-diamond .d-right:active,.tc-diamond .d-right.held{transform:translateY(-50%) translateY(2px) scale(.96)}

/* — move cluster: stick + Dash pill under the thumb's own column.
     The dash NEVER hangs as an absolute satellite over the other cluster
     (the 412px overlap defect this layout retires). — */
.tc-move{flex-direction:column;align-items:center;gap:8px}
.tc-move .tc-dash{position:static;width:150px;height:46px;border-radius:999px;flex-direction:row;gap:7px;border-color:rgba(255,0,198,.65)}
.tc-move .tc-dash .tc-lab{color:#FF00C6;font-size:10px}
.tc-move .tc-dash .tc-ic{font-size:19px}
.tc-move .tc-dash:active,.tc-move .tc-dash.held{transform:translate(var(--hx,0px),var(--hy,0px)) translateY(2px) scale(.97)}

/* — BOXING preset cluster (.tc-trio): PUNCH primary at the bottom seat,
     SUPER PUNCH pill on top, BLOCK at the left seat. Compact: 204px wide,
     fits beside the 156px phone stick inside a 412px band. — */
.tc-trio{position:relative;width:204px;height:196px;flex:none}
.tc-trio .tc{position:absolute}
.tc-trio .t-super{left:50%;top:0;transform:translateX(-50%);width:196px;height:46px;border-radius:999px;flex-direction:row;gap:7px;border-color:rgba(255,217,74,.6)}
.tc-trio .t-super .tc-ic{font-size:18px}
.tc-trio .t-super .tc-lab{font-size:10px;letter-spacing:1.6px;color:#FFD94A}
.tc-trio .t-super.ready{opacity:1;background:#FF00C6;border-color:#FF00C6;animation:neoMeterPulse .5s infinite alternate}
.tc-trio .t-super.ready .tc-lab{color:#fff}
.tc-trio .t-super:active,.tc-trio .t-super.held{transform:translateX(-50%) translateY(2px) scale(.97)}
.tc-trio .t-punch{right:0;bottom:0;width:88px;height:88px}
.tc-trio .t-punch .tc-ic{font-size:30px}
.tc-trio .t-block{left:0;bottom:6px;width:76px;height:76px}
.tc-trio .t-punch:active,.tc-trio .t-punch.held{transform:translateY(2px) scale(.96)}
.tc-trio .t-block:active,.tc-trio .t-block.held{transform:translateY(2px) scale(.96)}

/* — RETRO skin: same geometry, chunky pixel frame, no glass — */
body.skin-retro .joypad,body.skin-retro .tc{background:#141B3D;backdrop-filter:none;-webkit-backdrop-filter:none;border:3px solid #EDF2FF;border-radius:12px;box-shadow:4px 4px 0 rgba(0,0,0,.55)}
body.skin-retro .joypad{border-radius:14px}
body.skin-retro .joy-nub{background:#FF00C6;border:3px solid #EDF2FF;box-shadow:3px 3px 0 rgba(0,0,0,.5)}
body.skin-retro .joy-hi{display:none}
body.skin-retro .tc-super{border-radius:10px}
body.skin-retro .tc-super.ready{background:#FF00C6}
body.skin-retro .joy-ring{border-color:rgba(255,255,255,.35)}

@media (max-width:560px){
  .joypad{width:156px;height:156px}
  .joy-nub{width:70px;height:70px}
  /* v1.3: diamond 204px -> 220px. With 72px buttons, adjacent centers were
     93.3px at 204 — under the >=100px console law. At 220 they are ~104.7px. */
  .tc-diamond{width:220px;height:220px}
  .tc-diamond .tc{width:72px;height:72px}
  .tc-super{width:204px;height:48px}
  .tc::after{inset:-11px}
}
@media (prefers-reduced-motion:reduce){
  .joy-pulse.go{animation:none}
  .tc-super.ready{animation:none}
  .tc{transition:none}
  .joy-cluster.glide{transition:none}
}
