/* ===========================================================
   Charts and gadgets
   =========================================================== */

/* Sidebar gadgets (home) */
.gadgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 2px solid var(--ink);
  margin-top: 72px;
}
.gadget {
  padding: 28px 28px 32px;
  border-right: 1px solid var(--paper-3);
}
.gadget:last-child { border-right: none; }
.gadget-eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gadget-eyebrow .dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.gadget-title {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 28px;
  line-height: 1.05;
  margin: 0 0 12px;
}
.gadget-body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}
.gadget-stat {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 64px;
  line-height: 0.9;
  margin: 16px 0 8px;
  color: var(--accent);
}

/* The signature overlay chart */
.overlay-section {
  padding: 80px 0 40px;
}
.overlay-frame {
  background: var(--paper-2);
  border: 1px solid var(--ink);
  padding: 40px 40px 32px;
  position: relative;
}
.overlay-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}
.overlay-title {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 44px;
  line-height: 1;
  margin: 0 0 8px;
}
.overlay-sub {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.overlay-legend {
  display: flex;
  gap: 18px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.overlay-legend .sw {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 4px 8px;
  border: 1px solid transparent;
}
.overlay-legend .sw.active { border-color: var(--ink); background: var(--paper); }
.overlay-legend .sw .swab {
  width: 18px;
  height: 3px;
  display: inline-block;
}

/* MMI breakdown card */
.mmi-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 32px 36px 36px;
}
.mmi-card-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: baseline;
  border-bottom: 1px solid var(--paper-3);
  padding-bottom: 16px;
  margin-bottom: 24px;
}
.mmi-card-title {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 36px;
  line-height: 1;
  margin: 0;
}
.mmi-card-score {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 96px;
  line-height: 0.85;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.mmi-card-score .denom {
  font-family: var(--f-mono);
  font-style: normal;
  font-size: 14px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  margin-left: 6px;
  text-transform: uppercase;
  vertical-align: super;
}

.mmi-row {
  display: grid;
  grid-template-columns: 220px 1fr 80px;
  gap: 24px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--paper-3);
}
.mmi-row:last-child { border-bottom: none; }
.mmi-row-label {
  font-family: var(--f-display);
  font-size: 22px;
  font-style: italic;
  line-height: 1.1;
}
.mmi-row-track {
  height: 18px;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--paper-3);
}
.mmi-row-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--ink);
  transition: width 700ms cubic-bezier(.2,.7,.2,1);
}
.mmi-row-fill.accent { background: var(--accent); }
.mmi-row-ticks {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  pointer-events: none;
}
.mmi-row-ticks span {
  border-right: 1px solid var(--paper);
  opacity: 0.6;
}
.mmi-row-ticks span:last-child { border-right: none; }
.mmi-row-score {
  text-align: right;
  font-family: var(--f-mono);
  font-size: 15px;
  letter-spacing: 0.04em;
}
.mmi-row-score b {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 28px;
  margin-right: 2px;
}

/* Scoreboard strip */
.scoreboard {
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  position: relative;
}
[data-palette="forensic"] .scoreboard { background: #08070a; }

.scoreboard-track {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0;
}
.scoreboard-lbl {
  background: var(--accent);
  color: var(--paper);
  padding: 12px 16px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  border-right: 2px solid var(--ink);
}
.scoreboard-games {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  overflow-x: auto;
  scrollbar-width: thin;
}
.scoreboard-games::-webkit-scrollbar { height: 4px; }
.scoreboard-games::-webkit-scrollbar-thumb { background: var(--ink-3); }
.sb-game {
  padding: 10px 18px;
  border-right: 1px solid #2a2a26;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--paper);
  letter-spacing: 0.04em;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}
.sb-game.ok .sb-line { color: #b5e2c0; }
.sb-game.bad .sb-line { color: #f3b8a8; }
.sb-date {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9a948a;
}
.sb-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}
.sb-line .sb-team { font-weight: 600; }
.sb-line .sb-score {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1;
  margin: 0 4px 0 2px;
}
.sb-line .sb-at { color: #6a655c; }
.sb-note {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #b9b2a4;
  text-transform: uppercase;
}
