/* =========================================================================
 * Valour Rift Simulator — page layout + controls. The colorway (tokens,
 * backdrop, .panel surface) is shared from /theme.css, linked before this
 * file; only this page's font, layout and bespoke controls live here.
 * ========================================================================= */
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}

/* ---- Header ---- */
/* The header band (flex, vertical padding, divider) + h1/.sub/.spacer styling
   are shared from /theme.css; this page only sets its horizontal gutter (to
   line up with the .layout padding below) and lets the header wrap. */
header {
  position: relative;
  z-index: 1;
  padding-inline: 26px;
  flex-wrap: wrap;
}

/* ---- Layout ---- */
.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 26px 40px;
  align-items: start;
  max-width: 1120px;
}
.results { display: grid; gap: 20px; }

/* ---- Panels ---- */
/* .panel surface comes from /theme.css; only the headings are styled here. */
.panel > h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .01em;
  color: hsl(300, 50%, 90%);
  text-shadow: 0 1px 10px hsla(300, 70%, 50%, 0.30);
}
.panel h3 {
  margin: 18px 0 4px;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-note {
  margin: 0 0 12px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}
.section-note em { color: hsl(300, 35%, 86%); font-style: normal; font-weight: 600; }

/* ---- Controls ---- */
.field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.field > label {
  flex: 0 0 116px;
  color: var(--text);
  cursor: help;
}
.field input[type="number"] {
  width: 92px;
  background: hsla(300, 30%, 6%, 0.6);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  padding: 7px 10px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.field input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45), var(--glow);
}

/* ---- Power-up level steppers ---- */
.steppers { display: flex; flex-direction: column; gap: 12px; margin-bottom: 4px; }
.stepper {
  display: grid;
  grid-template-columns: 62px auto 1fr;
  align-items: center;
  gap: 12px;
}
.stepper-label { color: var(--text); font-weight: 600; }
.stepper-ctl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: hsla(300, 30%, 6%, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}
.step-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: hsla(300, 50%, 80%, 0.14);
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 130ms ease, transform 80ms ease, opacity 130ms ease;
}
.step-btn:hover { background: hsla(300, 70%, 78%, 0.30); }
.step-btn:active { transform: scale(0.9); }
.step-btn:disabled { opacity: .28; cursor: default; }
.stepper-level {
  min-width: 46px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.stepper-level b { font-size: 17px; color: var(--text); }
.lv-cap { color: var(--muted); font-size: 11px; margin-left: 3px; }
.stepper-value {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 8px;
}
.sv-base { white-space: nowrap; }

/* Glowing effective-value badge beside Speed / Siphon. */
.stepper-glow {
  font-size: 11px;
  font-weight: 600;
  color: hsl(300, 60%, 90%);
  padding: 1px 9px;
  border-radius: 999px;
  background: hsla(300, 65%, 62%, 0.16);
  border: 1px solid hsla(300, 70%, 78%, 0.35);
  text-shadow: 0 0 8px hsla(300, 85%, 72%, 0.75);
  box-shadow: 0 0 12px hsla(300, 80%, 65%, 0.30);
  white-space: nowrap;
}

/* Sync: manual hunt-count entry. */
.sync-value { gap: 7px; }
.sync-hunts {
  width: 66px;
  background: hsla(300, 30%, 6%, 0.6);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 4px 8px;
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.sync-hunts:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45), var(--glow);
}
.sv-unit { color: var(--muted); font-size: 12px; }

/* ---- Augmentation / boost toggle buttons ---- */
.toggle-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.tog {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: hsla(300, 28%, 10%, 0.5);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: border-color 140ms ease, color 140ms ease,
              background 140ms ease, box-shadow 140ms ease;
}
.tog .ic {
  font-size: 15px;
  line-height: 1;
  filter: grayscale(0.55) opacity(0.7);
  transition: filter 140ms ease;
}
.tog:hover { color: var(--text); border-color: hsla(300, 60%, 78%, 0.4); }
.tog.on {
  color: hsl(300, 30%, 96%);
  border-color: var(--accent);
  background: hsla(300, 65%, 62%, 0.26);
  box-shadow: 0 0 0 1px hsla(300, 70%, 75%, 0.35), 0 0 16px hsla(300, 80%, 65%, 0.35);
}
.tog.on .ic { filter: none; }

/* ---- Results stats ---- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
}
.stat {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 11px 13px;
  box-shadow: var(--shadow-sm), var(--inset);
}
.stat .k {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.stat .v {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
  color: var(--text);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}
.stat .v.gold { color: var(--gold); }
.stat .v.pos  { color: var(--green); }
.stat .v.neg  { color: var(--red); }

.meta { color: var(--muted); font-size: 11px; margin: 14px 0 0; }

/* ---- "How far you climb" distribution ---- */
.dist-row {
  display: grid;
  grid-template-columns: 82px 1fr 58px 58px;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  font-variant-numeric: tabular-nums;
}
.dist-head {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
  padding-bottom: 6px;
}
.dist-label { color: var(--text); white-space: nowrap; }
.dist-bar {
  background: hsla(300, 30%, 6%, 0.7);
  border-radius: 999px;
  height: 11px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}
.dist-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 12px hsla(300, 80%, 70%, 0.5);
}
.dist-chance { text-align: right; }
.dist-cum { text-align: right; color: var(--muted); }
.empty-note { color: var(--muted); font-size: 12px; }

@media (max-width: 780px) {
  .layout { grid-template-columns: 1fr; }
}
