@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&display=swap");

.storytext {
  color: var(--color-black);
  font-family: "EB Garamond", sans-serif;
  font-size: 1.2rem; /* Smaller on mobile */
  line-height: 1.7;
  text-align: left;
  font-weight: 300;
  cursor: default;
}
.questionnumber {
  color: var(--color-orange);
  font-family: "Cantarell", sans-serif;
  font-size: 0.8rem;
}

.storytext p {
  margin-bottom: 1.2rem !important;
}

.storytext p:last-child {
  margin-bottom: 0 !important;
}

.storytext .conversation-line {
  margin-bottom: 0.8rem !important;
}

.storytext .conversation-line:last-child {
  margin-bottom: 0 !important;
}

.story-selector {
  color: var(--color-black);
  background: var(--color-lightestblue);
  border: 1.4px solid var(--color-lightpurple);
  border-radius: 6px;
  height: 1.8rem;
  font-family: var(--font-funnel);
  font-size: 1rem;
  padding: 0 2.2rem 0 0.7rem;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s, box-shadow 0.2s;
  margin: 10px;
  outline: none;
  position: relative;
}

.story-selector:focus {
  border-color: var(--color-lightgreen);
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.15);
}

.story-extra-info {
  margin-top: 3em;
  font-size: 0.55em;
  color: var(--color-lightpurple);
  align-items: right;
  font-family: var(--font-funnel);
}

.story-extra-info a {
  color: var(--color-lightpurple);
}

.story-title {
  font-size: 1.8rem;
  font-family: var(--font-display);
  cursor: default;
  color: var(--color-black);
  font-weight: 400;
  text-align: center;
  letter-spacing: -1px;
  background-color: none;
  width: 90%; /* Wider on mobile */
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  margin-top: 8px;
  margin-bottom: 12px;
}

.verb-slot {
  display: inline-block;
  position: relative;
  margin: 0px;
  padding: 0px;
  vertical-align: middle;
  width: max-content;
}

.verb-input {
  height: 1.8rem;
  background: var(--color-lightestblue);
  border: 0x solid var(--color-lightpurple);
  border-radius: 6px;
  padding: 0px;
  font-size: 1.2rem; /* Match storytext font size on mobile */
  line-height: 1.6; /* Match storytext line-height */
  text-align: center;
  font-family: inherit;
  margin: 0px;
  width: 100%;
  vertical-align: text-bottom; /* Better alignment with text */
  position: relative;
  top: -3px; /* Upward adjustment to align with text baseline */
}

.verb-input:focus {
  outline: none;
  border-color: #28a745;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.verb-input.correct {
  background: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.verb-input.answered {
  background: rgba(212, 237, 218, 0.1);
  border-color: transparent;
  color: #155724;
  transition: all 0.6s ease;
  cursor: default;
  pointer-events: none;
  box-shadow: none;
}

.verb-input.answered:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}

.verb-input.incorrect {
  background: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.story-selector-container {
  text-align: center;
  display: flex;
  margin-left: auto;
  margin-right: 0;
  font-family: var(--font-funnel);
  color: var(--color-lighterblack);
  font-size: 0.8rem;
  justify-content: flex-end;
  align-items: center;
  width: 90%;
  padding-right: 3%;
}

.storydiv {
  background-color: var(--color-beige);
  width: 98%; /* Wider on mobile */
  border-radius: var(--border-radius);
  display: block;
  margin: 0 auto;
  padding: 15px; /* Reduced padding for mobile */
  margin-bottom: 10px;
  cursor: default;
  flex-shrink: 0;
}

.hint {
  font-family: var(--font-funnel);
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-lighterblack);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 10;
}

.hint::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #343a40;
}

.verb-slot:hover .hint {
  opacity: 1;
}

.progress-bar {
  background: var(--color-lightestpurple);
  height: 8px;
  border-radius: 4px;
  margin: 8px 0;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(
    45deg,
    var(--color-lightpurple),
    var(--color-purple)
  );
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.completion-message {
  background: var(--color-lightgreen);
  color: var(--color-green);
  font-family: var(--font-funnel);
  padding: 2px;
  border-radius: var(--border-radius);
  text-align: center;
  margin-top: 20px;
  display: none;
  animation: fadeIn 0.5s ease;
}

p {
  color: var(--color-lighterblack);
  font-family: var(--font-funnel);
  font-size: 0.8rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Desktop styles */
@media (min-width: 1024px) {
  .storydiv {
    padding: 20px 100px;
    padding-bottom: 80px;
  }

  .story-selector-container {
    right: 140px;
    display: flex;
    width: 90%;
    padding-right: 4%;
  }
  .storytext {
    font-size: 1.4rem; /* Smaller on mobile */
    line-height: 1.6;
  }

  .verb-input {
    font-size: 1.4rem; /* Match storytext font size on desktop */
    line-height: 1.6; /* Match storytext line-height on desktop */
  }

  .story-title {
    font-size: 2.8rem;
    margin-bottom: 30px;
  }

  .storytext p {
    margin-bottom: 1.2rem !important;
  }

  .storytext p:last-child {
    margin-bottom: 0 !important;
  }

  .storytext .conversation-line {
    margin-bottom: 1.2rem !important;
  }

  .storytext .conversation-line:last-child {
    margin-bottom: 0 !important;
  }

  .hint {
    font-size: 0.9rem;
  }
  .questionnumber {
    color: var(--color-orange);
    font-family: "Cantarell", sans-serif;
    font-size: 1rem;
  }
}
