/* Free tools (/tools and /tools/*): the calculators. Uses the site's colours and its .field inputs (site.css). */

.tool-head { max-width: 820px; }
.tool-head h1 { font-size: clamp(32px, 4.6vw, 48px); line-height: 1.1; letter-spacing: -1px; }
.tool-dek { margin-top: 16px; color: var(--text-2); font-size: 18px; line-height: 1.6; }

.tool-card { margin-top: 28px; padding: 26px; border-radius: 18px; border: 1px solid var(--border); background: #121212; }
.tool-card h2 { font-size: 22px; line-height: 1.25; letter-spacing: -0.3px; }
.tool-card > p { margin-top: 8px; color: var(--text-2); font-size: 15px; line-height: 1.6; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 16px; }
.tool-grid .field { margin-top: 14px; }
.tool-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* the tournament on one row, the hand on the next */
.tool-card .field small { color: var(--text-3); font-size: 12.5px; font-weight: 600; }
.tool-card textarea { min-height: 96px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.tool-check { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--text-2); font-size: 15px; font-weight: 600; }
.tool-check input { width: 18px; height: 18px; accent-color: #ff3838; }
.tool-more { margin-top: 16px; }
.tool-more summary { cursor: pointer; color: var(--text-2); font-size: 14px; font-weight: 700; }
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.tool-status { color: var(--text-3); font-size: 14px; }

.tool-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 22px 0 0; }
.tool-stat { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border); background: #0c0c0c; }
.tool-stat dt { color: var(--text-3); font-size: 12px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; }
.tool-stat dd { margin: 6px 0 0; color: #fff; font-size: 24px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.2; }
.tool-stat dd small { display: block; margin-top: 4px; color: var(--text-2); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.tool-stat.is-key { border-color: rgba(255, 56, 56, 0.4); background: radial-gradient(circle at 100% 0%, rgba(255, 40, 40, 0.12), transparent 60%), #0c0c0c; }
.tool-note { margin-top: 14px; color: var(--text-3); font-size: 13.5px; line-height: 1.55; }
.tool-error { margin-top: 14px; color: #ff6b6b; font-size: 15px; font-weight: 700; }
.tool-error:empty { display: none; }

.tool-chart { margin-top: 20px; }
.tool-chart svg { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); background: #0b0b0b; }
.tool-chart text { fill: rgba(255, 255, 255, 0.55); font: 600 11px 'Open Sans', system-ui, sans-serif; }
.tool-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; color: var(--text-3); font-size: 13px; }
.tool-legend span::before { content: ""; display: inline-block; width: 18px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 2px solid rgba(255, 255, 255, 0.45); }
.tool-legend .is-expected::before { border-top: 2px dashed #ff4a4a; }

.tool-table-wrap { margin-top: 18px; overflow-x: auto; }
.tool-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
.tool-table th, .tool-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.tool-table th:first-child, .tool-table td:first-child { text-align: left; }
.tool-table th { color: var(--text-3); font-size: 12px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; }
.tool-table td.is-up { color: #6be38f; }
.tool-table td.is-down { color: #ff6b6b; }
.tool-table.is-compact { min-width: 0; }

/* the explanation under each calculator */
.tool-content { max-width: 760px; color: rgba(255, 255, 255, 0.86); font-size: 17px; line-height: 1.7; }
.tool-content > * + * { margin-top: 16px; }
.tool-content h2 { margin-top: 44px; color: #fff; font-size: clamp(23px, 2.6vw, 28px); line-height: 1.25; letter-spacing: -0.4px; }
.tool-content h3 { margin-top: 26px; color: #fff; font-size: 19px; }
.tool-content h2 + *, .tool-content h3 + * { margin-top: 12px; }
.tool-content a { color: #ff5a5a; text-decoration: underline; text-decoration-color: rgba(255, 90, 90, 0.4); text-underline-offset: 3px; }
.tool-content ul { padding-left: 20px; list-style: disc; }
.tool-content li + li { margin-top: 6px; }
.tool-content code { padding: 1px 6px; border-radius: 6px; background: #1a1a1a; font-size: 15px; }

.tool-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.tool-links a { display: block; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--border); background: #121212; color: #fff; text-decoration: none; transition: border-color .2s ease, transform .2s ease; }
.tool-links a:hover { border-color: rgba(255, 56, 56, 0.45); transform: translateY(-2px); }
.tool-links strong { display: block; font-size: 17px; }
.tool-links span { display: block; margin-top: 6px; color: var(--text-2); font-size: 14.5px; line-height: 1.5; }

/* the variance calculator's format choice (Regular, PKO, Mystery bounty): radio buttons drawn as pills */
.tool-format { min-width: 0; margin: 16px 0 0; padding: 0; border: 0; }
.tool-format legend { padding: 0; color: var(--text-2); font-size: 13.5px; font-weight: 700; }
.tool-format-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tool-format label { position: relative; cursor: pointer; }
.tool-format input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tool-format span {
  display: block; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border-strong); background: rgba(0, 0, 0, 0.45);
  color: var(--text-2); font-size: 15px; font-weight: 700; transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.tool-format label:hover span { color: #fff; }
.tool-format input:checked + span { border-color: rgba(255, 70, 70, 0.7); background: rgba(255, 56, 56, 0.14); color: #fff; }
.tool-format input:focus-visible + span { box-shadow: 0 0 0 3px rgba(255, 56, 56, 0.25); }

/* how the formats compare, under the variance calculator's results; the chosen format is highlighted */
.tool-compare { margin-top: 28px; }
.tool-compare h3 { font-size: 18px; line-height: 1.3; }
.tool-compare .tool-table-wrap { margin-top: 10px; }
.tool-compare .tool-table { min-width: 0; table-layout: fixed; }
.tool-compare .tool-table th, .tool-compare .tool-table td { white-space: normal; }
.tool-compare .tool-table th:first-child, .tool-compare .tool-table td:first-child { width: 40%; }
.tool-compare .tool-table td { color: var(--text-2); }
.tool-compare .tool-table .is-on { background: rgba(255, 56, 56, 0.07); color: #fff; font-weight: 700; }
.tool-compare .tool-table th.is-on { color: #ff6b6b; }
.tool-compare .nw { white-space: nowrap; }

@media (max-width: 600px) {
  .tool-card { padding: 20px 16px; }
  /* two fields per row, inputs lined up even when a label wraps; lists and groups take the full width */
  .tool-grid, .tool-grid.is-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
  .tool-grid .field { justify-content: flex-end; }
  .tool-grid > div, .tool-grid .field:has(textarea) { grid-column: 1 / -1; }
  .tool-stat dd { font-size: 21px; }
  /* two results side by side; an odd one out at the end takes the full width */
  .tool-results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tool-results > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tool-stat { padding: 14px; }
  .tool-format-options { gap: 6px; }
  .tool-format span { padding: 8px 13px; font-size: 14px; }
  .tool-table.is-compact { font-size: 14px; }
  .tool-table.is-compact th, .tool-table.is-compact td { padding: 9px 6px; }
  .tool-compare .tool-table { font-size: 13.5px; }
  .tool-compare .tool-table th, .tool-compare .tool-table td { padding: 9px 6px; }
}

/* the newsletter box (site.css) at the end of each tool's explanation */
.tool-content .newsletter-box { margin-top: 48px; }

/* each tool's icon on its card: a dark tile with the red mark, like the site's icon (Adam: so the cards stand out
   from the text around them). The icons are inline SVG drawn on a 24-unit grid. */
.tool-links a:has(> .tool-icon) { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: start; }
.tool-links .tool-icon {
  grid-row: span 2; box-sizing: border-box; width: 48px; height: 48px; padding: 11px; border-radius: 13px;
  color: #ff4a4a; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  background: radial-gradient(circle at 100% 0%, rgba(255, 40, 40, 0.32), transparent 65%), linear-gradient(180deg, #1d1d1d, #080808);
  box-shadow: inset 0 0 0 1px rgba(255, 74, 74, 0.38), 0 0 18px rgba(255, 40, 40, 0.14);
  transition: box-shadow .2s ease;
}
.tool-links a:hover .tool-icon { box-shadow: inset 0 0 0 1px rgba(255, 74, 74, 0.65), 0 0 22px rgba(255, 40, 40, 0.28); }
.tool-links .tool-icon .tool-icon-fill { fill: currentColor; stroke: none; }
.tool-links .tool-icon .tool-icon-thin { stroke-width: 1.5; }
