/* Word Race — game-specific styles (shared multiplayer UI in ../mp.css) */

.play-area {
  display: flex;
  gap: 16px;
  align-items: stretch;
  position: relative;
}

.grid-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.grid {
  display: grid;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  touch-action: none;
  width: min(100%, calc(100dvh - 200px));
  align-self: flex-start;
}

.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  font-weight: 700;
  font-size: inherit;
  border-radius: 6px;
  color: var(--ink);
  background: var(--bg);
  transition: background 0.1s ease;
}

.cell.selecting {
  background: var(--accent) !important;
  color: #fff;
}

.cell.claim-0 { background: var(--found-1); }
.cell.claim-1 { background: var(--found-2); }
.cell.claim-2 { background: var(--found-3); }
.cell.claim-3 { background: var(--found-4); }
.cell.claim-4 { background: var(--found-5); }
.cell.claim-5 { background: var(--found-6); }
.cell.claim-6 { background: var(--found-7); }
.cell.claim-7 { background: var(--found-8); }

.word-panel {
  flex: 0 0 280px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  align-self: flex-start;
  max-height: 100%;
  overflow-y: auto;
}

.word-panel .race-scores {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.word-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.word-panel-head h2 {
  font-size: 1rem;
}

.progress {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.word-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  font-size: 0.82rem;
}

.word-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--bg);
  white-space: nowrap;
  overflow: hidden;
}

.word-list li .player-dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.word-list li.claimed {
  text-decoration: line-through;
  opacity: 0.55;
}

.queued-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  border-radius: 12px;
  padding: 12px 18px;
  text-align: center;
  margin-bottom: 12px;
}

/* ---------- Narrow screens ---------- */
@media (max-width: 760px) {
  .play-area {
    flex-direction: column;
  }

  .word-panel {
    flex: 1 1 auto;
    width: 100%;
    max-height: none;
  }

  .grid {
    width: 100%;
  }
}
