/* FrOdo 9♥ signature — subtle family heartbeat (holdem-lab only) */

.frodo-nine-heart-card {
  --nh-red: #d11f3a;
  --nh-glow: rgba(244, 63, 94, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  user-select: none;
  pointer-events: none;
}

.frodo-nine-heart-inner {
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: center;
  justify-items: center;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(145deg, #fff 0%, #faf7f2 100%);
  border: 2px solid var(--nh-red);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  padding: 4px 6px;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
}

.frodo-nine-heart-card .nh-rank {
  font-size: 0.95em;
  font-weight: 800;
  color: var(--nh-red);
  align-self: start;
  justify-self: start;
}

.frodo-nine-heart-card .nh-suit {
  font-size: 1.65em;
  color: var(--nh-red);
  text-shadow: 0 0 10px rgba(244, 63, 94, 0.25);
}

/* Sizes */
.frodo-nine-heart-card.size-sm .frodo-nine-heart-inner {
  width: 34px;
  height: 48px;
  border-radius: 7px;
  padding: 3px 4px;
}
.frodo-nine-heart-card.size-sm .nh-suit { font-size: 1.35em; }

.frodo-nine-heart-card.size-md .frodo-nine-heart-inner {
  width: 48px;
  height: 68px;
}

.frodo-nine-heart-card.size-lg .frodo-nine-heart-inner {
  width: 72px;
  height: 100px;
  border-radius: 12px;
  padding: 8px 10px;
}
.frodo-nine-heart-card.size-lg .nh-rank { font-size: 1.15em; }
.frodo-nine-heart-card.size-lg .nh-suit { font-size: 2.1em; }

/* Table corner signature */
.frodo-nine-heart-table-signature {
  opacity: 0.88;
}

.frodo-nine-heart-table-signature-wrap {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  pointer-events: none;
}

.table-shell {
  position: relative;
}

/* Double-beat pulse — normal (idle table, ~every 20–30s) */
@keyframes frodoNineHeartBeat {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 transparent);
  }
  7% {
    transform: scale(1.06);
    filter: drop-shadow(0 0 6px var(--nh-glow));
  }
  14% {
    transform: scale(1);
    filter: drop-shadow(0 0 2px rgba(244, 63, 94, 0.15));
  }
  21% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px var(--nh-glow));
  }
  32% {
    transform: scale(1);
    filter: drop-shadow(0 0 3px rgba(244, 63, 94, 0.12));
  }
}

/* Stronger beat — table start, final two, winner, legend */
@keyframes frodoNineHeartBeatStrong {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 transparent);
  }
  6% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 12px rgba(244, 63, 94, 0.55));
  }
  12% {
    transform: scale(1.02);
  }
  18% {
    transform: scale(1.18);
    filter: drop-shadow(0 0 18px rgba(244, 63, 94, 0.65));
  }
  28% {
    transform: scale(1.04);
    filter: drop-shadow(0 0 8px rgba(244, 63, 94, 0.35));
  }
  38% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 14px rgba(244, 63, 94, 0.5));
  }
  50% {
    transform: scale(1);
    filter: drop-shadow(0 0 4px rgba(244, 63, 94, 0.2));
  }
}

.frodo-nine-heart-card.is-beating {
  animation: frodoNineHeartBeat 1.05s ease-in-out 1;
}

.frodo-nine-heart-card.is-beating-strong {
  animation: frodoNineHeartBeatStrong 1.35s ease-in-out 1;
}

/* Reduced motion: no animation; optional soft static highlight */
@media (prefers-reduced-motion: reduce) {
  .frodo-nine-heart-card.is-beating,
  .frodo-nine-heart-card.is-beating-strong {
    animation: none !important;
  }

  .frodo-nine-heart-card.is-soft-highlight .frodo-nine-heart-inner {
    box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.4), 0 4px 14px rgba(0, 0, 0, 0.18);
  }
}

.frodo-nine-heart-modal-accent {
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
}

.frodo-nine-heart-legend-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  color: #92400e;
  background: #fef3c7;
  border: 1px dashed #fcd34d;
  border-radius: 10px;
  padding: 6px 10px;
  margin-top: 10px;
}

.frodo-nine-heart-legend-placeholder.hidden {
  display: none;
}
