@import url('https://fonts.googleapis.com/css2?family=Micro+5&display=swap');

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Micro 5', monospace;
  background-color: #fce7e7;
  color: #000000;
  padding: 4rem 1rem;
}

/* Centered Layout */
body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

main {
  width: 100%;
  max-width: 700px;
}

/* Headings */
h1 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center; /* Center the h1 */
}

/* Update Log Section */
.updates {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 2.5rem;
  padding: 1rem;
  background-color: white;
  border: 1px solid black;
  width: 400px;
  height: 200px;
  overflow-y: auto;
  font-family: inherit;
  margin-bottom: 0.2rem;
  border-radius: 8px;
  position: relative;
  z-index: 1;

  /* 🎯 perfect center trick */
  left: 50%;
  transform: translateX(-50%);
}

/* Optional: custom scrollbar for WebKit browsers (Chrome, Safari) */
.updates::-webkit-scrollbar {
  width: 6px;
}
.updates::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.updates div {
  padding: 0.25rem 0;
}

/* Virtual Pet Container */
.pet-container {
  position: absolute;
  top: 11rem;
  left: calc(50% + 140px);
  transform: translate(50%, -50%);
  width: 48px;
  height: 48px;
  pointer-events: auto; /* enable hover */
  cursor: default;
  z-index: 1000; /* float above everything */
}

/* Pet Images stacked */
.pet-container {
  position: absolute;
  top: 11rem;
  left: calc(50% + 140px);
  transform: translate(50%, -50%);
  width: 48px;
  height: 48px;
  pointer-events: auto;   /* allow hover events */
  cursor: default;        /* keep regular arrow */
  z-index: 1000;          /* float above everything */
}

/* All images inside the container */
.pet-container {
  position: absolute;
  top: 11rem;
  left: calc(50% + 140px);
  transform: translate(50%, -50%);
  width: 48px;
  height: 48px;
  pointer-events: auto;
  cursor: default;
  z-index: 1000;
}

/* Make both images stack and transition */
.pet-container {
  position: absolute;
  top: 11rem;
  left: calc(50% + 140px);
  transform: translate(50%, -50%);
  width: 48px;
  height: 48px;
  z-index: 1000;
  pointer-events: auto;
}

.pet-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 48px;
  pointer-events: none;
  transition: opacity 0.1s ease-in-out;
}

/* Default state: idle visible, hover hidden */
.pet-idle {
  opacity: 1;
}

.pet-hover {
  opacity: 0;
}

/* On hover: idle fades out, hover fades in */
.pet-container:hover .pet-idle {
  opacity: 0;
}

.pet-container:hover .pet-hover {
  opacity: 1;
}

/* Colored Underlines */
.yellow {
  text-decoration: underline;
  text-decoration-color: #f2c159;
  text-decoration-thickness: 2px;
}
.red {
  text-decoration: underline;
  text-decoration-color: #f4917e;
  text-decoration-thickness: 2px;
}
.blue {
  text-decoration: underline;
  text-decoration-color: #65acd0;
  text-decoration-thickness: 2px;
}

/* Base highlight styling for padding, font, border-radius */
.highlight-new {
  font-weight: 700;
  padding: 0em 0.45em;
  border-radius: 3px;
  font-family: 'Micro 5', monospace;
  display: inline-block;
  background: linear-gradient(-90deg, #f4917e, #f2c159, #65acd0);
  background-size: 300% 300%;
  color: #ffffff;
  animation: gradientMove 3s linear infinite;
}

/* Keyframes for moving the gradient */
@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.highlight-new span {
  display: inline-block;
  animation: jump-letter 2.0s ease-in-out infinite;
}

/* Jump timing for each letter */
.highlight-new span:nth-child(1) { animation-delay: 0s; }
.highlight-new span:nth-child(2) { animation-delay: 0.2s; }
.highlight-new span:nth-child(3) { animation-delay: 0.4s; }
.highlight-new span:nth-child(4) { animation-delay: 0.6s; }

/* Keyframe for jumping */
@keyframes jump-letter {
  0%, 10%, 90%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px); /* jump up */
  }
  50% {
    transform: translateY(3px);  /* drop down */
  }
}

/* Optional spacing */
section {
  margin-bottom: 2rem;
}

.legend {
    width: 400px;
    margin: 1rem auto 0;
    font-family: 'Micro 5', monospace;
    display: grid;
    grid-template-columns: 130px 1fr 80px; /* match your fixed widths */
    gap: 0.3rem 0.5rem;
}

.legend-row {
    display: contents; /* children go directly into the grid */
}

  .legend-row > div:first-child {
    /* flex: 0 0 130px; */ /* fixed width for colored underline text */
    white-space: nowrap;
  }

  .legend-meaning {
    /* flex: 1 1 auto; */
    white-space: nowrap;
  }

  /* Enter button styling */
  .enter-button {
    /* flex: 80 0 0px; */
    border: 1px solid #888;
    color: #555;
    font-size: 0.95rem;
    padding: 0.3rem 0;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    background-color: #f0f0f0;
    transition: background-color 0.2s ease;
    grid-row: 1 / span 3; /* span 3 rows */
    align-self: flex-start;    /* stick to top */
    justify-content: flex-end;
  }

  .enter-button:hover {
    background-color: #d0d0d0;
  }