/* The settings panel in #settingsPanel and the controls page in #controlsPanel
   (task U1, src/ui/settingspanel.js, controlspage.js). The .panelOverlay /
   .panelCard base rules, the fat .vol slider, kbd, .keyRow and .keysGroup are
   all in styles.css; this file adds only what is new. */

/* ---------------- SETTINGS ----------------
   One line per setting: its name on the left, its control on the right.
   A switch is a fat pill that says ON or OFF; a slider is the SOUND panel's
   own (.vol) with its number beside it; a choice is a few chips, one lit. */
.settingsCard{width:min(520px,94vw);max-height:92vh;background:rgba(10,18,34,.96)}
/* (The page turns touch gestures off for the sake of the steering; a list that
   scrolls says so itself, as the hangar's plane list does.) */
.setList{max-height:62vh;overflow-y:auto;padding-right:4px;touch-action:pan-y;-webkit-overflow-scrolling:touch}
.setGroup{font-size:11px;font-weight:900;letter-spacing:.16em;color:var(--accent);margin:14px 2px 2px}
.setGroup:first-child{margin-top:0}
.setRow{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;min-height:64px;
  padding:6px 2px;border-bottom:1px solid rgba(255,255,255,.08)}
.setRow-range{grid-template-columns:minmax(0,150px) minmax(0,1fr) 44px}
.setName{font-size:14px;font-weight:800;letter-spacing:.08em;line-height:1.25}
.setNum{font-size:17px;font-weight:900;font-variant-numeric:tabular-nums;text-align:right;color:var(--accent)}
.setRange{height:44px}

.setSwitch{position:relative;display:flex;align-items:center;width:104px;height:52px;border-radius:26px;
  border:2px solid var(--edge);background:rgba(255,255,255,.08);transition:background .15s,border-color .15s}
.setSwitch i{position:absolute;top:4px;left:4px;width:40px;height:40px;border-radius:50%;background:#8ea3c4;
  box-shadow:0 2px 6px rgba(0,0,0,.5);transition:left .15s,background .15s}
.setSwitch b{position:absolute;right:12px;font-size:13px;font-weight:900;letter-spacing:.08em;color:var(--dim)}
.setSwitch.on{background:rgba(95,240,138,.22);border-color:#5ff08a}
.setSwitch.on i{left:56px;background:#5ff08a}
.setSwitch.on b{right:auto;left:14px;color:#5ff08a}
.setSwitch:focus-visible,.setChip:focus-visible,.settingsCard .panelFoot button:focus-visible,
.controlsCard .panelFoot button:focus-visible{outline:3px solid #fff;outline-offset:2px}

.setChips{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}
.setChip{min-height:48px;padding:0 14px;border:2px solid var(--edge);border-radius:12px;font-size:12px;font-weight:900;
  letter-spacing:.08em;color:var(--dim);background:rgba(10,18,34,.5)}
.setChip.sel{border-color:var(--accent);color:var(--accent);background:rgba(77,208,255,.14)}
.setEmpty{padding:24px 0;text-align:center;font-size:12px;font-weight:800;letter-spacing:.12em;color:var(--dim)}
.settingsCard .panelFoot .ghostBtn{padding:14px 10px}

/* ---------------- HOW TO FLY ----------------
   Five pictures in words ("DRAG = STEER") in letters big enough to read from
   the sofa, then every key in the game, the way the KEYS panel lists them. */
.controlsCard{width:min(620px,94vw);max-height:92vh;background:rgba(10,18,34,.96)}
.ctlBody{max-height:64vh;overflow-y:auto;padding-right:4px;touch-action:pan-y;-webkit-overflow-scrolling:touch}
.ctlMoves{display:grid;gap:8px}
.ctlMove{display:grid;grid-template-columns:54px minmax(0,1fr);align-items:center;gap:12px;padding:10px 14px;
  border:2px solid var(--edge);border-radius:16px;background:rgba(30,52,92,.35)}
.ctlIcon{font-size:36px;line-height:1;text-align:center}
.ctlLine{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px}
.ctlLine b{font-size:19px;font-weight:900;letter-spacing:.08em;color:var(--ink)}
.ctlLine i{font-size:19px;font-weight:900;font-style:normal;color:var(--dim)}
.ctlLine strong{font-size:22px;font-weight:900;letter-spacing:.1em;color:#ffd24a}
.ctlWords em{display:block;margin-top:3px;font-size:10px;font-weight:700;font-style:normal;letter-spacing:.1em;color:var(--dim)}
.ctlKeysTitle{margin:18px 2px 8px;font-size:13px;font-weight:900;letter-spacing:.16em;text-align:center}

@media (orientation:portrait) and (max-width:480px){
  .setRow-range{grid-template-columns:minmax(0,104px) minmax(0,1fr) 38px;gap:8px}
  .setName{font-size:12px;letter-spacing:.05em}
  .setSwitch{width:96px}
  .setSwitch.on i{left:48px}
  .ctlMove{grid-template-columns:40px minmax(0,1fr);gap:8px;padding:8px 10px}
  .ctlIcon{font-size:28px}
  .ctlLine b{font-size:15px}
  .ctlLine i{font-size:15px}
  .ctlLine strong{font-size:18px}
  .controlsCard .keyRow{grid-template-columns:104px 1fr;gap:8px}
}

@media (orientation:landscape) and (max-height:480px){
  .setList{max-height:54vh}
  .setRow{min-height:52px;padding:3px 2px}
  .setSwitch{height:44px}
  .setSwitch i{width:32px;height:32px}
  .setSwitch.on i{left:64px}
  .ctlBody{max-height:56vh}
  .ctlMoves{grid-template-columns:1fr 1fr}
  .ctlMove{padding:6px 10px}
  .ctlLine b,.ctlLine i{font-size:14px}
  .ctlLine strong{font-size:16px}
}
