/* Président — a four-player card table. The card art is the shared Vector
   Playing Cards SVGs, rendered whole (the black outline is the die-cut: never
   cropped, never boxed). Scoped to .pres-root, tokens from the shell, a green
   felt surface inside the board only. */

.pres-root {
  --pres-gold: #b68235;
  --pres-felt-1: #2f7d4f;
  --pres-felt-2: #206040;
  --pres-felt-3: #184e34;
  --pres-ink: #f4f1ea;
  inline-size: 100%;
  max-inline-size: 680px;
  margin: 0 auto;
  color: var(--pres-ink);
  font-family: var(--font-body, "Lora", Georgia, serif);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vw, 14px);
}

/* ── Table surface ─────────────────────────────────────────────────────────── */
.pres-table {
  background: radial-gradient(130% 110% at 50% 12%, var(--pres-felt-1) 0%, var(--pres-felt-2) 58%, var(--pres-felt-3) 100%);
  border-radius: var(--radius-md, 12px);
  padding: clamp(10px, 3vw, 20px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 2px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.5vw, 12px);
}

.pres-seat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  min-block-size: 1px;
}
.pres-north, .pres-south { flex-direction: row; }
.pres-west, .pres-east { flex-direction: column; gap: 4px; }

.pres-name {
  font-family: var(--font-heading, "Cormorant Garamond", serif);
  font-size: clamp(12px, 2.6vw, 15px);
  letter-spacing: 0.04em;
  opacity: 0.82;
  text-align: center;
  padding: 1px 8px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.pres-name.pres-active {
  opacity: 1;
  color: #fff;
  background: rgba(182, 130, 53, 0.55);
  box-shadow: 0 0 0 1px rgba(182, 130, 53, 0.9);
}
.pres-count {
  font-size: clamp(11px, 2.4vw, 13px);
  letter-spacing: 0.02em;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.pres-count.pres-empty { opacity: 0.5; font-style: italic; }

/* ── Center: pile + info ───────────────────────────────────────────────────── */
.pres-midrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 2vw, 14px);
}
.pres-west, .pres-east { flex: 0 0 auto; }
.pres-center {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-block-size: clamp(96px, 26vw, 150px);
}
.pres-pile {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  min-block-size: clamp(64px, 18vw, 100px);
}
.pres-pile .pres-card { inline-size: clamp(44px, 12vw, 68px); }
.pres-pile-empty {
  font-family: var(--font-heading, "Cormorant Garamond", serif);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
}
.pres-info {
  font-family: var(--font-heading, "Cormorant Garamond", serif);
  font-size: clamp(12px, 2.8vw, 15px);
  letter-spacing: 0.03em;
  opacity: 0.9;
  text-align: center;
  min-block-size: 1.2em;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.pres-card { display: block; border-radius: 5px; block-size: auto; }

/* ── Standings ─────────────────────────────────────────────────────────────── */
.pres-standings {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(8px, 2.4vw, 16px);
}
.pres-round {
  font-family: var(--font-heading, "Cormorant Garamond", serif);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-neutral-500, #8a8578);
}
.pres-scorecell { display: inline-flex; align-items: baseline; gap: 5px; font-variant-numeric: tabular-nums; }
.pres-scorename {
  font-family: var(--font-heading, "Cormorant Garamond", serif);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--color-neutral-500, #8a8578);
}
.pres-scorecell b {
  font-family: var(--font-heading, "Cormorant Garamond", serif);
  font-weight: 600;
  font-size: clamp(16px, 4vw, 20px);
  color: var(--color-text, #23201b);
}
.pres-you b { color: var(--pres-gold); }

/* ── Status ────────────────────────────────────────────────────────────────── */
.pres-status {
  text-align: center;
  font-family: var(--font-heading, "Cormorant Garamond", serif);
  font-size: clamp(15px, 3.6vw, 20px);
  min-block-size: 1.5em;
  color: var(--color-text, #23201b);
}

/* ── Panel (buttons / round result) ────────────────────────────────────────── */
.pres-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-block-size: 1px;
}
.pres-panel[hidden] { display: none; }
.pres-titles {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  text-align: center;
}
.pres-titlecell {
  font-size: clamp(12px, 2.8vw, 14px);
  color: var(--color-text, #23201b);
}
.pres-titlecell b {
  font-family: var(--font-heading, "Cormorant Garamond", serif);
  color: var(--pres-gold);
}

.pres-btn {
  font-family: var(--font-heading, "Cormorant Garamond", serif);
  font-size: 15px;
  padding: 8px 20px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--color-neutral-400, #c9c3b5);
  background: #fff;
  color: #23201b; /* fixed: white bg, text must not flip in dark mode */
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, border-color 0.15s, opacity 0.15s;
}
.pres-btn:hover:not(:disabled) { border-color: var(--pres-gold); }
.pres-btn:active:not(:disabled) { transform: translateY(1px); }
.pres-btn:disabled { opacity: 0.45; cursor: default; }
.pres-btn-primary { background: var(--pres-gold); border-color: var(--pres-gold); color: #fff; }
.pres-btn-primary:hover:not(:disabled) { background: #a2732c; }
.pres-btn-primary:disabled { background: var(--pres-gold); }

/* ── Human hand ────────────────────────────────────────────────────────────── */
.pres-hand {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  min-block-size: clamp(60px, 16vw, 96px);
}
.pres-cardwrap { line-height: 0; position: relative; transition: transform 0.12s; }
.pres-cardwrap .pres-card { inline-size: clamp(40px, 9.5vw, 62px); }
.pres-playable .pres-card { cursor: pointer; box-shadow: 0 2px 7px rgba(0, 0, 0, 0.28); }
.pres-playable:hover { transform: translateY(-10px); }
.pres-selected { transform: translateY(-14px); }
.pres-selected .pres-card { box-shadow: 0 0 0 2px var(--pres-gold), 0 4px 10px rgba(0, 0, 0, 0.3); border-radius: 6px; }
.pres-muted { opacity: 0.4; }
.pres-muted .pres-card { cursor: default; }
.pres-hint .pres-card { animation: pres-pulse 1.1s ease; }

@keyframes pres-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(182, 130, 53, 0); }
  30% { box-shadow: 0 0 0 4px rgba(182, 130, 53, 0.85); transform: translateY(-8px); }
}

/* ── Dark mode ─────────────────────────────────────────────────────────────── */
.pres-root.mode-dark .pres-table {
  background: radial-gradient(130% 110% at 50% 12%, #245c3c 0%, #1a4830 58%, #123522 100%);
}
.pres-root.mode-dark .pres-status,
.pres-root.mode-dark .pres-scorecell b,
.pres-root.mode-dark .pres-titlecell { color: #ece7dc; }
.pres-root.mode-dark .pres-round,
.pres-root.mode-dark .pres-scorename { color: #b9b3a4; }
.pres-root.mode-dark .pres-you b,
.pres-root.mode-dark .pres-titlecell b { color: #d9a54e; }
.pres-root.mode-dark .pres-btn { background: #2a2721; color: #ece7dc; border-color: #4a463c; }
.pres-root.mode-dark .pres-btn-primary { background: var(--pres-gold); color: #1a1712; border-color: var(--pres-gold); }

/* ── Reduced motion ────────────────────────────────────────────────────────── */
.pres-root.no-motion .pres-cardwrap,
.pres-root.no-motion .pres-btn { transition: none; }
.pres-root.no-motion .pres-playable:hover { transform: none; }
.pres-root.no-motion .pres-hint .pres-card { animation: none; }
