/* Puzzle game specific styles */

.blank.invalid-letter {
  background: #ffd6d6 !important;
  border-bottom: 3px solid #ff4136 !important;
}

.blank.invalid-letter:focus {
  background: #ffb3b3 !important;
  /* Darker red background when focused */
  border-bottom: 3px solid #cc0000 !important;
  /* Darker red border when focused */
  box-shadow: 0 4px 16px rgba(255, 65, 54, 0.25) !important;
  /* Red-tinted shadow */
}

.blank.correct-letter {
  background: #d4edda !important;
  border-bottom: 3px solid #28a745 !important;
  color: #155724 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-2px);
  }

  50% {
    transform: translateX(2px);
  }

  75% {
    transform: translateX(-2px);
  }

  100% {
    transform: translateX(0);
  }
}

.word-slot {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}

.game-container {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(30, 60, 114, 0.10);
  padding: 40px 32px 32px 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  flex-shrink: 0;
  position: relative;
}

@media (max-width: 600px) {
  .game-container {
    margin-left: 10px;
    margin-right: 10px;
  }
}

.clue {
  font-size: 1.2rem;
  color: #2a5298;
  margin-bottom: 32px;
  font-weight: 500;
}

.words-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 36px;
}

.word-blanks {
  display: flex;
  gap: var(--blank-gap, 10px);
  justify-content: center;
}

.blank {
  width: var(--blank-width, 32px);
  height: var(--blank-height, 40px);
  margin: 0 2px;
  font-size: var(--blank-font-size, 1.5rem);
  color: #1e3c72;
  background: #f0f4fa;
  border: none;
  border-bottom: 3px solid #1e3c72;
  border-radius: 6px 6px 0 0;
  text-align: center;
  display: inline-block;
  vertical-align: middle;
  outline: none;
  box-shadow: 0 2px 8px rgba(30, 60, 114, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
  caret-color: transparent;
  /* Hide the cursor/caret */
  user-select: none;
  /* Prevent text selection */
  -webkit-user-select: none;
  /* Safari */
  -moz-user-select: none;
  /* Firefox */
  -ms-user-select: none;
  /* IE/Edge */
}

.blank:focus {
  border-bottom: 3px solid #2a5298;
  background: #d6e8ff;
  /* More prominent background color when focused */
  box-shadow: 0 4px 16px rgba(30, 60, 114, 0.15);
  /* Stronger shadow when focused */
}

.letter-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

.letter {
  background: #2a5298;
  color: #fff;
  border-radius: 6px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(30, 60, 114, 0.10);
  margin-bottom: 4px;
  user-select: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.letter:hover {
  background: #1e3c72;
  transform: translateY(-1px);
}

.letter:active {
  transform: translateY(0);
}

.letter.used {
  background: #d0e8ff;
  color: #357ab8;
  border-color: #b0d4f1;
  cursor: pointer;
}

.letter.used:hover {
  background: #b8dcff;
  transform: translateY(-1px);
}

.delete-button {
  background: #ff4136;
  color: #fff;
  border-radius: 6px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(255, 65, 54, 0.10);
  margin-bottom: 4px;
  user-select: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  position: relative;
}

.delete-button::before {
  content: "←";
  font-size: 1.5rem;
  line-height: 1;
}

.delete-button:hover {
  background: #e60000;
  transform: translateY(-1px);
}

.delete-button:active {
  transform: translateY(0);
}

/* Hide delete button on desktop/larger screens */
@media (min-width: 768px) {
  .delete-button {
    display: none !important;
  }
}

/* Timer display styles */
.timer-container {
  margin-top: 16px;
  text-align: center;
}

.timer-display {
  font-size: 1.1rem;
  color: #2a5298;
  font-weight: 500;
  background: #f0f4fa;
  padding: 8px 16px;
  border-radius: 6px;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(30, 60, 114, 0.1);
}

/* Hint system styles */
.hint-container {
  margin-top: 20px;
  text-align: center;
}

.hint-button {
  background: #ffa500;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(255, 165, 0, 0.2);
  display: inline-block;
  min-height: 44px;
  box-sizing: border-box;
}

.hint-button:hover:not(:disabled) {
  background: #ff8c00;
  transform: translateY(-1px);
}

.hint-button:active:not(:disabled) {
  transform: translateY(0);
}

.hint-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.hint-counter {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.9rem;
  color: #666;
}

.give-up-button {
  background: #dc3545;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
  display: inline-block;
  min-height: 44px;
  box-sizing: border-box;
  margin-left: 10px;
}

.give-up-button:hover {
  background: #c82333;
  transform: translateY(-1px);
}

.give-up-button:active {
  transform: translateY(0);
}

.blank.hint-revealed {
  background: #fff3cd !important;
  border-bottom: 3px solid #ffc107 !important;
  color: #856404 !important;
  cursor: not-allowed !important;
  outline: none !important;
  pointer-events: none !important;
}

.blank.hint-revealed:focus {
  background: #fff3cd !important;
  border-bottom: 3px solid #ffc107 !important;
  box-shadow: none !important;
}

.blank.give-up-revealed {
  /* Give up revealed letters look normal but are tracked for state */
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.blank.give-up-revealed:focus {
  /* Ensure no special focus styling for give-up letters */
  box-shadow: none !important;
}

.blank.give-up-letter {
  background: #fff3cd !important;
  border-bottom: 3px solid #ffc107 !important;
  color: #856404 !important;
  cursor: not-allowed !important;
  outline: none !important;
  pointer-events: none !important;
}

.blank.give-up-letter:focus {
  background: #fff3cd !important;
  border-bottom: 3px solid #ffc107 !important;
  box-shadow: none !important;
}

.give-up-confirm-message {
  background: #dc3545;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: bold;
  text-align: center;
  margin: 0;
  height: 44px;
  box-sizing: border-box;
  line-height: 1;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.give-up-yes-button,
.give-up-no-button {
  border: none;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  margin-left: 10px;
  transition: background-color 0.2s;
  height: auto;
  align-self: center;
}

.give-up-yes-button {
  background: #721c24;
  color: white;
}

.give-up-yes-button:hover {
  background: #5a161c;
}

.give-up-no-button {
  background: #6c757d;
  color: white;
}

.give-up-no-button:hover {
  background: #5a6268;
}

/* Development Reset Link */
.dev-reset-container {
  margin-top: 20px;
  text-align: center;
  width: 100%;
  max-width: 480px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.dev-reset-link {
  color: #6c757d;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
}

.dev-reset-link:hover {
  color: #dc3545;
  text-decoration: underline;
}

/* Win/Loss message styles */
.completion-messages {
  margin-top: 24px;
  text-align: center;
}

#win-message {
  font-size: 1.4rem;
  color: #2ecc40;
  font-weight: bold;
  margin-bottom: 8px;
}

#loss-message {
  font-size: 1.4rem;
  color: #dc3545;
  font-weight: bold;
  margin-bottom: 8px;
}

/* Button container for completion buttons */
.completion-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
  margin-bottom: 8px;
}

/* Back to game button styles */
#back-to-game-btn {
  font-size: 1.1rem;
  padding: 10px 28px;
  background: linear-gradient(90deg, #1e3c72, #2a5298);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

#back-to-game-btn:hover {
  background: linear-gradient(90deg, #1a3461, #235085);
  transform: translateY(-1px);
}

#back-to-game-btn:active {
  transform: translateY(0);
}

/* Share button styles */
#share-btn {
  font-size: 1.1rem;
  padding: 10px 28px;
  background: linear-gradient(90deg, #28a745, #20c997);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

#share-btn:hover {
  background: linear-gradient(90deg, #218838, #17a2b8);
  transform: translateY(-1px);
}

#share-btn:active {
  transform: translateY(0);
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Next puzzle divider */
#next-divider {
  height: 0;
  border-bottom: 1.5px solid #e0e4ea;
  margin: 8px 0 24px 0;
  width: 100%;
}