/*!
 * Betting Calculators – one design for every calculator.
 * By GreyPhox Digital Ltd.
 * Everything is scoped under .bcalc so nothing leaks into the rest of the page.
 * Override the variables on .bcalc (or a parent) to re-theme.
 */

.bcalc {
  --bcalc-navy: #202441;
  --bcalc-ink: #323861;
  --bcalc-blue: #08a4f7;
  --bcalc-blue-dark: #0b8fd6;
  --bcalc-yellow: #f6ca39;
  --bcalc-yellow-light: #ffd85c;
  --bcalc-green: #1f9d46;
  --bcalc-red: #d64545;
  --bcalc-tint: #f2faff;
  --bcalc-line: #d8eaf7;
  --bcalc-muted: #5e6488;
  --bcalc-radius: 18px;
  --bcalc-font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  box-sizing: border-box;
  width: 100%;
  margin: 0 0 32px;
  /* Small-screen layouts follow the calculator's own width, not the window's,
     so a calculator in a narrow column or sidebar stacks as it would on a phone. */
  container: bcalc / inline-size;
  background: #fff;
  border: 1px solid var(--bcalc-line);
  border-radius: var(--bcalc-radius);
  box-shadow: 0 10px 34px rgba(32, 36, 65, 0.08);
  font-family: var(--bcalc-font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--bcalc-ink);
  text-align: left;
}

.bcalc *,
.bcalc *::before,
.bcalc *::after {
  box-sizing: border-box;
}

.bcalc [hidden] {
  display: none !important;
}

/* ---- Header / body ------------------------------------------------------ */

.bcalc-head {
  border-radius: calc(var(--bcalc-radius) - 1px) calc(var(--bcalc-radius) - 1px) 0 0;
  padding: 16px 24px;
  background: var(--bcalc-navy);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

/* Title on the left, optional logo on the right */
.bcalc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.bcalc-head-title {
  min-width: 0;
}

.bcalc-head-logo {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  max-width: 40%;
  margin: -4px 0;
}

.bcalc-head-logo a {
  display: flex;
  border: 0;
  box-shadow: none;
}

.bcalc .bcalc-head-logo .bcalc-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: var(--bcalc-logo-h, 28px);
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  object-fit: contain;
}

.bcalc-body {
  padding: 24px;
}

.bcalc-note {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--bcalc-muted);
}

.bcalc-note:empty {
  display: none;
}

/* ---- Fields ------------------------------------------------------------- */

.bcalc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px 20px;
  margin-bottom: 20px;
}

.bcalc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.bcalc-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--bcalc-ink);
}

.bcalc .bcalc-input,
.bcalc .bcalc-select {
  display: block;
  width: 100%;
  min-width: 0;
  height: 46px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--bcalc-line);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--bcalc-ink);
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bcalc .bcalc-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23323861' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  cursor: pointer;
}

.bcalc .bcalc-input:focus,
.bcalc .bcalc-select:focus {
  outline: none;
  border-color: var(--bcalc-blue);
  box-shadow: 0 0 0 3px rgba(8, 164, 247, 0.18);
}

.bcalc .bcalc-input[readonly] {
  background: var(--bcalc-tint);
  color: var(--bcalc-muted);
}

.bcalc .bcalc-input::placeholder {
  color: #9aa0bd;
  font-weight: 400;
}

/* Prefix / suffix (£, %) */
.bcalc-affix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--bcalc-line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.bcalc-affix:focus-within {
  border-color: var(--bcalc-blue);
  box-shadow: 0 0 0 3px rgba(8, 164, 247, 0.18);
}

.bcalc .bcalc-affix .bcalc-input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.bcalc-affix-text {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--bcalc-tint);
  font-weight: 600;
  color: var(--bcalc-muted);
}

/* Segmented Yes/No, Home/Away */
.bcalc-seg {
  display: flex;
  height: 46px;
  padding: 4px;
  border: 1px solid var(--bcalc-line);
  border-radius: 10px;
  background: var(--bcalc-tint);
}

.bcalc-seg-opt {
  flex: 1;
  display: flex;
  margin: 0;
  cursor: pointer;
}

.bcalc-seg-opt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.bcalc-seg-opt span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 600;
  color: var(--bcalc-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.bcalc-seg-opt input:checked + span {
  background: var(--bcalc-ink);
  color: #fff;
}

.bcalc-seg-opt input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(8, 164, 247, 0.35);
}

/* Info tip */
.bcalc-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--bcalc-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
}

.bcalc-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: 240px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bcalc-navy);
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  transform: translateX(-50%);
  display: none;
  pointer-events: none;
}

.bcalc-tip:hover::after,
.bcalc-tip:focus::after {
  display: block;
}

/* Tips in table headers sit near the right edge – open them leftwards */
.bcalc-table th .bcalc-tip::after {
  left: auto;
  right: -8px;
  transform: none;
}

/* ---- Odds input ---------------------------------------------------------- */

.bcalc-odds-frac {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bcalc .bcalc-odds-frac .bcalc-input {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  text-align: center;
}

.bcalc-odds-sep {
  font-weight: 700;
  color: var(--bcalc-muted);
}

.bcalc-odds .bcalc-odds-frac,
.bcalc-odds .bcalc-odds-dec,
.bcalc-odds .bcalc-odds-amer {
  display: none;
}

.bcalc-odds[data-mode="fractional"] .bcalc-odds-frac,
.bcalc-odds[data-mode="decimal"] .bcalc-odds-dec,
.bcalc-odds[data-mode="american"] .bcalc-odds-amer {
  display: flex;
}

.bcalc-odds .bcalc-odds-dec,
.bcalc-odds .bcalc-odds-amer {
  width: 100%;
}

/* ---- Tables (legs, results) --------------------------------------------- */

.bcalc-table-wrap {
  margin: 0 0 20px;
}

.bcalc .bcalc-table {
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 15px;
}

.bcalc .bcalc-table th {
  padding: 10px 6px;
  border: 0;
  border-bottom: 2px solid var(--bcalc-line);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: left;
  vertical-align: bottom;
  color: var(--bcalc-muted);
}

.bcalc .bcalc-table td {
  padding: 8px 6px;
  border: 0;
  border-bottom: 1px solid var(--bcalc-line);
  vertical-align: middle;
  background: transparent;
}

.bcalc .bcalc-table th .bcalc-tip {
  margin-left: 4px;
  vertical-align: middle;
}

.bcalc-legs .bcalc-leg-n {
  width: 1%;
  font-weight: 700;
  color: var(--bcalc-ink);
}

/*
 * Fields inside tables. A number box's natural width is ~20 characters, which made the
 * odds column swallow the table and push the other columns out of the card. These give
 * each kind of field a sensible width instead, and still let it fill a wider column.
 */
.bcalc .bcalc-table .bcalc-input {
  width: 96px;
  min-width: 100%;
}

.bcalc .bcalc-table .bcalc-select {
  width: auto;
  min-width: 100%;
  padding-right: 30px;
  background-position: right 10px center;
}

.bcalc .bcalc-table .bcalc-odds {
  width: 100%;
  max-width: 240px;
}

.bcalc .bcalc-table .bcalc-odds-frac .bcalc-input {
  flex: 1 1 64px;
  width: 64px;
  min-width: 0;
}

.bcalc .bcalc-table .bcalc-affix {
  width: 100%;
  max-width: 140px;
}

.bcalc .bcalc-table .bcalc-affix .bcalc-input {
  flex: 1 1 56px;
  width: 56px;
  min-width: 0;
}

.bcalc .bcalc-num-cell,
.bcalc .bcalc-table th.bcalc-num-cell {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

.bcalc-ew-only {
  display: none;
}

.bcalc-is-ew .bcalc-ew-only {
  display: table-cell;
}

.bcalc .bcalc-dh-row td {
  padding-top: 0;
  background: var(--bcalc-tint);
}

.bcalc-dh {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 0 4px;
}

.bcalc-dh label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--bcalc-muted);
}

/* ---- Panels -------------------------------------------------------------- */

.bcalc-panel {
  margin: 0 0 20px;
  padding: 18px 18px 2px;
  border-radius: 14px;
  background: var(--bcalc-tint);
}

.bcalc-panel-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--bcalc-ink);
}

/* A field that needs the whole row (e.g. a mode picker with long option names) */
.bcalc-grid > .bcalc-field-full {
  grid-column: 1 / -1;
}

.bcalc-field-full .bcalc-select {
  max-width: 460px;
}

/* A section heading inside a field grid spans the whole row, so it sits above its fields */
.bcalc-nv-head {
  margin-top: 24px;
}

.bcalc-grid > .bcalc-subhead {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.bcalc-panel .bcalc-grid {
  margin-bottom: 16px;
}

/* ---- Buttons ------------------------------------------------------------- */

.bcalc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 4px 0 20px;
}

.bcalc-actions-left {
  justify-content: flex-start;
}

.bcalc .bcalc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
  padding: 10px 30px;
  border: 2px solid var(--bcalc-yellow);
  border-radius: 100px;
  background: var(--bcalc-yellow);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--bcalc-navy);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bcalc .bcalc-btn:hover {
  background: var(--bcalc-yellow-light);
  border-color: var(--bcalc-yellow-light);
  color: var(--bcalc-navy);
}

.bcalc .bcalc-btn-ghost {
  background: transparent;
  border-color: var(--bcalc-line);
  color: var(--bcalc-ink);
}

.bcalc .bcalc-btn-ghost:hover {
  background: var(--bcalc-tint);
  border-color: var(--bcalc-ink);
  color: var(--bcalc-ink);
}

.bcalc .bcalc-btn:disabled,
.bcalc .bcalc-btn:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.bcalc .bcalc-btn:focus-visible,
.bcalc .bcalc-icon-btn:focus-visible {
  outline: 3px solid rgba(8, 164, 247, 0.4);
  outline-offset: 2px;
}

.bcalc .bcalc-icon-btn {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--bcalc-line);
  border-radius: 10px;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  color: var(--bcalc-muted);
  cursor: pointer;
}

/* Copy button beside a stake */
.bcalc .bcalc-copy-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 15px;
  vertical-align: middle;
}

.bcalc .bcalc-icon-btn.bcalc-copy-btn:hover {
  border-color: var(--bcalc-blue);
  color: var(--bcalc-blue);
}

/* Copy button inside a result tile's label */
.bcalc-stat-label:has(.bcalc-copy-btn) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bcalc .bcalc-stat-label .bcalc-copy-btn {
  width: 26px;
  height: 26px;
  margin: -6px -4px -6px 0;
  border-radius: 6px;
  font-size: 13px;
}

.bcalc-stake-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.bcalc-liab {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--bcalc-muted);
}

.bcalc-liab:empty {
  display: none;
}

.bcalc .bcalc-icon-btn:hover {
  border-color: var(--bcalc-red);
  color: var(--bcalc-red);
}

/* ---- Results ------------------------------------------------------------- */

.bcalc-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.bcalc-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bcalc-tint);
}

.bcalc-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--bcalc-muted);
}

.bcalc-stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--bcalc-ink);
  word-break: break-word;
}

.bcalc-stat-main {
  background: var(--bcalc-navy);
}

.bcalc-stat-main .bcalc-stat-label {
  color: rgba(255, 255, 255, 0.72);
}

.bcalc-stat-main .bcalc-stat-value {
  color: #fff;
}

.bcalc .bcalc-pos {
  color: var(--bcalc-green);
}

.bcalc .bcalc-neg {
  color: var(--bcalc-red);
}

.bcalc-stat-main .bcalc-stat-value.bcalc-pos {
  color: #5fe08a;
}

.bcalc-stat-main .bcalc-stat-value.bcalc-neg {
  color: #ff8a8a;
}

.bcalc .bcalc-split {
  margin-top: 16px;
}

/* ---- Shared extras for calculator modules -------------------------------- */

/* Section sub-heading inside a calculator (e.g. "Bookmaker", "Exchange", "Results") */
.bcalc-subhead {
  margin: 4px 0 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--bcalc-muted);
}

/* Numbered instructions: "Back £10 at 3.0 with the bookmaker", "Lay £9.74 at 3.1 ..." */
.bcalc-steps {
  counter-reset: bcalc-step;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bcalc-steps li {
  counter-increment: bcalc-step;
  position: relative;
  margin: 0;
  padding: 12px 14px 12px 52px;
  border-radius: 12px;
  background: var(--bcalc-tint);
  font-size: 15px;
  line-height: 1.5;
}

.bcalc-steps li::before {
  content: counter(bcalc-step);
  position: absolute;
  left: 12px;
  top: 50%;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border-radius: 50%;
  background: var(--bcalc-ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
}

.bcalc-steps strong {
  color: var(--bcalc-navy);
}

/* Highlighted instruction / warning box */
.bcalc-callout {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-left: 4px solid var(--bcalc-blue);
  border-radius: 10px;
  background: var(--bcalc-tint);
  font-size: 15px;
}

.bcalc-callout-warn {
  border-left-color: var(--bcalc-yellow);
  background: #fff8e1;
}

/* Small inline pill, e.g. "Recommended", "Underlay" */
.bcalc-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--bcalc-tint);
  font-size: 12px;
  font-weight: 700;
  color: var(--bcalc-ink);
  vertical-align: middle;
}

.bcalc-badge-pos {
  background: #e3f6ea;
  color: var(--bcalc-green);
}

.bcalc-badge-neg {
  background: #fdeaea;
  color: var(--bcalc-red);
}

/* Two fixed columns (e.g. bookmaker side vs exchange side); one column on phones */
.bcalc-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.bcalc-cols > * {
  min-width: 0;
}

@container bcalc (max-width: 640px) {
  .bcalc-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- Average odds rows -------------------------------------------------- */

.bcalc-avg-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.bcalc-avg-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 46px;
  gap: 10px;
}

/* ---- Blackjack table & cards --------------------------------------------- */

.bcalc-bj-table {
  --bcalc-felt: #17643f;
  --bcalc-felt-dark: #0f4a2e;
  --bcalc-card-w: 76px;
  --bcalc-card-h: 106px;

  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0 0 22px;
  padding: 20px;
  border: 6px solid #5a3a22;
  border-radius: 22px;
  background: radial-gradient(ellipse at 50% 40%, var(--bcalc-felt) 0%, var(--bcalc-felt-dark) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), inset 0 6px 24px rgba(0, 0, 0, 0.35);
}

.bcalc-bj-hand {
  padding: 10px 12px 14px;
  border: 2px dashed transparent;
  border-radius: 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.bcalc-bj-table[data-turn="dealer"] [data-hand="dealer"],
.bcalc-bj-table[data-turn="player"] [data-hand="player"] {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.bcalc-bj-hand-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}

.bcalc-bj-hand-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.bcalc-bj-total {
  min-width: 34px;
  padding: 2px 10px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  color: #fff;
}

.bcalc-bj-total-win {
  background: var(--bcalc-yellow);
  color: var(--bcalc-navy);
}

.bcalc-bj-total-bust {
  background: var(--bcalc-red);
}

.bcalc-bj-cards {
  display: flex;
  align-items: center;
  min-height: var(--bcalc-card-h);
  padding-left: 2px;
}

.bcalc-bj-cards > .bcalc-card + .bcalc-card {
  margin-left: calc(var(--bcalc-card-w) * -0.18);
}

/* A playing card. Used on the table and (as buttons) in the card picker. */
.bcalc .bcalc-card {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: var(--bcalc-card-w, 76px);
  height: var(--bcalc-card-h, 106px);
  margin: 0;
  padding: 0;
  border: 1px solid #d5d8e4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  color: #1c1f33;
  user-select: none;
}

.bcalc .bcalc-card-red {
  color: #c62f3a;
}

.bcalc-card-corner {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.bcalc-card-corner b {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.bcalc-card-corner i {
  font-size: 14px;
  font-style: normal;
}

.bcalc-card-corner-end {
  top: auto;
  left: auto;
  right: 6px;
  bottom: 6px;
  transform: rotate(180deg);
}

/* Overlapped cards: hide the half-covered bottom corner */
.bcalc-bj-cards > .bcalc-card:not(:last-child) .bcalc-card-corner-end {
  visibility: hidden;
}

.bcalc-card-pip {
  font-size: 38px;
}

.bcalc-card-pip-face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54%;
  height: 56%;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  font-size: 30px;
  font-weight: 700;
  opacity: 0.9;
}

/* Dealer's hole card */
.bcalc .bcalc-card-back {
  border: 4px solid #fff;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.14) 0 4px, transparent 4px 9px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.14) 0 4px, transparent 4px 9px),
    var(--bcalc-navy);
}

/* Where the next card goes */
.bcalc .bcalc-card-slot {
  border: 2px dashed rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  font-family: inherit;
  font-size: 30px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  animation: bcalc-card-wait 1.6s ease-in-out infinite;
}

.bcalc-card-in {
  animation: bcalc-card-deal 0.32s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

@keyframes bcalc-card-deal {
  from {
    opacity: 0;
    transform: translate(24px, -26px) rotate(8deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bcalc-card-wait {
  50% {
    border-color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.14);
  }
}

/* Card picker */
.bcalc-bj-picker {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 22px;
}

.bcalc .bcalc-card-pick {
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 7;
  border-color: var(--bcalc-line);
  box-shadow: 0 2px 4px rgba(32, 36, 65, 0.1);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.bcalc .bcalc-card-pick .bcalc-card-corner {
  top: 4px;
  left: 5px;
}

.bcalc .bcalc-card-pick .bcalc-card-corner b {
  font-size: 11px;
}

.bcalc .bcalc-card-pick .bcalc-card-pip {
  font-size: 22px;
  font-weight: 700;
}

.bcalc .bcalc-card-pick:hover {
  border-color: var(--bcalc-blue);
  box-shadow: 0 8px 16px rgba(32, 36, 65, 0.18);
  transform: translateY(-4px);
}

.bcalc .bcalc-card-pick:focus-visible {
  outline: 3px solid rgba(8, 164, 247, 0.4);
  outline-offset: 2px;
}

.bcalc .bcalc-card-pick:disabled,
.bcalc .bcalc-card-pick:disabled:hover {
  opacity: 0.4;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

@container bcalc (max-width: 640px) {
  .bcalc-bj-table {
    --bcalc-card-w: 58px;
    --bcalc-card-h: 82px;

    padding: 12px;
    border-width: 4px;
  }

  .bcalc-card-corner b {
    font-size: 14px;
  }

  .bcalc-card-corner i {
    font-size: 11px;
  }

  .bcalc-card-pip {
    font-size: 28px;
  }

  .bcalc-card-pip-face {
    font-size: 22px;
  }

  .bcalc-bj-picker {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .bcalc .bcalc-card-pick .bcalc-card-pip {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bcalc-card-in,
  .bcalc .bcalc-card-slot {
    animation: none;
  }

  .bcalc .bcalc-card-pick:hover {
    transform: none;
  }
}

/* ---- Blackjack: Advisor / Play switch and simulator ----------------------- */

.bcalc-bj-mode {
  max-width: 420px;
  margin: 0 0 20px;
}

.bcalc-callout-good {
  border-left-color: var(--bcalc-green);
  background: #e9f8ef;
}

.bcalc-bj-stats {
  margin: 0 0 20px;
}

.bcalc-bj-hands {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bcalc-bj-hands > .bcalc-bj-hand {
  flex: 1 1 220px;
  min-width: 0;
}

.bcalc-bj-hand.bcalc-bj-hand-active {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.bcalc-bj-hands > .bcalc-bj-hand-active {
  border-color: var(--bcalc-yellow);
}

.bcalc-bj-hand-head {
  flex-wrap: wrap;
}

.bcalc-bj-stake {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.bcalc-bj-result {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--bcalc-navy);
}

.bcalc-bj-result-win {
  background: #5fe08a;
}

.bcalc-bj-result-blackjack {
  background: var(--bcalc-yellow);
}

.bcalc-bj-result-lose,
.bcalc-bj-result-bust {
  background: var(--bcalc-red);
  color: #fff;
}

.bcalc .bcalc-card-slot-idle {
  border-color: rgba(255, 255, 255, 0.25);
  background: transparent;
  animation: none;
}

/* Revealing the dealer's hole card */
.bcalc-card-flip {
  animation: bcalc-card-flip 0.4s ease both;
}

@keyframes bcalc-card-flip {
  from {
    transform: perspective(400px) rotateY(90deg);
  }
  to {
    transform: none;
  }
}

/* Chips */
.bcalc-bj-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
}

.bcalc .bcalc-chip {
  --bcalc-chip: #c62f3a;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin: 0;
  padding: 0;
  border: 5px dashed rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: var(--bcalc-chip);
  box-shadow: 0 0 0 3px var(--bcalc-chip), 0 4px 10px rgba(32, 36, 65, 0.3);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.bcalc .bcalc-chip-10 {
  --bcalc-chip: #1f6fd1;
}

.bcalc .bcalc-chip-25 {
  --bcalc-chip: #1f9d46;
}

.bcalc .bcalc-chip-50 {
  --bcalc-chip: #e07a1f;
}

.bcalc .bcalc-chip-100 {
  --bcalc-chip: #202441;
}

.bcalc .bcalc-chip:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 0 3px var(--bcalc-chip), 0 8px 16px rgba(32, 36, 65, 0.35);
}

.bcalc .bcalc-chip:focus-visible {
  outline: 3px solid rgba(8, 164, 247, 0.5);
  outline-offset: 4px;
}

.bcalc .bcalc-chip:disabled,
.bcalc .bcalc-chip:disabled:hover {
  opacity: 0.35;
  transform: none;
  cursor: not-allowed;
}

/* Hints toggle and reset */
.bcalc-bj-simbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding-top: 14px;
  border-top: 1px solid var(--bcalc-line);
}

.bcalc-bj-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.bcalc-bj-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--bcalc-blue);
}

.bcalc .bcalc-bj-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--bcalc-blue);
  text-decoration: underline;
  cursor: pointer;
}

.bcalc .bcalc-bj-link:hover {
  color: var(--bcalc-blue-dark);
}

@media (hover: none) {
  .bcalc-bj-keys {
    display: none;
  }
}

@container bcalc (max-width: 640px) {
  .bcalc-bj-mode {
    max-width: none;
  }

  .bcalc-bj-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bcalc .bcalc-chip {
    width: 52px;
    height: 52px;
    border-width: 4px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bcalc-card-flip {
    animation: none;
  }
}

/* ---- Embedded (iframe) calculators --------------------------------------- */

.bcalc-embed-body {
  padding: 8px;
}

.bcalc-embed-frame {
  display: block;
  width: 100%;
  min-height: 420px;
  border: 0;
}

.bcalc-admin-error {
  padding: 12px 16px;
  border-left: 4px solid #d64545;
  background: #fff4f4;
  font-family: monospace;
}

/* ---- Small screens -------------------------------------------------------- */

@container bcalc (max-width: 640px) {
  .bcalc-head {
    padding: 14px 18px;
    font-size: 17px;
  }

  .bcalc-body {
    padding: 18px;
  }

  .bcalc-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Tables become stacked cards, one per selection */
  .bcalc .bcalc-table thead {
    display: none;
  }

  .bcalc .bcalc-table,
  .bcalc .bcalc-table tbody,
  .bcalc .bcalc-table tr,
  .bcalc .bcalc-table td {
    display: block;
    width: 100%;
  }

  .bcalc .bcalc-table tr {
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 1px solid var(--bcalc-line);
    border-radius: 12px;
  }

  .bcalc .bcalc-table tr[hidden] {
    display: none !important;
  }

  .bcalc .bcalc-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border: 0;
    text-align: right;
  }

  .bcalc .bcalc-table td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--bcalc-muted);
    text-align: left;
  }

  .bcalc .bcalc-table td > * {
    flex: 1;
    min-width: 0;
    max-width: 62%;
  }

  .bcalc .bcalc-table .bcalc-input,
  .bcalc .bcalc-table .bcalc-select {
    width: 100%;
    min-width: 0;
  }

  .bcalc .bcalc-table .bcalc-odds-frac .bcalc-input,
  .bcalc .bcalc-table .bcalc-affix .bcalc-input {
    width: 0;
  }

  .bcalc .bcalc-table .bcalc-odds,
  .bcalc .bcalc-table .bcalc-affix {
    max-width: 62%;
  }

  .bcalc-legs .bcalc-leg-n {
    width: 100%;
  }

  .bcalc .bcalc-table .bcalc-ew-only {
    display: none;
  }

  .bcalc .bcalc-is-ew .bcalc-table .bcalc-ew-only {
    display: flex;
  }

  .bcalc .bcalc-dh-row {
    margin-top: -8px;
    background: var(--bcalc-tint);
  }

  .bcalc .bcalc-dh-row td::before {
    content: none;
  }

  .bcalc .bcalc-dh-row td > * {
    max-width: 100%;
  }

  .bcalc-dh {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 4px;
  }

  .bcalc-stat-value {
    font-size: 20px;
  }

  .bcalc-avg-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 46px;
  }

  .bcalc-tip::after {
    width: 200px;
  }
}

/* Wide tables (many columns) stack into cards sooner */
@container bcalc (max-width: 940px) {
  /* Tables become stacked cards, one per selection */
  .bcalc .bcalc-table-wide thead {
    display: none;
  }

  .bcalc .bcalc-table-wide,
  .bcalc .bcalc-table-wide tbody,
  .bcalc .bcalc-table-wide tr,
  .bcalc .bcalc-table-wide td {
    display: block;
    width: 100%;
  }

  .bcalc .bcalc-table-wide tr {
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 1px solid var(--bcalc-line);
    border-radius: 12px;
  }

  .bcalc .bcalc-table-wide tr[hidden] {
    display: none !important;
  }

  .bcalc .bcalc-table-wide td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border: 0;
    text-align: right;
  }

  .bcalc .bcalc-table-wide td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--bcalc-muted);
    text-align: left;
  }

  .bcalc .bcalc-table-wide td > * {
    flex: 1;
    min-width: 0;
    max-width: 62%;
  }

  .bcalc .bcalc-table-wide .bcalc-input,
  .bcalc .bcalc-table-wide .bcalc-select {
    width: 100%;
    min-width: 0;
  }

  .bcalc .bcalc-table-wide .bcalc-odds-frac .bcalc-input,
  .bcalc .bcalc-table-wide .bcalc-affix .bcalc-input {
    width: 0;
  }

  .bcalc .bcalc-table-wide .bcalc-odds,
  .bcalc .bcalc-table-wide .bcalc-affix {
    max-width: 62%;
  }
}

