* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Navigation Bar */
.navbar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-right: 10px;
}

@media (max-width: 480px) {
  .hamburger {
    display: flex !important;
  }
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(10px, 10px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.nav-left, .nav-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(102, 126, 234, 0.95);
  flex-direction: column;
  padding: 60px 20px 20px 20px;
  gap: 15px;
  z-index: 999;
  animation: slideDown 0.3s ease-out;
}

.nav-mobile-menu.open {
  display: flex;
}

.nav-mobile-item {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 1.1em;
  text-align: left;
  transition: all 0.3s ease;
  width: 100%;
}

.nav-mobile-item:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.98);
}

.nav-mobile-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
  margin: 10px 0;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid transparent;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.9em;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.nav-btn.active {
  background: white;
  color: #667eea;
  font-weight: bold;
}

.nav-code {
  font-weight: bold;
  font-size: 0.95em;
  padding: 0 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.5);
}

.nav-btn-back {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0;
  font-size: 1.8em;
  color: #333;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  overflow-x: hidden;
}

@media (max-width: 480px) {
  body {
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 100vh;
  }

  .navbar {
    flex-direction: row;
    gap: 8px;
    padding: 10px;
    padding-left: 5px;
    justify-content: space-between;
  }

  .hamburger {
    display: flex !important;
  }

  .nav-left {
    flex-wrap: nowrap !important;
  }

  .nav-btn {
    display: none !important;
  }

  .nav-right {
    display: none !important;
  }

  .nav-code {
    font-size: 0.85em;
    padding: 0 5px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .page-header h1 {
    font-size: 1.3em;
  }

  .users-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .stats-table {
    grid-template-columns: 35px 1fr repeat(5, 60px);
    gap: 8px;
    padding: 10px;
  }

  .stat-row > div,
  .stat-header > div {
    padding: 10px 6px;
    font-size: 0.9em;
  }

  .stat-badge {
    padding: 5px 8px;
    font-size: 0.9em;
  }

  .stat-label-small {
    font-size: 0.65em;
  }

  .ranking-card {
    gap: 12px;
    padding: 15px;
  }

  .ranking-medal {
    font-size: 2.5em;
    min-width: 60px;
  }

  .ranking-card-name {
    font-size: 1.2em;
  }

  .ranking-card-score {
    font-size: 1.5em;
    min-width: 60px;
    padding: 8px 12px;
  }

  .ranking-info-item {
    font-size: 0.85em;
  }
}

.container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 900px;
  width: 100%;
  padding: 40px;
  animation: slideIn 0.5s ease-out;
}

/* Desktop improvements */
@media (min-width: 1200px) {
  .container {
    max-width: 1000px;
    padding: 50px;
  }

  .page-header h1 {
    font-size: 2.2em;
  }

  .nav-btn {
    padding: 10px 16px;
    font-size: 0.95em;
  }

  .ranking-grid {
    gap: 20px;
  }

  .ranking-card {
    gap: 15px;
  }

  .stats-table {
    gap: 12px;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .container {
    max-width: 750px;
    padding: 35px;
  }
}

@media (max-width: 768px) {
  .container {
    max-width: 100%;
    border-radius: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .container {
    max-width: 100%;
    width: 100vw;
    height: 100vh;
    padding: 8px;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .hamburger {
    display: flex;
  }

  .nav-left, .nav-right {
    width: 100%;
    justify-content: flex-start;
  }

  h1 {
    font-size: 1.1em;
    margin-bottom: 15px;
  }

  h2 {
    font-size: 1em;
    margin-bottom: 10px;
  }

  .session-header {
    padding: 10px;
    margin-bottom: 10px;
  }

  .session-code {
    font-size: 1.1em;
    letter-spacing: 2px;
  }

  .form-group {
    margin-bottom: 10px;
  }

  .players-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
  }

  .player-card {
    padding: 10px;
    margin-bottom: 8px;
    border-left-width: 3px;
  }

  .player-checkbox {
    width: 20px;
    height: 20px;
  }

  .stats-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
  }

  /* Collapse stats table into stacked cards on very small screens */
  .stats-table {
    display: block;
    padding: 8px;
    background: transparent;
  }

  .stat-header { display: none; }

  .stat-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
  }

  .stat-row > div {
    padding: 6px 8px;
    justify-content: space-between;
    font-size: 0.95em;
  }

  .stat-person-name { padding-left: 0; }

  .stat-card {
    padding: 12px;
  }

  .stat-value {
    font-size: 1.5em;
  }

  .selection-controls {
    gap: 8px;
    margin-bottom: 10px;
  }

  .btn-secondary-small {
    padding: 8px !important;
    font-size: 0.85em !important;
  }

  .player-name {
    font-size: 0.95em;
  }

  .player-points {
    font-size: 1em;
  }

  .ranking-section {
    flex: 0 0 auto;
    padding: 10px;
    margin-bottom: 10px;
  }

  .ranking-item {
    padding: 8px;
    margin-bottom: 6px;
  }

  button {
    padding: 10px !important;
    font-size: 0.9em !important;
    margin-top: 5px !important;
  }

  input[type="text"],
  input[type="number"],
  select {
    padding: 10px;
    font-size: 16px;
  }

  label {
    font-size: 0.9em;
    margin-bottom: 5px;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  color: #333;
  margin-bottom: 30px;
  text-align: center;
  font-size: 2em;
}

h2 {
  color: #667eea;
  margin-bottom: 20px;
  font-size: 1.5em;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1em;
  transition: all 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

@media (max-width: 480px) {
  input[type="text"],
  input[type="number"],
  select {
    font-size: 16px;
  }
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  min-width: 44px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

button:active {
  transform: translateY(0);
}

button.secondary {
  background: #f0f0f0;
  color: #333;
  margin-top: 5px;
}

button.secondary:hover {
  background: #e0e0e0;
}

.error {
  color: #e74c3c;
  padding: 12px;
  background: #ffe5e5;
  border-radius: 8px;
  margin-bottom: 15px;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.success {
  color: #27ae60;
  padding: 12px;
  background: #e5ffe5;
  border-radius: 8px;
  margin-bottom: 15px;
  animation: slideIn 0.3s ease;
}

/* Page Profil */
.page-profile {
  animation: slideIn 0.5s ease-out;
}

/* Page Utilisateurs */
.page-users {
  animation: slideIn 0.5s ease-out;
}

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.user-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.user-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.user-code {
  font-size: 1.3em;
  font-weight: bold;
  margin-bottom: 10px;
}

.user-count {
  font-size: 0.9em;
  opacity: 0.9;
}

/* Page Statistiques */
.page-stats {
  animation: slideIn 0.5s ease-out;
}

/* Page Classement */
.page-ranking {
  animation: slideIn 0.5s ease-out;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.ranking-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  animation: slideIn 0.3s ease-out;
  border-left: 5px solid #667eea;
  transition: all 0.3s ease;
}

.ranking-card:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.ranking-card.rank-1 {
  background: linear-gradient(135deg, #fff8e1 0%, #fffde7 100%);
  border-left-color: #ffd700;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.ranking-card.rank-2 {
  background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
  border-left-color: #c0c0c0;
  box-shadow: 0 4px 15px rgba(192, 192, 192, 0.2);
}

.ranking-card.rank-3 {
  background: linear-gradient(135deg, #ffe8d6 0%, #ffdbce 100%);
  border-left-color: #cd7f32;
  box-shadow: 0 4px 15px rgba(205, 127, 50, 0.2);
}

.ranking-medal {
  font-size: 3em;
  min-width: 80px;
  text-align: center;
  flex-shrink: 0;
}

.ranking-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-card-name {
  font-size: 1.5em;
  font-weight: bold;
  color: #333;
}

.ranking-card-info {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.ranking-info-item {
  font-size: 0.95em;
  color: #666;
  font-weight: 500;
}

.ranking-card-score {
  font-size: 2em;
  font-weight: bold;
  color: #667eea;
  min-width: 80px;
  text-align: right;
  background: rgba(102, 126, 234, 0.1);
  padding: 10px 15px;
  border-radius: 8px;
}

.stats-table {
  display: grid;
  grid-template-columns: 40px 1fr repeat(5, 80px);
  gap: 10px;
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 12px;
}

.stat-header {
  display: contents;
}

.stat-header > div {
  font-weight: bold;
  color: #667eea;
  padding-bottom: 10px;
  border-bottom: 2px solid #667eea;
}

.stat-row {
  display: contents;
}

.stat-row > div {
  padding: 12px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  animation: slideIn 0.3s ease-out;
}

.stat-rank {
  font-weight: bold;
  color: #667eea;
  font-size: 1.1em;
}

.stat-person-name {
  justify-content: flex-start;
  padding-left: 15px;
  font-weight: 600;
  color: #333;
}

.stat-detail {
  flex-direction: column;
  gap: 4px;
}

.stat-badge {
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 1em;
  display: inline-block;
}

.stat-badge.games {
  background: #e3f2fd;
  color: #1976d2;
}

.stat-badge.wins {
  background: #f3e5f5;
  color: #7b1fa2;
}

.stat-badge.points {
  background: #e8f5e9;
  color: #388e3c;
}

.stat-badge.total {
  background: #fff3e0;
  color: #f57c00;
}

.stat-label-small {
  font-size: 0.7em;
  color: #999;
  font-weight: 500;
}

.top-ranking {
  background: #f8f9fa;
  border-radius: 12px;
  overflow: hidden;
}

.top-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
  animation: slideIn 0.3s ease-out;
}

.top-item:last-child {
  border-bottom: none;
}

.top-position {
  font-size: 1.5em;
  font-weight: bold;
  color: #667eea;
  width: 50px;
  text-align: center;
}

.top-name {
  flex: 1;
  font-weight: 500;
  color: #333;
  margin: 0 15px;
}

.top-score {
  font-size: 1.2em;
  font-weight: bold;
  color: #764ba2;
  background: rgba(102, 126, 234, 0.1);
  padding: 8px 15px;
  border-radius: 20px;
}

.logo {
  font-size: 3em;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.welcome-text {
  color: #666;
  margin-bottom: 30px;
  line-height: 1.6;
}

/* Page Session */
.page-session {
  animation: slideIn 0.5s ease-out;
}

.session-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 25px;
  text-align: center;
}

.session-code {
  font-size: 2em;
  font-weight: bold;
  letter-spacing: 3px;
  margin: 10px 0;
}

/* Statistiques */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 25px;
  animation: slideIn 0.5s ease-out;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.stat-label {
  font-size: 0.85em;
  opacity: 0.9;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.8em;
  font-weight: bold;
}

/* Contrôles de sélection */
.selection-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.btn-secondary-small {
  flex: 1;
  padding: 10px !important;
  background: #f0f0f0 !important;
  color: #333 !important;
  border: 2px solid #e0e0e0 !important;
  border-radius: 8px;
  font-size: 0.9em !important;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-small:hover {
  background: #e0e0e0 !important;
  border-color: #667eea !important;
}

.btn-secondary-small:active {
  transform: scale(0.98);
}

.players-list {
  margin-bottom: 30px;
}

.people-list {
  margin-bottom: 30px;
}

.player-card {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideIn 0.3s ease-out;
  border-left: 4px solid #667eea;
  transition: all 0.3s ease;
  gap: 12px;
}

.player-card.selected {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  box-shadow: 0 0 0 2px #667eea;
}

.player-checkbox {
  width: 24px;
  height: 24px;
  cursor: pointer;
  accent-color: #667eea;
  flex-shrink: 0;
}

.person-card {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideIn 0.3s ease-out;
  border-left: 4px solid #667eea;
  transition: all 0.3s ease;
  gap: 12px;
}

.person-card.selected {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  box-shadow: 0 0 0 2px #667eea;
}

.person-checkbox {
  width: 24px;
  height: 24px;
  cursor: pointer;
  accent-color: #667eea;
  flex-shrink: 0;
}

.player-info {
  flex: 1;
}

.player-name {
  font-weight: 600;
  color: #333;
  font-size: 1.1em;
  margin-bottom: 5px;
}

.player-points {
  color: #667eea;
  font-size: 1.3em;
  font-weight: bold;
}

.person-info {
  flex: 1;
}

.person-name {
  font-weight: 600;
  color: #333;
  font-size: 1.1em;
  margin-bottom: 5px;
}

.person-points {
  color: #667eea;
  font-size: 1.3em;
  font-weight: bold;
}

.rank-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: bold;
  margin-left: 10px;
  font-size: 0.9em;
}

.rank-1 {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
}

.rank-2 {
  background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
  color: #333;
}

.rank-3 {
  background: linear-gradient(135deg, #cd7f32 0%, #e8a76a 100%);
  color: white;
}

.player-actions {
  display: flex;
  gap: 10px;
  margin-left: 15px;
}

.btn-small {
  padding: 8px 15px !important;
  font-size: 0.9em !important;
  margin: 0 !important;
  width: auto;
}

.btn-delete {
  background: #e74c3c !important;
}

.btn-delete:hover {
  background: #c0392b !important;
}

.btn-add-points {
  background: #27ae60 !important;
}

.btn-add-points:hover {
  background: #229954 !important;
}

.btn-end-game {
  background: #3498db !important;
}

.btn-end-game:hover {
  background: #2980b9 !important;
}

.ranking-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.ranking-title {
  text-align: center;
  color: #333;
  margin-bottom: 15px;
  font-size: 1.3em;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: white;
  border-radius: 8px;
  margin-bottom: 10px;
  animation: slideIn 0.3s ease-out;
}

.ranking-position {
  font-size: 1.5em;
  font-weight: bold;
  color: #667eea;
  width: 40px;
  text-align: center;
}

.ranking-name {
  flex: 1;
  margin-left: 15px;
  font-weight: 500;
  color: #333;
}

.ranking-score {
  font-size: 1.2em;
  font-weight: bold;
  color: #764ba2;
  background: rgba(102, 126, 234, 0.1);
  padding: 5px 15px;
  border-radius: 20px;
}

/* Modal pour ajouter des points */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
  padding: 10px;
  overflow-y: auto;
}

.modal.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 15px;
  max-width: 400px;
  width: 90%;
  animation: slideIn 0.3s ease-out;
}

.modal-header {
  font-size: 1.5em;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
}

.modal-close {
  float: right;
  font-size: 1.5em;
  cursor: pointer;
  color: #999;
  background: none;
  border: none;
  padding: 0;
  width: auto;
  margin: 0;
}

.modal-close:hover {
  color: #333;
}

.hidden {
  display: none !important;
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-group button {
  flex: 1;
  margin: 0;
}

.btn-group button.secondary {
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 15px;
    border-radius: 15px;
  }

  h1 {
    font-size: 1.3em;
  }

  h2 {
    font-size: 1.2em;
  }

  .session-code {
    font-size: 1.3em;
  }

  .stats-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-label {
    font-size: 0.8em;
  }

  .stat-value {
    font-size: 1.6em;
  }

  .player-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .player-checkbox {
    margin-bottom: 10px;
  }

  .player-actions {
    width: 100%;
    margin-left: 0;
    margin-top: 10px;
    gap: 5px;
  }

  .selection-controls {
    gap: 10px;
    margin-bottom: 15px;
  }

  .btn-small {
    flex: 1;
    padding: 10px !important;
  }

  .quick-points {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .quick-btn {
    padding: 14px !important;
    font-size: 1em !important;
  }

  .ranking-item {
    padding: 10px;
  }

  .modal-content {
    width: 95%;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .session-header {
    padding: 15px;
    margin-bottom: 20px;
  }

  button {
    padding: 14px !important;
    font-size: 1em !important;
  }

  input[type="text"],
  input[type="number"],
  select {
    padding: 14px;
    font-size: 16px;
  }

  .player-card {
    padding: 12px;
  }

  .rank-badge {
    padding: 8px 12px;
    font-size: 0.85em;
  }
}

@media (max-width: 480px) {
  .stats-table {
    grid-template-columns: 30px 0.8fr repeat(4, 50px);
    gap: 6px;
    padding: 8px;
    font-size: 0.8em;
  }

  .stat-row > div,
  .stat-header > div {
    padding: 8px 4px;
    font-size: 0.75em;
  }

  .stat-badge {
    padding: 4px 6px;
    font-size: 0.75em;
  }

  .stat-rank {
    font-size: 0.95em;
  }

  .stat-person-name {
    font-size: 0.85em;
    padding-left: 8px;
  }

  .top-item {
    padding: 10px;
  }

  .ranking-card {
    gap: 10px;
    padding: 12px;
    flex-wrap: wrap;
  }

  .ranking-medal {
    font-size: 2em;
    min-width: 50px;
  }

  .ranking-details {
    flex: 1;
    min-width: 200px;
  }

  .ranking-card-name {
    font-size: 1.1em;
  }

  .ranking-card-info {
    gap: 10px;
  }

  .ranking-info-item {
    font-size: 0.8em;
  }

  .ranking-card-score {
    font-size: 1.3em;
    min-width: 50px;
    padding: 6px 10px;
  }

  body {
    padding: 10px;
  }

  .container {
    padding: 12px;
    border-radius: 12px;
  }

  h1 {
    font-size: 1.1em;
    margin-bottom: 20px;
  }

  h2 {
    font-size: 1em;
    margin-bottom: 15px;
  }

  .logo {
    font-size: 2.5em;
    margin-bottom: 15px;
  }

  .welcome-text {
    font-size: 0.9em;
  }

  .session-header {
    padding: 12px;
    margin-bottom: 15px;
  }

  .session-code {
    font-size: 1.1em;
    letter-spacing: 2px;
  }

  .players-list {
    margin-bottom: 20px;
  }

  .player-card {
    padding: 10px;
    margin-bottom: 12px;
    border-left-width: 3px;
  }

  .player-name {
    font-size: 1em;
  }

  .player-points {
    font-size: 1.1em;
  }

  .rank-badge {
    padding: 6px 10px;
    font-size: 0.8em;
    margin-left: 8px;
  }

  .player-actions {
    margin-top: 8px;
    gap: 5px;
  }

  .btn-small {
    padding: 12px !important;
    font-size: 0.9em !important;
  }

  .quick-points {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 15px;
  }

  .quick-btn {
    padding: 16px !important;
    font-size: 1.1em !important;
    margin: 0 !important;
  }

  .modal-content {
    width: 95%;
    padding: 15px;
    border-radius: 12px;
  }

  .modal-header {
    font-size: 1.2em;
  }

  .ranking-item {
    padding: 8px;
    margin-bottom: 8px;
  }

  .ranking-position {
    width: 30px;
    font-size: 1.2em;
  }

  .ranking-name {
    font-size: 0.95em;
    margin-left: 10px;
  }

  .ranking-score {
    font-size: 1em;
    padding: 5px 10px;
  }

  button {
    padding: 14px !important;
    font-size: 1em !important;
    margin-top: 8px !important;
  }

  input[type="text"],
  input[type="number"],
  select {
    padding: 14px;
    font-size: 16px;
    border-radius: 6px;
  }

  label {
    font-size: 0.95em;
    margin-bottom: 6px;
  }

  .form-group {
    margin-bottom: 15px;
  }

  .error,
  .success {
    font-size: 0.9em;
    padding: 10px;
  }

  .btn-group {
    gap: 8px;
  }

  .btn-group button {
    margin: 0 !important;
  }
}

/* Animations pour les points */
@keyframes pointsGain {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.points-update {
  animation: pointsGain 0.3s ease;
}

/* Quick Points Buttons */
.quick-points {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.quick-btn {
  padding: 12px !important;
  margin: 0 !important;
  font-size: 0.9em !important;
  background: #f0f0f0 !important;
  color: #333 !important;
  border: 2px solid #667eea !important;
  font-weight: 600;
  width: 100%;
  border-radius: 8px;
  min-height: 44px;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.quick-btn:hover {
  background: #667eea !important;
  color: white !important;
  transform: scale(1.05);
}

.quick-btn:active {
  transform: scale(0.95);
}

/* Loading */
.loading {
  text-align: center;
  padding: 20px;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
