/* Silly Face Challenge — scoped to .g-faces */
.g-faces .sf-hint { text-align: center; font-family: var(--head); font-weight: 600; color: var(--ink-soft); margin: -4px auto 16px; font-size: 1.15rem; max-width: 40em; min-height: 1.4em; }
.g-faces .sf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
.g-faces .sf-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; perspective: 1000px; }
@media (max-width: 960px) { .g-faces .sf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .g-faces .sf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.g-faces .sf-foot { text-align: center; margin: 22px 0 0; color: var(--ink-soft); }

.g-faces .sf-card {
  position: relative; width: 100%; aspect-ratio: 3 / 4.3; padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 22px; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  animation: sfDeal .5s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: var(--d, 0ms);
}
@supports not (aspect-ratio: 1) { .g-faces .sf-card { height: 300px; } }
.g-faces .sf-card:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; }
.g-faces .sf-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3, 1.35, .5, 1); border-radius: inherit; }
.g-faces .sf-card.is-up .sf-inner { transform: rotateY(180deg); }
.g-faces .sf-card:not(.is-up):hover .sf-inner { transform: translateY(-4px) rotate(-1.5deg); }
.g-faces .sf-face {
  position: absolute; inset: 0; border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px 10px 14px; text-align: center;
  background: #fff; box-shadow: inset 0 0 0 6px var(--sf), 0 6px 0 rgba(60, 30, 35, .14), 0 10px 18px rgba(60, 30, 35, .12);
}
.g-faces .sf-back { background: var(--tint); }
.g-faces .sf-front { transform: rotateY(180deg); background: linear-gradient(180deg, var(--tint) 0 58%, #fff 58%); }
.g-faces .sf-q {
  width: 56%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--sf);
  font-family: var(--head); font-weight: 700; font-size: clamp(2.4rem, 6vw, 3.6rem); box-shadow: inset 0 0 0 5px var(--sf); margin-bottom: 8px;
}
.g-faces .sf-front img { height: 52%; width: auto; max-width: 92%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(60, 30, 35, .2)); pointer-events: none; user-select: none; }
.g-faces .sf-word { font-family: var(--head); font-weight: 700; font-size: clamp(1.05rem, 2.4vw, 1.5rem); color: var(--sf); letter-spacing: .5px; line-height: 1.1; margin-top: 4px; }
.g-faces .sf-who { font-family: var(--head); font-weight: 600; font-size: .95rem; color: var(--ink-soft); }
.g-faces .sf-tip { font-size: .86rem; line-height: 1.25; color: var(--ink-soft); }
.g-faces .sf-card.is-wiggle .sf-inner { animation: sfWiggle .6s ease; }
@keyframes sfDeal { from { opacity: 0; transform: translateY(18px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes sfWiggle { 0%, 100% { transform: rotateY(180deg); } 25% { transform: rotateY(180deg) rotate(-5deg) scale(1.04); } 60% { transform: rotateY(180deg) rotate(4deg) scale(1.04); } }
@media (max-width: 560px) { .g-faces .sf-tip { font-size: .78rem; } .g-faces .sf-who { font-size: .85rem; } }
/* Japanese: tips are longer in full-width letters; break at the picture-book spaces, keep them inside the card */
html[lang="ja"] .g-faces .sf-word { letter-spacing: 0; }
html[lang="ja"] .g-faces .sf-tip { font-size: .8rem; line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
html[lang="ja"] .g-faces .sf-hint, html[lang="ja"] .g-faces .sf-foot { word-break: keep-all; overflow-wrap: anywhere; }
@media (max-width: 560px) { html[lang="ja"] .g-faces .sf-tip { font-size: .72rem; } }
@media (prefers-reduced-motion: reduce) { .g-faces .sf-card, .g-faces .sf-inner, .g-faces .sf-card.is-wiggle .sf-inner { animation: none; transition: none; } }
