/* Calcolatore di blackjack (/probabilita/calcolatore/). Usa i token di style.css. */
.bjc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 1.1rem; margin: 0.4rem 0 1.8rem; scroll-margin-top: calc(var(--header-h) + 12px); }
.bjc-input { display: grid; grid-template-columns: 1.35fr 1fr; gap: 0.9rem; }
.bjc-block, .bjc-box { min-width: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-m); padding: 0.9rem 1rem; }
.bjc-label { margin: 0 0 0.6rem; display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--green); }
.bjc-label b { color: #fff; font-size: 0.98rem; text-transform: none; letter-spacing: 0; }
.bjc-hand { display: flex; flex-wrap: wrap; gap: 0.4rem; min-height: 56px; margin-bottom: 0.7rem; align-items: center; }
.bjc-card { width: 40px; height: 56px; border-radius: 8px; background: #f7f5ef; color: #11181b; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem; box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.8); }
.bjc-card.is-ace { color: #b3261e; }
.bjc-empty { color: var(--ink-3); font-size: 0.88rem; }
.bjc-keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.4rem; }
.bjc-key { min-width: 0; height: 44px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface-3); color: #fff; font: 700 1rem var(--font); cursor: pointer; }
.bjc-key:hover:not(:disabled) { border-color: var(--green); }
.bjc-key[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.bjc-key:disabled { opacity: 0.4; cursor: not-allowed; }
.bjc-tools { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-top: 0.6rem; }
.bjc-tools button { background: none; border: 0; padding: 0.2rem 0; color: var(--link); font: 600 0.86rem var(--font); cursor: pointer; }
.bjc-rules { margin-top: 0.9rem; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface-2); }
.bjc-rules summary { cursor: pointer; padding: 0.75rem 1rem; font-weight: 700; color: #fff; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.bjc-rules summary::-webkit-details-marker { display: none; }
.bjc-rules summary::after { content: "▾"; color: var(--green); }
.bjc-rules[open] summary::after { content: "▴"; }
.bjc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; padding: 0.2rem 1rem 0.9rem; }
.bjc-grid label { display: block; font-size: 0.74rem; color: var(--ink-3); margin-bottom: 0.25rem; }
.bjc-grid select { width: 100%; background: var(--surface-3); border: 1px solid var(--line-2); color: #fff; border-radius: var(--r-s); padding: 0.5rem 0.6rem; font: 500 0.88rem var(--font); }
.bjc-out { display: grid; grid-template-columns: 1.35fr 1fr; gap: 0.9rem; margin-top: 0.9rem; }
.bjc-verdict { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 1rem; border-radius: var(--r-m); background: var(--green-t); border: 1px solid var(--green-glow); }
.bjc-verdict.is-empty { background: var(--surface-2); border-color: var(--line); }
.bjc-verdict p { margin: 0; min-width: 0; color: var(--ink-2); font-size: 0.92rem; line-height: 1.45; }
.bjc-verdict strong { color: #fff; font-size: 1.02rem; }
.bjc-wide { grid-column: 1 / -1; }
.bjc-act { flex: 0 0 auto; min-width: 52px; height: 52px; padding: 0 0.5rem; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-s); font-weight: 800; font-size: 1.15rem; color: #0b1215; background: var(--green); }
.bjc-act.a-h { background: #5fb4ff; }
.bjc-act.a-s { background: var(--amber); }
.bjc-act.a-d { background: var(--green); }
.bjc-act.a-p { background: #c9a0ff; }
.bjc-act.a-r { background: #ffb4b4; }
.bjc-box h3 { margin: 0 0 0.7rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--green); }
.bjc-tablewrap { overflow-x: auto; }
.bjc-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.bjc-table th, .bjc-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bjc-table th { color: var(--ink-3); font-weight: 600; font-size: 0.76rem; }
.bjc-table td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bjc-table tr.is-best td { color: #fff; font-weight: 700; }
.bjc-table tr:last-child td { border-bottom: 0; }
.bjc-facts { margin: 0.8rem 0 0; padding-left: 1.1rem; font-size: 0.88rem; color: var(--ink-2); }
.bjc-facts li { margin-bottom: 0.35rem; }
.bjc-facts b { color: #fff; }
.bjc-bars { display: grid; gap: 0.45rem; }
.bjc-bar { display: grid; grid-template-columns: 74px minmax(0, 1fr) 52px; align-items: center; gap: 0.5rem; font-size: 0.84rem; color: var(--ink-2); }
.bjc-bar i { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--green) var(--w), var(--surface-3) var(--w)); }
.bjc-bar b { color: #fff; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bjc-note { margin: 0.7rem 0 0; font-size: 0.8rem; color: var(--ink-3); line-height: 1.45; }
.bjc-edge { margin: 0.9rem 0 0; font-size: 0.86rem; color: var(--ink-2); }
.bjc-edge b { color: var(--amber); }
.bjc-nojs { margin: 0.8rem 0 0; color: var(--ink-2); }
.bjc:not(.is-ready) .bjc-out, .bjc:not(.is-ready) .bjc-edge { display: none; }

@media (max-width: 760px) {
  .bjc { padding: 0.8rem; }
  .bjc-input, .bjc-out { grid-template-columns: 1fr; }
  .bjc-bar { grid-template-columns: 64px minmax(0, 1fr) 48px; }
  .bjc-block, .bjc-box { padding: 0.8rem 0.7rem; }
  .bjc-table { font-size: 0.8rem; }
  .bjc-table th, .bjc-table td { padding: 0.45rem 0.3rem; white-space: normal; }
  .bjc-verdict { align-items: flex-start; }
}
