body {
  margin: 0;
  background-color: #0f0f20;
  color: #f1f1f1;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.game {
  max-width: 360px;
  margin: 20px auto;
  padding: 10px;
  background-color: #1b1e30;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.top {
  text-align: center;
  font-size: 1.6em;
  margin-bottom: 10px;
  color: #f2f2f2;
  position: relative;
  padding-bottom: 10px;
}

.top::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 25%;
  width: 50%;
  height: 3px;
  background: linear-gradient(to right, transparent, #7b68ee, transparent);
  border-radius: 3px;
}

#a_i_c_2, #chat-input {
  width: 100%;
  padding: 8px;
  margin: 6px 0;
  border-radius: 6px;
  border: none;
  font-size: 1em;
  box-sizing: border-box;
  background-color: #2b2e4a;
  color: #f9f9f9;
}

#answer-chat {
  color: #8ef2a2;
  margin-top: 5px;
  font-weight: bold;
  font-size: 1.1em;
  height: 24px;
  overflow: hidden;
}

#chat {
  background-color: #161825;
  padding: 8px;
  border-radius: 6px;
  margin-top: 10px;
}

#chat h4 {
  margin: 0 0 5px 0;
  font-weight: normal;
  color: #aaa;
}

#chat-messages {
  height: 180px;
  overflow-y: auto;
  font-size: 1.1em;
  color: #ffffff;
  margin-bottom: 5px;
  direction: rtl;
}

.chat-message {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  margin-bottom: 5px;
  direction: rtl;
}

.player-name {
  min-width: 80px;
  font-weight: bold;
  color: #fff;
  background: #6a5acd;
  padding: 0 5px;
  border-radius: 4px;
  text-align: right;
  user-select: none;
}

#zz_g_t_1 {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  color: #fff;
  margin: 15px 0;
}

#zz_g_t_1 .typed {
  color: #30b0b0; 
  transition: color 0.2s ease;
}
.trophy-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border: 2px solid #FF8C00;
  border-radius: 15px;
  padding: 2px 6px;
  margin-right: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  position: relative;
}

.trophy-icon {
  font-size: 12px;
  margin-right: 3px;
  filter: brightness(1.2);
}

.trophy-count {
  color: white;
  font-size: 10px;
  font-weight: bold;
  background: #FF8C00;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.player-name.shake {
  animation: shake 0.5s infinite;
}

.player-name.blink {
  animation: blink 1s infinite;
}

.player-name.glow {
  animation: glow 1.5s ease-in-out infinite alternate;
}

.player-name.scale {
  animation: scalePulse 1s infinite;
}

@keyframes shake {
  0% { transform: translate(0px); }
  25% { transform: translate(1px, 1px); }
  50% { transform: translate(-1px, -1px); }
  75% { transform: translate(1px, -1px); }
  100% { transform: translate(0px); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes glow {
  0% { box-shadow: 0 0 5px #fff; }
  100% { box-shadow: 0 0 15px #0ff; }
}

@keyframes scalePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.message-text {
  color: #ccc;
  flex: 1;
  text-align: left;
  direction: ltr;
  word-break: break-word;
}

#scores {
  margin-top: 10px;
  max-height: 250px;
  overflow-y: auto;
  font-size: 1em;
  color: #ddd;
}

button {
  outline: none;
}

#change-name {
  width: 50vw;         
  max-width: 250px;      
  position: absolute;
  bottom: 2vh;           
  left: 50%;
  transform: translateX(-50%);
  background-color: #30b0b0;  
  color: white;
  font-weight: bold;
  font-size: 1rem;      
  padding: 0.5em 0;      
  border: none;
  border-radius: 25px;   
  cursor: pointer;
  display: block;
}

/* تأثير النار الحقيقي */
.flame-text {
  font-weight: bold;
  font-size: 20px;
  color: #ffaa00;
  background: linear-gradient(
    -45deg,
    #ff0000,
    #ff6600,
    #ffff00,
    #ff6600,
    #ff0000
  );
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: flame 1.5s infinite ease-in-out;
  text-shadow:
    0 0 5px #ff3300,
    0 0 10px #ff6600,
    0 0 15px #ff9900,
    0 0 20px #ffcc00;
}

@keyframes flame {
  0% {
    background-position: 0% 50%;
    transform: scale(1.02) rotate(0deg);
  }
  50% {
    background-position: 100% 50%;
    transform: scale(1.08) rotate(-1deg);
  }
  100% {
    background-position: 0% 50%;
    transform: scale(1.02) rotate(0deg);
  }
}
/*///////////ثلج////////////*/

.ice-text {
  color: #d0f0ff;
  font-weight: bold;
  background: linear-gradient(135deg, #c0eaff 0%, #a0dfff 40%, #e0f7ff 60%, #a0dfff 80%, #c0eaff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 5px #a0dfff,
    0 0 10px #70c8ff,
    0 0 20px #50b8ff;
  position: relative;
  animation: icePulse 3s ease-in-out infinite;
  user-select: none;
}

/* نبض جليدي */
@keyframes icePulse {
  0%, 100% {
    text-shadow:
      0 0 5px #a0dfff,
      0 0 10px #70c8ff,
      0 0 20px #50b8ff;
    transform: scale(1);
  }
  50% {
    text-shadow:
      0 0 10px #d0f0ff,
      0 0 20px #90d8ff,
      0 0 30px #70c8ff;
    transform: scale(1.05);
  }
}

/* تأثير ثلج يتطاير حول النص */
.ice-text::before, .ice-text::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #e0f7ff 60%, transparent 80%);
  border-radius: 50%;
  filter: blur(1.5px);
  animation: snowFall 5s linear infinite;
  pointer-events: none;
  opacity: 0.8;
  top: -5px;
  left: 5%;
  z-index: 10;
}

.ice-text::after {
  animation-delay: 2.5s;
  top: auto;
  bottom: -5px;
  left: 85%;
  opacity: 0.6;
  width: 8px;
  height: 8px;
  filter: blur(2px);
  animation-duration: 7s;
}

@keyframes snowFall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0.8;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(15px) translateX(10px) rotate(180deg);
    opacity: 0;
  }
}

.shake {
  animation: shake 0.5s infinite;
  display: inline-block;
}
#extra-game-button {
  position: fixed;
  bottom: 65px; 
  right: 20px;
  width: 50px;
  height: 50px;
  background-color:#30b0b0;
  color: white;
  font-weight: bold;
  font-size: 0.7rem;
  border: none;
  border-radius: 50%;  
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#extra-game-button:hover {
  background-color: #a37712;
}

#extra-game-button:hover {
  background-color: #5a67d8;
}

body.light-mode {
  background-color: #0f0f20;      
  color: white;             
}

body.light-mode .game {
  background-color: #1a1a2e;    
  border-radius: 8px;
  box-shadow: 0 0 10px #111;
}

body.light-mode .top {
  color: #eee;              
}

body.light-mode #answer,
body.light-mode #chat-input {
  background-color: #222;  
  color: #white;              
  border: 1.5px solid #c3dafe;  
  border-radius: 8px;       
}

body.light-mode #answer-chat {
  color: #32cd32;               
}

body.light-mode #chat {
  background-color: #111;    
  border-radius: 8px;
  padding: 12px;
}

body.light-mode #chat h4 {
  color: #bbb;           
}

body.light-mode #chat-messages {
  color: #ffffff;         
}
body.light-mode .message-text {
  color: #2d3748;         
}
/*///////////////////*/
       /*قوس قزح*/
/*//////////////////*/
.rainbow-text {
  color: #ff00ff;
  font-weight: bold;
  background: linear-gradient(90deg, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0000ff, #8000ff, #ff00ff);
  background-size: 400% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  animation: rainbowMove 3s linear infinite, float 4s ease-in-out infinite;
  display: inline-block;
  padding: 2px 4px;
}

@keyframes rainbowMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 400% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

        /*/////////////////////*/
                /*انفجار*/
       /*/////////////////////*/


.boom-text {
  color: #ff0000;
  font-weight: bold;
  font-size: 1.2em;
  text-shadow: 
    0 0 5px #ff0000,
    0 0 10px #ff4444;
  animation: earthquake 0.1s infinite, crack 3s forwards, explode 3s forwards;
  display: inline-block;
  padding: 4px 8px;
  background: linear-gradient(45deg, #330000, #660000);
  border-radius: 5px;
  position: relative;
  overflow: hidden;
}

@keyframes earthquake {
  0% { transform: translate(0px, 0px) rotate(0deg); }
  25% { transform: translate(2px, 2px) rotate(1deg); }
  50% { transform: translate(0px, 3px) rotate(0deg); }
  75% { transform: translate(-2px, 1px) rotate(-1deg); }
  100% { transform: translate(0px, 0px) rotate(0deg); }
}

.boom-text::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ff0000, transparent);
  animation: crackLine 3s forwards;
}

@keyframes crackLine {
  0%, 60% { opacity: 0; transform: scaleX(0); }
  30%, 50% { opacity: 1; transform: scaleX(1); }
  61% { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes explode {
  0%, 65% {
    transform: scale(1);
    opacity: 1;
    filter: blur(0px);
  }
  70% {
    transform: scale(1.5);
    opacity: 0.8;
    filter: blur(2px);
    text-shadow: 
      0 0 20px #ff0000,
      0 0 40px #ff4444,
      0 0 60px #ff8888;
  }
  75% {
    transform: scale(2);
    opacity: 0;
    filter: blur(10px);
    text-shadow: 
      0 0 30px #ff0000,
      0 0 60px #ff4444,
      0 0 90px #ff8888,
      0 0 120px #ffffff;
  }
  80%, 100% {
    transform: scale(0);
    opacity: 0;
    filter: blur(20px);
    display: none;
  }
}

.boom-text::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, #ff0000, transparent);
  border-radius: 50%;
  animation: shockwave 3s forwards;
  transform: translate(-50%, -50%);
}

@keyframes shockwave {
  0%, 65% {
    width: 0;
    height: 0;
    opacity: 0;
  }
  70% {
    width: 100px;
    height: 100px;
    opacity: 0.7;
  }
  85% {
    width: 200px;
    height: 200px;
    opacity: 0;
  }
  100% {
    width: 200px;
    height: 200px;
    opacity: 0;
    display: none;
  }
}
         /*///////////////////////*/
                 /*الشبح*/
         /*//////////////////////*/

.ghost-text {
  color: transparent;
  font-weight: bold;
  background: 
    linear-gradient(90deg, #8a2be2, #00bfff, #8a2be2);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 
    0 0 10px rgba(138, 43, 226, 0.5),
    0 0 20px rgba(0, 191, 255, 0.3);
  animation: ghostAppear 4s infinite, ghostFloat 3s ease-in-out infinite;
  display: inline-block;
  padding: 4px 8px;
  opacity: 0;
}

@keyframes ghostAppear {
  0% { 
    opacity: 0;
    filter: blur(10px);
    transform: scale(0.8);
  }
  20% { 
    opacity: 1;
    filter: blur(0px);
    transform: scale(1.1);
  }
  40%, 60% { 
    opacity: 1;
    filter: blur(0px);
    transform: scale(1);
  }
  80% { 
    opacity: 0.5;
    filter: blur(5px);
    transform: scale(0.9);
  }
  100% { 
    opacity: 0;
    filter: blur(10px);
    transform: scale(0.8);
  }
}

@keyframes ghostFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-5px) rotate(1deg); }
  75% { transform: translateY(3px) rotate(-1deg); }
}



/*/////////بسكل////////*/


.bxl-text {
  color: #00ff00;
  font-weight: bold;
  text-shadow: 
    2px 2px 0 #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000;
  animation: glitch 2s infinite, pixelate 0.3s infinite;
  background: 
    repeating-linear-gradient(
      0deg,
      rgba(0, 255, 0, 0.1),
      rgba(0, 255, 0, 0.1) 1px,
      transparent 1px,
      transparent 3px
    );
  padding: 4px 8px;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  width: 0;
  display: inline-block;
  animation: 
    expandToFull 1.5s ease-in-out forwards,
    glitch 2s infinite,
    pixelate 0.3s infinite,
    shrinkToFit 0.8s ease-in-out 1.8s forwards;
}

@keyframes expandToFull {
  0% {
    width: 0;
  }
  100% {
    width: 100%; 
  }
}

@keyframes shrinkToFit {
  0% {
    width: 100%; 
  }
  100% {
    width: fit-content; 
  }
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

@keyframes pixelate {
  0%, 100% { filter: none; }
  50% { filter: blur(0.5px) contrast(2); }
}



/*///////////////////////*/
          /*الصارووووخ*/
/*//////////////////////*/

.rocket-text {

  color: deepskyblue; 
  font-weight: bold;
  text-shadow:
    0 0 5px deepskyblue,
    0 0 10px dodgerblue;
    
  position: relative;
  display: inline-block;
  overflow: visible; 

  animation: rocketLaunch 5s ease-in-out forwards; 
  opacity: 1;
}


.rocket-text::before {
  content: '';
  position: absolute;
  
  bottom: -5px; 
  right: -5px; 
  left: auto;
  transform: translateX(0); 
  
  width: 7px; 
  height: 15px; 
  background: 
    radial-gradient(ellipse at center,  #ffff00 0%, #ff6600 30%, #ff0000 60%, transparent 80%); 
  border-radius: 50%;
  filter: blur(1.5px); 
  opacity: 0;
  animation: 
    flamePulse 0.5s infinite alternate 0.5s, 

    flameVisibility 5s forwards; 
}


.rocket-text::after {
  content: '';
  position: absolute;
  
  bottom: -5px; 
  left: -5px; 
  right: auto;
  transform: translateX(0);
  
  width: 7px; 
  height: 15px; 
  background: 
    radial-gradient(ellipse at center,  #ffff00 0%, #ff6600 30%, #ff0000 60%, transparent 80%); 
  border-radius: 50%;
  filter: blur(1.5px);
  opacity: 0;
  animation: 
    flamePulse 0.5s infinite alternate 0.7s,
    
    flameVisibility 5s forwards; 
}


@keyframes flamePulse {
  0% { 
    height: 10px;
    opacity: 0.8;
  }
  100% { 
    height: 20px; 
    opacity: 1;
  }
}


@keyframes flameVisibility {
  0%, 10% { opacity: 0; } 
  20%, 55% { opacity: 1; } 
  60% { opacity: 0; } 
  61%, 95% { opacity: 0; } 
  100% { opacity: 0; }
}


@keyframes rocketLaunch {
  0%, 10% {
    
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  40% {
    
    transform: translateY(-80px) scale(1.05);
    opacity: 1;
  }
  60% {
    
    transform: translateY(-150px) scale(0.8);
    opacity: 0;
  }
  61% {
    
    transform: translateY(100px) scale(0.8);
    opacity: 0;
  }
  90% {
    
    transform: translateY(-10px) scale(1.05);
    opacity: 1;
  }
  100% {
    
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}



/*////////////////////////////////*/
/*////////////اوراق خضراء////////////*/
/*////////////////////////////////*/

.green-pulse-halo {
    position: relative;
    display: inline-block;
    z-index: 10;
    color: #00ff00 !important;
    font-weight: bold;
    text-shadow: 
        0 0 5px #00ff00,
        0 0 10px #32cd32,
        0 0 15px #7fff00,
        0 0 20px lime;
}


.green-pulse-halo .leaves-container {
    position: absolute;
    top: -8px;
    left: -8px;
    width: calc(100% + 16px);
    height: calc(100% + 16px);
    pointer-events: none;
    z-index: -1;
}


.green-pulse-halo .leaf {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #32CD32;
    opacity: 0;
    border-radius: 80% 0 80% 0;
    transform-origin: center;
    animation: floatLeaf 8s ease-in-out infinite;
}

.green-pulse-halo .leaf:nth-child(1) { 
    top: 10%; 
    left: 20%; 
    animation-delay: 0s; 
    background-color: #228B22;
}
.green-pulse-halo .leaf:nth-child(2) { 
    top: 10%; 
    left: 80%; 
    animation-delay: 2.5s; 
    background-color: #32CD32;
    transform: rotate(45deg);
}
.green-pulse-halo .leaf:nth-child(3) { 
    top: 85%; 
    left: 50%; 
    animation-delay: 5s; 
    background-color: #00FF00;
    transform: rotate(90deg);
}

@keyframes floatLeaf {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(0.6);
        opacity: 0;
    }
    15% {
        opacity: 0.7;
        transform: translate(3px, -2px) rotate(45deg) scale(0.7);
    }
    30% {
        opacity: 0.9;
        transform: translate(4px, 2px) rotate(90deg) scale(0.8);
    }
    45% {
        opacity: 0.8;
        transform: translate(2px, 4px) rotate(135deg) scale(0.9);
    }
    60% {
        opacity: 0.9;
        transform: translate(-3px, 2px) rotate(180deg) scale(0.8);
    }
    75% {
        opacity: 0.7;
        transform: translate(-4px, -2px) rotate(225deg) scale(0.7);
    }
    90% {
        opacity: 0.8;
        transform: translate(-2px, -4px) rotate(270deg) scale(0.6);
    }
    100% {
        transform: translate(0, 0) rotate(360deg) scale(0.6);
        opacity: 0;
    }
}

/* تأثير الدوامة جون */
.john-black-hole {
    position: relative;
    display: inline-block;
    color: #1a0f6b !important;
    font-weight: bold;
    text-shadow:
        0 0 5px #3a2d91,
        0 0 10px #5c4fc1,
        0 0 15px #7a6ee5,
        0 0 20px #a095f7 !important;
    z-index: 10;
    padding: 0 15px;
}

.swirl-container {
    position: absolute;
    top: 50%;
    left: 60%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
}

.swirl-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #7a6ee5;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    opacity: 0;
    animation: realSwirl 3s ease-in-out infinite;
}

.swirl-dot:nth-child(1) { animation-delay: 0s; }
.swirl-dot:nth-child(2) { animation-delay: 0.4s; }
.swirl-dot:nth-child(3) { animation-delay: 0.8s; }
.swirl-dot:nth-child(4) { animation-delay: 1.2s; }
.swirl-dot:nth-child(5) { animation-delay: 1.6s; }
.swirl-dot:nth-child(6) { animation-delay: 2s; }
.swirl-dot:nth-child(7) { animation-delay: 2.4s; }
.swirl-dot:nth-child(8) { animation-delay: 2.8s; }

@keyframes realSwirl {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) translateX(40px) scale(0.3);
        opacity: 0;
    }
    20% {
        transform: translate(-50%, -50%) rotate(72deg) translateX(30px) scale(0.6);
        opacity: 0.7;
    }
    40% {
        transform: translate(-50%, -50%) rotate(144deg) translateX(20px) scale(0.8);
        opacity: 0.9;
    }
    60% {
        transform: translate(-50%, -50%) rotate(216deg) translateX(10px) scale(1);
        opacity: 1;
    }
    80% {
        transform: translate(-50%, -50%) rotate(288deg) translateX(5px) scale(0.7);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg) translateX(0px) scale(0.2);
        opacity: 0;
    }
}

.swirl-container {
    animation: containerRotate 8s linear infinite;
}

@keyframes containerRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
