/* ------------------------------------------------------------------
   21 Blackjack Betting - social casino stylesheet

   Naming rules used across the whole project (stick to them):

   1. BEM with a project prefix "bb-"  ->  .bb-block__element--modifier
      .bb-card              block
      .bb-card__title       element inside the block
      .bb-card--featured    variation of the block

   2. Utility helpers get a "u-" prefix and do exactly one thing.
      .u-hidden, .u-center, .u-nowrap

   3. State classes that JS toggles get an "is-" prefix.
      .is-open, .is-active, .is-locked

   4. IDs are for JS hooks only, never for styling, and always "js-".
      id="js-age-gate", id="js-coin-badge"

   No generic names like .container, .wrapper, .btn-primary, .active.
   ------------------------------------------------------------------ */

:root {
  --bb-ink: #0b1410;
  --bb-ink-2: #10201a;
  --bb-felt: #123527;
  --bb-felt-soft: #17402f;
  --bb-line: rgba(233, 216, 166, 0.16);
  --bb-cream: #f3ede1;
  --bb-cream-dim: #b9b3a5;
  --bb-gold: #e0b552;
  --bb-gold-dark: #b8892c;
  --bb-red: #c8452f;
  --bb-radius: 14px;
  --bb-shell: 1180px;
  --bb-font-head: "Bebas Neue", "Barlow Condensed", sans-serif;
  --bb-font-body: "Barlow", system-ui, sans-serif;
  --bb-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bb-ink);
  color: var(--bb-cream);
  font-family: var(--bb-font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--bb-font-head);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin: 0 0 0.5em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
}
h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}
h3 {
  font-size: 1.5rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--bb-gold);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Layout ---------------------------------------------------------- */

.bb-shell {
  width: 100%;
  max-width: var(--bb-shell);
  margin: 0 auto;
  padding: 0 22px;
}

.bb-section {
  padding: 74px 0;
}

.bb-section--tight {
  padding: 46px 0;
}

.bb-section--felt {
  background:
    radial-gradient(circle at 20% 0%, rgba(224, 181, 82, 0.09), transparent 55%),
    var(--bb-ink-2);
  border-top: 1px solid var(--bb-line);
  border-bottom: 1px solid var(--bb-line);
}

.bb-grid {
  display: grid;
  gap: 22px;
}

.bb-grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.bb-grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.bb-lede {
  color: var(--bb-cream-dim);
  font-size: 1.12rem;
  max-width: 62ch;
}

.bb-eyebrow {
  color: var(--bb-gold);
  font-family: var(--bb-font-head);
  font-size: 1rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

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

.bb-btn {
  appearance: none;
  background: linear-gradient(180deg, var(--bb-gold), var(--bb-gold-dark));
  border: 0;
  border-radius: 999px;
  color: #201603;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--bb-font-head);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  padding: 13px 26px;
  text-transform: uppercase;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.bb-btn:hover {
  filter: brightness(1.08);
  text-decoration: none;
  transform: translateY(-1px);
}

.bb-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.55;
  transform: none;
}

.bb-btn--ghost {
  background: transparent;
  border: 1px solid var(--bb-line);
  color: var(--bb-cream);
}

.bb-btn--small {
  font-size: 0.92rem;
  padding: 9px 18px;
}

.bb-btn--wide {
  justify-content: center;
  width: 100%;
}

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

.bb-header {
  background: rgba(11, 20, 16, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bb-line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.bb-header__inner {
  align-items: center;
  display: flex;
  gap: 18px;
  min-height: 72px;
}

.bb-logo {
  align-items: center;
  color: var(--bb-cream);
  display: inline-flex;
  font-family: var(--bb-font-head);
  font-size: 1.45rem;
  gap: 9px;
  letter-spacing: 0.06em;
}

.bb-logo:hover {
  text-decoration: none;
}

.bb-logo__chip {
  align-items: center;
  background: linear-gradient(180deg, var(--bb-gold), var(--bb-gold-dark));
  border-radius: 50%;
  color: #201603;
  display: flex;
  font-size: 1.05rem;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.bb-nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.bb-nav__link {
  color: var(--bb-cream-dim);
  font-size: 0.96rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bb-nav__link:hover,
.bb-nav__link.is-active {
  color: var(--bb-gold);
  text-decoration: none;
}

.bb-header__side {
  align-items: center;
  display: flex;
  gap: 12px;
}

.bb-coins {
  align-items: center;
  background: rgba(224, 181, 82, 0.12);
  border: 1px solid var(--bb-line);
  border-radius: 999px;
  color: var(--bb-gold);
  display: inline-flex;
  font-family: var(--bb-font-head);
  font-size: 1rem;
  gap: 6px;
  letter-spacing: 0.06em;
  padding: 6px 14px;
}

.bb-burger {
  background: transparent;
  border: 1px solid var(--bb-line);
  border-radius: 10px;
  color: var(--bb-cream);
  cursor: pointer;
  display: none;
  font-size: 1.2rem;
  padding: 6px 11px;
}

/* Age strip ------------------------------------------------------- */

.bb-strip {
  background: var(--bb-felt);
  border-bottom: 1px solid var(--bb-line);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  padding: 9px 0;
  text-align: center;
  text-transform: uppercase;
}

.bb-strip__badge {
  background: var(--bb-red);
  border-radius: 5px;
  color: #fff;
  font-weight: 700;
  margin-right: 8px;
  padding: 2px 7px;
}

/* Hero ------------------------------------------------------------ */

.bb-hero {
  position: relative;
  overflow: hidden;
}

.bb-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.bb-hero__media img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.bb-hero__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(11, 20, 16, 0.96) 12%, rgba(11, 20, 16, 0.55) 100%);
}

.bb-hero__body {
  padding: 96px 0 84px;
  position: relative;
  z-index: 1;
  max-width: 660px;
}

.bb-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

.bb-hero__note {
  color: var(--bb-cream-dim);
  font-size: 0.9rem;
  margin-top: 20px;
}

/* Cards ----------------------------------------------------------- */

.bb-card {
  background: var(--bb-ink-2);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.bb-card:hover {
  border-color: rgba(224, 181, 82, 0.4);
  transform: translateY(-3px);
}

.bb-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.bb-card__media img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.bb-card__body {
  padding: 20px 20px 24px;
}

.bb-card__title {
  margin-bottom: 6px;
}

.bb-card__text {
  color: var(--bb-cream-dim);
  font-size: 0.97rem;
}

.bb-card__tag {
  color: var(--bb-gold);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.bb-panel {
  background: var(--bb-ink-2);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-radius);
  padding: 26px;
}

.bb-panel__num {
  color: var(--bb-gold);
  font-family: var(--bb-font-head);
  font-size: 2.2rem;
}

/* Prose pages ----------------------------------------------------- */

.bb-prose {
  max-width: 78ch;
}

.bb-prose h2 {
  margin-top: 2em;
}

.bb-prose ul {
  color: var(--bb-cream-dim);
  padding-left: 20px;
}

.bb-prose li {
  margin-bottom: 8px;
}

.bb-prose--legal p,
.bb-prose--legal li {
  color: var(--bb-cream-dim);
  font-size: 1rem;
}

/* Modals ---------------------------------------------------------- */

.bb-modal {
  align-items: center;
  background: rgba(4, 9, 7, 0.86);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 90;
}

.bb-modal.is-open {
  display: flex;
}

.bb-modal__box {
  background: var(--bb-ink-2);
  border: 1px solid var(--bb-line);
  border-radius: 18px;
  box-shadow: var(--bb-shadow);
  max-height: 92vh;
  max-width: 460px;
  overflow-y: auto;
  padding: 30px;
  width: 100%;
}

.bb-modal__title {
  margin-bottom: 10px;
}

.bb-modal__text {
  color: var(--bb-cream-dim);
  font-size: 0.97rem;
}

.bb-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.bb-modal__foot {
  border-top: 1px solid var(--bb-line);
  color: var(--bb-cream-dim);
  font-size: 0.86rem;
  margin-top: 20px;
  padding-top: 14px;
}

.bb-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.bb-tabs__btn {
  background: transparent;
  border: 1px solid var(--bb-line);
  border-radius: 999px;
  color: var(--bb-cream-dim);
  cursor: pointer;
  font-family: var(--bb-font-head);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  padding: 7px 16px;
  text-transform: uppercase;
}

.bb-tabs__btn.is-active {
  background: rgba(224, 181, 82, 0.16);
  color: var(--bb-gold);
}

/* Forms ----------------------------------------------------------- */

.bb-field {
  margin-bottom: 14px;
}

.bb-field__label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.bb-field__input {
  background: #0a1712;
  border: 1px solid var(--bb-line);
  border-radius: 10px;
  color: var(--bb-cream);
  font-family: inherit;
  font-size: 1rem;
  padding: 11px 13px;
  width: 100%;
}

.bb-field__input:focus {
  border-color: var(--bb-gold);
  outline: none;
}

.bb-check {
  align-items: flex-start;
  color: var(--bb-cream-dim);
  display: flex;
  font-size: 0.88rem;
  gap: 9px;
  margin-bottom: 12px;
}

.bb-check input {
  margin-top: 4px;
}

.bb-note {
  border-radius: 10px;
  display: none;
  font-size: 0.9rem;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.bb-note.is-open {
  display: block;
}

.bb-note--bad {
  background: rgba(200, 69, 47, 0.15);
  color: #f0a99b;
}

.bb-note--good {
  background: rgba(224, 181, 82, 0.14);
  color: var(--bb-gold);
}

/* Game shell ------------------------------------------------------ */

.bb-table {
  background:
    radial-gradient(circle at 50% 0%, var(--bb-felt-soft), var(--bb-felt) 70%);
  border: 1px solid var(--bb-line);
  border-radius: 20px;
  padding: 28px;
  position: relative;
}

.bb-table__row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.bb-table__label {
  color: var(--bb-cream-dim);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.bb-table__value {
  font-family: var(--bb-font-head);
  font-size: 1.7rem;
}

.bb-table__msg {
  font-family: var(--bb-font-head);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  min-height: 1.5em;
}

.bb-table__msg--win {
  color: var(--bb-gold);
}

.bb-table__msg--lose {
  color: #f0a99b;
}

.bb-lock {
  align-items: center;
  backdrop-filter: blur(6px);
  background: rgba(6, 13, 10, 0.88);
  border-radius: 20px;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: absolute;
  text-align: center;
  z-index: 5;
}

.bb-lock.is-hidden {
  display: none;
}

.bb-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 118px;
}

.bb-pcard {
  align-items: center;
  background: #f7f3e8;
  border-radius: 9px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
  color: #14100a;
  display: flex;
  flex-direction: column;
  font-family: var(--bb-font-head);
  height: 112px;
  justify-content: center;
  line-height: 1;
  width: 78px;
}

.bb-pcard--red {
  color: var(--bb-red);
}

.bb-pcard--down {
  background: repeating-linear-gradient(45deg, #1d3f30, #1d3f30 6px, #14312a 6px, #14312a 12px);
  color: transparent;
}

.bb-pcard--held {
  outline: 3px solid var(--bb-gold);
}

.bb-pcard__rank {
  font-size: 1.9rem;
}

.bb-pcard__suit {
  font-size: 1.5rem;
}

.bb-pcard__hold {
  color: var(--bb-gold);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  margin-top: 4px;
  min-height: 1em;
}

.bb-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.bb-stake {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bb-stake__btn {
  background: rgba(224, 181, 82, 0.1);
  border: 1px solid var(--bb-line);
  border-radius: 999px;
  color: var(--bb-cream);
  cursor: pointer;
  font-family: var(--bb-font-head);
  letter-spacing: 0.06em;
  padding: 7px 15px;
}

.bb-stake__btn.is-active {
  background: var(--bb-gold);
  color: #201603;
}

/* Reels ----------------------------------------------------------- */

.bb-reels {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 auto;
  max-width: 460px;
}

.bb-reels__cell {
  align-items: center;
  background: #0a1712;
  border: 1px solid var(--bb-line);
  border-radius: 12px;
  display: flex;
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  height: 120px;
  justify-content: center;
}

.bb-reels__cell.is-spinning {
  animation: bb-flicker 0.12s linear infinite;
}

@keyframes bb-flicker {
  50% {
    opacity: 0.45;
  }
}

/* Roulette -------------------------------------------------------- */

.bb-wheel {
  align-items: center;
  background: radial-gradient(circle, #1e4634, #0d2419);
  border: 3px solid var(--bb-gold-dark);
  border-radius: 50%;
  display: flex;
  font-family: var(--bb-font-head);
  font-size: 3.2rem;
  height: 170px;
  justify-content: center;
  margin: 0 auto 20px;
  width: 170px;
}

.bb-wheel.is-red {
  background: radial-gradient(circle, #8d2f21, #4a170f);
}

.bb-wheel.is-black {
  background: radial-gradient(circle, #222, #0b0b0b);
}

.bb-bets {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.bb-bets__btn {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--bb-line);
  border-radius: 10px;
  color: var(--bb-cream);
  cursor: pointer;
  font-family: var(--bb-font-head);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  padding: 12px;
}

.bb-bets__btn.is-active {
  border-color: var(--bb-gold);
  box-shadow: inset 0 0 0 1px var(--bb-gold);
  color: var(--bb-gold);
}

/* Paytable -------------------------------------------------------- */

.bb-paytable {
  border-collapse: collapse;
  width: 100%;
}

.bb-paytable th,
.bb-paytable td {
  border-bottom: 1px solid var(--bb-line);
  padding: 9px 6px;
  text-align: left;
}

.bb-paytable th {
  color: var(--bb-gold);
  font-family: var(--bb-font-head);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
}

.bb-paytable td:last-child {
  text-align: right;
}

/* Footer ---------------------------------------------------------- */

.bb-footer {
  background: #070d0a;
  border-top: 1px solid var(--bb-line);
  padding: 54px 0 30px;
}

.bb-footer__grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.bb-footer__head {
  color: var(--bb-cream);
  font-family: var(--bb-font-head);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.bb-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bb-footer__list li {
  margin-bottom: 8px;
}

.bb-footer__list a {
  color: var(--bb-cream-dim);
  font-size: 0.95rem;
}

.bb-footer__legal {
  border-top: 1px solid var(--bb-line);
  color: var(--bb-cream-dim);
  font-size: 0.86rem;
  margin-top: 34px;
  padding-top: 20px;
}

.bb-footer__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.bb-badge {
  border: 1px solid var(--bb-line);
  border-radius: 8px;
  color: var(--bb-cream-dim);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  text-transform: uppercase;
}

/* Utilities ------------------------------------------------------- */

.u-hidden {
  display: none !important;
}

.u-center {
  text-align: center;
}

.u-mt-l {
  margin-top: 34px;
}

.u-mb-l {
  margin-bottom: 34px;
}

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

@media (max-width: 880px) {
  .bb-burger {
    display: block;
  }

  .bb-nav {
    background: var(--bb-ink-2);
    border-bottom: 1px solid var(--bb-line);
    display: none;
    flex-direction: column;
    gap: 0;
    left: 0;
    padding: 12px 22px 18px;
    position: absolute;
    top: 100%;
    width: 100%;
  }

  .bb-nav.is-open {
    display: flex;
  }

  .bb-nav__link {
    border-bottom: 1px solid var(--bb-line);
    padding: 11px 0;
  }

  .bb-hero__body {
    padding: 62px 0 54px;
  }

  .bb-table {
    padding: 18px;
  }
}
