/* Player cards: identity, equal-weight metrics, cosmetic hand, visible clock. */
#screen-game #playerRail .pchip {--seat-stat:14px;}
#screen-game #playerRail .pchip .pchip-meta {column-gap:9px!important;row-gap:3px!important;}
#screen-game #playerRail .pchip .pchip-score,#screen-game #playerRail .pchip .pchip-card-count {display:inline-flex;align-items:baseline;gap:3px;font:600 var(--seat-stat)/1.15 var(--ui-display)!important;white-space:nowrap;}
#screen-game #playerRail .pchip .pchip-score[hidden] {display:none!important;}
#screen-game #playerRail .pchip .pchip-score>strong,#screen-game #playerRail .pchip .pchip-card-count>strong {font:700 var(--seat-stat)/1 var(--ui-display)!important;font-variant-numeric:tabular-nums;}
#screen-game #playerRail .pchip :is(.pchip-score,.pchip-card-count)>small {font:500 10px/1 var(--ui-display)!important;color:var(--chrome-muted);}
#screen-game #playerRail .pchip .pchip-score>strong {color:var(--gold-ink);}
#screen-game #playerRail .pchip.has-turn-hud.has-clock {grid-template-columns:32px minmax(0,1fr) auto 41px!important;}
#screen-game #playerRail .pchip .pchip-turn-hud {width:41px!important;max-width:41px!important;height:46px!important;margin-left:0!important;gap:4px!important;}
#screen-game #playerRail .pchip .pchip-timer {width:34px!important;height:34px!important;min-width:34px!important;max-width:34px!important;min-height:34px!important;max-height:34px!important;flex-basis:34px!important;}
#screen-game #playerRail .pchip .pchip-timer-seconds {font-size:15px!important;font-weight:700!important;}
#screen-game #playerRail .pchip .pchip-timer-bar::after {inset:4px!important;background:var(--chrome-raised-2)!important;}
#screen-game #playerRail .pchip .pchip-timer-seconds {color:var(--cream)!important;}
#screen-game #playerRail .pchip .pchip-timer.critical {animation:none!important;}
@container(min-width:1150px){
 #screen-game #playerRail .pchip {--seat-stat:16px;}
 #screen-game #playerRail .pchip.has-turn-hud.has-clock {grid-template-columns:44px minmax(0,1fr) auto 41px!important;}
}
@container(min-width:1300px){
 #screen-game #playerRail .pchip {--seat-stat:18px;}
 #screen-game #playerRail .pchip.has-turn-hud.has-clock {grid-template-columns:50px minmax(0,1fr) auto 41px!important;}
}
@media(min-width:761px) and (max-width:1200px){
 #screen-game #playerRail .pchip.has-turn-hud.has-clock {grid-template-columns:25px minmax(0,1fr) 34px!important;}
 #screen-game #playerRail .pchip .pchip-turn-hud {width:34px!important;max-width:34px!important;height:38px!important;}
 #screen-game #playerRail .pchip .pchip-timer {width:29px!important;height:29px!important;min-width:29px!important;max-width:29px!important;min-height:29px!important;max-height:29px!important;flex-basis:29px!important;}
 #screen-game #playerRail .pchip .pchip-timer-seconds {font-size:13px!important;}
}
@media(max-width:760px){
 #screen-game #playerRail .pchip {--seat-stat:12px;}
 #screen-game #playerRail .pchip .pchip-meta {column-gap:6px!important;}
 #screen-game #playerRail .pchip :is(.pchip-score,.pchip-card-count)>small {font-size:9px!important;}
 #screen-game #playerRail .pchip.has-turn-hud.has-clock,#screen-game #playerRail:not([data-players="2"]) .pchip.is-me.has-clock {grid-template-columns:26px minmax(0,1fr) 27px!important;}
 #screen-game #playerRail .pchip .pchip-turn-hud {width:27px!important;max-width:27px!important;height:36px!important;gap:3px!important;}
 #screen-game #playerRail .pchip .pchip-timer {width:26px!important;height:26px!important;min-width:26px!important;max-width:26px!important;min-height:26px!important;max-height:26px!important;flex-basis:26px!important;}
 #screen-game #playerRail .pchip .pchip-timer-seconds {font-size:12px!important;}
 #screen-game #playerRail .pchip .pchip-timer-bar::after {inset:3px!important;}
}
@media(pointer:coarse) and (min-width:600px) and (min-height:560px){
 #screen-game #playerRail .pchip {--seat-stat:17px;}
 #screen-game #playerRail :is(.pchip,.pchip.is-me).has-clock {grid-template-columns:36px minmax(0,1fr) 34px!important;}
 #screen-game #playerRail .pchip .pchip-turn-hud {width:34px!important;max-width:34px!important;height:38px!important;}
 #screen-game #playerRail .pchip .pchip-timer {width:30px!important;height:30px!important;min-width:30px!important;max-width:30px!important;min-height:30px!important;max-height:30px!important;flex-basis:30px!important;}
 #screen-game #playerRail .pchip .pchip-timer-seconds {font-size:14px!important;}
 #screen-game #playerRail .tablet-hand-caption>strong {font-size:17px!important;}
}
/* A hovered table card keeps the same paint order as the hand. */
#tableMelds .mini-card-slot {isolation:auto;transition:transform .18s cubic-bezier(.2,.75,.25,1);}
@media(hover:hover) and (pointer:fine){#tableMelds .mini-card-slot:hover {transform:translateY(-4px) scale(1.045);}}
/* Fixed tracks keep the controls under the pointer, even for an empty hand.
   Long hands pan horizontally rather than growing another row. */
#modal-round .round-hand-viewer {display:grid;grid-template-rows:38px 126px 44px;gap:8px;padding:12px;min-width:0;overflow:hidden;}
#modal-round .round-hand-viewer-head {height:38px;margin:0!important;min-width:0;align-items:center;}
#modal-round .round-hand-viewer-head>strong {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#modal-round .round-hand-penalty {flex:0 0 auto;}
#modal-round .round-hand-cards-large {height:126px;min-height:126px;max-height:126px;display:flex;flex-wrap:nowrap!important;align-items:center;justify-content:safe center;overflow-x:auto!important;overflow-y:hidden!important;box-sizing:border-box;padding:6px 8px 10px;overscroll-behavior-x:contain;scrollbar-width:thin;}
#modal-round .round-empty-hand {height:100%;min-height:0;margin:0;}
#modal-round .round-hand-nav {height:44px;margin:0!important;gap:18px;}
#modal-round .round-hand-arrow {width:44px;height:40px;flex:0 0 44px;}
#modal-round .round-hand-counter {width:70px;font-variant-numeric:tabular-nums;}
#modal-round .round-hand-viewer:focus-visible {outline:2px solid var(--gold);outline-offset:3px;}
@media(max-width:760px){
 #modal-round .round-hand-viewer {grid-template-rows:34px 112px 44px;padding:9px;gap:6px;}
 #modal-round .round-hand-viewer-head {height:34px;gap:8px;}
 #modal-round .round-hand-cards-large {height:112px;min-height:112px;max-height:112px;padding:5px 5px 9px;}
 #modal-round .round-result-card.card {width:64px!important;height:92px!important;}
 #modal-round .round-hand-arrow {height:44px;}
}
@media(prefers-reduced-motion:reduce){#tableMelds .mini-card-slot {transition:none!important;}}
/* A short fan reads as one hand and frees room for both metrics. */
#screen-game #playerRail .pchip .opponent-hand {gap:0!important;}
#screen-game #playerRail .pchip .opponent-back+.opponent-back,#screen-game #playerRail .pchip .opponent-card-stack {margin-left:-6px!important;}
#screen-game #playerRail .pchip .pchip-meta {flex-wrap:wrap!important;}
@media(max-width:760px){
 #screen-game #playerRail .pchip:not(.is-me) .pchip-meta>.pchip-card-count {display:none!important;}
 #screen-game #playerRail .pchip:not(.is-me) .pchip-score>small {display:none!important;}
 #screen-game #playerRail .pchip:not(.is-me) .tablet-hand-caption {display:flex!important;flex:0 0 auto;flex-direction:column;align-items:center;gap:2px;min-width:24px;margin-left:5px;padding-left:5px;border-left:1px solid var(--chrome-border-strong);font:500 8px/1 var(--ui-display);color:var(--chrome-muted);}
 #screen-game #playerRail .pchip:not(.is-me) .tablet-hand-caption>strong {font:700 12px/1 var(--ui-display)!important;color:var(--cream);}
 #screen-game #playerRail .pchip:not(.is-me) .tablet-hand-caption>small {font:inherit;}
}
@media(max-height:720px){
 #modal-round .modal {padding:16px!important;}
 #modal-round .section-title {font-size:24px!important;line-height:1.2!important;padding-block:0!important;margin:0 0 10px!important;}
 #modal-round .round-scoreboard .row {padding-block:3px;font-size:16px;}
}

#screen-game #playerRail .pchip .pchip-turn-hud.is-idle {width:28px!important;max-width:28px!important;}
@media(max-width:760px){#screen-game #playerRail .pchip .pchip-turn-hud.is-idle {width:21px!important;max-width:21px!important;}}
/* On a narrow desktop rail (including open chat), use the same two-tier
   organization as tablets instead of squeezing names between deck and clock. */
@media(pointer:fine) and (min-width:761px){@container(max-width:1149px){
 body #screen-game #playerRail[data-players] :is(.pchip,.pchip.is-me) {--seat-stat:14px;grid-template-columns:32px minmax(0,1fr) 34px!important;grid-template-rows:32px 36px!important;height:90px!important;min-height:90px!important;padding:6px!important;gap:3px 6px!important;}
 body #screen-game #playerRail[data-players] .pchip .pchip-av {width:32px!important;height:32px!important;min-width:32px!important;max-width:32px!important;}
 body #screen-game #playerRail[data-players] .pchip .pchip-body {grid-column:2!important;grid-row:1!important;gap:2px!important;}
 body #screen-game #playerRail[data-players] .pchip .pchip-name {font-size:13px!important;}
 body #screen-game #playerRail[data-players] .pchip .pchip-card-count {display:none!important;}
 body #screen-game #playerRail[data-players] .pchip .pchip-turn-hud {grid-column:3!important;grid-row:1!important;width:34px!important;max-width:34px!important;height:36px!important;gap:3px!important;}
 body #screen-game #playerRail[data-players] .pchip .pchip-timer {width:29px!important;height:29px!important;min-width:29px!important;max-width:29px!important;min-height:29px!important;max-height:29px!important;flex-basis:29px!important;}
 body #screen-game #playerRail[data-players] .pchip .pchip-timer-seconds {font-size:13px!important;}
 body #screen-game #playerRail[data-players] .pchip .opponent-hand {grid-column:1/-1!important;grid-row:2!important;justify-content:center!important;height:36px!important;}
 body #screen-game #playerRail[data-players] .pchip .opponent-back,body #screen-game #playerRail[data-players] .pchip .opponent-card-stack {width:23px!important;height:33px!important;flex-basis:23px!important;}
 body #screen-game #playerRail[data-players] .pchip .opponent-card-stack>b {font-size:13px;}
 body #screen-game #playerRail[data-players] .pchip .tablet-hand-caption {display:flex!important;flex:0 0 auto;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:30px;margin-left:7px;padding-left:8px;border-left:1px solid var(--chrome-border-strong);font:500 9px/1 var(--ui-display);color:var(--chrome-muted);}
 body #screen-game #playerRail[data-players] .pchip .tablet-hand-caption>strong {font:700 14px/1 var(--ui-display);color:var(--cream);}
 body #screen-game #playerRail[data-players] .pchip .tablet-hand-caption>small {font:inherit;}
}}

#screen-game #playerRail .pchip .pchip-score::after {content:none!important;display:none!important;}
