/* ===== Квиз-Дуэль: общие компоненты (стилистика Т-Банка 2.0) ===== */

/* --- Сетка карточек команд --- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 10px;
  margin-top: 12px;
  max-height: 40vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px;
  scrollbar-width: thin;
}
.team-grid::-webkit-scrollbar { width: 5px; }
.team-grid::-webkit-scrollbar-thumb { background: #D5D8DE; border-radius: 999px; }
.team-card {
  background: var(--card);
  border: 1.5px solid rgba(29, 32, 36, 0.08);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-sm);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.3;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s cubic-bezier(0.16, 1, 0.3, 1);
  word-break: break-word;
  animation: fadeIn .25s ease;
  user-select: none;
}
.team-card:hover {
  border-color: var(--yellow-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.team-card:active { transform: scale(.96); }
.team-card.is-selected {
  border-color: var(--yellow-deep);
  background: var(--yellow-soft);
  box-shadow: 0 4px 14px rgba(245, 196, 0, 0.3);
}
.team-card.team-card--add {
  border: 2px dashed var(--ink-faint);
  background: transparent;
  color: var(--ink-soft);
  opacity: 0.85;
}
.team-card.team-card--add:hover {
  opacity: 1;
  border-color: var(--ink);
  color: var(--ink);
}
.team-card .team-emoji { font-size: 18px; display: block; margin-bottom: 2px; }
.team-card.is-disabled { opacity: .4; cursor: default; transform: none !important; box-shadow: none !important; }

/* --- Строки таблицы / рейтинга --- */
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: var(--border-subtle);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
  animation: fadeIn .25s ease;
  transition: transform .12s ease;
}
.rank-row .rank-num {
  flex: 0 0 32px;
  font-weight: 800;
  font-size: 15px;
  color: var(--ink-soft);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rank-row .rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}
.rank-badge--1 { background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%); color: #4B2E00; box-shadow: 0 2px 8px rgba(255, 165, 0, 0.4); }
.rank-badge--2 { background: linear-gradient(135deg, #E0E2E6 0%, #BCC1C9 100%); color: #2B3037; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); }
.rank-badge--3 { background: linear-gradient(135deg, #F0C49E 0%, #CD7F32 100%); color: #3E1E00; box-shadow: 0 2px 6px rgba(205, 127, 50, 0.3); }

.rank-row .rank-name {
  flex: 1;
  font-weight: 800;
  font-size: 15px;
  word-break: break-word;
  color: var(--ink);
}
.rank-row .rank-pts {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  background: #F4F5F7;
  padding: 4px 10px;
  border-radius: 8px;
}
.rank-row.is-me {
  background: var(--yellow-grad);
  border-color: rgba(245, 196, 0, 0.5);
  box-shadow: var(--shadow-yellow);
}
.rank-row.is-me .rank-name { color: var(--ink); }
.rank-row.is-me .rank-num { color: var(--ink); }
.rank-row.is-me .rank-pts { background: rgba(255, 255, 255, 0.7); color: var(--ink); }

/* --- Карточки истории дуэлей --- */
.hist-list { display: flex; flex-direction: column; gap: 10px; }
.hist-card {
  background: var(--card);
  border: var(--border-subtle);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease;
  animation: fadeIn .25s ease;
}
.hist-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.hist-card:active { transform: scale(.98); }
.hist-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
}
.hist-team { flex: 1; 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: 18px;
  font-variant-numeric: tabular-nums;
  padding: 3px 12px;
  border-radius: 10px;
  background: #F0F2F5;
  color: var(--ink);
  font-weight: 800;
}
.hist-score .score.winner {
  background: var(--yellow-grad);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(245, 196, 0, 0.35);
}
.hist-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #F0F2F5;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}
.hist-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.hist-badge--ok {
  background: var(--ok-soft);
  color: var(--ok);
}

/* --- Табы выбора категорий --- */
.tabs {
  display: flex;
  background: #E4E7EB;
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 14px;
}
.tab-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 9px 8px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s cubic-bezier(0.16, 1, 0.3, 1);
}
.tab-btn.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(29, 32, 36, 0.08);
}
.tab-btn:active { transform: scale(.97); }

/* --- Карточка ошибки / повтора --- */
.retry-card { text-align: center; padding: 28px 20px; }
.retry-card .retry-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--ink-soft);
}
.retry-card .retry-text { color: var(--ink-soft); font-size: 14px; margin: 6px 0 16px; }

/* --- Индикаторы энергии / лимитов дуэлей --- */
.energy-card {
  background: #F8F9FA;
  border: 1px solid #E9ECF0;
  border-radius: var(--radius-s);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.energy-label { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.energy-slots { display: flex; align-items: center; gap: 6px; }
.energy-pip {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #E2E5E9;
  transition: all .2s ease;
}
.energy-pip.is-full {
  background: var(--ok);
  box-shadow: 0 0 8px rgba(0, 179, 65, 0.45);
}
.energy-pip.is-inter {
  background: var(--yellow-deep);
  box-shadow: 0 0 8px rgba(245, 196, 0, 0.5);
}

/* --- Быстрые действия в меню (плитка) --- */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.action-tile {
  background: var(--card);
  border: var(--border-subtle);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-sm);
  padding: 12px 6px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  transition: all .15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.action-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(29, 32, 36, 0.12);
}
.action-tile:active { transform: scale(.95); }
.action-tile-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
