/* Gin rummy (js/games/gin-rummy.js). The table and cards are Solitaire's
 * (css/games/solitaire.css, loaded with this file). */

.gr-room .sc-slot[data-pile] { cursor: pointer; }
.gr-room .sc-slot[hidden] { display: none; }
/* the pile glows softly when a lifted card can go there */
.gr-room .sc-slot.gr-drop { border-style: dashed; border-color: var(--accent); }

/* meld bars: a coloured bar under every card in a meld (one colour per meld) */
.gr-room .sc-card::after {
  content: ''; position: absolute; left: 8%; right: 8%; top: calc(100% + var(--cw, 80px) * .045);
  height: calc(var(--cw, 80px) * .075); min-height: 4px; border-radius: 99px; background: transparent; pointer-events: none;
}
.gr-room .sc-card.gr-m0::after { background: var(--toy-blue); }
.gr-room .sc-card.gr-m1::after { background: var(--toy-butter); }
.gr-room .sc-card.gr-m2::after { background: var(--toy-pink); }
.gr-room .sc-card.gr-m3::after { background: var(--toy-mint); }
.gr-room .sc-card.gr-lo::after { background: none; border: 2px dashed var(--ink-muted); box-sizing: border-box; }
.gr-room .sc-card.is-down::after { display: none; }
/* the card you just took */
.gr-room .sc-card.gr-new:not(.sc-picked):not(.sc-hint) { box-shadow: 0 0 0 3px var(--toy-butter), 0 6px 16px rgba(0, 0, 0, .3); }
.gr-room .sc-card.gr-gone { opacity: 0; pointer-events: none; }
.gr-room .sc-anim .sc-card { transition: transform .26s cubic-bezier(.2, .8, .3, 1), opacity .2s ease; }

/* texts on the table */
.gr-who, .gr-note, .gr-status { position: absolute; margin: 0; z-index: 0; pointer-events: none; text-align: center; line-height: 1.35; max-width: none; }
.gr-who, .gr-note { font-size: .85rem; color: var(--ink-muted); }
.gr-status { font-size: 1rem; color: var(--ink); }
.gr-status[hidden], .gr-note[hidden], .gr-info[hidden] { display: none; }

/* deadwood and the Knock button */
.gr-info { position: absolute; z-index: 300; display: flex; align-items: center; justify-content: center; gap: var(--space-3); }
.gr-next { white-space: nowrap; }
.gr-dw { margin: 0; font-size: 1.05rem; color: var(--ink); white-space: nowrap; }
.gr-dw b { font-size: 1.9rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-left: .3rem; vertical-align: -.12em; }
.gr-knock[aria-disabled="true"] { opacity: .5; }
.gr-knock.gr-ready { border-color: var(--ink); }
.gr-knock.gr-hinted { box-shadow: 0 0 0 3px var(--accent), 0 0 0 8px color-mix(in srgb, var(--accent) 30%, transparent); }
.gr-over .gr-knock { display: none; }

/* the end of a hand: the summary in the status line, Next hand beside your deadwood */
.gr-over .gr-status { z-index: 300; }
.gr-score { display: block; margin-top: var(--space-2); color: var(--ink-muted); }
.gr-score b { color: var(--ink); font-variant-numeric: tabular-nums; }
.gr-score span { white-space: nowrap; }
.gr-info .btn[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) { .gr-room .sc-anim .sc-card { transition: none; } }

/* keyboard: the stock and the pile show the ring above their cards; a focused card comes to the front */
.gr-room .sc-slot:focus { outline: none; }
.gr-room .sc-slot:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; z-index: 150; background: transparent; border-color: transparent; }
.gr-room .sc-card:focus { outline: none; }
.gr-room .sc-card:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; z-index: 8000 !important; }
