/* Solitaire board — the game's own "green baize" texture, 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 .sol-root so nothing leaks into the shell chrome. Ported from the board
   portion of references/solitaire-final.html. */

.sol-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) {
  .sol-root { --felt: #144d36; --felt-hi: #1d6046; }
}
.sol-root.mode-dark { --felt: #144d36; --felt-hi: #1d6046; }

.sol-board {
  max-width: calc(var(--cw) * 7 + var(--gap) * 6);
  margin: 0 auto;
  position: relative;
}
.sol-top {
  display: grid;
  grid-template-columns: repeat(7, var(--cw));
  gap: var(--gap);
  margin-bottom: calc(var(--gap) * 1.7);
}
.sol-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);
}
.sol-cols {
  display: grid;
  grid-template-columns: repeat(7, var(--cw));
  gap: var(--gap);
}
.sol-pile {
  position: relative;
  min-height: var(--ch);
  width: var(--cw);
}
.sol-pile > .sol-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. */
.sol-root.hand-left .sol-top { direction: rtl; }
.sol-root.hand-left .sol-top > * { direction: ltr; }

.sol-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. */
.sol-root .cf {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
  object-fit: fill;
  z-index: 2;
}
.sol-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. */
.sol-root .card.hint {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
  border-radius: var(--r);
  z-index: 40;
  animation: sol-hint 0.6s ease-in-out 2;
}
@keyframes sol-hint { 0%, 100% { outline-color: var(--gold); } 50% { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .sol-root .card.hint { animation: none; } }

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

.sol-win {
  position: absolute;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
}
.sol-win .msg {
  position: absolute;
  left: 50%;
  top: 36%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: auto;
  background: rgba(20, 50, 38, 0.93);
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 22px 30px;
}
.sol-win h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.sol-win p { font-size: 13px; color: rgba(234, 243, 237, 0.65); margin: 6px 0 16px; }
.sol-win .sol-again {
  font: inherit;
  font-size: 13px;
  color: var(--gold);
  background: none;
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
}
.sol-win .sol-again:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

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