/* ================= Table widgets =================
   Pre-actions, time bank, reactions, rabbit hunt, all-in odds, squeeze. */

/* tools row lives on the left of the action bar */
.action-bar { position: relative; }
.table-tools {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 8px; z-index: 3;
}
.pre-actions { display: none; gap: 6px; }
.action-bar.pre .pre-actions { display: flex; }
.pre-actions button, .tool-btn {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  padding: 8px 12px; border-radius: 10px; color: var(--text-2);
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .14);
  transition: background .15s, border-color .15s, color .15s;
}
.pre-actions button::before {
  content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 7px; vertical-align: -1px;
  border-radius: 3px; border: 1.5px solid rgba(255, 255, 255, .4);
}
.pre-actions button.on { color: #fff; border-color: #4ad08a; background: rgba(74, 208, 138, .14); }
.pre-actions button.on::before { background: #4ad08a; border-color: #4ad08a; box-shadow: inset 0 0 0 2px #0b0f14; }
.pre-actions button:hover, .tool-btn:hover { border-color: rgba(255, 255, 255, .3); color: #fff; }
.tool-btn[hidden] { display: none; }
#btnTimeBank { color: #ffd38a; border-color: rgba(242, 154, 46, .45); }
#btnEmote { font-size: 18px; padding: 5px 10px; }

.emote-wrap { position: relative; }
.emote-menu {
  position: absolute; bottom: calc(100% + 10px); left: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 44px); gap: 4px; padding: 8px;
  background: #121821; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.emote-menu[hidden] { display: none; }
.emote-menu button { font-size: 24px; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; transition: transform .1s, background .15s; }
.emote-menu button:hover { background: rgba(255, 255, 255, .08); transform: scale(1.15); }

/* reactions float over the sender's seat */
.emote-pop {
  z-index: 45; pointer-events: none; font-size: 64px; line-height: 1;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .55));
}

/* pot odds under the call amount */
.btn.act.call { flex-direction: column; gap: 0; line-height: 1.15; }
.btn.act .odds { display: block; font-size: 11px; font-weight: 700; letter-spacing: .3px; opacity: .85; text-transform: none; }

/* rabbit hunt */
.rabbit-btn {
  position: absolute; transform: translate(-50%, -50%); z-index: 6; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; padding: 8px 16px; border-radius: 999px;
  color: #fff; background: rgba(10, 13, 18, .82); border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
}
.rabbit-btn:hover { border-color: var(--accent); }
.rabbit-btn[hidden] { display: none; }
.card.rabbit { opacity: .78; filter: saturate(.75); outline: 2px dashed rgba(255, 255, 255, .55); outline-offset: 3px; }

/* all-in odds badges */
.equity-badge {
  z-index: 42; pointer-events: none; display: flex; flex-direction: column; align-items: center;
  padding: 6px 14px; border-radius: 12px; background: rgba(8, 11, 16, .92); border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .55);
}
.equity-badge b { font-size: 26px; color: #fff; line-height: 1.05; }
.equity-badge span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.equity-badge.won { border-color: #4ad08a; }
.equity-badge.won b { color: #6ee7a8; }

/* squeeze: face-down hero cards invite a tap */
.hole.squeeze-me { cursor: pointer; }
.hole.squeeze-me::after {
  content: 'Tap to reveal'; position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 3;
  font-size: 13px; font-weight: 700; white-space: nowrap; color: #fff; padding: 5px 12px; border-radius: 999px;
  background: rgba(8, 11, 16, .85); border: 1px solid rgba(226, 176, 74, .6); pointer-events: none;
  animation: hint-pulse 1.6s ease-in-out infinite;
}
@keyframes hint-pulse { 50% { box-shadow: 0 0 0 6px rgba(226, 176, 74, .15); } }

/* lobby toggle */
.toggle-field { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.toggle-field input { width: 18px; height: 18px; accent-color: var(--accent); }

/* tablets: tools sit above the bar so they never collide with the buttons */
@media (max-width: 1280px) {
  .table-tools { top: auto; bottom: calc(100% + 8px); transform: none; left: 12px; }
  .pre-actions button, .tool-btn { background: rgba(8, 11, 16, .86); }
}
/* phones: pre-actions take the place of the waiting text */
@media (max-width: 760px) {
  .action-bar.pre .waiting { display: none; }
  .action-bar.pre .table-tools { position: static; transform: none; justify-content: center; width: 100%; }
  .action-bar.pre { justify-content: center; }
  .action-bar.pre .emote-wrap { position: absolute; left: 10px; bottom: calc(100% + 8px); }
  .pre-actions button { padding: 10px 10px; font-size: 12.5px; }
  .emote-pop { font-size: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .hole.squeeze-me::after { animation: none; }
}

/* dealing */
.card-flyer { z-index: 25; }
.card-flyer .card { width: 110px; height: 154px; }

/* ---------- Smart HUD card ---------- */
.hud-card {
  position: absolute; transform: translate(-50%, -50%); z-index: 50; width: 270px; padding: 14px;
  background: rgba(12, 16, 22, .97); border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .7);
}
.hud-card[hidden] { display: none; }
.hud-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.hud-head img { width: 46px; height: 46px; border-radius: 50%; }
.hud-head b { display: block; font-size: 16px; }
.hud-head span { font-size: 12px; color: var(--muted); }
.hud-x { margin-left: auto; align-self: flex-start; background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; }
.hud-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hud-grid div { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; padding: 7px 4px; text-align: center; }
.hud-grid span { display: block; font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.hud-grid b { font-size: 17px; color: #fff; }
.hud-note { margin: 10px 2px 0; font-size: 12.5px; color: var(--text-2); }
.seat:not(.empty) .avatar { cursor: pointer; }

/* ---------- smart bet buttons ---------- */
.btn.preset { flex-direction: column; gap: 0; line-height: 1.15; padding: 5px 11px; min-width: 64px; }
.btn.preset b { font-size: 12.5px; }
.btn.preset .num { font-size: 11px; opacity: .75; font-weight: 600; }
.presets:empty { display: none; }

/* ---------- action buttons keep a fixed height ---------- */
.btn.act { height: 56px; padding: 0 10px; }
.btn.act .act-main { display: block; }
.btn.act.call { justify-content: center; }
.btn.act.call .odds { margin-top: 2px; }
#btnSitOut.on { color: #ffd38a; border-color: rgba(242, 154, 46, .5); }
.equity-badge b.dead { font-size: 15px; color: #ff8a8e; text-transform: uppercase; letter-spacing: .5px; }

/* ================= Turn clock medallion ================= */
.turn-clock {
  position: absolute; transform: translate(-50%, -50%); z-index: 32; width: 132px; height: 132px; pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #1d2633 0%, #0b0f15 70%);
  box-shadow: 0 0 0 3px #0b0e13, 0 0 0 5px rgba(226, 176, 74, .55), 0 16px 40px rgba(0, 0, 0, .7), inset 0 2px 10px rgba(255, 255, 255, .06);
}
.turn-clock[hidden] { display: none; }
.tc-sheen {
  position: absolute; inset: -14px; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(255, 214, 120, .55) 70%, transparent 85%);
  filter: blur(7px); animation: tc-spin 2.8s linear infinite;
}
@keyframes tc-spin { to { transform: rotate(360deg); } }
.turn-clock svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tc-track { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 8; }
.tc-arc {
  fill: none; stroke: url(#tcGold); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 0;
  transform: rotate(-90deg); transform-origin: center; transform-box: fill-box; transition: stroke .3s;
}
.tc-tip { fill: #fff6d8; filter: drop-shadow(0 0 4px #ffd36b) drop-shadow(0 0 10px rgba(255, 200, 80, .9)); }
.tc-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.tc-face b {
  font-size: 44px; font-weight: 900; letter-spacing: -1px;
  background: linear-gradient(180deg, #fff3cf, #e2b04a 60%, #b07f1d); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .5));
}
.tc-face span { margin-top: 2px; font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(255, 236, 190, .7); }
.tc-label {
  position: absolute; left: 50%; top: calc(100% + 10px); transform: translateX(-50%); white-space: nowrap;
  font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: #1d1404;
  padding: 4px 12px; border-radius: 999px; background: linear-gradient(180deg, #f4d27f, #e2b04a); box-shadow: 0 6px 14px rgba(0, 0, 0, .5);
}
.turn-clock.warn .tc-arc { stroke: #f4a63a; }
.turn-clock.urgent { box-shadow: 0 0 0 3px #0b0e13, 0 0 0 5px rgba(255, 77, 79, .8), 0 0 40px rgba(255, 77, 79, .55), 0 16px 40px rgba(0, 0, 0, .7); }
.turn-clock.urgent .tc-arc { stroke: #ff4d4f; }
.turn-clock.urgent .tc-face b { background: linear-gradient(180deg, #ffe1e1, #ff5a5c 60%, #b3151a); -webkit-background-clip: text; background-clip: text; }
.turn-clock.urgent .tc-sheen { background: conic-gradient(from 0deg, transparent 0 55%, rgba(255, 90, 92, .7) 70%, transparent 85%); animation-duration: 1.2s; }
.turn-clock.urgent .tc-label { background: linear-gradient(180deg, #ff7a7c, #d9262b); color: #fff; }

/* ================= Live clock (top bar) ================= */
.live-clock {
  display: flex; align-items: center; gap: 1px; padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  font-size: 16px; font-weight: 800; letter-spacing: .5px; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #1c232e, #121820); border: 1px solid rgba(226, 176, 74, .4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 18px rgba(226, 176, 74, .12);
}
.live-clock span { background: linear-gradient(180deg, #fff3cf, #e2b04a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.live-clock i { font-style: normal; color: #e2b04a; animation: blink 1s steps(2, start) infinite; margin: 0 1px; }
@keyframes blink { to { visibility: hidden; } }
@media (max-width: 860px) { .live-clock { font-size: 14px; padding: 4px 10px; } }
@media (prefers-reduced-motion: reduce) { .tc-sheen, .live-clock i, .ring.urgent { animation: none; } }
