/* Court Piece score sheet (score tab): two team panels with runs of deals, the table with dealer
   and trump-caller, one column of result buttons per team. Inside .tl-card (light card palette). */
.cp { padding: .6rem .55rem .8rem; }
.cp-t0 { --team: #b3141b; }
.cp-t1 { --team: #1f4e8c; }

/* ---- the score ---- */
.cp-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.cp-side { background: #fbf6ea; border: 1px solid var(--card-rule); border-top: 5px solid var(--team); border-radius: 8px; padding: .35rem .45rem .4rem; min-width: 0; }
.cp-side.cp-won { background: color-mix(in srgb, var(--team) 10%, #fff); }
.cp-nm { display: flex; flex-direction: column; font-weight: 700; line-height: 1.2; min-width: 0; }
.cp-nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-score { display: flex; align-items: baseline; gap: .35rem; margin: .15rem 0 .1rem; }
.cp-score b { font-size: 2.4rem; line-height: 1; font-weight: 800; color: var(--team); font-variant-numeric: lining-nums tabular-nums; }
.cp-score span { color: var(--card-soft); font-size: .95rem; }
.cp-run { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .45rem; }
.cp-pips { display: flex; gap: 3px; }
.cp-pip { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--team); background: var(--card); }
.cp-pip.on { background: var(--team); }
.cp-runn { font-size: .85rem; color: var(--card-soft); white-space: nowrap; }
.cp-sub { font-size: .82rem; color: var(--card-soft); margin-top: .15rem; }
.cp-live { min-height: 1.4em; margin: .5rem 0 .2rem; font-weight: 700; text-align: center; }

/* ---- the deal ---- */
.cp-deal { border-top: 3px double var(--card-rule); padding-top: .4rem; }
.cp-dealhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .1rem .7rem; }
.cp-dealhead strong { font-size: 1.15rem; }
.cp-since { color: var(--card-soft); font-size: .88rem; }

/* the table: 3 × 3 grid, player 1 at the bottom, anticlockwise to the right, top, left */
.cp-table { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-areas: ". n ." "w m e" ". s ."; gap: .3rem; margin: .5rem 0; }
.cp-seat { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px; padding: .15rem .2rem;
  border: 1px solid var(--card-rule); border-bottom: 3px solid var(--team); border-radius: 7px; background: var(--card); min-width: 0; text-align: center; }
.cp-s { grid-area: s; } .cp-e { grid-area: e; } .cp-n { grid-area: n; } .cp-w { grid-area: w; }
.cp-sn { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-badge { font-size: .8rem; font-variant-caps: all-small-caps; letter-spacing: .05em; color: #fff; background: var(--card-soft); border-radius: 4px; padding: 0 .35rem; white-space: nowrap; }
.cp-seat.cp-dealer { background: #f1ead9; }
.cp-seat.cp-dealer .cp-badge { background: var(--card-ink); }
.cp-seat.cp-caller { background: color-mix(in srgb, var(--team) 12%, #fff); border-color: var(--team); }
.cp-seat.cp-caller .cp-badge { background: var(--team); }
.cp-mid { grid-area: m; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--card-soft); line-height: 1.05; }
.cp-arrow { font-size: 1.7rem; }
.cp-arrowt { font-size: .8rem; text-align: center; }
.cp-why { font-size: .9rem; font-style: italic; color: var(--card-soft); margin: .3rem 0; }
.cp-hint { margin: .35rem 0; }
.cp-who { font-weight: 700; font-size: 1.1rem; margin: .7rem 0 .35rem; }

/* result buttons: one column per team */
.cp-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.cp-col { display: grid; gap: .3rem; align-content: start; border: 1px solid var(--card-rule); border-top: 5px solid var(--team); border-radius: 8px; padding: .3rem; background: var(--card); min-width: 0; }
.cp-colh { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.15; margin-bottom: .1rem; }
.cp-colnm { font-weight: 700; color: var(--team); overflow-wrap: anywhere; }
.cp-colrole { font-size: .8rem; color: var(--card-soft); }
.cp .cp-res { font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .05rem; min-height: 52px;
  padding: .25rem .2rem; border-radius: 7px; cursor: pointer; text-align: center; line-height: 1.15;
  background: #fbf6ea; color: var(--card-ink); border: 1px solid var(--card-line); }
.cp .cp-res.cp-main { min-height: 64px; background: var(--team); border-color: var(--team); color: #fff; }
.cp-rk { font-weight: 700; }
.cp-main .cp-rk { font-size: 1.2rem; }
.cp-rs { font-size: .8rem; opacity: .9; }
.cp-res:active { transform: translateY(1px); }
.cp-revoke { margin: .6rem 0 0; }
.cp-revoke summary { cursor: pointer; padding: .5rem 0; min-height: 44px; color: var(--card-soft); }
.cp-revrow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.cp-revrow .tl-btn { display: flex; flex-direction: column; align-items: center; gap: .05rem; line-height: 1.15; padding: .3rem .3rem; border-left: 4px solid var(--team); }
.cp-finish { margin-top: .7rem; padding-top: .5rem; border-top: 1px solid var(--card-rule); }
.cp-finish .tl-btn { width: 100%; }
.cp-finish .tl-note { margin: .3rem 0 0; font-size: .88rem; }

/* game over */
.cp-over { border-top: 3px double var(--card-rule); padding-top: .4rem; text-align: center; }
.cp-winner { font-size: 1.5rem; font-weight: 800; margin: .4rem 0 .2rem; }
.cp-sum { color: var(--card-soft); margin: 0 0 .6rem; }
.cp .cp-big { width: 100%; min-height: 52px; }

/* controls, history */
.cp-ctl { margin-top: .9rem; }
.cp-undo { flex: 1; }
.cp-more { margin: .4rem 0 0; border-top: 1px solid var(--card-rule); }
.cp-more summary { cursor: pointer; font-weight: 700; padding: .6rem 0; min-height: 44px; }
.cp-hist { list-style: none; margin: 0; padding: 0; }
.cp-hist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 .5rem; padding: .25rem 0 .25rem .45rem; border-left: 4px solid var(--team); border-bottom: 1px dotted var(--card-rule); font-size: .92rem; }
.cp-hh { font-size: .8rem; color: var(--card-soft); grid-column: 1 / -1; }
.cp-hw b { color: var(--team); }
.cp-hs { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; align-self: end; }

/* setup */
.cp-setup .tl-h { margin-top: .2rem; }
.cp-names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .6rem; }
.cp-names label > span { color: var(--team); font-weight: 700; }
.cp-firstrow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.cp-firstrow .tl-btn { border-left: 4px solid var(--team); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-start { min-width: 8rem; }
