/* Reset de base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Layout global */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: #0d0d0d;
  color: #f5f5f5;
  min-height: 100vh;
  line-height: 1.6;
}

.app-header {
  background: #1a1a1a;
  border-bottom: 2px solid #00ff88;
  padding: 15px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 9999;
}

.app-title {
  font-size: 22px;
  font-weight: 700;
  color: #00ff88;
  letter-spacing: 0.5px;
}

.app-nav a {
  color: #999;
  margin-left: 20px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  padding: 8px 12px;
  border-radius: 6px;
}

.app-nav a:hover {
  color: #fff;
  background: #252525;
}

.app-nav a.active {
  color: #000;
  background: #00ff88;
  font-weight: 600;
}

.app-main {
  padding: 35px 25px;
  max-width: 1400px;
  margin: 0 auto;
}

h1 {
  font-size: 28px;
  margin-bottom: 25px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

/* Sections admin (players/teams) */
.admin-section {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 20px 25px;
  margin-bottom: 25px;
  border: 1px solid #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.admin-section h2 {
  font-size: 20px;
  margin-bottom: 18px;
  color: #00ff88;
  font-weight: 700;
}

/* Formulaires admin */
.admin-section form {
  display: grid;
  grid-template-columns: 2fr 2fr 2fr 2fr auto;
  gap: 12px;
  align-items: center;
}

.admin-section input,
.admin-section select {
  background: #252525;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 12px 14px;
  color: #f5f5f5;
  font-size: 14px;
  transition: all 0.2s;
}

.admin-section input:focus,
.admin-section select:focus {
  outline: none;
  border-color: #00ff88;
  box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.1);
}

/* Colonne actions dans les tableaux */
td:last-child {
  white-space: nowrap;
}

td:last-child .btn-secondary {
  margin-right: 6px;
  padding: 8px 14px;   /* un peu plus compact que les autres */
  font-size: 13px;
}


/* Tableaux admin */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
}

thead {
  background: #252525;
}

th {
  padding: 12px 14px;
  border-bottom: 2px solid #00ff88;
  font-weight: 600;
  color: #00ff88;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid #2a2a2a;
}

tbody tr {
  transition: background 0.2s;
}

tbody tr:hover {
  background: #222;
}

tbody tr:nth-child(even) {
  background: #181818;
}

tbody tr:nth-child(even):hover {
  background: #222;
}

/* Colonne actions dans les tableaux */
td:last-child {
  white-space: nowrap;
}

td:last-child .btn-secondary {
  margin-right: 8px;
}

/* Boutons génériques */
.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: #00ff88;
  color: #000;
  border: 2px solid #00ff88;
}

.btn-primary:hover {
  background: #00cc66;
  border-color: #00cc66;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

.btn-secondary {
  background: #333;
  color: #fff;
  border: 2px solid #444;
}

.btn-secondary:hover {
  background: #444;
  border-color: #555;
  transform: translateY(-1px);
}

.table-actions {
  text-align: center;
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  margin-left: 6px;
  padding: 4px;
  color: #ddd;
}

.icon-btn:hover {
  color: #00ff88;
  transform: scale(1.05);
}

/* Centrer le texte dans les tableaux admin */
table th,
table td {
  text-align: center;
  vertical-align: middle;
}

/* --- PARTIE ÉCRAN 3 CIBLES (iPad) --- */

.targets-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 10px;
}

.target-card {
  background: #1a1a1a;
  border-radius: 15px;
  padding: 20px;
  border: 2px solid #333;
  transition: all 0.3s;
  cursor: pointer;
}

.target-card:hover {
  border-color: #00ff88;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
  transform: translateY(-2px);
}

.target-card.active {
  border-color: #00ff88;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
  background: #1d1d1d;
}

.target-header {
  text-align: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #333;
}

.target-header h2 {
  font-size: 28px;
  color: #00ff88;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 1px;
}

.phase {
  color: #999;
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.match-info {
  margin: 20px 0;
}

.team {
  padding: 15px 20px;
  border-radius: 12px;
  margin: 12px 0;
  background: #252525;
  border: 1px solid #333;
  transition: all 0.2s;
}

.team.winner {
  background: linear-gradient(135deg, #00ff88, #00cc66);
  color: #000;
  font-weight: bold;
  border-color: #00ff88;
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

.team-name {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
  font-weight: 600;
}

.team-score {
  font-size: 15px;
  opacity: 0.8;
  font-weight: 500;
}

.players {
  font-size: 13px;
  color: #aaa;
  margin-top: 4px;
}

.team.winner .players {
  color: #000;
  opacity: 0.7;
}

.vs {
  text-align: center;
  font-size: 18px;
  color: #ff4444;
  margin: 15px 0;
  font-weight: 700;
  letter-spacing: 2px;
}

/* Boutons iPad */
.actions {
  margin-top: 20px;
}

.targets-container .btn-primary,
.targets-container .btn-secondary {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  font-size: 16px;
  margin-top: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  cursor: pointer;
}

.targets-container .btn-primary {
  background: #00ff88;
  color: #000;
  border: 2px solid #00ff88;
}

.targets-container .btn-primary:hover {
  background: #00cc66;
  border-color: #00cc66;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.4);
}

.targets-container .btn-secondary {
  background: #333;
  color: #fff;
  border: 2px solid #444;
}

.targets-container .btn-secondary:hover {
  background: #444;
  border-color: #555;
  transform: translateY(-2px);
}

.targets-container .btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Responsive multi-colonnes pour les cibles */
@media (min-width: 768px) {
  .targets-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
}

@media (min-width: 1200px) {
  .targets-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
  }

  .target-card {
    padding: 25px;
  }

  .admin-section form {
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  }
}

.result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.result-modal {
  background: #1a1a1a;
  border-radius: 16px;
  padding: 25px;
  width: 90%;
  max-width: 400px;
  border: 2px solid #00ff88;
  box-shadow: 0 8px 32px rgba(0, 255, 136, 0.3);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.result-modal h2 {
  font-size: 22px;
  margin-bottom: 10px;
  text-align: center;
  color: #00ff88;
  font-weight: 700;
}

.result-modal p {
  text-align: center;
  color: #aaa;
  margin-bottom: 20px;
}

.result-row {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-row label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.result-row select {
  flex: 1;
  background: #252525;
  border: 1px solid #444;
  border-radius: 8px;
  color: #f5f5f5;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.result-row select:focus {
  outline: none;
  border-color: #00ff88;
  box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.2);
}

.result-row input[type="number"] {
  flex: 1;
  background: #252525;
  border: 1px solid #444;
  border-radius: 8px;
  color: #f5f5f5;
  padding: 10px 12px;
  font-size: 14px;
  transition: all 0.2s;
}

.result-row input[type="number"]:focus {
  outline: none;
  border-color: #00ff88;
  box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.2);
}

.result-row input[type="number"]::placeholder {
  color: #666;
}

.result-winner {
  flex: 1;
  background: #252525;
  border: 2px solid #444;
  border-radius: 10px;
  padding: 14px 16px;
  color: #f5f5f5;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  text-align: center;
}

.result-winner:hover {
  border-color: #00ff88;
  background: #2a2a2a;
}

.result-winner.active {
  background: #00ff88;
  color: #000;
  border-color: #00ff88;
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.4);
  transform: scale(1.02);
}

.result-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 25px;
}

.result-actions .btn-secondary,
.result-actions .btn-primary {
  flex: 1;
  padding: 12px 20px;
}

/* === CLASSEMENTS & MATCHS === */
.standings-section,
.matches-section {
  margin-top: 40px;
}

.standings-section h2,
.matches-section h2 {
  font-size: 24px;
  margin-bottom: 25px;
  color: #00ff88;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.poules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

@media (min-width: 900px) {
  .poules-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.poule-card {
  background: #181818;
  border-radius: 10px;
  border: 1px solid #333;
  padding: 15px;
}

.poule-card h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #00ff88;
  text-align: center;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.standings-table thead th {
  background: #222;
  padding: 8px 6px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  color: #aaa;
  border-bottom: 1px solid #444;
}

.standings-table tbody td {
  padding: 10px 6px;
  border-bottom: 1px solid #2a2a2a;
}

.standings-table .pos {
  width: 40px;
  text-align: center;
  font-weight: bold;
  color: #00ff88;
}

.standings-table .team-name {
  font-weight: 600;
}

.standings-table .players {
  font-size: 12px;
  color: #999;
}

.standings-table .positive {
  color: #00ff88;
}

.standings-table .negative {
  color: #ff4444;
}

.standings-table .no-data {
  text-align: center;
  color: #666;
  padding: 20px;
}

.standings-table tr.position-1 {
  background: rgba(0, 255, 136, 0.05);
}

/* Matchs */
.matches-category {
  margin-bottom: 30px;
}

.matches-category h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #fff;
}

.matches-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 700px) {
  .matches-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .matches-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.match-card {
  background: #181818;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px;
  transition: all 0.2s;
}

.match-card.playing {
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.05);
}

.match-card.finished {
  opacity: 0.8;
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #2a2a2a;
}

.match-phase {
  font-size: 12px;
  color: #aaa;
  font-weight: 600;
}

.target-badge {
  font-size: 11px;
  background: #00ff88;
  color: #000;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: bold;
}

.match-teams {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: #222;
  border-radius: 6px;
}

.match-team.winner {
  background: linear-gradient(135deg, #00ff88, #00cc66);
  color: #000;
  font-weight: bold;
}

.match-team-name {
  font-size: 14px;
}

.match-score {
  font-size: 16px;
  font-weight: bold;
  min-width: 30px;
  text-align: right;
}

.match-vs {
  text-align: center;
  font-size: 12px;
  color: #666;
  padding: 4px 0;
}

.matches-list .no-data {
  grid-column: 1 / -1;
  text-align: center;
  color: #666;
  padding: 30px;
  font-style: italic;
}

/* Phase Finale / Playoffs */
.playoff-section {
  margin-top: 40px;
  margin-bottom: 40px;
}

.playoff-section h2 {
  font-size: 24px;
  margin-bottom: 25px;
  color: #00ff88;
  text-align: center;
}

.playoff-bracket {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

@media (min-width: 900px) {
  .playoff-bracket {
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
  }
}

.playoff-round {
  flex: 1;
  min-width: 280px;
}

.playoff-round h3 {
  font-size: 18px;
  margin-bottom: 15px;
  text-align: center;
  color: #fff;
  text-transform: uppercase;
  font-weight: 600;
}

.playoff-matches {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.playoff-match {
  background: #181818;
  border: 2px solid #333;
  border-radius: 10px;
  padding: 15px;
  transition: all 0.3s;
}

.playoff-match.playing {
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.08);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.playoff-match.finished {
  opacity: 0.85;
}

.playoff-match.pending {
  opacity: 0.6;
  border-style: dashed;
}

.playoff-match-header {
  text-align: center;
  margin-bottom: 12px;
}

.status-badge {
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.status-badge.playing {
  background: #00ff88;
  color: #000;
}

.status-badge.finished {
  background: #5cb85c;
  color: #fff;
}

.status-badge.ready {
  background: #f39c12;
  color: #000;
}

.status-badge.pending {
  background: #666;
  color: #fff;
}

.playoff-match-teams {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.playoff-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: #222;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.playoff-team.winner {
  background: linear-gradient(135deg, #00ff88, #00cc66);
  color: #000;
  font-weight: bold;
  border-color: #00ff88;
}

.playoff-team-name {
  font-size: 15px;
  flex: 1;
}

.playoff-score {
  font-size: 20px;
  font-weight: bold;
  min-width: 35px;
  text-align: right;
}

/* Styles pour les cartes de phase */
.phase-card {
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.3s;
}

.phase-card:hover {
  border-color: #00ff88;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.phase-card h3 {
  margin: 0 0 20px 0;
  color: #00ff88;
  font-size: 18px;
  border-bottom: 2px solid #00ff88;
  padding-bottom: 10px;
}

.phase-card .matches-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.match-item {
  background: #252525;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 12px;
  transition: all 0.2s;
}

.match-item:hover {
  border-color: #00ff88;
  background: #2a2a2a;
}

.match-header {
  margin-bottom: 10px;
}

.match-status {
  font-size: 14px;
  font-weight: bold;
}

.match-content {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.match-team {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #1a1a1a;
  border-radius: 4px;
  transition: all 0.2s;
}

.match-team.winner {
  background: rgba(0, 255, 136, 0.15);
  border: 1px solid #00ff88;
}

.match-team-name {
  flex: 1;
  font-size: 13px;
  color: #ccc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-team.winner .match-team-name {
  color: #00ff88;
  font-weight: bold;
}

.match-legs {
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  min-width: 25px;
  text-align: center;
}

.match-vs {
  color: #666;
  font-size: 12px;
  font-weight: bold;
}

/* Animation pour la coupe du vainqueur */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-30px) scale(1.1);
  }
}

@keyframes glow {
  0%, 100% {
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
  }
  50% {
    text-shadow: 0 0 40px rgba(0, 255, 136, 0.8), 0 0 60px rgba(0, 255, 136, 0.6);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Conteneur du vainqueur */
.winner-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(100vh - 80px);
  overflow: hidden;
  padding-top: 60px;
}

.winner-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  animation: fadeInUp 1s ease-out;
  text-align: center;
}

.trophy-icon {
  font-size: 150px;
  animation: bounce 2s infinite;
  filter: drop-shadow(0 10px 30px rgba(0, 255, 136, 0.4));
}

.winner-name {
  font-size: 64px;
  font-weight: 900;
  color: #00ff88;
  text-align: center;
  margin: 0;
  animation: glow 2s infinite;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.winner-title {
  font-size: 28px;
  color: #fff;
  margin: 0;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.second-place {
  margin-top: 40px;
  padding: 25px 50px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  border: 2px solid #333;
  backdrop-filter: blur(10px);
  animation: fadeInUp 1s ease-out 0.5s both;
}

.second-label {
  font-size: 16px;
  color: #888;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.second-name {
  font-size: 32px;
  color: #ccc;
  margin: 10px 0 0 0;
  font-weight: 700;
}

/* Feux d'artifice */
.fireworks {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.firework {
  position: absolute;
  width: 4px;
  height: 4px;
}

.firework-particle {
  position: absolute;
  width: 4px;
  height: 40px;
  background: #00ff88;
  animation: explode 1.5s ease-out forwards;
  transform-origin: center bottom;
}

@keyframes explode {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-150px) scale(0);
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .trophy-icon {
    font-size: 100px;
  }
  
  .winner-name {
    font-size: 40px;
  }
  
  .winner-title {
    font-size: 20px;
  }
  
  .second-name {
    font-size: 24px;
  }
}

