:root {
  --primary: #3b82f6;
  --online: #22c55e;
  --offline: #64748b;
  --glass: rgba(25, 30, 60, 0.75);
  --text: #f8fafc;
}

* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: url('images/back.png') center/cover fixed;
  color: var(--text);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: ''; 
  position: absolute; 
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,20,0.12), rgba(20,10,60,0.85));
  z-index: 1;
}

/* Navigation */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  backdrop-filter: blur(14px);
  background: rgba(10, 15, 40, 0.8);
  border-bottom: 1px solid rgba(100, 120, 200, 0.25);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 2rem;
  font-weight: 900;
  text-decoration: none;
  color: inherit;
}

.logo img { height: 48px; width: auto; }
.logo span { color: var(--primary); }

.nav-buttons button {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--text);
  padding: 0.7rem 1.6rem;
  margin-left: 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.nav-buttons button:hover { 
  background: var(--primary); 
  transform: translateY(-2px); 
}

.nav-buttons .signup { 
  background: var(--primary); 
}

/* Main Content */
.container {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 130px 20px 80px;
  text-align: center;
}

h1 {
  font-size: 4.5rem;
  font-weight: 900;
  background: linear-gradient(90deg, #60a5fa, #a3e635);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Tableau */
.table-container {
  background: var(--glass);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0,0,0,0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(100,120,200,0.3);
  margin: 40px auto;
  max-width: 900px;                  /* ajouté pour compacter */
}

table { 
  width: 100%; 
  border-collapse: collapse; 
  font-size: 0.95rem;
}

thead { 
  background: linear-gradient(90deg, #1e3a8a, #1e40af); 
}

th, td {
  padding: 14px 10px !important;
  text-align: center;
}

th { 
  font-weight: 700; 
  font-size: 1.1rem; 
}

tr:nth-child(even) { 
  background: rgba(255,255,255,0.03); 
}

/* Status dots / icônes */
.status-dot {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
}

.status.online .status-dot {
  content: url('images/chesscom.png');
  animation: pulse 2s infinite;
}

.status.offline .status-dot {
  content: url('images/lichess.png');
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.7); }
  70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* Largeurs de colonnes */
th:nth-child(1), td:nth-child(1) { width: 60px; }   /* Rank */
th:nth-child(2), td:nth-child(2) { width: 40px; }   /* Status */
th:nth-child(4), td:nth-child(4),
th:nth-child(5), td:nth-child(5) { width: 90px; }   /* Blitz & Bullet */

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
}

.modal.active { display: flex !important; }

.modal-content {
  background: rgba(25, 30, 60, 0.98);
  padding: 40px;
  border-radius: 20px;
  width: 90%;
  max-width: 420px;
  border: 1px solid rgba(100,120,200,0.4);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  position: relative;
  animation: modalShow 0.4s ease;
}

@keyframes modalShow { 
  from { transform: scale(0.7); opacity: 0; } 
  to { transform: scale(1); opacity: 1; } 
}

.close { 
  position: absolute; 
  top: 15px; right: 20px; 
  font-size: 32px; 
  cursor: pointer; 
  color: #94a3b8; 
}

.close:hover { color: white; }

.modal h2 { 
  font-size: 2rem; 
  margin-bottom: 30px; 
  color: var(--primary); 
  text-align: center; 
}

input {
  width: 100%; 
  padding: 14px; 
  margin: 12px 0;
  background: rgba(50,60,100,0.6); 
  border: 1px solid rgba(100,120,200,0.4);
  border-radius: 8px; 
  color: white; 
  font-size: 1rem;
}

input:focus { 
  outline: none; 
  border-color: var(--primary); 
}

.btn-primary {
  width: 100%; 
  padding: 14px; 
  background: var(--primary);
  color: white; 
  border: none; 
  border-radius: 8px;
  font-size: 1.1rem; 
  font-weight: 600; 
  cursor: pointer;
  margin-top: 15px; 
  transition: 0.3s;
}

.btn-primary:hover { 
  background: #2563eb; 
  transform: translateY(-2px); 
}

/* Responsive */
@media (max-width: 768px) {
  nav { 
    flex-direction: column; 
    gap: 1rem; 
    padding: 1rem; 
  }
  
  h1 { font-size: 3.5rem; }
  
  .logo { font-size: 1.8rem; }
  .logo img { height: 40px; }
  
  .table-container { 
    max-width: 100%; 
    padding: 0 10px; 
  }
  
  table { font-size: 0.85rem; }
  
  th, td { padding: 10px 6px !important; }
}