/* Family Feud-style scoreboard overlay
   Uses scoreboard-numbered-1-8.png as the background image.
   Coordinates are percentage-based so the board scales responsively.
   Empty answer slots are covered with a blank blue panel and show no number.
   Revealed answer text is also fitted in JavaScript so long answers shrink before truncating. */

.ff-board {
  position: relative;
  width: min(100%, 1672px);
  aspect-ratio: 1672 / 941;
  user-select: none;
  font-family: Impact, Haettenschweiler, "Arial Black", system-ui, sans-serif;
}

.ff-board__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.ff-score {
  position: absolute;
  left: 40.61%;
  top: 4.46%;
  width: 18.84%;
  height: 18.92%;
  display: grid;
  place-items: center;
  color: #f5f7ff;
  font-size: clamp(28px, 6vw, 96px);
  line-height: 1;
  letter-spacing: 0.03em;
  text-shadow:
    0 4px 0 #111,
    0 0 14px rgba(45, 146, 255, 0.9),
    0 0 28px rgba(45, 146, 255, 0.65);
  pointer-events: none;
}

.ff-slot {
  position: absolute;
  overflow: hidden;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff;
  perspective: 800px;
}

.ff-slot.is-empty,
.ff-slot.is-rolling,
.ff-slot.is-revealed {
  cursor: default;
}

.ff-slot:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -4px;
}

.ff-slot[data-slot="1"] { left: 22.847%; top: 30.818%; width: 26.017%; height: 10.202%; }
.ff-slot[data-slot="2"] { left: 22.847%; top: 44.846%; width: 26.017%; height: 10.202%; }
.ff-slot[data-slot="3"] { left: 22.847%; top: 58.980%; width: 26.017%; height: 10.202%; }
.ff-slot[data-slot="4"] { left: 22.847%; top: 73.007%; width: 26.017%; height: 10.202%; }
.ff-slot[data-slot="5"] { left: 50.179%; top: 30.818%; width: 26.555%; height: 10.202%; }
.ff-slot[data-slot="6"] { left: 50.179%; top: 44.846%; width: 26.555%; height: 10.202%; }
.ff-slot[data-slot="7"] { left: 50.179%; top: 58.980%; width: 26.555%; height: 10.202%; }
.ff-slot[data-slot="8"] { left: 50.179%; top: 73.007%; width: 26.555%; height: 10.202%; }

.ff-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(40, 162, 255, 0.95) 0%, rgba(0, 82, 207, 0.98) 46%, rgba(0, 27, 105, 0.98) 100%);
  border: 2px solid rgba(228, 244, 255, 0.95);
  box-shadow:
    inset 0 0 0 2px rgba(0, 13, 48, 0.85),
    inset 0 12px 18px rgba(255, 255, 255, 0.12),
    inset 0 -16px 24px rgba(0, 0, 0, 0.38),
    0 0 10px rgba(0, 113, 255, 0.35);
  transition: opacity 160ms ease;
}

.ff-cover-number {
  color: #f5f7ff;
  font-size: clamp(24px, 3.35vw, 68px);
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow:
    0 4px 0 #111,
    0 0 12px rgba(0, 0, 0, 0.75),
    0 0 8px rgba(255, 255, 255, 0.6);
}

.ff-slot.is-empty .ff-cover-number {
  display: none;
}

.ff-slot.is-rolling .ff-cover,
.ff-slot.is-revealed .ff-cover {
  opacity: 0;
}

.ff-reel {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  transform: translateY(-300%) rotateX(0deg);
  transform-origin: center center;
  pointer-events: none;
}

.ff-slot.is-rolling .ff-reel {
  opacity: 1;
  animation: ff-reel-roll 850ms cubic-bezier(.17,.67,.23,1.04) forwards;
}

.ff-slot.is-revealed .ff-reel {
  opacity: 1;
  transform: translateY(0) rotateX(0deg);
}

.ff-panel {
  height: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2px minmax(40px, 16%);
  align-items: center;
  background:
    linear-gradient(180deg, rgba(40, 162, 255, 0.95) 0%, rgba(0, 82, 207, 0.98) 46%, rgba(0, 27, 105, 0.98) 100%);
  border: 2px solid rgba(228, 244, 255, 0.95);
  box-shadow:
    inset 0 0 0 2px rgba(0, 13, 48, 0.85),
    inset 0 12px 18px rgba(255, 255, 255, 0.12),
    inset 0 -16px 24px rgba(0, 0, 0, 0.38),
    0 0 10px rgba(0, 113, 255, 0.35);
}

.ff-answer,
.ff-points {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 0.45em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 3px 0 #0b0b0b, 0 0 8px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  line-height: 1;
}

.ff-answer {
  font-size: clamp(12px, 2.05vw, 39px);
  letter-spacing: 0.01em;
}

.ff-divider {
  height: 78%;
  width: 2px;
  background: linear-gradient(180deg, rgba(255,255,255,0.25), #fff, rgba(255,255,255,0.25));
  box-shadow: 0 0 7px rgba(255,255,255,0.75);
}

.ff-points {
  font-size: clamp(14px, 2.45vw, 48px);
}


.ff-strike-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3.5%;
  pointer-events: none;
  opacity: 0;
  transform: scale(.86);
  transition: opacity 140ms ease, transform 140ms ease;
}

.ff-strike-overlay.is-active {
  opacity: 1;
  transform: scale(1);
}

.ff-strike-mark {
  display: grid;
  place-items: center;
  width: clamp(72px, 13vw, 210px);
  height: clamp(72px, 13vw, 210px);
  border-radius: 22px;
  color: #fff;
  background: radial-gradient(circle at 50% 35%, #ff4b4b 0%, #dc2626 46%, #7f1d1d 100%);
  border: clamp(3px, .45vw, 8px) solid #fff;
  font-size: clamp(68px, 14vw, 220px);
  font-family: Impact, Haettenschweiler, "Arial Black", system-ui, sans-serif;
  line-height: .84;
  text-shadow:
    0 .04em 0 #3f0505,
    0 0 .08em rgba(0, 0, 0, .9),
    0 0 .12em rgba(255, 255, 255, .75);
  box-shadow:
    0 0 22px rgba(255, 255, 255, .65),
    0 0 38px rgba(220, 38, 38, .85),
    inset 0 0 16px rgba(255, 255, 255, .25),
    inset 0 -22px 28px rgba(0, 0, 0, .3);
}

@keyframes ff-reel-roll {
  0% {
    opacity: 1;
    transform: translateY(-360%) rotateX(0deg);
    filter: blur(4px);
  }
  40% {
    transform: translateY(-170%) rotateX(78deg);
    filter: blur(3px);
  }
  70% {
    transform: translateY(-55%) rotateX(255deg);
    filter: blur(1px);
  }
  100% {
    transform: translateY(0) rotateX(360deg);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ff-slot.is-rolling .ff-reel {
    animation: none;
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
  }
}
