/* ===========================================================================
 * blackjackpickfa.com — light product-comparison design.
 * Denser than an editorial site: tight vertical rhythm, tabular numbers,
 * chips and matrices instead of hero art.
 * ======================================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f4f7fb;
  --bg-tint: #eaf0fa;
  --surface: #ffffff;
  --line: #dfe5ee;
  --line-strong: #c6d0de;
  --text: #16202e;
  --text-2: #45536a;
  --muted: #6b7a90;
  --brandc: #2f6bd8;
  --brandc-dark: #23539f;
  --brandc-soft: #e7effc;
  --ok: #12805c;
  --warn: #a4620a;
  --bad: #b3352c;
  --radius: 10px;
  --wrap: 76rem;

  /* table theme tokens consumed by game.css */
  --bjc-felt: #eef3fa;
  --bjc-felt-edge: #c6d0de;
  --bjc-felt-text: #16202e;
  --bjc-surface: #ffffff;
  --bjc-border: #dfe5ee;
  --bjc-text: #16202e;
  --bjc-muted: #6b7a90;
  --bjc-accent: #2f6bd8;
  --bjc-accent-ink: #ffffff;
  --bjc-secondary: #12805c;
  --bjc-win: #12805c;
  --bjc-loss: #b3352c;
  --bjc-radius: 10px;
  --bjc-chip: #2f6bd8;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Naskh Arabic", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.9;
}
body.nav-locked { overflow: hidden; }

img { max-width: 100%; height: auto; }
a { color: var(--brandc); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--brandc); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(var(--wrap), 100% - 2rem); margin-inline: auto; }

.skip {
  position: absolute; inset-inline-start: -9999px; top: 0;
  background: var(--brandc); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip:focus { inset-inline-start: 0; }

h1, h2, h3, h4 { line-height: 1.45; margin: 0 0 .55rem; font-weight: 700; }
h1 { font-size: clamp(1.5rem, 4vw, 2.15rem); letter-spacing: -.015em; }
h2 { font-size: clamp(1.18rem, 2.6vw, 1.5rem); margin-top: 2rem; }
h3 { font-size: 1.05rem; margin-top: 1.35rem; }
p { margin: 0 0 .95rem; }
main ul, main ol { padding-inline-start: 1.25rem; margin: 0 0 1rem; }
main li { margin-bottom: .4rem; }

.lead { font-size: 1.05rem; color: var(--text-2); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

/* -------------------------------------------------------------- utility bar */

.utility { background: var(--text); color: #dbe3ef; font-size: .8rem; }
.utility-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 34px; flex-wrap: wrap; }
.utility-note { opacity: .75; }
.utility-links { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.utility-links a { color: #fff; font-weight: 600; }

/* ------------------------------------------------------------------ header */

.site-head { position: sticky; top: 0; z-index: 60; background: #fff; border-bottom: 1px solid var(--line); }
.head-inner { display: flex; align-items: center; gap: 1rem; min-height: 62px; }
.brand img { display: block; }

.nav-btn {
  margin-inline-start: auto; width: 44px; height: 44px;
  display: grid; place-content: center; gap: 5px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.nav-btn span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; }

.site-nav { display: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--text); font-size: .93rem; font-weight: 600; }
.site-nav a[aria-current="page"] { color: var(--brandc); }
.site-nav.is-open {
  display: block; position: absolute; inset-inline: 0; top: 100%;
  background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 1rem 1rem;
  box-shadow: 0 14px 30px rgba(22, 32, 46, .1);
  max-height: calc(100vh - 96px); overflow-y: auto;
}
.site-nav.is-open li { border-bottom: 1px solid var(--line); }
.site-nav.is-open a { display: block; padding: .7rem .2rem; }
.nav-cta { display: block; margin-top: .8rem; text-align: center; }

@media (min-width: 62rem) {
  .nav-btn { display: none; }
  .site-nav { display: flex; align-items: center; gap: 1.35rem; margin-inline-start: auto; position: static; padding: 0; box-shadow: none; border: 0; }
  .site-nav ul { display: flex; gap: 1.25rem; }
  .nav-cta { margin: 0; }
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .5rem 1.05rem;
  border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: #fff; color: var(--text);
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--brandc); }
.btn-primary { background: var(--brandc); border-color: var(--brandc); color: #fff; }
.btn-primary:hover { background: var(--brandc-dark); border-color: var(--brandc-dark); }
.btn-soft { background: var(--brandc-soft); border-color: var(--brandc-soft); color: var(--brandc-dark); }
.btn-lg { min-height: 52px; font-size: 1rem; padding-inline: 1.5rem; }
.btn-sm { min-height: 40px; font-size: .84rem; padding: .25rem .75rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* -------------------------------------------------------------------- hero */

.hero { background: linear-gradient(180deg, var(--bg-tint), #fff); border-bottom: 1px solid var(--line); padding: 2.2rem 0 1.8rem; }
.hero h1 { margin-bottom: .7rem; }
.hero-sub { font-size: 1.05rem; color: var(--text-2); max-width: 44rem; }
.hero-metrics { display: grid; gap: .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 1.4rem; }
@media (min-width: 48rem) { .hero-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.metric { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; }
.metric b { display: block; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.metric span { font-size: .8rem; color: var(--muted); }

/* ---------------------------------------------------------------- sections */

.section { padding: 2.1rem 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 1rem; max-width: 46rem; }
.section-head h2 { margin-top: 0; }
.section-head p { color: var(--muted); margin: 0; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.05rem; }
.panel h2:first-child, .panel h3:first-child { margin-top: 0; }

.grid { display: grid; gap: .8rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 46rem) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .95rem; min-width: 0; }
.card h3 { margin-top: 0; font-size: 1rem; }
.card p { font-size: .9rem; color: var(--text-2); margin-bottom: .5rem; }

.note {
  background: var(--brandc-soft); border: 1px solid #cddcf7; color: #1b3f79;
  border-radius: var(--radius); padding: .75rem .9rem; font-size: .88rem; margin: 1rem 0;
}
.note p:last-child { margin-bottom: 0; }

.data-note {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: .7rem .9rem; font-size: .84rem; color: var(--muted); margin: 1rem 0; background: var(--bg-alt);
}

/* -------------------------------------------------------------- breadcrumb */

.crumbs { padding: .8rem 0 .1rem; font-size: .8rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; padding: 0; }
.crumbs li { color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-inline-end: .3rem; color: var(--line-strong); }
.crumbs a { color: var(--muted); }

/* ------------------------------------------------------------------ tables */

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; min-width: 42rem; font-size: .88rem; background: #fff; }
caption { text-align: start; font-size: .84rem; color: var(--muted); padding: .7rem .8rem 0; }
th, td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
thead th { background: var(--bg-alt); font-size: .8rem; color: var(--text-2); white-space: nowrap; position: sticky; top: 0; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody tr:nth-child(even) { background: #fbfcfe; }
.num { font-variant-numeric: tabular-nums; }
.table-plain { min-width: 0; }
.table-plain th, .table-plain td { white-space: normal; }

th button.sortbtn {
  background: none; border: 0; font: inherit; font-size: .8rem; font-weight: 600;
  color: var(--text-2); cursor: pointer; padding: .5rem .35rem; min-height: 40px; display: inline-flex; gap: .25rem; align-items: center;
}
th button.sortbtn::after { content: "⇅"; font-size: .75rem; opacity: .5; }
th button.sortbtn[data-sort-dir="desc"]::after { content: "↓"; opacity: 1; color: var(--brandc); }
th button.sortbtn[data-sort-dir="asc"]::after { content: "↑"; opacity: 1; color: var(--brandc); }

/* ------------------------------------------------------------------ brands */

.brand-logo {
  display: grid; place-items: center;
  background: #101722; border: 1px solid #101722; border-radius: 8px;
  padding: .4rem .6rem; width: 96px; height: 48px; flex: 0 0 auto;
}
.brand-logo img { max-height: 34px; width: auto; object-fit: contain; }

.brand-row {
  display: flex; gap: .85rem; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem; background: #fff; margin-bottom: .7rem; flex-wrap: wrap;
}
.brand-row-main { flex: 1 1 14rem; min-width: 0; }
.brand-row h3 { margin: 0 0 .2rem; font-size: 1.02rem; }
.brand-row p { margin: 0; font-size: .87rem; color: var(--text-2); }
.brand-row-side { display: flex; flex-direction: column; gap: .4rem; align-items: stretch; min-width: 9rem; }

.crit-list { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: .5rem 0 0; }
.crit-list li { margin: 0; }
.crit {
  font-size: .76rem; padding: .18rem .55rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--bg-alt);
}
.crit b { color: var(--text); font-weight: 700; }
.pending { color: var(--muted); }

/* ---------------------------------------------------------------- selector */

.selector { background: #fff; border: 1px solid var(--line-strong); border-radius: 14px; padding: 1.1rem; box-shadow: 0 6px 22px rgba(22, 32, 46, .06); }
.selector legend { font-weight: 700; font-size: 1rem; padding: 0; }
.selector fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.opt-grid { display: grid; gap: .5rem; grid-template-columns: 1fr; margin-top: .7rem; }
@media (min-width: 40rem) { .opt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 60rem) { .opt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.opt { position: relative; }
.opt input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt span {
  display: block; padding: .7rem .85rem; border: 1px solid var(--line-strong);
  border-radius: var(--radius); font-size: .9rem; font-weight: 600; background: #fff;
}
.opt small { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); margin-top: .15rem; }
.opt input:checked + span { border-color: var(--brandc); background: var(--brandc-soft); color: var(--brandc-dark); }
.opt input:focus-visible + span { outline: 3px solid var(--brandc); outline-offset: 2px; }

.result-head { display: flex; flex-wrap: wrap; gap: .6rem; align-items: baseline; justify-content: space-between; margin-top: 1.5rem; }
.result-head h3 { margin: 0; }

/* --------------------------------------------------------------- compare */

.compare-pick { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.compare-pick label { display: flex; gap: .4rem; align-items: center; font-size: .86rem; font-weight: 500; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.compare-pick input { width: auto; min-height: 0; margin: 0; }
.compare-out { margin-top: 1.2rem; }

/* -------------------------------------------------------------------- faq */

.faq details { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .5rem; background: #fff; }
.faq summary { cursor: pointer; padding: .75rem .9rem; font-weight: 600; font-size: .94rem; list-style: none; display: flex; justify-content: space-between; gap: .5rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brandc); font-size: 1.1rem; }
.faq details[open] summary::after { content: "−"; }
.faq .faq-a { padding: 0 .9rem .8rem; color: var(--text-2); font-size: .9rem; }
.faq .faq-a p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- related */

.related { margin: 1.8rem 0 1rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.related h2 { margin-top: 0; font-size: 1.05rem; }
.related-list { list-style: none; padding: 0; display: grid; gap: .45rem; }
@media (min-width: 46rem) { .related-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.related-list li { margin: 0; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.related-list a { font-weight: 600; font-size: .9rem; }
.related-list span { display: block; font-size: .8rem; color: var(--muted); }

/* --------------------------------------------------------------- comments */

.comment { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .85rem; background: #fff; margin-bottom: .55rem; }
.comment-head { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin-bottom: .3rem; }
.comment-name { font-weight: 700; font-size: .9rem; }
.comment p { margin: 0 0 .3rem; font-size: .9rem; }
.comment time { font-size: .77rem; color: var(--muted); }
.comment.is-pending { border-style: dashed; background: var(--bg-alt); }
.comment-badge { font-size: .7rem; padding: .1rem .45rem; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--line); color: var(--muted); }
.stars { font-size: .85rem; }
.stars-on { color: #d99a12; }
.stars-off { color: var(--line-strong); }

.form-grid { display: grid; gap: .65rem; }
@media (min-width: 42rem) { .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; } }
label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: .2rem; }
input, select, textarea {
  width: 100%; font: inherit; font-size: .92rem; padding: .55rem .65rem; min-height: 44px;
  border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; color: var(--text);
}
textarea { min-height: 6.5rem; resize: vertical; }
.form-status { font-size: .85rem; color: var(--brandc-dark); min-height: 1.3rem; }

/* ------------------------------------------------------------------- misc */

.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 2.2rem; margin-bottom: .8rem; }
.steps li::before {
  content: counter(s); position: absolute; inset-inline-start: 0; top: .25rem;
  width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 6px;
  background: var(--brandc-soft); color: var(--brandc-dark); font-weight: 800; font-size: .82rem;
}
.split-list { display: grid; gap: .7rem; }
@media (min-width: 46rem) { .split-list { grid-template-columns: 1fr 1fr; } }
.list-good li::marker { color: var(--ok); }
.list-bad li::marker { color: var(--bad); }

.article { max-width: 48rem; }
.byline { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.byline-team { font-weight: 700; color: var(--text-2); }
.byline-sep { opacity: .5; }

.toc { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin: 1.1rem 0 1.5rem; }
.toc h2 { margin: 0 0 .4rem; font-size: .92rem; }
.toc ol { margin: 0; padding-inline-start: 1.1rem; }
.toc a { color: var(--text); font-size: .88rem; }

.game-shell { padding: 1rem 0; }

/* ----------------------------------------------------------------- footer */

.site-foot { margin-top: 2.5rem; background: var(--bg-alt); border-top: 1px solid var(--line); padding: 2rem 0 1.4rem; }
.foot-grid { display: grid; gap: 1.3rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .foot-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .foot-grid { grid-template-columns: repeat(4, 1fr); } }
.foot-col h2 { font-size: .9rem; margin: 0 0 .5rem; }
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { margin-bottom: .35rem; }
.foot-col a { color: var(--text-2); font-size: .86rem; }
.foot-bottom { margin-top: 1.6rem; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.foot-copy { margin: .5rem 0 0; }

/* -------------------------------------------------------------------- 404 */

.err-wrap { text-align: center; padding: 3rem 0 1.5rem; }
.err-code { font-size: clamp(3rem, 12vw, 5rem); font-weight: 800; color: var(--brandc); line-height: 1; margin: 0; }

[hidden] { display: none !important; }
