* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 24px 14px;
  color: #e5efff;

  /* ✅ Glossy navy blue background */
  background:
    radial-gradient(1200px 700px at 15% 10%, rgba(90, 130, 255, 0.35), transparent 55%),
    radial-gradient(900px 500px at 80% 20%, rgba(0, 255, 209, 0.12), transparent 50%),
    radial-gradient(800px 600px at 50% 110%, rgba(34, 197, 94, 0.10), transparent 60%),
    linear-gradient(180deg, #06122a 0%, #071a38 40%, #05112a 100%);
  min-height: 100vh;
}

.container {
  max-width: 1050px;
  margin: 0 auto;
}

h1 {
  margin: 0 0 12px;
  font-size: 26px;
  color: #ffffff;
  letter-spacing: 0.2px;
}

/* Status */
.status {
  margin: 10px 0 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #dbeafe;
}

/* Cards */
.table-card,
.risk-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ✅ Risk scale (above table) */
.risk-card {
  padding: 16px;
  margin: 0 0 14px;
}

.risk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.risk-title {
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #ffffff;
}

.risk-values .pill {
  display: inline-block;
  margin-right: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 13px;
  color: #dbeafe;
}

.risk-bar-wrap {
  position: relative;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
}

/* Segments */
.risk-segment { position: absolute; top: 0; bottom: 0; }

.risk-segment.lower  { background: rgba(239, 68, 68, 0.25); }
.risk-segment.middle { background: rgba(234, 179, 8, 0.22); }
.risk-segment.higher { background: rgba(34, 197, 94, 0.22); }

/* Two thumbs */
.marker-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 34px;
  margin: 0;
  background: transparent;

  pointer-events: none;
  z-index: 5;

  -webkit-appearance: none;
  appearance: none;
}

.marker-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;

  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0b1020;
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);

  pointer-events: auto;
  cursor: grab;
}

.marker-input::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  appearance: none;
  height: 34px;
  background: transparent;
}

.marker-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0b1020;
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  pointer-events: auto;
  cursor: grab;
}
.marker-input::-moz-range-track {
  height: 34px;
  background: transparent;
}

/* Legend */
.risk-legend {
  margin-top: 10px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #dbeafe;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}

.lower-swatch  { background: rgba(239, 68, 68, 0.75); }
.middle-swatch { background: rgba(234, 179, 8, 0.75); }
.higher-swatch { background: rgba(34, 197, 94, 0.75); }

/* Table header */
.table-card {
  padding: 14px;
  margin-top: 6px;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.table-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
}

.season-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dbeafe;
}

.season-control select {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: #e5efff;
}

/* Table */
#metricsTable {
  width: 100%;
  border-collapse: collapse;
}

#metricsTable th,
#metricsTable td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}

#metricsTable th {
  color: #e5efff;
  background: rgba(255,255,255,0.06);
  text-align: left;
  font-weight: 800;
}

#metricsTable td {
  background: rgba(255,255,255,0.03);
  color: #e5efff;
}

td.metric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Cell color classes (Risk Scale scheme) */
td.metric-cell.val-red {
  background: rgba(239, 68, 68, 0.22) !important;
  color: #fecaca !important;
}

td.metric-cell.val-yellow {
  background: rgba(234, 179, 8, 0.22) !important;
  color: #fde68a !important;
}

td.metric-cell.val-green {
  background: rgba(34, 197, 94, 0.22) !important;
  color: #bbf7d0 !important;
}

/* ============================================================
   NEW: Previous Games slider (single thumb, styled like the risk scale)
   ============================================================ */
.games-bar-wrap {
  position: relative;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
}

/* Filled portion = games included */
.games-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(90, 130, 255, 0.30);
  pointer-events: none;
}

.games-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 34px;
  margin: 0;
  background: transparent;
  z-index: 5;
  cursor: pointer;

  -webkit-appearance: none;
  appearance: none;
}

.games-input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.games-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0b1020;
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  cursor: grab;
}

.games-input::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  appearance: none;
  height: 34px;
  background: transparent;
}

.games-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0b1020;
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  cursor: grab;
}

.games-input::-moz-range-track {
  height: 34px;
  background: transparent;
}

.games-swatch { background: rgba(90, 130, 255, 0.75); }