/* /tester/ — the quick gamepad + keyboard tester (builds on site.css tokens) */
.tx-hero { padding-bottom: 8px; }
.tx-head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: end; }
.tx-head h1 { margin: 0 0 10px; }
.tx-head .lead { margin: 0; max-width: 62ch; }
.tx-head__app { display: grid; gap: 10px; justify-items: start; }
.tx-head__app p { margin: 0; }

.tx { border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface); overflow: hidden; }
.tx-bar { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.tx-ctl { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--text-2); }
.tx-ctl input[type='range'] { width: 110px; accent-color: var(--cyan); }
.tx-ctl b { min-width: 2.6em; font: 600 var(--fs-xs) var(--font-mono); color: var(--text); }
.tx-ctl select { height: 34px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-3); background: var(--bg); color: var(--text); font: inherit; }
.tx-ctl--sel { margin-left: auto; }

/* "Press a Button to See Devices" over the player rows until a controller shows up (stays put while the table scrolls) */
.tx-area { position: relative; }
.tx-empty { position: absolute; left: 0; right: 0; top: 54px; bottom: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; }
.tx-empty[hidden] { display: none; }
.tx-empty span { padding: 12px 22px; border-radius: var(--r); border: 1px solid var(--line-3); background: color-mix(in srgb, var(--bg) 92%, transparent); color: var(--text); font: 600 clamp(1.05rem, 0.9rem + 0.7vw, 1.5rem) var(--font-display); text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
/* the table scrolls inside its frame on a narrow screen, never the page */
.tx-wrap { overflow-x: auto; }
.tx-t { width: 100%; min-width: 980px; border-collapse: collapse; table-layout: fixed; }
.tx-t th, .tx-t td { border: 1px solid var(--line); text-align: center; vertical-align: middle; }
.tx-t thead th { padding: 10px 2px; font: 600 var(--fs-xs) var(--font-mono); color: var(--muted); background: var(--bg); }
.tx-t thead th:first-child { width: 150px; }
.tx-t thead th:nth-last-child(-n + 2) { width: 72px; }
.tx-t tbody th { padding: 10px 12px; text-align: left; background: var(--bg); }
.tx-p { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 8px; border-radius: 50%; background: var(--cyan); color: var(--on-cyan); font: 700 1rem var(--font-display); vertical-align: middle; }
.tx-t tbody th small { display: inline-block; max-width: 92px; vertical-align: middle; font: 500 0.66rem/1.25 var(--font-body); color: var(--text-2); }
.tx-t tr.is-off .tx-p { background: var(--surface-2); color: var(--dim); }
.tx-t tr.is-off th small { color: var(--dim); }
.tx-t td[data-b] { height: 58px; font: 700 0.95rem var(--font-mono); color: var(--on-cyan); transition: background 0.06s; }
.tx-t td[data-b].is-on { background: var(--cyan); }
.tx-t tr.is-off td { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, 0.015) 6px 12px); }
.tx-stick { position: relative; }
.tx-stick::before { content: ''; position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 1.5px solid var(--line-3); }
.tx-stick i { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--line-3); }
.tx-stick i.is-on { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }

.tx-keys { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding: 16px 18px; border-top: 1px solid var(--line); }
.tx-keys span { font-size: var(--fs-sm); color: var(--text-2); }
.tx-keys b { font: 700 clamp(1.3rem, 1rem + 1vw, 2rem)/1.2 var(--font-mono); color: var(--dim); }
.tx-keys b.is-on { color: var(--cyan); }
.tx-hint { margin: 0; padding: 0 18px 16px; }

@media (max-width: 860px) {
  .tx-head { grid-template-columns: 1fr; align-items: start; }
  .tx-ctl--sel { margin-left: 0; }
}
