/* FCC Family Games — Go Fish (Phase 7B.3 visual polish). Scoped to .fcc-gf only. */

.fcc-gf {
  --gf-red: #c2185b;
  --gf-black: #1f2937;
  --gf-narration: #475569;
  position: relative;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 2px 8px;
  background: linear-gradient(180deg, #fafbff, #f1f3ff);
  border-radius: 18px;
}

.fcc-gf *,
.fcc-gf *::before,
.fcc-gf *::after {
  box-sizing: border-box;
}

/* Head row — mirrors .fcc-games-game__header grid (Go Fish uses __head) */
.fcc-gf > .fcc-games-game__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.fcc-gf > .fcc-games-game__head .fcc-games-game__title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin: 0;
  min-width: 0;
}

.fcc-gf > .fcc-games-game__head .fcc-games-btn {
  min-height: 44px;
  min-width: 44px;
}

/* Banners */
.fcc-gf-banner {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(120, 120, 128, 0.18);
}

.fcc-gf-banner--win {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: rgba(245, 158, 11, 0.35);
}

.fcc-gf-banner--tie {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(100, 116, 139, 0.25);
}

@keyframes fcc-gf-celebrate {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.fcc-gf-banner--win .fcc-gf-banner__celebrate {
  display: inline;
  animation: fcc-gf-celebrate 600ms ease-out forwards;
}

/* Opponents */
.fcc-gf-opponents {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.fcc-gf-opp {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  min-height: 44px;
  justify-content: flex-start;
  max-width: 100%;
}

.fcc-gf-opp.is-turn {
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.45);
}

.fcc-gf-opp__name {
  font-size: 13px;
  font-weight: 600;
}

.fcc-gf-opp__count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.fcc-gf-opp__books {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #10b981;
  color: #fff;
}

/* Mini card back in chips */
.fcc-gf-opp .fcc-gf-card--back {
  width: 24px;
  height: 34px;
  font-size: 14px;
  margin: 0;
  flex-shrink: 0;
}

/* Table */
.fcc-gf-table {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

@media (min-width: 720px) {
  .fcc-gf-table {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 24px;
  }

  .fcc-gf-draw {
    flex-shrink: 0;
  }

  .fcc-gf-narration {
    flex: 1;
    text-align: left !important;
    max-width: 40ch;
  }
}

/* Draw pile */
.fcc-gf-draw {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.fcc-gf-draw__count {
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(108, 99, 255, 0.14);
  border: 1px solid rgba(108, 99, 255, 0.22);
}

@keyframes fcc-gf-bounce {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-6px) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}

.fcc-gf-draw--pulse {
  animation: fcc-gf-bounce 280ms ease-out;
}

/* Narration */
.fcc-gf-narration {
  max-width: 32ch;
  margin: 0 auto;
  text-align: center;
  font-style: italic;
  color: var(--gf-narration);
  font-size: 15px;
  line-height: 1.45;
}

/* Playing cards */
.fcc-gf-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 78px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-family: inherit;
  padding: 6px 4px;
  cursor: default;
  vertical-align: middle;
  margin: 0;
}

.fcc-gf-card__rank {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.fcc-gf-card__suit {
  font-size: 22px;
  line-height: 1;
  margin-top: 4px;
  pointer-events: none;
}

.fcc-gf-card--red .fcc-gf-card__rank,
.fcc-gf-card--red .fcc-gf-card__suit {
  color: var(--gf-red);
}

.fcc-gf-card--black .fcc-gf-card__rank,
.fcc-gf-card--black .fcc-gf-card__suit {
  color: var(--gf-black);
}

.fcc-gf-card--back {
  background: linear-gradient(135deg, #6c63ff, #4f80ff);
  color: rgba(255, 255, 255, 0.9);
  font-size: 28px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  border: none;
}

button.fcc-gf-card {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
}

button.fcc-gf-card:focus-visible {
  outline: 2px solid #6c63ff;
  outline-offset: 2px;
  z-index: 5;
}

@media (min-width: 1024px) {
  .fcc-gf-card {
    width: 72px;
    height: 100px;
  }

  .fcc-gf-card__rank {
    font-size: 20px;
  }

  .fcc-gf-card__suit {
    font-size: 26px;
  }

  .fcc-gf-card--back {
    font-size: 34px;
  }
}

/* Hand fan */
.fcc-gf-hand {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: center;
  padding: 8px 4px 12px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  min-height: 100px;
  -webkit-overflow-scrolling: touch;
}

.fcc-gf-hand .fcc-gf-card {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  margin-left: -22px;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fcc-gf-hand .fcc-gf-card:first-child {
  margin-left: 0;
}

.fcc-gf-hand .fcc-gf-card:hover,
.fcc-gf-hand .fcc-gf-card:focus-visible,
.fcc-gf-hand .fcc-gf-card:active,
.fcc-gf-hand .fcc-gf-card.is-selected {
  transform: translateY(-8px) rotate(0deg);
  z-index: 5;
}

@keyframes fcc-gf-deal {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.fcc-gf[data-initial-deal='true'] .fcc-gf-hand .fcc-gf-card {
  animation: fcc-gf-deal 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 30ms);
}

.fcc-gf-yourhand h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
}

/* Curtain */
.fcc-gf-hand--curtain {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 120px;
  padding: 28px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef2ff, #e0f2fe);
  border: 1px solid rgba(108, 99, 255, 0.16);
  position: relative;
  overflow: hidden;
}

.fcc-gf-hand--curtain .fcc-games-btn--primary {
  min-height: 48px;
  padding: 12px 20px;
}

.fcc-gf-hand--curtain::before {
  content: '🐟';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 96px;
  line-height: 1;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

.fcc-gf-hand--curtain .fcc-games-btn,
.fcc-gf-hand--curtain p {
  position: relative;
  z-index: 1;
}

/* Books */
.fcc-gf-books {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.fcc-gf-books__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(120, 120, 128, 0.14);
  min-width: 0;
}

.fcc-gf-books__name {
  font-weight: 600;
  font-size: 14px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fcc-gf-books__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #10b981;
  color: #fff;
  white-space: nowrap;
}

.fcc-gf-books__set {
  text-align: right;
  min-width: 0;
}

/* Controls */
.fcc-gf-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  bottom: 8px;
  z-index: 2;
  padding: 8px 0;
  background: linear-gradient(180deg, transparent, rgba(241, 243, 255, 0.92) 20%);
}

.fcc-gf-controls .fcc-games-btn {
  min-height: 44px;
}

.fcc-gf-controls .fcc-games-btn--primary {
  align-self: center;
  min-width: min(100%, 200px);
}

.fcc-gf-prompt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e0f2fe, #ddd6fe);
  border: 1px solid rgba(108, 99, 255, 0.2);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  color: #1e293b;
}

.fcc-gf-prompt__fish {
  flex-shrink: 0;
  font-size: 1.4em;
  line-height: 1;
  vertical-align: -2px;
}

.fcc-gf-ask-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.fcc-gf-ask-label {
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.fcc-gf .fcc-gf-target,
.fcc-gf .fcc-gf-rank {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
}

.fcc-gf .fcc-gf-target.is-active,
.fcc-gf .fcc-gf-rank.is-active {
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.45);
}

@media (max-width: 640px) {
  .fcc-gf > .fcc-games-game__head {
    gap: 8px;
  }

  .fcc-gf > .fcc-games-game__head .fcc-games-game__title {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fcc-gf *,
  .fcc-gf *::before,
  .fcc-gf *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
