/* Hide all sections by default */
.mode-section {
  display: none;
}

/* Show only the active section */
.mode-section.active {
  display: block;
}

/* Optional: highlight the active button */
nav button.active {
  font-weight: bold;
}
/* Critterpedia grid */
#critterpediaGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 48px);
  gap: 10px;
  padding: 10px 100px;
  justify-content: start;
}

/* Icon container */
.critter-icon {
  position: relative;
  width: 48px;
  height: 48px;
}

/* Icon image */
.critter-icon img {
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Tooltip (hidden by default) */
.critter-icon .tooltip {
  position: absolute;
  bottom: 110%;               /* Above the icon */
  left: 50%;                  /* Center horizontally */
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  text-align: left;
  width: max-content;         /* Auto width, fits content */
  max-width: 220px;           /* Never too wide */
  word-wrap: break-word;      /* Wrap long words/text */
  white-space: normal;        /* Allow wrapping */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}

/* Ensure tooltip doesn't spill off the right edge */
.critter-icon:hover .tooltip {
  opacity: 1;
}

/* Keep tooltip inside viewport on small screens */
@media (max-width: 500px) {
  .critter-icon .tooltip {
    max-width: calc(100vw - 20px);
  }
}

/* Greyed-out caught creatures */
.critter-icon.caught img {
  filter: grayscale(100%) brightness(0.6);
}



/* ===== Base page styling ===== */
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #fff6e5; /* soft warm cream */
  color: #3a2a1a;
}

/* ===== Top navigation / tabs ===== */
nav {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background-color: #f4a261; /* warm orange */
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

nav button {
  background-color: #f6bd60; /* golden yellow */
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  color: #3a2a1a;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

nav button:hover {
  background-color: #f1a94e;
  transform: translateY(-1px);
}

nav button.active {
  background-color: #e76f51;
  color: #fff;
}

/* ===== Main content area ===== */
main {
  padding: 20px;
}

/* ===== Island input section ===== */
.island-inputs {
  background-color: #fff1cc;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.island-inputs label {
  font-weight: 600;
  margin-right: 6px;
}

.island-inputs input,
.island-inputs select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #d6a85a;
  background-color: #fffaf0;
}

/* ===== Tables (assistants) ===== */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fffaf0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

th {
  background-color: #f4a261;
  color: #3a2a1a;
  text-align: left;
  padding: 10px;
}

td {
  padding: 10px;
  border-bottom: 1px solid #f0d9a7;
}

tr:last-child td {
  border-bottom: none;
}

/* ===== Icons in tables ===== */
table img {
  width: 40px;
  height: 40px;
}

/* ===== Caught checkbox ===== */
input[type="checkbox"] {
  transform: scale(1.2);
  cursor: pointer;
}

/* ===== Critterpedia grid ===== */
.critterpedia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 16px;
  padding: 20px;
}

/* ===== Critter icon card ===== */
.critter-card {
  position: relative;
  background-color: #fff1cc;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.critter-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* ===== Critter icons ===== */
.critter-card img {
  width: 48px;
  height: 48px;
}

/* ===== Caught critters ===== */
.critter-card.caught {
  opacity: 0.4;
  filter: grayscale(100%);
}

/* ===== Tooltip ===== */
.tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #3a2a1a;
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  max-width: 220px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.critter-card:hover .tooltip {
  opacity: 1;
}
/* ===== Mobile adjustments ===== */
@media (max-width: 600px) {

  /* Reduce overall padding */
  main {
    padding: 12px;
  }

  /* Fix critterpedia grid side padding */
  #critterpediaGrid {
    padding: 10px;
    justify-content: center;
  }

  /* Make nav buttons wrap instead of overflow */
  nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  nav button {
    flex: 1 1 auto;
    min-width: 120px;
    text-align: center;
  }

  /* Stack island inputs more nicely */
  .island-inputs {
    padding: 12px;
  }

  .island-inputs label {
    display: block;
    margin-bottom: 4px;
  }

  .island-inputs input,
  .island-inputs select {
    width: 100%;
    margin-bottom: 10px;
  }

  /* Make tables scroll instead of squish */
  table {
    font-size: 0.9rem;
  }

  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Slightly larger tap targets */
  table img {
    width: 44px;
    height: 44px;
  }

  input[type="checkbox"] {
    transform: scale(1.4);
  }

  /* Tooltips stay inside screen */
  .tooltip {
    max-width: calc(100vw - 24px);
    font-size: 0.8rem;
  }
}

#feedback-box {
  position: fixed;
  bottom: 10px;
  right: 10px;

  font-size: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;

  padding: 8px 10px;
  border-radius: 8px;
  max-width: 220px;
  line-height: 1.4;

  z-index: 1000;
}

#feedback-box a {
  color: #9fd3ff;
  text-decoration: none;
}

#feedback-box a:hover {
  text-decoration: underline;
}

