/* Tool pages: gambling budget calculator, RTP calculator, blackjack basic-strategy trainer.
   Extends articles.css and uses the site tokens from site.css. Sharp corners, like the rest of the site. */

.article-body .tool { margin: 28px 0 40px; padding: 24px; background: var(--dark-iron); border: 1px solid var(--charcoal); }
.article-body .tool > h3:first-child { margin-top: 0; }
.tool-fields { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tool-field label { display: block; margin-bottom: 8px; color: var(--smoke); font-size: 14px; font-weight: 500; line-height: 1.4; }
.tool-input { display: flex; align-items: stretch; background: var(--abyss); border: 1px solid var(--iron); }
.tool-input:focus-within { border-color: var(--lambo-gold); box-shadow: 0 0 0 1px var(--lambo-gold); }
.tool-input .unit { display: flex; align-items: center; padding: 0 12px; color: var(--ash); font-size: 14px; font-weight: 600; }
.tool-input .unit:first-child { border-right: 1px solid var(--charcoal); }
.tool-input .unit:last-child { border-left: 1px solid var(--charcoal); }
.tool-input input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 12px; border: 0; background: transparent; color: var(--white);
  font-family: var(--font-body); font-size: 18px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tool-input input:focus { outline: none; }
.article-body .tool-field .hint { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--ash); }

.tool-results { display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-top: 24px;
  background: var(--charcoal); border: 1px solid var(--charcoal); }
.tool-result { padding: 16px 18px; background: var(--abyss); }
.tool-result .k { display: block; margin-bottom: 8px; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--ash); }
.tool-result output { display: block; font-family: var(--font-display); font-size: 28px; line-height: 1.15; color: var(--white); font-variant-numeric: tabular-nums; }
.tool-result.key output { color: var(--lambo-gold); }
.article-body .tool-status { max-width: none; margin: 18px 0 0; padding: 14px 16px; border-left: 2px solid var(--lambo-gold); background: var(--abyss);
  color: var(--steel); font-size: 15px; line-height: 1.6; }
.article-body .tool-status[data-tone="stop"] { border-left-color: var(--mega-red); color: var(--smoke); }
.article-body .tool-example { max-width: none; margin: 12px 0 0; color: var(--ash); font-size: 13px; line-height: 1.5; }
.article-body .bj-hand { max-width: none; margin: 0; }
.article-body .tool-formula { max-width: none; padding: 14px 16px; background: var(--dark-iron); border: 1px solid var(--charcoal); color: var(--smoke);
  font-size: 15px; font-variant-numeric: tabular-nums; }

/* Blackjack: chart */
.bs-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 14px; color: var(--steel); }
.article-body .bs-legend li { margin: 0; padding: 0; display: flex; align-items: center; gap: 8px; }
.bs-swatch { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 4px; font-size: 12px; font-weight: 700; }
.article-body .bs-wrap { margin: 16px 0 32px; }
.article-body table.bs-chart { width: auto; min-width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 13px; line-height: 1; }
.article-body .bs-chart caption { caption-side: top; padding: 0 0 10px; text-align: left; color: var(--smoke); font-size: 15px; font-weight: 600; line-height: 1.4; }
.article-body .bs-chart th, .article-body .bs-chart td { min-width: 28px; padding: 9px 3px; border: 0; text-align: center; vertical-align: middle; }
.article-body .bs-chart thead th { background: transparent; color: var(--ash); font-size: 12px; letter-spacing: 0; text-transform: none; }
.article-body .bs-chart tbody th { width: auto; padding-right: 10px; background: transparent; color: var(--smoke); font-weight: 600; text-align: left; white-space: nowrap; }
.article-body .bs-chart .bs-H, .bs-swatch.bs-H { background: var(--charcoal); color: var(--smoke); }
.article-body .bs-chart .bs-S, .bs-swatch.bs-S { background: var(--lambo-gold); color: var(--abyss); }
.article-body .bs-chart .bs-D, .article-body .bs-chart .bs-d, .bs-swatch.bs-D, .bs-swatch.bs-d { background: var(--mega-green); color: var(--white); }
.article-body .bs-chart .bs-P, .bs-swatch.bs-P { background: var(--mega-red); color: var(--white); }

/* Blackjack: trainer */
.article-body .tool[data-tool="blackjack"] { padding: 0; background: transparent; border: 0; }
.bj-felt { display: grid; gap: 18px; padding: 22px; background: var(--mega-green-deep); border: 1px solid var(--mega-green); }
.bj-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.bj-label { min-width: 150px; color: rgba(255, 255, 255, 0.78); font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.bj-cards { display: flex; gap: 8px; }
.bj-card { display: grid; place-items: center; align-content: center; width: 52px; height: 74px; background: #fdfdfb; color: #141414; border-radius: 4px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); font-family: var(--font-body); font-size: 20px; font-weight: 700; line-height: 1; }
.bj-card .suit { margin-top: 4px; font-size: 17px; font-weight: 400; }
.bj-card.red { color: #b0001a; }
.bj-hand { color: var(--white); font-size: 15px; font-weight: 600; }
.bj-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.bj-actions button, .bj-next { min-height: 48px; padding: 10px 8px; background: transparent; border: 1px solid var(--lambo-gold); color: var(--lambo-gold);
  font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; }
.bj-actions button:hover:not(:disabled), .bj-next:hover { background: var(--lambo-gold); color: var(--abyss); }
.bj-actions button:disabled { border-color: var(--iron); color: var(--slate); cursor: not-allowed; }
.bj-actions button:focus-visible, .bj-next:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.bj-next { justify-self: start; padding: 10px 22px; }
.article-body .bj-feedback { max-width: none; min-height: 3.2em; margin: 16px 0 0; color: var(--smoke); font-size: 15px; line-height: 1.6; }
.article-body .bj-feedback[data-tone="right"] { color: var(--mega-green-lite); }
.article-body .bj-feedback[data-tone="wrong"] { color: #ff8a8a; }
.article-body .bj-score { max-width: none; margin: 8px 0 0; color: var(--ash); font-size: 13px; font-variant-numeric: tabular-nums; }
.bj-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }

@media (max-width: 480px) {
  .article-body .tool { padding: 18px 16px; }
  .bj-felt { padding: 16px; }
  .bj-label { min-width: 0; width: 100%; }
  .bj-card { width: 46px; height: 66px; font-size: 18px; }
  .bj-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-body .bs-chart th, .article-body .bs-chart td { min-width: 25px; padding: 8px 1px; font-size: 12px; }
}
