/* ===============================
   Reset global
   =============================== */
* {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    /* Fond animé */
    background: linear-gradient(
        135deg,
        #ff5f6d,
        #ffc371,
        #42e695,
        #3bb2b8,
        #7f7fd5
    );
    background-size: 400% 400%;
    animation: gradientMove 15s ease infinite;
    color: white;
    text-align: center;
}

/* Animation dégradé */
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===============================
   Notifications
   =============================== */
#notif-icon {
    position: fixed;
    top: 15px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    z-index: 1000;
}

#notif-count {
    background: red;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
}

#notif-panel {
    position: fixed;
    top: 50px;
    right: 15px;
    background: rgba(0,0,0,0.9);
    color: white;
    border: 2px solid #f39c12;
    border-radius: 10px;
    width: 250px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    display: none;
    z-index: 999;
}

#notif-panel h3 {
    margin-top: 0;
}

/* ===============================
   Écran de démarrage
   =============================== */
#start-screen {
    text-align: center;
    margin-bottom: 20px;
}

#start-screen input {
    display: block;
    margin: 0 auto 10px auto;
    padding: 10px;
    font-size: 16px;
    width: 200px;
}

#start-screen button {
    display: block;
    margin: 0 auto;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
}

/* ===============================
   Jeu et Canvas
   =============================== */
#game-container {
    display: none;
    padding: 20px;
    background: rgba(0,0,0,0.55);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
}

canvas {
    background: #111;
    border-radius: 10px;
    border: 6px solid #f39c12;
    box-shadow: 0 0 20px #f39c12;
    margin-bottom: 15px;
}

/* ===============================
   Score et Best Score
   =============================== */
#game-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

#current-score-container,
#best-score-container {
    font-weight: bold;
    padding: 8px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    width: fit-content;
    text-align: center;
    background: rgba(0,0,0,0.5);
    text-shadow: 0 0 3px #fff, 0 0 6px #f39c12;
    box-shadow: 0 0 10px #f39c12 inset, 0 0 15px #f39c12;
}

#current-score-container { color: #1abc9c; font-size: 18px; }
#best-score-container { color: #f1c40f; font-size: 18px; }

/* ===============================
   Super barre
   =============================== */
#super-container {
    width: 200px;
    height: 14px;
    border: 2px solid #ff9a00;
    border-radius: 10px;
    margin: 15px auto;
    background: rgba(0,0,0,0.6);
    overflow: hidden;
}

#super-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,#ff4c00,#ff9a00);
    transition: width 0.2s linear;
}

/* ===============================
   Bouton Restart
   =============================== */
#restart {
    background: linear-gradient(45deg, #ff4c00,#ff9a00);
    border: 2px solid #ff9a00;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    padding: 10px 25px;
    border-radius: 10px;
    cursor: pointer;
    text-shadow: 0 0 5px #ff9a00,0 0 10px #ff4c00;
    box-shadow: 0 0 10px #ff9a00,0 0 20px #ff4c00,0 0 30px #ff4c00 inset;
    transition: all 0.2s ease-in-out;
}

#restart:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px #ffb84c,0 0 30px #ff6b00,0 0 40px #ff6b00 inset;
}

/* ===============================
   Scoreboard
   =============================== */
#scoreboard {
    margin: 20px auto;
    border-collapse: collapse;
    width: 300px;
}

#scoreboard th, #scoreboard td {
    border: 1px solid #f39c12;
    padding: 5px;
    font-weight: bold;
}

#scoreboard th {
    color: #fff;
    text-shadow: 0 0 4px #000;
}

#scoreboard td {
    color: #ecf0f1;
    text-shadow: 0 0 2px #000;
}

#scoreboard tr:nth-child(even) {
    background: rgba(255,255,255,0.1);
}

/* Top 3 flames animation */
@keyframes flame {
    0% { color:#ff4c00;text-shadow:0 0 5px #ff9a00,0 0 10px #ff4c00; }
    25% { color:#ff7800;text-shadow:0 0 5px #ffb300,0 0 10px #ff7800; }
    50% { color:#ff1a00;text-shadow:0 0 5px #ff7a00,0 0 10px #ff1a00; }
    75% { color:#ff6500;text-shadow:0 0 5px #ff9a00,0 0 10px #ff6500; }
    100% { color:#ff4c00;text-shadow:0 0 5px #ff9a00,0 0 10px #ff4c00; }
}

/* ===============================
   Amis
   =============================== */
#friends-container {
    margin-top: 15px;
    background: rgba(0,0,0,0.6);
    padding: 10px;
    border-radius: 8px;
    width: 300px;
}

#friends-list, #search-results {
    list-style: none;
    padding-left: 0;
}

#search-player {
    padding: 5px;
    width: 150px;
}

#search-btn {
    padding: 5px 10px;
    margin-left: 5px;
    cursor: pointer;
}
/* =========================
   NOTIFICATION TOAST
========================= */
#notif-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #00ffcc;
    color: black;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 0 10px #00ffcc;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    font-weight: bold;
    z-index: 999;
}

#notif-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Résultats recherche plus jolis */
#search-results li {
    transition: 0.2s;
}
#search-results li:hover {
    transform: scale(1.05);
}
.remove-friend-btn {
    margin-left: 10px;
    background: #e74c3c;
    border: none;
    color: white;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    transition: 0.2s;
}

.remove-friend-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.hidden {
    display: none;
}

.modal-content {
    background: #1e1e2f;
    padding: 20px 30px;
    border-radius: 10px;
    text-align: center;
    color: white;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.modal-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

#confirm-yes {
    background: #e74c3c;
    border: none;
    padding: 8px 14px;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

#confirm-no {
    background: #2ecc71;
    border: none;
    padding: 8px 14px;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

#confirm-yes:hover { background: #c0392b; }
#confirm-no:hover { background: #27ae60; }
#confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 999;

  /* ❗ NE PAS METTRE display:flex ICI */
  display: none;
}

#confirm-yes {
  background: #e74c3c;
  border: none;
  padding: 8px 15px;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

#confirm-no {
  background: #2ecc71;
  border: none;
  padding: 8px 15px;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}
#confirm-modal.active {
  display: flex;
}