/**
 * /card-counting-efficiency-calculator/ -- Playing Efficiency (PE), Betting
 * Correlation (BC) and Insurance Correlation (IC) calculator + reference table.
 * Consumes tokens.css; chrome + prose come from casino-v2.css + article.css.
 * Prefix: .eff-  (mirrors the .dev- deviations idiom).
 */

/* ---- hero (mirrors .dev-hero) ---- */
.eff-hero {
  background:
    radial-gradient(120% 140% at 100% 0, rgba(255,255,255,0.06), transparent 60%),
    linear-gradient(160deg, var(--bji-navy-900), var(--bji-navy-800) 70%);
  color: var(--bji-text-inverse);
  padding: var(--bji-space-6) 0 var(--bji-space-7);
}
.eff-hero .crumbs { font-size: var(--bji-text-xs); color: var(--bji-text-inverse-muted); margin-bottom: var(--bji-space-4); }
.eff-hero .crumbs a { color: var(--bji-text-inverse-muted); text-decoration: none; }
.eff-hero .crumbs a:hover { color: #fff; }
.eff-hero h1 {
  font-size: var(--bji-text-3xl);
  font-weight: var(--bji-weight-black);
  line-height: var(--bji-leading-tight);
  margin: 0 0 var(--bji-space-3);
  color: #fff;
}
.eff-hero .tagline {
  font-size: var(--bji-text-lg);
  color: var(--bji-text-inverse-muted);
  max-width: 46rem;
  margin: 0;
}
.eff-hero .byline {
  display: flex; align-items: center; gap: var(--bji-space-2);
  margin: var(--bji-space-4) 0 0;
  font-size: var(--bji-text-sm); color: var(--bji-text-inverse-muted);
}
.eff-hero .byline img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.eff-hero .byline a { color: #fff; font-weight: var(--bji-weight-semibold); border-bottom: 1px solid rgba(255,255,255,0.35); text-decoration: none; }
.eff-hero .byline a:hover { border-bottom-color: #fff; }
.eff-hero .trust { margin: var(--bji-space-2) 0 0; font-size: var(--bji-text-xs); color: var(--bji-text-inverse-muted); }
.eff-hero .trust b { color: #fff; font-weight: var(--bji-weight-semibold); }

/* ---- tool panel ---- */
.eff-tool { margin-top: calc(-1 * var(--bji-space-6)); padding-bottom: var(--bji-section-gap); }
.eff-panel {
  background: var(--bji-surface);
  border: 1px solid var(--bji-border);
  border-radius: var(--bji-radius-lg);
  box-shadow: var(--bji-shadow-md);
  padding: var(--bji-space-5);
}
.eff-panel-title {
  margin: 0 0 var(--bji-space-1);
  font-size: var(--bji-text-lg); font-weight: var(--bji-weight-bold);
  color: var(--bji-navy-900);
}
.eff-panel-sub { margin: 0 0 var(--bji-space-4); font-size: var(--bji-text-sm); color: var(--bji-text-muted); }

/* ---- tag input grid ---- */
.eff-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: var(--bji-space-2);
  margin-bottom: var(--bji-space-4);
}
.eff-tag { display: flex; flex-direction: column; align-items: center; gap: var(--bji-space-1); min-width: 0; }
.eff-tag-rank {
  font-size: var(--bji-text-sm); font-weight: var(--bji-weight-black);
  color: var(--bji-navy-900); line-height: 1;
}
.eff-tag-rank small { font-weight: var(--bji-weight-semibold); color: var(--bji-text-muted); font-size: 0.7em; }
.eff-tag input {
  width: 100%; min-width: 0; text-align: center;
  font-size: var(--bji-text-lg); font-weight: var(--bji-weight-bold);
  color: var(--bji-navy-900);
  border: 1px solid var(--bji-border-strong); border-radius: var(--bji-radius-md);
  padding: var(--bji-space-2) var(--bji-space-1);
  -moz-appearance: textfield;
}
.eff-tag input::-webkit-outer-spin-button,
.eff-tag input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.eff-tag input:focus { outline: 2px solid var(--bji-green-500); outline-offset: 1px; border-color: var(--bji-green-500); }
@media (max-width: 640px) {
  .eff-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--bji-space-2) var(--bji-space-1); }
}

/* ---- presets ---- */
.eff-presets { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bji-space-2); margin-bottom: var(--bji-space-4); }
.eff-presets-label {
  font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold);
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--bji-text-muted);
  margin-right: var(--bji-space-1);
}
.eff-preset {
  border: 1px solid var(--bji-border-strong); background: var(--bji-surface-sunken);
  border-radius: 999px; padding: var(--bji-space-1) var(--bji-space-3);
  font-size: var(--bji-text-sm); font-weight: var(--bji-weight-semibold);
  color: var(--bji-navy-800); cursor: pointer;
}
.eff-preset:hover { background: var(--bji-navy-900); color: #fff; border-color: var(--bji-navy-900); }

/* ---- actions ---- */
.eff-actions { display: flex; flex-wrap: wrap; gap: var(--bji-space-3); align-items: center; }
.eff-calc {
  font-size: var(--bji-text-base); font-weight: var(--bji-weight-bold);
  padding: var(--bji-space-2) var(--bji-space-5);
}
.eff-reset {
  border: none; background: none; cursor: pointer;
  font-size: var(--bji-text-sm); color: var(--bji-text-muted);
  text-decoration: underline; text-underline-offset: 2px;
}
.eff-reset:hover { color: var(--bji-navy-900); }

/* ---- results ---- */
.eff-results {
  margin-top: var(--bji-space-5);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--bji-space-4);
}
@media (max-width: 640px) { .eff-results { grid-template-columns: 1fr; } }
.eff-result {
  background: var(--bji-surface-sunken);
  border: 1px solid var(--bji-border);
  border-top: 3px solid var(--bji-green-500);
  border-radius: var(--bji-radius-md);
  padding: var(--bji-space-4);
  text-align: center;
}
.eff-result:nth-child(2) { border-top-color: var(--bji-blue-500); }
.eff-result:nth-child(3) { border-top-color: var(--bji-navy-800); }
.eff-result-head { display: flex; align-items: baseline; justify-content: center; gap: var(--bji-space-2); }
.eff-result-label { font-size: var(--bji-text-sm); font-weight: var(--bji-weight-bold); color: var(--bji-navy-900); }
.eff-result-abbr {
  font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold);
  color: var(--bji-text-muted); background: var(--bji-surface);
  border: 1px solid var(--bji-border); border-radius: var(--bji-radius-sm);
  padding: 1px 5px; letter-spacing: 0.03em;
}
.eff-result-value {
  display: block; margin: var(--bji-space-2) 0 var(--bji-space-1);
  font-size: var(--bji-text-3xl); font-weight: var(--bji-weight-black);
  color: var(--bji-navy-900); font-variant-numeric: tabular-nums;
}
.eff-result-desc { margin: 0; font-size: var(--bji-text-xs); color: var(--bji-text-muted); line-height: var(--bji-leading-snug); }
.eff-results.is-degenerate .eff-result-value { color: var(--bji-text-faint); }

.eff-active {
  margin: var(--bji-space-4) 0 0; font-size: var(--bji-text-sm); color: var(--bji-text-muted);
}
.eff-active b { color: var(--bji-navy-900); }

.eff-note {
  margin: var(--bji-space-5) 0 0; padding: var(--bji-space-3) var(--bji-space-4);
  background: var(--bji-surface-sunken); border-left: 4px solid var(--bji-blue-500);
  border-radius: var(--bji-radius-sm); font-size: var(--bji-text-sm); color: var(--bji-text-muted);
}

/* visually-hidden helper (bootstrap's .screen-reader-text is not on the v2 stack) */
.eff-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- reference table ---- */
.eff-ref { padding-bottom: var(--bji-section-gap); }
.eff-ref .cv2-container { max-width: var(--bji-prose-width); }
.eff-ref h2 { font-size: var(--bji-text-2xl); font-weight: var(--bji-weight-bold); margin: 0 0 var(--bji-space-2); }
.eff-ref-intro { margin: 0 0 var(--bji-space-4); font-size: var(--bji-text-base); color: var(--bji-text-muted); }
.eff-ref-block { min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.eff-ref-table { width: 100%; border-collapse: collapse; font-size: var(--bji-text-sm); }
.eff-ref-table caption {
  caption-side: bottom; text-align: left; padding: var(--bji-space-2) 0 0;
  font-size: var(--bji-text-xs); color: var(--bji-text-muted);
}
.eff-ref-table thead th {
  text-align: center; font-size: var(--bji-text-xs); text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--bji-text-muted); font-weight: var(--bji-weight-bold);
  padding: var(--bji-space-2); border-bottom: 2px solid var(--bji-border-strong); white-space: nowrap;
}
.eff-ref-table thead th:first-child { text-align: left; }
.eff-ref-table tbody td { padding: var(--bji-space-2); border-bottom: 1px solid var(--bji-border); text-align: center; vertical-align: middle; }
.eff-ref-table tbody td:first-child { text-align: left; }
.eff-ref-sys { font-weight: var(--bji-weight-bold); color: var(--bji-navy-900); white-space: nowrap; }
.eff-ref-num { font-variant-numeric: tabular-nums; color: var(--bji-text); }
.eff-ref-load {
  border: 1px solid var(--bji-border-strong); background: var(--bji-surface);
  border-radius: var(--bji-radius-sm); padding: 2px var(--bji-space-2);
  font-size: var(--bji-text-xs); font-weight: var(--bji-weight-semibold);
  color: var(--bji-navy-800); cursor: pointer; white-space: nowrap;
}
.eff-ref-load:hover { background: var(--bji-navy-900); color: #fff; border-color: var(--bji-navy-900); }

/* ---- article ---- */
.eff-article { padding-bottom: var(--bji-section-gap); }
.eff-article .eff-prose { max-width: var(--bji-prose-width); margin-inline: auto; }

/* ---- author card (mirrors .dev-author-card) ---- */
.eff-author { padding-bottom: var(--bji-section-gap); }
.eff-author-card {
  max-width: var(--bji-prose-width); margin-inline: auto;
  display: grid; grid-template-columns: 108px 1fr; gap: var(--bji-space-5);
  background: var(--bji-surface); border: 1px solid var(--bji-border);
  border-left: 4px solid var(--bji-blue-500); border-radius: var(--bji-radius-lg);
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
}
.eff-author-card .photo { width: 108px; height: 108px; border-radius: 50%; object-fit: cover; border: 3px solid var(--bji-blue-100); }
.eff-author-card .kicker { display: block; font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--bji-blue-600); margin-bottom: var(--bji-space-1); }
.eff-author-card h2 { margin: 0 0 var(--bji-space-1); font-size: var(--bji-text-xl); font-weight: var(--bji-weight-bold); }
.eff-author-card .role { margin: 0 0 var(--bji-space-3); font-size: var(--bji-text-sm); font-weight: var(--bji-weight-semibold); color: var(--bji-text-muted); }
.eff-author-card .bio { margin: 0 0 var(--bji-space-3); font-size: var(--bji-text-sm); }
.eff-author-card .links { margin: 0; font-size: var(--bji-text-sm); }
@media (max-width: 560px) { .eff-author-card { grid-template-columns: 1fr; } .eff-author-card .photo { width: 84px; height: 84px; } }

/* ---- related tools (mirrors .dev-tool-grid) ---- */
.eff-tools { padding-bottom: var(--bji-section-gap); }
.eff-tools h2 { font-size: var(--bji-text-2xl); font-weight: var(--bji-weight-bold); margin: 0 0 var(--bji-space-4); }
.eff-tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--bji-space-4); }
.eff-tool-card { background: var(--bji-surface); border: 1px solid var(--bji-border); border-radius: var(--bji-radius-md); padding: var(--bji-space-4); display: flex; flex-direction: column; gap: var(--bji-space-2); }
.eff-tool-card .icon { font-size: 1.5rem; line-height: 1; }
.eff-tool-card h3 { margin: 0; font-size: var(--bji-text-base); }
.eff-tool-card h3 a { text-decoration: none; color: var(--bji-navy-800); }
.eff-tool-card p { margin: 0; font-size: var(--bji-text-sm); color: var(--bji-text-muted); }

.eff-comments { padding-bottom: var(--bji-section-gap); }
.eff-comments .cv2-container { max-width: var(--bji-prose-width); }
