/* ---------- kumanda test ve ayar ekranı (src/rc-setup.js) */
.rcs { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; }
.rcs[hidden], .rcs [hidden] { display: none !important; }
.rcs-back {
  position: absolute; inset: 0; background: rgba(8, 10, 13, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.rcs-sheet {
  position: relative; display: grid; grid-template-rows: auto auto minmax(0, 1fr);
  width: min(980px, calc(100vw - 48px)); height: min(700px, calc(100dvh - 48px));
  background: rgba(16, 19, 24, 0.95); border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); overflow: hidden; outline: none;
}

.rcs-head { display: flex; align-items: center; gap: 14px; padding: 14px 14px 12px 22px; border-bottom: 1px solid var(--line); }
.rcs-head h3 { margin: 0; flex: 1; min-width: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcs-src { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; }
.rcs-src span { overflow: hidden; text-overflow: ellipsis; }
.rcs-live { flex: none; width: 7px; height: 7px; border-radius: 50%; background: rgba(244, 246, 248, 0.35); }
.rcs-live.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.rcs-close { flex: none; width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, 0.06); }
.rcs-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.rcs-tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.rcs-tabs::-webkit-scrollbar { display: none; }
.rcs-tabs button {
  flex: none; padding: 12px 12px 10px; border: 0; border-radius: 0; background: transparent;
  color: var(--muted); font-weight: 600; white-space: nowrap;
  box-shadow: inset 0 -2px 0 transparent; transition: color 0.15s, box-shadow 0.15s;
}
.rcs-tabs button:hover { background: transparent; color: var(--text); }
.rcs-tabs button.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.rcs-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.rcs-body { overflow-y: auto; padding: 20px 22px 26px; overscroll-behavior: contain; }
.rcs-sec + .rcs-sec { margin-top: 20px; }
.rcs-sec h4, .rcs-th {
  margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.rcs-hint { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.rcs .num { font: 12px var(--mono); color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rcs .num.strong { color: var(--text); font-weight: 600; }
.rcs button:disabled { opacity: 0.4; cursor: default; }
.rcs button:disabled:hover { background: rgba(255, 255, 255, 0.1); }
.rcs button.primary:disabled:hover { background: var(--accent); }
.rcs .rcs-quiet { background: transparent; color: var(--muted); }
.rcs .rcs-quiet:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.rcs-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---- çubuk kutuları ve teker */
.rcs-sticks { display: flex; align-items: flex-start; gap: 14px; }
.rcs-stick { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rcs-stick canvas {
  display: block; width: 216px; height: 216px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.025);
}
.rcs-stick p { margin: 0; display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.rcs-stick p b { font-weight: 600; }
.rcs-stick p span { font-size: 12px; color: var(--muted); }
.rcs-wheelcol { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rcs-wheelcol p { margin: 0; font-size: 12px; color: var(--muted); }
.rcs-wheel {
  position: relative; width: 14px; height: 216px;
  border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, 0.025);
}
.rcs-wheel::after { content: ''; position: absolute; left: 2px; right: 2px; top: 50%; height: 1px; background: rgba(255, 255, 255, 0.16); }
.rcs-wheel i { position: absolute; left: 50%; z-index: 1; }
.rcs-wheel i.out { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(47, 140, 255, 0.7); }
.rcs-wheel i.raw { width: 20px; height: 2px; margin: -1px 0 0 -10px; border-radius: 1px; background: rgba(244, 246, 248, 0.6); }
.rcs-wrange { position: absolute; left: 1px; right: 1px; border: 1px dashed rgba(47, 140, 255, 0.6); border-radius: 5px; background: rgba(47, 140, 255, 0.1); }
.rcs-sticks.small canvas { width: 150px; height: 150px; }
.rcs-sticks.small .rcs-wheel { height: 150px; }
.rcs-legend { display: flex; align-items: center; gap: 6px; margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.rcs-legend i { flex: none; border-radius: 50%; }
.rcs-legend i.ring { width: 11px; height: 11px; border: 1.5px solid rgba(244, 246, 248, 0.6); }
.rcs-legend i.dot { width: 9px; height: 9px; margin-left: 10px; background: var(--accent); }

/* ---- Test */
.rcs-test { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: start; }
.rcs-tr {
  display: grid; grid-template-columns: minmax(0, 1fr) 6.5ch minmax(70px, 1.3fr) 6.5ch;
  align-items: center; column-gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line);
}
.rcs-th { margin: 0; padding: 0 2px 8px; }
.rcs-th .num { font: inherit; }
.rcs-axname { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.rcs-axname b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcs-axname small { font: 11px var(--mono); color: var(--muted); white-space: nowrap; }
.rcs-axname small.dim { opacity: 0.6; font-family: inherit; }
.rcs-bar { position: relative; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); }
.rcs-bar::before { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: rgba(255, 255, 255, 0.25); }
.rcs-bar .fill { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; border-radius: 3px; background: var(--accent); }
.rcs-bar .tick { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: rgba(244, 246, 248, 0.75); }
.rcs-btns { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.rcs-btn { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.rcs-btn i { width: 8px; height: 8px; border-radius: 50%; background: rgba(244, 246, 248, 0.22); }
.rcs-btn.on { color: var(--text); }
.rcs-btn.on i { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.rcs-mode { display: flex; gap: 20px; font: 600 15px var(--mono); }
.rcs-mode span { padding: 0 2px 5px; color: rgba(244, 246, 248, 0.32); box-shadow: inset 0 -2px 0 transparent; }
.rcs-mode span.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---- Kalibrasyon */
.rcs-cal {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 36px; align-content: start;
  grid-template-areas: 'info live' 'wiz live' 'acts live' '. live'; grid-template-rows: auto auto auto 1fr;
}
.rcs-wiz, .rcs-cal > .rcs-acts { margin-top: 18px; }
.rcs-cal-info { grid-area: info; }
.rcs-wiz { grid-area: wiz; padding: 2px 0 2px 14px; border-left: 2px solid var(--accent); }
.rcs-cal-live { grid-area: live; }
.rcs-cal > .rcs-acts { grid-area: acts; }
.rcs-lead { margin: 0 0 12px; max-width: 48ch; font-size: 13px; color: var(--muted); }
.rcs-cal-state { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.rcs-cal-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: rgba(244, 246, 248, 0.35); }
.rcs-cal-state.ok::before { background: var(--ok); }
.rcs-cal-info .rcs-hint { margin-top: 6px; color: var(--ok); }
.rcs-cal-info .rcs-hint.warn { color: var(--warn); }
.rcs-stepno { margin: 0 0 4px; font: 600 11px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.rcs-wiz-title { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.rcs-prog { display: block; height: 4px; margin-top: 12px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, 0.1); }
.rcs-prog i { display: block; width: 0; height: 100%; background: var(--accent); }
.rcs-cal-axes { display: grid; gap: 9px; margin-top: 16px; }
.rcs-cal-ax { display: grid; grid-template-columns: 9em minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13px; }
.rcs-cal-ax > span:first-child { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; }
.rcs-cal-ax small { font-size: 11px; color: var(--muted); }
.rcs-cal-ax .rcs-prog { margin: 0; }
.rcs-cal-ax.done .rcs-prog i { background: var(--ok); }

/* ---- Ayar */
.rcs-axis {
  display: grid; grid-template-columns: 150px 84px minmax(0, 1fr); gap: 20px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.rcs-axis:first-of-type { border-top: 1px solid var(--line); }
.rcs-axis-name { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rcs-axis-name > span { display: flex; flex-direction: column; gap: 1px; }
.rcs-axis-name b { font-size: 14px; font-weight: 600; }
.rcs-axis-name small { font-size: 12px; color: var(--muted); }
.rcs-inv { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); cursor: pointer; }
.rcs-curve { display: block; width: 84px; height: 84px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.025); }
.rcs-axis-sliders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.rcs-slider { display: flex; flex-direction: column; gap: 2px; min-width: 0; cursor: pointer; }
.rcs-sl-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); }
.rcs-sl-line > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcs-sl-line b { font: 600 12px var(--mono); color: var(--text); white-space: nowrap; }
.rcs-sl-line b.is-global { color: var(--muted); }
.rcs-tune .rcs-acts { justify-content: flex-end; margin-top: 10px; }
.rcs-speeds .rcs-hint { margin-bottom: 12px; }
.rcs-speed-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 28px; }
.rcs-speed-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rcs-speed-col.off .rcs-slider { opacity: 0.45; cursor: default; }
.rcs-speed-head { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
.rcs-speed-col .rcs-hint { margin: 0; }

/* kaydırıcılar: ince iz, dolu kısım vurgulu (--p) */
.rcs input[type='range'] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; padding: 0;
  background: transparent; cursor: pointer; --p: 50%;
}
.rcs input[type='range']::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(to right, var(--accent) var(--p), rgba(255, 255, 255, 0.16) var(--p));
}
.rcs input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(47, 140, 255, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
}
.rcs input[type='range']::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.16); }
.rcs input[type='range']::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
.rcs input[type='range']::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }
.rcs input[type='range']:focus-visible { outline: none; }
.rcs input[type='range']:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent); }
.rcs input[type='range']:disabled { cursor: default; }

/* ---- Gamepad */
.rcs-pad { max-width: 640px; }
.rcs-field { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 42px; font-size: 14px; color: var(--muted); }
.rcs-field b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.rcs-pad .rcs-hint { margin-top: 4px; }
.rcs select {
  -webkit-appearance: none; appearance: none; min-width: 170px; max-width: 230px;
  font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
  background: rgba(255, 255, 255, 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aab' stroke-width='2'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 8px center / 16px;
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 30px 7px 10px;
}
.rcs select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.rcs select option { background: #1d2127; color: var(--text); }
.rcs-padaxes .rcs-tr { grid-template-columns: minmax(0, 1fr) minmax(80px, 1.6fr) 6.5ch; }
.rcs-padaxes .rcs-tr:first-child { border-top: 1px solid var(--line); }
.rcs-padbtns { margin: 0; font: 13px var(--mono); }

/* ---- telefon: alttan açılan sayfa */
@media (max-width: 700px) {
  .rcs { place-items: end stretch; }
  .rcs-sheet { width: 100%; height: 92dvh; border-radius: 18px 18px 0 0; border-bottom: 0; }
  .rcs-head { flex-wrap: wrap; gap: 4px 10px; padding: 12px 10px 10px 16px; }
  .rcs-head h3 { font-size: 16px; }
  .rcs-src { order: 3; flex-basis: 100%; font-size: 12px; }
  .rcs-tabs { padding: 0 4px; }
  .rcs-tabs button { padding: 11px 10px 9px; font-size: 13px; }
  .rcs-body { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
  .rcs-test { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .rcs-sticks { justify-content: center; gap: 10px; }
  .rcs-stick canvas, .rcs-sticks.small canvas { width: min(216px, calc(50vw - 42px)); height: min(216px, calc(50vw - 42px)); }
  .rcs-wheel, .rcs-sticks.small .rcs-wheel { height: min(216px, calc(50vw - 42px)); }
  .rcs-test .rcs-axname small { display: none; }
  .rcs-legend { justify-content: center; }
  .rcs-cal { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'info' 'wiz' 'live' 'acts'; grid-template-rows: none; }
  .rcs-cal-live { margin-top: 18px; }
  .rcs-axis { grid-template-columns: 72px minmax(0, 1fr); gap: 10px 14px; align-items: start; }
  .rcs-axis-name { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .rcs-axis-name > span { flex-direction: row; align-items: baseline; gap: 8px; }
  .rcs-curve { width: 72px; height: 72px; }
  .rcs-axis-sliders { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .rcs-speed-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .rcs select { min-width: 0; max-width: 62vw; }
}
@media (max-height: 520px) and (min-width: 701px) {
  .rcs-sheet { height: calc(100dvh - 16px); }
}
