/* La Belle Lucie board — the fan-patience baize, matted inside the shell's
   editorial page (ARCHITECTURE.md §6 allows a per-game texture as long as it
   honours mode / colorBlind / reducedMotion). Every selector is scoped under
   .bl-root so nothing leaks into the shell chrome. */

.bl-root {
  --felt: #1b6b49;
  --felt-hi: #2a7f5b;
  --paper: #fdfcf7;
  --ink: #14110e;
  --madder: #c0182b;
  --gold: #d8b65c;
  --line: rgba(253, 252, 247, 0.22);
  --cw: clamp(38px, 12vw, 84px);
  --ch: calc(var(--cw) * 1.45);
  --gap: clamp(6px, 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% 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) {
  .bl-root { --felt: #144d36; --felt-hi: #1d6046; }
}
.bl-root.mode-dark { --felt: #144d36; --felt-hi: #1d6046; }

.bl-board {
  margin: 0 auto;
  position: relative;
}

/* Top strip: four foundations on the left, the redeal affordance on the right. */
.bl-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap);
  flex-wrap: wrap;
  margin-bottom: calc(var(--gap) * 1.9);
}
.bl-foundations {
  display: grid;
  grid-template-columns: repeat(4, var(--cw));
  gap: var(--gap);
}
.bl-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);
}

.bl-redeal {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  text-align: right;
}
.bl-redeal-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--gold);
  background: rgba(20, 50, 38, 0.55);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
}
.bl-redeal-btn:hover:not(:disabled) { background: rgba(20, 50, 38, 0.85); }
.bl-redeal-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.bl-redeal-btn:disabled { opacity: 0.4; cursor: default; }
.bl-redeal-note {
  font-size: 11px;
  color: rgba(234, 243, 237, 0.6);
}

/* The 18 fans wrap across the baize; each fan is only as wide as its cards. */
.bl-fans {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: calc(var(--gap) * 1.4) var(--gap);
}
.bl-fan {
  position: relative;
  min-width: var(--cw);
  height: var(--ch);
}
.bl-fan.empty {
  border-radius: var(--r);
  border: 1.5px dashed var(--line);
  opacity: 0.5;
}

.bl-root .card {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--cw);
  height: var(--ch);
  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: left 0.17s cubic-bezier(0.2, 0.7, 0.3, 1);
}
/* Faces are one full-card SVG (its own rounded ground + black die-cut outline);
   aspect matches the card, so object-fit: fill is exact and never crops. */
.bl-root .cf {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
  object-fit: fill;
  z-index: 2;
}
.bl-root .card.lift {
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.16), 0 14px 28px rgba(0, 0, 0, 0.38);
}
.bl-root .card.hint,
.bl-root .bl-redeal-btn.hint {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
  border-radius: var(--r);
  z-index: 40;
  animation: bl-hint 0.6s ease-in-out 2;
}
.bl-root .bl-redeal-btn.hint { border-radius: 999px; }
@keyframes bl-hint { 0%, 100% { outline-color: var(--gold); } 50% { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .bl-root .card.hint, .bl-root .bl-redeal-btn.hint { animation: none; } }

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

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

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