/* Kibitzing (Watch screen + the player's spectator chip). Black & chrome; team colours NS ice blue / EW amber. */
:root { --kb-ns: #5AB4FF; --kb-ew: #FFB547; }
.kb-ns { color: var(--kb-ns); }
.kb-ew { color: var(--kb-ew); }
#screen-watch { max-width: 1100px; margin: 0 auto; padding: 8px; }
.kb-panel h2 { margin: 0 0 4px; }
.kb-rows { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.kb-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #3a3d44; border-radius: 12px; background: linear-gradient(180deg, #1c1d22, #121317); }
.kb-row-main { flex: 1; min-width: 0; }
.kb-row-head { font-size: 1rem; }
.kb-row-players { margin: 2px 0; overflow-wrap: anywhere; }
.kb-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.kb-eye { font-variant-numeric: tabular-nums; color: #cfd3da; white-space: nowrap; }
.kb-empty { padding: 18px; text-align: center; }

.kb-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.kb-head { flex: 1; min-width: 160px; }
.kb-score { font-weight: 600; }
.kb-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.kb-follow { display: inline-flex; border: 1px solid #555a62; border-radius: 10px; overflow: hidden; }
.kb-follow button { background: transparent; color: #d9dde3; border: 0; padding: 6px 11px; font-weight: 700; cursor: pointer; min-width: 36px; min-height: 34px; }
.kb-follow button + button { border-left: 1px solid #555a62; }
.kb-follow button.on { background: linear-gradient(180deg, #e9ecef, #aab0b8); color: #111; }
.kb-show button { min-width: 48px; }
.kb-fair { flex-basis: 100%; }

.kb-felt { --card-w: clamp(46px, 7.2vw, 84px); --card-h: calc(var(--card-w) * 1.4); position: relative; display: grid; gap: 8px; padding: 12px;
  grid-template-columns: minmax(90px, 1fr) minmax(170px, 1.6fr) minmax(90px, 1fr); grid-template-areas: "top top top" "left center right" "bottom bottom bottom";
  background: var(--felt, #17181c); border-radius: 22px; border: 4px solid #8c939b; box-shadow: inset 0 0 40px rgba(0,0,0,.45), 0 0 0 2px #2b2e33; min-height: 460px; }
.kb-felt > .g5-board { position: absolute; top: 8px; right: 8px; z-index: 6; width: 196px; }
.kb-seat { position: relative; border-radius: 14px; padding: 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.kb-seat[data-pos="2"] { grid-area: top; }
.kb-seat[data-pos="1"] { grid-area: left; justify-content: center; }
.kb-seat[data-pos="3"] { grid-area: right; justify-content: center; }
.kb-seat[data-pos="0"] { grid-area: bottom; }
/* turn indicator: a light grey box covering the whole active seat (name + bid + hand) */
.kb-seat.turn { background: rgba(225, 228, 233, .16); box-shadow: 0 0 0 2px rgba(225, 228, 233, .45); }
.kb-seat.offline .kb-name, .kb-seat.offline .kb-meta { color: #8a8f96; } /* offline: grey name only; the seat's cards stay fully opaque */
.kb-plate { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; text-align: center; }
.kb-av { font-size: 1.3rem; }
.kb-name { font-weight: 800; font-size: 1.02rem; overflow-wrap: anywhere; min-width: 0; }
.kb-bid { font-size: .86rem; color: #d7dbe0; flex-basis: 100%; }
.kb-bid .nil { color: #ff6b6b; }
.kb-dealer { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(180deg, #fff, #c8ccd2); color: #111; font-weight: 900; font-size: .95rem; box-shadow: 0 1px 3px rgba(0,0,0,.6); }
.kb-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 100%; }
.kb-hand.main { flex-wrap: nowrap; gap: 0; }
.kb-hand.main .card { margin-left: calc(var(--card-w) * -.42); }
.kb-hand.main .card:first-child { margin-left: 0; }
.kb-back { width: 16px; height: 24px; border-radius: 3px; border: 1px solid #8c939b; background: repeating-linear-gradient(45deg, #2a2d33 0 3px, #3c4047 3px 6px); margin-left: -9px; }
.kb-back:first-child { margin-left: 0; }
.kb-back.big { width: calc(var(--card-w) * .62); height: calc(var(--card-w) * .87); margin-left: calc(var(--card-w) * -.38); border-radius: 6px; }
.kb-back.big:first-child { margin-left: 0; }
.kb-mini { display: inline-flex; align-items: baseline; gap: 1px; padding: 2px 4px; border-radius: 5px; background: #fff; color: #111; font-weight: 800; font-size: .9rem; line-height: 1.1; min-width: 26px; justify-content: center; }
.kb-mini.red { color: #c8102e; }
.fc4 .kb-mini.s-D { color: #1f5fd1; } .fc4 .kb-mini.s-C { color: #138a3e; }
.kb-mini i { font-style: normal; }
.kb-center { grid-area: center; position: relative; min-height: calc(var(--card-h) * 2.2); }
.kb-slot { position: absolute; }
.kb-slot[data-pos="2"] { top: 0; left: 50%; transform: translateX(-50%); }
.kb-slot[data-pos="0"] { bottom: 0; left: 50%; transform: translateX(-50%); }
.kb-slot[data-pos="1"] { left: 4%; top: 50%; transform: translateY(-50%); }
.kb-slot[data-pos="3"] { right: 4%; top: 50%; transform: translateY(-50%); }
.kb-slot .card.kb-win { box-shadow: 0 0 0 3px #e9ecef, 0 0 14px rgba(255,255,255,.5); }
.kb-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #cfd3da; font-weight: 600; pointer-events: none; padding: 0 20%; }
/* last trick: bigger compass in the bottom-left corner (as at the player's table) */
.kb-last { position: absolute; bottom: 10px; left: 10px; padding: 6px 8px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid #444950; }
.kb-lt-label { font-size: .8rem; color: #cfd3da; margin-bottom: 4px; max-width: 170px; }
.kb-compass { display: grid; grid-template-columns: repeat(3, auto); grid-template-rows: repeat(3, auto); gap: 2px; justify-content: center; }
.kb-compass .kb-mini { font-size: 1.08rem; min-width: 34px; padding: 3px 5px; }
.kb-cp.p2 { grid-area: 1 / 2; } .kb-cp.p1 { grid-area: 2 / 1; } .kb-cp.p3 { grid-area: 2 / 3; } .kb-cp.p0 { grid-area: 3 / 2; }
.kb-cp.led .kb-mini { box-shadow: 0 0 0 2px #ffd400; }
.kb-result { margin-top: 10px; padding: 10px; border: 1px solid #3a3d44; border-radius: 12px; background: #141519; }
.kb-res { width: 100%; border-collapse: collapse; text-align: center; }
.kb-res th, .kb-res td { padding: 4px 6px; border-bottom: 1px solid #2b2e33; }
.kb-res tr.kb-ns th, .kb-res tr.kb-ns td b { color: var(--kb-ns); } .kb-res tr.kb-ew th, .kb-res tr.kb-ew td b { color: var(--kb-ew); }
.kb-res-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

/* the player's own table: spectator count + Allow kibitzers */
.kib-box { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; }
.kib-count { font-variant-numeric: tabular-nums; color: #cfd3da; }
.kib-toggle { padding: 2px 8px; font-size: .8rem; min-height: 26px; }

@media (max-width: 600px) {
  .kb-felt { --card-w: 40px; grid-template-columns: 74px 1fr 74px; padding: 8px 6px; gap: 6px; min-height: 0; border-width: 3px; }
  .kb-seat { padding: 4px; }
  .kb-name { font-size: .84rem; }
  .kb-seat[data-pos="1"] .kb-plate, .kb-seat[data-pos="3"] .kb-plate { max-width: 100%; }
  .kb-bid { font-size: .76rem; }
  .kb-mini { font-size: .74rem; min-width: 20px; padding: 1px 2px; }
  .kb-seat[data-pos="1"] .kb-back, .kb-seat[data-pos="3"] .kb-back { margin-left: -11px; }
  .kb-hand.main .card { margin-left: calc(var(--card-w) * -.5); }
  .kb-last { position: static; grid-column: 1 / -1; order: 9; justify-self: center; display: flex; gap: 8px; align-items: center; }
  .kb-lt-label { margin: 0; max-width: 110px; }
  .kb-compass .kb-mini { font-size: .86rem; min-width: 26px; }
  .kb-center { min-height: calc(var(--card-h) * 2.4); }
  .kb-slot[data-pos="1"] { left: 0; } .kb-slot[data-pos="3"] { right: 0; }
  .kb-dealer { width: 24px; height: 24px; font-size: .8rem; }
  .kib-box { margin-left: 4px; }
}

/* the 👁 Watch nav button adds one more pill: tighten the top bar on phones so 375 px never scrolls sideways */
@media (max-width: 420px) {
  .topbar .nav { gap: 3px; }
  .topbar .navbtn { padding-left: 7px; padding-right: 7px; }
}

/* Same compass as the play table: a 2.86-card box, partner and you ±0.51 card-heights,
   opponents ±0.91 card-widths. Comes after the 600 px tweak so the cross stays tight there too. */
.kb-center { width: calc(var(--card-w) * 2.86); height: calc(var(--card-w) * 2.86); min-height: calc(var(--card-w) * 2.86); justify-self: center; align-self: center; }
.kb-slot[data-pos="2"] { top: max(0px, calc(50% - var(--card-w) * 1.414)); bottom: auto; left: 50%; right: auto; transform: translateX(-50%); }
.kb-slot[data-pos="0"] { bottom: max(0px, calc(50% - var(--card-w) * 1.414)); top: auto; left: 50%; right: auto; transform: translateX(-50%); }
.kb-slot[data-pos="1"] { left: max(0px, calc(50% - var(--card-w) * 1.41)); right: auto; top: 50%; bottom: auto; transform: translateY(-50%); }
.kb-slot[data-pos="3"] { right: max(0px, calc(50% - var(--card-w) * 1.41)); left: auto; top: 50%; bottom: auto; transform: translateY(-50%); }

/* Watch warning (Duplicate: watching shows every hand and burns the board): one line + Watch / Cancel */
.kb-warn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; padding: 9px 12px; border: 1px solid #FFB547; border-radius: 12px; background: rgba(255,181,71,.10); color: #ffe2b3; }
.kb-warn[hidden] { display: none; }
.kb-warn > span:first-child { flex: 1; min-width: 200px; }
.kb-warn-btns { display: inline-flex; gap: 6px; }
/* Sit & Go spectate: ◀ Prev · Table N · Board B · Next ▶ */
.kb-tour { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 8px; padding: 6px 8px; border: 1px solid #3a3d44; border-radius: 12px; background: #15161a; }
.kb-tour[hidden] { display: none; }
.kb-tour-lbl { flex: 1; text-align: center; min-width: 0; }
.kb-arrow { min-height: 36px; padding: 6px 12px; white-space: nowrap; }
.tour-spec { margin: 6px 0; }
@media (max-width: 480px) { .kb-tour { gap: 6px; padding: 5px 6px; } .kb-arrow { padding: 6px 8px; } .kb-tour-lbl { font-size: .9rem; } }
/* phones: the View from / Show / Rotate buttons are touch targets (≥ 44 px); this file loads after site.css, so the
   34 px desktop height above would otherwise win over site.css's coarse-pointer rule */
@media (pointer: coarse), (max-width: 700px) { .kb-follow button, #kbRotate { min-height: 44px; } }
