: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;
}


.container {
  max-width: 640px;
  width: 100%;
  padding: 2rem 1rem;
  text-align: center;
  border-radius: 10px;
}


.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;
}



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 #bbb;
  font-weight: 500;
  font-size: 1rem;
  color: #666;
}

/* Eingabe-Lücke */
.gap-input {
  padding: 6px 10px;
  font-size: 1rem;
  border: 2px solid #ccc;
  border-radius: 10px;
  text-align: center;
  display: inline-block;
  min-width: 80px;
  box-sizing: border-box;
  background-color: #fafafa;
  color: #333;
  transition: border-color 0.2s ease;
}

/* Fokuszustand – nur klarer Rand, kein Glow */
.gap-input:focus {
  border-color: #333;
  outline: none;
}

/* Falsche Eingabe */
.gap-input.wrong {
  background-color: #fdf1f1;
  border-color: #e09393;
  color: #a22;
}

/* Richtige Lösung – einheitlich mit .correct */
.correct,
.gap-input.correct {
  background-color: #e3f6df;
  border-color: #6fbf52;
  color: #24622b;
  border-radius: 6px;
  padding: 6px 10px;
  min-width: 80px;
  text-align: center;
  display: inline-block;
  box-sizing: border-box;
}

/* Einheitlicher Stil für falsch */
.wrong {
  background-color: #fce6e6;
  border-color: #e09393;
  color: #a22;
  border-radius: 6px;
  padding: 6px 10px;
  min-width: 80px;
  text-align: center;
  display: inline-block;
  box-sizing: border-box;
}



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 {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
  gap: clamp(8px, 5vw, 30px);
  }

  .clara-img {
    width: 60px;
    max-height: 120px;
    margin-left: -10px; /* weiter nach links */
  }

  .speech-bubble {
    font-size: 1rem;
    padding: 10px 14px;
    max-width: 85vw;
    margin: 0 auto;
    text-align: center;
  }

  #speakBtn {
    font-size: 1.1rem;
    padding: 10px 16px;
    margin-top: 0.8rem;
    min-width: 44px;
    min-height: 44px;
  }

}



/* 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;
  }
    .gap-input {
    background-color: #2a2a2a;
    border: 2px solid #555;
    color: #f2f2f2;
  }

  .gap-input::placeholder {
    color: #888;
  }

  .gap-input.wrong {
    background-color: #442222;
    border-color: #bb4444;
    color: #fdd;
  }

  .correct {
    background-color: #2e5d2e;
    color: #d4fdd4;
  }

  .wrong {
    background-color: #5a1e1e;
    color: #ffdada;
  }
    .gap {
    border-bottom: 2px dotted #666;
    color: #bbb;
  }

  .gap-input {
    background-color: #2c2c2c;
    color: #eee;
    border: 1px solid #666;
  }

  .gap-input:focus {
    border-color: #58cc02;
  }
  .details-satzbau {
    background-color: #2a2a2a;
    border-color: #444;
    color: #eee;
  }

  .details-satzbau summary i {
    color: #ccc;
  }

  .details-satzbau[open] summary i {
    color: #58cc02;
  }

}
