/* ═══ RAMI (Rummy) — Evotic Edge ═══
   Solo vs IA (2-4 joueurs). 52 cartes + 2 jokers, 13 cartes/joueur.
   Séquences (≥3 même couleur) ou brelans/carrés. Premier à tout combiner gagne. */

.rm-stage { display: flex; flex-direction: column; min-height: 0; }

/* Lobby */
.rm-lobby { padding: 28px 20px; text-align: center; }
.rm-lobby h2 { font-size: 20px; font-weight: 900; color: var(--gs-txt); margin: 0 0 14px; }
.rm-lobby p { font-size: 13px; color: var(--gs-txt3); margin: 0 0 22px; }
/* Mode segmenté : Ordinateur / Entre amis */
.rm-mode-seg { display: inline-flex; flex-wrap: wrap; justify-content: center; background: var(--gs-card, #f0ede4); border-radius: 999px; padding: 4px; gap: 4px; margin: 0 auto; }
#rm-online-section { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 6px; }
#rm-online-section .gs-btn { min-width: 220px; }
.rm-mode-btn {
  border: none; background: transparent; color: var(--gs-txt3); font-family: inherit;
  font-size: 13px; font-weight: 800; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s;
}
.rm-mode-btn.active { background: #6A1B9A; color: #fff; }
.rm-mode-hint { font-size: 12.5px; color: var(--gs-txt3); margin: 12px 0 18px; min-height: 16px; }
.rm-count-title { font-size: 14px; font-weight: 800; color: var(--gs-txt); margin: 0 0 12px; }
.rm-count-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.rm-count-btn { width: 86px; height: 92px; border: 2px solid var(--gs-border, #e2d9bf); border-radius: 16px;
  background: var(--gs-card, #fff); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; cursor: pointer; font-family: inherit; transition: transform .12s; }
.rm-count-btn:active { transform: scale(.95); }
.rm-count-btn i { font-size: 24px; color: #6A1B9A; }
.rm-count-btn span { font-size: 13px; font-weight: 800; color: var(--gs-txt); }

/* Opponents */
.rm-players { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 10px 8px; }
.rm-pl { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: var(--gs-card, #fff); border: 1.5px solid transparent; font-size: 12px; font-weight: 800; color: var(--gs-txt); }
.rm-pl.active { border-color: #6750A4; box-shadow: 0 0 0 2px rgba(103, 80, 164,.15); }
.rm-pl i { color: #6A1B9A; }
.rm-pl .rm-badge { background: #6A1B9A; color: #fff; border-radius: 999px; min-width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; padding: 0 5px; }

/* Piles */
.rm-piles { display: flex; gap: 18px; justify-content: center; align-items: center; padding: 10px; }
.rm-pile { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rm-pile-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--gs-txt3); }
.rm-card {
  width: 46px; height: 64px; border-radius: 8px; background: #fff; border: 1.5px solid #cfd2d8;
  box-shadow: 0 2px 4px rgba(0,0,0,.12); display: flex; flex-direction: column; justify-content: space-between;
  padding: 4px 5px; box-sizing: border-box; font-weight: 900; font-size: 15px; flex: 0 0 auto; user-select: none;
}
.rm-card .rm-suit { font-size: 16px; align-self: flex-end; line-height: 1; }
.rm-card.red { color: #D32F2F; }
.rm-card.black { color: #1c1c2e; }
.rm-card.joker { color: #6A1B9A; align-items: center; justify-content: center; font-size: 13px; text-align: center; }
.rm-card.back { background: repeating-linear-gradient(45deg,#6A1B9A,#6A1B9A 6px,#8E24AA 6px,#8E24AA 12px); border-color: #4A148C; }
.rm-card.empty { background: rgba(0,0,0,.04); border: 1.5px dashed #bbb; box-shadow: none; }
.rm-card.btn-card { cursor: pointer; transition: transform .12s; }
.rm-card.btn-card:active { transform: scale(.94); }
.rm-pile-n { font-size: 11px; font-weight: 800; color: var(--gs-txt3); }

/* Status + hint */
.rm-status { text-align: center; font-size: 13px; font-weight: 800; color: var(--gs-txt); padding: 4px 12px; min-height: 18px; }
.rm-status.my-turn { color: #6750A4; }
.rm-hint { text-align: center; font-size: 11px; color: var(--gs-txt3); font-weight: 700; padding: 0 12px 4px; }

/* Hand */
.rm-hand-wrap { padding: 6px 0 4px; margin-top: auto; }
.rm-hand-label { display: flex; justify-content: space-between; align-items: center; padding: 0 12px 4px; }
.rm-hand-label span { font-size: 11px; font-weight: 800; color: var(--gs-txt3); text-transform: uppercase; letter-spacing: .5px; }
.rm-sort { font-size: 11px; font-weight: 800; color: #6A1B9A; background: none; border: none; cursor: pointer; font-family: inherit; }
.rm-hand { display: flex; gap: 4px; overflow-x: auto; padding: 6px 12px 14px; -webkit-overflow-scrolling: touch; }
.rm-hand .rm-card { width: 44px; height: 62px; }
.rm-hand .rm-card.discardable { cursor: pointer; box-shadow: 0 0 0 2px #6750A4, 0 2px 4px rgba(0,0,0,.12); }
.rm-hand .rm-card.discardable:active { transform: translateY(-4px); }

.rm-actions { display: flex; gap: 10px; justify-content: center; padding: 6px 10px 12px; flex-wrap: wrap; }

@media (max-width: 360px) {
  .rm-hand .rm-card { width: 38px; height: 54px; font-size: 13px; }
}
