:root {
  --green: #58cc02;
  --green-light: #d4edda;
  --red-light: #f8d7da;
  --gray-light: #f0f0f0;
  --blue-light: #dbeeff;
  --gray-soft: #e7e7e7;
  --font: "Helvetica Neue", sans-serif;
}


body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background-color: #fff;
  display: flex;
  justify-content: center;
  min-height: 100vh;

  /* Zoom-Deaktivierung & Touch-Optimierung */
  touch-action: manipulation;
  -webkit-user-select: none;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}



.details-satzbau {
  width: 75%;
  max-width: 640px;
  background-color: #f2f2f2;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 1rem auto;
  color: #333;
}

.details-satzbau summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  padding: 4px;
  list-style: none;
}

.details-satzbau summary::-webkit-details-marker {
  display: none; /* entfernt Standard-Pfeil */
}

.details-satzbau summary i {
  transition: transform 0.3s ease;
  font-size: 1.2rem;
  color: #555;
}

.details-satzbau[open] summary i {
  transform: rotate(180deg);
}

.details-satzbau p {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #333;
  text-align: center;
}


.container {
  max-width: 640px;
  width: 100%;
  padding: 2rem 1rem;
  text-align: center;
  border-radius: 10px;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #222;
}

.card {
  background: var(--gray-light);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

#spanish-sentence {
  font-size: 1.2rem;
  font-weight: bold;
  color: #222;
  margin-bottom: 0.6rem;
}

#speakBtn {
  background-color: #e6ecf2;
  color: #222;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
}

#speakBtn:hover {
  background-color: #d3e0ea;
}



.word-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 1.2rem;
}

.word {
  background-color: #eef4fb;
  color: #333;
  border: 1px solid #cbdff2;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.word:hover {
  background-color: #e0ebf7;
}

.word.used,
.word.faded {
  background-color: #dce2e7;
  color: #aaa;
  opacity: 0.6;
}

.output-area {
  min-height: 125px;
  max-height: 200px;
  background-color: #f9f9f9;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 8px 8px;
  overflow-y: auto;
}

.output-word {
  background-color: #d6d6d6;
  border-radius: 6px;
  padding: 8px 16px;
  margin: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.2;
  height: auto;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background-color 0.2s ease;
}


.output-word-correct {
  background-color: var(--green-light);
  color: #1e6b26;
}

.output-word-wrong {
  background-color: var(--red-light);
  color: #a82222;
}


.controls {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.speech-bubble-container {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 30px; /* 👈 Weniger Abstand zwischen Bild und Blase */
  margin-bottom: 1.5rem;
  max-width: 95%;
  margin-left: auto;
  margin-right: auto;
}



.clara-img {
  width: 80px;        /* feste, kontrollierte Breite */
  height: auto;
  max-height: 160px;  /* optional, falls nötig */
  object-fit: contain;
  flex-shrink: 0;
  margin: 0;          /* sicherstellen, dass kein Abstand da ist */
  padding: 0;
}



.speech-bubble {
  position: relative;
  background: #f0f0f0;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 500;
  text-align: center;
  max-width: 80vw;
  line-height: 1.4;
  color: #333;
  padding: 14px 20px; /* 👈 mehr Luft innen: vertikal 14px, horizontal 20px */
  line-height: 1.5; /* 👈 optional: mehr Zeilenhöhe */

}


/* Zeiger (links) */
.speech-bubble::before {
  content: "";
  position: absolute;
  left: -18px;   /* 👈 optional: näher an die Blase */
  top: 16px;     /* 👈 leicht höher als vorher */
  width: 0;
  height: 0;
  border: 10px solid transparent;
  border-right-color: #f0f0f0;
}


.gap {
  padding: 2px 6px;
  border-bottom: 2px dotted #ccc;
  font-weight: bold;
}

.correct {
  background-color: #d4edda; /* sanftes Grün */
  color: #155724;
  border-radius: 4px;
  padding: 2px 4px;
}

.wrong {
  background-color: #f8d7da; /* sanftes Rot */
  color: #721c24;
  border-radius: 4px;
  padding: 2px 4px;
}



button {
  font-size: 1rem;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

button i {
  font-size: 1.1rem;
}

#checkBtn {
  background-color: #e8cb27;
  color: #1c431c;
}

#resetBtn {
  background-color: #d6d6d6;
  color: #333;
}

#nextBtn {
  background-color: #b8dfff;
  color: #154d75;
}

.next-control {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}


button:hover {
  transform: translateY(-2px);
}

.result-text {
  margin-top: 1rem;
  font-weight: bold;
  font-size: 1.1rem;
  color: #333;
}

@media (max-width: 600px) {
.speech-bubble-container {
  gap: clamp(8px, 5vw, 30px);
}
}



/* Darkmode */
@media (prefers-color-scheme: dark) {
  .speech-bubble {
    background: #2a2a2a;
    color: #f2f2f2;
  }

  .speech-bubble::before {
    border-right-color: #2a2a2a;
  }

  .clara-img {
    filter: brightness(0.9) contrast(1.1);
  }

  body {
    background-color: #121212;
    color: #f2f2f2;
  }

  .container {
    background-color: #121212;
  }

  .card {
    background-color: #1e1e1e;
    color: #fff;
  }

  #spanish-sentence {
    color: #fff;
  }

  .output-area {
    background-color: #1c1c1c;
  }

  .word {
    background-color: #2a2a2a;
    border-color: #444;
    color: #eee;
  }

  .word.used,
  .word.faded {
    background-color: #444;
    color: #888;
  }

  .output-word {
    background-color: #2e4c2e;
    color: #d2ffd2;
  }

  .output-word.correct {
    background-color: #c4f4c6 !important;
    color: #1e6b26;
  }

  .output-word.wrong {
    background-color: #fbd5d5 !important;
    color: #a82222;
  }

  button {
    background-color: #58cc02;
    color: white;
  }

  #checkBtn {
    background-color: #58cc02;
    color: white;
  }

  #resetBtn {
    background-color: #666;
    color: white;
  }

  #nextBtn {
    background-color: #3388ff;
    color: white;
  }

  button:hover {
    filter: brightness(1.1);
  }

  .result-text {
    color: #eee;
  }
  
    #speakBtn {
    background-color: #2a2a2a;
    color: #eee;
  }

  #speakBtn:hover {
    background-color: #3a3a3a;
  }
    .details-satzbau {
    background-color: #2a2a2a;
    border-color: #444;
    color: #eee;
  }

  .details-satzbau summary i {
    color: #ccc;
  }

  .details-satzbau[open] summary i {
    color: #58cc02;
  }

}

/* ✅ Feedback Lightmode */
.output-word-correct {
  background-color: var(--green-light) !important;
  color: #1e6b26 !important;
}

.output-word-wrong {
  background-color: var(--red-light) !important;
  color: #a82222 !important;
}

/* 🌙 Feedback Darkmode */
@media (prefers-color-scheme: dark) {
  .output-word-correct {
    background-color: #1d3d1d !important;  /* dunkles Grün */
    color: #a8f0a8 !important;             /* hellgrün für Kontrast */
    border: 1px solid #3fa63f;
  }

  .output-word-wrong {
    background-color: #3d1d1d !important;  /* dunkles Rot */
    color: #f0a8a8 !important;             /* hellrot */
    border: 1px solid #a63f3f;
  }
}
@media (prefers-color-scheme: dark) {
  /* ... deine bisherigen Darkmode-Regeln ... */

  /* Dezenter Hover für Buttons */
  button:hover {
    filter: brightness(1.05); /* statt 1.1 -> nur leichtes Aufhellen */
  }

  /* Dezenter Hover für Wort-Kacheln */
  .word:hover {
    background-color: #3a3a3a; /* sanft dunkleres Grau statt helles Blitzen */
    border-color: #555;
  }
}
