/* Background & body */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #e0f7fa 0%, #80deea 100%);
  color: #222;
  transition: background 0.3s, color 0.3s;
}

/* Dark mode background */
.dark {
  background: linear-gradient(135deg, #121212 0%, #333333 100%);
  color: #eee;
}

/* login */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #00796b; /* vert clair */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.dark .login-screen {
  background-color: #153822; /* vert sombre mode dark */
}

.login-card {
  background: #d4edda; /* vert clair */
  padding: 30px 40px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 100, 0, 0.3); /* belle ombre verte */
  width: 320px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.dark .login-card {
  background: #0b2e14;
  box-shadow: 0 8px 20px rgba(0, 50, 0, 0.6);
}

.login-card h2 {
  margin: 0 0 15px;
  color: #155724;
  font-weight: 700;
  font-size: 1.8rem;
}

.dark .login-card h2 {
  color: #a8d5a2;
}

.login-card input[type="password"] {
  padding: 12px 15px;
  font-size: 1rem;
  border: 2px solid #28a745;
  border-radius: 8px;
  background: #e9f7ef;
  color: #155724;
  transition: border-color 0.3s;
}

.login-card input[type="password"]:focus {
  outline: none;
  border-color: #19692c;
  background: #d4edda;
}

.login-card button {
  padding: 12px;
  font-size: 1rem;
  background-color: #00796b;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s;
  font-weight: 600;
}

.login-card button:hover {
  background-color: #19692c;
}

.dark .login-card input[type="password"] {
  border-color: #19692c;
  background: #153822;
  color: #a8d5a2;
}

.dark .login-card button {
  background-color: #2ecc40;
}

.dark .login-card button:hover {
  background-color: #19692c;
}

.error {
  color: #a71d2a;
  font-weight: 700;
  margin-top: 5px;
}

.logo {
  width: 90px;
  height: auto;
  margin: 10px auto;
  display: block;
  background: transparent;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
  border-radius: 30px;
  box-shadow: 0 8px 20px rgba(0, 100, 0, 0.3);
}

.logointerface {
  top: 0;
  left: 0;
  width: 80px;
  height: auto;
  margin: 10px auto;
  background: transparent;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
  box-shadow: 0 8px 20px rgba(0, 100, 0, 0.3);
  border-radius: 30px;
}

/* Container */
.container {
  max-width: 90%;
  margin: 30px auto;
  padding: 20px;
  background: rgba(255 255 255 / 0.85);
  border-radius: 30px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transition: background 0.3s;
}

.dark .container {
  background: rgba(30 30 30 / 0.85);
}
.title {
  text-align: center;
  font-size: 2rem;
  padding: 10px;
  margin: 20px 0;
}
.footer {
  text-align: center;
  font-size: 12px;
  margin: 10px 0;
  padding: 10px;
}
.version {
  text-align: right;
  font-size: 12px;
  margin: 10px 0;
  padding: 10px;
}

/* Controls */
.controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 colonnes égales */
  gap: 15px;
  margin-bottom: 25px;
  justify-content: center;
}

/* Inputs and select */
input[type="text"],
select,
input[type="color"] {
  padding: 10px 15px;
  font-size: 1rem;
  border: 2px solid #00796b;
  border-radius: 8px;
  outline-offset: 2px;
  transition: border-color 0.3s, box-shadow 0.3s;
  min-width: 140px;
  box-sizing: border-box;
}

input[type="text"]:focus,
select:focus,
input[type="color"]:focus {
  border-color: #004d40;
  box-shadow: 0 0 8px #004d40aa;
}

/* Buttons */
button {
  background-color: #00796b;
  color: white;
  border: none;
  padding: 10px 18px;
  margin-block: 10px 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
  min-width: 100px;
}

button:hover {
  background-color: #004d40;
}

.dark button {
  background-color: #009688;
}

.dark button:hover {
  background-color: #00695c;
}

/* Player cards grid & style */
#players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.player {
  background: white;
  color: #222;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s, color 0.3s, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.player:hover {
  transform: scale(1.02);
}

.dark .player {
  background: #262626;
  color: #eee;
}

/* Color bar */
.color-bar {
  width: 12px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 6px;
}

/* Score */
.score {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 6px;
}

/* Responsive container for player info */
.info {
  flex-grow: 1;
  min-width: 140px;
}

/* Chart */
#scoreChart {
  width: 100%;
  max-width: 800px;
  height: auto;
  aspect-ratio: 3 / 1;
  margin: 20px auto;
  display: block;
}

/* Loader */
.loader {
  text-align: center;
  padding: 50px;
  font-size: 1.2rem;
}

/* Responsive for smaller screens */
@media (max-width: 600px) {
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  input[type="text"],
  select,
  input[type="color"],
  button {
    width: 100%;
    min-width: unset;
  }
  .player {
    flex-direction: column;
    align-items: flex-start;
  }
  .player > div:last-child {
    margin-top: 10px;
  }
}

/* guide */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 2rem;
  background-color: #f9f9f9;
  color: #333;
  line-height: 1.6;
}
h1,
h2 {
  color: #222;
  margin-top: 1.5rem;
}
.section {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}
.emoji {
  font-size: 1.4rem;
  margin-right: 0.5rem;
}
ul {
  padding-left: 1.2rem;
}
li {
  margin-bottom: 0.6rem;
}

.section strong {
  color: #444;
}

.guide-button {
  display: inline-block;
  margin-top: 10px;
  padding: 12px;
  font-size: 1rem;
  background-color: #00796b;
  border: none;
  border-radius: 8px;
  color: white;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s;
  font-weight: 600;
}
.guide-button:hover {
  background-color: #005a4f;
}
