/* Alfapet / Scrabble */

.af-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  justify-content: center;
  align-items: center;
  margin: 0.5rem 0 0.85rem;
  font-size: 0.9rem;
}

.af-hud strong {
  color: #e8f0ff;
}

.af-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 760px) {
  .af-layout {
    grid-template-columns: 1fr;
  }
}

.af-board {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  gap: 1px;
  background: #1a2a1a;
  border: 3px solid #3d5c3d;
  border-radius: 8px;
  padding: 3px;
  max-width: min(100%, 34rem);
  margin: 0 auto;
  aspect-ratio: 1;
}

.af-cell {
  position: relative;
  aspect-ratio: 1;
  border: none;
  border-radius: 2px;
  padding: 0;
  background: #2d4a2d;
  color: #c8dcf5;
  cursor: pointer;
  font-size: clamp(0.45rem, 1.8vw, 0.7rem);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.af-cell.af-dl {
  background: #3d6a9e;
}

.af-cell.af-tl {
  background: #2a6f9c;
}

.af-cell.af-dw,
.af-cell.af-center {
  background: #a85a6a;
}

.af-cell.af-tw {
  background: #8b3a3a;
}

.af-prem {
  opacity: 0.75;
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.af-cell.filled,
.af-cell.draft {
  background: linear-gradient(160deg, #f3e6c8 0%, #e2c98a 100%);
  color: #2a1f12;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.af-cell.draft {
  outline: 2px solid #5b8def;
  outline-offset: -2px;
}

.af-tile-letter {
  font-weight: 800;
  font-size: clamp(0.7rem, 2.6vw, 1rem);
}

.af-tile-pts {
  position: absolute;
  right: 1px;
  bottom: 0;
  font-size: 0.45em;
  font-weight: 700;
  opacity: 0.75;
}

.af-rack-wrap {
  margin: 0.85rem auto 0.5rem;
  max-width: min(100%, 34rem);
  text-align: center;
}

.af-rack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  min-height: 3rem;
}

.af-rack-tile {
  position: relative;
  width: 2.5rem;
  height: 2.85rem;
  border-radius: 6px;
  border: 1px solid #c4a574;
  background: linear-gradient(160deg, #f7ecd2, #dfc48a);
  color: #2a1f12;
  cursor: pointer;
  box-shadow: 0 2px 0 #a88b55;
}

.af-rack-tile.selected {
  outline: 2px solid #5b8def;
  transform: translateY(-3px);
}

.af-rack-tile.used {
  opacity: 0.35;
}

.af-rack-tile .af-tile-letter {
  font-size: 1.15rem;
}

.af-side {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.af-side h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--accent);
}

.af-history {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  color: var(--muted);
  max-height: 12rem;
  overflow-y: auto;
}

.af-history li {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
}

.af-legend {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.af-status {
  text-align: center;
  min-height: 1.4em;
  margin: 0.65rem 0;
  font-weight: 600;
}

.af-status.win {
  color: #86efac;
}

.af-status.idle {
  color: #c8dcf5;
}

.game-controls-row .btn-secondary.active {
  border-color: var(--accent);
  background: rgba(91, 141, 239, 0.18);
}

.player-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
}

.player-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(200, 220, 245, 0.12);
}

.share-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
