/* Shared Match Stats, Calm Tabbed Match Centre & Progressive Disclosure (#127)
   Reusable across Match Hub Match Details and Scoreboard Result Summary. */

:root {
  --inoff-ms-p1: #f36a36;
  --inoff-ms-p1-soft: rgba(243, 106, 54, 0.14);
  --inoff-ms-p2: #47626c;
  --inoff-ms-p2-soft: rgba(71, 98, 108, 0.14);
  --inoff-ms-draw: #9aa3a7;
  --inoff-ms-hairline: #eae3d6;
}

/* Hero Avatars + Quiet Subtitle */
.inoff-ms-hero-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.inoff-ms-hero-avatar.is-p1 { background: var(--inoff-ms-p1); }
.inoff-ms-hero-avatar.is-p2 { background: var(--inoff-ms-p2); }

.inoff-ms-hero-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.inoff-ms-hero-sub {
  text-align: center;
  font-size: 12px;
  color: #6b6158;
  line-height: 1.4;
}

.inoff-ms-hero-sub a {
  color: var(--inoff-ms-p2);
  text-decoration: underline;
  text-decoration-color: #8da9b4;
}

/* Compact 6-circle H2H Form Indicator under Hero subtitle (most recent on right) */
.inoff-ms-form-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  background: transparent;
  border: 0;
  padding: 4px 8px;
  border-radius: 9999px;
  cursor: pointer;
  align-self: center;
}

.inoff-ms-form-row.hidden {
  display: none;
}

.inoff-ms-form-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
}

.inoff-ms-form-dot.is-w { background: var(--inoff-ms-p1); }
.inoff-ms-form-dot.is-l { background: var(--inoff-ms-p2); }
.inoff-ms-form-dot.is-d { background: var(--inoff-ms-draw); }
.inoff-ms-form-dot.is-empty {
  background: #f3efe6;
  color: #9aa3a7;
  border: 1px solid #d8d0c0;
}

.inoff-ms-meta-sub {
  font-size: 11.5px;
  color: #6b6158;
  line-height: 1.3;
}

/* Segmented 3-Tab Pill Switcher (matches inoff-shell-switch language) */
.inoff-ms-tabs {
  display: flex;
  align-items: center;
  background: #f3efe6;
  border: 1px solid #d8d0c0;
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.inoff-ms-tabs.hidden {
  display: none;
}

.inoff-ms-tab {
  flex: 1;
  min-height: 40px;
  padding: 6px 8px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: #6b6158;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.inoff-ms-tab:hover {
  color: #1c1c16;
}

.inoff-ms-tab.is-active {
  background: #ffffff;
  color: #aa3600;
  box-shadow: 0 1px 3px rgba(28, 28, 22, 0.1);
}

.inoff-ms-tab.hidden {
  display: none;
}

/* Slim Opposing Comparison Bars */
.inoff-ms-cmp-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 10px;
}

.inoff-ms-cmp-legend .is-p1 { color: var(--inoff-ms-p1); }
.inoff-ms-cmp-legend .is-p2 { color: var(--inoff-ms-p2); }

.inoff-ms-cmp-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.inoff-ms-cmp-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.inoff-ms-cmp-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  font-size: 12px;
}

.inoff-ms-cmp-val-l { font-weight: 600; color: #1c1c16; text-align: left; font-variant-numeric: tabular-nums; }
.inoff-ms-cmp-label { font-size: 11px; font-weight: 600; color: #6b6158; text-align: center; padding: 0 8px; }
.inoff-ms-cmp-val-r { font-weight: 600; color: #1c1c16; text-align: right; font-variant-numeric: tabular-nums; }

.inoff-ms-cmp-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.inoff-ms-cmp-track {
  height: 6px;
  border-radius: 999px;
  background: #eee8dc;
  overflow: hidden;
  display: flex;
}

.inoff-ms-cmp-track.is-left { justify-content: flex-end; }
.inoff-ms-cmp-fill { height: 100%; border-radius: 999px; }
.inoff-ms-cmp-fill.is-p1 { background: var(--inoff-ms-p1); }
.inoff-ms-cmp-fill.is-p2 { background: var(--inoff-ms-p2); }

/* Quiet Progressive-Disclosure Accordions */
.inoff-ms-acc-list {
  margin-top: 16px;
  border-top: 1px solid var(--inoff-ms-hairline);
}

.inoff-ms-acc {
  border-bottom: 1px solid var(--inoff-ms-hairline);
}

.inoff-ms-acc:last-child {
  border-bottom: 0;
}

.inoff-ms-acc-trigger {
  width: 100%;
  min-height: 46px;
  padding: 10px 2px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #1c1c16;
  text-align: left;
  cursor: pointer;
}

.inoff-ms-acc-hint {
  font-size: 11.5px;
  font-weight: 500;
  color: #6b6158;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inoff-ms-acc-chev {
  color: #8b959a;
  display: inline-flex;
  flex-shrink: 0;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.inoff-ms-acc.is-open .inoff-ms-acc-chev {
  transform: rotate(180deg);
}

.inoff-ms-acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 240ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 240ms;
}

.inoff-ms-acc.is-open .inoff-ms-acc-panel {
  grid-template-rows: 1fr;
  visibility: visible;
  transition-delay: 0s;
}

.inoff-ms-acc-clip {
  min-height: 0;
  overflow: hidden;
}

.inoff-ms-acc-body {
  padding: 2px 2px 14px;
}

/* Previous Meetings list inside H2H accordion: flush full-width edge-to-edge (no double border or wasted side gutter) */
.inoff-ms-acc-panel:has(.inoff-mc-list) {
  margin-inline: -16px;
}

.inoff-ms-acc-body:has(> .inoff-mc-list) {
  padding: 0;
}

.inoff-ms-acc-body > .inoff-mc-list {
  border: 0;
  border-top: 1px solid #f2ede2;
  border-radius: 0;
  box-shadow: none;
}

@media (orientation: landscape) and (min-width: 600px) {
  .inoff-ms-acc-panel:has(.inoff-mc-list) {
    margin-inline: 0;
  }

  .inoff-ms-acc-body:has(> .inoff-mc-list) {
    padding: 4px 0 12px;
  }

  .inoff-ms-acc-body > .inoff-mc-list {
    border-top: 0;
  }
}

/* Unified Single-Column Key-Value List for ALL Drill-Downs (#127)
   One font (Sora), one size (13px), two weights (400 label, 600 value) — zero nested boxes. */
.inoff-ms-dl {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.inoff-ms-dl-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid #f2ede2;
  font-size: 13px;
  line-height: 1.4;
}

.inoff-ms-dl-row:first-child {
  border-top: 0;
  padding-top: 4px;
}

.inoff-ms-dl-row dt {
  margin: 0;
  font-weight: 400;
  color: #6b6158;
  flex-shrink: 0;
}

.inoff-ms-dl-row dd {
  margin: 0;
  font-weight: 600;
  color: #1c1c16;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.inoff-ms-dl-row dd a {
  color: var(--inoff-ms-p2);
  text-decoration: underline;
  text-decoration-color: #8da9b4;
}

.inoff-ms-dl-subhead {
  margin: 12px 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b6158;
}

.inoff-ms-dl-subhead:first-child {
  margin-top: 4px;
}

.inoff-ms-notes {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 2.5px solid var(--inoff-ms-p1);
  background: #f8f5ee;
  border-radius: 0 8px 8px 0;
  font-size: 12.5px;
  font-weight: 400;
  color: #59413a;
  line-height: 1.45;
}

/* Airy 2-Line Frame History */
.inoff-ms-frame-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-top: 1px solid #f2ede2;
}

.inoff-ms-frame-row:first-child { border-top: 0; }

.inoff-ms-frame-top,
.inoff-ms-frame-bot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.inoff-ms-frame-top {
  font-size: 13px;
  font-weight: 600;
  color: #1c1c16;
}

.inoff-ms-frame-bot {
  font-size: 12px;
  font-weight: 400;
  color: #6b6158;
  font-variant-numeric: tabular-nums;
}

.inoff-ms-fnum {
  color: #6b6158;
  font-weight: 500;
  margin-right: 6px;
}

.inoff-ms-ftag {
  font-size: 11px;
  font-weight: 600;
  color: var(--inoff-ms-p1);
  margin-left: 6px;
}

.inoff-ms-ftag.is-rd { color: var(--inoff-ms-p2); }

.inoff-ms-fscore {
  font-weight: 600;
  color: #1c1c16;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* H2H Tab: BIG Percentage Headline + Counts + Split Bar */
.inoff-ms-h2h-nums {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 8px;
  margin: 14px 0 10px;
}

.inoff-ms-h2h-name {
  font-size: 12px;
  font-weight: 600;
  color: #1c1c16;
  margin-bottom: 3px;
}

.inoff-ms-h2h-name.is-center { text-align: center; color: #6b6158; font-weight: 500; }
.inoff-ms-h2h-name.is-right { text-align: right; }

.inoff-ms-h2h-pct {
  font-family: 'Oswald', 'Arial Narrow', system-ui, sans-serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.inoff-ms-h2h-pct.is-p1 { color: var(--inoff-ms-p1); }
.inoff-ms-h2h-pct.is-draw { color: var(--inoff-ms-draw); font-size: 24px; text-align: center; }
.inoff-ms-h2h-pct.is-p2 { color: var(--inoff-ms-p2); text-align: right; }

.inoff-ms-h2h-count {
  font-size: 13px;
  font-weight: 600;
  color: #1c1c16;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.inoff-ms-h2h-count.is-center { text-align: center; color: #6b6158; font-weight: 500; }
.inoff-ms-h2h-count.is-right { text-align: right; }

/* Player Profile 2-Column BIG Headline (Match Win % | Frame Win %) */
.inoff-ms-career-nums {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 12px;
  margin: 14px 0 10px;
}

.inoff-ms-split-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  background: #eee8dc;
}

.inoff-ms-split-bar .is-p1 { background: var(--inoff-ms-p1); }
.inoff-ms-split-bar .is-draw { background: var(--inoff-ms-draw); }
.inoff-ms-split-bar .is-p2 { background: var(--inoff-ms-p2); }

.inoff-ms-chart-wrap {
  width: 100%;
  margin-top: 4px;
}

.inoff-ms-chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .inoff-ms-acc-panel,
  .inoff-ms-acc-chev,
  .inoff-ms-tab {
    transition: none;
  }
}
