/* First & Last: everything scoped under .game--first-last */

.game--first-last .fl {
  display: grid;
  justify-items: center;
  gap: 22px;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.game--first-last .fl__rule { margin: 0; color: var(--muted); font-size: 1.05rem; }
.game--first-last .fl__rule strong { color: var(--text); }

/* Letter tiles */
.game--first-last .fl__tiles { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 4vw, 28px); }
.game--first-last .fl__dots { font-size: clamp(2rem, 8vw, 3.5rem); font-weight: 800; color: var(--muted); }

.game--first-last .fl-tile {
  display: grid;
  place-items: center;
  gap: 2px;
  width: clamp(110px, 30vw, 170px);
  aspect-ratio: 1;
  padding-bottom: 10px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.game--first-last .fl-tile__letter {
  font-size: clamp(4rem, 16vw, 6.5rem);
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
}
.game--first-last .fl-tile__label { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.game--first-last .fl-tile--empty .fl-tile__letter { color: var(--border); }

.game--first-last .fl__tiles--fresh .fl-tile { animation: fl-flip .45s cubic-bezier(.3, 1.4, .5, 1) both; }
.game--first-last .fl__tiles--fresh .fl-tile:last-child { animation-delay: .12s; }
@keyframes fl-flip {
  from { transform: rotateX(90deg) scale(.9); opacity: 0; }
  to { transform: rotateX(0) scale(1); opacity: 1; }
}

.game--first-last .fl__deal { min-width: 240px; }

/* Player buttons */
.game--first-last .fl__players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: 100%; }
.game--first-last .fl-player {
  display: grid;
  gap: 2px;
  padding: 18px 12px;
  border: 3px solid var(--pc);
  border-radius: 20px;
  background: var(--pc-soft);
  color: var(--pc);
  cursor: pointer;
  transition: transform .08s ease, opacity .15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.game--first-last .fl-player:active:not(:disabled) { transform: scale(.97); }
.game--first-last .fl-player:disabled { cursor: default; opacity: .7; }
.game--first-last .fl-player:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.game--first-last .fl-player__name { font-weight: 800; font-size: 1.1rem; overflow-wrap: anywhere; }
.game--first-last .fl-player__score { font-size: clamp(3rem, 12vw, 4.5rem); font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.game--first-last .fl-player__hint { font-size: .8rem; font-weight: 650; opacity: .8; }
.game--first-last .fl-player.is-bumped .fl-player__score { animation: fl-bump .4s ease; }
@keyframes fl-bump {
  40% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.game--first-last .fl__footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.game--first-last .fl__keys { font-size: .8rem; color: var(--muted); }
@media (hover: none) {
  .game--first-last .fl__keys { display: none; }
}

/* History */
.game--first-last .fl__history { width: 100%; }
.game--first-last .fl__history-title { margin-bottom: 8px; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.game--first-last .fl__history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.game--first-last .fl-hist {
  display: inline-flex; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--pc-soft);
  color: var(--pc);
  font-size: .85rem;
}
.game--first-last .fl-hist__pair { font-weight: 800; }
