/* games/gap_fill/gap_fill.css */

.gf-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.gf-card--auto-advance .game-footer-row {
  display: none;
}

/* Meta-Infos oben */
.gf-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: #6b6f76;
}

.gf-topic {
  font-weight: 600;
}

.gf-counter {
  opacity: 0.7;
}

/* Question-Box: Satz + Hint */
.gf-question {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  background: linear-gradient(135deg, #f7f7fb, #eef0f7);
  border: 1px solid rgba(28, 35, 66, 0.08);
  border-radius: 16px;
  padding: 16px;
  margin-top: 24px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* Satz + Lücke */
.gf-sentence {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1c2342;
  line-height: 1.8;
  text-align: center;
}

.gf-text-before,
.gf-text-after {
  white-space: pre-wrap;
}

.gf-gap {
  display: inline-block;
  min-width: 60px;
  padding: 0 4px;
  border-bottom: 2px solid #1c2342;
  text-align: center;
  color: #1c2342;
  font-weight: 700;
}

/* Hinweis innerhalb der Question-Box */
.gf-hint {
  font-size: 0.82rem;
  color: rgba(28, 35, 66, 0.45);
  font-style: italic;
  border-top: 1px solid rgba(28, 35, 66, 0.07);
  padding-top: 6px;
}

/* Antwort-Optionen */
.gf-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.gf-option {
  width: 100%;
  text-align: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #d6d8e0;
  background: #f7f7fb;
  color: #1c2342;
  font-size: 0.95rem;
  line-height: 1.35;
  cursor: pointer;
  margin: 0;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.06s ease;
}

.gf-option:hover:not(.gf-option--disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* Hover-Transform auf Touch deaktivieren */
@media (hover: none) {
  .gf-option:hover:not(.gf-option--disabled) {
    transform: none;
    box-shadow: none;
  }
}

/* gewählte Option */
.gf-option--selected {
  border-color: #1c2342;
  background: #ecefff;
  box-shadow: 0 3px 10px rgba(28, 35, 66, 0.18);
}

/* Zustände nach Auswahl */
.gf-option--disabled {
  cursor: default;
}

.gf-option--correct {
  border-color: #2e7d32;
  background: #e8f5e9;
}

.gf-option--wrong {
  border-color: #c62828;
  background: #ffebee;
}

/* Ghost-Chip, der zur Lücke fliegt */
.gf-chip-ghost {
  position: absolute;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d6d8e0;
  background: #f7f7fb;
  font-size: 0.9rem;
  pointer-events: none;
  white-space: nowrap;
  transition:
    left 0.35s ease,
    top 0.35s ease,
    transform 0.35s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

/* Gap-States */
.gf-gap--filled {
  border-bottom-width: 2px;
}

.gf-gap--correct {
  color: #2e7d32;
  border-color: #2e7d32;
  animation: gf-gap-pop 0.35s ease-out;
  position: relative;
}

.gf-gap--correct::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(232, 189, 79, 0.9), transparent 60%);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  animation: gf-gap-firework 0.6s ease-out forwards;
}

.gf-gap--wrong {
  color: #c62828;
  border-color: #c62828;
  animation: gf-gap-blink 0.4s ease-out 0s 2;
}

/* ======================================
   ANIMATIONEN Gap-Fill
   ====================================== */

@keyframes gf-gap-pop {
  0%   { transform: scale(0.9); }
  40%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes gf-gap-firework {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0); }
  60%  { opacity: 0.9; transform: translate(-50%, -50%) scale(1.6); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.0); }
}

@keyframes gf-gap-blink {
  0%   { background: transparent; }
  50%  { background: rgba(198, 40, 40, 0.12); }
  100% { background: transparent; }
}

/* ======================================
   MOBILE-FEINTUNING
   ====================================== */

@media (max-width: 600px) {
  .gf-card {
    gap: 8px;
    padding-top: 28px;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 44px);
    min-height: 100%;
  }

  .gf-meta-row {
    font-size: 0.85rem;
  }

  .gf-question {
    padding: 14px 12px;
    margin-top: 20px;
  }

  .gf-sentence {
    font-size: 1rem;
    line-height: 1.6;
  }

  .gf-gap {
    min-width: 46px;
  }

  .gf-options {
    gap: 14px;
    margin-top: auto;
  }

  .gf-option {
    font-size: 17px;
    padding: 14px 12px;
  }

  .gf-card .game-footer-row {
    margin-top: 0;
    padding-bottom: 0;
  }

  .gf-card .game-feedback {
    min-height: 0;
    margin-bottom: 0;
  }
}
