/* Poker page styles — layered on top of the shared style.css */

/* The poker page goes much wider than the rest of the site, with less padding,
   so the table can dominate the screen. */
.poker-card { max-width: 1100px; padding: 1.5rem 1.5rem 2rem; }

/* ------------------------------- Setup ------------------------------- */
#setup { margin-top: 1.5rem; }
.field { margin-bottom: 1.1rem; }
.field-row { display: flex; gap: 1rem; }
.field-row .field { flex: 1; }
.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
#setup select, #setup input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 10px;
  -webkit-appearance: none;
  appearance: none;
}
#setup select:focus, #setup input:focus { outline: none; border-color: var(--accent); }

/* ------------------------------- Buttons ------------------------------- */
.poker-btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}
.poker-btn:hover:not(:disabled) { border-color: var(--accent); }
.poker-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.poker-btn.primary:hover:not(:disabled) { filter: brightness(1.05); }
.poker-btn.small { padding: 0.4rem 0.55rem; font-size: 0.82rem; }
.poker-btn:disabled { opacity: 0.4; cursor: default; }

/* ------------------------------- Message ------------------------------- */
.poker-message {
  min-height: 1.4rem;
  margin: 0.5rem 0 1rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.5;
}

/* ------------------------------- Table ------------------------------- */
#table {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 72vh;
  margin: 0.5rem auto 1.25rem;
  background: radial-gradient(ellipse at center, #2e7d4f 0%, #1f5d3a 70%, #194b2f 100%);
  border: 6px solid #6b4a2b;
  border-radius: 48% / 46%;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.35);
}

#board {
  position: absolute;
  left: 50%; top: 38%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 4px;
  min-height: 44px;
}
#pot-label {
  position: absolute;
  left: 50%; top: 56%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
#dealer-btn {
  position: absolute;
  z-index: 5;                      /* sit above the seats so it's always visible */
  width: 26px; height: 26px;
  transform: translate(-50%, -50%);
  background: #fff; color: #194b2f;
  border: 2px solid #194b2f;
  border-radius: 50%;
  font-size: 0.8rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.position-badge {
  position: absolute;
  z-index: 4;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  transform: translate(-50%, -50%);
  background: #ffd479;
  color: #194b2f;
  border: 2px solid #194b2f;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

/* ------------------------------- Seats ------------------------------- */
.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 92px;
  text-align: center;
  background: rgba(20, 40, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 5px 4px 6px;
  color: #f4efe8;
}
.seat.active { border-color: #ffd479; box-shadow: 0 0 0 2px #ffd479; }
.seat.human { background: rgba(60, 40, 20, 0.9); }
.seat.folded { opacity: 0.45; }
.seat-name { font-size: 0.78rem; font-weight: 600; margin-top: 2px; }
.seat-stack { font-size: 0.74rem; color: #bfe6cc; }
.seat-bet {
  font-size: 0.72rem; font-weight: 700; color: #ffd479;
  margin-top: 2px;
}
.seat-cards { display: flex; gap: 3px; justify-content: center; min-height: 30px; }
.folded-label { font-size: 0.72rem; font-style: italic; color: #cbb; }
.peek-btn {
  margin-top: 4px;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  color: #194b2f;
  background: #ffd479;
  border: none;
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
}
.peek-btn:hover { filter: brightness(1.05); }
.peek-note { font-size: 0.66rem; font-style: italic; color: #cbb; margin-top: 2px; }

/* Playing cards */
.pcard {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 26px; height: 36px;
  padding: 0 3px;
  background: #fff; color: #1a1a1a;
  border-radius: 4px;
  font-size: 0.8rem; font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.pcard.red { color: #c62828; }
.pcard.back {
  background: repeating-linear-gradient(45deg, #b5651d, #b5651d 4px, #9a531a 4px, #9a531a 8px);
}
#board .pcard { min-width: 30px; height: 42px; font-size: 0.9rem; }

/* ------------------------------- Controls ------------------------------- */
/* The whole bar sticks to the bottom of the viewport, so the action buttons
   stay put and visible every turn instead of collapsing out of view. */
#action-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin: 0 -1.5rem -2rem;          /* bleed to the card edges */
  padding: 0.5rem 1.5rem 0.6rem;
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 16px rgba(43, 38, 34, 0.08);
}
.waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.4rem 0;
}
.controls { margin-top: 0; }
.action-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.action-row .poker-btn { flex: 1; }
.raise-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.45rem; }
.raise-row input[type="range"] { flex: 1; accent-color: var(--accent); }
#raise-amt { font-weight: 700; min-width: 70px; text-align: right; }
.quick { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.quick .poker-btn { flex: 1; }

/* Deal / Skip / Leave row — always present, separated from the action buttons. */
.table-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.table-row .poker-btn { flex: 1; font-size: 0.82rem; padding: 0.45rem 0.4rem; white-space: nowrap; }

/* Narrow phones: taller table fills the screen better, smaller seats so they
   don't overlap around the oval. */
@media (max-width: 480px) {
  .poker-card { padding: 1rem 0.75rem 1.5rem; }
  #action-bar { margin: 0 -0.75rem -1.5rem; padding: 0.6rem 0.75rem 0.8rem; }
  #table { aspect-ratio: 4 / 5; max-height: 80vh; }
  .seat { width: 74px; padding: 4px 2px 5px; }
  .seat-name { font-size: 0.7rem; }
  .pcard { min-width: 20px; height: 30px; font-size: 0.7rem; }
}
