/* ==== Index.php ==== */

:root {
  --font-xxs: 0.75rem;   /* 12px */
  --font-xs:  0.875rem;  /* 14px */
  --font-sm:  1rem;      /* 16px */
  --font-md:  1.125rem;  /* 18px */
  --font-lg:  1.25rem;   /* 20px */
  --font-xl:  1.5rem;    /* 24px */
  --sidebar-width: 280px;
  --sidebar-padding: 16px;
  --sidebar-border: 1px;
  --sidebar-total-width: calc(
    var(--sidebar-width) + 
    var(--sidebar-padding) * 2 + 
    var(--sidebar-border)
  );
}

#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(10px); /* flou */
  background: rgba(0, 0, 0, 0.4); /* optionnel, teinte sombre */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
#loader img {
  width: 200px; /* taille de ton illustration */
  animation: pulse 1.5s infinite;
}
/* Layout */
.container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #fff;
}

/* Header / Nav */
header {
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #00e5ff;
  text-shadow: 0 0 8px #00e5ff;
}
nav ul {
  list-style: none;
  display: flex;
  gap: 10px;
  margin: 0; padding: 0;
}
nav ul li a {
  color: #00e5ff;
  text-decoration: none;
}
nav ul li a:hover {
  color: #00ffea;
  text-shadow: 0 0 3px #00ffea;
}

/* Hero */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 10px;
}
.hero-title {
  font-size: var(--font-xl);
  margin-bottom: 7.5px;
  text-shadow: 0 0 7.5px #00e5ff;
}
.hero-subtitle {
  font-size: var(--font-lg);
  margin-bottom: 22.5px;
  opacity: 0.8;
}

/* Buttons */
.btn-play {
  padding: 12px 30px;
  font-size: var(--font-sm);
  font-weight: bold;
  background: #00e5ff;
  color: #000;
  border: none;
  border-radius: 37.5px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 0 12px #00e5ff;
  transition: transform 0.2s ease;
}
.btn-play:hover { transform: scale(1.05); }

.btn-auth {
  padding: 7.5px 22.5px;
  font-size: var(--font-sm);
  font-weight: 700;
  background: #00e5ff;
  color: #000;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 0 15px #00e5ff;
  transition: transform 0.2s ease, background-color 0.3s ease;
  margin-left: 10px;
}
.btn-auth:hover {
  background-color: #00b8cc;
  box-shadow: 0 0 25px #00b8cc;
  transform: scale(1.05);
}

/* Games section */
#games {
  padding: 37.5px 15px;
  background: rgba(10,10,42,0.8);
}
#games h2 {
  text-align: center;
  font-size: var(--font-xl);
  margin-bottom: 30px;
  color: #00e5ff;
  text-shadow: 0 0 4px #00e5ff;
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 22.5px;
  max-width: 1000px;
  margin: 0 auto;
}
.game-card {
  background: rgba(0,0,0,0.5);
  border-radius: 15px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s ease, background 0.2s ease;
}
.game-card:hover { transform: translateY(-5px); background: rgba(0,0,0,0.7); }
.game-card img {
  width: 75px;
  height: auto;
  margin-bottom: 15px;
  filter: drop-shadow(0 0 8px #00e5ff);
}
.game-card button {
  margin-top: auto;
  padding: 7.5px 15px;
  font-size: 0.7rem;
  font-weight: bold;
  background: #00e5ff;
  color: #000;
  border: none;
  border-radius: 37.5px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 0 7.5px #00e5ff;
  transition: transform 0.2s ease;
}
.game-card button:hover { transform: scale(1.05); }

/* Footer */
footer {
  padding: 15px;
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #fff;
}
footer a {
  color: #00e5ff;
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}

/* Scorebox */
.scorebox {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 98%;               /* prend toute la largeur */
  z-index: 999;
  background: rgba(0, 0, 0, 0.55);
  border-top: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 -2px 18px rgba(0, 229, 255, 0.35);
  border-radius: 12px 12px 0 0; /* arrondi uniquement en haut */
  padding: 10px 14px;
  backdrop-filter: blur(4px);
  color: #fff;
  user-select: none;
}

/* Ligne interne : label / valeur */
.scorebox-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.scorebox .label {
  color: #00e5ff;
  text-shadow: 0 0 6px #00e5ff;
  font-weight: 600;
}
.scorebox .value {
  font-weight: 80;
}

/* Bouton refresh */
.scorebox-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: 999px;
  background: #00e5ff;
  color: #000;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 12px #00e5ff;
  transition: transform 0.15s ease;
}
.scorebox-refresh:hover { transform: scale(1.06); }

/* Version mobile : on garde la bande */
@media (max-width: 600px) {
  .scorebox {
    padding: 8px 10px;
    font-size: var(--font-xs);
  }
}

/* Bouton poignée sidebar */
.toggle-arrow {
  position: fixed;
  top: 50%;
  left: 0;
  z-index: 1001;

  width: 1cm;
  height: 3cm;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;

  background: rgba(255, 255, 255, 0.5);
  border: 4px solid #00e5ff;
  border-left: none;
  border-radius: 0 5mm 5mm 0;

  cursor: pointer;
  padding: 0;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.55);
  transform: translateY(-50%);
  transition: left 0.25s ease, transform 0.2s ease;
  user-select: none;
}

.toggle-arrow span {
  width: 25px;
  height: 4px;
  background: #000;
  border-radius: 999px;
  display: block;
}

.toggle-arrow:hover {
  transform: translateY(-50%) scale(1.04);
}

.toggle-arrow.open {
  left: var(--sidebar-total-width);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;

  width: var(--sidebar-width);
  height: 100vh;
  padding: var(--sidebar-padding);

  transform: translateX(-100%);
  background: rgba(0,0,0,.75);
  border-right: var(--sidebar-border) solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.2);
  backdrop-filter: blur(6px);
  z-index: 1000;
  transition: transform .25s ease;
  color: #fff;
  overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }
.sidebar h2 {
  margin: 0 0 12px;
  font-size: var(--font-md);
  color: #00e5ff;
  text-shadow: 0 0 6px #00e5ff;
}
.convertBox {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
}
.convertBox .row {
  display: flex; align-items: center; gap: 8px; margin: 8px 0;
}
.convertBox input[type=number] {
  width: 90px; padding: 6px 8px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.4); color: #fff;
}
#convertBtn {
  padding: 8px 14px; border-radius: 999px; border: none; cursor: pointer; font-weight: 700;
  background: #00e5ff; color: #000; box-shadow: 0 0 10px #00e5ff;
}
#convertBtn[disabled] { opacity: .5; cursor: not-allowed; }
/* Nouveautés */
.newsBox {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 12px rgba(0, 229, 255, 0.05);

  height: 58vh;
  min-height: 430px;
  max-height: calc(100vh - 245px);

  display: flex;
  flex-direction: column;
}

.newsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.newsHeader h3 {
  margin: 0;
  font-size: var(--font-sm);
  color: #00e5ff;
  text-shadow: 0 0 6px #00e5ff;
}

.newsCounter {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 999px;
  font-size: var(--font-xxs);
  color: rgba(255, 255, 255, 0.78);
  background: rgba(0, 0, 0, 0.25);
}

.newsList {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 6px;
  font-size: var(--font-xxs);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.65) rgba(255, 255, 255, 0.06);
}

.newsList::-webkit-scrollbar {
  width: 6px;
}

.newsList::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.newsList::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.65);
  border-radius: 999px;
}

.newsItem {
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 229, 255, 0.16);
}

.newsItem:first-child {
  padding-top: 2px;
}

.newsItem:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.newsTitle {
  margin-bottom: 4px;
  color: #fff;
  font-size: var(--font-xs);
  font-weight: 700;
  line-height: 1.25;
  text-shadow: none;
}

.newsDate {
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--font-xxs);
  line-height: 1.2;
}

.newsContent {
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.45;
  word-break: break-word;
}

.newsLink {
  display: inline-flex;
  align-items: center;
  margin-top: 7px;
  color: #00e5ff;
  font-size: var(--font-xxs);
  text-decoration: none;
  text-shadow: 0 0 4px rgba(0, 229, 255, 0.6);
}

.newsLink:hover {
  color: #00ffea;
  text-decoration: underline;
}

/* Formulaire d'ajout */
.addNewsBtn {
  width: 100%;
  margin: 0 0 10px;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  background: #00e5ff;
  color: #000;
  font-family: inherit;
  font-size: var(--font-xxs);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.85);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.addNewsBtn:hover {
  background: #00ffea;
  transform: scale(1.03);
}

.addNewsForm {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
}

.addNewsForm input,
.addNewsForm textarea {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-family: inherit;
  font-size: var(--font-xxs);
  outline: none;
}

.addNewsForm input:focus,
.addNewsForm textarea:focus {
  border-color: rgba(0, 229, 255, 0.72);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.35);
}

.addNewsForm textarea {
  resize: vertical;
  min-height: 82px;
}

.addNewsForm button[type="submit"] {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  background: #00e5ff;
  color: #000;
  font-family: inherit;
  font-size: var(--font-xxs);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 9px rgba(0, 229, 255, 0.75);
}

.addNewsMsg {
  min-height: 1em;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--font-xxs);
  line-height: 1.35;
}

.addNewsForm input::placeholder,
.addNewsForm textarea::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.addNewsForm button[type="submit"]:hover {
  background: #00ffea;
  transform: scale(1.02);
}

.newsLink::after {
  content: " ↗";
  opacity: 0.8;
}

.addNewsForm select {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-family: inherit;
  font-size: var(--font-xxs);
  outline: none;
}

.addNewsForm select:focus {
  border-color: rgba(0, 229, 255, 0.72);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.35);
}

.newsMeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.newsBadge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: var(--font-xxs);
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(0, 0, 0, 0.28);
}

.newsItem {
  position: relative;
  padding: 10px 0 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.newsItem::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.8);
}

.newsType-erreur::before {
  background: #ff4d4d;
  box-shadow: 0 0 8px rgba(255, 77, 77, 0.65);
}

.newsType-maintenance::before {
  background: #ffd84d;
  box-shadow: 0 0 8px rgba(255, 216, 77, 0.65);
}

.newsType-info::before {
  background: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.65);
}

.newsType-nouveaute::before {
  background: #4dff88;
  box-shadow: 0 0 8px rgba(77, 255, 136, 0.65);
}

/* Traduction IA des nouveautés */
.newsTranslateControls {
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
}

.newsTranslateControls label {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--font-xxs);
  line-height: 1.25;
}

.newsTranslateSelect {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-family: inherit;
  font-size: var(--font-xxs);
  outline: none;
}

.newsTranslateSelect:focus {
  border-color: rgba(0, 229, 255, 0.72);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.35);
}

.newsActions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.newsTranslateBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  color: #00e5ff;
  font-family: inherit;
  font-size: var(--font-xxs);
  font-weight: 700;
  cursor: pointer;
  text-shadow: 0 0 4px rgba(0, 229, 255, 0.7);
  transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.newsTranslateBtn:hover:not(:disabled) {
  background: #00ffea;
  transform: scale(1.03);
}

.newsTranslateBtn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.newsTranslation {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-left: 3px solid rgba(0, 229, 255, 0.8);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.05);
}

.newsTranslationMeta {
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--font-xxs);
  line-height: 1.2;
}

.newsTranslationTitle {
  margin-bottom: 5px;
  color: #fff;
  font-size: var(--font-xs);
  font-weight: 700;
  line-height: 1.25;
}

.newsTranslationContent {
  color: rgba(255, 255, 255, 0.86);
  font-size: var(--font-xxs);
  line-height: 1.45;
  word-break: break-word;
}

.newsTranslationError {
  color: #ffb4b4;
  font-size: var(--font-xxs);
  line-height: 1.35;
}

.header-user-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-right: 10px;
  color: white;
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid rgba(0, 229, 255, 0.38);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.24);
}

header .header-user-link .header-avatar {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;

  display: block;
  flex: 0 0 34px;

  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 229, 255, 0.72);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.55);
}