/* bj.css: blackjack table. Deep blue felt, cream cards, gold accents. */
:root {
  --felt: #0b2f4a;
  --felt-2: #0f4266;
  --felt-3: #155a87;
  --line: rgba(220, 235, 255, .22);
  --cream: #fbf7ee;
  --ink: #1d1a17;
  --red: #c0272d;
  --gold: #f2c14e;
  --good: #7be0a0;
  --bad: #ffb3b0;
  --head: 'Fredoka', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --shadow: 0 6px 18px rgba(0, 0, 0, .35);
  --card-w: clamp(62px, 7.5vw, 110px);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; font-family: var(--body); color: var(--cream);
  background:
    radial-gradient(1400px 700px at 40% -10%, var(--felt-3), transparent 70%),
    radial-gradient(900px 600px at 100% 100%, var(--felt-2), transparent 70%),
    var(--felt);
}
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- top bar ---------- */
.b-top { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding: 14px clamp(16px, 3vw, 40px); border-bottom: 1px solid var(--line); }
.b-top h1 { margin: 0 auto 0 0; font-family: var(--head); font-size: clamp(1.4rem, 2.4vw, 2rem); color: var(--gold); }
.b-top h1 span { font-size: .55em; color: var(--cream); font-weight: 500; opacity: .85; }
.b-bank { display: flex; align-items: baseline; gap: 10px; }
.b-bank-label { font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; opacity: .8; }
.b-bank strong { font-family: var(--head); font-size: 1.8rem; color: var(--gold); }

/* ---------- layout ---------- */
.b-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: clamp(16px, 2vw, 32px); padding: clamp(16px, 2vw, 32px) clamp(16px, 3vw, 40px); }
.b-table {
  padding: clamp(16px, 2.5vw, 36px); border-radius: 36px 36px 220px 220px / 36px 36px 120px 120px;
  background: radial-gradient(ellipse at 50% 15%, var(--felt-3), var(--felt-2) 55%, var(--felt) 100%);
  border: 10px solid #3a2414; box-shadow: inset 0 0 60px rgba(0,0,0,.45), var(--shadow);
  text-align: center;
}
.b-zone-title { margin: 0 0 10px; font-family: var(--head); font-weight: 500; font-size: 1rem; letter-spacing: 1px; text-transform: uppercase; }
.b-total { margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: rgba(0,0,0,.3); text-transform: none; letter-spacing: 0; font-weight: 600; }
.b-total:empty { display: none; }
/* Cards overlap like a fanned hand. When a row runs out of room it wraps to a
   second row: each card pulls the next one over by --lap, and the matching
   right padding keeps every row centered. */
.b-cards {
  --lap: calc(var(--card-w) * .42);
  display: flex; flex-wrap: wrap; justify-content: center; row-gap: 12px;
  min-height: calc(var(--card-w) * 1.4); padding-right: var(--lap);
}
.b-cards .b-card { margin-right: calc(var(--lap) * -1); }
.b-hand { max-width: 100%; }
.b-felt-rules { margin: 20px auto 0; max-width: 640px; padding: 6px 14px; border-top: 2px solid rgba(242,193,78,.5); border-bottom: 2px solid rgba(242,193,78,.5); color: var(--gold); font-family: var(--head); letter-spacing: 1px; text-transform: uppercase; font-size: clamp(.7rem, 1.1vw, .9rem); }

/* ---------- cards ---------- */
.b-card { position: relative; flex: none; width: var(--card-w); aspect-ratio: 5 / 7; border-radius: 10px; background: var(--cream); color: var(--ink); box-shadow: var(--shadow); font-family: var(--head); text-align: left; }
.b-card.is-red { color: var(--red); }
.b-card.is-slot { background: transparent; border: 2px dashed var(--line); box-shadow: none; }
.b-card.is-back {
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 6px, transparent 6px 12px), linear-gradient(135deg, #8a1c2b, #5c0f1c);
  border: 5px solid var(--cream);
}
.b-corner { position: absolute; top: 6px; left: 8px; font-size: calc(var(--card-w) * .2); font-weight: 700; line-height: .95; text-align: center; }
.b-corner-b { top: auto; left: auto; bottom: 6px; right: 8px; transform: rotate(180deg); }
.b-pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--card-w) * .5); }
.b-card.is-new { animation: b-deal .38s ease-out both; }
@keyframes b-deal { from { opacity: 0; transform: translate(40px, -70px) rotate(10deg); } to { opacity: 1; transform: none; } }
.b-card.is-flip { animation: b-flip .45s ease-out both; }
@keyframes b-flip { from { transform: rotateY(90deg); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .b-card.is-new, .b-card.is-flip { animation: none; } }

/* ---------- result ---------- */
.b-result { min-height: 1.6em; margin: 18px 0; font-family: var(--head); font-size: clamp(1.05rem, 2vw, 1.45rem); }
.b-result.is-good { color: var(--good); }
.b-result.is-bad { color: var(--bad); }
.b-result.is-warn { color: var(--gold); }

/* ---------- your hands ---------- */
.b-hands { display: flex; justify-content: center; gap: clamp(14px, 3vw, 44px); flex-wrap: wrap; min-height: calc(var(--card-w) * 1.4 + 60px); }
.b-hand { padding: 10px 12px 8px; border-radius: 18px; border: 3px solid transparent; }
.b-hand.is-active { border-color: var(--gold); background: rgba(242,193,78,.1); }
.b-hand-info { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.b-hand-info strong { font-family: var(--head); font-size: 1.15rem; }
.b-tag { padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: .85rem; background: rgba(0,0,0,.3); }
.b-tag.is-win, .b-tag.is-bj { background: var(--good); color: var(--ink); }
.b-tag.is-lose, .b-tag.is-bust { background: var(--bad); color: var(--ink); }

/* ---------- bet spot ---------- */
.b-spot-row { display: flex; justify-content: center; margin-top: 14px; }
.b-spot { width: clamp(96px, 10vw, 130px); aspect-ratio: 1; border-radius: 50%; display: grid; align-content: center; justify-items: center; gap: 6px; background: rgba(0,0,0,.18); border: 3px solid rgba(220,235,255,.6); color: var(--cream); cursor: pointer; }
.b-spot:disabled { cursor: default; }
.b-spot:not(:disabled):hover { background: rgba(0,0,0,.3); }
.b-spot-name { font-family: var(--head); font-size: 1.3rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.b-spot-amt { min-height: 1.6em; font-weight: 700; }
.b-spot-amt.has-chip { padding: 2px 10px; border-radius: 999px; border: 2px dashed rgba(255,255,255,.7); }

/* ---------- controls ---------- */
.b-controls { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; min-height: 52px; }
.b-btn { padding: 12px 26px; border-radius: 999px; border: 2px solid var(--cream); background: transparent; color: var(--cream); font-family: var(--head); font-weight: 600; font-size: 1.1rem; cursor: pointer; }
.b-btn:hover:not(:disabled) { background: rgba(255,255,255,.1); }
.b-btn:disabled { opacity: .4; cursor: default; }
.b-btn-gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.b-btn-gold:hover:not(:disabled) { background: #f7cf6c; }
.b-btn-ghost { border-color: rgba(255,255,255,.4); }
.b-btn-sm { padding: 6px 16px; font-size: .95rem; }
.b-note { font-weight: 600; opacity: .9; }
.b-hint { min-height: 1.3em; margin: 12px 0 0; color: var(--gold); font-style: italic; }

/* ---------- chips ---------- */
.b-chips { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.b-chip { width: 58px; height: 58px; border-radius: 50%; cursor: pointer; font-family: var(--head); font-weight: 700; font-size: 1.05rem; border: 5px dashed rgba(255,255,255,.85); color: #fff; box-shadow: var(--shadow); transition: transform .12s ease; }
.b-chip.is-on { transform: translateY(-6px); outline: 3px solid var(--gold); outline-offset: 3px; }
.chip-1   { background: #e9e4da; color: var(--ink); }
.chip-5   { background: #c0272d; }
.chip-25  { background: #1f8a4c; }
.chip-100 { background: #1d1a17; }
.chip-500 { background: #6b3fa0; }
.b-chip.chip-1 { border-color: #8a8174; }

/* ---------- side panel ---------- */
.b-side { display: grid; gap: 16px; align-content: start; }
.b-panel { padding: 16px 20px; border-radius: 20px; background: rgba(0,0,0,.25); }
.b-panel h2 { margin: 0 0 10px; font-family: var(--head); font-size: 1.15rem; color: var(--gold); }
.b-deck { display: flex; gap: 16px; align-items: center; }
.b-deck strong { font-family: var(--head); font-size: 1.6rem; color: var(--gold); }
.b-deck-note { margin: 4px 0 0; font-size: .85rem; opacity: .8; }
.b-deck-pile {
  --h: 26px; flex: none; width: 46px; height: 64px; border-radius: 6px; border: 3px solid var(--cream);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 4px, transparent 4px 8px), linear-gradient(135deg, #8a1c2b, #5c0f1c);
  box-shadow: 0 var(--h) 0 -2px #d9d2c4, 0 0 0 0 transparent; margin-bottom: var(--h); transition: box-shadow .3s, margin .3s;
}
.b-rules { margin: 0; padding-left: 18px; line-height: 1.55; font-size: .95rem; }
.b-stats dl { margin: 0 0 12px; display: grid; gap: 6px; }
.b-stats dl div { display: flex; justify-content: space-between; }
.b-stats dd { margin: 0; font-weight: 700; }
.b-check { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; cursor: pointer; }
.b-link { background: none; border: 0; padding: 0; color: var(--bad); text-decoration: underline; cursor: pointer; font-weight: 600; }

/* ---------- dialog ---------- */
.b-dialog { max-width: 560px; width: calc(100% - 32px); border: 0; border-radius: 22px; padding: 22px 26px; background: var(--cream); color: var(--ink); }
.b-dialog::backdrop { background: rgba(0,0,0,.6); }
.b-dialog h2 { margin: 0 0 10px; font-family: var(--head); color: var(--felt-2); }
.b-dialog ol { padding-left: 20px; line-height: 1.5; }
.b-dialog .b-btn { background: var(--felt-2); border-color: var(--felt-2); color: var(--cream); }

/* ---------- smaller screens: stack ---------- */
@media (max-width: 980px) {
  .b-main { grid-template-columns: 1fr; }
  .b-side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 560px) {
  :root { --card-w: 19vw; }
  .b-table { border-width: 6px; border-radius: 24px; padding: 14px; }
  .b-chip { width: 50px; height: 50px; font-size: .95rem; }
  .b-btn { padding: 10px 18px; }
}

/* ---------- larger print (2026-11-14, by request: easier on the eyes) ---------- */
html { font-size: 118%; }
:root { --card-w: clamp(86px, 9vw, 138px); }
.b-corner { top: 5px; left: 7px; font-size: calc(var(--card-w) * .3); line-height: .9; letter-spacing: -1px; }
.b-corner-b { top: auto; left: auto; bottom: 5px; right: 7px; }
.b-pip { font-size: calc(var(--card-w) * .48); }
.b-zone-title { font-size: 1.15rem; }
.b-total { font-size: 1.15rem; }
.b-hand-info strong { font-size: 1.45rem; }
.b-tag { font-size: 1rem; padding: 3px 12px; }
.b-result { font-size: clamp(1.3rem, 2.4vw, 1.75rem); }
.b-hint { font-size: 1.15rem; }
@media (max-width: 560px) {
  :root { --card-w: 23vw; }
  html { font-size: 112%; }
}

/* ---------- command buttons: one size, raised (2026-11-14) ---------- */
.b-controls { display: grid; grid-template-columns: repeat(auto-fit, 9.5em); justify-content: center; gap: 16px; }
.b-controls .b-note { grid-column: 1 / -1; text-align: center; }
.b-btn {
  position: relative; padding: 14px 12px; border: 0; border-radius: 16px; text-align: center;
  background: linear-gradient(#fffdf6, #e4d9c2); color: var(--ink); font-size: 1.2rem; font-weight: 700;
  box-shadow: 0 6px 0 #978a6c, 0 10px 16px rgba(0,0,0,.4); transition: transform .06s ease, box-shadow .06s ease;
}
.b-btn:hover:not(:disabled) { background: linear-gradient(#ffffff, #ece3cf); }
.b-btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 #978a6c, 0 3px 6px rgba(0,0,0,.4); }
.b-btn-gold { background: linear-gradient(#ffdd80, #f0b52e); color: var(--ink); box-shadow: 0 6px 0 #a3760f, 0 10px 16px rgba(0,0,0,.4); }
.b-btn-gold:hover:not(:disabled) { background: linear-gradient(#ffe599, #f4bf45); }
.b-btn-gold:active:not(:disabled) { box-shadow: 0 1px 0 #a3760f, 0 3px 6px rgba(0,0,0,.4); }
.b-btn:disabled { opacity: .4; box-shadow: 0 3px 0 #6f6650; }
.b-btn-sm { padding: 8px 16px; font-size: .95rem; box-shadow: 0 4px 0 #978a6c, 0 6px 10px rgba(0,0,0,.35); }
@media (max-width: 560px) {
  .b-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- result pop-up ---------- */
.b-pop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.55); overflow: hidden; animation: b-pop-fade .2s ease-out; }
@keyframes b-pop-fade { from { opacity: 0; } }
.b-pop-card {
  position: relative; z-index: 2; width: min(520px, 100%); padding: 26px clamp(18px, 4vw, 34px) 24px; border-radius: 28px; text-align: center;
  background: var(--cream); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: b-pop-in .4s cubic-bezier(.2,1.4,.4,1);
}
@keyframes b-pop-in { from { transform: scale(.6); opacity: 0; } }
.b-pop-big { font-size: clamp(4rem, 14vw, 6rem); line-height: 1; }
.b-pop-card h2 { margin: 8px 0 6px; font-family: var(--head); font-size: clamp(2rem, 6vw, 2.6rem); color: var(--felt-2); }
.b-pop-card.is-party h2 { color: #1f7a45; }
.b-pop-card.is-sad h2 { color: #a3242c; }
.b-pop-money { margin: 0; font-family: var(--head); font-size: 1.6rem; font-weight: 700; }
.b-pop-dealer { margin: 6px 0 14px; font-size: 1.15rem; color: #444; }
.b-pop-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; font-size: 1.1rem; font-weight: 600; }
.b-pop-list li { padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.06); }
.b-pop-list li.is-party { background: rgba(31,138,76,.15); }
.b-pop-list li.is-sad { background: rgba(192,39,45,.12); }
.b-pop-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 8px; }
.b-confetti { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.b-confetti span { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; opacity: .9; animation: b-confetti-fall linear forwards; }
@keyframes b-confetti-fall { to { transform: translateY(110vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { .b-pop, .b-pop-card { animation: none; } .b-confetti { display: none; } }

/* ---------- normal-size cards, big values (2026-11-14, second pass) ----------
   The bigger cards made the page scroll, so the cards are back to their first
   size and only the printing grew: a large rank, a smaller suit under it, and
   a smaller center pip to leave the corner room. */
:root { --card-w: clamp(64px, 7.5vw, 112px); }
.b-corner { display: flex; flex-direction: column; align-items: center; top: 3px; left: 5px; line-height: .85; }
.b-corner-b { top: auto; left: auto; bottom: 3px; right: 5px; }
.b-corner-r { font-size: calc(var(--card-w) * .4); font-weight: 700; letter-spacing: -2px; }
.b-corner-s { font-size: calc(var(--card-w) * .24); }
.b-pip { font-size: calc(var(--card-w) * .36); }   /* centered on the card */
@media (max-width: 560px) {
  :root { --card-w: 19vw; }
}
