/* SYSCALL.WIN — web replica of the in-game menu, v4 skin.
   Layout geometry is unchanged (690x494 window, sidebar/panels/rows, widget
   metrics menu.js depends on: .sld__grab 9.4px, borderless sliders). The
   surfaces now speak the site's language: near-black glass, hairline borders,
   pink accent, mono kickers, soft shadows. */

/* ---------- stage ---------- */

body.menu-page { background: var(--bg, #07070b); }

.menu-stage {
  min-height: calc(100vh - 54px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 40px 16px 56px;
}

.stage-head { text-align: center; margin-bottom: 2px; }

.stage-title {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  font-size: clamp(26px, 3.6vw, 36px);
  letter-spacing: -0.02em; line-height: 1.12;
  margin: 0;
}

.stage-note {
  max-width: 640px; margin: 0; text-align: center;
  color: var(--dim, #a4a3ae); font-size: 14px; line-height: 1.55;
}

/* ---------- the menu window ---------- */

.menu {
  --pad: 8px;
  --strip-h: 26px;
  --w-face: #0e0d14;
  --w-line: rgba(255, 255, 255, 0.07);
  --w-field: #171320;
  --w-field-hi: #241a2b;
  --w-field-on: #2e2136;

  position: relative;
  width: 690px; height: 494px;
  padding: var(--pad);
  background: linear-gradient(180deg, var(--w-face), #0a0910);
  border: 1px solid var(--line, #2e1a2a);
  border-radius: 12px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13.5px; color: var(--text, #f7f7f4);
  overflow: hidden;
  transform: scale(var(--menu-scale, 1));
  transform-origin: top center;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 34px 90px -34px rgba(255, 61, 154, 0.30),
    0 18px 50px -20px rgba(0, 0, 0, 0.9);
  user-select: none;
  animation: menuIn 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}
@keyframes menuIn {
  from { opacity: 0; transform: scale(calc(var(--menu-scale, 1) * 0.97)) translateY(14px); }
}

/* title strip: the drag band */
.strip {
  height: var(--strip-h);
  display: flex; align-items: center; gap: 7px;
  padding: 0 2px 6px;
  border-bottom: 1px solid rgba(255, 61, 154, 0.45);
}
.strip__mark { width: 18px; height: 18px; display: block; flex: none; }
.strip__logo {
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-weight: 700; font-size: 13px; line-height: 1;
  letter-spacing: 0.04em;
  color: var(--text, #f7f7f4);
}
.strip__logo span { color: var(--pink, #ff3d9a); }
.strip__tag {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-size: 9.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--dim, #a4a3ae);
}
.strip__tag i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok, #3ddc97); box-shadow: 0 0 8px var(--ok, #3ddc97);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

/* ---------- columns ---------- */

.cols { display: flex; height: calc(494px - 2px - 2 * var(--pad) - var(--strip-h)); }

.sidebar { width: 104px; flex: none; padding: 10px 0 0; }
.vline {
  width: 1px; flex: none;
  background: linear-gradient(180deg, transparent, rgba(255, 61, 154, 0.35) 30%, rgba(255, 61, 154, 0.35) 70%, transparent);
}

.navbtn {
  display: block; width: calc(100% - 12px); height: 34px;
  margin: 0 6px 7px;
  background: transparent;
  border: 1px solid transparent; border-radius: 8px;
  color: var(--dim, #a4a3ae); font: inherit; font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.navbtn:hover { background: var(--w-field-hi); color: var(--text, #f7f7f4); }
.navbtn:active { background: var(--w-field-on); }
.navbtn[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(255, 61, 154, 0.22), rgba(255, 61, 154, 0.10));
  border-color: rgba(255, 61, 154, 0.45);
  color: var(--pink-hi, #ff7ab8);
  box-shadow: 0 0 18px -6px rgba(255, 61, 154, 0.55);
}
.navbtn:focus-visible { outline: 2px solid var(--pink, #ff3d9a); outline-offset: 2px; }

.body {
  flex: 1; min-width: 0;
  padding: 10px 4px 10px 10px;
  overflow-y: auto;                /* scrollbar-gutter keeps the column stable */
  scrollbar-gutter: stable;
}

/* ---------- pages / panels ---------- */

.page { display: flex; gap: 12px; align-items: stretch; min-height: 100%; }
.page--single { display: block; }

.panel {
  flex: 1 1 0; min-width: 0;
  border: 1px solid var(--w-line); border-radius: 10px;
  padding: 9px 11px;
  overflow-y: auto; overflow-x: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.phead {
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--pink, #ff3d9a); text-align: center;
  line-height: 18px; margin-bottom: 6px;
}

/* ---------- rows ---------- */

.row {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 4px; min-height: 21px;
}
.row--right { justify-content: space-between; padding-left: 14px; gap: 9px; }
.lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.lbl--dis { color: var(--faint, #6f6e7a); }

.sep {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: 7px 0 6px;
}

.w119 { width: 119px; flex: none; }

/* checkbox */
.row--cb { cursor: pointer; }
.cb {
  width: 15px; height: 15px; flex: none;
  background: var(--w-field);
  border: 1px solid var(--w-line); border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.row--cb:hover .cb { background: var(--w-field-hi); border-color: rgba(255, 61, 154, 0.35); }
.cb svg { width: 10px; height: 10px; display: none; }
.cb svg path {
  fill: none; stroke: #12040c; stroke-width: 2.1;
  stroke-linecap: round; stroke-linejoin: round;
}
.cb--on {
  background: var(--pink, #ff3d9a);
  border-color: var(--pink, #ff3d9a);
  box-shadow: 0 0 12px -3px rgba(255, 61, 154, 0.7);
}
.cb--on svg { display: block; }

/* frame-shared geometry: slider + combo + keybind.
   .sld must keep no border and no padding: menu.js positions the grab with
   clientWidth and drag-maps with getBoundingClientRect — they must agree. */
.sld, .cmb, .kb {
  position: relative;
  height: 21px;
  border-radius: 6px;
  font-size: 13px; color: var(--text, #f7f7f4);
}

/* slider */
.sld {
  background: var(--w-field);
  box-shadow: 0 0 0 1px var(--w-line) inset;
  cursor: ew-resize;
  width: 65%;
  flex: none;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}
.sld:hover { background: var(--w-field-hi); }
.sld:active { background: var(--w-field-on); box-shadow: 0 0 0 1px rgba(255, 61, 154, 0.45) inset; }
.sld--off { opacity: 0.45; pointer-events: none; }
.sld__grab {
  position: absolute; top: 3px; bottom: 3px;
  width: 9.4px; border-radius: 4px;
  background: var(--pink, #ff3d9a);
  box-shadow: 0 0 10px -1px rgba(255, 61, 154, 0.8);
  pointer-events: none;
  transition: background 0.16s ease;
}
.sld:active .sld__grab { background: var(--pink-hi, #ff7ab8); }
.sld__val {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-size: 11px; letter-spacing: 0.03em;
  pointer-events: none;
}

/* combo (widget left, label right) / right-column combo */
.cmb {
  background: var(--w-field);
  box-shadow: 0 0 0 1px var(--w-line) inset;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 7px;
  cursor: pointer;
  width: 65%; flex: none;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}
.cmb:hover { background: var(--w-field-hi); }
.cmb:active { background: var(--w-field-on); }
.cmb--w119 { width: 119px; }
.cmb__t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cmb__arr { flex: none; margin-left: 6px; display: inline-flex; }
.cmb__arr svg { display: block; width: 9px; height: 6px; }
.cmb__arr svg path { fill: var(--dim, #a4a3ae); }

/* keybind box */
.kb {
  background: var(--w-field);
  box-shadow: 0 0 0 1px var(--w-line) inset;
  border: 0; width: 100%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font: inherit; font-size: 12.5px;
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  letter-spacing: 0.02em;
  transition: background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}
.kb:hover { background: var(--w-field-hi); box-shadow: 0 0 0 1px rgba(255, 61, 154, 0.4) inset; }
.kb:active { background: var(--w-field-on); }
.kb--wait {
  color: var(--pink-hi, #ff7ab8);
  box-shadow: 0 0 0 1px rgba(255, 61, 154, 0.55) inset;
  animation: waitPulse 1.1s ease-in-out infinite;
}
@keyframes waitPulse { 50% { opacity: 0.55; } }

/* colour swatch slot */
.cslot { width: 119px; flex: none; position: relative; height: 21px; }
.csw {
  position: absolute; left: 0; top: 2px;
  width: 17px; height: 17px;
  border-radius: 5px;
  box-shadow: 0 0 0 1px var(--w-line);
  cursor: pointer; overflow: hidden;
  transition: box-shadow 0.16s ease;
}
.csw:hover { box-shadow: 0 0 0 1px rgba(255, 61, 154, 0.55), 0 0 10px -2px rgba(255, 61, 154, 0.6); }
.csw input[type="color"] {
  position: absolute; inset: -4px; width: 200%; height: 200%;
  opacity: 0; cursor: pointer; border: 0; padding: 0;
}

/* ---------- popups (combo / hitbones) ---------- */

.pop {
  position: absolute; top: calc(100% + 3px); left: 0;
  min-width: 100%; z-index: 40;
  background: rgba(15, 13, 20, 0.97);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line, #2e1a2a); border-radius: 8px;
  padding: 3px 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 18px 44px -14px rgba(0, 0, 0, 0.9);
}
.pop__i {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 9px; white-space: nowrap; cursor: pointer;
  line-height: 17px; font-size: 12.5px;
  transition: background 0.12s ease;
}
.pop__i:hover { background: rgba(255, 61, 154, 0.28); }
.pop__i--sel { background: rgba(255, 61, 154, 0.12); color: var(--pink-hi, #ff7ab8); }
.pop__i--sel:hover { background: rgba(255, 61, 154, 0.28); }
.pop__i svg { width: 9px; height: 9px; flex: none; }
.pop__i svg path {
  fill: none; stroke: var(--pink, #ff3d9a); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- key-days readout ---------- */

.days {
  position: absolute; left: 14px; bottom: 9px;
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-size: 11px; letter-spacing: 0.05em;
  color: var(--faint, #6f6e7a);
  pointer-events: none;
}

/* ---------- scrollbars ---------- */

.menu ::-webkit-scrollbar { width: 8px; height: 8px; }
.menu ::-webkit-scrollbar-track { background: transparent; }
.menu ::-webkit-scrollbar-thumb {
  background: #2b2130; border-radius: 99px; border: 2px solid transparent;
  background-clip: padding-box;
}
.menu ::-webkit-scrollbar-thumb:hover { background: #6d2a52; background-clip: padding-box; }
.menu ::-webkit-scrollbar-thumb:active { background: var(--pink, #ff3d9a); background-clip: padding-box; }
.menu ::-webkit-scrollbar-corner { background: transparent; }

/* ---------- small screens: fit() scales the fixed 690px window ---------- */

@media (max-width: 760px) {
  .menu-stage { padding: 26px 8px 40px; gap: 16px; }
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .menu { animation: none; }
  .strip__tag i, .kb--wait { animation: none; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
