body {
  font-family: Arial, sans-serif;
  background: linear-gradient(to right, #f0f8ff, #e6f0ff);
}

.title-card {
  max-width: 600px;
  margin: 20px auto;
  margin-top: 12%;
  margin-bottom: 1%;
  text-align: center; 
}

.title-card h1 {
  font-size: 2rem;
  color: #007bff;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
}

#loading {
  font-size: 24px;
  text-align: center;
  margin-top: 50px;
}
#puzzle-area {
  display: flex;
  flex-wrap: nowrap; /* prevent wrapping */
  gap: 10px;
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
  padding: 10px;
  box-sizing: border-box;
  justify-content: center;
}

.clue-container, .submission-container {
  margin: 20px auto;
  padding: 10px;
  max-width: 600px;
  font-family: sans-serif; 
}

.clue-container { 
  border: 2px solid #ccc;
  border-radius: 8px;
  background-color: #f9f9f9;
  /* Scroll handling */
  height: 40vh;         /* Adjust height as needed */
  overflow-y: auto;          /* Enable vertical scrolling */
  scrollbar-width: thin;     /* thinner scrollbar for Firefox */
  margin: 20px auto; 
}
.submission-container { 
  display: flex;
  justify-content: center;   /* Center items horizontally */
  flex-wrap: wrap;           /* Allow buttons to wrap if needed */
  gap: 10px;                 /* Space between buttons */
}

/*used when the submission container has been hidden*/
.submission-container-outer
{
  margin-top: 5%;
}

/*BUTTONS IN SUBMISSION CONTAINER*/
.submission-container button {
  flex: 1 1 30%; /* Allow buttons to grow and wrap */
  min-width: 120px; /*prevent buttons from getting too small */
}

button {
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid #007bff;
  border-radius: 6px;
  background-color: #007bff;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

button:hover {
  background-color: #0056b3;
  border-color: #0056b3;
  box-shadow: 0 4px 8px rgba(0, 86, 179, 0.4);
}

button:active {
  transform: scale(0.97);
}

button:disabled,
button.hidden {
  background-color: #cccccc;
  border-color: #aaa;
  cursor: not-allowed;
  color: #666;
  box-shadow: none;
}

/*CLUES*/

.clue {
  padding: 8px 10px;
  margin-bottom: 6px;
  border-left: 4px solid #007bff;
  background-color: #fff;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.clue:hover {
  background-color: #eef5ff;
}

.new-clue {
  border-left-color: #cb5b27; 
}

.square {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-width: 20px;
  max-width: 100px;
  background-color: #ffffff;
  color: #333;
  border: 2px solid #007bff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  font-size: clamp(0.8rem, 4vw, 1.1rem); 
  text-overflow: ellipsis;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: grab;
  box-sizing: border-box;
  overflow: hidden;
  text-align: center;
}

.sortable-chosen {
  opacity: 0;
}

.square.disabled {
  opacity: 0.6;
}


.hidden {
  display: none;
}

/*RESULT MESSAGE*/
.result-message {
  position: absolute;
  right: 0; /*stuck to the right of the parent div*/
  transform: translateX(10%) translateY(-40%) rotate(7deg); /*slight rotation */
  background-color: rgba(255, 255, 255, 1);
  padding: 10px 15px;
  border: 2px solid #ccc;
  border-radius: 8px;
  font-size: 1.0rem; 
  z-index: 1000;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
  pointer-events: none; /* makes sure it doesn't interfere with clicks */
} 
.clue-container {
  margin: 0 5%;
}
.clue-container-outer {
  position: relative;
  padding: 0;
  margin: 0 auto;
  max-width: 600px;
}

.result-message.success {
  color: #28a745; 
}

.result-message.failure {
  color: #dc3545; 
}

.result-message.hidden {
  display: none;
}


/*CONFIRMATION MODAL*/
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
  
.modal-content {
  background: white;
  padding: 20px 30px;
  border-radius: 8px;
  max-width: 300px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.modal-buttons {
  margin-top: 20px;
  display: flex;
  justify-content: space-around;
}

.modal-buttons button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

#confirm-yes {
  background-color: #28a745;
  color: white;
}

#confirm-cancel {
  background-color: #dc3545;
  color: white;
}
.modal.hidden {
  display: none;
}

/*DIFFICULTY SELECTION SCREEN*/

/* background */
.difficulty-selection-container {
    top: 0;
    left: 0;
    width: 80%;
    margin: 0 auto;
    padding: 2rem;
    background-color:#e0f0ff;
    display: flex;
    flex-direction: row; /* two-column layout */
    gap: 2rem;
    box-sizing: border-box;
    justify-content: center;
}
/* Left Column: Info Section */
.difficulty-selection-result-container {
    flex: 1;
    color: white;
}

/* "How to Play" section */
.how-to-play {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
}
/* Title text */
.difficulty-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Container for difficulty buttons */
/* Right Column: Buttons stacked vertically */
.difficulty-buttons {
    display: flex;
    flex-direction: column; /* vertical stack */
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    flex: 0 0 250px; /* fixed width for button area */
}
/* Button wrapper */
.difficulty-btn-wrapper {
    position: relative; 
    display: flex;
    width: 100%;
    max-width: 100px;
}

/* Style for each difficulty button */
.difficulty-btn {
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px 5px;
    width: 100%;
    border: none;
    border-radius: 8px; 
    color: white;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.complete-label { 
  position: absolute; 
  top: -30%;
  left: 65%;
  transform: rotate(7deg); /* center + slight rotation */
  background-color: rgba(255, 255, 255, 1); 
  border: 2px solid #ccc;
  border-radius: 8px;
  font-size: 0.75rem; 
  z-index: 1000;
  padding: 4px;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
  pointer-events: none; /* makes sure it doesn't interfere with clicks */
  color: #000;
}
.complete-label.success {
  color: #28a745; 
}

.complete-label.failure {
  color: #dc3545; 
}


/* Messages */
.attempted-all-puzzles-message {
    margin-top: 2rem;
    font-weight: bold;
    font-size: 1.1rem;
}

.attempted-all-puzzles-message.perfect {
    color: gold;
    font-size: 1.2rem;
}