/* ---------- Lobby ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.chip:disabled {
  cursor: default;
}

.letters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 6px;
}

.letter-toggle {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.letter-toggle[aria-pressed="false"] {
  background: var(--surface-2);
  color: var(--muted);
  text-decoration: line-through;
}

.letter-toggle:disabled {
  cursor: default;
}

.read-only-value {
  font-weight: 700;
}

/* ---------- Playing ---------- */

.round-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.letter-tile {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 3.2rem;
  font-weight: 900;
  box-shadow: var(--shadow);
  animation: pop 0.4s ease-out;
}

.timer {
  font-size: 2rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.timer.low {
  color: var(--bad);
}

.timer-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.timer-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.25s linear;
}

.answers-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.answers-form input.wrong-letter {
  border-color: var(--warn);
  background: var(--warn-soft);
}

.stop-banner {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bad);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  text-align: center;
  animation: pop 0.3s ease-out;
}

.btn-stop {
  min-height: 56px;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}

.btn-stop:hover {
  background: var(--bad);
  filter: brightness(1.08);
}

.progress {
  width: 60px;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--ok);
}

/* ---------- Review ---------- */

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.review-card h3 {
  font-size: 1.05rem;
}

.answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.answer-row:first-of-type {
  border-top: 0;
}

.answer-who {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.answer-text {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.answer-text.empty {
  color: var(--muted);
  font-weight: 400;
}

.answer-side {
  display: flex;
  align-items: center;
  gap: 6px;
  grid-row: span 2;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge.valid {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge.rejected,
.badge.letter {
  background: var(--bad-soft);
  color: var(--bad);
}

.badge.empty {
  background: var(--surface-2);
  color: var(--muted);
}

.vote-btn {
  min-height: 30px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.vote-btn[aria-pressed="true"] {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}

/* ---------- Scores ---------- */

.table-scroll {
  overflow-x: auto;
}

.detail-table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 0.9rem;
}

.detail-table th,
.detail-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.detail-table td.invalid {
  color: var(--muted);
  text-decoration: line-through;
}

.detail-table .pts {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 4px;
}

@media (max-width: 520px) {
  .letter-tile {
    width: 68px;
    height: 68px;
    font-size: 2.6rem;
  }
}
