/* Hanafuda Match — flower-card matching solitaire. */
.hf-col { --cw: 52px; justify-content: space-evenly; padding: 4px 6px; direction: ltr; }
.hf-table, .hf-hand { display: grid; gap: 5px; justify-content: center; align-content: center; }
.hf-table { flex: 1 1 auto; min-height: 0; }
.hf-hand { flex: none; padding: 6px 8px 4px; border-radius: 14px; background: rgba(22, 16, 38, 0.55); box-shadow: inset 0 0 0 1px var(--hairline); }
.hf-card {
  position: relative;
  width: var(--cw);
  height: calc(var(--cw) * 1.6);
  padding: 0;
  border: 0;
  border-radius: calc(var(--cw) * 0.1);
  background: #FBF3EA;
  box-shadow: 0 0 0 2px #161026, 0 3px 7px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s var(--ease-out), box-shadow 0.16s;
}
.hf-card svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; }
.hf-m, .hf-v {
  position: absolute;
  min-width: calc(var(--cw) * 0.34);
  height: calc(var(--cw) * 0.34);
  padding: 0 2px;
  font: 800 calc(var(--cw) * 0.24)/calc(var(--cw) * 0.34) var(--font-text);
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}
.hf-m { top: 0; left: 0; border-radius: 0 0 calc(var(--cw) * 0.14) 0; box-shadow: 0 0 0 1.5px #FBF3EA; }
.hf-v { right: 0; bottom: 0; border-radius: calc(var(--cw) * 0.14) 0 0 0; background: #161026; }
.hf-vB { background: #D9B25F; color: #161026; text-shadow: none; }
.hf-vA { background: #2E3A7C; }
.hf-card.is-hit { box-shadow: 0 0 0 3px var(--gold), 0 0 16px 3px rgba(246, 166, 193, 0.75); animation: hf-pulse 0.9s ease-in-out infinite alternate; z-index: 2; }
.hf-card.is-sel { transform: translateY(-7px); box-shadow: 0 0 0 3px var(--w-gold), 0 10px 18px rgba(0, 0, 0, 0.5); z-index: 3; }
.hf-card.has-match::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--w-torii); box-shadow: 0 0 0 2px #FBF3EA; }
.hf-card.is-new { animation: hf-in 0.34s var(--ease-out) both; }
.hf-card.is-take { animation: hf-take 0.52s ease-in both; z-index: 4; box-shadow: 0 0 0 3px var(--w-gold), 0 0 18px 4px rgba(217, 178, 95, 0.8); }
.hf-stock {
  cursor: default;
  background:
    radial-gradient(circle at 50% 42%, #F6A6C1 0 9%, transparent 10%),
    radial-gradient(circle at 50% 42%, transparent 0 17%, rgba(246, 166, 193, 0.5) 18% 21%, transparent 22%),
    linear-gradient(180deg, #7A2A22, #4E1712);
  box-shadow: 0 0 0 2px #161026, 3px 3px 0 0 #3A120E, 5px 5px 0 0 #161026;
}
.hf-stock.is-out { background: rgba(251, 243, 234, 0.05); box-shadow: inset 0 0 0 1px rgba(251, 243, 234, 0.2); }
.hf-count { position: absolute; left: 0; right: 0; bottom: 8%; text-align: center; font: 800 calc(var(--cw) * 0.3)/1 var(--font-text); color: #FBD3E0; }
.hf-slot { background: rgba(246, 166, 193, 0.1); box-shadow: inset 0 0 0 2px var(--gold); animation: hf-pulse 0.9s ease-in-out infinite alternate; }
.hf-slot::before { content: "+"; position: absolute; top: 50%; left: 0; right: 0; margin-top: -0.6em; font: 800 calc(var(--cw) * 0.5)/1.2 var(--font-text); color: var(--gold); }
.hf-mid { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 62px; width: 100%; }
.hf-year { display: flex; gap: 5px; }
.hf-dot { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(251, 243, 234, 0.35); }
.hf-dot.is-full { box-shadow: 0 0 0 2px var(--w-gold), 0 0 8px rgba(217, 178, 95, 0.9); }
.hf-status { min-height: 24px; margin: 0; font-size: 0.86rem; text-align: center; }
html[lang="ar"] .hf-status { direction: rtl; }
.hf-pop {
  position: absolute; top: 34%; left: 50%; z-index: 6;
  font: 800 2.2rem/1 var(--font-display); color: var(--w-gold);
  text-shadow: 0 2px 0 #161026, 0 0 14px rgba(22, 16, 38, 0.9);
  pointer-events: none;
  animation: hf-pop 0.9s var(--ease-out) both;
}
@keyframes hf-pulse { from { filter: brightness(1); } to { filter: brightness(1.14); } }
@keyframes hf-in { from { transform: translateY(-14px) rotateY(80deg) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hf-take { 0% { transform: scale(1); opacity: 1; } 35% { transform: scale(1.12) rotate(-3deg); opacity: 1; } 100% { transform: translateY(26px) scale(0.5) rotate(6deg); opacity: 0; } }
@keyframes hf-pop { from { transform: translate(-50%, 10px) scale(0.6); opacity: 0; } 25% { transform: translate(-50%, 0) scale(1.1); opacity: 1; } to { transform: translate(-50%, -34px) scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hf-card.is-new, .hf-card.is-hit, .hf-slot { animation: none; } }
body[data-game="hanafuda"] .fa-title { font-size: clamp(0.95rem, 4.4vw, 1.5rem); line-height: 1.05; white-space: normal; }
