/* Shared TR/EN 3D controller. All selectors are scoped to this test. */
.g3d-test { --g3d-green: #10a37f; --g3d-tilt: 28deg; --g3d-scale: 1; }
.g3d-test .g3d-card { padding: clamp(16px, 2.4vw, 30px); text-align: left; }
.g3d-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.g3d-eyebrow { display: block; margin-bottom: 10px; color: #8e8e8e; font-size: 10px; letter-spacing: .16em; font-weight: 700; }
.g3d-heading h2 { margin: 0 0 8px; color: #ececec; font-size: clamp(24px, 3vw, 36px); font-weight: 700; letter-spacing: -.04em; }
.g3d-heading p { margin: 0; color: #b4b4b4; font-size: 13px; line-height: 1.6; }
.g3d-badge { display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid #424242; border-radius: 12px; background: #171717; color: #ececec; font: 600 14px ui-monospace, monospace; }
.g3d-badge i { color: var(--g3d-green); }
.g3d-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 14px 0; border-top: 1px solid #424242; }
.g3d-status { display: inline-flex; align-items: center; gap: 8px; color: #b4b4b4; font-size: 11px; }
.g3d-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #8e8e8e; }
.g3d-test.is-connected .g3d-status::before { background: var(--g3d-green); box-shadow: 0 0 12px rgba(16,163,127,.5); }
.g3d-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.g3d-test [hidden] { display: none !important; }
.g3d-view-switch { display: inline-flex; padding: 3px; border: 1px solid #424242; border-radius: 9px; background: #171717; }
.g3d-view-switch button { min-height: 36px; padding: 7px 12px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #b4b4b4; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.g3d-view-switch button[aria-pressed="true"] { border-color: #424242; background: #2f2f2f; color: #ececec; }
.g3d-view-switch button:hover { background: #424242; color: #fff; }
.g3d-controls :focus-visible { outline: 2px solid var(--g3d-green); outline-offset: 3px; }
.g3d-angle { display: inline-flex; align-items: center; gap: 10px; margin: 0; color: #8e8e8e; font-size: 11px; }
.g3d-angle input { width: 90px; min-height: 36px; accent-color: var(--g3d-green); }
.g3d-angle:has(input:disabled) { opacity: .4; }
.g3d-scene { position: relative; isolation: isolate; border: 1px solid #2f2f2f; border-radius: 16px; background-color: #000; background-image: radial-gradient(ellipse at 50% 65%, rgba(16,163,127,.09), transparent 65%), radial-gradient(rgba(180,180,180,.1) .6px, transparent .6px); background-size: auto, 20px 20px; }
.g3d-device-line { display: flex; align-items: baseline; gap: 16px; padding: 18px 20px 0; font: 10px ui-monospace, monospace; color: #8e8e8e; }
.g3d-device-line > span:first-child { flex: 0 0 auto; letter-spacing: .1em; }
.g3d-device-line > span:last-child { margin-left: auto; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; color: #b4b4b4; }
.g3d-stage { display: flex; align-items: center; justify-content: center; height: clamp(250px, 45vw, 420px); overflow: hidden; }
.g3d-fit { flex: 0 0 540px; width: 540px; height: 380px; display: grid; place-items: center; transform: scale(var(--g3d-scale)); }
.g3d-device { position: relative; width: 460px; height: 300px; transform-style: preserve-3d; transform: perspective(1400px) rotateX(var(--g3d-tilt)) rotateZ(-6deg); transition: transform 220ms ease; pointer-events: none; user-select: none; }
.g3d-test.is-top-view .g3d-device { transform: perspective(1400px) rotateX(0deg) rotateZ(0deg); }
.g3d-shell { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.g3d-shell--base { fill: #171717; stroke: #424242; stroke-width: 2; transform: translateZ(-14px) translateY(12px); filter: drop-shadow(10px 28px 12px rgba(0,0,0,.65)); }
.g3d-shell--rim { fill: none; stroke: var(--g3d-green); stroke-width: 1.5; stroke-opacity: .65; transform: translateZ(-8px) translateY(8px); }
.g3d-shell--top { fill: url(#g3d-shell-fill); stroke: #424242; stroke-width: 1.5; }
.g3d-shell--top .g3d-grip-line { fill: none; stroke: #424242; stroke-width: 4; stroke-linecap: round; }
.g3d-brand { position: absolute; left: 184px; top: 54px; width: 92px; text-align: center; color: #b4b4b4; font-size: 17px; font-weight: 800; letter-spacing: -.8px; transform: translateZ(2px); }
.g3d-brand span { color: var(--g3d-green); }
.g3d-button { position: absolute; display: grid; place-items: center; box-sizing: border-box; border: 1px solid #424242; background: linear-gradient(135deg, #424242, #2f2f2f 45%, #212121); color: #ececec; font: 600 12px ui-monospace, monospace; transform: translateZ(10px); box-shadow: 0 2px 0 #171717, 0 5px 0 #424242, 0 7px 5px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.08); transition: transform 60ms ease-out; }
.g3d-button.is-pressed { background: linear-gradient(135deg, #10a37f, #0d8f70); color: #fff; border-color: #10a37f; transform: translateZ(4px) translateY(3px); box-shadow: 0 2px 0 #171717, 0 0 16px rgba(16,163,127,.3); }
.g3d-face { width: 34px; height: 34px; border-radius: 50%; }
.g3d-b0 { left: 338px; top: 139px; }
.g3d-b1 { left: 367px; top: 110px; }
.g3d-b2 { left: 309px; top: 110px; }
.g3d-b3 { left: 338px; top: 81px; }
.g3d-shoulder { top: 43px; width: 82px; height: 21px; font-size: 9px; border-radius: 10px 10px 5px 5px; }
.g3d-b4 { left: 70px; }
.g3d-b5 { left: 308px; }
.g3d-trigger { top: 13px; width: 72px; height: 32px; font-size: 9px; border-radius: 14px 14px 6px 6px; transform-origin: center bottom; transform: translateZ(2px) rotateX(var(--g3d-pull, 0deg)); }
.g3d-trigger--left { left: 75px; }
.g3d-trigger--right { left: 313px; }
.g3d-trigger.is-pressed { transform: translateZ(2px) rotateX(var(--g3d-pull, 0deg)); }
.g3d-dpad { width: 25px; height: 25px; border-radius: 5px; font-size: 14px; }
.g3d-b12 { left: 97px; top: 85px; }
.g3d-b13 { left: 97px; top: 137px; }
.g3d-b14 { left: 71px; top: 111px; }
.g3d-b15 { left: 123px; top: 111px; }
.g3d-system { width: 29px; height: 19px; border-radius: 9px; font-size: 14px; }
.g3d-b8 { left: 188px; top: 100px; }
.g3d-b9 { left: 243px; top: 100px; }
.g3d-b16 { left: 217px; top: 133px; width: 26px; height: 26px; border-radius: 50%; }
.g3d-stick { position: absolute; top: 151px; width: 72px; height: 72px; border: 1px solid #424242; border-radius: 50%; background: radial-gradient(circle, #000 35%, #171717 65%, #424242); box-shadow: inset 0 4px 9px #000, 0 2px 0 #424242; transform: translateZ(4px); transform-style: preserve-3d; }
.g3d-stick--0 { left: 132px; }
.g3d-stick--1 { left: 256px; }
.g3d-stick-cap { position: absolute; top: 50%; left: 50%; width: 52px; height: 52px; border: 1px solid #424242; border-radius: 50%; background: radial-gradient(circle at 40% 32%, #2f2f2f 35%, #212121 52%, #424242 57%, #171717 62%); color: #8e8e8e; display: grid; place-items: center; box-shadow: 0 3px 0 #171717, 0 6px 0 #424242, 0 10px 7px rgba(0,0,0,.5); transform: translate(calc(-50% + var(--g3d-x, 0px)), calc(-50% + var(--g3d-y, 0px))) translateZ(var(--g3d-height, 16px)) rotateX(var(--g3d-rx, 0deg)) rotateY(var(--g3d-ry, 0deg)); }
.g3d-stick-cap small { font: 9px ui-monospace, monospace; }
.g3d-stick-cap.is-pressed { --g3d-height: 9px; border-color: #10a37f; color: #ececec; background: radial-gradient(circle, #0d8f70 35%, #10a37f 55%, #171717 62%); }
.g3d-note { margin: 0; padding: 0 18px 20px; text-align: center; color: #b4b4b4; font-size: 12px; line-height: 1.6; }
.g3d-test.is-unmapped .g3d-note { color: #ececec; }
.g3d-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 16px 0 24px; color: #b4b4b4; font-size: 11px; }
.g3d-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.g3d-legend i { width: 10px; height: 10px; border: 1px solid #424242; border-radius: 3px; background: #2f2f2f; }
.g3d-legend .g3d-led { background: #10a37f; border-color: #10a37f; }
.g3d-legend small { margin-left: auto; color: #8e8e8e; font-size: 11px; }
.g3d-readings-title { color: #ececec; font-size: 16px; font-weight: 600; margin: 0 0 14px; }
.g3d-test .gp-panel, .g3d-test .gp-triggers, .g3d-test .gp-buttons { border-radius: 12px; background: #171717 !important; }
.g3d-test .gp-label { font-size: 12px; font-weight: 600; }
.g3d-test .gp-analog-area { border-color: #424242; background: linear-gradient(transparent calc(50% - .5px), #424242 50%, transparent calc(50% + .5px)), linear-gradient(90deg, transparent calc(50% - .5px), #424242 50%, transparent calc(50% + .5px)), #171717; }
.g3d-test .gp-dot { background: #10a37f; box-shadow: 0 0 12px rgba(16,163,127,.3); transition: none; }
.g3d-axis-values { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 0; color: #8e8e8e; font: 11px ui-monospace, monospace; }
.g3d-axis-values > span:not(.g3d-axis-divider) { min-width: 38px; color: #ececec; }
.g3d-axis-divider { margin: 0 4px; }
.g3d-test .gp-triggers label { font-size: 12px; font-weight: 500; }
.g3d-test .gp-progress { accent-color: #10a37f; }
.g3d-test .gp-progress::-webkit-progress-value { background: #10a37f; }
.g3d-test .gp-progress::-moz-progress-bar { background: #10a37f; }
.g3d-test .gp-button-grid { grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); gap: 8px; }
.g3d-test .gp-button-grid button { border-radius: 8px; font: 11px ui-monospace, monospace; }
.g3d-test .gp-actions { text-align: center; }
.g3d-test .gp-actions .note { color: #8e8e8e; font-size: 11px; margin: 10px 0 0; }
@media (max-width: 575.98px) {
    .g3d-test { --g3d-scale: .5; }
    .g3d-heading { gap: 10px; }
    .g3d-badge { padding: 8px 10px; font-size: 12px; }
    .g3d-controls { width: 100%; justify-content: space-between; gap: 8px; }
    .g3d-angle input { width: 64px; }
    .g3d-device-line { padding: 15px 14px 0; font-size: 9px; }
    .g3d-test .gp-analogs { grid-template-columns: 1fr; }
    .g3d-legend { gap: 10px; }
    .g3d-legend small { width: 100%; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .g3d-device, .g3d-button, .g3d-test .gp-button-grid button { transition: none; }
}
