/* Skyjo minimal styles */
body { font-family: Arial, Helvetica, sans-serif; margin: 20px; color: #222; }
h1 { margin-bottom: 6px; }
ul { list-style: none; padding: 0; }
ul li { margin: 6px 0; }
.current-total { font-weight: 700; color: #0b5394; }
form table { border-collapse: collapse; width: 100%; max-width: 720px; }
form table th, form table td { padding: 6px 8px; border-bottom: 1px solid #eee; text-align: left; }
.score-input { width: 90px; padding: 6px 8px; font-size: 1rem; border: 1px solid #ccc; border-radius: 4px; text-align: right; }
button, .button { padding: 8px 12px; font-size: 1rem; border-radius: 4px; border: none; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; cursor: pointer; text-decoration: none; display: inline-block; margin-right: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); transition: transform 0.2s ease, box-shadow 0.2s ease; }
button:hover, .button:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.2); opacity: 1; }
.button-rules { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.button-rules:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.2); opacity: 1; }
.button-submit { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); font-weight: 600; font-size: 1.1rem; padding: 10px 20px; }
.finish-badge { display: inline-block; padding: 4px 8px; background: #c0392b; color: white; border-radius: 4px; font-weight: 700; }

/* Rounds table styling */
.rounds-wrap { overflow-x: auto; margin-top: 12px; }
.rounds-table { width: 100%; border-collapse: collapse; min-width: 480px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-radius: 6px; overflow: hidden; }
.rounds-table thead th { background: linear-gradient(to bottom, #2d6ca2, #255a8a); color: white; font-weight: 700; padding: 12px 10px; border-bottom: none; text-align: left; }
.rounds-table tbody td { padding: 10px 10px; border-bottom: 1px solid #e8ecf1; vertical-align: middle; }
.rounds-table tbody tr:nth-child(odd) { background: #ffffff; }
.rounds-table tbody tr:nth-child(even) { background: #f9fbfc; }
.rounds-table tbody tr:hover { background: #e8f4ff; transition: background 0.2s ease; }
.round-col { width: 64px; text-align: center; font-weight: 700; color: #2d6ca2; }
.score-cell { text-align: right; font-weight: 700; padding-right: 16px; color: #333; }
.ts-col { white-space: nowrap; color: #666; font-size: 0.9rem; font-style: italic; }
.player-col { text-align: left; font-weight: 600; color: #2d6ca2; }

@media (max-width: 600px) {
  .score-input { width: 64px; }
  .rounds-table thead th, .rounds-table tbody td { padding: 6px 8px; }
  .round-col { width: 48px; }
  .score-cell { padding-right: 8px; }
}

/* Background image and main container */
body {
  background-color: #fef5e7;
  background-image:
    linear-gradient(to bottom,
      rgba(254, 245, 231, 0) 0%,
      rgba(254, 245, 231, 0) 25%,
      rgba(255, 240, 220, 0.4) 35%,
      rgba(255, 220, 180, 0.7) 50%,
      rgba(255, 200, 150, 0.85) 65%,
      rgba(255, 180, 120, 1) 80%,
      rgba(255, 160, 100, 1) 100%
    );
  background-size: 100% auto;
  background-position: center top;
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100vh;
}

/* Image bandeau en haut sur PC uniquement */
@media (min-width: 769px) {
  body::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 200px;
    background-image: url('/familyboardgame/images/article-skyjo-bandeau-bis.webp');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 10;
  }
}

/* Sur mobile, image bandeau en haut avec même style */
@media (max-width: 768px) {
  body::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 117%;
    max-width: 650px;
    height: 195px;
    background-image: url('/familyboardgame/images/article-skyjo-bandeau-bis.webp');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 10;
  }

  .page-content {
    margin-top: 215px !important;
  }
}

.page-content {
  position: relative;
  background: rgba(255,255,255,0.94);
  margin: 20px auto;
  padding: 20px;
  padding-bottom: 56px; /* ensure space for bottom-right back button */
  border-radius: 8px;
  max-width: 1100px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

/* Décaler le contenu vers le bas sur PC pour laisser place au logo */
@media (min-width: 769px) {
  .page-content {
    margin-top: 180px;
  }
}

/* Pages communes (accueil, stats, groupes) : en-tête Family board games, sans bandeau de jeu */
body.hub-page::before { content: none; }
body.hub-page .page-content { margin-top: 20px !important; }
.hub-topbar { display: flex; justify-content: flex-end; }
.hub-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px 0;
  border-bottom: 2px solid #007bff;
}
.hub-header h1 { margin: 0 0 10px 0; color: #333; }
.hub-header h1 a { color: inherit; text-decoration: none; }
.user-welcome { font-size: 14px; color: #666; margin-bottom: 0; }
.hub-page-title { font-size: 1.6rem; }

/* Back button bottom-right inside page content */
.back-button {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #2d6ca2;
  background: transparent;
  color: #2d6ca2;
  font-weight: 700;
  text-decoration: none;
  z-index: 2;
  cursor: pointer;
  font-size: 1rem;
  font-family: Arial, Helvetica, sans-serif;
}
.back-button:hover { background: #e9eef6; color: #1e4f7a; }
@media (max-width: 600px) {
  .back-button { position: static; display: inline-block; margin-left: 0; }
}

/* Ensure tables and lists inside the content keep transparent background */
.page-content table, .page-content ul { background: transparent; }

/* Global vertical spacing for better readability */
.page-content > * + * { margin-top: 14px; }
.page-content h1, .page-content h2, .page-content h3 { margin: 0 0 10px 0; }
.page-content p, .page-content ul, .page-content ol, .page-content table, .page-content form, .page-content section { margin: 0; }
.page-content form label { display: block; margin-bottom: 6px; }
.page-content input, .page-content select, .page-content textarea, .page-content button { margin-top: 6px; margin-bottom: 6px; }

@media (max-width: 600px) {
  .page-content > * + * { margin-top: 12px; }
  .player-input { width: 92%; }
}

/* Player inputs for new game */
.player-input { display: block; margin: 6px 0; padding: 6px 8px; width: 72%; max-width: 520px; border: 1px solid #ccc; border-radius: 4px; }
.extra-player { display: none; }
#add-player { margin-top: 8px; margin-bottom: 12px; padding: 6px 10px; background: #f0f0f0; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; color: #2d6ca2; font-weight: 700; }
#add-player:hover { background: #e9eef6; color: #1e4f7a; }

/* Search form */
.search-form {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  border: 1px solid #e1e4e8;
}
.search-form label {
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  display: block;
}
.search-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.date-input {
  padding: 8px 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  min-width: 160px;
  max-width: 100%;
  box-sizing: border-box;
}
.search-button {
  padding: 8px 16px;
  font-size: 1rem;
  border-radius: 4px;
  border: none;
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: white;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.search-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  opacity: 1;
}
.button-secondary {
  background: #95a5a6;
  border-color: #95a5a6;
}
.button-secondary:hover {
  background: #7f8c8d;
  opacity: 1;
}

@media (max-width: 600px) {
  .search-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .date-input, .search-button {
    width: 100%;
  }
}

/* Winner badge */
.winner-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  color: white;
  padding: 14px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
  z-index: 10;
  line-height: 1.4;
}
.winner-score {
  display: block;
  font-size: 1.3rem;
  margin-top: 4px;
  color: #fff;
}

@media (max-width: 600px) {
  .winner-badge {
    position: static;
    display: inline-block;
    margin-bottom: 16px;
    font-size: 1rem;
  }
  .winner-score { font-size: 1.1rem; }
}

/* Stats table styling */
.table-wrap { overflow-x: auto; margin-top: 16px; }
.stats-table { width: 100%; border-collapse: collapse; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-radius: 6px; overflow: hidden; }
.stats-table thead th { background: linear-gradient(to bottom, #2d6ca2, #255a8a); color: white; font-weight: 700; padding: 12px 14px; text-align: left; border-bottom: none; }
.stats-table tbody td { padding: 12px 14px; border-bottom: 1px solid #e8ecf1; }
.stats-table tbody tr:nth-child(odd) { background: #ffffff; }
.stats-table tbody tr:nth-child(even) { background: #f9fbfc; }
.stats-table tbody tr:hover { background: #e8f4ff; transition: background 0.2s ease; }
.player-name-col { text-align: left; min-width: 120px; }
.rank-col { text-align: center; font-weight: 700; color: #2d6ca2; min-width: 60px; font-size: 1.1rem; }
.stat-col { text-align: center; font-weight: 600; color: #333; min-width: 80px; }
.stat-best { color: #27ae60; font-weight: 700; }
.stat-worst { color: #e74c3c; font-weight: 700; }

@media (max-width: 600px) {
  .stats-table thead th, .stats-table tbody td { padding: 8px 10px; font-size: 0.9rem; }
  .stat-col { min-width: 60px; }

  /* Masquer les colonnes non essentielles sur mobile */
  .stat-col-hide-mobile {
    display: none;
  }

  .rank-col {
    min-width: 50px;
    font-size: 1rem;
  }

  .player-name-col {
    text-align: left;
  }
}

/* Metro tiles - Style Windows Phone/Lumia */
.metro-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 15px;
  padding-bottom: 40px;
}

.metro-tile {
  background: #2d6ca2;
  color: white;
  border-radius: 0;
  padding: 20px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.metro-tile:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.tile-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255,255,255,0.2);
}

.tile-icon {
  font-size: 1.8rem;
}

.tile-title {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.95;
}

.tile-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Couleurs des tuiles */
.tile-podium { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.tile-worst { background: linear-gradient(135deg, #fc5c7d 0%, #6a82fb 100%); }
.tile-best { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.tile-games { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.tile-players { background: linear-gradient(135deg, #6c757d 0%, #495057 100%); }

/* Contenu des tuiles - Podium */
.tile-podium-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.tile-podium-item:last-child {
  border-bottom: none;
}

.tile-medal {
  font-size: 1.5rem;
  min-width: 30px;
}

.tile-player {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 600;
}

.tile-score {
  font-size: 1.3rem;
  font-weight: 700;
  min-width: 60px;
  text-align: right;
}

.tile-gold { opacity: 1; }
.tile-silver { opacity: 0.9; }
.tile-bronze { opacity: 0.8; }

/* Contenu des tuiles - Valeurs principales */
.tile-main-value {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 5px;
  text-align: center;
}

.tile-main-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
  text-align: center;
  margin-bottom: 15px;
}

.tile-player-name {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin: 10px 0;
}

.tile-details {
  font-size: 0.85rem;
  opacity: 0.85;
  text-align: center;
  margin-top: 8px;
}

.tile-secondary-value {
  font-size: 1rem;
  opacity: 0.9;
  text-align: center;
  margin-top: 10px;
}

/* Stats menu grid */
.stats-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.stats-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stats-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.stats-card-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.stats-card-img {
  display: block;
  height: 90px;
  max-width: 100%;
  margin: 0 auto 15px;
  object-fit: contain;
  border-radius: 6px;
}

.stats-card h2 {
  margin: 10px 0;
  font-size: 1.5rem;
  color: white;
}

.stats-card p {
  margin: 5px 0;
  opacity: 0.9;
  font-size: 1rem;
}

.stats-card-rounds {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Podium styling */
.podium-section {
  margin: 30px 0;
  padding: 30px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
}

.podium-section h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #2d3748;
}

.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 20px;
  margin: 0 auto;
  max-width: 700px;
}

.podium-place {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  min-width: 180px;
}

.podium-place:hover {
  transform: scale(1.05);
}

.podium-first {
  order: 2;
  border: 3px solid #FFD700;
  background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
  min-height: 240px;
}

.podium-second {
  order: 1;
  border: 3px solid #C0C0C0;
  background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 100%);
  min-height: 200px;
}

.podium-third {
  order: 3;
  border: 3px solid #CD7F32;
  background: linear-gradient(135deg, #fff4ed 0%, #fff8f3 100%);
  min-height: 180px;
}

.podium-rank {
  font-size: 1.2rem;
  font-weight: 700;
  color: #718096;
  margin-bottom: 5px;
}

.podium-medal {
  font-size: 3rem;
  margin: 10px 0;
}

.podium-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2d3748;
  margin: 10px 0;
}

.podium-score {
  font-size: 1.5rem;
  font-weight: 700;
  color: #4299e1;
  margin-top: 10px;
}

/* Badges section */
.badges-section {
  margin: 30px 0;
}

.badges-section h2 {
  text-align: center;
  margin-bottom: 25px;
  color: #2d3748;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.badge-card {
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.badge-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.badge-worst {
  background: linear-gradient(135deg, #fc5c7d 0%, #6a82fb 100%);
  color: white;
}

.badge-best {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.badge-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.badge-card h3 {
  margin: 10px 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.badge-player {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 15px 0 10px 0;
}

.badge-value {
  font-size: 2rem;
  font-weight: 700;
  margin: 10px 0;
}

.badge-detail {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-top: 10px;
}

/* Stats detail section */
.stats-detail-section {
  margin: 70px 0 30px 0;
}

.stats-detail-section h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #2d3748;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .metro-tiles {
    grid-template-columns: 1fr;
  }

  .tile-main-value {
    font-size: 3rem;
  }

  .podium {
    flex-direction: column;
    align-items: center;
  }

  .podium-first, .podium-second, .podium-third {
    order: 0;
    width: 100%;
    min-height: auto;
  }

  .stats-menu-grid {
    grid-template-columns: 1fr;
  }

  .badges-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1200px) {
  .metro-tiles {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* Home action buttons */
.home-actions {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.home-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 20px;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.home-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Couleurs différentes pour chaque bouton */
.home-action-btn:nth-child(1) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.home-action-btn:nth-child(2) {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.home-action-btn:nth-child(3) {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.action-icon {
  font-size: 1.5rem;
}

.action-text {
  font-size: 1rem;
}

/* Mobile : Tuiles empilées avec icônes plus grandes */
@media (max-width: 600px) {
  .home-actions {
    flex-direction: column;
    gap: 12px;
  }

  .home-action-btn {
    flex-direction: column;
    padding: 25px 20px;
    min-height: 120px;
    border-radius: 12px;
  }

  .action-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
  }

  .action-text {
    font-size: 1.1rem;
  }
}

/* Game type selection grid */
.game-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.game-type-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px 30px;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.game-type-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.game-type-card:nth-child(1) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.game-type-card:nth-child(2) {
  background: linear-gradient(135deg, #fc5c7d 0%, #6a82fb 100%);
}

.game-type-icon {
  font-size: 4rem;
  margin-bottom: 15px;
}

.game-type-card h2 {
  margin: 10px 0;
  font-size: 1.8rem;
  color: white;
}

.game-type-card p {
  margin: 5px 0;
  opacity: 0.9;
  font-size: 1.1rem;
}

@media (max-width: 600px) {
  .game-type-grid {
    grid-template-columns: 1fr;
  }

  .game-type-card {
    padding: 35px 25px;
  }

  .game-type-icon {
    font-size: 3.5rem;
  }
}

/* Game scores section */
.game-scores-section {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 30px;
}

.game-scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.game-score-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-score-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.game-score-player {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 10px;
}

.game-score-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #667eea;
  line-height: 1;
}

.game-score-label {
  font-size: 1rem;
  font-weight: 400;
  color: #718096;
  margin-left: 5px;
}

/* Round form table */
.round-form-wrapper {
  overflow-x: auto;
  margin: 20px 0;
}

.round-form-table {
  width: 100%;
  border-collapse: collapse;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-radius: 6px;
  overflow: hidden;
}

.round-form-table thead th {
  background: linear-gradient(to bottom, #667eea, #764ba2);
  color: white;
  font-weight: 700;
  padding: 12px 14px;
  text-align: left;
  border-bottom: none;
}

.round-form-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #e8ecf1;
}

.round-form-table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.round-form-table tbody tr:nth-child(even) {
  background: #f9fbfc;
}

@media (max-width: 600px) {
  .game-scores-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .game-score-card {
    padding: 15px;
  }

  .game-score-value {
    font-size: 2rem;
  }

  .hide-mobile {
    display: none;
  }

  /* Rounds table responsive - passer les colonnes en lignes */
  .rounds-table {
    min-width: 100%;
  }

  .rounds-table thead {
    display: none;
  }

  .rounds-table tbody tr {
    display: block;
    margin-bottom: 20px;
    border: 1px solid #e8ecf1;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  }

  .rounds-table tbody td {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
  }

  .rounds-table tbody td:last-child {
    border-bottom: none;
  }

  .rounds-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #2d3748;
    margin-right: 10px;
  }

  .round-col::before {
    content: "Round ";
  }

  .player-col::before {
    content: attr(data-label);
  }

  .ts-col::before {
    content: "Date ";
  }

  .score-cell {
    text-align: right;
    font-weight: 700;
  }
}

/* Login page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  background: white;
  padding: 50px 40px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  max-width: 420px;
  width: 90%;
  text-align: center;
}

.login-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.login-box h1 {
  margin-bottom: 10px;
  color: #2d3748;
}

.login-form {
  margin-top: 30px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1.1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-submit {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.1rem;
  margin-top: 10px;
}

.flash-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
}

.flash-error {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
}

@media (max-width: 600px) {
  .login-box {
    padding: 40px 25px;
  }

  .login-icon {
    font-size: 3rem;
  }
}

/* Styles pour l'édition de rounds */
.edit-col {
  width: 100px;
  text-align: center;
}

.edit-round-btn, .save-round-btn, .cancel-round-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  margin: 0 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.edit-round-btn:hover {
  transform: scale(1.2);
}

.save-round-btn {
  color: #43e97b;
}

.save-round-btn:hover {
  transform: scale(1.2);
}

.cancel-round-btn {
  color: #e74c3c;
}

.cancel-round-btn:hover {
  transform: scale(1.2);
}

.score-edit-input {
  border: 2px solid #4facfe;
  border-radius: 6px;
  padding: 6px 8px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  width: 55px;
  background: white;
  transition: all 0.2s ease;
}

.score-edit-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
  transform: scale(1.05);
}

.finisher-edit-radio {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #667eea;
}

/* Colonne finisher */
.finisher-col {
  text-align: center;
  width: 80px;
}

.finisher-radio {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.finisher-edit-select {
  border: 1px solid #4facfe;
  border-radius: 4px;
  padding: 4px 6px;
  text-align: center;
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
}

.finisher-edit-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.finisher-display {
  font-weight: 600;
  color: #667eea;
}

/* Score wrapper pour aligner score et badge */
.score-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* Score edit wrapper pour aligner input et radio */
.score-edit-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 5px 0;
}

/* Badge finisher (pastille) */
.finisher-badge {
  font-size: 0.75rem;
  line-height: 1;
  opacity: 0.8;
}

/* Score doublé en gras */
.score-doubled {
  font-weight: 700 !important;
  color: #e74c3c;
}

/* Modale */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  transition: color 0.2s;
}

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

/* Responsive pour mobile */
@media (max-width: 768px) {
  .edit-col {
    width: auto;
  }

  .edit-round-btn, .save-round-btn, .cancel-round-btn {
    font-size: 1.5rem;
    padding: 8px 10px;
  }

  .score-edit-input {
    width: 50px !important;
    font-size: 0.95rem;
    padding: 5px 6px;
  }

  .finisher-col {
    font-size: 0.8rem;
  }

  .finisher-radio {
    width: 18px;
    height: 18px;
  }

  .finisher-edit-radio {
    width: 18px;
    height: 18px;
  }

  .score-edit-wrapper {
    gap: 3px;
    padding: 3px 0;
  }

  .finisher-edit-select {
    font-size: 0.8rem;
    padding: 2px 4px;
  }
}

/* Styles pour la tuile "Le précoce" */
.tile-precoce {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* Lien joueur cliquable dans les stats */
.player-link {
  color: #2d3748;
  text-decoration: none;
  transition: color 0.2s ease;
}

.player-link:hover {
  color: #667eea;
  text-decoration: underline;
}

/* Styles pour la page de statistiques individuelles */
.tile-player-mean {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tile-player-top {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.tile-player-flop {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.tile-player-precocity {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.tile-player-rounds {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.tile-player-seniority {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

/* Section co-joueurs */
.player-coplayers-section {
  margin: 40px 0;
}

.player-coplayers-section h2 {
  margin-bottom: 20px;
  color: #2d3748;
  font-size: 1.5rem;
}

.coplayers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.coplayer-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.coplayer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.coplayer-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 8px;
}

.coplayer-count {
  font-size: 0.95rem;
  color: #718096;
}

/* Section récapitulatif */
.player-summary-section {
  margin: 40px 0;
}

.player-summary-section h2 {
  margin-bottom: 20px;
  color: #2d3748;
  font-size: 1.5rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.summary-item {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.summary-label {
  font-size: 0.85rem;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.summary-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2d3748;
}

@media (max-width: 768px) {
  .coplayers-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Login page links */
.login-links {
  margin-top: 24px;
  text-align: center;
  font-size: 0.9rem;
}

.login-links a {
  color: #667eea;
  text-decoration: none;
}

.login-links a:hover {
  text-decoration: underline;
}

.login-links .separator {
  color: #ccc;
  margin: 0 8px;
}

/* Profile page */
.profile-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.profile-section h2 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #2d3748;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
}

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

.profile-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #4a5568;
}

.profile-form .form-input {
  width: 100%;
  max-width: 400px;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: border-color 0.2s;
}

.profile-form .form-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.profile-form .form-input:disabled {
  background-color: #f7fafc;
  color: #a0aec0;
}

.profile-form small {
  display: block;
  margin-top: 4px;
  color: #718096;
  font-size: 0.85rem;
}

.profile-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.button-secondary {
  background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
}

.button-danger {
  background: linear-gradient(135deg, #fc8181 0%, #e53e3e 100%);
}

/* Groups page */
.groups-actions {
  margin-bottom: 24px;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.group-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}

.group-card:nth-child(2n) {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.group-card:nth-child(3n) {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.group-card:nth-child(4n) {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  box-shadow: 0 4px 15px rgba(67, 233, 123, 0.3);
}

.group-card:nth-child(5n) {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  box-shadow: 0 4px 15px rgba(250, 112, 154, 0.3);
}

.group-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
}

.group-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.group-card h3 {
  margin: 0 0 auto 0;
  color: white;
  font-size: 1.3rem;
  font-weight: 700;
}

.group-stats {
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.9);
  margin-top: 16px;
}

.group-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Nombre de parties par jeu sur la carte d'un groupe */
.group-games {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.group-game-chip {
  background: rgba(255,255,255,0.25);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

.game-players {
  color: #718096;
  font-weight: 400;
}

.group-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.group-badge.owner {
  background: rgba(255,255,255,0.25);
  color: white;
  backdrop-filter: blur(4px);
}

@media (max-width: 600px) {
  .groups-grid {
    grid-template-columns: 1fr;
  }

  .group-card {
    min-height: 120px;
  }
}

/* Group detail page */
.group-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 24px;
}

.group-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.group-section h2 {
  margin: 0 0 16px 0;
  color: #2d3748;
  font-size: 1.1rem;
  border-bottom: 2px solid #667eea;
  padding-bottom: 8px;
}

.members-list, .users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.member-item, .user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f7fafc;
  border-radius: 6px;
}

.member-name, .user-name {
  font-weight: 500;
}

.user-role {
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 4px;
}

.user-role.owner {
  background: #667eea;
  color: white;
}

.user-role.member {
  background: #e2e8f0;
  color: #4a5568;
}

.add-member-form, .invite-form {
  display: flex;
  gap: 8px;
}

.form-input-small {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.form-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.button-small {
  padding: 4px 8px;
  font-size: 0.8rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.button-small.button-danger {
  background: #e53e3e;
  color: white;
}

.inline-form {
  display: inline;
}

.games-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f7fafc;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.game-item:hover {
  background: #edf2f7;
}

.game-type {
  font-weight: 600;
  color: #667eea;
}

.game-players {
  flex: 1;
  color: #4a5568;
  font-size: 0.9rem;
}

.game-status {
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 4px;
}

.game-status.ongoing {
  background: #c6f6d5;
  color: #22543d;
}

.game-status.finished {
  background: #e2e8f0;
  color: #4a5568;
}

.empty-text {
  color: #718096;
  font-style: italic;
}

.page-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.empty-state h2 {
  margin: 0 0 8px 0;
  color: #2d3748;
}

.empty-state p {
  color: #718096;
  margin-bottom: 24px;
}

/* Form group */
.group-form {
  max-width: 500px;
}

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

.group-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #4a5568;
}

.group-form .form-input {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.group-form .form-textarea {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  resize: vertical;
}

.group-form small {
  display: block;
  margin-top: 4px;
  color: #718096;
  font-size: 0.85rem;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* User menu */
.user-menu {
  display: flex;
  gap: 8px;
  align-items: center;
}

@media (max-width: 600px) {
  .user-menu {
    flex-direction: column;
    gap: 4px;
  }
}

/* Stats filter */
.stats-filter {
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stats-filter label {
  font-weight: 600;
  color: #4a5568;
  white-space: nowrap;
}

.stats-filter select {
  padding: 8px 12px;
  font-size: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  min-width: 200px;
}

.stats-filter select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

@media (max-width: 600px) {
  .stats-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-filter select {
    width: 100%;
    min-width: auto;
  }
}

/* New group creation fields */
.new-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cancel-new-group {
  background: none;
  border: 1px solid #e53e3e;
  color: #e53e3e;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.cancel-new-group:hover {
  background: #e53e3e;
  color: white;
}

/* ===================== Flip 7 ===================== */
/* Bandeau Flip 7 à la place du bandeau Skyjo */
body.flip7::before { background-image: url('/familyboardgame/images/Flip7-quatro.webp'); }

.f7-muted { color: #888; font-weight: 400; }
.f7-help { font-size: 0.85rem; color: #666; margin: 12px 0; }

.f7-tiebreak {
  background: #fff4d6;
  border-left: 4px solid #f5b400;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.f7-leader { box-shadow: 0 0 0 3px #f5b400, 0 2px 8px rgba(0,0,0,0.1); }
.f7-progress { height: 8px; background: #e8ecf1; border-radius: 4px; margin-top: 12px; overflow: hidden; }
.f7-progress-bar { height: 100%; background: linear-gradient(90deg, #0fa3a3, #f5b400); }

/* Saisie d'une manche : une carte par joueur */
.f7-entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.f7-entry {
  background: white;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-left: 4px solid #0fa3a3;
}
.f7-entry.is-bust { border-left-color: #e74c3c; background: #fdf1f0; }
.f7-entry-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 1.05rem; }
.f7-entry-total b { font-size: 1.3rem; color: #0b5394; }
.f7-entry.is-bust .f7-entry-total b { color: #e74c3c; }
.f7-entry-fields { display: flex; gap: 10px; margin-bottom: 10px; }
.f7-entry-fields label { flex: 1; font-size: 0.85rem; color: #555; }
.f7-entry-fields input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 8px;
  font-size: 1.1rem;
  text-align: right;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.f7-entry-fields input:disabled { background: #eee; }
.f7-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.f7-toggle {
  padding: 6px 10px;
  border: 1px solid #ccd5df;
  border-radius: 16px;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  background: #f7f9fb;
}
.f7-toggle input { display: none; }
.f7-toggle.checked { background: #0fa3a3; border-color: #0fa3a3; color: white; }
.f7-toggle-bust.checked { background: #e74c3c; border-color: #e74c3c; }
.f7-entry.is-bust .f7-toggle:not(.f7-toggle-bust) { opacity: 0.4; }

/* Historique */
.f7-badge { font-size: 0.8rem; margin-right: 2px; }
.edit-round-btn { text-decoration: none; }

/* Règles */
.f7-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 20px 0; }
.f7-rules img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.f7-rules-note { background: white; padding: 12px 16px; border-radius: 8px; }
.f7-rules-note ul { list-style: disc; padding-left: 20px; }

/* Statistiques : couleurs des dalles propres à Flip 7 (tuiles Metro communes avec Skyjo) */
.tile-f7-flip7 { background: linear-gradient(135deg, #0fa3a3 0%, #f5b400 100%); }
.tile-f7-stop { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.tile-f7-prudent { background: linear-gradient(135deg, #5ee7df 0%, #4a6fa5 100%); }

/* ===================== Mantis ===================== */
body.mantis::before { background-image: url('/familyboardgame/images/mantis-materiel-de-jeu.png'); }

.m-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.m-player { background: white; border-radius: 10px; padding: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); border-top: 5px solid #e84f8a; }
.m-player.leader { box-shadow: 0 0 0 3px #f5b400, 0 2px 8px rgba(0,0,0,0.1); }
.m-player.winner { background: #fff8e1; }
.m-head { display: flex; justify-content: space-between; align-items: baseline; }
.m-name { font-weight: 700; font-size: 1.15rem; }
.m-steals { font-size: 0.85rem; color: #666; }
.m-score { font-size: 3rem; font-weight: 800; color: #e84f8a; text-align: center; line-height: 1.1; margin: 6px 0 2px; }
.m-score small { font-size: 1rem; color: #888; font-weight: 400; }
.m-sprint { font-size: 0.8rem; color: #e67e22; font-weight: 700; text-align: center; min-height: 1em; }
.m-progress { position: relative; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; margin: 6px 0 12px; }
.m-progress div { height: 100%; background: linear-gradient(90deg, #f5576c, #f5b400, #43e97b, #4facfe, #a76bd8); }
.m-progress .m-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: #333; opacity: .5; }
.m-actions { display: flex; flex-direction: column; gap: 6px; }
.m-free { display: flex; gap: 6px; }
.m-free input { flex: 1; min-width: 0; padding: 10px; font-size: 1.1rem; text-align: center; border: 1px solid #ccc; border-radius: 4px; }
.m-actions button { margin: 0; padding: 12px 14px; font-weight: 700; }
.m-plus { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.m-steal { background: linear-gradient(135deg, #a76bd8 0%, #4facfe 100%); }
.m-edit { margin-top: 8px; font-size: 0.9rem; }
.m-edit summary { cursor: pointer; color: #555; display: inline-block; padding: 4px 10px; border: 1px solid #ccd5df; border-radius: 14px; background: #f7f9fb; }
.m-edit form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; }
.m-edit label { display: flex; flex-direction: column; font-size: 0.8rem; color: #555; }
.m-edit input { width: 70px; padding: 6px; font-size: 1rem; text-align: center; border: 1px solid #ccc; border-radius: 4px; }
.m-winner-banner { text-align: center; background: linear-gradient(135deg, #f39c12, #e67e22); color: white; font-weight: 700; font-size: 1.3rem; padding: 16px; border-radius: 10px; margin-bottom: 16px; }
.m-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; align-items: center; }
.m-toolbar form { margin: 0; }
.m-log { background: white; border-radius: 8px; padding: 12px 16px; max-height: 260px; overflow-y: auto; }
.m-log li { border-bottom: 1px solid #f0f0f0; padding: 4px 0; font-size: 0.95rem; }
.m-log-time { color: #888; font-size: 0.85rem; }
.m-log-empty { color: #888; }
.m-tiebreak { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.m-tiebreak label { display: flex; flex-direction: column; gap: 6px; }
.m-tiebreak input { padding: 10px; font-size: 1.2rem; border: 1px solid #ccc; border-radius: 4px; }

/* Statistiques : couleurs des dalles propres à Mantis */
.tile-mantis-steal { background: linear-gradient(135deg, #a76bd8 0%, #4facfe 100%); }
.tile-mantis-collect { background: linear-gradient(135deg, #f5576c 0%, #f5b400 50%, #43e97b 100%); }

/* ===================== Qwirkle ===================== */
body.qwirkle::before { background-image: url('/familyboardgame/images/Qwirkle-bandeau.png'); }

.q-players { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.q-player { display: block; background: white; border-radius: 10px; padding: 10px; text-align: center; color: inherit;
  text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,0.1); border-top: 5px solid #222; }
a.q-player[href]:hover { transform: translateY(-2px); }
.q-player.current { border-top-color: #e74c3c; box-shadow: 0 0 0 3px #e74c3c; }
.q-player.winner { background: #fff8e1; }
.q-name { font-weight: 700; }
.q-total { font-size: 2.2rem; font-weight: 800; color: #222; line-height: 1.1; }
.q-sub { font-size: 0.8rem; color: #666; }
.q-turn { background: white; border-radius: 10px; padding: 16px; margin: 16px 0; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.q-turn h2 { margin: 0 0 10px 0; font-size: 1.3rem; }
.q-turn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.q-turn-row input[type=number] { width: 110px; padding: 12px; font-size: 1.4rem; text-align: center; border: 1px solid #ccc; border-radius: 6px; }
.q-counter { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid #ccd5df; border-radius: 22px; background: #f7f9fb; }
.q-counter.active { background: #f5b400; border-color: #f5b400; }
.q-counter button { margin: 0; width: 36px; height: 36px; padding: 0; border-radius: 50%; background: white; color: #222; font-size: 1.2rem; box-shadow: none; }
.q-counter-value { min-width: 72px; text-align: center; font-weight: 700; }
.q-turn-total { font-weight: 800; color: #e67e22; font-size: 1.1rem; }
.q-valid { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); font-weight: 700; padding: 12px 18px; }
.q-swap { background: linear-gradient(135deg, #a76bd8 0%, #4facfe 100%); }
.q-help { font-size: 0.85rem; color: #666; margin: 10px 0 0; }
.q-end { margin: 10px 0; }
.q-end summary { list-style: none; cursor: pointer; }
.q-end summary::-webkit-details-marker { display: none; }
.q-end form { background: white; border-radius: 10px; padding: 14px; margin-top: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.q-sheet-wrap { overflow-x: auto; }
.q-sheet { width: 100%; max-width: 560px; margin: 0 auto; border-collapse: collapse; background: white; border-radius: 8px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08); table-layout: fixed; }
.q-sheet th { background: #222; color: white; padding: 10px 6px; font-weight: 700; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-sheet td { padding: 8px 6px; text-align: center; border-bottom: 1px solid #e8ecf1; font-weight: 600; }
.q-sheet tbody tr:nth-child(even) { background: #f9fbfc; }
.q-sheet th:first-child, .q-sheet .q-sheet-turn { width: 52px; color: #888; }
.q-sheet th:first-child { color: white; }
.q-sheet tfoot td { font-weight: 800; background: #f1f3f6; font-size: 1.1rem; }
.q-cell-link { color: inherit; text-decoration: none; border-bottom: 1px dashed #aaa; }

/* Statistiques : couleurs des dalles propres à Qwirkle */
.tile-qwirkle-king { background: linear-gradient(135deg, #e74c3c 0%, #f5b400 50%, #43e97b 100%); }
.tile-qwirkle-steady { background: linear-gradient(135deg, #4facfe 0%, #222 100%); }
