/* ===== Квиз-Дуэль: общие компоненты (UI-BASE) ===== */

/* --- Сетка карточек команд --- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.team-card {
  background: var(--card);
  border: 2px solid transparent;
  border-radius: var(--radius-s);
  box-shadow: var(--shadow);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.3;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, transform .08s ease;
  word-break: break-word;
  animation: fadeIn .25s ease;
}
.team-card:active { transform: scale(.97); }
.team-card.is-selected { border-color: var(--yellow); background: var(--yellow-soft); }
.team-card .team-emoji { font-size: 20px; display: block; margin-bottom: 4px; }
.team-card.is-disabled { opacity: .4; cursor: default; }

/* --- Строки таблицы / рейтинга --- */
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  animation: fadeIn .25s ease;
}
.rank-row .rank-num {
  flex: 0 0 30px;
  font-weight: 800;
  font-size: 16px;
  color: var(--ink-soft);
  text-align: center;
}
.rank-row .rank-name {
  flex: 1;
  font-weight: 800;
  font-size: 15px;
  word-break: break-word;
}
.rank-row .rank-pts {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.rank-row.is-me {
  background: var(--yellow);
  box-shadow: var(--shadow-lg);
}
.rank-row.is-me .rank-num, .rank-row.is-me .rank-pts { color: var(--ink); }
.rank-row .medal { font-size: 16px; }

/* --- Карточки истории дуэлей --- */
.hist-list { display: flex; flex-direction: column; gap: 10px; }
.hist-card {
  background: var(--card);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  cursor: pointer;
  transition: transform .08s ease;
  animation: fadeIn .25s ease;
}
.hist-card:active { transform: scale(.98); }
.hist-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
}
.hist-team { flex: 1; text-align: center; word-break: break-word; line-height: 1.25; }
.hist-team:first-child { text-align: left; }
.hist-team:last-child { text-align: right; }
.hist-score .score {
  flex: 0 0 auto;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  padding: 2px 10px;
  border-radius: 10px;
  background: var(--bg);
}
.hist-score .score.winner { background: var(--yellow); }
.hist-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}
.hist-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #FDECEC;
  color: #C43A2F;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* --- Карточка ошибки / повтора --- */
.retry-card { text-align: center; padding: 28px 20px; }
.retry-card .retry-emoji { font-size: 34px; margin-bottom: 8px; }
.retry-card .retry-text { color: var(--ink-soft); font-size: 14px; margin: 6px 0 16px; }

/* --- Скелетон загрузки --- */
.skel { background: linear-gradient(90deg, #EEF0F3 25%, #F7F8FA 50%, #EEF0F3 75%); background-size: 200% 100%; animation: skel 1.2s infinite linear; border-radius: var(--radius-s); }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
