/* ============================================================
   BELOTE — Rich Classic Card Game UI
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Exo+2:wght@400;600;700;800&family=Cinzel:wght@700&display=swap');

/* ---- Variables ---- */
:root {
  --felt:       #1a5c2e;
  --felt-dark:  #143f20;
  --felt-light: #216b36;
  --gold:       #c8a550;
  --gold-light: #f0d080;
  --gold-dark:  #8a6820;
  --card-w:     72px;
  --card-h:     105px;
  --card-r:     8px;
  --red:        #c0182a;
  --red-dark:   #8a0e1a;
  --black:      #1a1a22;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Exo 2', sans-serif;
  background: var(--felt-dark);
}

/* ============================================================
   INTRO SCREEN
   ============================================================ */
#bIntro {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
}

.b-intro-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(200,165,80,.12) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(0,0,0,.4) 0%, transparent 50%),
    linear-gradient(160deg, #0e2a15 0%, #1a4a24 40%, #0c1e10 100%);
}

/* Decorative pattern on intro */
.b-intro-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(200,165,80,.04) 0, rgba(200,165,80,.04) 1px, transparent 0, transparent 50%);
  background-size: 32px 32px;
}

/* Corner card decorations */
.b-intro-bg::after {
  content: '♠ ♥ ♦ ♣';
  position: absolute;
  bottom: 24px; right: 28px;
  font-size: 1.4rem;
  color: rgba(200,165,80,.18);
  letter-spacing: .3em;
}

.b-intro-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 20px;
  padding: 40px 32px;
}

.b-intro-suits {
  display: flex; gap: 16px;
  margin-bottom: -4px;
}

.b-suit-deco {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 12px currentColor);
  animation: suitFloat 3s ease-in-out infinite;
}
.b-suit-deco:nth-child(2) { animation-delay: .4s; }
.b-suit-deco:nth-child(3) { animation-delay: .8s; }
.b-suit-deco:nth-child(4) { animation-delay: 1.2s; }

@keyframes suitFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.b-suit-red   { color: var(--red); }
.b-suit-black { color: #e8e4d0; }

.b-intro-title {
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  font-weight: 900;
  color: var(--gold-light);
  text-shadow:
    0 0 20px rgba(200,165,80,.6),
    0 0 50px rgba(200,165,80,.25),
    0 2px 6px rgba(0,0,0,.7);
  letter-spacing: .18em;
}

.b-intro-subtitle {
  font-family: 'Cinzel', serif;
  font-size: .95rem;
  color: rgba(200,165,80,.65);
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-top: -14px;
}

.b-intro-rules {
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(200,165,80,.2);
  border-radius: 12px;
  padding: 16px 24px;
  margin: 4px 0;
}

.b-rule-item {
  font-size: .88rem;
  color: rgba(220,200,160,.8);
  display: flex; align-items: center; gap: 10px;
}

.b-rule-icon { font-size: 1rem; }

/* ============================================================
   BUTTONS
   ============================================================ */
.b-btn {
  padding: 12px 32px;
  border: none;
  border-radius: 10px;
  font-family: 'Exo 2', sans-serif;
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: transform .08s, box-shadow .1s, filter .1s;
  min-width: 160px;
}

.b-btn:active { transform: translateY(3px); }

.b-btn-primary {
  background: linear-gradient(180deg, #e8c060 0%, #b88820 55%, #8c6010 100%);
  color: #2a1800;
  box-shadow: 0 5px 0 #5a3800, 0 8px 22px rgba(180,130,0,.4), inset 0 1px 0 rgba(255,255,255,.3);
  text-shadow: 0 1px 0 rgba(255,220,100,.3);
}
.b-btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 5px 0 #5a3800, 0 10px 28px rgba(200,150,0,.5), inset 0 1px 0 rgba(255,255,255,.3);
}
.b-btn-primary:active { box-shadow: 0 1px 0 #5a3800; }

.b-btn-secondary {
  background: transparent;
  color: rgba(200,165,80,.8);
  border: 1.5px solid rgba(200,165,80,.35);
  box-shadow: none;
}
.b-btn-secondary:hover {
  background: rgba(200,165,80,.1);
  border-color: rgba(200,165,80,.6);
}

/* ============================================================
   RULES OVERLAY
   ============================================================ */
#bRulesOverlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
}

.b-rules-box {
  background: linear-gradient(160deg, #2a1e10 0%, #1e1408 100%);
  border: 1px solid rgba(200,165,80,.35);
  border-radius: 16px;
  padding: 36px 40px;
  max-width: 500px; width: 90%;
  box-shadow: 0 16px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(200,165,80,.08);
}

.b-rules-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--gold-light);
  text-align: center;
  margin: 0 0 20px;
  text-shadow: 0 0 16px rgba(200,165,80,.4);
}

.b-rules-text p {
  font-size: .88rem;
  color: rgba(220,200,160,.8);
  line-height: 1.65;
  margin: 0 0 10px;
}
.b-rules-text strong { color: var(--gold-light); }

/* ============================================================
   GAME LAYOUT
   ============================================================ */
#bGame {
  display: flex; flex-direction: column;
  width: 100vw; height: 100vh;
  overflow: hidden;
}

/* Top bar */
#bTopBar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px;
  background: linear-gradient(180deg, #1a1408 0%, #120e06 100%);
  border-bottom: 1px solid rgba(200,165,80,.25);
  flex-shrink: 0;
  position: relative;
}

#bTopBar::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,165,80,.5), transparent);
}

.b-score-block {
  display: flex; flex-direction: column; align-items: center;
  min-width: 80px;
}

.b-score-right { align-items: center; }

.b-score-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(200,165,80,.55);
}

.b-score-val {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--gold-light);
  text-shadow: 0 0 10px rgba(200,165,80,.5);
  line-height: 1.1;
}

.b-topbar-center {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}

.b-trump-display {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .04em;
  min-height: 22px;
}

.b-round-info {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(200,165,80,.5);
}

.b-menu-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(200,165,80,.1);
  border: 1px solid rgba(200,165,80,.25);
  color: rgba(200,165,80,.7);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .1s, border-color .1s;
}
.b-menu-btn:hover {
  background: rgba(200,165,80,.2);
  border-color: rgba(200,165,80,.5);
}

/* ---- Felt Table ---- */
#bTable {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 45%, var(--felt-light) 0%, var(--felt) 40%, var(--felt-dark) 100%);
  position: relative;
}

/* Felt texture */
#bTable::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='1' height='1' fill='rgba(0,0,0,0.06)'/%3E%3C/svg%3E");
  background-size: 4px 4px;
  pointer-events: none;
}

/* Golden oval rim */
#bTable::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 60px;
  border: 2px solid rgba(200,165,80,.18);
  box-shadow:
    0 0 0 1px rgba(200,165,80,.08),
    inset 0 0 40px rgba(0,0,0,.25);
  pointer-events: none;
}

/* ============================================================
   PLAYER AREAS
   ============================================================ */
.b-player-area {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
}

.b-player-top, .b-player-bottom {
  flex-direction: column; gap: 4px;
  padding: 6px 0;
}

.b-player-top    { justify-content: flex-start; }
.b-player-bottom { justify-content: flex-end; }

.b-player-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(200,165,80,.55);
  text-align: center;
  font-weight: 600;
}
.b-player-label-me { color: rgba(200,165,80,.75); }

/* Middle row */
.b-table-middle {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative; z-index: 2;
  overflow: hidden;
}

.b-player-left, .b-player-right {
  flex-direction: column; gap: 6px;
  padding: 6px;
  width: 72px;
}
.b-player-left  { align-items: flex-start; }
.b-player-right { align-items: flex-end; }

/* ============================================================
   HANDS
   ============================================================ */
.b-hand {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Bottom hand: fan layout */
.b-hand-bottom {
  flex-direction: row;
  gap: -16px;
  padding: 8px 16px;
}

.b-hand-bottom .b-card {
  margin-right: -18px;
  transition: transform .15s ease, box-shadow .15s ease, margin .15s;
}
.b-hand-bottom .b-card:last-child { margin-right: 0; }
.b-hand-bottom .b-card:hover {
  transform: translateY(-14px) scale(1.05);
  z-index: 10;
  margin-right: -14px;
}
.b-hand-bottom .b-card.b-playable {
  cursor: pointer;
}
.b-hand-bottom .b-card.b-playable:hover {
  box-shadow:
    0 12px 28px rgba(0,0,0,.5),
    0 0 0 2px rgba(200,165,80,.8),
    0 0 16px rgba(200,165,80,.4);
}
.b-hand-bottom .b-card.b-not-playable {
  filter: brightness(.65);
  cursor: not-allowed;
}

/* Top hand: fan (face down) */
.b-hand-top {
  flex-direction: row;
  gap: 0;
}
.b-hand-top .b-card {
  margin-right: -20px;
}
.b-hand-top .b-card:last-child { margin-right: 0; }

/* Side hands: vertical stack */
.b-hand-left, .b-hand-right {
  flex-direction: column;
  gap: 0;
}
.b-hand-left  .b-card { margin-bottom: -60px; }
.b-hand-right .b-card { margin-bottom: -60px; }
.b-hand-left  .b-card:last-child,
.b-hand-right .b-card:last-child { margin-bottom: 0; }

/* ============================================================
   CARDS
   ============================================================ */
.b-card {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--card-r);
  position: relative;
  flex-shrink: 0;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow:
    0 4px 10px rgba(0,0,0,.4),
    0 1px 2px rgba(0,0,0,.6);
  animation: cardDeal .25s ease both;
  user-select: none;
}

@keyframes cardDeal {
  from { opacity: 0; transform: scale(.7) translateY(-20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---- Card Back ---- */
.b-card-back {
  width: 100%; height: 100%;
  border-radius: var(--card-r);
  background:
    linear-gradient(145deg, #1c2880 0%, #141c60 50%, #0e1448 100%);
  border: 2px solid rgba(255,255,255,.12);
  overflow: hidden;
  position: relative;
}

.b-card-back::before {
  content: '';
  position: absolute; inset: 4px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,.1);
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0, rgba(255,255,255,.03) 1px, transparent 0, transparent 8px);
}

.b-card-back::after {
  content: '♠';
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  color: rgba(255,255,255,.1);
}

/* ---- Card Face ---- */
.b-card-face {
  width: 100%; height: 100%;
  border-radius: var(--card-r);
  background: linear-gradient(160deg, #fefefe 0%, #f4f0e8 100%);
  border: 1.5px solid rgba(0,0,0,.15);
  border-top: 1.5px solid rgba(255,255,255,.9);
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
}

/* Inner border line */
.b-card-face::before {
  content: '';
  position: absolute; inset: 3px;
  border-radius: 6px;
  border: .5px solid rgba(0,0,0,.06);
  pointer-events: none;
}

.b-card-corner {
  position: absolute;
  display: flex; flex-direction: column; align-items: center;
  line-height: 1;
  gap: 0;
}

.b-card-corner-tl { top: 4px; left: 5px; }
.b-card-corner-br {
  bottom: 4px; right: 5px;
  transform: rotate(180deg);
}

.b-corner-rank {
  font-family: 'Playfair Display', serif;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1;
}

.b-corner-suit {
  font-size: .72rem;
  line-height: 1;
  margin-top: -1px;
}

/* Center of card */
.b-card-center {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}

/* Face card art area */
.b-card-art {
  position: absolute;
  inset: 14px 6px;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  flex-direction: column;
  gap: 2px;
}

/* Red cards */
.b-card-red .b-corner-rank { color: var(--red); }
.b-card-red .b-corner-suit { color: var(--red); }
.b-card-red .b-card-center { color: var(--red); }
.b-card-red .b-card-art    { background: rgba(192,24,42,.04); border: .5px solid rgba(192,24,42,.1); }

/* Black cards */
.b-card-black .b-corner-rank { color: var(--black); }
.b-card-black .b-corner-suit { color: var(--black); }
.b-card-black .b-card-center { color: var(--black); }
.b-card-black .b-card-art    { background: rgba(26,26,34,.04); border: .5px solid rgba(26,26,34,.1); }

/* Face card label inside art */
.b-face-label {
  font-family: 'Cinzel', serif;
  font-size: .65rem;
  letter-spacing: .04em;
  opacity: .55;
}
.b-card-red   .b-face-label { color: var(--red-dark); }
.b-card-black .b-face-label { color: #333; }

/* Trump indicator glow */
.b-card.b-trump-card .b-card-face {
  box-shadow: inset 0 0 0 2px rgba(200,165,80,.5);
}
.b-card.b-trump-card::after {
  content: '';
  position: absolute; inset: -2px;
  border-radius: calc(var(--card-r) + 2px);
  border: 2px solid rgba(200,165,80,.6);
  box-shadow: 0 0 8px rgba(200,165,80,.3);
  pointer-events: none;
}

/* ============================================================
   TRICK AREA
   ============================================================ */
#bTrickArea {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  position: relative; z-index: 3;
  min-width: 0;
}

.b-trick-zone {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}

.b-trick-row {
  display: flex; align-items: center; gap: 4px;
}

.b-trick-slot {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--card-r);
  border: 1px dashed rgba(200,165,80,.15);
  position: relative;
  display: flex; align-items: center; justify-content: center;
}

.b-trick-center-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(200,165,80,.18);
  margin: 0 4px;
}

/* Card played in trick */
.b-trick-slot .b-card {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  animation: trickPlay .2s ease both;
}

@keyframes trickPlay {
  from { opacity: 0; transform: scale(.85); }
  to   { opacity: 1; transform: scale(1); }
}

.b-last-trick {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(200,165,80,.45);
  min-height: 16px;
  text-align: center;
}

.b-message {
  font-size: .85rem;
  font-weight: 700;
  color: var(--gold-light);
  text-shadow: 0 0 12px rgba(200,165,80,.5);
  min-height: 20px;
  text-align: center;
  letter-spacing: .04em;
  animation: msgFade .3s ease;
}
@keyframes msgFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   BID OVERLAY
   ============================================================ */
#bBidOverlay {
  position: fixed; inset: 0 0 0 0; z-index: 200;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 52px;
  background: rgba(0,0,0,.35);
}

.b-bid-box {
  background: linear-gradient(160deg, #241a0a 0%, #1a1206 100%);
  border: 1px solid rgba(200,165,80,.3);
  border-radius: 18px;
  padding: 20px 28px 22px;
  width: 420px; max-width: 94vw;
  box-shadow: 0 20px 60px rgba(0,0,0,.8), 0 0 0 1px rgba(200,165,80,.07);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

.b-bid-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--gold-light);
  text-shadow: 0 0 14px rgba(200,165,80,.4);
  letter-spacing: .04em;
  text-align: center;
}

.b-bid-subtitle {
  font-size: .82rem;
  color: rgba(200,165,80,.55);
  text-align: center;
  letter-spacing: .05em;
  margin-top: -12px;
}

.b-bid-suits {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; width: 100%;
}

.b-bid-suit-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 10px;
  border: 1px solid rgba(200,165,80,.2);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  cursor: pointer;
  font-size: 2rem;
  font-family: inherit;
  transition: transform .1s, border-color .1s, background .1s, box-shadow .1s;
}
.b-bid-suit-btn span {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.b-bid-suit-btn:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.07);
}
.b-bid-suit-btn.b-bid-selected {
  border-color: var(--gold);
  background: rgba(200,165,80,.12);
  box-shadow: 0 0 16px rgba(200,165,80,.2);
}

.b-bid-red  { color: var(--red); }
.b-bid-red span  { color: var(--red); }
.b-bid-black { color: #1a1a22; background-color: rgba(255,255,255,.06)!important; }
.b-bid-black span { color: #e0dccc; }

.b-bid-value-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; flex-wrap: wrap;
}

.b-bid-val-label {
  font-size: .78rem;
  color: rgba(200,165,80,.55);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.b-bid-values {
  display: flex; gap: 6px; flex-wrap: wrap;
}

.b-bid-val-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(200,165,80,.2);
  background: rgba(200,165,80,.06);
  color: rgba(200,165,80,.7);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .08s, border-color .08s;
}
.b-bid-val-btn:hover,
.b-bid-val-btn.b-val-selected {
  background: rgba(200,165,80,.2);
  border-color: var(--gold);
  color: var(--gold-light);
}

.b-bid-actions {
  display: flex; gap: 12px; width: 100%; justify-content: center;
}

/* ============================================================
   ROUND RESULT OVERLAY
   ============================================================ */
#bRoundResult {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
}

.b-result-box {
  background: linear-gradient(160deg, #241a0a 0%, #1a1206 100%);
  border: 1px solid rgba(200,165,80,.3);
  border-radius: 20px;
  padding: 36px 44px;
  min-width: 320px; max-width: 94vw;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
  position: relative; overflow: hidden;
}

.b-result-box::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,165,80,.6), transparent);
}

.b-result-icon {
  font-size: 2.8rem;
  animation: resultPop .4s ease both;
}
@keyframes resultPop {
  from { transform: scale(0) rotate(-10deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}

.b-result-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 0 16px rgba(200,165,80,.5);
  text-align: center;
}

.b-result-detail {
  font-size: .88rem;
  color: rgba(200,165,80,.65);
  text-align: center;
  letter-spacing: .04em;
  max-width: 280px;
}

.b-result-scores {
  display: flex; align-items: center; gap: 20px;
}

.b-result-score-col {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}

.b-result-score-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(200,165,80,.5);
}

.b-result-score-val {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--gold-light);
  text-shadow: 0 0 10px rgba(200,165,80,.4);
}

.b-result-score-sep {
  font-size: .85rem;
  color: rgba(200,165,80,.35);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.b-result-total {
  font-size: .85rem;
  color: rgba(200,165,80,.6);
  text-align: center;
  letter-spacing: .04em;
}
.b-result-total-label { opacity: .65; }

/* ============================================================
   GAME OVER
   ============================================================ */
#bGameOver {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(200,165,80,.08) 0%, transparent 60%),
    rgba(0,0,0,.82);
  backdrop-filter: blur(10px);
}

.b-gameover-box {
  background: linear-gradient(160deg, #241a0a 0%, #1a1206 100%);
  border: 1px solid rgba(200,165,80,.4);
  border-radius: 20px;
  padding: 40px 48px;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  box-shadow: 0 20px 80px rgba(0,0,0,.8), 0 0 60px rgba(200,165,80,.08);
  min-width: 320px;
}

.b-gameover-suits {
  display: flex; gap: 12px;
}

.b-gameover-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(200,165,80,.6), 0 0 40px rgba(200,165,80,.25);
  text-align: center;
}

.b-gameover-sub {
  font-size: .9rem;
  color: rgba(200,165,80,.6);
  text-align: center;
  margin-top: -12px;
}

/* ============================================================
   ACTIVE PLAYER HIGHLIGHT
   ============================================================ */
.b-player-label.b-active-player {
  color: var(--gold-light);
  text-shadow: 0 0 8px rgba(200,165,80,.5);
  animation: labelPulse 1.2s ease-in-out infinite;
}

@keyframes labelPulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .55; }
}

/* ============================================================
   LEVEE COUNTER BADGES
   ============================================================ */
.b-trick-count {
  display: inline-flex; align-items: center;
  gap: 4px;
  background: rgba(200,165,80,.15);
  border: 1px solid rgba(200,165,80,.25);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: rgba(200,165,80,.7);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  :root {
    --card-w: 52px;
    --card-h: 76px;
    --card-r: 6px;
  }

  .b-intro-title { font-size: 2.6rem; }
  .b-intro-suits .b-suit-deco { font-size: 1.8rem; }

  .b-hand-bottom .b-card { margin-right: -22px; }
  .b-hand-top    .b-card { margin-right: -24px; }
  .b-hand-left   .b-card, .b-hand-right .b-card { margin-bottom: -48px; }

  .b-card-center { font-size: 1.5rem; }
  .b-corner-rank { font-size: .72rem; }
  .b-corner-suit { font-size: .6rem; }

  .b-bid-box { padding: 24px 20px; }
  .b-result-box { padding: 28px 24px; min-width: 280px; }
  .b-gameover-box { padding: 32px 24px; min-width: 280px; }
  .b-gameover-title { font-size: 1.7rem; }
  .b-result-title { font-size: 1.4rem; }

  #bTopBar { padding: 6px 10px; }
  .b-score-val { font-size: 1.2rem; }

  .b-player-left, .b-player-right { width: 58px; }
}
