@import url('https://fonts.googleapis.com/css2?family=Cabin+Condensed:wght@600&display=swap');

body {
  font-family: 'Cabin Condensed', sans-serif;
  background-image: url("./assets/background_map.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  margin: 0;
  padding: 20px;
  text-align: center;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
}

h1 {
  color: #fffce6;
  font-size: 2rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px #000;
}

.input-container {
  margin-bottom: 15px;
  position: relative;
}

#characterGuess {
  padding: 8px;
  width: 250px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#submitGuess {
  padding: 8px 16px;
  margin-left: 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#submitGuess:hover {
  background-color: #0056b3;
}

#customDropdown {
  position: absolute;
  background-color: #1e1e1e !important;
  border: 1px solid #555;
  color: #f5f5f5 !important;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  width: 100%;
  font-family: 'Cabin Condensed', sans-serif;
  transition: opacity 0.2s ease;
  opacity: 0.95;
}

#customDropdown div {
  background-color: #1e1e1e !important;
  color: #f5f5f5 !important;
  padding: 10px;
  border-bottom: 1px solid #444;
  cursor: pointer;
  font-size: 16px;
}

#customDropdown div:hover {
  background-color: #333 !important;
}

#hintButtonsContainer {
  margin: 15px 0;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.hint-disabled {
  background-color: #555;
  cursor: not-allowed;
  color: white;
}

.hint-active {
  background-color: #28a745;
  cursor: pointer;
  color: white;
}

.hint-display-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.hint-display {
  display: none;
  margin-top: 10px;
  padding: 8px 16px;
  background-color: #111;
  color: #fff;
  border-radius: 4px;
  font-weight: bold;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  visibility: hidden; /* Prevent empty black boxes */
}

.hint-display.active {
  display: block;
  visibility: visible;
}


.hint-display.show {
  display: inline-block;
}




.feedback-grid {
  display: grid;
  grid-template-columns:
    1fr    /* Image */
    1.5fr  /* Name */
    1fr    /* Gender */
    1fr    /* Race */
    1fr    /* Age */
    1fr    /* Height */
    1.2fr  /* Origin */
    1.25fr  /* Bounty */
    1fr    /* Devil Fruit */
    1fr    /* Haki */
    1fr    /* Status */
    1.5fr  /* Affiliation */
    1.55fr; /* First Arc */
  gap: 8px;
  width: 100%;
  max-width: 1600px;  /* Optional max width */
  margin: 0 auto;
  margin-bottom: 12px;
}

.feedback-item {
  display: grid;
  grid-template-columns:
    1fr 1.5fr 1fr 1fr 1fr 1fr 1.2fr 1.25fr 1fr 1fr 1fr 1.5fr 1.55fr;
  gap: 8px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto 8px auto;
}





.feedback-label {
  font-weight: 600;
  text-align: center;
  background-color: #222;
  color: #f5f5dc;
  padding: 8px;
  border-radius: 4px;
  font-size: 16px;
  letter-spacing: 0.5px;
  border: 1px solid #555;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  height: 36px; /* 👈 consistent label height */
  line-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}




.feedback-field {
  height: 96px;
  text-align: center;
  font-weight: bold;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
  padding: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.feedback-field.small-text {
  font-size: 12px;
}

.green {
  background-color: #28a745;
}

.red {
  background-color: #dc3545;
}

.yellow {
  background-color: #ffc107;
  color: #333;
}

#playAgainButton {
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#playAgainButton:hover {
  background-color: #218838;
}

#hintDisplayFirst,
#hintDisplayDevilFruit {
  display: inline-block;
  margin-top: 10px;
  margin-bottom: 15px;
  padding: 10px 16px;
  background-color: #1e1e1e;
  color: #f5f5f5;
  border: 1px solid #555;
  border-radius: 4px;
  font-weight: bold;
  max-width: 90%;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

#customDropdown div {
  background-color: #1e1e1e;
  border-bottom: 1px solid #333;
}

#customDropdown div:hover {
  background-color: #333;
}

#customDropdown .alias-text {
  font-size: 12px;
  color: #aaa;
  margin-top: 2px;
}

.dropdown-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #444;
}

.alias-text {
  font-size: 12px;
  color: #ccc;
}

.feedback-img,
.feedback-field img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #444;
  background-color: #111;
}

.feedback-item img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  margin-right: 8px;
}

.feedback-field.image-only img,
.feedback-character-image {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #444;
  background-color: #111;
}






.image-field {
  display: flex;
  justify-content: center;
  align-items: center;
}

.dropdown-option {
  display: flex;
  align-items: flex-start;
  padding: 8px 10px;
  background-color: #1e1e1e;
  border-bottom: 1px solid #444;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  transition: background-color 0.2s ease;
  min-height: 60px;
}

.dropdown-option:hover {
  background-color: #333;
}

.dropdown-option * {
  pointer-events: none;
}

.dropdown-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.dropdown-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  min-width: 0; /* Required to make text-overflow work correctly inside flex */
}

.dropdown-name {
  font-size: 16px;
  font-weight: bold;
  color: white;
}

.dropdown-alias-container {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
}

.dropdown-alias {
  display: inline-block;
  color: #ccc;
  font-size: 10px;
  transform-origin: left;
  transition: transform 0.1s ease-out;
}

.dropdown-alias.long {
  font-size: 9px; /* smaller for long nicknames */
  line-height: 1.1;
}

.dropdown-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}

.dropdown-content {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  overflow: hidden;
}




.option-content {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.option-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.option-name {
  font-size: 16px;
  font-weight: bold;
  color: white;
}

.option-alias {
  font-size: 12px;
  color: #ccc;
}

#customDropdown .dropdown-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
  background-color: #1e1e1e;
  border-bottom: 1px solid #444;
  width: 100%;
  box-sizing: border-box;
}

#customDropdown .dropdown-option:hover {
  background-color: #333;
}

#customDropdown .option-content {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

#customDropdown .option-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

#customDropdown .option-text {
  display: flex;
  flex-direction: column;
  color: #f5f5f5;
  width: 100%;
}

#customDropdown .option-name {
  font-size: 16px;
  font-weight: bold;
}

#customDropdown .option-alias {
  font-size: 12px;
  color: #aaa;
}

#customDropdown:empty {
  display: none;
  border: none !important;
  height: 0;
}


/* MOBILE STYLES */
@media (max-width: 768px) {
  body {
    font-size: 14px;
    padding: 10px;
  }

  .feedback-grid,
  .feedback-item {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .feedback-field,
  .feedback-label {
    font-size: 12px;
    min-width: 90px;
    height: auto;
    padding: 6px;
  }

  .feedback-field img,
  .feedback-character-image {
    width: 64px;
    height: 64px;
  }

  h1 {
    font-size: 1.5rem;
  }

  #characterGuess,
  #submitGuess {
    width: 100%;
    margin: 5px 0;
  }

  #hintButtonsContainer {
    flex-direction: column;
    align-items: center;
  }

  .hint-display {
    font-size: 12px;
  }

  .dropdown-option {
    font-size: 12px;
  }
}
