/* Osmose (Osmosis) board — same "green baize" family as the other Réussites,
   matted inside the shell's editorial page. All selectors are scoped under
   .osm-root so nothing leaks into the shell chrome. Layout differs from Klondike:
   a top strip (stock, waste, four reserve piles) and four horizontal foundation
   rows fanned to the right, one suit per row. */

.osm-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(30px, 11vw, 84px);
  --ch: calc(var(--cw) * 1.45);
  --gap: clamp(4px, 1.2vw, 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);
}

@media (prefers-color-scheme: dark) {
  .osm-root { --felt: #144d36; --felt-hi: #1d6046; }
}
.osm-root.mode-dark { --felt: #144d36; --felt-hi: #1d6046; }

.osm-board {
  max-width: calc(var(--cw) * 7 + var(--gap) * 6);
  margin: 0 auto;
  position: relative;
}

.osm-top {
  display: grid;
  grid-template-columns: repeat(7, var(--cw));
  gap: var(--gap);
  margin-bottom: calc(var(--gap) * 1.7);
  align-items: start;
}
.osm-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);
}
.osm-pile, .osm-res {
  position: relative;
  min-height: var(--ch);
  width: var(--cw);
}
.osm-pile > .osm-base, .osm-res > .osm-base {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--ch);
  border-radius: var(--r);
  border: 1.5px solid var(--line);
}

/* Foundation rows: one suit each, fanned to the right. */
.osm-founds {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.osm-frow {
  position: relative;
  height: var(--ch);
  border-radius: var(--r);
  background: rgba(20, 50, 38, 0.28);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.osm-frow > .osm-base {
  position: absolute;
  left: 0; top: 0;
  width: var(--cw);
  height: var(--ch);
  border-radius: var(--r);
  border: 1.5px solid var(--line);
}
.osm-tag {
  position: absolute;
  right: calc(var(--cw) * 0.14);
  top: calc(var(--cw) * 0.08);
  font-size: calc(var(--cw) * 0.4);
  opacity: 0.5;
  z-index: 1;
  pointer-events: none;
}

/* Left-handed layout: mirror the top strip. */
.osm-root.hand-left .osm-top { direction: rtl; }
.osm-root.hand-left .osm-top > * { direction: ltr; }

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

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

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

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