/* =========================
   Onglets
   ========================= */

.tabs-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0;
  margin-bottom: 16px;
  background: #020617;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-soft);
  padding: 12px 16px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-variant: small-caps;
  transition: all 0.2s ease;
  border-right: 1px solid var(--border);
  text-align: center;
}

.tab-btn:last-child {
  border-right: none;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(31, 142, 205, 0.1);
  box-shadow: none;
  transform: none;
}

.tab-btn.active {
  color: var(--accent-soft);
  background: rgba(31, 142, 205, 0.15);
  border-bottom: 3px solid var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* =========================
   Team Builder
   ========================= */

#team-builder {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

#team-builder h3 {
  color: var(--accent-soft);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

#team-builder p {
  margin: 0;
}

#team-builder select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

#team-builder select:hover {
  border-color: var(--accent);
}

#team-builder button {
  background: var(--accent);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#team-builder button:hover {
  background: var(--accent-soft);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

#teams-output {
  font-size: 14px;
  color: var(--text-soft);
}

/* =========================
   Historique des matchs
   ========================= */

#history-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Match History - OP.GG Style */
.match-card-opgg {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.match-header-opgg {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--border);
}

.match-date-opgg {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
}

.match-actions-opgg {
  display: flex;
  gap: 8px;
}

.edit-match-btn-opgg,
.delete-match-btn-opgg {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.edit-match-btn-opgg {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-soft);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.edit-match-btn-opgg:hover {
  background: rgba(56, 189, 248, 0.25);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.delete-match-btn-opgg {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.delete-match-btn-opgg:hover {
  background: rgba(239, 68, 68, 0.25);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.match-teams-opgg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.match-team-section {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
}

.match-team-section:last-child {
  border-right: none;
}

.match-team-section.team-win {
  background: rgba(34, 197, 94, 0.05);
  border-left: 3px solid #22c55e;
}

.match-team-section.team-lose {
  background: rgba(239, 68, 68, 0.05);
  border-left: 3px solid #ef4444;
}

.match-team-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.team-result {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.team-win .team-result {
  color: #22c55e;
}

.team-lose .team-result {
  color: #ef4444;
}

.team-label {
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 500;
}

.match-detail-table {
  width: 100%;
  border-collapse: collapse;
}

.match-player-row {
  transition: background 0.2s;
}

.match-player-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.match-player-row.winner-row {
  border-left: 2px solid rgba(34, 197, 94, 0.3);
}

.match-player-row.loser-row {
  border-left: 2px solid rgba(239, 68, 68, 0.3);
}

.match-player-cell {
  padding: 8px 0;
}

.match-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-champion-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-champion-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.match-champion-icon.empty {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.match-player-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.match-player-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.match-player-kda {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.kda-score {
  color: var(--text-soft);
  font-weight: 500;
}

.kda-ratio {
  color: var(--accent-soft);
  font-weight: 600;
  font-size: 11px;
}

.empty-message {
  text-align: center;
  color: var(--text-soft);
  padding: 24px;
  font-size: 14px;
}

/* =========================
   Formules et Variables
   ========================= */

:root {
  --bg: #050816;
  --bg-panel: #0f172a;
  --bg-panel-alt: #111827;
  --accent: #1f8ecd;
  --accent-soft: #38bdf8;
  --border: #1f2937;
  --text: #e5e7eb;
  --text-soft: #9ca3af;
  --error: #f97373;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Helvetica Neue', 'Arial', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.page {
  max-width: 1600px;     /* Large tableau */
  margin: 32px auto 40px;
  padding: 0 24px;       /* petit padding plus aéré */
}


/* =========================
   Titres & Cards
   ========================= */

h1 {
  text-align: center;
  margin: 0 0 20px 0;
  font-size: 42px;
  font-weight: 800;
  background: linear-gradient(135deg, #38bdf8 0%, #1f8ecd 50%, #0ea5e9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px rgba(56, 189, 248, 0.5);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.subtitle {
  text-align: center;
  margin-bottom: 24px;
  color: var(--text-soft);
  font-size: 14px;
}

.card {
  background: linear-gradient(145deg, var(--bg-panel), var(--bg-panel-alt));
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px 16px 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

/* =========================
   Formulaire
   ========================= */

textarea {
  width: 100%;
  height: 120px;
  margin-bottom: 10px;
  background: #020617;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  resize: vertical;
}

label {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text-soft);
}

button {
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  color: white;
  font-weight: 500;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.1s ease;
  box-shadow: 0 10px 25px rgba(31, 142, 205, 0.45);
}

button:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 16px 35px rgba(56, 189, 248, 0.5);
}

button:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.7);
}

/* =========================
   Tableau principal
   ========================= */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: #020617;
  border-radius: var(--radius);
  overflow: hidden;
}

th,
td {
  border-bottom: 1px solid #111827;
  padding: 14px 8px;
  text-align: left;
  font-size: 13px;
}

th {
  background: #020617;
  color: var(--text-soft);
  font-weight: 500;
}

/* Sortable columns */
th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background 0.2s ease;
}

th.sortable:hover {
  background: rgba(31, 142, 205, 0.1);
  color: var(--accent-soft);
}

th.sortable::after {
  content: '⇅';
  margin-left: 6px;
  opacity: 0.3;
  font-size: 11px;
}

th.sortable.sorted-asc::after {
  content: '↑';
  opacity: 1;
  color: var(--accent);
}

th.sortable.sorted-desc::after {
  content: '↓';
  opacity: 1;
  color: var(--accent);
}

/* Custom Checkbox */
.player-select {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: #020617;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.player-select:hover {
  border-color: var(--accent-soft);
  background: rgba(31, 142, 205, 0.1);
}

.player-select:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.player-select:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #020617;
  font-size: 13px;
  font-weight: bold;
}

.player-select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.8);
}

tbody tr:hover {
  background: rgba(30, 64, 175, 0.25);
  cursor: pointer;
}

.checkbox-cell {
  cursor: default !important;
}

/* Cellule joueur : icône de profil + pseudo */
.player-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icône de profil dans le tableau principal */
.profile-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* Icône de rang */
.rank-icon {
  width: 110px;
  height: 66px;
  vertical-align: middle;
  margin-left: 6px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(250, 250, 210, 0.9));
}

/* Winrate vert/rouge */
.winrate-cell {
  font-weight: 600;
}

.winrate-good {
  color: #4ade80;
}

.winrate-bad {
  color: #f87171;
}

/* Podium : 1er, 2e, 3e */
.podium-gold {
  background: linear-gradient(
    90deg,
    rgba(245, 158, 11, 0.22),
    rgba(15, 23, 42, 0.95)
  );
}

.podium-silver {
  background: linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.25),
    rgba(15, 23, 42, 0.95)
  );
}

.podium-bronze {
  background: linear-gradient(
    90deg,
    rgba(180, 83, 9, 0.22),
    rgba(15, 23, 42, 0.95)
  );
}

/* Status & erreurs */

#status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-soft);
}

.error {
  color: var(--error);
  font-size: 12px;
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 700px) {
  th:nth-child(4),
  td:nth-child(4),
  th:nth-child(5),
  td:nth-child(5),
  th:nth-child(6),
  td:nth-child(6) {
    display: none;
  }

  .profile-icon {
    width: 28px;
    height: 28px;
  }
}

/* =========================
   Modale équipes
   ========================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #020617;
  border-radius: 10px;
  border: 1px solid #1f2937;
  padding: 16px 20px 18px;
  max-width: 900px;
  width: 90%;
  max-height: 80vh;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
  overflow: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 24px;
  cursor: pointer;
}

.modal-close:hover {
  color: #f9fafb;
}

.modal-summary {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 10px;
}

.teams-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.clash-links {
  display: flex;
  gap: 12px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.clash-link {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(31, 142, 205, 0.15);
  color: var(--accent-soft);
  border: 1px solid rgba(31, 142, 205, 0.35);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s ease;
}

.clash-link:hover {
  background: rgba(31, 142, 205, 0.25);
  box-shadow: 0 0 12px rgba(31, 142, 205, 0.45);
}

.team-column {
  flex: 1 1 280px;
}

.team-column h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.team-score {
  font-weight: 600;
  color: #38bdf8;
}

/* Tableau dans la popup */
.team-column table {
  width: 100%;
  border-collapse: collapse;
  background: #020617;
  table-layout: fixed;
}

.team-column th,
.team-column td {
  padding: 6px 8px;
  border-bottom: 1px solid #111827;
  font-size: 13px;
  text-align: left;
}

.team-column th {
  color: #9ca3af;
  font-weight: 500;
  background: rgba(15, 23, 42, 0.95);
}

.team-column tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.8);
}

.team-column tbody tr:hover {
  background: rgba(30, 64, 175, 0.4);
}

/* Largeurs des colonnes dans la popup */
.team-column th:nth-child(1),
.team-column td:nth-child(1) {
  width: 45%; /* Joueur */
}

.team-column th:nth-child(2),
.team-column td:nth-child(2) {
  width: 23%; /* Rang */
  white-space: nowrap;
}

.team-column th:nth-child(3),
.team-column td:nth-child(3) {
  width: 16%; /* LP */
}

.team-column th:nth-child(4),
.team-column td:nth-child(4) {
  width: 16%; /* Winrate */
}

/* Joueur dans la popup */
.modal-player {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Pseudo tronqué proprement */
.modal-player span {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Drag handle */
.drag-handle {
  cursor: grab;
  color: #64748b;
  font-size: 16px;
  user-select: none;
  padding: 0 4px;
}

/* Draggable rows */
.draggable-player {
  cursor: move;
  transition: background-color 0.2s;
}

.draggable-player:hover {
  background-color: rgba(56, 189, 248, 0.1);
}

.draggable-player:active {
  cursor: grabbing;
}

/* Drop zone styling */
.droppable-tbody.drag-over {
  background-color: rgba(56, 189, 248, 0.15);
  outline: 2px dashed #38bdf8;
  outline-offset: -2px;
}

/* Icône de profil dans la popup */
.modal-profile-icon {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.8);
}

/* Bouton Re-roll */
.modal-reroll {
  background: #0ea5e9;
  border: none;
  color: white;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.modal-reroll:hover {
  background: #38bdf8;
}

/* Zone d'enregistrement du résultat */
.result-actions {
  margin-top: 16px;
  border-top: 1px solid #111827;
  padding-top: 10px;
  font-size: 13px;
}

.result-actions p {
  margin: 0 0 6px;
  color: var(--text-soft);
}

.result-actions .result-btn {
  margin-right: 8px;
  padding: 6px 12px;
  font-size: 13px;
}

#result-message {
  margin-left: 8px;
  font-size: 13px;
}

/* Utils */

.hidden {
  display: none !important;
}

/* Cellule rang : texte + icône alignés */
.rank-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rank-text {
  display: inline-block;
  min-width: 120px;
  white-space: nowrap;
}

/* =========================
   Formulaires d'édition
   ========================= */

#edit-match-modal .modal-content {
  max-width: 600px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.teams-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
}

.team-preview h4 {
  margin: 0 0 8px;
  color: var(--accent-soft);
  font-size: 14px;
}

.team-preview ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.team-preview li {
  padding: 4px 8px;
  margin: 4px 0;
  background: #0f172a;
  border-left: 2px solid var(--accent);
  font-size: 13px;
  color: var(--text);
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn-save {
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
}

.btn-save:hover {
  background: var(--accent-soft);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

.btn-cancel {
  background: #374151;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  background: #4b5563;
}

/* =========================
   Champion Selection Modal
   ========================= */

.champion-modal-content {
  max-width: 1400px;
  width: 95%;
  max-height: 90vh;
}

/* Winner toggle section */
.winner-toggle-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
}

.winner-toggle-section label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.winner-toggle-buttons {
  display: flex;
  gap: 8px;
}

.winner-toggle-btn {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.winner-toggle-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent);
}

.winner-toggle-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

#champion-selections {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.champion-team-row {
  background: #020617;
  border-radius: 8px;
  border: 1px solid #111827;
  padding: 12px;
}

.champion-team-row.winner-team {
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.team-row-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #111827;
}

.team-row-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--accent-soft);
}

.team-row-players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.player-champion-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-name-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding: 4px 8px;
  background: #0f172a;
  border-radius: 4px;
  text-align: center;
}

/* Player score inputs */
.player-score-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}

.score-input {
  width: 45px;
  padding: 4px 6px;
  text-align: center;
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
}

/* Remove number input spinners */
.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.score-input[type=number] {
  -moz-appearance: textfield;
}

.score-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.score-separator {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 600;
}

.champion-selector-compact {
  position: relative;
}

.champion-selected-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: #0f172a;
  border: 2px solid #1f2937;
  border-radius: 6px;
  min-height: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.champion-selected-display:hover {
  border-color: var(--accent);
  background: #1a1f35;
}

.champion-selected-display .champion-placeholder {
  font-size: 12px;
  color: var(--text-soft);
}

.champion-selected-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: 1px solid var(--accent);
}

.champion-selected-name {
  font-size: 13px;
  color: var(--accent-soft);
  font-weight: 600;
}

.champion-grid-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  z-index: 1000;
  background: #0f172a;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 8px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
}

.champion-grid-dropdown.open {
  display: grid;
}

.champion-icon-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #020617;
  cursor: pointer;
  transition: all 0.15s ease;
  overflow: hidden;
}

.champion-icon-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.champion-icon-btn:hover {
  border-color: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(31, 142, 205, 0.6);
}

.champion-icon-btn.selected {
  border-color: var(--accent-soft);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.8);
  transform: scale(1.05);
}

.champion-icon-btn.hidden {
  display: none;
}

.champion-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #111827;
  display: flex;
  align-items: center;
  gap: 12px;
}

#champion-result-message {
  font-size: 13px;
  color: var(--text-soft);
}

/* Scrollbar styling for champion selections */
.champion-grid-dropdown::-webkit-scrollbar {
  width: 8px;
}

.champion-grid-dropdown::-webkit-scrollbar-track {
  background: #020617;
  border-radius: 4px;
}

.champion-grid-dropdown::-webkit-scrollbar-thumb {
  background: #1f2937;
  border-radius: 4px;
}

.champion-grid-dropdown::-webkit-scrollbar-thumb:hover {
  background: #374151;
}

/* Champion display in match history */
.champion-icon-small {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  vertical-align: middle;
  margin-left: 4px;
}

/* =========================
   Clash Tab
   ========================= */

#clash-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.clash-controls {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.clash-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.clash-select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text);
}

.clash-filter-hint {
  color: var(--text-soft);
  font-size: 12px;
}

.clash-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 12px;
}

.clash-filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(2, 6, 23, 0.9);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.clash-filter-item input {
  cursor: pointer;
}

.clash-filter-item:hover {
  border-color: var(--accent);
  background: rgba(31, 142, 205, 0.1);
}

.clash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.clash-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.clash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid var(--border);
}

.clash-player {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clash-profile {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.clash-player-name {
  font-weight: 700;
  color: var(--text);
}

.clash-player-meta {
  color: var(--text-soft);
  font-size: 12px;
}

.clash-champions {
  display: flex;
  flex-direction: column;
  padding: 10px 12px 12px;
  gap: 8px;
}

.clash-champion-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: rgba(2, 6, 23, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.clash-champion-icon {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

.champion-placeholder-small {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-soft);
  font-weight: 700;
  font-size: 14px;
}

.clash-champion-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clash-winrate-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  background: rgba(8, 47, 73, 0.95);
  color: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.clash-champion-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.clash-champion-name {
  font-weight: 700;
  color: var(--text);
}

.clash-champion-meta {
  color: var(--text-soft);
  font-size: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.clash-winrate-text {
  font-weight: 800;
}

@media (max-width: 700px) {
  .clash-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

