/*
 * guide.css — Gin Rummy variant geometry on top of _shared/base.css. Shares the
 * top-level Rummy guide's table/play-screen classes (kept in sync by copy) and
 * adds Gin's own pieces: the concealed grouped hand, the live deadwood chip and
 * the worked scoring cases. Only layout/shape lives here; every colour comes
 * from the --gc-* theme variables. All card faces/backs are REAL images
 * resolved via the data-card contract (GUIDE_REVIEW_STANDARD §10).
 */

/* A meld: distinct cards side by side (small gap, no fan overlap). */
.rm-minimeld {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border-radius: 10px;
}

/* Two melds side by side (a set and a run) with breathing room. */
.rm-melds {
  display: flex;
  gap: clamp(10px, 4vw, 22px);
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

/* A horizontal scene: melds, arrows and single cards in a row. */
.rm-scene,
.rm-midrow,
.rm-opporow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(10px, 4vw, 22px);
  width: 100%;
}

/* Melds stacked vertically (the table area of the play screen). */
.rm-meldstack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Flow arrows between scene steps. */
.rm-arrow {
  font-size: clamp(20px, 6vw, 28px);
  font-weight: 800;
  color: var(--gc-accent);
  flex: 0 0 auto;
}

/* Highlight states mirrored from the real play view. */
.rm-ring-gold { outline: 3px solid var(--gc-warning); outline-offset: 2px; }
.rm-ring-blue { outline: 3px solid var(--gc-accent); outline-offset: 2px; }
.rm-ring-dash {
  outline: 2px dashed var(--gc-accent);
  outline-offset: 3px;
  border-radius: 10px;
}
.rm-dim { opacity: 0.5; }

/* Contrast-frame captions (the ace rule). */
.rm-vs-label {
  margin: 6px 0 0;
  font-size: 13px;
  text-align: center;
}

/* ---- The play screen mock ---- */

.rm-screen { gap: 12px; }

.rm-avatar {
  font-size: 24px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--gc-text) 12%, transparent);
  border: 2px solid var(--gc-border);
}
.rm-oppo-hand { display: inline-flex; }
.rm-oppo-hand .gc-cardimg { width: calc(var(--gc-card-w) * 0.5); }
.rm-oppo-hand .gc-cardimg + .gc-cardimg { margin-left: calc(var(--gc-card-w) * -0.3); }

/* Opponent's running penalty total (warning tone = counts against them). */
.rm-penalty {
  font-size: 14px;
  font-weight: 800;
  color: var(--gc-warning);
  font-variant-numeric: tabular-nums;
}

/* The coaching turn banner. */
.rm-banner {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gc-accent);
  text-align: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gc-text) 8%, transparent);
  max-width: 100%;
}

/* Owner tag beside a table meld ("yours" / a rival's name). */
.rm-owner {
  font-size: 11px;
  color: color-mix(in srgb, var(--gc-text) 65%, transparent);
  padding-left: 6px;
  white-space: nowrap;
}

/* A labelled slot (deck / discard) in the middle row. */
.rm-slotlabel {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.rm-caption {
  font-size: 11px;
  color: color-mix(in srgb, var(--gc-text) 65%, transparent);
}
.rm-mytotal {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-variant-numeric: tabular-nums;
  color: var(--gc-warning);
  font-size: 15px;
}

/* Action bar with schematic buttons (labels are i18n). */
.rm-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rm-btn {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--gc-bg);
  background: var(--gc-accent);
  white-space: nowrap;
}
.rm-btn.secondary {
  color: var(--gc-text);
  background: color-mix(in srgb, var(--gc-text) 12%, transparent);
  border: 1px solid var(--gc-border);
}

/* ---- The match score line (penalties accumulate, lowest wins) ---- */

.rm-line {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.rm-line-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rm-line-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  min-width: 74px;
}
.rm-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--gc-text) 35%, transparent);
}
.rm-dot.mine { background: var(--gc-accent); }
.rm-chip {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--gc-text) 10%, transparent);
  border: 1px solid var(--gc-border);
}
/* The total that crossed the target — the rival's losing line. */
.rm-chip-out {
  color: var(--gc-warning);
  border-color: var(--gc-warning);
}
.rm-trophy { font-size: 18px; }
.rm-flag {
  font-size: 12px;
  font-weight: 700;
  color: var(--gc-warning);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- The full-round sequence strip ---- */

.rm-seq {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
.rm-seq-step {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  max-width: 150px;
}
.rm-seq-cap {
  font-size: 11.5px;
  line-height: 1.3;
  text-align: center;
  color: color-mix(in srgb, var(--gc-text) 75%, transparent);
}

/* ---- Gin-only additions ---- */

/* A concealed hand laid out as grouped melds + loose deadwood. */
.gn-hand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(8px, 3vw, 16px);
  width: 100%;
}
/* Matched groups read as settled; loose cards read as the count against you. */
.gn-matched {
  outline: 2px solid color-mix(in srgb, var(--gc-success) 70%, transparent);
  outline-offset: 2px;
}
.gn-loose {
  outline: 2px dashed var(--gc-warning);
  outline-offset: 2px;
}

/* Opponent / own running POINTS (higher is better in Gin — accent tone). */
.gn-points {
  font-size: 14px;
  font-weight: 800;
  color: var(--gc-accent);
  font-variant-numeric: tabular-nums;
}
.gn-mytotal {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-variant-numeric: tabular-nums;
  color: var(--gc-accent);
  font-size: 15px;
}

/* The live deadwood chip from the real play view. */
.gn-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gc-text) 8%, transparent);
  border: 1px solid var(--gc-border);
}
/* Green once the hand is at or below the knock line. */
.gn-chip.is-knockable {
  color: var(--gc-success);
  border-color: var(--gc-success);
}
.gn-chip-sep { opacity: 0.5; }

/* The three worked scoring cases, stacked. */
.gn-cases {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.gn-case {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.gn-case-tag {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--gc-text) 65%, transparent);
}

/* The play-screen fan: a gentle overlap so a selected (raised) card stays
 * fully legible — the real view lifts the selection the same way. */
.rm-screen .gc-cardrow { --overlap: calc(var(--gc-card-w) * -0.18); }
