@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@300&display=swap');

:root {
  --gradient-colors: linear-gradient(45deg, #ff6ec4, #7873f5, #42e695, #ff6ec4); /* Default gradient colors */
  --glow-color: rgba(99, 69, 109, 0.6); /* Default glow color */
}

/* #app {
  width: 60%;
} */

body {
  font-family: "Inconsolata", monospace;
  background-color: #0d0d0d;
  color: #e0e0e0;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.container {
  position: relative;
  text-align: center;
  padding: 25px;
  border-radius: 15px;
  background-color: #1a1a1a;
  width: 90%; 
  max-width: 800px;
  border: 2px solid transparent;
  background-image: linear-gradient(#1a1a1a, #1a1a1a), var(--gradient-colors);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-size: 200% 200%;
  /* animation: container-gradient-shift 10s ease-in-out infinite, glow 4s ease-in-out infinite alternate; */
  animation: container-gradient-shift 10s ease-in-out infinite;
}

@keyframes container-gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Glow Effect */
@keyframes glow {
  0% {
    box-shadow: 0 0 100px 2px var(--glow-color, rgba(255, 110, 196, 0.4)), 
                0 0 5px 4px var(--glow-color, rgba(120, 115, 245, 0.4)), 
                0 0 800px 6px var(--glow-color, rgba(66, 230, 149, 0.4));
  }
  100% {
    box-shadow: 0 0 5px 4px var(--glow-color, rgba(255, 110, 196, 0.8)), 
                0 0 80px 6px var(--glow-color, rgba(120, 115, 245, 0.8)), 
                0 0 220px 8px var(--glow-color, rgba(66, 230, 149, 0.8));
  }
}

.hidden {
  display: none;
}

h1, h2 {
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 20px;
  color: #ffffff;
}

#game-title {
  margin-top: 0;
}

input,
button {
  padding: 12px;
  margin: 10px 0;
  border: none;
  border-radius: 8px;
  background-color: #333333;
  color: #ffffff;
  font-size: 1em;
  transition: background-color 0.3s ease;
  width: 100%;
  max-width: 400px;
  font-family: "Inconsolata", monospace !important; /* Ensures the font is consistent */
}

button:hover {
  background-color: #444444;
  cursor: pointer;
}

fieldset {
  border: 1px solid #444444;
  border-radius: 8px;
  padding: 10px;
  margin: 15px 0; /* Reduced margin */
  background-color: #262626;
  text-align: left;
}

fieldset:hover {
  border: 1px solid #555555;
}

legend {
  padding: 0 8px; /* Reduced padding */
  font-weight: 600;
  color: #e0e0e0;
  text-align: left;
}

.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0px; /* Reduced spacing between rows */
}

label {
  width: auto;
  margin-right: 10px; /* Reduced margin */
  flex: 1;
  font-size: 0.9em; /* Slightly smaller font */
}

input {
  box-sizing: border-box;
  background-color: #1a1a1a;
  border: 1px solid #333333;
  color: #e0e0e0;
  padding: 6px; /* Reduced padding */
  margin: 4px;
  flex: 2;
  font-size: 0.9em; /* Slightly smaller font */
}

#grid {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 1px;
  margin: 20px 0;
}

.cell {
  width: 100%;
  padding-top: 100%;
  position: relative;
  background-color: #222222;
  border-radius: 3px;
  border: 1px solid #444444;
  transition: background-color 0.2s ease;
}

.cell:hover {
  background-color: #666666;
  cursor: pointer;
}

.cell.occupied {
  background-color: #76c7c0;
}

#scoreboard {
  text-align: left;
  margin-top: 20px;
  padding: 10px;
  border-radius: 8px;
  background-color: #1e1e1e;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

#scoreboard div {
  margin: 5px 0;
}

#lobbyCodeContainer {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lobbyCode {
  font-size: 1.3em;
  padding: 10px;
  border: 1px solid #333333;
  border-radius: 8px;
  background-color: #1a1a1a;
  color: var(--glow-color);
  text-align: center;
  width: auto;
  max-width: 300px;
  display: inline-block;
  font-family: "Inconsolata", monospace;
  margin-left: 6px;
}

#copyLobbyCode,
#shareLobbyCode,
#qrCodeButton {
  padding: 10px;
  background-color: #555555;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-left: 6px;
  width: 40%;
}

#copyLobbyCode:hover,
#shareLobbyCode:hover,
#qrCodeButton:hover {
  background-color: #777777;
  animation: background-pulse 1.5s infinite;
}

#turn-status p {
  margin: 5px 0;
}

#endTurn {
  margin-top: 15px;
  width: auto;
  max-width: none;
  background-color: #5a5a5a;
}

#endTurn:hover {
  background-color: #777777;
}

/* Player color display in lobby */
#playersList div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 5px 0;
  padding: 10px;
  border-radius: 5px;
  background-color: #2e2e2e;
  font-size: 1em;
  color: #e0e0e0;
}

#playersList div span {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  margin-left: 10px;
}

.player-row {
  display: flex;
  align-items: center; /* Vertically centers the content within the row */
  gap: 10px;
}

.player-name {
  flex: 1;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  line-height: 1.5; /* Adjust the line height if needed */
  vertical-align: middle; /* Ensures the text is aligned in the middle */
}

.player-name:focus {
  border-bottom: 1px dashed #ccc;
  outline: none;
}

.player-color {
  width: 20px;
  height: 20px;
  display: inline-block;
  cursor: pointer;
  border: 1px solid #ccc;
  border-radius: 50%;
  vertical-align: middle; /* Ensures the color circle aligns with the text */
}

#startGame {
  margin-top: 20px;
  padding: 12px 25px;
  background-color: #464646;
  color: #ffffff;
  font-size: 1.2em;
  font-family: "Inconsolata", monospace;
  cursor: pointer;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  background-clip: padding-box, border-box;
  background-origin: border-box;
}

#startGame:hover {
  background-color: #545454;
  animation: background-pulse 1.5s infinite;
}

@keyframes border-glow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

@keyframes background-pulse {
  0% {
    box-shadow: 0 0 15px var(--glow-color), 0 0 5px var(--glow-color);
  }
  50% {
    box-shadow: 0 0 20px var(--glow-color), 0 0 10px var(--glow-color);
  }
  100% {
    box-shadow: 0 0 15px var(--glow-color), 0 0 5px var(--glow-color);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.4);
  }
  70% {
    box-shadow: 0 0 30px 20px rgba(0, 255, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 0, 0);
  }
}

img {
  width: 100%;
}

.modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 100; /* Ensure it appears above other content */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8); /* Dark background with opacity */
}

.modal-content {
  background-color: #1a1a1a;
  border-radius: 15px;
  padding: 20px;
  width: 80%;
  max-width: 300px;
  margin: 10% auto; /* Position it vertically */
  text-align: center;
  color: #e0e0e0;
  border: 2px solid transparent;
  background-image: linear-gradient(#1a1a1a, #1a1a1a), var(--gradient-colors);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-size: 200% 200%;
  animation: container-gradient-shift 10s ease-in-out infinite;
  position: relative; /* Ensure close button aligns correctly */
}

.modal-content h2 {
  margin-bottom: 20px;
  font-size: 1.5em;
}

.close {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #fff;
}

#qrCodeContainer {
  margin-top: 20px;
  text-align: center;
}

/* Add a slight glow to the QR code */
#qrCodeContainer canvas {
  box-shadow: 0 0 15px var(--glow-color);
}

.current-player {
  border: 1px solid var(--glow-color);
}

.host-tag {
  background-color: #232323;
  font-weight: bold;
  padding-right: 1rem;
  padding-left: 1rem;
  flex: 0;
  cursor: pointer;
  line-height: 1.4; /* Adjust the line height if needed */
  vertical-align: middle; /* Ensures the text is aligned in the middle */
}

.host-tag::after {
  content: 'This player is the host';
  position: absolute;
  transform: translateY(-80%);
  background-color: #555;
  color: #fff;
  padding: 5px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 0.75em;
  visibility: hidden; /* Hide the tooltip by default */
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 10; /* Ensure the tooltip appears above other content */
}

.host-tag:hover::after {
  visibility: visible;
  opacity: 1;
}

ion-icon {
  vertical-align: bottom;
}

.winner-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.85);
  border: 2px solid #ffffff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
  z-index: 1000;
}

.winner-name {
  font-size: 1.5em;
  font-weight: bold;
}

#winnerContainer button {
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #007bff;
  border: none;
  border-radius: 5px;
  color: #ffffff;
  cursor: pointer;
}

#winnerContainer button:hover {
  background-color: #0056b3;
}

.lil-p {
  margin: 0.25em;
}
