/* OPS+ calculator — Roberin sports compact renewal 2026-06-21 */
.ops-plus-baseball-calculator.opsp-rec,
.ops-plus-baseball-calculator.opsp-rec *,
.ops-plus-baseball-calculator.opsp-rec *::before,
.ops-plus-baseball-calculator.opsp-rec *::after {
  box-sizing: border-box;
}

.ops-plus-baseball-calculator.opsp-rec {
  --opsp-shell: #faf2e8;
  --opsp-paper: #fff7e8;
  --opsp-paper-soft: #fbf0dc;
  --opsp-panel: #fffdf7;
  --opsp-input: #fffdf8;
  --opsp-ink: #2b2119;
  --opsp-muted: #67584a;
  --opsp-line: #6b5745;
  --opsp-line-soft: rgba(107, 87, 69, 0.28);
  --opsp-grid: rgba(107, 87, 69, 0.055);
  --opsp-primary-bg: #f2e3d3;
  --opsp-primary-ink: #2b2119;
  --opsp-green: #e3efd2;
  --opsp-green-ink: #2f4e2e;
  --opsp-blue: #dfeef8;
  --opsp-blue-ink: #28455a;
  --opsp-warn: #fff2c1;
  --opsp-placeholder: #b7aba0;
  --opsp-shadow: 4px 4px 0 rgba(72, 55, 40, 0.22);
  --opsp-shadow-soft: 2px 2px 0 rgba(72, 55, 40, 0.14);
  position: relative;
  width: min(100%, 960px);
  margin: 18px auto;
  overflow: hidden;
  border: 2px solid var(--opsp-line);
  border-radius: 0;
  background:
    linear-gradient(var(--opsp-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--opsp-grid) 1px, transparent 1px),
    var(--opsp-paper);
  background-size: 20px 20px, 20px 20px, auto;
  color: var(--opsp-ink);
  box-shadow: var(--opsp-shadow);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.45;
  letter-spacing: 0;
}

body[data-scheme="dark"] .ops-plus-baseball-calculator.opsp-rec,
body[data-scheme="inverse"] .ops-plus-baseball-calculator.opsp-rec,
.ops-plus-baseball-calculator.opsp-rec.dark {
  --opsp-shell: #201811;
  --opsp-paper: #2b2119;
  --opsp-paper-soft: #241c15;
  --opsp-panel: #33271d;
  --opsp-input: #241c15;
  --opsp-ink: #f7ebd8;
  --opsp-muted: #f0dfc5;
  --opsp-line: #a98b6b;
  --opsp-line-soft: rgba(169, 139, 107, 0.48);
  --opsp-grid: rgba(229, 196, 139, 0.06);
  --opsp-primary-bg: #ead6b8;
  --opsp-primary-ink: #21170f;
  --opsp-green: #344a32;
  --opsp-green-ink: #f7ebd8;
  --opsp-blue: #233c43;
  --opsp-blue-ink: #f1e8cf;
  --opsp-warn: #3b2d21;
  --opsp-placeholder: #897a6b;
  --opsp-shadow: 4px 4px 0 rgba(0, 0, 0, 0.34);
  --opsp-shadow-soft: 2px 2px 0 rgba(0, 0, 0, 0.24);
}

@media (prefers-color-scheme: dark) {
  body:not([data-scheme="light"]):not([data-scheme="default"]):not([data-scheme="normal"]) .ops-plus-baseball-calculator.opsp-rec:not(.light) {
    --opsp-shell: #201811;
    --opsp-paper: #2b2119;
    --opsp-paper-soft: #241c15;
    --opsp-panel: #33271d;
    --opsp-input: #241c15;
    --opsp-ink: #f7ebd8;
    --opsp-muted: #f0dfc5;
    --opsp-line: #a98b6b;
    --opsp-line-soft: rgba(169, 139, 107, 0.48);
    --opsp-grid: rgba(229, 196, 139, 0.06);
    --opsp-primary-bg: #ead6b8;
    --opsp-primary-ink: #21170f;
    --opsp-green: #344a32;
    --opsp-green-ink: #f7ebd8;
    --opsp-blue: #233c43;
    --opsp-blue-ink: #f1e8cf;
    --opsp-warn: #3b2d21;
    --opsp-placeholder: #897a6b;
    --opsp-shadow: 4px 4px 0 rgba(0, 0, 0, 0.34);
    --opsp-shadow-soft: 2px 2px 0 rgba(0, 0, 0, 0.24);
  }
}

.ops-plus-baseball-calculator.opsp-rec :where(h2, h3, h4, p) {
  margin: 0;
}

.ops-plus-baseball-calculator.opsp-rec :where(button, input, select, textarea) {
  min-width: 0;
  border-radius: 0 !important;
  font: inherit !important;
  letter-spacing: 0;
}

.opsp-rec__title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px 13px;
  background:
    linear-gradient(90deg, rgba(255, 253, 247, 0.98) 0%, rgba(255, 248, 235, 0.98) 56%, rgba(247, 223, 157, 0.28) 100%),
    var(--opsp-paper);
}

body[data-scheme="dark"] .opsp-rec__title,
body[data-scheme="inverse"] .opsp-rec__title,
.ops-plus-baseball-calculator.opsp-rec.dark .opsp-rec__title {
  background:
    linear-gradient(90deg, rgba(80, 62, 45, 0.94) 0%, rgba(65, 50, 37, 0.94) 58%, rgba(96, 75, 43, 0.72) 100%),
    var(--opsp-panel);
}

.opsp-rec__title-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.opsp-rec__kicker {
  color: var(--opsp-muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.opsp-rec__title h2 {
  color: var(--opsp-ink);
  font-size: 21px;
  font-weight: 950;
  line-height: 1.16;
}

.opsp-rec__title p {
  max-width: 680px;
  color: var(--opsp-muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.opsp-rec__title-pill {
  display: grid;
  min-width: 118px;
  place-items: center;
  border: 1px solid var(--opsp-line);
  background: var(--opsp-panel);
  color: var(--opsp-ink);
  padding: 6px 9px;
  box-shadow: var(--opsp-shadow-soft);
  text-align: center;
}

.opsp-rec__title-pill strong {
  display: block;
  font-size: 23px;
  font-weight: 950;
  line-height: 1;
}

.opsp-rec__title-pill span {
  color: var(--opsp-muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
}

.opsp-rec__body {
  display: grid;
  grid-template-columns: minmax(330px, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
  align-items: start;
  border-top: 2px solid var(--opsp-line);
  padding: 10px;
}

.opsp-rec__panel {
  min-width: 0;
  border: 2px solid var(--opsp-line);
  background: var(--opsp-panel);
  color: var(--opsp-ink);
  padding: 8px;
  box-shadow: var(--opsp-shadow-soft);
}

.opsp-rec__panel-head {
  display: grid;
  gap: 3px;
  margin-bottom: 7px;
}

.opsp-rec__panel-head h3 {
  color: var(--opsp-ink);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.2;
}

.opsp-rec__panel-head p {
  color: var(--opsp-muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.opsp-rec__field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.opsp-rec__field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.opsp-rec__field--full {
  grid-column: 1 / -1;
}

.opsp-rec__field label,
.opsp-rec__field-label {
  color: var(--opsp-ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.ops-plus-baseball-calculator.opsp-rec input {
  width: 100% !important;
  min-height: 37px !important;
  border: 1px solid var(--opsp-line) !important;
  background: var(--opsp-input) !important;
  color: var(--opsp-ink) !important;
  -webkit-text-fill-color: var(--opsp-ink) !important;
  padding: 7px 9px !important;
  box-shadow: inset 0 1px 0 rgba(107, 87, 69, 0.08) !important;
  font-size: 14px !important;
  font-weight: 950 !important;
  font-variant-numeric: tabular-nums;
  font-variation-settings: "wght" 950;
  line-height: 1.3 !important;
}

.ops-plus-baseball-calculator.opsp-rec input[type="text"] {
  font-weight: 900 !important;
  font-variation-settings: "wght" 900;
}

.ops-plus-baseball-calculator.opsp-rec input::placeholder {
  color: var(--opsp-placeholder) !important;
  -webkit-text-fill-color: var(--opsp-placeholder) !important;
  opacity: 1 !important;
  font-weight: 750 !important;
  font-variation-settings: "wght" 750;
}

.ops-plus-baseball-calculator.opsp-rec input:focus-visible,
.ops-plus-baseball-calculator.opsp-rec button:focus-visible {
  outline: 2px solid #d2aa55 !important;
  outline-offset: 2px !important;
}

.opsp-rec__hint {
  color: var(--opsp-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.opsp-rec__league-block {
  display: grid;
  gap: 8px;
  margin-top: 9px;
  border: 1px dashed var(--opsp-line);
  background: var(--opsp-paper-soft);
  padding: 8px;
}

.opsp-rec__league-top {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--opsp-muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.opsp-rec__preset-row,
.opsp-rec__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.ops-plus-baseball-calculator.opsp-rec button,
.ops-plus-baseball-calculator.opsp-rec .preset-btn {
  display: inline-grid !important;
  min-width: 0 !important;
  min-height: 36px !important;
  place-items: center !important;
  border: 1px solid var(--opsp-line) !important;
  border-radius: 0 !important;
  background: var(--opsp-panel) !important;
  color: var(--opsp-ink) !important;
  -webkit-text-fill-color: var(--opsp-ink) !important;
  padding: 6px 8px !important;
  box-shadow: var(--opsp-shadow-soft) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  font-variation-settings: "wght" 900;
  line-height: 1.15 !important;
  text-align: center !important;
  text-decoration: none !important;
  cursor: pointer;
  appearance: none;
}

.ops-plus-baseball-calculator.opsp-rec button:hover,
.ops-plus-baseball-calculator.opsp-rec .preset-btn:hover {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(72, 55, 40, 0.16) !important;
}

.ops-plus-baseball-calculator.opsp-rec .preset-btn[aria-pressed="true"],
.ops-plus-baseball-calculator.opsp-rec #copyBtn {
  background: var(--opsp-primary-bg) !important;
  color: var(--opsp-primary-ink) !important;
  -webkit-text-fill-color: var(--opsp-primary-ink) !important;
}

.ops-plus-baseball-calculator.opsp-rec #calculateBtn[hidden],
.ops-plus-baseball-calculator.opsp-rec .opsp-rec__compat-calc {
  display: none !important;
}

.opsp-rec__scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 8px;
}

.opsp-rec__metric,
.opsp-rec__hero {
  display: grid;
  min-width: 0;
  min-height: 74px;
  place-items: center;
  border: 1px solid var(--opsp-line);
  background: var(--opsp-panel);
  color: var(--opsp-ink);
  padding: 10px;
  text-align: center;
  box-shadow: 1px 1px 0 rgba(72, 55, 40, 0.14);
}

.opsp-rec__hero {
  background: var(--opsp-green);
  color: var(--opsp-green-ink);
}

.opsp-rec__metric span,
.opsp-rec__hero span {
  display: block;
  color: inherit;
  opacity: 0.86;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.15;
}

.opsp-rec__metric strong,
.opsp-rec__hero strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 29px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 1.08;
}

.opsp-rec__hero strong {
  font-size: 36px;
}

.opsp-rec__rating {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  border: 1px solid var(--opsp-line);
  background: var(--opsp-blue);
  color: var(--opsp-blue-ink);
  padding: 6px 8px;
  font-weight: 900;
}

.opsp-rec__rating-key {
  display: inline-grid;
  min-width: 48px;
  place-items: center;
  border: 1px solid currentColor;
  padding: 3px 6px;
  font-size: 11px;
  line-height: 1.1;
}

.opsp-rec__rating-text {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.25;
}

.opsp-rec__rating--excellent {
  background: var(--opsp-green);
  color: var(--opsp-green-ink);
}

.opsp-rec__rating--good {
  background: #f7df9d;
  color: #4d3612;
}

body[data-scheme="dark"] .opsp-rec__rating--good,
body[data-scheme="inverse"] .opsp-rec__rating--good,
.ops-plus-baseball-calculator.opsp-rec.dark .opsp-rec__rating--good {
  background: #5a461e;
  color: #fff1c7;
}

.opsp-rec__breakdown {
  display: grid;
  margin-top: 8px;
  border: 1px solid var(--opsp-line);
  background: var(--opsp-panel);
}

.opsp-rec__row {
  display: grid;
  grid-template-columns: minmax(92px, 0.82fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  border-bottom: 1px solid var(--opsp-line-soft);
  padding: 6px 8px;
}

.opsp-rec__row:last-child {
  border-bottom: 0;
}

.opsp-rec__row span {
  color: var(--opsp-muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.22;
}

.opsp-rec__row strong {
  min-width: 0;
  color: var(--opsp-ink);
  font-size: 13px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 1.22;
  text-align: right;
  overflow-wrap: anywhere;
}

.opsp-rec__guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.opsp-rec__guide-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  border: 1px solid var(--opsp-line-soft);
  background: var(--opsp-paper-soft);
  padding: 6px 7px;
  min-width: 0;
}

.opsp-rec__guide-item strong {
  color: var(--opsp-ink);
  font-size: 12px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.opsp-rec__guide-item span {
  min-width: 0;
  color: var(--opsp-muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.opsp-rec__mini-note {
  margin-top: 8px;
  border: 1px dashed var(--opsp-line);
  background: var(--opsp-warn);
  color: var(--opsp-ink);
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.ops-plus-baseball-calculator.opsp-rec .opsp-rec__guide + .opsp-rec__mini-note {
  margin-top: 10px !important;
}

.opsp-rec__toast {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  display: grid;
  gap: 2px;
  max-width: min(300px, calc(100% - 24px));
  border: 2px solid var(--opsp-line);
  background: var(--opsp-panel);
  color: var(--opsp-ink);
  padding: 9px 11px;
  box-shadow: var(--opsp-shadow-soft);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.opsp-rec__toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.opsp-rec__toast-title {
  color: var(--opsp-ink);
  font-size: 12px;
  font-weight: 950;
  line-height: 1.2;
}

.opsp-rec__toast-value {
  color: var(--opsp-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.opsp-rec__screen-reader {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

@media (max-width: 760px) {
  .ops-plus-baseball-calculator.opsp-rec {
    width: calc(100% - 18px);
    margin: 12px auto;
  }

  .opsp-rec__title,
  .opsp-rec__body {
    grid-template-columns: 1fr;
  }

  .opsp-rec__title-pill {
    width: 100%;
    min-width: 0;
  }

  .opsp-rec__body {
    padding: 10px;
  }

  .opsp-rec__panel {
    padding: 10px;
  }

  .opsp-rec__hero strong {
    font-size: 36px;
  }
}

@media (max-width: 430px) {
  .opsp-rec__title {
    gap: 10px;
    padding: 12px;
  }

  .opsp-rec__title h2 {
    font-size: 19px;
  }

  .opsp-rec__title p,
  .opsp-rec__panel-head p,
  .opsp-rec__mini-note {
    font-size: 12px;
  }

  .opsp-rec__field-grid,
  .opsp-rec__scoreboard,
  .opsp-rec__guide {
    grid-template-columns: 1fr;
  }

  .opsp-rec__preset-row,
  .opsp-rec__actions {
    gap: 6px;
  }

  .ops-plus-baseball-calculator.opsp-rec button,
  .ops-plus-baseball-calculator.opsp-rec .preset-btn {
    min-height: 38px !important;
    padding-inline: 6px !important;
    font-size: 12px !important;
  }

  .opsp-rec__hero,
  .opsp-rec__metric {
    min-height: 74px;
  }

  .opsp-rec__hero strong,
  .opsp-rec__metric strong {
    font-size: 30px;
  }

  .opsp-rec__row {
    grid-template-columns: minmax(82px, 0.8fr) minmax(0, 1fr);
  }
}

/* prefers-color-scheme: dark title fallback */

@media (prefers-color-scheme: dark) {
  body:not([data-scheme="light"]):not([data-scheme="default"]):not([data-scheme="normal"]) .ops-plus-baseball-calculator.opsp-rec:not(.light) .opsp-rec__title {
    background:
      linear-gradient(90deg, rgba(80, 62, 45, 0.94) 0%, rgba(65, 50, 37, 0.94) 58%, rgba(96, 75, 43, 0.72) 100%),
      var(--opsp-panel);
  }
}
