/* Global variables !!! */
:root {
  --letter-width: 1.1ch; /* Define base width */
  --space-width: 0.9ch;
}

.space-span,
.letter-span.space-span {
  display: inline-block;
  white-space: pre;
  width: var(--letter-width);
  overflow: hidden;
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
  transition: width 0.4s ease-in-out, padding 0.4s ease-in-out, margin 0.4s ease-in-out;
}

.space-span-final {
  width: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  overflow: hidden !important;
  font-size: 0 !important;
  transition: width 0.4s ease-in-out, padding 0.4s ease-in-out, margin 0.4s ease-in-out;
}

.wrapper {
  display: inline-block;
  border: 1px solid red;
  min-width: 1.5rem;
  padding: .2rem;
}

.simple-keyboard {
  max-width: 850px;
  height: 140px;
}

[data-skbtn].disabled {
  opacity: 0.5;
  /* Reduce opacity */
  pointer-events: none;
  /* Disable interactions */
  filter: grayscale(100%);
  /* Apply grayscale filter */
}


#fieldsContainer {
  position: relative;
  display: inline-block;

}

body {
  margin: 0;
}

.dummyClass {
  display: none;
}

#user-pic {
  width: 0.8rem;
  height: 0.8rem;
}

#opponent-pic {
  width: 0.8rem;
  height: 0.8rem;
}

.currentLettersInput {
  /* border: 1px solid rgb(15, 139, 100); */
  border: none;
  font-family: 'Source Code Pro', monospace;
  font-size: 2.5rem;
  font-weight: bold;
  padding: 0px 0px 0px 0px;
  margin: 0;
  opacity: 0.5;
}

#whoseTurnMessage {
  height: 50px; /* Set a fixed height */
  display: flex; /* Use flexbox for alignment */
  align-items: center; /* Vertically center the text */
  justify-content: center; /* Horizontally center the text */
  text-align: center; /* Center-align the text */
  font-size: clamp(14px, 5vw, 24px); /* Dynamically adjust font size */
  font-weight: 600; /* Set font weight */
  overflow-wrap: break-word; /* Allow text to wrap */
  word-wrap: break-word; /* Ensure long words wrap */
  white-space: normal; /* Allow text to wrap to the next line */
  /* color: #8E4585; */
  /* color: darkmagenta; */
  color: #e8883a;
  
}

/* dumb comment */
.lettersHelper {
  position: absolute;
  padding: 0;
  margin: 0;
  top: 0;
  left: 0;
  pointer-events: none;

  font-family: 'Source Code Pro', monospace;
  font-size: 2.5rem;
  font-weight: bold;
  /* border: 1px solid rgb(15, 139, 100); */
  white-space: pre;
  /* opacity: 0.5; */
}

.lettersHelper span {
  display: inline-block;
  white-space: pre;

}


.navbar .navbar-nav .nav-link {
  color: #fff;
  font-size: 1.1em;
}

/* Style for desktop devices */


@media screen and (min-width: 992px) {
  .navbar .navbar-nav .nav-link {
    padding: 0 0.5em;
  }

  .navbar .navbar-nav .nav-item:not(:last-child) .nav-link {
    border-right: 3px solid #fff;
  }
}

.requiredLetter {
  color: black;
  font-weight: bold;
}

.winningWordLetter {
  color: rgb(15, 139, 100);
  font-weight: bold;
}

.losingWordLetter {
  color: red;
  font-weight: bold;
}

.nonTerminalWordLetter {
  color: #b45309;
  font-weight: bold;
}

.computersWord {
  color: rgb(27, 8, 132);
  font-weight: bold;
}

#animationSvg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

.btn-primary.letter-count {
  /* use absolute positioning to place this span in the bottom right hand corner of its containing div */
  position: absolute;
  cursor: help;
  font-size: 0.5rem;
  font-weight: normal;
  color: black;
  /* pointer-events: auto; */
  z-index: 100;
}

.btn-primary.letter-count.players-count {
  bottom: 0%;
  left: 3%;
}

.btn-primary.letter-count.computers-count {
  bottom: 0%;
  right: 3%;
}
.btn-primary.letter-count.win {
  font-size: 0.6rem;
  font-weight: bold;
  color: rgb(19, 197, 141);
}

.btn-primary.letter-count.lose {
  font-size: 0.6rem;
  font-weight: bold;
  color: red;
}

@media (min-width: 768px) {
  .btn-primary.letter-count {
    font-size: 0.5rem;
    /* Adjust the size as needed */
  }

  .btn-primary.letter-count.win {
    font-size: 0.5rem;
    font-weight: bold;
    color: rgb(19, 197, 141);
  }

  .btn-primary.letter-count.lose {
    font-size: 0.5rem;
    font-weight: bold;
    color: red;
  }
}


.neutral-letter {
  color: blue;
  font-weight: bold;
}

.new-letter {
  color: sandybrown;
  font-weight: bold;
}
/* Ensure correct-position doesn't interfere with visibility/opacity */
.letter-span.correct-position {
  color: green;
  /* Avoid adding properties here that might conflict */
}

.correct-position-letter,
.letter-span.correct-position-letter,
.letter-span.anagram-span.correct-position-letter {
  color: rgb(15, 139, 100) !important;
}

.wrong-position-letter,
.letter-span.wrong-position-letter,
.letter-span.anagram-span.wrong-position-letter {
  color: black;
}

.last-letter-win {
  display: inline-block;
  white-space: pre;
  font-size: 2.5rem;
  font-family: 'Source Code Pro', monospace;
  font-weight: bold;
  width: calc(1.1ch - 1px);
  padding-right: 1px;
  color: green;
}

.last-letter-lose {
  display: inline-block;
  white-space: pre;
  font-size: 2.5rem;
  font-family: 'Source Code Pro', monospace;
  font-weight: bold;
  width: calc(1.1ch - 1px);
  padding-right: 1px;
  color: red;
}
.letter-span {
  display: inline-block;
  white-space: pre;
  font-size: 2.5rem;
  /* font-size: 3em; */
  font-family: 'Source Code Pro', monospace;
  font-weight: bold;
  width: 1.1ch;
  /* padding-left: 1px; */
 /* padding-left: 1px; REMOVE padding for easier width/positioning */
 padding: 0; /* Use padding: 0 */
 /* color: sandybrown; Use color instead of fill */
 text-align: center; /* Center character */
 vertical-align: bottom; /* Consistent alignment */
 box-sizing: border-box; /* Include border/padding in width */

 /* Ensure no other transitions interfere unless intended */
 /* transition: opacity 0.5s ease-in-out, transform 0s, width 0s; */
 visibility: visible; /* Ensure it's visible by default (opacity controls fade) */
}

.letter-span.anagram-span {
  opacity: 1; /* Ensure letters are visible */
}

/* Class to trigger the fade-in */
.letter-span.anagram-span.visible {
  opacity: 1;
}
.letter-clone {
  /* Inherit/copy text styles from .letter-span */
  display: inline-block;
  white-space: pre;
  font-size: 2.5rem;
  font-family: 'Source Code Pro', monospace;
  font-weight: bold;
  width: var(--letter-width);
  padding: 0;
  text-align: center;
  vertical-align: bottom; /* Match original */
  box-sizing: border-box;

  /* --- Positioning & Animation --- */
  position: absolute; /* Position relative to inputContainer */
  z-index: 10; /* Appear above original spans */
  pointer-events: none; /* Don't interfere with clicks */
  opacity: 1 !important; /* Clones are visible during animation */
  visibility: visible !important;
  background-color: transparent !important; /* CRUCIAL: Ensure no background */
  transition: left 1s ease-in-out, top 1s ease-in-out; /* Animation speed */
}


.letter-span-win {
  display: inline-block;
  white-space: pre;
  font-size: 2.5rem;
  font-family: 'Source Code Pro', monospace;
  font-weight: bold;
  width: 1.1ch;
  padding-left: 1px;
  fill: green;
}

.letter-span-lose {
  display: inline-block;
  white-space: pre;
  font-size: 2.5rem;
  font-family: 'Source Code Pro', monospace;
  font-weight: bold;
  width: 1.1ch;
  padding-left: 1px;
  fill: red;
}


/* Remove rule adjusting padding for spans after cursor if padding was removed */
/* span.cursor+span.letter-span {
  width: calc(1.1ch - 1px);
  padding-left: 0px;
} */

.cursor {
  display: inline-block;
  font-family: 'Source Code Pro', monospace;
  font-weight: bold;
  width: 1px;
  font-size: 2.5rem;
  height: 64px;
  background-color: black;
  animation: blink 1s steps(1) infinite;
}


#inputContainer {
  display: flex;
  /* height: 3rem; */
  /* border: 1px solid #ccc; */
  padding-top: 0px;
  padding-bottom: 0px;
  padding-left: 20px;
  padding-right: 20px;
  margin-bottom: 0px;
  /* min-width: 200px; */
  /* white-space: nowrap; */
  /* overflow-x: auto; */
  -webkit-user-select: none;
  user-select: none;
  /* Ensure the container can be a reference for absolute positioning */
  position: relative; /* ADD THIS */

}

#xjumble {
  position: relative;
}


@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

#optionsForm {
  display: flex;
  flex-direction: column;
  width: 300px;
  margin: 0 auto;
}

.optionsLabel {
  margin: 10px 0;
}

#optionsButton {
  margin-top: 20px;
}

.modal-header {
  cursor: move;
}

.form-switch {
  display: inline-block;
  text-align: center;
}

.small-user-text {
  font-size: 0.8rem;
}

.blue-underline {
  position: relative;
}

.blue-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: #e8883a;
  transition: width 0.3s linear;
}

.blue-underline.active::after {
  width: 100%;
}

/* --- NEW: Hover effect for NON-ACTIVE mode spans --- */
.blue-underline:not(.active):hover::after {
  /* Use RGBA to apply opacity ONLY to the border color */
  /* Define --primary-color-rgb if you haven't already */
  /* border-bottom-color: rgba(var(--primary-color-rgb, 59, 113, 202), 0.4); Pale blue underline (adjust 0.4 opacity as needed) */
  background: var(--primary-color); /* Optional: Make text solid blue on hover too */

  width: 100%;
}

#starterButtonsRow {
  opacity: 0;
  /* Initially hidden */
  /* transform: translateY(20px);  Slightly lower position */
  transition: opacity 1s ease-out;
  /*, transform 0.5s ease-out; /* Smooth transition */
}

#starterButtonsRow.visible {
  opacity: 1;
  /* Fully visible */

  /*  transform: translateY(0);  Final position */
}

.starterButton {
  font-size: 0.6rem;
  font-weight: bold;
  padding-left: 5%;
  padding-right: 5%;
}

.button-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 10px;
}

.button-container button {
  flex: 1;
  margin: 0 3px;
  white-space: nowrap;
  font-size: 0.6rem;
  padding-left: 3px;
  padding-right: 3px;
}

.mode-row {
  margin-top: 0px;
}

.mode-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0px;
  margin-bottom: 10px;
}

.mode-container span {
  margin: 0 3px;
}

#checkWord {
  display: inline-block;
  border: 2px solid rgb(30, 98, 214);
  border-radius: 0.4rem;
  min-width: 1.5rem;
  padding: .2rem;
  outline: none;
}

#checkWord:focus {
  outline: none;
}

#checkWord.validWinningWord {
  border: 2px solid green;

}
#checkWord.validLosingWord {
  border: 2px solid red;
}
#checkWord.invalidWord {
  /* dashed border */
  border-style: dashed;
  border-color: black;
  

}

.property {
  color: mediumseagreen;
  
  
}
.value {
  color: sandybrown;
  font-weight: bold;
}
.lighter-value {
  color: sandybrown;
  font-weight: bold;
}



div.selectable {
  cursor: pointer;
  pointer-events: auto;
  opacity: 1;
}

div.selectable:hover {
  background-color: #f0f0f0;
}

div.selectable.ignored {
  opacity: 0;
  /* Initially hidden */
  /* transform: translateY(20px);  Slightly lower position */
  transition: opacity 1s ease-out;

  cursor: not-allowed;
  pointer-events: none;
  
  
}
/* Make all elements with class state-span show a hand cursor when hivered over */
.state-span {
  cursor: pointer;
}

.opponent-chart-container {
  display: block;
  position: relative;
  width: 100%;
  height: 380px;
  overflow: hidden;
}

#opponentChart {
  width: 100% !important;
  height: 100% !important;
}

/* --- Placeholder Styling --- */
#conditional-area-placeholder {
  /* Set a minimum height sufficient to contain the TALLEST
     of the conditional elements (#starterButtonsRow or #group-players-container)
     including their margins. Inspect in DevTools to find the right value.
     Let's assume #group-players-container is taller.
     Its height is 100px + mb-1 (approx 0.25rem). Let's use rem or vh for better scaling.
     Example using rem (adjust based on your base font size): */
  height: 7rem; /* Adjust this value! (e.g., 100px height + margins) */

  /* Or using vh (viewport height) - less reliable if content above changes */
  /* min-height: 15vh; */ /* Adjust this value! */
    /* Use Flexbox to center the visible content vertically within this fixed height */
    display: flex;
    align-items: center; /* Vertically center */
    justify-content: center; /* Horizontally center (optional, if inner rows aren't full width) */

    /* Add consistent spacing below this area */
    margin-bottom: 0.25rem; /* Replaces mb-1 from inner rows */

  /* Or keep pixels if the content height is fixed */
  /* min-height: 120px; */ /* Example: 100px height + 2 * mb-1 margin */

  /* Ensure it doesn't collapse if absolutely positioned children are used later */
  position: relative;
  width: 100%;
}


.player-icon {
    position: absolute;
    width: 40px; /* Adjust size */
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    background-color: #eee; /* Placeholder background */
    object-fit: cover; /* Ensure profile pics fit well */
    transition: transform 0.3s ease, border-color 0.3s ease;
    transform: translate(-50%, -50%); /* Center icon on its position */
}

.player-icon.active-player {
    border-color: #0d6efd; /* Highlight active player */
    transform: translate(-50%, -50%) scale(1.2); /* Slightly larger */
}

/* Positioning for 3 players (Triangle) */
.player-count-3 #player-icon-0 { top: 15%; left: 50%; } /* Top */
.player-count-3 #player-icon-1 { top: 85%; left: 20%; } /* Bottom left */
.player-count-3 #player-icon-2 { top: 85%; left: 80%; } /* Bottom right */

/* Positioning for 4 players (Square) */
.player-count-4 #player-icon-0 { top: 20%; left: 20%; } /* Top left */
.player-count-4 #player-icon-1 { top: 20%; left: 80%; } /* Top right */
.player-count-4 #player-icon-2 { top: 80%; left: 80%; } /* Bottom right */
.player-count-4 #player-icon-3 { top: 80%; left: 20%; } /* Bottom left */

/* Positioning for 5 players (Pentagon) */
.player-count-5 #player-icon-0 { top: 10%; left: 50%; } /* Top */
.player-count-5 #player-icon-1 { top: 45%; left: 88%; } /* Mid right */
.player-count-5 #player-icon-2 { top: 90%; left: 70%; } /* Bottom right */
.player-count-5 #player-icon-3 { top: 90%; left: 30%; } /* Bottom left */
.player-count-5 #player-icon-4 { top: 45%; left: 12%; } /* Mid left */

/* Hide unused icons cleanly */
.player-icon[hidden] {
    display: none;
}

/* Add this to overrides.css or default.css */

/* Ensure starterButtonsRow is hidden in Group Mode (State config should do this, but belt-and-braces) */
/* body.group-mode #starterButtonsRow {
    display: none !important;
} */

/* --- Default Hiding --- */
/* Hide both conditional rows by default */
#starterButtonsRow,
#group-players-container {
    display: none; /* Completely remove from layout */
    width: 100%; /* Ensure they can fill the placeholder if needed */
    margin-bottom: 0 !important; /* Remove their own bottom margin */
    
}

/* --- Mode-Specific Display --- */
/* Show Starter Buttons ONLY in Practice Mode */
body.practice-mode #starterButtonsRow {
  display: flex; /* Or block, depending on its original display type */
  /* Ensure other styles like justify-content are applied if needed */
  justify-content: center;
}
body.group-mode #starterButtonsRow {
  display: none !important; /* Or block, depending on its original display type */
  /* Ensure other styles like justify-content are applied if needed */
  justify-content: center;
}

/* Show Group Players ONLY in Group Mode */
body.group-mode #group-players-container {
  display: flex; /* Or block */
  justify-content: center;
  /* Remove the negative margin-top if previously added */
  margin-top: 0;
}
/* Show Group Players ONLY in Group Mode */
body.practice-mode #group-players-container {
  display: none !important; /* Or block */
  justify-content: center;
  /* Remove the negative margin-top if previously added */
  margin-top: 0;
}

/* --- Group Players Container Adjustments --- */
/* Keep existing styles for positioning icons *within* the container */
#group-players-container .group-players-inner-container { /* Target the inner div */
  position: relative;
  height: 100px; /* Adjust as needed */
  width: 100%;
  max-width: 400px; /* Limit width */
  /* Remove top/bottom margins if the placeholder handles the spacing */
  /* margin-top: 10px; */
  /* margin-bottom: 10px; */
}

#challengeWordInput.is-valid {
  border-color: #14A44D; /* MDB Success green */
  box-shadow: 0 0 0 0.25rem rgba(20, 164, 77, 0.25);
}
#challengeWordInput.is-invalid {
  border-color: #DC4C64; /* MDB Danger red */
   box-shadow: 0 0 0 0.25rem rgba(220, 76, 100, 0.25);
}

.modal-content {
  padding: 20px;
}

html, body {
/* height: 100%; */
margin: 0;
padding: 0;
}


