:root {
  --bg: #1a5c2a;
  --felt: #1a5c2a;
  --accent: #f5c842;
  --card-back: #1a3a8a;
}
/* ═══════════════════════════════════════
   style.css — iKout complete stylesheet
═══════════════════════════════════════ */

/* ── Reset & base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: sans-serif;
  background: var(--bg);
  min-height: 100vh;
  color: white;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

/* ── Buttons ── */
.btn {
  width: 100%; padding: 11px; border-radius: 8px; border: none;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all .15s; margin-bottom: 6px; display: block;
}
.btn:last-child { margin-bottom: 0; }
.btn-gold   { background: #f5c842; color: #1a3a0a; }
.btn-gold:hover { background: #ffd54f; }
.btn-ghost  { background: rgba(255,255,255,0.12); color: white; border: 1px solid rgba(255,255,255,0.2); }
.btn-ghost:hover { background: rgba(255,255,255,0.22); }
.btn-google {
  background: white; color: #333;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 500; font-size: 14px; padding: 11px;
  border-radius: 8px; border: none; cursor: pointer; width: 100%;
  margin-bottom: 6px; transition: all .15s;
}
.btn-google:hover { background: #f5f5f5; }
.btn-guest  { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.85); border: 1px dashed rgba(255,255,255,0.28); }
.btn-guest:hover { background: rgba(255,255,255,0.16); }
.btn-signout { background: rgba(255,80,80,0.12); color: #ff7070; border: 1px solid rgba(255,80,80,0.35); border-radius: 8px; cursor: pointer; padding: 10px; font-size: 13px; font-weight: 600; flex: 1; transition: all .15s; }
.btn-signout:hover { background: rgba(255,80,80,0.25); }
.btn-whatsapp { background: rgba(37,211,102,0.15); color: #25d366; border: 1px solid rgba(37,211,102,0.4); }
.btn-whatsapp:hover { background: rgba(37,211,102,0.28); }

/* ── Inputs ── */
.auth-input {
  width: 100%; padding: 11px 14px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1);
  color: white; font-size: 15px; outline: none; text-align: center;
  margin-bottom: 6px; transition: border-color .15s;
}
.auth-input:focus { border-color: #f5c842; }

.code-input {
  flex: 1; padding: 10px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.08);
  color: white; font-size: 17px; letter-spacing: 4px; text-transform: uppercase;
  outline: none; text-align: center; transition: border-color .15s;
}

/* ── Auth screen ── */
#authScreen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100vh; height: 100dvh; padding: 1.5rem; gap: 16px;
}
.auth-card {
  background: rgba(0,0,0,0.45); border-radius: 16px; padding: 1.6rem;
  width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 8px;
}
.auth-hint { font-size: 11px; color: rgba(255,255,255,0.32); text-align: center; }
.auth-divider {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.3); font-size: 12px; margin: 2px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.12);
}
.err { color: #ff7070; font-size: 12px; text-align: center; min-height: 16px; }

/* ── Logo ── */
.logo-svg { flex-shrink: 0; }
.logo-sm  { margin-bottom: 4px; }

/* ── Lobby ── */
#lobby {
  display: none; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100vh; min-height: 100dvh;
  padding: 1rem; gap: 10px; overflow-y: auto;
}
.lobby-content { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 8px; }

/* Profile card */
.profile-card {
  background: rgba(0,0,0,0.42); border: 1px solid rgba(245,200,66,0.28);
  border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; gap: 13px;
}
.profile-photo    { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid #f5c842; flex-shrink: 0; }
.profile-initials { width: 52px; height: 52px; border-radius: 50%; background: #f5c842; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: #1a3a0a; flex-shrink: 0; }
.profile-info     { flex: 1; min-width: 0; }
.profile-greeting { font-size: 10px; color: rgba(255,255,255,0.38); letter-spacing: 1px; margin-bottom: 2px; }
.profile-name     { font-size: 17px; font-weight: 700; color: #f5c842; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-stats    { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 2px; }

/* Version toggle */
.version-row    { display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.version-label  { font-size: 12px; color: rgba(255,255,255,0.5); }
.version-toggle { display: flex; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,0.15); }
.version-opt    { padding: 6px 16px; font-size: 12px; font-weight: 500; cursor: pointer; border: none; background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.5); transition: all .15s; }
.version-opt.active { background: #f5c842; color: #1a3a0a; }

/* Join code row */
.join-code-row { display: flex; gap: 8px; }
.btn-join      { padding: 10px 18px; border-radius: 8px; border: none; background: rgba(255,255,255,0.15); color: white; font-size: 14px; font-weight: 500; cursor: pointer; }
.btn-join:hover { background: rgba(255,255,255,0.26); }

/* Lobby actions */
.lobby-actions { display: flex; gap: 8px; margin-top: 2px; }
.lobby-actions .btn-ghost { flex: 1; margin-bottom: 0; padding: 10px; font-size: 13px; }

.divider { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.3); font-size: 12px; margin: 2px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.12); }

/* ── Banner ── */
.banner-wrap { width: 100%; max-width: 380px; }
.banner {
  display: flex; align-items: center; gap: 12px;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(245,200,66,0.28);
  border-radius: 12px; padding: 10px 14px; text-decoration: none; color: white;
  transition: border-color .2s;
}
.banner:hover { border-color: rgba(245,200,66,0.6); }
.banner-img   { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.banner-text  { flex: 1; min-width: 0; }
.banner-title { font-size: 13px; font-weight: 600; color: #f5c842; margin-bottom: 2px; }
.banner-desc  { font-size: 11px; color: rgba(255,255,255,0.55); }
.banner-cta   { font-size: 11px; padding: 4px 10px; border-radius: 20px; background: #f5c842; color: #1a3a0a; font-weight: 600; flex-shrink: 0; }
.banner-label { font-size: 9px; color: rgba(255,255,255,0.25); text-align: right; margin-top: 3px; letter-spacing: 1px; }

/* ── Overlays & modals ── */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 200; align-items: center; justify-content: center; }
.overlay.show { display: flex; }
.modal {
  background: #1b4d25; border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px; padding: 1.4rem; text-align: center;
  min-width: 280px; max-width: 360px; width: calc(100% - 2rem);
  display: flex; flex-direction: column; gap: 8px;
}
.modal h3 { font-size: 15px; font-weight: 600; }
.modal p  { font-size: 12px; color: rgba(255,255,255,0.58); }
.modal-header { display: flex; justify-content: space-between; align-items: center; }
.modal-title  { font-size: 15px; font-weight: 600; color: #f5c842; }
.modal-label  { font-size: 11px; color: rgba(255,255,255,0.4); letter-spacing: 1px; }
.close-btn    { background: none; border: none; color: rgba(255,255,255,0.45); font-size: 20px; cursor: pointer; line-height: 1; padding: 0 2px; align-self: flex-start; }
.close-btn:hover { color: white; }
.result-close { align-self: flex-end; margin-bottom: -4px; }
.room-code-big { font-size: 36px; font-weight: 700; letter-spacing: 10px; color: #f5c842; }

/* Join modal */
#joinModal .modal { max-width: 310px; }

/* ── Waiting room ── */
#waiting { display: none; flex-direction: column; align-items: center; justify-content: center; height: 100vh; height: 100dvh; padding: 1rem; }
.wait-panel  { background: rgba(0,0,0,0.4); border-radius: 14px; padding: 1.4rem; width: 100%; max-width: 440px; }
.wait-title  { font-size: 15px; font-weight: 600; text-align: center; color: #f5c842; margin-bottom: 11px; }
.code-box    { background: rgba(245,200,66,0.1); border: 1px solid rgba(245,200,66,0.3); border-radius: 10px; padding: 12px 14px; margin-bottom: 11px; }
.code-row    { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.code-lbl    { font-size: 11px; color: rgba(255,255,255,0.4); letter-spacing: 1px; }
.code-val    { font-size: 34px; font-weight: 700; letter-spacing: 9px; color: #f5c842; }
.share-row   { display: flex; gap: 7px; }
.share-btn   { flex: 1; padding: 7px; border-radius: 7px; border: none; font-size: 12px; font-weight: 500; cursor: pointer; }
.share-link  { background: rgba(245,200,66,0.18); color: #f5c842; border: 1px solid rgba(245,200,66,0.35); }
.share-code  { background: rgba(255,255,255,0.08); color: white; border: 1px solid rgba(255,255,255,0.18); }
.copy-toast  { font-size: 11px; color: #a3e8b0; text-align: center; margin-top: 5px; min-height: 13px; }
.slots       { display: grid; gap: 7px; margin-bottom: 12px; }
.slot        { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 8px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.09); }
.slot.filled { background: rgba(245,200,66,0.07); border-color: rgba(245,200,66,0.25); }
.slotav      { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.35); flex-shrink: 0; object-fit: cover; }
.slotav.on   { background: #f5c842; color: #1a3a0a; }
.slotav.bot  { background: #7c3aed; color: #e9d5ff; }
.slot-name   { font-size: 13px; font-weight: 500; flex: 1; }
.slot-empty  { font-size: 13px; color: rgba(255,255,255,0.28); flex: 1; }
.tbadge      { font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 500; }
.ta { background: rgba(66,133,244,0.3); color: #93bbff; }
.tb { background: rgba(234,67,53,0.3);  color: #ffa09a; }
.add-bot-btn { font-size: 11px; padding: 4px 10px; border-radius: 20px; border: 1px solid rgba(245,200,66,0.35); background: rgba(245,200,66,0.08); color: #f5c842; cursor: pointer; }
.add-bot-btn:hover { background: rgba(245,200,66,0.22); }
.host-controls { background: rgba(245,200,66,0.07); border: 1px solid rgba(245,200,66,0.28); border-radius: 10px; padding: 12px; display: none; }
.start-note  { font-size: 12px; color: rgba(255,255,255,0.5); text-align: center; margin-bottom: 8px; }
.start-btn   { font-size: 15px; padding: 12px; margin-bottom: 0; }
.wait-info   { font-size: 12px; color: rgba(255,255,255,0.4); text-align: center; margin-top: 8px; }

/* ── Game ── */
#game { display: none; flex-direction: column; height: 100vh; height: 100dvh; }
.top-bar    { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: rgba(0,0,0,0.45); flex-shrink: 0; min-height: 44px; }
.score-grp  { display: flex; align-items: center; gap: 5px; }
.score-lbl  { font-size: 10px; color: rgba(255,255,255,0.42); }
.score-val  { font-size: 20px; font-weight: 700; color: #f5c842; line-height: 1; }
.mid-info   { font-size: 11px; color: rgba(255,255,255,0.52); text-align: center; }
.trump-pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 13px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.18); }
.share-icon-btn { background: rgba(245,200,66,0.18); border: 1px solid rgba(245,200,66,0.45); color: #f5c842; border-radius: 8px; padding: 5px 9px; cursor: pointer; font-size: 16px; line-height: 1; }

.main-area  { flex: 1; display: flex; overflow: hidden; position: relative; }
.table-wrap { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; }

/* Chat */
.chat-panel { width: 205px; background: rgba(0,0,0,0.44); display: flex; flex-direction: column; flex-shrink: 0; border-left: 1px solid rgba(255,255,255,0.09); transition: transform .25s; }
.chat-title { padding: 7px 10px; font-size: 12px; font-weight: 500; border-bottom: 1px solid rgba(255,255,255,0.09); color: rgba(255,255,255,0.65); }
.chat-msgs  { flex: 1; overflow-y: auto; padding: 7px; display: flex; flex-direction: column; gap: 5px; }
.chat-msgs::-webkit-scrollbar { width: 3px; }
.chat-msgs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 3px; }
.chat-msg   { font-size: 12px; line-height: 1.4; }
.chat-msg .who { font-weight: 600; font-size: 11px; margin-bottom: 2px; }
.chat-msg .txt { background: rgba(255,255,255,0.09); padding: 4px 7px; border-radius: 6px; word-break: break-word; }
.chat-msg.mine .txt { background: rgba(245,200,66,0.18); }
.chat-msg.system .txt { background: transparent; color: rgba(255,255,255,0.38); font-style: italic; font-size: 11px; padding: 1px 0; }
.chat-input-row { display: flex; gap: 5px; padding: 7px; border-top: 1px solid rgba(255,255,255,0.09); }
.chat-input-row input { flex: 1; padding: 6px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.09); color: white; font-size: 12px; outline: none; min-width: 0; }
.chat-input-row input:focus { border-color: #f5c842; }
.chat-send  { padding: 6px 10px; border-radius: 6px; border: none; background: #f5c842; color: #1a3a0a; font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.chat-toggle { display: none; position: absolute; bottom: 130px; right: 8px; z-index: 80; background: rgba(0,0,0,0.6); border: 1px solid rgba(245,200,66,0.4); color: #f5c842; border-radius: 50%; width: 40px; height: 40px; font-size: 18px; cursor: pointer; align-items: center; justify-content: center; }

/* Player positions */
.player-area { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pos-bottom  { bottom: 5px; left: 50%; transform: translateX(-50%); }
.pos-top     { top: 5px; left: 50%; transform: translateX(-50%); }
.pos-left    { left: 5px; top: 50%; transform: translateY(-50%); }
.pos-right   { right: 5px; top: 50%; transform: translateY(-50%); }
.pos-topleft { top: 5px; left: 5px; }
.pos-topright{ top: 5px; right: 5px; }
.ptag   { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.pta    { background: rgba(66,133,244,0.38); color: #c2d8ff; }
.ptb    { background: rgba(234,67,53,0.38);  color: #ffc2bd; }
.myptag { border: 1px solid #f5c842; }
.botag  { border: 1px dashed #a78bfa; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: #f5c842; animation: pulse 1s infinite; display: none; }
.pulse-dot.on { display: block; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.22} }
.trick-badge { font-size: 10px; padding: 1px 6px; border-radius: 20px; background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.58); }
.mini-av { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,255,255,0.28); flex-shrink: 0; }
.hand-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 560px; }
.suit-group { display: flex; flex-direction: row; }

/* ── Cards ── */
.card {
  border-radius: 7px; background: white; border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18), 0 1px 2px rgba(0,0,0,0.12);
  position: relative; font-family: Georgia, 'Times New Roman', serif;
  cursor: default; transition: transform .15s; user-select: none; flex-shrink: 0; overflow: hidden;
}
.card.playable { cursor: pointer; border: 2px solid #f5c842; box-shadow: 0 0 9px rgba(245,200,66,0.6); transform: translateY(-6px); }
.card.playable:hover  { transform: translateY(-18px); }
.card.playable:active { transform: translateY(-22px); }
.card .corner    { position: absolute; line-height: 1; text-align: center; }
.card .corner.tl { top: 4px; left: 5px; }
.card .corner.br { bottom: 4px; right: 5px; transform: rotate(180deg); }
.card .corner .cr { font-size: 15px; font-weight: 700; display: block; line-height: 1.1; }
.card .corner .cs { font-size: 12px; display: block; line-height: 1; }
.card .card-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.card .pips-wrap { position: absolute; inset: 0; }
.card .pip { position: absolute; transform: translate(-50%,-50%); }
.red-card .corner, .red-card .pip, .red-card .card-center { color: #cc0000; }
.blk-card .corner, .blk-card .pip, .blk-card .card-center { color: #111; }
.jkr-card { background: #fffde7; border-color: #f5c842; }
.jkr-card .corner { color: #b45309; }
.card-back { width:54px; height:78px; border-radius: 7px; background: var(--card-back); border: 2px solid rgba(255,255,255,0.25); display: inline-block; flex-shrink: 0; position: relative; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,0.15); }
.card-back::before { content:''; position:absolute; inset:0; background: repeating-linear-gradient(45deg, rgba(255,255,255,0.06) 0, rgba(255,255,255,0.06) 2px, transparent 2px, transparent 8px); }
.card-back::after { content:'🃏'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:22px; filter:brightness(0) invert(0.3); display:flex; align-items:center; justify-content:center; }

/* Trick zone */
.trick-zone { width: 310px; height: 220px; position: relative; display: flex; align-items: center; justify-content: center; }
.tspot { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ts-bottom  { bottom: 0; left: 50%; transform: translateX(-50%); }
.ts-top     { top: 0; left: 50%; transform: translateX(-50%); }
.ts-left    { left: 0; top: 50%; transform: translateY(-50%); }
.ts-right   { right: 0; top: 50%; transform: translateY(-50%); }
.ts-topleft { top: 0; left: 0; }
.ts-topright{ top: 0; right: 0; }
.tname { font-size: 9px; color: rgba(255,255,255,0.5); }
.fly-card { position: absolute; pointer-events: none; z-index: 200; transition: all .42s cubic-bezier(.4,0,.2,1); border-radius: 6px; background: white; overflow: hidden; font-family: Georgia, serif; width:54px; height:78px; }
.status-toast { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,0.76); border-radius: 9px; padding: 8px 16px; font-size: 13px; white-space: nowrap; pointer-events: none; z-index: 60; opacity: 0; transition: opacity .3s; }
.status-toast.show { opacity: 1; }

/* ── Bid modal ── */
.bid-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.bbtn { padding: 10px 5px; border-radius: 7px; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.09); color: white; font-size: 14px; cursor: pointer; transition: all .15s; }
.bbtn:hover:not(:disabled) { background: #f5c842; color: #1a3a0a; border-color: #f5c842; }
.bbtn:disabled { opacity: 0.28; cursor: not-allowed; }
.bbtn.pass { grid-column: span 3; font-size: 13px; background: rgba(255,255,255,0.04); }
.suit-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.sbtn { padding: 13px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.09); color: white; font-size: 28px; cursor: pointer; transition: all .15s; }
.sbtn.red { color: #e53e3e; }
.sbtn:hover { transform: scale(1.07); border-color: #f5c842; }

/* ── Result modals ── */
.result-icon  { font-size: 38px; }
.result-title { font-size: 17px; font-weight: 600; }
.result-detail{ font-size: 12px; color: rgba(255,255,255,0.58); white-space: pre-line; line-height: 1.6; }
.result-scores{ display: flex; justify-content: space-around; margin: 6px 0; }
.rscore-lbl   { font-size: 11px; color: rgba(255,255,255,0.42); }
.rscore-val   { font-size: 25px; font-weight: 700; color: #f5c842; }
.go-label     { font-size: 11px; letter-spacing: 3px; color: rgba(255,255,255,0.42); }
.go-team      { font-size: 26px; font-weight: 700; color: #f5c842; }
.go-players   { font-size: 13px; color: rgba(255,255,255,0.65); }

/* ── Leaderboard ── */
#leaderboard  { z-index: 300; }
.lb-modal     { max-width: 400px; max-height: 88vh; display: flex; flex-direction: column; gap: 0; padding: 1.4rem; }
.lb-header    { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.lb-title     { font-size: 16px; font-weight: 600; color: #f5c842; }
.lb-tabs      { display: flex; gap: 6px; margin-bottom: 12px; }
.lb-tab       { flex: 1; padding: 6px; border-radius: 7px; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.55); font-size: 12px; cursor: pointer; }
.lb-tab.active{ background: #f5c842; color: #1a3a0a; border-color: #f5c842; font-weight: 600; }
.lb-list      { overflow-y: auto; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.lb-list::-webkit-scrollbar { width: 3px; }
.lb-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.lb-row       { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 8px; background: rgba(255,255,255,0.06); }
.lb-row.me    { background: rgba(245,200,66,0.1); border: 1px solid rgba(245,200,66,0.22); }
.lb-rank      { font-size: 13px; font-weight: 700; width: 24px; text-align: center; color: rgba(255,255,255,0.4); }
.lb-av        { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #f5c842; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #1a3a0a; }
.lb-name      { flex: 1; font-size: 12px; font-weight: 500; }
.lb-val       { font-size: 13px; font-weight: 600; color: #f5c842; }
.lb-sub       { font-size: 10px; color: rgba(255,255,255,0.4); text-align: right; }
.lb-empty     { text-align: center; color: rgba(255,255,255,0.3); font-size: 13px; padding: 20px 0; }

/* ── Mobile responsive ── */
@media (max-width: 600px) {
  .chat-panel { position: absolute; right: 0; top: 0; bottom: 0; width: 200px; transform: translateX(100%); z-index: 70; }
  .chat-panel.open { transform: translateX(0); }
  .chat-toggle { display: flex; }
  .score-val { font-size: 15px; }
  .score-lbl { font-size: 9px; }
  .trump-pill { font-size: 11px; padding: 1px 6px; }

  /* Hand row — compact on mobile */
  .hand-row { max-width: 100vw; gap: 2px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; justify-content: flex-start; padding-left: 4px; }
  .hand-row::-webkit-scrollbar { height: 2px; }
  .suit-group { flex-shrink: 0; }
  .suit-group .card { width: 52px !important; height: 76px !important; }
  .suit-group .card + .card { margin-left: -28px !important; }
  .suit-group .card.playable { transform: translateY(-8px); }
  .suit-group .card.playable:active { transform: translateY(-14px); }

  /* Separator between suit groups */
  .hand-row > div[style*="border-left"] { height: 76px !important; }

  /* Trick zone smaller */
  .trick-zone { width: 180px; height: 140px; }

  /* Player areas tighter */
  .ptag { font-size: 10px; padding: 1px 6px; }
  .trick-badge { font-size: 9px; }
  .mini-av { width: 16px; height: 16px; }

  /* Top bar compact */
  .top-bar { padding: 4px 8px; min-height: 38px; }
  .mid-info { font-size: 10px; }
}

/* Very small phones */
@media (max-width: 390px) {
  .suit-group .card { width: 46px !important; height: 68px !important; }
  .suit-group .card + .card { margin-left: -26px !important; }
  .trick-zone { width: 160px; height: 120px; }
}

/* Secondary screen (profile / settings) */
#secondary { background: var(--bg); }
.secondary-header { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; background:rgba(0,0,0,0.4); flex-shrink:0; }
.back-btn { background:none; border:none; color:#f5c842; font-size:16px; font-weight:600; cursor:pointer; padding:4px 8px; }
.back-btn:hover { color:#ffd54f; }
.secondary-title { font-size:16px; font-weight:600; color:white; }
.secondary-body { flex:1; overflow-y:auto; padding:16px; max-width:440px; margin:0 auto; width:100%; }
.secondary-body::-webkit-scrollbar { width:3px; }
.secondary-body::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.2); border-radius:3px; }

/* Stats grid */
.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.stat-box { background:rgba(0,0,0,0.35); border-radius:10px; padding:12px 8px; text-align:center; border:1px solid rgba(255,255,255,0.1); }
.stat-val { font-size:22px; font-weight:700; color:white; }
.stat-lbl { font-size:10px; color:rgba(255,255,255,0.45); margin-top:2px; letter-spacing:1px; }

/* Settings rows */
.setting-row { display:flex; align-items:center; justify-content:space-between; background:rgba(0,0,0,0.3); border-radius:10px; padding:14px; border:1px solid rgba(255,255,255,0.08); }
.setting-label { font-size:13px; font-weight:500; margin-bottom:2px; }
.setting-desc { font-size:11px; color:rgba(255,255,255,0.45); }

/* Toggle switch */
.toggle { position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0; }
.toggle input { opacity:0; width:0; height:0; }
.toggle-slider { position:absolute; cursor:pointer; inset:0; background:rgba(255,255,255,0.2); border-radius:24px; transition:.3s; }
.toggle-slider:before { content:''; position:absolute; height:18px; width:18px; left:3px; bottom:3px; background:white; border-radius:50%; transition:.3s; }
.toggle input:checked + .toggle-slider { background:#f5c842; }
.toggle input:checked + .toggle-slider:before { transform:translateX(20px); }

/* Bottom nav */
.bottom-nav { display:flex; gap:6px; }
.nav-btn { flex:1; padding:10px 4px; border-radius:10px; border:1px solid rgba(255,255,255,0.12); background:rgba(0,0,0,0.3); color:rgba(255,255,255,0.7); font-size:11px; font-weight:500; cursor:pointer; text-align:center; display:flex; flex-direction:column; align-items:center; gap:3px; }
.nav-btn:hover { background:rgba(255,255,255,0.1); }
.nav-btn.danger { color:#ff7070; border-color:rgba(255,80,80,0.25); }
.nav-btn.danger:hover { background:rgba(255,80,80,0.12); }
.nav-icon { font-size:20px; line-height:1; }

/* Guest notice */
.guest-notice { background:rgba(0,0,0,0.3); border:1px solid rgba(255,255,255,0.12); border-radius:12px; padding:14px; text-align:center; color:white; }

/* Reaction picker */
.reaction-btn { display:none;position:absolute;bottom:130px;left:8px;z-index:80;background:rgba(0,0,0,0.6);border:1px solid rgba(255,255,255,0.2);border-radius:50%;width:40px;height:40px;font-size:20px;cursor:pointer;align-items:center;justify-content:center; }
.history-btn  { display:none;position:absolute;bottom:130px;left:56px;z-index:80;background:rgba(0,0,0,0.6);border:1px solid rgba(255,255,255,0.2);border-radius:50%;width:40px;height:40px;font-size:18px;cursor:pointer;align-items:center;justify-content:center; }
@media(max-width:600px){ .reaction-btn,.history-btn{ display:flex; } }
.reaction-picker { display:none;position:absolute;bottom:180px;left:8px;z-index:90;background:rgba(0,0,0,0.85);border-radius:12px;padding:8px;border:1px solid rgba(255,255,255,0.15); }
.reaction-picker.show { display:block; }
.reaction-row { display:flex;gap:4px;flex-wrap:wrap;max-width:180px; }
.reaction-emoji { background:none;border:none;font-size:24px;cursor:pointer;padding:4px;border-radius:8px;transition:transform .1s; }
.reaction-emoji:hover { transform:scale(1.3); }
.reaction-bubble { position:absolute;font-size:32px;z-index:150;pointer-events:none;animation:floatUp 2.5s ease-out forwards; bottom:40%;left:50%;transform:translateX(-50%); }
@keyframes floatUp { 0%{opacity:1;transform:translateX(-50%) translateY(0) scale(1)} 100%{opacity:0;transform:translateX(-50%) translateY(-80px) scale(1.4)} }

/* Hand history panel */
.history-panel { display:none;position:absolute;bottom:60px;left:8px;z-index:90;background:rgba(0,0,0,0.9);border-radius:12px;border:1px solid rgba(255,255,255,0.15);width:260px;max-height:240px;overflow-y:auto; }
.history-panel.show { display:block; }
.history-panel::-webkit-scrollbar { width:3px; }
.history-panel::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.2);border-radius:3px; }
.panel-header { display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid rgba(255,255,255,0.1); }
.panel-title { font-size:12px;font-weight:600;color:rgba(255,255,255,0.8); }

/* Theme swatches */
.theme-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.theme-swatch { border-radius:10px; padding:10px 8px; cursor:pointer; text-align:center; border:2px solid transparent; transition:all .2s; }
.theme-swatch.active { border-color:var(--accent); }
.theme-swatch .swatch-dot { width:28px; height:28px; border-radius:50%; margin:0 auto 4px; border:2px solid rgba(255,255,255,0.3); }
.theme-swatch .swatch-name { font-size:10px; color:rgba(255,255,255,0.7); }

/* Avatar grid */
.avatar-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.avatar-opt { border-radius:10px; padding:10px 4px; cursor:pointer; text-align:center; border:2px solid rgba(255,255,255,0.1); background:rgba(255,255,255,0.06); transition:all .2s; }
.avatar-opt:hover { background:rgba(255,255,255,0.14); }
.avatar-opt.active { border-color:var(--accent); background:rgba(245,200,66,0.15); }
.avatar-opt .av-emoji { font-size:26px; line-height:1.2; }
.avatar-opt .av-label { font-size:9px; color:rgba(255,255,255,0.55); margin-top:2px; }

/* Last played indicator */
.last-played-badge { font-size:9px; background:#f5c842; color:#1a3a0a; padding:1px 5px; border-radius:10px; font-weight:700; display:inline-block; margin-left:4px; }



/* ══════════════════════════════════════════
   TABLE LAYOUT — complete rewrite
══════════════════════════════════════════ */

/* Game screen */
#game {
  display: none;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--felt, #1a5c2a);
  overflow: hidden;
  position: relative;
}

/* ── Top score bar ── */
.top-bar {
  display: flex;
  align-items: center;
  padding: 0 8px;
  height: 46px;
  background: rgba(0,0,0,0.55);
  flex-shrink: 0;
  gap: 6px;
  z-index: 20;
}
.team-score {
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  padding: 3px 10px;
  min-width: 80px;
}
.team-a { background: #1e4a1e; border: 1px solid #4a9a4a; }
.team-b { background: #4a1e1e; border: 1px solid #9a4a4a; flex-direction: row-reverse; }
.team-label { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.8); }
.team-pts   { font-size: 22px; font-weight: 800; color: white; min-width: 28px; text-align: center; }
.team-tricks { font-size: 10px; color: rgba(255,255,255,0.5); display: block; }
.mid-info   { flex: 1; text-align: center; overflow: hidden; }
.bid-line   { font-size: 11px; color: rgba(255,255,255,0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trump-pill { font-size: 12px; display: inline-block; padding: 2px 10px; border-radius: 20px; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.2); }
.top-actions { display: flex; gap: 5px; flex-shrink: 0; }
.icon-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; border-radius: 8px; padding: 5px 9px; cursor: pointer; font-size: 15px; }
.icon-btn.danger { background: rgba(255,80,80,0.15); border-color: rgba(255,80,80,0.4); color: #ff7070; }

/* ── Table area — the green felt ── */
.table-area {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ═══════════════════════════════════════
   PLAYER ZONES — absolute positioned
   Each zone is a flex container with:
   - badge (avatar + name + tricks)
   - card stack (face-down backs)
═══════════════════════════════════════ */

.pzone {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* TOP player: centred at top, column layout (badge above stack) */
.player-top {
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
}

/* LEFT player: centred on left side, row layout (stack | badge) */
.player-left {
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  flex-direction: row;
  align-items: center;
}

/* RIGHT player: centred on right side, row layout (badge | stack) */
.player-right {
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  flex-direction: row;
  align-items: center;
}

/* TOP-LEFT / TOP-RIGHT (6 players) */
.player-top-left {
  top: 10px;
  left: 10px;
  flex-direction: column;
  align-items: flex-start;
}
.player-top-right {
  top: 10px;
  right: 10px;
  flex-direction: column;
  align-items: flex-end;
}

/* ── Player badge ── */
.pbadge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,0.65);
  border-radius: 10px;
  padding: 4px 8px;
  white-space: nowrap;
  border-width: 2px;
  border-style: solid;
}
.pbadge-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.pbadge-av-init {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #f5c842;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #1a3a0a;
  flex-shrink: 0;
}
.pbadge-name  { font-size: 12px; font-weight: 600; color: white; }
.pbadge-sub   { font-size: 10px; color: rgba(255,255,255,0.5); }
.pbadge-bid   {
  margin-left: 3px;
  background: rgba(245,200,66,0.25);
  border: 1px solid #f5c842;
  border-radius: 5px;
  padding: 0 5px;
  font-size: 11px; font-weight: 700; color: #f5c842;
}
.active-dot {
  position: absolute;
  top: -4px; left: -4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #f5c842;
  box-shadow: 0 0 8px #f5c842;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.4; transform:scale(0.8); }
}

/* ── Card stacks ── */
.cstack-v {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cstack-h {
  display: flex;
  flex-direction: row;
  align-items: center;
}
/* Vertical overlap: each card overlaps the previous by 64px */
.cstack-v .sv         { width: 50px !important; height: 74px !important; }
.cstack-v .sv + .sv   { margin-top: -62px; }
/* Horizontal overlap */
.cstack-h .sh         { width: 50px !important; height: 74px !important; }
.cstack-h .sh + .sh   { margin-left: -38px; }

/* ── Trick zone — CROSS layout ──
   3-col x 3-row grid:
   .  TOP   .
   L  [  ]  R
   .  ME    .
*/
.trick-zone {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -54%);
  display: grid;
  grid-template-columns: auto auto auto;
  grid-template-rows:    auto auto auto;
  gap: 6px;
  align-items: center;
  justify-items: center;
  /* No background — transparent by default */
  background: transparent;
}
/* Grid cells have no size unless a card is in them */
.trick-zone:empty { display: none; }

.tslot          { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tslot-top      { grid-column: 2; grid-row: 1; }
.tslot-left     { grid-column: 1; grid-row: 2; }
.tslot-right    { grid-column: 3; grid-row: 2; }
.tslot-bottom   { grid-column: 2; grid-row: 3; }

/* 6-player extras */
.tslot-top-left  { grid-column: 1; grid-row: 1; }
.tslot-top-right { grid-column: 3; grid-row: 1; }

.tslot-name {
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  color: rgba(255,255,255,0.7);
}

/* ── My badge above hand ── */
#myBadge {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 5;
}

/* ── Status toast ── */
.status-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 80px);
  background: rgba(0,0,0,0.85);
  border-radius: 10px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  transition: opacity .3s;
}
.status-toast.show { opacity: 1; }

/* ── Flying card animation ── */
.fly-card {
  position: absolute;
  pointer-events: none;
  z-index: 200;
  transition: all .42s cubic-bezier(.4,0,.2,1);
  border-radius: 7px;
  overflow: hidden;
}

/* ── My hand at bottom ── */
.my-hand-area {
  flex-shrink: 0;
  padding: 6px 6px 8px;
  background: rgba(0,0,0,0.35);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
}
.hand-row {
  display: flex;
  align-items: flex-end;
  overflow-x: auto;
  padding: 4px 2px 2px;
  max-width: 100%;
  gap: 0;
}
.hand-row::-webkit-scrollbar { height: 2px; }
.hand-row::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.suit-group { display: flex; flex-direction: row; flex-shrink: 0; }
.suit-sep {
  width: 6px; height: 82px; flex-shrink: 0;
  border-left: 1px dashed rgba(255,255,255,0.3);
  margin: 0 3px; align-self: flex-end;
}

/* ── Cards ── */
.card {
  border-radius: 7px;
  background: white;
  border: 1px solid #ccc;
  position: relative;
  font-family: Georgia, 'Times New Roman', serif;
  cursor: default;
  transition: transform .15s, box-shadow .15s;
  user-select: none;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.card.playable {
  cursor: pointer;
  border: 2px solid #f5c842;
  box-shadow: 0 0 12px rgba(245,200,66,0.8);
  transform: translateY(-10px);
}
.card.playable:hover  { transform: translateY(-20px); }
.card.playable:active { transform: translateY(-26px); }
.card-back {
  border-radius: 7px;
  background: var(--card-back, #1a3a8a);
  border: 2px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.card-back::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 2px,
    transparent 2px, transparent 8px
  );
}

/* Best card in hand */
.strongest-card {
  border: 2px solid #f5c842 !important;
  box-shadow: 0 0 16px rgba(245,200,66,1), 0 0 30px rgba(245,200,66,0.4) !important;
}
.strongest-badge {
  position: absolute;
  top: -13px; left: 50%;
  transform: translateX(-50%);
  background: #f5c842;
  color: #1a3a0a;
  font-size: 9px; font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}

/* ── Bottom bar ── */
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 10px;
  background: rgba(0,0,0,0.5);
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.bottom-left, .bottom-right { display: flex; gap: 5px; }
.bar-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: white; border-radius: 8px;
  padding: 5px 10px; cursor: pointer; font-size: 15px;
}
.bar-btn:hover { background: rgba(255,255,255,0.2); }

/* ── Chat ── */
.chat-panel {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 240px; z-index: 150;
  background: #1a3020;
  border-left: 1px solid rgba(255,255,255,0.12);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s;
}
.chat-panel.open { transform: translateX(0); }
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: rgba(0,0,0,0.4);
  font-size: 13px; font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.chat-msgs { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.chat-msg { font-size: 12px; line-height: 1.4; }
.chat-msg .who { font-weight: 600; font-size: 11px; margin-bottom: 2px; }
.chat-msg .txt { background: rgba(255,255,255,0.09); padding: 4px 8px; border-radius: 6px; word-break: break-word; }
.chat-msg.mine .txt { background: rgba(245,200,66,0.18); }
.chat-msg.system .txt { background: transparent; color: rgba(255,255,255,0.4); font-style: italic; }
.chat-input-row { display: flex; gap: 5px; padding: 8px; border-top: 1px solid rgba(255,255,255,0.1); }
.chat-input-row input { flex: 1; padding: 7px 10px; border-radius: 7px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); color: white; font-size: 12px; outline: none; }
.chat-input-row input:focus { border-color: #f5c842; }
.chat-send { padding: 7px 12px; border-radius: 7px; border: none; background: #f5c842; color: #1a3a0a; font-size: 14px; cursor: pointer; }

/* ── Reactions / History ── */
.react-btn, .hist-btn {
  position: absolute; z-index: 50;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%; width: 36px; height: 36px; font-size: 17px;
  cursor: pointer; color: white; display: flex; align-items: center; justify-content: center;
}
.react-btn { bottom: 8px; left: 8px; }
.hist-btn  { bottom: 8px; left: 52px; }
.reaction-picker {
  display: none; position: absolute; bottom: 50px; left: 8px; z-index: 90;
  background: rgba(0,0,0,0.92); border-radius: 12px; padding: 8px;
  border: 1px solid rgba(255,255,255,0.15);
}
.reaction-picker.show { display: block; }
#reactionRow { display: flex; gap: 4px; }
.reaction-emoji { background: none; border: none; font-size: 24px; cursor: pointer; padding: 4px; border-radius: 8px; }
.reaction-emoji:hover { background: rgba(255,255,255,0.1); }
.reaction-bubble {
  position: absolute; font-size: 36px; z-index: 150; pointer-events: none;
  bottom: 30%; left: 50%; transform: translateX(-50%);
  animation: floatUp 2.5s ease-out forwards;
}
@keyframes floatUp {
  0%   { opacity:1; transform:translateX(-50%) translateY(0); }
  100% { opacity:0; transform:translateX(-50%) translateY(-100px); }
}
.history-panel {
  display: none; position: absolute; bottom: 50px; left: 8px; z-index: 90;
  background: rgba(0,0,0,0.93); border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15); width: 260px; max-height: 240px; overflow-y: auto;
}
.history-panel.show { display: block; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.panel-title { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.8); }

/* ── Modals ── */
.overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.65); z-index:200; align-items:center; justify-content:center; }
.overlay.show { display:flex; }
.modal { background:#1b4d25; border:1px solid rgba(255,255,255,0.15); border-radius:14px; padding:1.4rem; text-align:center; min-width:260px; max-width:340px; width:calc(100% - 2rem); display:flex; flex-direction:column; gap:8px; }
.modal h3 { font-size:15px; font-weight:600; margin:0; }
.modal p  { font-size:12px; color:rgba(255,255,255,0.55); margin:0; }
.modal-header { display:flex; justify-content:space-between; align-items:center; }
.modal-title  { font-size:15px; font-weight:600; color:#f5c842; }
.close-btn { background:none; border:none; color:rgba(255,255,255,0.45); font-size:20px; cursor:pointer; }
.close-btn:hover { color:white; }
.result-close { align-self:flex-end; margin-bottom:-4px; }
.result-icon  { font-size:38px; }
.result-title { font-size:17px; font-weight:600; }
.result-detail{ font-size:12px; color:rgba(255,255,255,0.58); white-space:pre-line; line-height:1.6; }
.result-scores{ display:flex; justify-content:space-around; margin:6px 0; }
.rscore-lbl { font-size:11px; color:rgba(255,255,255,0.42); }
.rscore-val { font-size:25px; font-weight:700; color:#f5c842; }
.go-team    { font-size:22px; font-weight:700; color:#f5c842; }
.go-players { font-size:13px; color:rgba(255,255,255,0.7); }
.bid-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.bbtn { padding:10px 5px; border-radius:7px; border:1px solid rgba(255,255,255,0.18); background:rgba(255,255,255,0.09); color:white; font-size:14px; cursor:pointer; transition:all .15s; }
.bbtn:hover:not(:disabled) { background:#f5c842; color:#1a3a0a; border-color:#f5c842; }
.bbtn:disabled { opacity:0.28; cursor:not-allowed; }
.bbtn.pass { grid-column:span 3; font-size:13px; background:rgba(255,255,255,0.04); }
.suit-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.sbtn { padding:13px; border-radius:9px; border:1px solid rgba(255,255,255,0.18); background:rgba(255,255,255,0.09); color:white; font-size:28px; cursor:pointer; transition:all .15s; }
.sbtn.red { color:#e53e3e; }
.sbtn:hover { transform:scale(1.07); border-color:#f5c842; }
.code-box { background:rgba(245,200,66,0.1); border:1px solid rgba(245,200,66,0.3); border-radius:10px; padding:12px 14px; }
.code-lbl { font-size:11px; color:rgba(255,255,255,0.4); letter-spacing:1px; margin-bottom:4px; }
.code-val { font-size:32px; font-weight:700; letter-spacing:9px; color:#f5c842; }
.copy-toast { font-size:11px; color:#a3e8b0; text-align:center; margin-top:5px; min-height:13px; }
.btn-whatsapp { background:rgba(37,211,102,0.15); color:#25d366; border:1px solid rgba(37,211,102,0.4); }

/* ══ MOBILE ══ */
@media (max-width: 600px) {
  .top-bar { height: 42px; padding: 0 5px; gap: 3px; }
  .team-pts { font-size: 18px; }
  .team-label { font-size: 10px; }
  .trump-pill { font-size: 10px; padding: 1px 7px; }

  /* Smaller stacks on mobile */
  .cstack-v .sv       { width: 38px !important; height: 55px !important; }
  .cstack-v .sv + .sv { margin-top: -48px; }
  .cstack-h .sh       { width: 38px !important; height: 55px !important; }
  .cstack-h .sh + .sh { margin-left: -30px; }

  /* Smaller trick zone cards */
  .tslot-name { font-size: 9px; }

  /* Hand cards */
  .suit-group .card              { width: 54px !important; height: 80px !important; }
  .suit-group .card + .card      { margin-left: -24px !important; }
  .suit-group .card.playable     { transform: translateY(-8px) !important; }
  .suit-group .card.playable:hover { transform: translateY(-16px) !important; }
  .suit-sep { height: 80px; }
  .my-hand-area { min-height: 88px; padding: 4px 4px 6px; }

  /* Player badges smaller */
  .pbadge-av, .pbadge-av-init { width: 24px !important; height: 24px !important; font-size: 10px !important; }
  .pbadge-name { font-size: 11px; }
  .pbadge-sub  { font-size: 9px; }
  .pbadge { padding: 3px 6px !important; }

  /* Tighter zone positions */
  .player-left  { left: 3px; }
  .player-right { right: 3px; }
}

/* ══════════════════════════════════════════
   HEXAGON TABLE — 6-player layout
   Players sit at hexagon vertices
══════════════════════════════════════════ */

/* 6-player hex table — no background image, pure CSS positions */

/* 6-player hexagon positions
   Each .pzone gets absolute % positioning
   transform: translate(-50%,-50%) centres the zone on its point */
/* ── 6-player hexagon positions ──
   Team A (Orange): rel 3=top, rel 1=bot-left, rel 5=bot-right
   Team B (Pink):   rel 2=top-left, rel 4=top-right, rel 0=me(bottom)
   Radius 38% from centre. Angles from image:
   top=270° top-right=330° bot-right=30° me=90° bot-left=150° top-left=210°
*/

/* rel 3 — TOP (Team A) */
.hex-table .player-top {
  top: 8%; left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* rel 4 — TOP-RIGHT (Team B) */
.hex-table .player-top-right {
  top: 29%; left: 81%;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* rel 5 — BOT-RIGHT (Team A) */
.hex-table .player-right {
  top: 67%; left: 81%;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* rel 1 — BOT-LEFT (Team A) */
.hex-table .player-left {
  top: 67%; left: 19%;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* rel 2 — TOP-LEFT (Team B) */
.hex-table .player-top-left {
  top: 29%; left: 19%;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* My badge at bottom for hex */ (same as 4p) */
.hex-table #myBadge {
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
}

/* Hex stack sizing — slightly smaller to fit */
.hex-table .cstack-v .sv       { width: 42px !important; height: 62px !important; }
.hex-table .cstack-v .sv + .sv { margin-top: -54px; }
.hex-table .cstack-h .sh       { width: 42px !important; height: 62px !important; }
.hex-table .cstack-h .sh + .sh { margin-left: -32px; }

/* 4-player: no hex class, normal layout unchanged */

/* ══ MOBILE hex ══ */
@media (max-width: 600px) {
  .hex-table .cstack-v .sv       { width: 34px !important; height: 50px !important; }
  .hex-table .cstack-v .sv + .sv { margin-top: -43px; }
  .hex-table .cstack-h .sh       { width: 34px !important; height: 50px !important; }
  .hex-table .cstack-h .sh + .sh { margin-left: -25px; }
  .hex-table .pbadge-name { font-size: 10px; }
  .hex-table .pbadge { padding: 2px 5px !important; }
}
