@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

* {
  margin: 0;
  padding: 0;
}

html {
  overflow: hidden;
}

body {
  background:  radial-gradient(ellipse 80% 60% at 50% 0%, rgba(139, 92, 246, 0.25), transparent 70%),
                 radial-gradient(125% 125% at 50% 10%, #000000 40%, #010133 100%),
                #000000;;
  background-size: cover;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.text-gold {
  color: #ffff00;
  font-weight: 900;
  letter-spacing: 3px;
}

.white-glow{
  color: white;
  text-shadow:0 0 10px rgba(255, 255, 252, 0.7), 0 0 20px rgba(255, 255, 255, 0.5);
}

.text-glow {
  text-shadow: 
    0 0 10px rgba(255, 215, 0, .7), 0 0 20px rgba(255, 215, 0, .5);
}

.text-flame {
  color: #ff4500;
  font-weight: 900;
  letter-spacing: 3px;
}

.text-flame-glow {
  text-shadow: 
    0 0 10px rgba(255, 69, 0, .7), 0 0 20px rgba(255, 69, 0, .5);
}

.nav-left{
  position: absolute;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  left: 50px; 
  top: 40px;
  font-size: 30px;
  padding-left: 6px ;
}
.something{
  color: white;
  font-family: 'Orbitron', 'Courier New', monospace;
}



nav li {
  list-style-type: none;
  font-family: 'Orbitron', 'Courier New', monospace;
  font-weight: 900;
  font-style: normal;
  transition: all 0.5s ease;
  cursor: pointer;
  text-transform: uppercase;
}

nav li:hover {
  transform: translateY(-2px);
}

nav {
  display: flex;
  margin: auto;
  font-size: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  
  border-radius: 8px;
  margin: 10px;
  font-family: orbitron, 'Courier New', monospace;
  font-weight: 700px;
}
nav ul {
  margin: auto;
}
.main-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px;
  min-height: calc(100vh - 120px);
  padding: 20px;
  margin-top: 60px;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
  margin: 15px 10%;
  overflow: hidden;
}

.tic-tac-toe-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  display: grid;
  grid-template-columns: repeat(3, 10vw);
  grid-template-rows: repeat(3, 10vw);
  font-family: sans-serif;
}
.container .box {
  border: 2px solid white;
  transition: all 0.2s ease;
  font-size: 7vw;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  color: white;
  font-weight: bold;
}

.boxtext {
  position: relative;
  z-index: 2;
}

.container .box .boxtext.player-x {
 color: #ffff00;
  text-shadow: 
    0 0 10px rgba(255, 215, 0, .7), 
    0 0 20px rgba(255, 215, 0, .5)
}

.container .box .boxtext.player-o {
  color: rgba(255 69, 0);
  text-shadow: 
    0 0 10px rgba(255, 69, 0, .7), 0 0 20px rgba(255, 69, 0, .5), 0 0 30px rgba(255, 69, 0, .3);
}
  

.container .box:not(.bt-0):before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: white;
  box-shadow: 
    0 0 15px rgba(255, 255, 255, 0.9),
    0 0 25px rgba(255, 255, 255, 0.5);
  z-index: 1;
}

.container .box:not(.bl-0):after {
  content: '';
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: white;
  box-shadow: 
    0 0 15px rgba(255, 255, 255, 0.9),
    0 0 25px rgba(255, 255, 255, 0.5);
  z-index: 1;
}
.container .box:hover {
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 0 15px rgba(255, 255, 255, 0.6),
    0 0 25px rgba(255, 255, 255, 0.3);
}
.imgbox {
  position: absolute;
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
  transition: all 0.5s ease;
}
.imgbox.show {
  position: relative;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.draw-imgbox {
  position: absolute;
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
  transition: all 0.5s ease;
}
.draw-imgbox.show {
  position: relative;
  opacity: 1;
  transform: scale(0.8);
  pointer-events: auto;
  
}
.container .box.br-0 {
  border-right: 0;
}
.container .box.bl-0 {
  border-left: 0;
}
.container .box.bt-0 {
  border-top: 0;
}
.container .box.bb-0 {
  border-bottom: 0;
}

.gameInfo {
  padding: 20px;
  max-height: calc(100vh - 120px);
  overflow-y: hidden  ;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 300px;
  text-align: center;
  max-width: 28%;
  margin-top: -40px;
}
.gameInfo div span {
  padding-bottom: 20px;
  display: inline-block;
  font-size: 35px;
}

.info {
  color: white;
  text-shadow: 0 0 10px white;
  font-family: VT323,orbitron;
  

}
.gameInfo div button {
    margin-left: 2vw;
}

#createGame,#joingame{
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 15px;
 
}
.gold-btn{
  --tw-bg-opacity: 1;
  background-color: rgb(255 215 0 );
  font-weight: 700;
  --tw-text-opacity: 1;
  color: rgb(0 0 0 / var(--tw-text-opacity, 1));
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration:  0.3s;
  animation-duration: 0.3s;
  border: none;
  outline: none;
}

.gold-btn:hover{
  box-shadow: 0 0 10px #ffd700b3, 0 0 20px #ffd70080;
  border: none;
  outline: none;
}
.flame-btn{
  --tw-bg-opacity: 1;
    background-color: rgb(255 69 0 );
    font-weight: 700;
    --tw-text-opacity: 1;
    color: rgb(255 255 255 / var(--tw-text-opacity, 1));
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 0.3s;
    animation-duration: 0.3s;
    border-radius: calc(var(--radius) - 2px);
    padding: 0.5rem 1.5rem;
    border: none;
    outline: none;
}

.flame-btn:hover{
  border: none;
  outline: none;
  box-shadow: 0 0 10px #ff4500b3, 0 0 20px #ff450080;
}
.paragraphs{
  margin-bottom: 30px;
  font-family: comfortaa;
  --tw-text-opacity: 0.8;
  color: rgb(209 213 219);  
  font-size: 1.125rem;
  align-items: start;
  max-width: 43%;        
  line-height: 1.6;      
  margin-right: 2rem; 
  opacity: 0;
}

.info {
  color: white;
  text-shadow: 0 0 10px white;
  font-family: VT323,orbitron;
  

}
.gameInfo div button {
    margin-left: 2vw;
}


#lobby {
  text-align: center;
  margin-top: 100px;
  font-family: sans-serif;
}

#lobby h2 {
  margin-bottom: 20px;
  font-size: 2.5em;
}

#lobby #createGame {
  padding: 10px 20px;
  font-size: 1.2em;
  cursor: pointer;
  border-radius: 8px;
  border: none;
  background-color: rgb(255 215 0 / var(--tw-bg-opacity, 1));
  color: rgb(0, 0, 0);
  margin: 10px;
  transition: all 0.3s ease;
  
}

#lobby #createGame:hover {
  box-shadow: 0px 0px 10px rgb(255 215 0)
}
#lobby button {
  padding: 10px 20px;
  font-size: 1.2em;
  cursor: pointer;
  border-radius: 8px;
  border: none;
}
#lobby #spectateGame{
  background-color: rgb(255 215 0 / var(--tw-bg-opacity, 1));
  color: black;
  transition: all 0.3s ease;
}
#lobby #spectateGame:hover {
  box-shadow: 0px 0px 10px rgb(255 215 0);
}
#lobby #joinGame {
  background-color: rgb(255 69 0 / var(--tw-bg-opacity, 1));
  color: black;
  transition: all 0.3s ease;
  margin-right: 20px;
}
#lobby #joinGame:hover {
  box-shadow: 0px 0px 10px rgb(255 69 0);
}
#lobby input {
  padding: 10px;
  font-size: 1.2em;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-right: 20px;
}


#quiz-container {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(5, 5, 16, 0.95), rgba(10, 10, 21, 0.95));
  border: 2px solid white;
  box-shadow: 
    0 0 15px rgba(255, 255, 255, 0.6),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  text-align: center;
  color: white;
  backdrop-filter: blur(10px);
}

#quiz-container h3 {
  color: white;
  text-shadow: 0 0 15px white;
  margin-bottom: 20px;
  font-family: 'Orbitron', 'Courier New', monospace;
  font-size: 1.4em;
}

#answers button {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  font-size: 1em;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(20, 20, 35, 0.8), rgba(30, 30, 50, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: white;
  transition: all 0.3s ease;
  font-family: 'Orbitron', 'Courier New', monospace;
}

#answers button:hover {
  background: linear-gradient(135deg, rgba(40, 40, 60, 0.9), rgba(50, 50, 70, 0.9));
  border-color: white;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

#answers button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#question-timer-container, #move-timer-container {
  margin-top: 15px;
  margin-bottom: 30px;
  font-size: 1.5vw;
  font-family: 'Orbitron', 'Courier New', monospace;
  font-weight: bold;
  color: white;
  background: linear-gradient(135deg, rgba(5, 5, 16, 0.9), rgba(10, 10, 21, 0.9));
  border: 2px solid white;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
  padding: 15px;
  border-radius: 12px;
  text-align: center;
  text-shadow: 0 0 10px white;
}

#question-time, #move-time {
  color: #ffff00;
  font-size: 1.8vw;
  text-shadow: 0 0 15px #ffff00;
  font-weight: 900;
}
#spectator-info {
  text-align: center;
  font-weight: bold;
  font-family: sans-serif;
  color: #d35400;
  background-color: #fdebd0;
  border: 1px solid #d35400;
  padding: 10px;
  margin-top: 15px;
  border-radius: 8px;
}
.spectating .box, .spectating #answers button {
  pointer-events: none;
  cursor: not-allowed;
}

.modal-overlay {
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6); 
  z-index: 10; 
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-card {
  background-color: white;
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  font-family: sans-serif;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  width: 90%;
  max-width: 400px;
}

.modal-card h3 {
  margin-top: 0;
  font-size: 1.8em;
  color: #333;
}

.modal-card p {
  font-size: 1.1em;
  color: #555;
}

.game-code {
  font-size: 2.5em;
  font-weight: bold;
  color: #7b57ff;
  background-color: #eef2f3;
  padding: 10px 20px;
  border-radius: 8px;
  margin: 20px 0;
  letter-spacing: 4px;
  border: 2px dashed #ccc;
}

#startGameButton {
  padding: 12px 25px;
  font-size: 1.2em;
  cursor: pointer;
  border-radius: 8px;
  border: none;
  background-color: #7b57ff;
  color: white;
  transition: background-color 0.3s;
}

#startGameButton:hover {
  background-color: #9173ff;
}

#feedback-message {
  padding: 12px;
  margin-top: 15px;
  border-radius: 8px;
  text-align: center;
  font-family: sans-serif;
  font-weight: bold;
  font-size: 1.1em;
  
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border: none;
}

#feedback-message.show {
  opacity: 1;
  transform: translateY(0);
  height: auto;
  padding: 12px;
  border: 1px solid;
}

#feedback-message.error {
  color: #721c24; 
  background-color: #f8d7da; 
  border-color: #f5c6cb;  
}

.spectator-answer-container {
  margin-bottom: 6px;
  border: 1px solid #ddd;
  padding: 6px 8px;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.9);
  max-width: 100%;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 35px;
}

.spectator-answer-container:hover {
  border-color: #7b57ff;
  box-shadow: 0 1px 4px rgba(123, 87, 255, 0.2);
}

.spectator-answer-text {
  font-weight: 600;
  font-size: 0.9em;
  color: #2c3e50;
  word-wrap: break-word;
  line-height: 1.1;
  flex: 1;
  text-align: left;
}

.spectator-player-choices {
  font-size: 0.75em;
  font-weight: 500;
  font-style: italic;
  line-height: 1.0;
  text-align: right;
  margin-left: 8px;
  white-space: nowrap;
}

.spectator-player-choices.chosen {
  color: #7b57ff;
  font-weight: 600;
}

.spectator-player-choices.not-chosen {
  color: #7f8c8d;
}



#startGameBtn {
  width: 120px;
  height: 40px;
  background-color: rgb(255 215 0  );
  border: none;
  color: black;
  cursor: pointer;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
  margin-left: 20px;
  font-size: 16px;
}

#startGameBtn:hover {
  box-shadow: 0 0 10px rgba(255, 215, 0);
}

#startGameBtn:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
  box-shadow: none;
}

#countdown-message {
  font-size: 1.8em;
  font-family: sans-serif;
  font-weight: bold;
  color: #34495e;
  text-align: center;
  margin-top: 20px;
  height: 30px;
}


.game-container {
  perspective: 1000px;
  perspective: 1000px;
  position: fixed;
  left: 60%;
  font-family: orbitron,sans-serif;
  opacity: 0;
  transform: translateX(100px);
}

.tic-tac-toe-grid {
  display: grid;
  grid-template-columns: repeat(3, 120px);
  grid-template-rows: repeat(3, 120px);
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 15px;
  border: 2px solid rgba(255, 215, 0, 0.3);
  box-shadow: 
      0 0 30px rgba(255, 215, 0, 0.2),
      inset 0 0 20px rgba(0, 0, 0, 0.5);
  transform: rotateX(5deg) rotateY(-5deg);
  transition: all 0.3s ease;
}

.tic-tac-toe-grid:hover {
  transform: rotateX(0deg) rotateY(0deg);
  transform: translateY(-5px);
  box-shadow: 0px 0px 10px rgb(255 215 0)
}

.grid-cell {
  background: linear-gradient(145deg, #1e1e1e, #2a2a2a);
  border: 2px solid #444;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 48px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.grid-cell::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
  transition: left 0.5s ease;
}

.grid-cell:hover::before {
  left: 100%;
}

.grid-cell:hover {
  border-color: #ffd700;
  box-shadow: 
      0 0 20px rgba(255, 215, 0, 0.3),
      inset 0 0 10px rgba(255, 215, 0, 0.1);
  transform: translateY(-3px);
}

.grid-cell.x {
  color: #ffff00
  ;
  text-shadow: 
      0 0 10px rgba(255, 215, 0, .7), 0 0 20px rgba(255, 215, 0, .5), 
      0 0 30px #ffff00
      ;

  border-color: #ffff00;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.grid-cell.o {
  color: #ff4500;
  text-shadow: 
      0 0 10px #ff4500,
      0 0 20px #ff4500,
      0 0 30px #ff4500;
  border-color: #ff4500;
  box-shadow: 0 0 15px rgba(255, 107, 53, 0.4);
}

.grid-cell.x::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.grid-cell.o::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
  pointer-events: none;
}