/* ========================================
   POKER CARDS
   Shared card + suit visual language.
   Lives in its own stylesheet because it is used by the quiz, the
   LeakFinder AND by public pages on the "landing" layout, which does not
   load leakfinder.css.
   ======================================== */

/* ── Card base ── */
.lf-card {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  border-radius: 7px;
  font-family: "JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  border: 1px solid;
  vertical-align: middle;
  white-space: nowrap;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.35),
    0 0 0 0.5px rgba(255, 255, 255, 0.06) inset;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.lf-card:hover {
  transform: translateY(-1px);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.45),
    0 0 0 0.5px rgba(255, 255, 255, 0.08) inset;
}

.lf-card__rank {
  font-size: 14px;
}

.lf-card__suit {
  font-size: 13px;
  line-height: 1;
}

/* ── Medium card variant (admin postflop preview board) ── */
.lf-card--md {
  padding: 6px 10px;
  border-radius: 9px;
  gap: 3px;
}

.lf-card--md .lf-card__rank {
  font-size: 17px;
  line-height: 1;
}

.lf-card--md .lf-card__suit {
  font-size: 14px;
  line-height: 1;
}

@media (min-width: 640px) {
  .lf-card--md {
    padding: 7px 11px;
    border-radius: 10px;
    gap: 4px;
  }

  .lf-card--md .lf-card__rank {
    font-size: 19px;
  }

  .lf-card--md .lf-card__suit {
    font-size: 16px;
  }
}

/* ── Large card variant (postflop quiz) ── */
.lf-card--lg {
  padding: 10px 14px;
  border-radius: 12px;
  gap: 4px;
}

.lf-card--lg .lf-card__rank {
  font-size: 22px;
  line-height: 1;
}

.lf-card--lg .lf-card__suit {
  font-size: 18px;
  line-height: 1;
}

@media (min-width: 640px) {
  .lf-card--lg {
    padding: 12px 16px;
    border-radius: 14px;
    gap: 5px;
  }

  .lf-card--lg .lf-card__rank {
    font-size: 26px;
  }

  .lf-card--lg .lf-card__suit {
    font-size: 20px;
  }
}

.lf-card--xl {
  padding: 12px 16px;
  border-radius: 14px;
  gap: 5px;
}

.lf-card--xl .lf-card__rank {
  font-size: 28px;
  line-height: 1;
}

.lf-card--xl .lf-card__suit {
  font-size: 22px;
  line-height: 1;
}

@media (min-width: 640px) {
  .lf-card--xl {
    padding: 14px 18px;
    border-radius: 16px;
    gap: 6px;
  }

  .lf-card--xl .lf-card__rank {
    font-size: 34px;
  }

  .lf-card--xl .lf-card__suit {
    font-size: 26px;
  }
}

/* ── 2XL hero hand variant (postflop quiz hero row) ── */
.lf-card--2xl {
  padding: 14px 20px;
  border-radius: 16px;
  gap: 6px;
}

.lf-card--2xl .lf-card__rank {
  font-size: 32px;
  line-height: 1;
}

.lf-card--2xl .lf-card__suit {
  font-size: 26px;
  line-height: 1;
}

@media (min-width: 640px) {
  .lf-card--2xl {
    padding: 18px 26px;
    border-radius: 18px;
    gap: 8px;
  }

  .lf-card--2xl .lf-card__rank {
    font-size: 44px;
  }

  .lf-card--2xl .lf-card__suit {
    font-size: 34px;
  }
}

/* ── Suit color variants (WCAG AA · color-blind safe) ──
   Solid opaque backgrounds so cards pop on dark felt.
   Palette: silver spades, coral hearts, blue diamonds, gold clubs.
   Avoids red-green confusion (protanopia/deuteranopia). */

/* Spades ♠ – silver/slate (high contrast on dark) */
.lf-suit--spade {
  color: #f1f5f9;
  background: linear-gradient(160deg, #64748b, #475569);
  border-color: rgba(148, 163, 184, 0.4);
}

.lf-suit--spade .lf-card__suit {
  color: #cbd5e1;
}

/* Hearts ♥ – red */
.lf-suit--heart {
  color: #fff;
  background: linear-gradient(160deg, #ef4444, #b91c1c);
  border-color: rgba(239, 68, 68, 0.45);
}

.lf-suit--heart .lf-card__suit {
  color: #fecaca;
}

/* Diamonds ♦ – turquoise blue */
.lf-suit--diamond {
  color: #fff;
  background: linear-gradient(160deg, #22d3ee, #0891b2);
  border-color: rgba(34, 211, 238, 0.5);
}

.lf-suit--diamond .lf-card__suit {
  color: #cffafe;
}

/* Clubs ♣ – green */
.lf-suit--club {
  color: #fff;
  background: linear-gradient(160deg, #22c55e, #15803d);
  border-color: rgba(34, 197, 94, 0.45);
}

.lf-suit--club .lf-card__suit {
  color: #bbf7d0;
}

/* ── Focus state for keyboard navigation ── */
.lf-card:focus-visible {
  outline: 2px solid var(--brm8-primary, #8aebff);
  outline-offset: 2px;
}

/* ── Hand pair (two cards side by side) ── */
.lf-hand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── Second card slight overlap effect ── */
.lf-hand .lf-card:last-child {
  margin-left: -2px;
}

/* ── Light mode overrides ── */
html:not(.dark) .lf-card {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 0 0 0.5px rgba(0, 0, 0, 0.04) inset;
}

html:not(.dark) .lf-card:hover {
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.16),
    0 0 0 0.5px rgba(0, 0, 0, 0.06) inset;
}

html:not(.dark) .lf-suit--spade {
  color: #1e293b;
  background: linear-gradient(160deg, #64748b, #334155);
  border-color: rgba(51, 65, 85, 0.3);
}

html:not(.dark) .lf-suit--spade .lf-card__suit {
  color: #cbd5e1;
}

html:not(.dark) .lf-suit--heart {
  color: #fff;
  background: linear-gradient(160deg, #dc2626, #991b1b);
  border-color: rgba(220, 38, 38, 0.3);
}

html:not(.dark) .lf-suit--heart .lf-card__suit {
  color: #fecaca;
}

html:not(.dark) .lf-suit--diamond {
  color: #fff;
  background: linear-gradient(160deg, #06b6d4, #0e7490);
  border-color: rgba(6, 182, 212, 0.3);
}

html:not(.dark) .lf-suit--diamond .lf-card__suit {
  color: #cffafe;
}

html:not(.dark) .lf-suit--club {
  color: #fff;
  background: linear-gradient(160deg, #16a34a, #166534);
  border-color: rgba(22, 163, 74, 0.3);
}

html:not(.dark) .lf-suit--club .lf-card__suit {
  color: #bbf7d0;
}
