/* Russian Solitaire board — the same "green baize" texture as the Yukon board,
   matted inside the shell's editorial page (ARCHITECTURE.md §6 allows a per-game
   texture as long as it honours mode / colorBlind / reducedMotion). All selectors
   are scoped under .rus-root so nothing leaks into the shell chrome. */

.rus-root {
  --felt: #1b6b49;
  --felt-hi: #2a7f5b;
  --paper: #fdfcf7;
  --ink: #14110e;
  --madder: #c0182b;   /* refusal / red suits — the board's semantic red */
  --gold: #d8b65c;
  --line: rgba(253, 252, 247, 0.22);
  --cw: clamp(40px, 11.6vw, 84px);
  --ch: calc(var(--cw) * 1.45);
  --gap: clamp(5px, 1.4vw, 12px);
  --r: calc(var(--cw) * 0.041); /* matches the corner radius baked into the card SVGs */

  position: relative;
  padding: clamp(12px, 3vw, 26px) clamp(8px, 2.4vw, 22px);
  border-radius: var(--radius-md);
  background: var(--felt);
  background-image: radial-gradient(ellipse 80% 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);
}

/* Dark mode: deepen the baize a touch; card faces stay the lightest surface. */
@media (prefers-color-scheme: dark) {
  .rus-root { --felt: #144d36; --felt-hi: #1d6046; }
}
.rus-root.mode-dark { --felt: #144d36; --felt-hi: #1d6046; }

.rus-board {
  max-width: calc(var(--cw) * 7 + var(--gap) * 6);
  margin: 0 auto;
  position: relative;
}
.rus-top {
  display: grid;
  grid-template-columns: repeat(7, var(--cw));
  gap: var(--gap);
  margin-bottom: calc(var(--gap) * 1.7);
}
.rus-slot {
  width: var(--cw);
  height: var(--ch);
  border-radius: var(--r);
  border: 1.5px solid var(--line);
  position: relative;
  display: grid;
  place-items: center;
  color: rgba(253, 252, 247, 0.24);
  font-size: calc(var(--cw) * 0.44);
}
.rus-cols {
  display: grid;
  grid-template-columns: repeat(7, var(--cw));
  gap: var(--gap);
}
.rus-pile {
  position: relative;
  min-height: var(--ch);
  width: var(--cw);
}
.rus-pile > .rus-base {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--ch);
  border-radius: var(--r);
  border: 1.5px solid var(--line);
}

/* Left-handed layout (variant "gaucher", if enabled): mirror the top row. */
.rus-root.hand-left .rus-top { direction: rtl; }
.rus-root.hand-left .rus-top > * { direction: ltr; }

.rus-root .card {
  position: absolute;
  left: 0;
  width: var(--cw);
  height: var(--ch);
  /* The face SVG is the whole card (its own rounded ground + hairline border),
     so the card neither fills nor clips — that would nibble the SVG corners.
     border-radius is kept only so the drop shadow follows the card silhouette. */
  border-radius: var(--r);
  color: var(--ink);
  user-select: none;
  touch-action: none;
  box-shadow: 0 -1px 0 rgba(20, 17, 14, 0.16), 0 -4px 7px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.12);
  transition: top 0.17s cubic-bezier(0.2, 0.7, 0.3, 1), left 0.17s cubic-bezier(0.2, 0.7, 0.3, 1);
}
/* Both faces and the back are one full-card SVG image (its own rounded ground +
   black die-cut outline). Aspect matches the card, so object-fit: fill is exact. */
.rus-root .cf {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
  object-fit: fill;
  z-index: 2;
}
.rus-root .card.lift {
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.16), 0 14px 28px rgba(0, 0, 0, 0.38);
}
/* Hint: flash the suggested card with a gold ring. */
.rus-root .card.hint {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
  border-radius: var(--r);
  z-index: 40;
  animation: rus-hint 0.6s ease-in-out 2;
}
@keyframes rus-hint { 0%, 100% { outline-color: var(--gold); } 50% { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .rus-root .card.hint { animation: none; } }

.rus-drag {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 50;
}
.rus-drag .card { transition: none; }

.rus-win {
  position: absolute;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .rus-root .card { transition: none; }
}
.rus-root.no-motion .card { transition: none; }
