/* Pyramide board — same green-baize texture as Solitaire/FreeCell (per-game
   texture is allowed, ARCHITECTURE.md §6), scoped under .py-root. A 7-row
   pyramid of overlapping cards, with a stock + waste below. Reuses the shared
   card SVGs. Absolute positioning for the pyramid (rows overlap vertically). */

.py-root {
  --felt: #1b6b49; --felt-hi: #2a7f5b; --gold: #d8b65c;
  --line: rgba(253, 252, 247, 0.22);
  --cw: 76px;
  --ch: calc(var(--cw) * 1.45);
  --r: calc(var(--cw) * 0.041);
  position: relative;
  padding: clamp(12px, 3vw, 26px) clamp(6px, 2vw, 18px);
  border-radius: var(--radius-md);
  background: var(--felt);
  background-image: radial-gradient(ellipse 80% 70% at 50% 22%, 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) { .py-root { --felt: #144d36; --felt-hi: #1d6046; } }
.py-root.mode-dark { --felt: #144d36; --felt-hi: #1d6046; }

.py-board { position: relative; margin: 0 auto; max-width: calc(var(--cw) * 7 + 60px); }

.py-pyr { position: relative; width: 100%; margin: 0 auto; }
.py-root .card {
  position: absolute; 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 -4px 7px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.12);
}
.py-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); }

/* Covered cards are dimmed and inert; free cards are bright and clickable. */
.py-pyr .card { filter: brightness(0.62) saturate(0.85); }
.py-pyr .card.free { filter: none; cursor: pointer; }
.py-pyr .card.free:hover { transform: translateY(-2px); }
.py-root .card.sel { outline: 3px solid var(--gold); outline-offset: 1px; z-index: 30; }
.py-root .card.py-hint { outline: 3px solid var(--gold); outline-offset: 1px; z-index: 40; animation: py-hint 0.6s ease-in-out 2; }
@keyframes py-hint { 0%, 100% { outline-color: var(--gold); } 50% { outline-color: transparent; } }

.py-foot {
  display: flex; align-items: center; gap: clamp(10px, 3vw, 22px);
  margin-top: clamp(10px, 2.5vw, 20px); flex-wrap: wrap;
}
.py-slot {
  position: relative; width: var(--cw); height: var(--ch); border-radius: var(--r);
  border: 1.5px solid var(--line); display: grid; place-items: center;
  color: rgba(253, 252, 247, 0.4); font-size: calc(var(--cw) * 0.5);
}
.py-stock { cursor: pointer; }
.py-stock:hover { border-color: rgba(216, 182, 92, 0.5); }
.py-stock .card, .py-waste .card { position: absolute; inset: 0; }
.py-waste .card.free { cursor: pointer; }
.py-msg { margin-left: auto; font-size: 0.92rem; opacity: 0.9; align-self: center; }

@media (prefers-reduced-motion: reduce) { .py-pyr .card.free:hover { transform: none; } }
