/* Monte Carlo (pairing patience) board — same green-baize texture as the other
   Réussites (per-game texture allowed, ARCHITECTURE.md §6), scoped under
   .mc-root. A 5x5 grid (CSS grid) of cards, with the stock + a Consolidate
   button below. Reuses the shared card SVGs. */

.mc-root {
  --felt: #1b6b49; --felt-hi: #2a7f5b; --gold: #d8b65c;
  --line: rgba(253, 252, 247, 0.22);
  --cw: 56px;
  --ch: calc(var(--cw) * 1.45);
  --gap: calc(var(--cw) * 0.14);
  --r: calc(var(--cw) * 0.05);
  position: relative;
  padding: clamp(12px, 3vw, 26px) clamp(6px, 2vw, 18px);
  border-radius: var(--radius-md);
  background: var(--felt);
  background-image: radial-gradient(ellipse 82% 70% at 50% 24%, var(--felt-hi), var(--felt) 74%);
  color: #eaf3ed; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(20, 17, 14, 0.25), var(--shadow-sm);
}
@media (prefers-color-scheme: dark) { .mc-root { --felt: #144d36; --felt-hi: #1d6046; } }
.mc-root.mode-dark { --felt: #144d36; --felt-hi: #1d6046; }

.mc-board { position: relative; margin: 0 auto; width: fit-content; max-width: 100%; }

.mc-grid {
  display: grid;
  grid-template-columns: repeat(5, var(--cw));
  grid-auto-rows: var(--ch);
  gap: var(--gap);
  justify-content: center;
  margin: 0 auto;
}

.mc-cell { width: var(--cw); height: var(--ch); border-radius: var(--r); }
.mc-empty { border: 1.5px dashed var(--line); background: rgba(0, 0, 0, 0.08); }

.mc-root .card {
  position: relative; width: var(--cw); height: var(--ch); border-radius: var(--r);
  user-select: none; touch-action: manipulation;
  box-shadow: 0 -1px 0 rgba(20, 17, 14, 0.16), 0 -3px 6px rgba(0, 0, 0, 0.2), 0 2px 3px rgba(0, 0, 0, 0.12);
}
.mc-root .cf { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; display: block; object-fit: fill; z-index: 2; border-radius: var(--r); }

/* grid cards are always clickable; the selected card lifts and glows, and the
   equal-rank neighbours it could pair with get a gold ring. */
.mc-grid .mc-card { cursor: pointer; }
.mc-grid .mc-card:hover { transform: translateY(-2px); }
.mc-grid .mc-card.mc-sel { box-shadow: 0 0 0 3px var(--gold), 0 4px 12px rgba(0, 0, 0, 0.35); transform: translateY(-3px); z-index: 30; }
.mc-grid .mc-card.mc-play { box-shadow: 0 0 0 2px var(--gold), 0 2px 8px rgba(0, 0, 0, 0.3); }
.mc-root .card.mc-hint { outline: 3px solid var(--gold); outline-offset: 1px; z-index: 40; animation: mc-hint 0.6s ease-in-out 2; }

.mc-foot { display: flex; align-items: center; gap: clamp(12px, 4vw, 30px); margin-top: clamp(12px, 3vw, 24px); flex-wrap: wrap; }
.mc-slot { position: relative; width: var(--cw); height: var(--ch); border-radius: var(--r); border: 1.5px solid var(--line); }
.mc-stock.empty { opacity: 0.5; }
.mc-stock .card { position: absolute; inset: 0; }
.mc-count { position: absolute; inset-block-end: 3px; inset-inline-end: 4px; z-index: 5; font-size: calc(var(--cw) * 0.24); font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }

.mc-deal {
  appearance: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 0.92rem;
  padding: 0.5em 1.1em; border-radius: 999px; color: #1a140a;
  border: 1px solid rgba(216, 182, 92, 0.7); background: var(--gold);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.mc-deal:hover:not(:disabled) { filter: brightness(1.06); }
.mc-deal:disabled { cursor: default; opacity: 0.4; }
.mc-deal.mc-hint { outline: 3px solid var(--gold); outline-offset: 2px; animation: mc-hint 0.6s ease-in-out 2; }

.mc-msg { margin-left: auto; font-size: 0.92rem; opacity: 0.9; align-self: center; }

.mc-sound {
  position: absolute; inset-block-start: 4px; inset-inline-end: 4px; z-index: 55;
  inline-size: 30px; block-size: 30px; border-radius: 50%; padding: 0;
  border: 1px solid rgba(253, 252, 247, 0.22); background: rgba(0, 0, 0, 0.18);
  color: #eaf3ed; font-size: 15px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; opacity: 0.65;
}
.mc-sound:hover { opacity: 1; }
.mc-sound.on { background: rgba(216, 182, 92, 0.22); border-color: rgba(216, 182, 92, 0.5); opacity: 1; }

@keyframes mc-hint { 0%, 100% { outline-color: var(--gold); } 50% { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .mc-grid .mc-card:hover, .mc-grid .mc-card.mc-sel { transform: none; }
  .mc-root .card.mc-hint, .mc-deal.mc-hint { animation: none; }
}
