/* ============================================================
   Blackjack (21) — mesa, cartas y portada (templates/play_blackjack.html,
   blackjack_hub.html). Sin imágenes externas: el paño es un degradado
   con grano SVG en línea (feTurbulence) y las cartas son SVG de
   static/js/blackjack-cards.js.

   Dos paños (data-felt en #bj): verde (por defecto) y burdeos. La mesa
   es un objeto oscuro en ambos temas del portal; lo demás usa los tokens
   del portal (--surface, --ink, --line…).
   ============================================================ */

.bj-shell, .bj-hub-art {
  --bj-gold: #CDA65A; --bj-gold-2: #E8CC8C; --bj-gold-deep: #9C7A36;
  --bj-cream: #F6EEDC; --bj-cream-2: rgba(246, 238, 220, .74);
  --bj-ease: cubic-bezier(.22, .9, .25, 1);
  --bj-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0.55 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --bj-felt-1: #1E6A4A; --bj-felt-2: #114532; --bj-felt-3: #0A2C20;
  --bj-rail-1: #3A2416; --bj-rail-2: #20130B;
}
.bj-shell[data-felt="burdeos"] { --bj-felt-1: #7C2232; --bj-felt-2: #4E111D; --bj-felt-3: #2E0911; }

/* ============================================================ la sala */
.bj-shell { max-width: 1240px; }
.bj-room { margin-top: 6px; }
.bj-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: clamp(14px, 2.2vw, 26px); align-items: start; }
.bj-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* ---------- la mesa: riel de cuero con filete dorado y paño ---------- */
.bj-table {
  --cw: clamp(62px, 6.6vw, 96px);
  position: relative; isolation: isolate; border-radius: 30px 30px 46% 46% / 30px 30px 120px 120px;
  padding: 12px; background: linear-gradient(180deg, var(--bj-rail-1), var(--bj-rail-2));
  box-shadow: inset 0 1px 0 rgba(255, 220, 170, .18), inset 0 -2px 0 rgba(0, 0, 0, .4),
              0 0 0 1px rgba(0, 0, 0, .35), 0 22px 44px -22px rgba(0, 0, 0, .6);
}
.bj-felt {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center;
  min-height: clamp(440px, 64vh, 600px); padding: 18px clamp(12px, 3vw, 36px) 28px;
  border-radius: 22px 22px 46% 46% / 22px 22px 110px 110px; color: var(--bj-cream);
  background: var(--bj-grain), radial-gradient(120% 90% at 50% 18%, var(--bj-felt-1) 0%, var(--bj-felt-2) 58%, var(--bj-felt-3) 100%);
  box-shadow: inset 0 0 0 1.5px var(--bj-gold-deep), inset 0 0 0 7px rgba(0, 0, 0, .14), inset 0 0 0 8px rgba(205, 166, 90, .45),
              inset 0 18px 60px -20px rgba(0, 0, 0, .5), inset 0 -40px 80px -40px rgba(0, 0, 0, .55);
  transition: background .6s ease;
}

/* zapato y descarte */
.bj-tray { position: absolute; top: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; z-index: 1; }
.bj-tray small { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--bj-cream-2); font-family: var(--font-num); }
.bj-shoe { right: clamp(10px, 2.4vw, 26px); }
.bj-discard { left: clamp(10px, 2.4vw, 26px); }
.bj-shoe-box {
  position: relative; display: block; width: calc(var(--cw) * .74); height: calc(var(--cw) * .74 * 1.08);
  border-radius: 6px 6px 10px 10px; background: linear-gradient(160deg, #3B2618, #1D110A);
  box-shadow: inset 0 0 0 1px rgba(232, 204, 140, .5), 0 6px 14px -6px rgba(0, 0, 0, .6);
}
.bj-shoe-card {
  position: absolute; left: 12%; right: 12%; top: -14%; height: 64%; border-radius: 4px;
  background: repeating-linear-gradient(45deg, rgba(232, 204, 140, .35) 0 1px, transparent 1px 5px),
              repeating-linear-gradient(-45deg, rgba(232, 204, 140, .35) 0 1px, transparent 1px 5px), #6E1B29;
  box-shadow: inset 0 0 0 1px var(--bj-gold-2), 0 2px 0 #4A101B, 0 4px 0 #3A0C15;
}
.bj-shoe-meter { display: block; position: relative; width: calc(var(--cw) * .74); height: 4px; border-radius: 4px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.bj-shoe-meter b { display: block; height: 100%; width: 100%; background: var(--bj-gold); border-radius: 4px; transition: width .4s ease; }
.bj-shoe-meter::after { content: ""; position: absolute; top: -1px; bottom: -1px; left: var(--cut, 25%); width: 2px; background: #E5534B; }
.bj-shoe.is-shuffling .bj-shoe-box { animation: bj-shuffle .9s ease; }
@keyframes bj-shuffle { 0%, 100% { transform: none; } 15% { transform: rotate(-6deg) translateY(-2px); } 35% { transform: rotate(5deg); } 55% { transform: rotate(-4deg) translateY(-1px); } 75% { transform: rotate(2deg); } }
.bj-tray-cards {
  display: block; width: calc(var(--cw) * .56); height: calc(var(--cw) * .56 * 1.4); border-radius: 5px;
  border: 1px dashed rgba(232, 204, 140, .35);
}
.bj-tray-cards.has-cards {
  border: 0; background: #6E1B29; box-shadow: inset 0 0 0 1px var(--bj-gold-2), 1px 1px 0 #4A101B, 2px 2px 0 #3A0C15, 3px 3px 0 #2A0810;
}

/* zonas */
.bj-zone { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bj-dealer { margin-top: 6px; }
.bj-zone-head { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.bj-who { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--bj-cream-2); font-weight: 600; }
.bj-total {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 26px; padding: 0 10px;
  border-radius: 999px; font-family: var(--font-num); font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--bj-cream); background: rgba(0, 0, 0, .38); box-shadow: inset 0 0 0 1px rgba(232, 204, 140, .55);
  transition: background .2s, color .2s;
}
.bj-total:empty { display: none; }
.bj-total.is-soft { color: var(--bj-gold-2); }
.bj-total.is-bust { background: #8E1F1F; box-shadow: inset 0 0 0 1px #E07A6E; color: #FFF1EC; }
.bj-total.is-natural { background: linear-gradient(180deg, var(--bj-gold-2), var(--bj-gold)); color: #2A1A08; box-shadow: none; }

.bj-cards { display: flex; justify-content: center; align-items: flex-start; min-height: calc(var(--cw) * 1.4); padding: 0 4px; }

/* lo impreso en el paño */
.bj-print { width: min(100%, 600px); margin: 8px 0 0; text-align: center; pointer-events: none; user-select: none; }
.bj-arc { display: block; width: 100%; height: auto; overflow: visible; }
.bj-arc text { fill: var(--bj-gold-2); fill-opacity: .85; font-family: var(--font-display); font-size: 15.5px; letter-spacing: .14em; text-transform: uppercase; }
.bj-rule-line { margin: -2px 0 0; font-family: var(--font-display); font-style: italic; font-size: .95rem; letter-spacing: .03em; color: var(--bj-gold-2); }
.bj-rl-a { display: none; }
.bj-print-sub { margin: 6px 0 0; font-size: .64rem; letter-spacing: .26em; text-transform: uppercase; color: var(--bj-gold); opacity: .72; }
.bj-msg {
  margin: 10px 0 12px; min-height: 2.8em; max-width: 46ch; text-align: center; font-size: var(--t-sm); line-height: 1.4;
  color: var(--bj-cream); text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
.bj-player { margin-top: auto; }
.bj-hands { display: flex; justify-content: center; align-items: flex-start; flex-wrap: wrap; gap: 14px clamp(10px, 2.4vw, 30px); width: 100%; }
.bj-hand { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 8px 10px; border-radius: 16px; transition: background .25s, box-shadow .25s, opacity .3s; }
.bj-hand.is-active { background: rgba(0, 0, 0, .14); box-shadow: inset 0 0 0 1.5px var(--bj-gold-2), 0 0 24px -6px rgba(232, 204, 140, .45); }
.bj-hand.is-loss .bj-cards { opacity: .62; transition: opacity .4s; }
.bj-tag {
  position: absolute; left: 50%; top: calc(44px + var(--cw) * 1.4); transform: translate(-50%, -50%); z-index: 3;
  padding: 6px 14px; border-radius: 999px; white-space: nowrap; font-size: .86rem; font-weight: 700; letter-spacing: .02em;
  background: rgba(20, 14, 10, .86); color: var(--bj-cream); box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(232, 204, 140, .5);
  animation: bj-pop .34s var(--bj-ease) both;
}
.bj-tag[hidden] { display: none; }
.bj-tag.is-win { background: #F6EEDC; color: #1C5A3C; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .7), inset 0 0 0 1.5px var(--bj-gold); }
.bj-tag.is-natural { background: linear-gradient(180deg, var(--bj-gold-2), var(--bj-gold)); color: #2A1A08; }
.bj-tag.is-loss { background: rgba(30, 10, 10, .88); color: #F3C9C2; }
.bj-tag.is-push { background: rgba(20, 20, 24, .86); color: #E6E1D6; }
@keyframes bj-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(.7); } }

/* ============================================================ las cartas */
.bj-card {
  position: relative; flex: none; width: var(--cw); aspect-ratio: 100 / 140; perspective: 900px;
  transition: transform .44s var(--bj-ease), opacity .3s ease; will-change: transform;
}
.bj-card + .bj-card { margin-left: calc(var(--cw) * -.6); }
.bj-card-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .46s var(--bj-ease); }
.bj-card.is-down .bj-card-in { transform: rotateY(180deg); }
.bj-face {
  position: absolute; inset: 0; border-radius: calc(var(--cw) * .08); overflow: hidden;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 6px 14px -6px rgba(0, 0, 0, .55), -2px 0 6px -3px rgba(0, 0, 0, .35);
}
.bj-backf { transform: rotateY(180deg); }
.bj-art { display: block; width: 100%; height: 100%; }
.bj-card.is-peek .bj-card-in { animation: bj-peek .7s ease; }
@keyframes bj-peek { 40%, 60% { transform: rotateY(180deg) rotateX(-18deg) translateY(-4px); } }
.bj-card.is-down.is-peek .bj-card-in { transform: rotateY(180deg); }
.bj-card.is-doubled { rotate: 90deg; margin-left: calc(var(--cw) * -.3); margin-top: calc(var(--cw) * .1); }

/* ============================================================ jugadas */
.bj-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.25fr); gap: 8px; }
.bj-act {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 6px 12px;
  border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: inherit; font-size: var(--t-sm); cursor: pointer;
  transition: background var(--dur), border-color var(--dur), transform .12s, box-shadow var(--dur), opacity var(--dur);
}
.bj-act b { font-weight: 600; }
.bj-act kbd {
  font-family: var(--font-num); font-size: .68rem; line-height: 1; padding: 3px 5px; border-radius: 5px;
  border: 1px solid var(--line-2); color: var(--muted); background: var(--surface-2);
}
.bj-act:hover:not(:disabled) { border-color: var(--ink-2); background: var(--surface-2); }
.bj-act:active:not(:disabled) { transform: translateY(1px); }
.bj-act:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bj-act:disabled { opacity: .42; cursor: default; }
.bj-deal { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.bj-deal kbd { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--on-ink) 40%, transparent); }
.bj-deal:hover:not(:disabled) { background: var(--ink-2); border-color: var(--ink-2); }
.bj-act.is-advised:not(:disabled) { border-color: var(--bj-gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bj-gold) 55%, transparent); background: color-mix(in srgb, var(--bj-gold) 14%, var(--surface)); }
.bj-act.is-advised:not(:disabled)::after {
  content: "Consejo"; position: absolute; top: -9px; right: 8px; padding: 1px 7px; border-radius: 999px;
  font-size: .62rem; font-weight: 700; letter-spacing: .04em; background: var(--bj-gold); color: #2A1A08;
}
.bj-advice { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 14px; border-radius: 12px; font-size: var(--t-sm); color: var(--ink-2); background: color-mix(in srgb, var(--bj-gold) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bj-gold) 40%, var(--line)); }
.bj-advice[hidden] { display: none; }
.bj-advice-tag { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.bj-advice-tag svg { width: 16px; height: 16px; color: var(--bj-gold-deep); }

/* ============================================================ panel lateral */
.bj-side { display: flex; flex-direction: column; gap: 12px; }
.bj-panel { padding: 16px 16px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.bj-panel .eyebrow { margin: 0 0 4px; }
.bj-big { font-family: var(--font-display); font-size: 2.6rem; line-height: 1.05; color: var(--ink); display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.bj-big i { font-style: normal; color: var(--line-2); font-size: 1.6rem; }
.bj-big .w { color: var(--success); } .bj-big .l { color: var(--danger); } .bj-big .p { color: var(--ink-2); }
.bj-big-sm { font-size: 1.5rem; }
.bj-panel-sub { margin: 4px 0 0; font-size: var(--t-xs); color: var(--muted); line-height: 1.45; }
.bj-prog { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.bj-prog-row { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--muted); }
.bj-prog-row b { font-family: var(--font-num); color: var(--ink); font-weight: 500; }
.bj-bar { display: block; height: 7px; border-radius: 7px; background: var(--surface-3); overflow: hidden; margin-bottom: 4px; }
.bj-bar b { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--bj-gold-deep), var(--bj-gold)); transition: width .4s ease; }
.bj-bar.is-hands b { background: var(--ink-2); opacity: .55; }
.bj-mini { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 0; padding: 12px 16px; border-radius: var(--r-lg); background: var(--surface-2); font-size: var(--t-sm); }
.bj-mini dt { color: var(--muted); }
.bj-mini dd { margin: 0; text-align: right; font-family: var(--font-num); color: var(--ink); }
.bj-side-note, .bj-nobet { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: var(--t-xs); color: var(--muted); line-height: 1.45; }
.bj-side-note svg, .bj-nobet svg { width: 16px; height: 16px; flex: none; color: var(--success); margin-top: 1px; }

/* sonido */
.bj-sound-pop { min-width: 220px; padding: 8px; }
.bj-vol { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 6px; font-size: var(--t-sm); color: var(--ink-2); }
.bj-vol input { width: 100%; accent-color: var(--bj-gold-deep); min-height: 28px; }
.tool-btn.is-off { color: var(--muted); }
.tool-btn.is-off svg { opacity: .5; }

/* ============================================================ resultado (racha y desafío) */
.bj-table { --tt-table: var(--bj-felt-3); }
.bj-table .tt-result { border-radius: inherit; }
.bj-medal { display: grid; place-items: center; width: 74px; height: 74px; margin: 2px auto 10px; border-radius: 50%; font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.bj-medal[hidden] { display: none; }
.bj-medal span { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; border: 1px dashed rgba(0, 0, 0, .25); }
.bj-medal.is-oro { background: radial-gradient(circle at 35% 30%, #FFF2C4, #E3B653 55%, #A57A22); color: #4A3208; box-shadow: 0 8px 20px -8px rgba(165, 122, 34, .8); }
.bj-medal.is-plata { background: radial-gradient(circle at 35% 30%, #FFFFFF, #C9CDD3 55%, #8B9099); color: #2E3238; box-shadow: 0 8px 20px -8px rgba(80, 86, 96, .7); }
.bj-medal.is-bronce { background: radial-gradient(circle at 35% 30%, #F6D3B4, #C3834F 55%, #8A5428); color: #3E2210; box-shadow: 0 8px 20px -8px rgba(138, 84, 40, .7); }

/* ============================================================ diálogos */
.bj-setup { max-width: 660px; }
.bj-setup fieldset { border: 0; margin: 14px 0 0; padding: 0; min-width: 0; }
.bj-setup legend { margin-bottom: 8px; font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bj-setup [data-when][hidden] { display: none; }
.bj-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.bj-mode-opt {
  position: relative; display: flex; flex-direction: column; gap: 3px; padding: 11px 12px 10px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left;
  transition: border-color var(--dur), background var(--dur), box-shadow var(--dur);
}
.bj-mode-opt input { position: absolute; opacity: 0; pointer-events: none; }
.bj-mode-opt strong { font-size: .95rem; color: var(--ink); }
.bj-mode-opt em { font-style: normal; font-family: var(--font-num); font-size: .72rem; color: var(--accent); }
.bj-mode-opt span { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.bj-mode-opt:hover { border-color: var(--line-2); }
.bj-mode-opt:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); background: var(--surface-2); }
.bj-mode-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.bj-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.bj-seg label { position: relative; flex: 1 1 auto; }
.bj-seg input { position: absolute; opacity: 0; pointer-events: none; }
.bj-seg span {
  display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); background: var(--surface);
  cursor: pointer; white-space: nowrap; transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.bj-seg input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.bj-seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.bj-setup-note { font-size: var(--t-xs); margin-top: 12px !important; }
.bj-chals { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; max-height: min(44vh, 360px); overflow: auto; padding: 2px; }
.bj-chal {
  position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 48px; padding: 8px 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.bj-chal input { position: absolute; opacity: 0; pointer-events: none; }
.bj-chal:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); background: var(--surface-2); }
.bj-chal:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.bj-chal-n { font-family: var(--font-num); font-size: .78rem; color: var(--muted); text-align: center; }
.bj-chal-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bj-chal-t strong { font-size: .9rem; color: var(--ink); }
.bj-chal-t small { font-size: .74rem; color: var(--muted); line-height: 1.3; }
.bj-chal-m { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.bj-chal-m:empty { display: none; }
.bj-chal-m.is-oro { background: linear-gradient(180deg, #F3D98A, #C99A3B); color: #3E2A06; }
.bj-chal-m.is-plata { background: linear-gradient(180deg, #F1F2F4, #AEB3BB); color: #2E3238; }
.bj-chal-m.is-bronce { background: linear-gradient(180deg, #EBC09B, #B2753F); color: #3A1F0B; }
.bj-h3 { margin: 18px 0 8px; font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.bj-medals { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.bj-medals li { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); font-size: .8rem; color: var(--ink); }
.bj-medals li .bj-chal-m { grid-row: span 2; display: inline-grid; background: var(--surface-3); }
.bj-medals li small { color: var(--muted); font-size: .7rem; }

/* tabla de estrategia */
.bj-strat-card { max-width: 980px; }
.bj-strat-lede { font-size: var(--t-sm); }
.bj-strat { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; margin-top: 12px; }
.bj-strat table { width: 100%; border-collapse: separate; border-spacing: 2px; font-family: var(--font-num); font-size: .74rem; }
.bj-strat caption { text-align: left; font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); padding-bottom: 4px; }
.bj-strat th { font-weight: 500; color: var(--muted); padding: 3px 2px; }
.bj-strat tbody th { text-align: right; padding-right: 6px; white-space: nowrap; color: var(--ink-2); }
.bj-strat td { text-align: center; padding: 4px 0; border-radius: 4px; font-weight: 600; }
.sH { background: color-mix(in srgb, var(--surface-3) 80%, transparent); color: var(--ink-2); }
.sS { background: color-mix(in srgb, #D9B567 55%, var(--surface)); color: #3A2A08; }
.sD, .sDs { background: color-mix(in srgb, #2F7550 60%, var(--surface)); color: #fff; }
.sDs { background: color-mix(in srgb, #2F7550 40%, var(--surface)); color: var(--ink); }
.sP { background: color-mix(in srgb, #A62520 55%, var(--surface)); color: #fff; }
.bj-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: var(--t-xs); color: var(--muted); margin: 12px 0 0 !important; }
.bj-legend span { display: inline-grid; place-items: center; min-width: 26px; height: 20px; border-radius: 4px; font-family: var(--font-num); font-weight: 600; font-size: .7rem; }

/* ============================================================ portada */
.bj-nobet { margin: -6px 0 18px; padding: 10px 14px; border-radius: 12px; background: var(--success-weak); color: var(--ink-2); font-size: var(--t-sm); max-width: 58ch; }
.bj-nobet strong { color: var(--ink); }
.bj-fair { font-size: var(--t-xs); margin-top: 16px; max-width: 60ch; }
.bj-hub-stats { margin: 0 0 8px; max-width: 520px; }
.bj-hub-stats[hidden] { display: none; }
.bj-hub-art {
  --cw: 92px; position: relative; height: 176px; margin: -4px 0 6px; border-radius: var(--r-lg); overflow: hidden;
  background: var(--bj-grain), radial-gradient(120% 100% at 50% 0%, var(--bj-felt-1), var(--bj-felt-2) 60%, var(--bj-felt-3));
  box-shadow: inset 0 0 0 1.5px var(--bj-gold-deep), inset 0 0 0 6px rgba(0, 0, 0, .12), inset 0 0 0 7px rgba(205, 166, 90, .4);
}
.bj-hub-card {
  position: absolute; left: 50%; top: 22px; width: var(--cw); aspect-ratio: 100 / 140; border-radius: 8px; overflow: hidden;
  transform: translateX(calc(-50% + (var(--i) - 1) * 46px)) rotate(var(--r)); transform-origin: 50% 120%;
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .75);
}
.bj-hub-card .bj-art { display: block; width: 100%; height: 100%; }
.bj-select { width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-sm); }
.bj-hub .tt-start fieldset[hidden] { display: none; }
.bj-hub .bj-seg4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ============================================================ adaptable */
@media (max-width: 1020px) {
  .bj-layout { grid-template-columns: minmax(0, 1fr); }
  .bj-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .bj-side-note { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .bj-table { --cw: 64px; padding: 7px; border-radius: 22px 22px 34% 34% / 22px 22px 70px 70px; }
  .bj-felt { min-height: 0; padding: 12px 8px 22px; border-radius: 17px 17px 34% 34% / 17px 17px 64px 64px; }
  .bj-arc { display: none; }
  .bj-print { margin-top: 4px; }
  .bj-print-sub { margin: 4px 0 0; font-size: .58rem; letter-spacing: .18em; }
  .bj-rule-line { margin: 0 auto; font-size: .76rem; max-width: 32ch; line-height: 1.35; }
  .bj-rl-a { display: inline; }
  .bj-dealer { margin-top: 0; padding: 0 calc(var(--cw) * .7); }
  .bj-msg { font-size: .82rem; margin: 8px 0 10px; }
  .bj-hands[data-n="3"] { --cw: 50px; gap: 10px 6px; }
  .bj-hands[data-n="2"] { --cw: 56px; }
  .bj-hand { padding: 6px 4px 8px; }
  .bj-total { height: 24px; min-width: 34px; font-size: .82rem; padding: 0 8px; }
  .bj-tag { font-size: .78rem; padding: 5px 11px; }
  .bj-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .bj-deal { grid-column: 1 / -1; min-height: 50px; }
  .bj-act { flex-direction: column; gap: 2px; min-height: 54px; padding: 6px 4px; font-size: .8rem; text-align: center; }
  .bj-act b { line-height: 1.15; }
  .bj-act kbd { display: none; }
  .bj-deal { flex-direction: row; }
  .bj-side { grid-template-columns: minmax(0, 1fr); }
  .bj-hub-art { --cw: 80px; height: 156px; }
}
@media (max-width: 380px) {
  .bj-table { --cw: 56px; }
  .bj-hands[data-n="2"] { --cw: 50px; }
  .bj-hands[data-n="3"] { --cw: 44px; gap: 8px 4px; }
  .bj-hands[data-n="3"] .bj-who { display: none; }
  .bj-hands[data-n="3"] .bj-hand { padding: 6px 2px 8px; }
  .bj-tray small { display: none; }
  .bj-act { font-size: .74rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bj-card, .bj-card-in, .bj-shoe-meter b, .bj-bar b { transition: none !important; }
  .bj-tag, .bj-shoe.is-shuffling .bj-shoe-box, .bj-card.is-peek .bj-card-in { animation: none !important; }
}
