/* Rummy (Indian Rummy, 13 cards). The table is 3-patti's (body.patti-mode):
   seats, the deck over the joker card and the playing stack come from
   styles.css. These rules cover the printed joker, seat totals, a hand of 13
   or 14 cards, and the grouped hands in a deal's result. */
.rummy-tile .game-tile-art{background:radial-gradient(ellipse at 40% 22%,#6fd3c69e,transparent 64%),linear-gradient(145deg,#1f8f8e,#1b6f80 62%,#4a4f73)}
.rm-tile-art{position:absolute;left:50%;top:50%;width:256px;height:160px;transform:translate(-50%,-50%)}
.rm-tile-art .playing-card{position:absolute;margin:0;width:88px;height:126px;box-shadow:0 8px 16px #00000026}
.rm-tile-card.one{left:20px;top:16px;transform:rotate(-14deg)}
.rm-tile-card.two{left:62px;top:6px;transform:rotate(-5deg)}
.rm-tile-card.three{left:104px;top:4px;transform:rotate(4deg)}
.rm-tile-card.four{left:148px;top:12px;transform:rotate(13deg)}
@media (max-width:580px){.rm-tile-art{transform:translate(-50%,-50%) scale(.9)}}
.rm-rules-card h2{font-size:1.5rem}

/* A printed joker: a red star and the word Joker. */
.playing-card.simple-card.rm-joker{background:linear-gradient(160deg,#fffdf5,#f5e8cb)}
.rm-joker .card-value{color:#b5362c}
.simple-card.rm-joker .card-suit{font:800 clamp(8px,16cqw,20px)/1 system-ui,sans-serif;letter-spacing:.02em;color:#6b4a6e;margin-top:10%}

/* Seats: the card fan with the player's total, or Dropped / Out. */
.rm-seats .seat-hand{display:flex;align-items:flex-end;justify-content:center;gap:5px}
.rm-total{font-size:.68rem;font-weight:800;line-height:1;padding:2px 5px;border-radius:8px;background:#003f5866;color:#fff4cf;font-variant-numeric:tabular-nums}
.rm-status{display:inline-block;padding:2px 7px;border-radius:9px;background:#003f5866;color:#e9dcc0;font-size:.64rem;font-weight:800;white-space:nowrap}
.table-orbit .seat-circle .player-seat.rm-sitting-out .name,.table-orbit .seat-circle .player-seat.rm-sitting-out .seat-hand{opacity:.62}
.rm-deal-note{position:absolute;left:14px;bottom:10px;margin:0;font-size:.7rem;color:#e7f6ee;opacity:.85;pointer-events:none}
.in-game .rm-deal-note{left:10px;bottom:6px;font-size:.62rem}

/* A hand of 13 or 14: each button is the exposed strip of its card, narrower
   as the row fills, scrolling once even that no longer fits. */
.rm-hand .hand-cards{container-type:inline-size;overflow-x:auto;overflow-y:visible;scrollbar-width:thin}
.rm-hand .hand-fan,body.patti-mode.in-game .rm-hand .hand-fan{width:max-content;min-width:100%;margin:0 auto;justify-content:safe center}
.rm-hand.hand-area .hand-fan{--step:max(calc(var(--hand-card-width) * .22),min(calc(var(--hand-card-width) * .47),calc((100cqw - var(--hand-card-width) - 20px) / max(1, var(--n) - 1))))}
.rm-hand.hand-area .hand-fan .card-button{--fan-angle:0deg;--fan-offset:0px;width:var(--step);min-width:var(--step);flex:0 0 var(--step)}
.rm-hand.hand-area .hand-fan .card-button:last-child{width:var(--hand-card-width);min-width:var(--hand-card-width);flex-basis:var(--hand-card-width)}
.rm-hand .hand-fan .simple-card .card-value{font-size:min(32cqw,calc(var(--step) * .8));margin-left:6%}
.rm-hand .hand-fan .simple-card .card-suit{font-size:min(34cqw,calc(var(--step) * .8));margin-left:6%}
.rm-hand .hand-fan .simple-card.rm-joker .card-suit{font-size:min(15cqw,calc(var(--step) * .34))}
.rm-hand .card-button.selected{transform:translateY(-14px);z-index:60}
.rm-hand .card-button .joker-tag{font-size:.55rem;padding:2px 4px;left:3px;right:auto;bottom:10%}
/* The card just taken from the open pile: a still gold edge until the turn ends. */
.rm-hand .card-button.rm-fresh .playing-card{box-shadow:inset 0 5px 0 #e0a62c,0 0 0 2px #e0a62c}
body.patti-mode.in-game .rm-hand .hand-cards{overflow-x:auto;overflow-y:hidden;padding-top:16px;margin-top:-16px}
/* A phone holds thirteen or fourteen cards across, so Rummy's cards are
   narrower than 3-patti's three; the table takes the height they leave. */
@media (max-width:580px) and (orientation:portrait){body.patti-mode.rummy-mode.in-game{--patti-card:clamp(62px,calc(10.5dvh - 4px),80px)}}
@media (max-width:580px) and (orientation:portrait) and (max-height:620px){body.patti-mode.rummy-mode.in-game{--patti-card:clamp(56px,calc(10dvh - 4px),70px)}}
/* A landscape phone's hand sits in a narrow column beside the table. */
@media (orientation:landscape) and (min-width:568px) and (max-height:650px){body.patti-mode.rummy-mode.in-game .rm-hand .hand-cards{--hand-card-width:68px;--hand-card-height:calc(68px * 1.4)}}
@media (prefers-reduced-motion:reduce){.rm-hand .card-button.selected{transform:translateY(-8px)}}

/* Card flights and a discard waiting to land. */
.rm-flight{position:absolute;left:0;top:0;will-change:transform,opacity}
.rm-flight .playing-card{width:100%;height:100%;margin:0}
.rm-in-flight{visibility:hidden}

/* A deal's result: each hand in its sequences and sets, each group named. */
.rm-result .result-hands{grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr))}
.rm-groups{display:flex;flex-wrap:wrap;align-items:flex-start;gap:10px 12px;margin:6px 0 4px}
.rm-group{display:grid;justify-items:start;gap:3px}
.rm-group .revealed-cards{display:flex;flex-wrap:nowrap;margin:0}
.rm-group .revealed-cards .playing-card{margin:0}
.rm-group .revealed-cards .playing-card+.playing-card{margin-left:-22px}
.rm-group-name{font-size:.66rem;font-weight:800;letter-spacing:.03em;text-transform:uppercase;color:#52614e}
.rm-group-pure .rm-group-name{color:#1d6b3a}
.rm-group-out .rm-group-name{color:#9a3a2c}
.rm-group-out .revealed-cards{opacity:.85}
.audience-board .rm-group-name{font-size:.8rem}
