/* ===== Texas Hold'em — game-specific styles =====
   Generic glass chrome comes from shared/css/glass.css (cards reuse .c-card
   wholesale; the rules modal uses the shared .c-modal, which scrolls the
   full-screen overlay, never a boxed inner scrollbar). This file lays out a
   four-seat green-felt table: three opponents across the top, the five-card
   community board and status in the middle, your hero seat at the bottom,
   then the action row and the raise-sizing tray. */

:root {
  /* Casino green felt chrome: green app background, yellow buttons and
     green-tinted text. Hole cards use the same red back as the other
     casino card tables (Blackjack, Three Card Poker, Hearts). */
  --accent-1: #f2b400;
  --accent-2: #ffd447;
  --on-accent: #ffffff;
  --back-1: #b83232;
  --back-2: #6a1414;
  --bg-1: #12764c;
  --bg-2: #083f29;
  --bg-glow-a: rgba(18, 118, 76, .55);
  --bg-glow-b: rgba(63, 191, 122, .22);
  --c-text: #eaf3ee;
  --c-muted: #b7d3c2;
}

/* Letterbox behind the felt and the frosted Rules modal follow the same green
   (the primary buttons are yellow via .c-btn--primary -> --accent-1/2). */
body { background: #083f29; }
.c-modal__backdrop { background: rgba(3, 22, 14, .5); }
.c-modal__panel { background: rgba(9, 44, 29, .72); }
/* Yellow primary buttons: the white label needs a shadow to stay legible. */
.c-btn--primary { text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }

.c-app { --fpad: clamp(10px, 3.5vw, 30px); }
/* The table's own 60px tail is more than this page needs; keeping the page
   short lets the action row and the raise tray stay above the fold. */
.c-table { padding-top: clamp(10px, 2.6vh, 26px); padding-bottom: 16px; }

/* ---------- Table ---------- */
.he-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.8vh, 20px);
  width: 100%;
  max-width: min(1500px, 98vw);
  margin: 0 auto;
}

.he-felt {
  --bcw: clamp(40px, min(6.4vw, 8.8vh), 88px);
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.4vh, 16px);
  padding: clamp(4px, 1.2vh, 12px) 0;
}

/* Pot pill, top-centre of the felt. */
.he-pot {
  align-self: center;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(240, 180, 41, .5);
  background: rgba(8, 40, 26, .6);
  color: #ffe6a8;
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
}
.he-pot b {
  font-size: 15px; font-variant-numeric: tabular-nums;
  letter-spacing: 0; text-transform: none; color: #fff;
}

/* ---------- Seat rows ---------- */
.he-row {
  display: flex;
  gap: clamp(12px, 3.5vw, 48px);
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}
.he-row--opp .he-seat { --cw: clamp(30px, min(4.6vw, 6.4vh), 84px); }
.he-row--hero { margin-top: 2px; }
.he-row--hero .he-seat { --cw: clamp(48px, min(7.4vw, 10vh), 112px); }

.he-seat {
  --ch: calc(var(--cw) * 1.42);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(4, 24, 15, .4);
  transition: border-color .18s ease, box-shadow .18s ease, opacity .2s ease, transform .18s ease;
}
.he-seat.is-turn {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 2px rgba(240, 180, 41, .45), 0 0 18px rgba(240, 180, 41, .28);
  transform: translateY(-2px);
}
.he-seat.is-folded { opacity: .38; }
.he-seat.is-win {
  border-color: #7ef0a4;
  box-shadow: 0 0 0 2px rgba(126, 240, 164, .5), 0 0 20px rgba(126, 240, 164, .3);
}
.he-seat.is-allin { border-color: rgba(242, 180, 0, .45); }

.he-seat__top { display: flex; align-items: baseline; gap: 8px; }
.he-name {
  font-size: 12px; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: #eafff2;
}
.he-stack {
  font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: #ffe6a8;
}
.he-seat.is-allin .he-stack { color: #ffd97a; }

.he-cards {
  position: relative;
  min-width: var(--cw);
  height: calc(var(--cw) * 1.42);
}
.he-cards .c-card {
  box-shadow: 0 3px 8px rgba(0, 0, 0, .4), inset 0 0 0 1px var(--card-edge);
}
.he-cards .c-card.he-new {
  /* staggered per-card via el.style.animationDelay in JS */
  animation: heDeal .32s cubic-bezier(.18, .7, .3, 1) both;
}
@keyframes heDeal {
  from { transform: translateY(-34vh) rotate(-12deg) scale(.6); opacity: 0; }
  to   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
}

/* Showdown reveal: an opponent's hole cards turn over (a flip), instead of
   the hand being dealt in again. */
.he-cards .c-card.he-flip {
  transform-origin: center;
  animation: heFlip .5s ease-out both;
}
@keyframes heFlip {
  0%   { transform: perspective(600px) rotateY(92deg); opacity: .25; }
  100% { transform: perspective(600px) rotateY(0deg); opacity: 1; }
}

/* Small round dealer button pinned to the seat corner. */
.he-dealer {
  position: absolute;
  top: -7px; right: -7px;
  width: 21px; height: 21px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #d7dce1 72%);
  border: 2px solid #0a3521;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
  color: #0a3521;
  font-size: 10px; font-weight: 900; line-height: 1;
}
.he-dealer[hidden] { display: none; }

.he-bet {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-height: 16px;
  font-size: 12px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.he-role {
  font-size: 10px; font-weight: 900; letter-spacing: .06em;
  text-transform: uppercase; color: #ffe6a8;
}
.he-role:empty { display: none; }
.he-amt:empty { display: none; }
.he-act {
  min-height: 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
  color: #bfe8cf;
}

/* ---------- Community board + status ---------- */
.he-middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.2vh, 14px);
  width: 100%;
}
.he-community {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(4px, 1vw, 10px);
}
.he-slot {
  --cw: var(--bcw);
  --ch: calc(var(--bcw) * 1.42);
  position: relative;
  width: var(--cw);
  height: var(--ch);
  border-radius: calc(var(--cw) * .09);
  background: rgba(4, 24, 15, .35);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .14);
}
.he-slot.is-filled {
  background: transparent;
  box-shadow: none;
}
.he-slot .c-card {
  box-shadow: 0 3px 8px rgba(0, 0, 0, .4), inset 0 0 0 1px var(--card-edge);
}
.he-slot .c-card.he-board-new {
  /* flush/turn/river land one at a time */
  animation: heBoardIn .34s cubic-bezier(.18, .7, .3, 1) both;
}
@keyframes heBoardIn {
  from { transform: translateY(-16px) scale(.72); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.he-status {
  align-self: center;
  max-width: 92%;
  padding: 5px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(6, 30, 19, .66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 14px; font-weight: 700; letter-spacing: .01em;
  color: var(--c-text);
  text-align: center;
  transition: color .2s ease, border-color .2s ease;
}
.he-status--win  { color: #7ef0a4; border-color: rgba(126, 240, 164, .5); }
.he-status--lose { color: #ff8b94; border-color: rgba(255, 139, 148, .5); }
.he-status--push { color: #ffd97a; border-color: rgba(255, 217, 122, .5); }

/* ---------- Action row ---------- */
.he-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.he-actions .c-btn {
  min-width: 96px;
  text-align: center;
  font-size: 14px;
  padding: 8px 16px;
}

/* ---------- Raise-sizing tray ---------- */
.he-betbox {
  width: min(840px, 96vw);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(4, 24, 15, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.he-betbox[hidden] { display: none; }
.he-betbox__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 118px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--c-muted);
}
.he-betbox__head b {
  font-size: 16px; color: #ffe6a8;
  font-variant-numeric: tabular-nums;
}
.he-range {
  flex: 1 1 180px;
  min-width: 120px;
  height: 24px;
  accent-color: var(--accent-1);
  cursor: pointer;
}
.he-range:disabled { opacity: .55; cursor: default; }
.he-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.he-preset {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  color: var(--c-text);
  font: inherit; font-size: 12px; font-weight: 600;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease;
}
.he-preset:hover { background: rgba(255, 255, 255, .14); }
.he-preset:focus-visible { outline: none; box-shadow: var(--ring); }
.he-betbox__foot { display: flex; gap: 8px; margin-left: auto; }

/* ---------- Small screens ---------- */
@media (max-width: 620px) {
  .he-betbox__head { min-width: 0; width: 100%; }
  .he-range { flex-basis: 100%; }
  .he-betbox__foot { margin-left: 0; width: 100%; justify-content: flex-end; }
}

@media (max-width: 520px) {
  .he-felt { --bcw: clamp(36px, 11vw, 48px); }
  .he-row { gap: 8px; }
  .he-row--opp .he-seat { --cw: clamp(28px, 8.6vw, 38px); }
  .he-row--hero .he-seat { --cw: clamp(46px, 14vw, 64px); }
  .he-seat { padding: 6px 6px 5px; border-radius: 11px; }
  .he-seat__top { gap: 5px; }
  .he-name { font-size: 10px; }
  .he-stack { font-size: 10px; }
  .he-role { font-size: 9px; }
  .he-bet { font-size: 10px; }
  .he-act { font-size: 9px; }
  .he-dealer { width: 18px; height: 18px; font-size: 8px; top: -6px; right: -6px; }
  .he-pot { font-size: 11px; padding: 4px 12px; }
  .he-pot b { font-size: 13px; }
  .he-status { font-size: 12px; padding: 5px 14px; }
  .he-actions .c-btn { min-width: 74px; font-size: 13px; padding: 8px 10px; }
}

@media (max-width: 360px) {
  .he-felt { --bcw: 34px; }
  .he-row--opp .he-seat { --cw: 26px; }
  .he-row--hero .he-seat { --cw: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .he-cards .c-card.he-new,
  .he-cards .c-card.he-flip,
  .he-slot .c-card.he-board-new { animation: none; }
  .he-seat.is-turn { transform: none; }
}
