/* Gamepad tester — tool-specific UI. Layout chrome comes from shared.css. */

.gp-stage { max-width: 760px; margin: 0 auto; }

/* ── Status banner ── */
.gp-status {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 18px; text-align: center;
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  background: var(--surface2); color: var(--muted); font-weight: 600;
}
.gp-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
[data-gamepad].is-connected .gp-status { border-style: solid; border-color: var(--teal); background: #ecfdf5; color: var(--teal-dark); }
[data-gamepad].is-connected .gp-dot { background: var(--teal); box-shadow: 0 0 0 4px rgba(5,150,105,.18); }

/* ── Panel ── */
.gp-panel { margin-top: 16px; }

.gp-meta {
  display: grid; gap: 6px; margin-bottom: 16px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.gp-meta-row { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.gp-meta-row .k { color: var(--muted); font-weight: 600; }
.gp-meta-row .v { font-family: var(--mono); color: var(--text); text-align: right; word-break: break-word; }

/* ── Sticks ── */
.gp-sticks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.gp-stick {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.gp-stick-box {
  position: relative; width: 150px; max-width: 100%; aspect-ratio: 1;
  border-radius: 50%; background: radial-gradient(circle, var(--surface2), var(--surface));
  border: 2px solid var(--border);
}
.gp-stick-box::before, .gp-stick-box::after {
  content: ''; position: absolute; background: var(--border);
}
.gp-stick-box::before { left: 50%; top: 8%; bottom: 8%; width: 1px; transform: translateX(-.5px); }
.gp-stick-box::after  { top: 50%; left: 8%; right: 8%; height: 1px; transform: translateY(-.5px); }
.gp-stick-dot {
  position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff; box-shadow: var(--shadow);
  transform: translate(-50%, -50%); will-change: transform;
}
.gp-stick-dot.pressed { background: var(--teal); }
.gp-stick-label { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.gp-stick-val { font-family: var(--mono); font-size: .9rem; color: var(--text); font-variant-numeric: tabular-nums; }

/* ── Triggers ── */
.gp-triggers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.gp-trig {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.gp-trig-label { font-family: 'Orbitron', var(--mono); font-weight: 700; color: var(--muted); }
.gp-trig-bar { height: 12px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.gp-trig-fill { height: 100%; width: 0%; background: var(--accent); transition: width .05s linear; }
.gp-trig-val { font-family: var(--mono); font-size: .85rem; color: var(--text); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }

/* ── Buttons grid ── */
.gp-buttons {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px;
}
.gp-btn {
  padding: 10px 6px; text-align: center; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: background-color .05s ease, border-color .05s ease, color .05s ease;
}
.gp-btn .lbl { font-weight: 700; font-size: .9rem; color: var(--text); }
.gp-btn .val { font-family: var(--mono); font-size: .72rem; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.gp-btn.pressed { background: var(--accent); border-color: var(--accent); }
.gp-btn.pressed .lbl, .gp-btn.pressed .val { color: #fff; }

@media (max-width: 560px) {
  .gp-sticks, .gp-triggers { grid-template-columns: 1fr; }
}
