/* games/match_pairs/match_pairs.css */

/* Spielkarte */
.mp-card {
  --mp-option-font-size: 17px;
  --mp-option-card-height: clamp(64px, 8.2vh, 80px);
  --mp-options-gap: 10px;
  --mp-question-options-gap: clamp(14px, 4vh, 38px);

  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 20px 96px;
  border-radius: 24px;
  background: radial-gradient(circle at top left, #f6f7ff 0, #eef0ff 38%, #ffffff 100%);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.16);
  color: #1c2342;
  overflow: hidden;
}

/* dezentes Schimmer-Overlay */
.mp-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(232, 189, 79, 0.15), transparent 55%);
  opacity: 0.7;
  pointer-events: none;
}

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

.mp-topic {
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.mp-counter {
  opacity: 0.8;
}

/* ==============================
   Question-Box: echte Frage
   ============================== */

.mp-question {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  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: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.mp-question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1c2342;
  line-height: 1.4;
}

.mp-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;
}

/* ==============================
   Begriff-Karte (fliegt ein/aus)
   ============================== */

.mp-term-section {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
}

.mp-term-progress {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(28, 35, 66, 0.4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Dunkle Begriff-Karte */
.mp-term-box {
  width: 100%;
  text-align: center;
  padding: 18px 20px;
  border-radius: 16px;
  background: radial-gradient(circle at top left, #f8d895 0, #e9bf72 45%, #d09a49 100%);
  color: #2a1f10;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  border: 1px solid rgba(105, 73, 22, 0.28);
  box-shadow:
    0 8px 24px rgba(94, 62, 17, 0.28),
    inset 0 1px 0 rgba(255, 245, 220, 0.42);
}

/* Golddot oben rechts */
.mp-term-box::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #7a4f1a;
  opacity: 0.8;
}

/* Fly-in: von unten mit Bounce */
.mp-term-box--in {
  animation: mp-term-fly-in 0.55s cubic-bezier(0.34, 1.45, 0.64, 1) forwards;
}

/* Fly-out: nach oben mit kurzem Rückzieher */
.mp-term-box--out {
  animation: mp-term-fly-out 0.32s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes mp-term-fly-in {
  0%   { opacity: 0; transform: translateY(52px) scale(0.86) rotate(-2deg); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
}

@keyframes mp-term-fly-out {
  0%   { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
  25%  { transform: translateY(5px) scale(1.03) rotate(0.5deg); }
  100% { opacity: 0; transform: translateY(-36px) scale(0.88) rotate(1.5deg); }
}

/* ==============================
   Options (Matching-Phase)
   ============================== */

.mp-options-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--mp-options-gap);
  margin-top: auto;
  padding-top: var(--mp-question-options-gap);
}

.mp-option {
  width: 100%;
  min-height: var(--mp-option-card-height);
  height: var(--mp-option-card-height);
  max-height: 120px;
  overflow: hidden;
  text-align: center;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(170, 122, 51, 0.42);
  background: linear-gradient(180deg, #fffaf3 0%, #f3e6cb 100%);
  color: #1c2342;
  font-size: var(--mp-option-font-size);
  line-height: 1.4;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.06s ease;
  box-shadow: 0 3px 10px rgba(232, 189, 79, 0.2);
}

.mp-option:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(232, 189, 79, 0.35);
}

.mp-option:active:not(:disabled) {
  transform: translateY(0);
}

.mp-option--used {
  cursor: default;
  pointer-events: none;
  animation: mp-option-gummizug-out 0.45s cubic-bezier(0.4, 0, 0.8, 1) forwards;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-width: 0;
  transition:
    max-height    0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.3s,
    padding       0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.3s,
    margin        0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.3s,
    border-width  0.5s ease 0.3s;
}

@keyframes mp-option-gummizug-out {
  0%   { transform: scale(1);    opacity: 1; }
  20%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(0);    opacity: 0; }
}

@media (hover: none) {
  .mp-option:hover:not(:disabled) {
    transform: none;
    box-shadow: 0 3px 10px rgba(232, 189, 79, 0.2);
  }
}

/* ==============================
   Review-Phase: Step-by-Step
   ============================== */

.mp-review-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding-top: 12px;
}

/* Score-Punkte: ein Kreis pro Paar, grün/rot */
.mp-score-dots {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-bottom: 18px;
}

.mp-score-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  animation: mp-dot-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.mp-score-dot--correct { background: #2e7d32; }
.mp-score-dot--wrong   { background: #c62828; }

@keyframes mp-dot-pop {
  to { opacity: 1; transform: scale(1); }
}

/* Einzelne Zeile — keine Box, keine Hintergrundfarbe */
.mp-review-pair {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px 2px;
  border-bottom: 1px dashed rgba(28, 35, 66, 0.13);
  opacity: 0;
  animation: mp-review-pair-in 0.45s ease-out forwards;
  animation-delay: var(--delay, 0s);
}

.mp-review-pair:last-child {
  border-bottom: none;
}

/* Label-Zeile: Icon + Term als kleines Label */
.mp-review-row-label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mp-review-icon {
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  animation: mp-icon-stamp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(var(--delay, 0s) + 0.25s);
}

.mp-review-pair--correct .mp-review-icon { color: #2e7d32; }
.mp-review-pair--wrong  .mp-review-icon { color: #c62828; }

.mp-review-term {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.mp-review-pair--correct .mp-review-term { color: #2e7d32; }
.mp-review-pair--wrong  .mp-review-term { color: #c62828; }

/* Antworttext — eingerückt, wirkt als Inhalt unter dem Label */
.mp-review-chosen {
  font-size: 0.93rem;
  font-weight: 500;
  color: #1c2342;
  line-height: 1.4;
  padding-left: 16px;
}

.mp-review-pair--wrong .mp-review-chosen {
  text-decoration: line-through;
  color: rgba(28, 35, 66, 0.35);
}

/* Richtige Antwort bei Fehlern */
.mp-review-correct-hint {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2e7d32;
  line-height: 1.4;
  padding-left: 16px;
}

/* ==============================
   Animationen
   ============================== */

@keyframes mp-review-pair-in {
  0%   { opacity: 0; transform: translateY(22px) scale(0.92); }
  60%  { opacity: 1; transform: translateY(-4px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes mp-icon-stamp {
  0%   { opacity: 0; transform: scale(0.1) rotate(-30deg); }
  50%  { opacity: 1; transform: scale(1.55) rotate(8deg); }
  72%  { transform: scale(0.88) rotate(-4deg); }
  88%  { transform: scale(1.1) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ==============================
   Mobile Feintuning
   ============================== */

@media (max-width: 600px) {
  .mp-card {
    gap: 8px;
    --mp-option-card-height: clamp(58px, 7.8vh, 72px);
    padding: 28px 14px 100px;
    border-radius: 18px;
  }

  /* Matching-Phase: Vollbild, Buttons unten */
  .mp-card--matching {
    min-height: 100%;
  }

  .mp-card--matching .mp-options-wrap {
    margin-top: auto;
  }

  /* Footer in beiden Phasen klein halten */
  .mp-card .game-footer-row {
    margin-top: 0;
    padding-bottom: 0;
  }

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

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

  .mp-question {
    margin-top: 10px;
    padding: 12px;
  }

  .mp-question-text {
    font-size: 0.95rem;
  }

  .mp-term-box {
    font-size: 1rem;
    padding: 16px 16px;
  }

  .mp-options-wrap {
    gap: var(--mp-options-gap);
  }

  .mp-option {
    font-size: var(--mp-option-font-size);
    padding: 14px 12px;
  }

  .mp-review-wrap {
    padding-top: 8px;
  }

  .mp-score-dots {
    margin-bottom: 14px;
  }

  .mp-review-pair {
    padding: 10px 2px;
  }

  .mp-review-chosen {
    font-size: 0.88rem;
  }

  .mp-review-correct-hint {
    font-size: 0.86rem;
  }
}

/* ==============================
   Review-Footer-Button
   ============================== */

.mp-footer-row {
  --gm-dock-height: 84px;
  --gm-dock-bg: #1c2342;
}

.mp-next-btn {
  font-size: 1.04rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0 20px 3px;
  font-variant-numeric: tabular-nums;
}
