/* Flavour velocity — scoped styles for the two read-only screens only.
   Loaded solely by flavour-velocity.html, so nothing here affects other pages. */

/* The seven-column leaderboard will not fit the global .page cap (480px). This
   scoped modifier widens ONLY these two screens; the global .page cap in
   styles.css is deliberately left unchanged (widening app-wide is its own pass). */
.page--wide {
  max-width: 1080px;
}

/* The table is the wide element: let IT scroll on narrow screens rather than
   clipping or forcing the page to scroll horizontally. Keyed off the container,
   never the viewport — a viewport breakpoint above a fixed page cap is what
   caused the tubs-screen clipping bug. */
.vel-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.vel-head h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}
.vel-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  max-width: 60ch;
}

/* --- Controls -------------------------------------------------------------- */
.vel-controls {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin: 16px 0 12px;
}
.vel-ctl label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 5px;
}
.vel-ctl select {
  font: inherit;
  padding: 6px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-primary);
}
.vel-seg {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface-2);
}
.vel-seg button {
  font: inherit;
  font-size: 13px;
  border: 0;
  background: var(--surface-2);
  padding: 7px 13px;
  cursor: pointer;
  color: var(--text-secondary);
  border-right: 1px solid var(--border);
}
.vel-seg button:last-child {
  border-right: 0;
}
.vel-seg button.on {
  background: var(--accent-text);
  color: #fff;
  font-weight: 600;
}
.vel-basis {
  margin-left: auto;
  align-self: center;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
}
.vel-basis-sub {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

/* Warming-up banner */
.vel-note {
  display: flex;
  gap: 9px;
  padding: 10px 14px;
  background: var(--warning-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--warning-text);
  font-size: 12.5px;
  margin-bottom: 14px;
}
.vel-note b {
  font-weight: 650;
}

/* --- Leaderboard table ---------------------------------------------------- */
.vel-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px; /* keeps the 7 columns legible; the wrapper scrolls below this */
}
.vel-table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.vel-table th.num {
  text-align: right;
}
.vel-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.vel-table tbody tr:last-child td {
  border-bottom: 0;
}
.vel-table tbody tr.vel-row:hover {
  background: var(--surface-1);
  cursor: pointer;
}
.vel-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.vel-fl {
  font-weight: 600;
}
.vel-fun {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}
.vel-big {
  font-weight: 650;
  font-size: 14.5px;
}

.vel-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.vel-badge.always {
  background: #eaeff5;
  color: #40566e;
}
.vel-badge.rotational {
  background: #fbeedb;
  color: #9a6516;
}

.vel-barcell {
  width: 130px;
}
.vel-track {
  height: 8px;
  background: var(--surface-1);
  border-radius: 4px;
  overflow: hidden;
}
.vel-fill {
  height: 100%;
  background: var(--accent-text);
  border-radius: 4px;
}
.vel-fill.slow {
  background: var(--status-grey);
}

.vel-conf {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}
.vel-conf.low {
  color: var(--status-orange);
  font-weight: 600;
}

/* A flavour on display now with no completed run yet: shown, but muted and set
   apart from the ranked rows above it. */
.vel-inprog {
  color: var(--text-muted);
  font-style: italic;
  font-size: 12.5px;
}
.vel-inprog-row td {
  background: var(--surface-1);
}

/* --- Group view (slice 2) ------------------------------------------------- */
/* Group rows expand in place to reveal their members. The group row is the
   slot; the caret signals it toggles rather than drilling in. */
.vel-grouprow {
  cursor: pointer;
}
.vel-grouprow:hover {
  background: var(--surface-1);
}
.vel-grouprow.open td {
  border-bottom-color: transparent; /* visually bind the group to its members */
}
.vel-grouprow .vel-fl {
  font-weight: 650;
}
.vel-caret {
  display: inline-block;
  width: 1em;
  margin-right: 4px;
  color: var(--text-muted);
  font-size: 11px;
}
/* Member rows sit indented under an expanded group, on a faint recessed ground. */
.vel-member td {
  background: var(--surface-1);
}
.vel-member td.vel-indent {
  padding-left: 30px;
}
.vel-member .vel-fl {
  font-weight: 500;
}

.vel-grp td {
  background: var(--surface-1);
  padding: 6px 10px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
}

.vel-foot {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}
.vel-foot b {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- Drill-down ----------------------------------------------------------- */
.vel-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.vel-kpi {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.vel-kpi .v {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.vel-kpi .l {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 2px;
}
.vel-kpi .h {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.vel-sparkhd {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin: 4px 0 8px;
}
.vel-spark {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 60px;
  margin-bottom: 26px;
  position: relative;
}
.vel-spark .bar {
  flex: 1;
  background: var(--accent-bg);
  border-top: 2px solid var(--accent-text);
  border-radius: 2px 2px 0 0;
  position: relative;
  min-height: 2px;
}
.vel-spark .bar span {
  position: absolute;
  bottom: -18px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.vel-tag {
  display: inline-block;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--surface-1);
  color: var(--text-secondary);
  font-weight: 600;
}
.vel-tag.merged {
  background: #e6f0fb;
  color: #2a5d92;
}
.vel-tag.set_aside,
.vel-tag.second_life {
  background: #fbeedb;
  color: #9a6516;
}
.vel-tag.still_out {
  background: var(--accent-bg);
  color: var(--accent-text);
}
.vel-sub {
  color: var(--text-muted);
  font-size: 11px;
}

.vel-empty {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text-secondary);
  font-size: 13px;
}
