
:root {
  --bg: #0c0b14;
  --panel: #171525;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --text: #f8f7ff;
  --muted: #a7a2bb;
  --border: #302b45;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, #251342 0%, transparent 48%),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 6%;
  border-bottom: 1px solid var(--border);
  background: #100e1acc;
}

.topbar h1 {
  font-size: 20px;
  margin: 0;
}

.status {
  color: #c4b5fd;
  font-size: 13px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #a78bfa;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.hero {
  padding: 42px 0 30px;
  text-align: center;
}

.eyebrow {
  color: #c4b5fd;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 3px;
}

.hero h2, .section-heading h2 {
  margin: 10px 0;
  font-size: clamp(25px, 4vw, 36px);
}

.hero > p:last-child,
.hint {
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.game {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: center;
}

.wheel-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 30px 15px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #141120;
  overflow: hidden;
}

.wheel {
  position: relative;
  width: min(360px, 76vw);
  aspect-ratio: 1;
  border: 7px solid #e9d5ff;
  border-radius: 50%;
  background: conic-gradient(
    #8b5cf6 0deg 45deg,
    #ec4899 45deg 90deg,
    #4338ca 90deg 135deg,
    #06b6d4 135deg 180deg,
    #7c3aed 180deg 225deg,
    #f97316 225deg 270deg,
    #db2777 270deg 315deg,
    #4f46e5 315deg 360deg
  );
  box-shadow: 0 0 35px #8b5cf655, inset 0 0 15px #0005;
  transition: transform 5s cubic-bezier(0.12, 0.7, 0.12, 1);
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from -1deg,
    transparent 0deg 44deg,
    #ffffffbb 44deg 45deg
  );
}

.wheel-center {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  transform: translate(-50%, -50%);
  border: 4px solid #f5d0fe;
  border-radius: 50%;
  background: #171126;
  font-size: 28px;
  box-shadow: 0 0 18px #0008;
}

.pointer {
  position: absolute;
  z-index: 4;
  top: 21px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 17px solid transparent;
  border-right: 17px solid transparent;
  border-top: 35px solid #fff;
  filter: drop-shadow(0 3px 5px #0008);
}

.spin-button {
  margin-top: 28px;
  padding: 15px 28px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(110deg, var(--purple), var(--pink));
  color: white;
  font-weight: bold;
  letter-spacing: 1px;
  box-shadow: 0 8px 24px #8b5cf644;
}

.panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
}

.panel h3 {
  margin-top: 0;
}

.player-form {
  display: flex;
  gap: 8px;
}

.player-form input {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: #0e0c17;
  color: white;
}

.player-form input:focus {
  border-color: var(--purple);
}

.player-form button,
.secondary-button {
  padding: 11px 14px;
  border: none;
  border-radius: 9px;
  background: var(--purple);
  color: white;
  font-weight: bold;
}

.player-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 18px 0;
  list-style: none;
}

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #e9e5f5;
  font-size: 13px;
}

.player-item.active {
  border-color: var(--purple);
  background: #8b5cf61c;
}

.player-item button {
  border: none;
  background: transparent;
  color: #f9a8d4;
}

.current-player,
.result {
  display: grid;
  gap: 8px;
  padding: 15px;
  margin-top: 12px;
  border-radius: 12px;
  background: #0e0c17;
  overflow-wrap: anywhere;
}

.result {
  border: 1px solid #44345e;
}

.small-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1.5px;
}

.result strong {
  color: #d8b4fe;
  font-size: 19px;
}

.secondary-button,
.reset-button {
  width: 100%;
  margin-top: 12px;
}

.reset-button {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}

.prizes {
  margin-top: 48px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.count {
  padding: 8px 12px;
  border-radius: 20px;
  background: #8b5cf622;
  color: #d8b4fe;
  font-size: 12px;
}

.prize-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.prize-card {
  padding: 18px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  text-align: center;
}

.prize-card .emoji {
  display: block;
  margin-bottom: 10px;
  font-size: 25px;
}

.prize-card strong {
  font-size: 13px;
}

footer {
  padding: 35px 0 25px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

@media (max-width: 760px) {
  .game {
    grid-template-columns: 1fr;
  }

  .prize-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    padding: 18px 4%;
  }

  .topbar h1 {
    font-size: 16px;
  }
}

.auth-panel {
  max-width: 560px;
  margin: 0 auto 35px;
  padding: 25px;
  border: 1px solid #302b45;
  border-radius: 20px;
  background: #171525;
}

.auth-panel h2 {
  margin-top: 0;
}

.auth-panel p {
  color: #a7a2bb;
  line-height: 1.5;
}

.auth-panel form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.auth-panel input {
  width: 100%;
  padding: 13px;
  border: 1px solid #302b45;
  border-radius: 9px;
  background: #0e0c17;
  color: white;
}

.auth-panel button {
  padding: 12px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(110deg, #8b5cf6, #ec4899);
  color: white;
  font-weight: bold;
}

#authMessage {
  overflow-wrap: anywhere;
}

#logoutButton {
  margin-top: 10px;
}

[hidden] {
  display: none !important;
}
/* Masquer les anciennes commandes locales */
#playerForm,
#nextPlayerButton,
#resetButton,
#playerList .player-item button {
  display: none !important;
}
.invitation-box {
  max-width: 450px;
  margin: 30px auto;
  padding: 20px;
  border: 2px solid #8b5cf6;
  border-radius: 15px;
  background: #1e1633;
  color: white;
  text-align: center;
}

.invitation-box[hidden] {
  display: none !important;
}

.invitation-box input {
  padding: 12px;
  border-radius: 8px;
  margin: 10px;
}

.invitation-box button {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: #8b5cf6;
  color: white;
  cursor: pointer;
}
/* ===== ESPACE ADMINISTRATION ===== */

#adminButton {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: bold;
  cursor: pointer;
}

#adminButton:hover {
  background: #9333ea;
}

#adminPanel {
  max-width: 850px;
  margin: 30px auto;
  padding: 30px;
  background: #181125;
  border: 2px solid #7c3aed;
  border-radius: 18px;
  color: white;
  text-align: center;
  box-shadow: 0 0 25px rgba(124, 58, 237, 0.3);
}

.admin-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin: 25px 0;
}

.admin-menu button {
  background: #302044;
  color: white;
  border: 1px solid #7c3aed;
  border-radius: 12px;
  padding: 20px;
  font-size: 16px;
  cursor: pointer;
}

.admin-menu button:hover {
  background: #6d28d9;
}

#closeAdmin {
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 25px;
  cursor: pointer;
}

/* Garder les éléments cachés réellement invisibles */
[hidden] {
  display: none !important;
}

/* Adaptation aux téléphones */
@media (max-width: 600px) {
  .admin-menu {
    grid-template-columns: 1fr;
  }

  #adminPanel {
    margin: 15px;
    padding: 20px;
  }
}/* ===== LISTE DES JOUEURS ADMIN ===== */

#adminPlayersPanel {
  margin-top: 25px;
  padding: 20px;
  background: #21152f;
  border: 1px solid #7c3aed;
  border-radius: 15px;
}

#adminPlayersPanel h3 {
  color: #c084fc;
  margin-bottom: 15px;
}

#adminPlayersList {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.admin-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: #302044;
  border: 1px solid #5b21b6;
  border-radius: 10px;
  color: white;
  text-align: left;
}

.admin-player strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

/* Adaptation aux téléphones */
@media (max-width: 600px) {
  .admin-player {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* ===== BOUTONS ACTIVER / DÉSACTIVER ===== */

.admin-status-button {
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

.admin-status-button:hover {
  background: #6d28d9;
  transform: scale(1.03);
}

.admin-status-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 600px) {
  .admin-status-button {
    width: 100%;
  }
}
/* ===== ADMINISTRATION : GESTION DES GAINS ===== */

#adminPrizesPanel {
  margin-top: 25px;
  padding: 20px;
  background: #21152f;
  border: 1px solid #7c3aed;
  border-radius: 15px;
}

#adminPrizesPanel h3 {
  color: #c084fc;
  margin-bottom: 15px;
}

#adminPrizesList {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.admin-prize {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background: #302044;
  border: 1px solid #5b21b6;
  border-radius: 10px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  text-align: left;
  transition: 0.2s;
}

.admin-prize:hover {
  background: #452565;
  border-color: #a855f7;
}

/* Adaptation aux téléphones */
@media (max-width: 600px) {
  #adminPrizesPanel {
    padding: 15px;
  }

  .admin-prize {
    padding: 12px;
    font-size: 14px;
  }
}/* ===== BOUTONS MODIFIER LES GAINS ===== */

.admin-prize {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.admin-edit-prize {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

.admin-edit-prize:hover {
  background: linear-gradient(135deg, #9333ea, #c084fc);
  transform: scale(1.05);
}

.admin-edit-prize:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Adaptation aux téléphones */
@media (max-width: 600px) {
  .admin-prize {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-edit-prize {
    width: 100%;
  }
}
/* ===== ÉTIQUETTES DES GAINS SUR LA ROUE ===== */

.wheel-labels {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 85px;
  text-align: center;
  color: white;
  font-size: 11px;
  font-weight: bold;
  line-height: 1.2;
  text-shadow: 1px 1px 3px #000;
}

.wheel-label span {
  display: block;
  overflow-wrap: break-word;
}
[hidden] {
    display: none !important;
}