/* BLACKJACK */
.bj-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.bj-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; cursor: pointer; transition: transform .15s, border-color .15s; }
.bj-card:hover { transform: translateY(-3px); border-color: #3a4558; }
.bj-card h2 { margin: 0 0 2px; font-size: 20px; }
.bj-card .lim { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--amber); }
.mini-felt { margin: 14px 0 12px; height: 90px; border-radius: 0 0 140px 140px / 0 0 90px 90px; background: radial-gradient(ellipse at 50% 0, #1c7a49, #0d4428 75%);
  border: 3px solid #6b4a22; border-top: 0; position: relative; }
.mini-seat { position: absolute; width: 34px; height: 34px; border-radius: 50%; transform: translate(-50%, -50%); display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: #fff; }
.mini-seat.free { border: 2px dashed rgba(255,255,255,.35); color: rgba(255,255,255,.5); }
.mini-seat.taken { background: #2a3142; border: 2px solid #8b95a8; }
.mini-seat.bot { border-color: #556; }
.bj-card .names { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.bj-card .free-count { color: var(--green); font-weight: 600; }
.bj-card .full { color: var(--red); font-weight: 600; }

.bj-main { display: block; max-width: 1200px; }
.bj-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.bj-tname { font-size: 20px; font-weight: 700; }
.bj-timer { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 18px; color: var(--amber); }

.felt-wrap { overflow-x: auto; padding-bottom: 6px; }
.felt { position: relative; min-width: 820px; height: 600px; margin-top: 150px;
  border-radius: 0 0 50% 50% / 0 0 72% 72%;
  background: radial-gradient(ellipse at 50% 10%, #208a52 0, #12613a 45%, #0a3d24 100%);
  border: 14px solid #5a3b1a; border-top: 10px solid #5a3b1a;
  box-shadow: inset 0 0 80px rgba(0,0,0,.55), 0 20px 50px rgba(0,0,0,.5), 0 0 0 3px #c9a24a; }
.felt-text { position: absolute; left: 50%; top: 300px; transform: translateX(-50%); white-space: nowrap; letter-spacing: .22em;
  color: rgba(233, 208, 140, .55); font-size: 12px; font-weight: 700; }

/* Dealerin */
.dealer { position: absolute; left: 50%; top: -150px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; width: 520px; }
.robot { position: relative; width: 196px; height: 225px; filter: drop-shadow(0 10px 18px rgba(0,0,0,.55)); animation: hover 4s ease-in-out infinite; }
.robot svg { width: 100%; height: 100%; }
.robot .eyes { animation: blink 5s infinite; transform-origin: 100px 90px; }
.robot .core { animation: corePulse 1.8s ease-in-out infinite alternate; }
.robot.talk .eyes path { filter: brightness(1.3); }
.robot-name { position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); font: 700 10px 'JetBrains Mono', monospace; letter-spacing: .2em; color: #5ff3ff;
  background: rgba(5, 20, 28, .85); border: 1px solid #1f6f80; padding: 1px 7px; border-radius: 6px; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes hover { 50% { transform: translateY(-4px); } }
@keyframes corePulse { to { opacity: .45; } }
.say { margin-top: 8px; background: rgba(5, 20, 28, .82); border: 1px solid #1f6f80; color: #cfffff; padding: 6px 14px; border-radius: 14px; font-size: 13px; min-height: 30px; max-width: 420px; text-align: center; }
.dealer-cards { margin-top: 10px; min-height: 76px; }

/* Karten */
.cards { display: flex; justify-content: center; position: relative; }
.card { width: 50px; height: 72px; border-radius: 6px; background: linear-gradient(160deg, #fff, #eef0f3); color: #15171c; box-shadow: 0 3px 8px rgba(0,0,0,.45);
  position: relative; margin-left: -26px; font-weight: 800; flex: none; }
.card:first-child { margin-left: 0; }
.card .r { position: absolute; left: 5px; top: 3px; font-size: 15px; line-height: 1; }
.card .s1 { position: absolute; left: 5px; top: 19px; font-size: 12px; }
.card .s2 { position: absolute; right: 5px; bottom: 4px; font-size: 24px; line-height: 1; }
.card.red { color: #c0283a; }
.card.back { background: repeating-linear-gradient(45deg, #2a3a8c 0 5px, #22307a 5px 10px); border: 3px solid #fff; }
.card.back::after { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(255,255,255,.35); border-radius: 3px; }
.card.new { animation: dealIn .35s ease-out both; }
@keyframes dealIn { from { transform: translate(0, -160px) rotate(-12deg) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.total { display: inline-block; margin-top: 4px; font: 700 12px 'JetBrains Mono', monospace; background: rgba(0,0,0,.6); color: #fff; padding: 2px 8px; border-radius: 10px; }
.total.bust { background: var(--red); } .total.bjk { background: #c9a24a; color: #231400; }

/* Plätze */
.seat { position: absolute; width: 150px; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; text-align: center; }
.seat .spot { width: 74px; height: 74px; border-radius: 50%; border: 2px solid rgba(233, 208, 140, .5); display: grid; place-items: center; }
.seat.free .spot { border-style: dashed; cursor: pointer; color: rgba(233, 208, 140, .8); font-size: 12px; font-weight: 600; transition: background .15s; }
.seat.free .spot:hover { background: rgba(233, 208, 140, .12); }
.seat.free.locked .spot { cursor: default; }
.seat .pname { margin-top: 6px; font-weight: 700; font-size: 13px; background: rgba(0,0,0,.55); padding: 3px 10px; border-radius: 10px; color: #fff; white-space: nowrap; }
.seat.mine .pname { background: var(--amber); color: #231400; }
.seat.turn .pname { box-shadow: 0 0 0 2px #5ff3ff, 0 0 16px #5ff3ff; }
.seat .hands { display: flex; gap: 10px; justify-content: center; min-height: 92px; align-items: flex-end; }
.seat .hand { display: flex; flex-direction: column; align-items: center; }
.seat .hand.active .cards { filter: drop-shadow(0 0 8px #5ff3ff); }
.stack { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 800 10.5px 'JetBrains Mono', monospace; color: #fff;
  background: radial-gradient(circle, #d4a017 0 45%, #9c7410 46%); border: 3px dashed rgba(255,255,255,.7); box-shadow: 0 3px 6px rgba(0,0,0,.5); }
.stack.empty { background: none; border: 2px dashed rgba(233, 208, 140, .35); box-shadow: none; color: rgba(233,208,140,.5); font-family: Inter, sans-serif; font-weight: 600; font-size: 10px; }
.res { margin-top: 3px; font-size: 11.5px; font-weight: 800; padding: 1px 8px; border-radius: 8px; }
.res.win, .res.blackjack { background: var(--green); color: #04130b; }
.res.lose, .res.bust { background: var(--red); color: #fff; }
.res.push { background: #8590a3; color: #0b0d12; }
.tbar { width: 90px; height: 4px; border-radius: 2px; background: rgba(0,0,0,.4); margin-top: 4px; overflow: hidden; }
.tbar i { display: block; height: 100%; background: #5ff3ff; }

/* Steuerung */
.bj-controls { margin-top: 14px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-height: 78px; }
.ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctl-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.ctl-right .err { margin: 0; }
.bj-chips { display: flex; gap: 6px; }
.bj-chips .chip { width: 44px; height: 44px; font-size: 11px; }
.bj-betrow { display: flex; align-items: center; gap: 10px; }
.bj-betrow b { font-family: 'JetBrains Mono', monospace; }
.act { border: 0; border-radius: 10px; padding: 12px 20px; font-weight: 800; cursor: pointer; font-size: 15px; color: #04130b; }
.act small { font-weight: 500; opacity: .7; }
.act.hit { background: linear-gradient(180deg, #47f0a0, var(--green-d)); }
.act.stand { background: linear-gradient(180deg, #ff7a86, #d63345); color: #fff; }
.act.double { background: linear-gradient(180deg, #ffd27a, #f09a1a); color: #231400; }
.act.split { background: linear-gradient(180deg, #8fc3ff, #3d7be0); color: #fff; }
.act:disabled { opacity: .3; cursor: not-allowed; }

@media (max-width: 900px) {
  .bj-controls { flex-direction: column; align-items: stretch; }
  .ctl-right { margin-left: 0; }
}

/* Chat */
.bj-chat { margin-top: 14px; }
.bj-chat h3 { margin: 0 0 8px; font-size: 13px; }
.chat-log { height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 4px 2px; font-size: 13.5px; }
.chat-log .cm { line-height: 1.35; overflow-wrap: anywhere; }
.chat-log .cm b { margin-right: 6px; }
.chat-log .cm .ts { color: #4d5668; font-size: 11px; margin-right: 6px; font-family: 'JetBrains Mono', monospace; }
.chat-log .cm.self b { color: var(--amber) !important; }
.chat-log .empty { color: var(--muted); }
.chat-form { display: flex; gap: 8px; margin-top: 8px; }

/* Chat links fixiert neben dem Tisch */
#tableView.bj-main { max-width: 1560px; display: grid; grid-template-columns: 320px minmax(0, 1fr); column-gap: 18px; align-items: start; }
#tableView .bj-top { grid-column: 2; grid-row: 1; }
#tableView .felt-wrap { grid-column: 2; grid-row: 2; }
#tableView .bj-controls { grid-column: 2; grid-row: 3; }
#tableView .bj-chat { grid-column: 1; grid-row: 1 / span 3; margin-top: 0; position: sticky; top: 14px;
  height: calc(100vh - 100px); min-height: 420px; display: flex; flex-direction: column; }
#tableView .chat-log { flex: 1; height: auto; min-height: 0; }
@media (max-width: 1100px) {
  #tableView.bj-main { grid-template-columns: 1fr; }
  #tableView .bj-top, #tableView .felt-wrap, #tableView .bj-controls { grid-column: 1; grid-row: auto; }
  #tableView .bj-chat { grid-column: 1; grid-row: auto; position: static; height: 320px; min-height: 0; margin-top: 14px; }
}
