/* ============================
   BASE
============================ */

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  color: #fff;
  background: #000;
}

#matrix {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.overlay {
  position: relative;
  z-index: 1;
  padding: 20px;
}

/* ============================
   HEADER + MATRIX NEON TITLE
============================ */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* ============================
   TITRE MATRIX NEON TRICOLORE
============================ */

.matrix-title {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  display: flex;
  gap: 15px;
}

/* CHALLENGES — bleu néon */
.title-blue {
  color: #00aaff;
  text-shadow:
    0 0 8px #00aaff,
    0 0 16px #00aaff,
    0 0 30px rgba(0,170,255,0.6);
}

/* Ass — blanc lumineux */
.title-white {
  color: #ffffff;
  text-shadow:
    0 0 8px #ffffff,
    0 0 20px rgba(255,255,255,0.6),
    0 0 30px rgba(255,255,255,0.3);
}

/* ============================
   $ASS — GRADIENT ANIMÉ ROUGE
============================ */

.title-red {
  font-weight: 900;
  background: linear-gradient(
    90deg,
    #ff003c,
    #ff335c,
    #ff6680,
    #ff003c
  );
  background-size: 300%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;

  animation: redGlow 3s linear infinite;

  text-shadow:
    0 0 10px rgba(255,0,60,0.6),
    0 0 20px rgba(255,0,60,0.4),
    0 0 35px rgba(255,0,60,0.3);

  /* Dégradé Matrix supplémentaire */
  background: linear-gradient(90deg, #ff0000, #dae0de, #001aff);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;

  /* Glow Matrix */
  text-shadow:
    0 0 10px rgba(0,255,153,0.6),
    0 0 20px rgba(0,255,153,0.4),
    0 0 40px rgba(223, 7, 7, 0.2);
}

/* Animation du gradient */
@keyframes redGlow {
  0%   { background-position: 0% }
  50%  { background-position: 100% }
  100% { background-position: 0% }
}

/* Le $ASS encore plus brillant */
header h1 span {
  font-size: 1.5em;
  font-weight: 900;
  color: #cf1120;
  text-shadow:
    0 0 15px #b60c0c,
    0 0 30px #ca2b45,
    0 0 45px rgba(179, 4, 19, 0.8);
}

/* ============================
   NAVIGATION
============================ */

nav a {
  margin-left: 10px;
  color: #fff;
  text-decoration: none;
  transition: 0.2s;
}

nav a:hover {
  color: #00ff99;
  text-shadow: 0 0 10px #00ff99;
}

/* ============================
   HERO
============================ */

.hero {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.hero-video video {
  max-width: 400px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,255,153,0.3);
}

/* ============================
   VIDEO CARDS
============================ */

.video-card video,
.video-card iframe {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 0 15px rgba(0,255,153,0.2);
}

/* ============================
   BOXES (wallet, chat, ranking…)
============================ */

.wallet-gate,
.live-chat,
.ranking,
.leaderboard-page section {
  margin-top: 20px;
  background: rgba(0,0,0,0.6);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #00ff99;
  box-shadow: 0 0 15px rgba(0,255,153,0.2);
}

/* ============================
   CHAT
============================ */

.chat-input {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.chat-input input {
  flex: 1;
}

#chat-window {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #333;
  padding: 10px;
  margin-top: 10px;
  background: rgba(0,0,0,0.4);
  box-shadow: inset 0 0 10px rgba(0,255,153,0.2);
}

.chat-line {
  display: flex;
  margin-bottom: 8px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  color: #000;
  font-weight: bold;
  background: #00ff99;
  box-shadow: 0 0 10px #00ff99;
}

.chat-meta {
  font-size: 12px;
  opacity: 0.8;
}

.chat-text {
  font-size: 14px;
}

/* ============================
   LEADERBOARD
============================ */

.ranking-item {
  margin-bottom: 8px;
}

.leaderboard-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.7);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #00ff99;
  box-shadow: 0 0 15px rgba(0,255,153,0.2);
}

.leaderboard-rank {
  width: 40px;
  font-weight: bold;
}

.leaderboard-badge {
  width: 40px;
  font-size: 20px;
}

.leaderboard-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  color: #000;
  font-weight: bold;
  box-shadow: 0 0 10px #00ff99;
}

.leaderboard-info {
  flex: 1;
}

.leaderboard-username {
  font-weight: bold;
}

.leaderboard-wallet {
  font-size: 12px;
  opacity: 0.7;
}

.leaderboard-stats span {
  margin-right: 10px;
  font-size: 12px;
}

/* ============================
   SECURITY NOTE
============================ */

.security-note {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 8px;
}

/* ============================
   CHALLENGES
============================ */

.challenges-page {
  margin-top: 20px;
}

.upload-section,
.video-list-section {
  background: rgba(0,0,0,0.6);
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #00ff99;
  margin-bottom: 20px;
  box-shadow: 0 0 15px rgba(0,255,153,0.2);
}

.upload-box input,
.upload-box textarea {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 6px;
  border: none;
}

.upload-box button {
  padding: 10px 20px;
  background: #00ff99;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 0 10px #00ff99;
}

.video-item {
  margin-bottom: 20px;
}

.video-card {
  background: rgba(0,0,0,0.5);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #00ff99;
  box-shadow: 0 0 15px rgba(0,255,153,0.2);
}

.video-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.like-btn {
  background: #ff0066;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255,0,102,0.4);
}

.like-count {
  font-size: 18px;
  font-weight: bold;
}
/* ============================
   RESPONSIVE DESIGN
============================ */

/* --- TABLETTES (max 1024px) --- */
@media (max-width: 1024px) {

  .matrix-title {
    font-size: 2.5rem;
    gap: 10px;
  }

  .hero {
    flex-direction: column;
    align-items: center;
  }

  .hero-video video {
    max-width: 90%;
  }

  .leaderboard-page {
    grid-template-columns: 1fr;
  }
}

/* --- MOBILES (max 768px) --- */
@media (max-width: 768px) {

  header {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  nav a {
    margin: 0 8px;
    display: inline-block;
  }

  .matrix-title {
    font-size: 2rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero {
    flex-direction: column;
    gap: 15px;
  }

  .hero-text h2 {
    font-size: 1.4rem;
  }

  .hero-video video {
    width: 100%;
    max-width: 350px;
  }

  #chat-window {
    max-height: 220px;
  }

  .chat-input {
    flex-direction: column;
  }

  .chat-input button {
    width: 100%;
  }

  .upload-box input,
  .upload-box textarea {
    font-size: 14px;
  }

  .video-card {
    padding: 10px;
  }

  .video-card video,
  .video-card iframe {
    max-height: 250px;
  }
}

/* --- PETITS MOBILES (max 480px) --- */
@media (max-width: 480px) {

  .matrix-title {
    font-size: 1.6rem;
    gap: 6px;
  }

  header h1 span {
    font-size: 1.2em;
  }

  nav a {
    font-size: 14px;
  }

  .hero-text p {
    font-size: 14px;
  }

  .leaderboard-item {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .leaderboard-avatar {
    margin: 0 auto;
  }

  .video-card video,
  .video-card iframe {
    max-height: 200px;
  }

  .like-btn {
    width: 100%;
    text-align: center;
  }
}
/* ============================
   MODE COMPACT AUTOMATIQUE (MOBILE)
============================ */

@media (max-width: 600px) {

  /* Réduction globale */
  body {
    font-size: 14px;
  }

  .overlay {
    padding: 10px;
  }

  /* Header compact */
  header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .matrix-title {
    font-size: 1.6rem;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
  }

  header h1 span {
    font-size: 1.1em;
  }

  nav a {
    font-size: 13px;
    margin: 0 5px;
  }

  /* Hero compact */
  .hero {
    flex-direction: column;
    gap: 10px;
  }

  .hero-text h2 {
    font-size: 1.2rem;
  }

  .hero-text p {
    font-size: 13px;
  }

  .hero-video video {
    width: 100%;
    max-width: 300px;
  }

  /* Chat compact */
  #chat-window {
    max-height: 180px;
    padding: 6px;
    font-size: 13px;
  }

  .chat-line {
    margin-bottom: 5px;
  }

  .avatar {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .chat-meta {
    font-size: 10px;
  }

  .chat-text {
    font-size: 13px;
  }

  .chat-input {
    flex-direction: column;
    gap: 6px;
  }

  .chat-input button {
    width: 100%;
  }

  /* Upload compact */
  .upload-box input,
  .upload-box textarea {
    font-size: 13px;
    padding: 6px;
  }

  .upload-box button {
    width: 100%;
    padding: 8px;
  }

  /* Vidéos compactes */
  .video-card {
    padding: 10px;
  }

  .video-card video,
  .video-card iframe {
    max-height: 200px;
  }

  .video-actions {
    gap: 6px;
  }

  .like-btn {
    padding: 6px 10px;
    font-size: 13px;
  }

  .like-count {
    font-size: 16px;
  }

  /* Leaderboard compact */
  .leaderboard-page {
    grid-template-columns: 1fr;
  }

  .leaderboard-item {
    flex-direction: column;
    text-align: center;
    gap: 6px;
    padding: 10px;
  }

  .leaderboard-avatar {
    margin: 0 auto;
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .leaderboard-stats span {
    font-size: 11px;
  }
}
/* ============================
   MODE COMPACT INTELLIGENT
   (basé sur la hauteur)
============================ */

/* --- Compact léger (petite hauteur) --- */
@media (max-height: 700px) {

  .overlay {
    padding: 10px;
  }

  header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .matrix-title {
    font-size: 2rem;
  }

  #chat-window {
    max-height: 200px;
  }

  .hero {
    flex-direction: column;
    gap: 10px;
  }

  .hero-video video {
    max-height: 220px;
  }
}

/* --- Compact fort (hauteur très limitée) --- */
@media (max-height: 600px) {

  body {
    font-size: 14px;
  }

  .matrix-title {
    font-size: 1.6rem;
  }

  .hero-text h2 {
    font-size: 1.2rem;
  }

  .hero-text p {
    font-size: 13px;
  }

  #chat-window {
    max-height: 160px;
    padding: 6px;
  }

  .chat-input {
    flex-direction: column;
    gap: 6px;
  }

  .video-card {
    padding: 10px;
  }

  .video-card video,
  .video-card iframe {
    max-height: 180px;
  }
}

/* --- Ultra compact (mode paysage mobile) --- */
@media (max-height: 500px) {

  header {
    gap: 6px;
  }

  .matrix-title {
    font-size: 1.3rem;
    gap: 4px;
  }

  nav a {
    font-size: 12px;
    margin: 0 4px;
  }

  #chat-window {
    max-height: 120px;
  }

  .avatar {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .chat-text {
    font-size: 12px;
  }

  .video-card video,
  .video-card iframe {
    max-height: 150px;
  }

  .like-btn {
    padding: 5px 8px;
    font-size: 12px;
  }

  .leaderboard-item {
    padding: 8px;
    gap: 4px;
  }
}