﻿/* games/timeline_order/timeline_order.css */

:root {
  --to-anim-fast: 140ms;
  --to-anim-base: 220ms;
  --to-anim-slow: 420ms;
}

.to-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  color: #1c2342;
  padding-bottom: 20px;
}

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

.to-card--compact-five {
  gap: 7px;
}

/* Meta-Zeile: Thema + FragezÃ¤hler */
.to-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #6b6f76;
}

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

.to-counter {
  opacity: 0.8;
}

/* Prompt / Einleitung */
.to-prompt {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  color: #1c2342;
  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);
}

.to-card--compact-five .to-prompt {
  margin-top: 10px;
  padding: 11px 10px;
  line-height: 1.3;
}

/* Timeline-Bereich (Slots) */
.to-line-wrapper {
  position: relative;
  margin-top: 6px;
  padding: 12px 10px 12px 0;
}

.to-card--compact-five .to-line-wrapper {
  margin-top: 1px;
  padding: 6px 6px 6px 0;
}

.to-line-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888c99;
  margin: 0 0 10px 12px;
}

.to-card--compact-five .to-line-label {
  margin: 0 0 6px 10px;
  font-size: 0.75rem;
}

.to-line {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  padding-left: 34px;
}

.to-card--compact-five .to-line {
  gap: 6px;
  padding-left: 30px;
}

.to-line::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(232, 189, 79, 0.95), rgba(140, 90, 34, 0.35));
}

/* Einzelner Slot */
.to-slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8f8fc 0%, #f1f2f8 100%);
  border: 1px solid rgba(28, 35, 66, 0.08);
  min-height: 42px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.to-slot--hidden {
  display: none;
}

.to-slot--reveal {
  animation: to-slot-reveal var(--to-anim-base) ease-out;
}

.to-card--compact-five .to-slot {
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 13px;
}

/* Slot-Index (1, 2, 3, â€¦) */
.to-slot-index {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #1c2342;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(28, 35, 66, 0.18);
  position: absolute;
  left: -32px;
  top: 50%;
  transform: translateY(-50%);
}

/* Slot-Text (wenn belegt) */
.to-slot-text {
  flex: 1;
  font-size: 0.92rem;
  line-height: 1.35;
  color: #1c2342;
  padding-right: 34px;
}

/* Placeholder-Text, wenn leer */
.to-slot-placeholder {
  flex: 1;
  font-size: 0.88rem;
  color: #9ca0b0;
  padding-right: 34px;
}

.to-card--compact-five .to-slot-text,
.to-card--compact-five .to-slot-placeholder {
  font-size: 0.82rem;
  line-height: 1.25;
  padding-right: 28px;
}

.to-slot-result {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.to-card--compact-five .to-slot-result {
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  right: 7px;
}

/* Slot ist belegt */
.to-slot--filled {
  border-style: solid;
  border-color: #d0d3e4;
  background: #ffffff;
}

/* Slot wird beim FÃ¼llen kurz gepulst */
.to-slot--pop {
  animation: to-slot-pop var(--to-anim-base) ease-out;
}

/* Slot richtig/falsch nach Auswertung */
.to-slot--correct {
  border-color: #2e7d32;
  background: #e8f5e9;
}

.to-slot--correct .to-slot-result {
  background: linear-gradient(180deg, #f7d97b 0%, #d8a32f 100%);
  color: #54380a;
}

.to-slot--wrong {
  border-color: #c62828;
  background: #ffebee;
}

.to-slot--wrong .to-slot-result {
  background: linear-gradient(180deg, #ff998f 0%, #db4437 100%);
  color: #ffffff;
}

.to-slot--check-pop {
  animation: to-slot-check-pop var(--to-anim-base) ease-out;
}

/* Pool-Bereich */
.to-pool-wrapper {
  margin-top: 5px;
}

.to-card--compact-five .to-pool-wrapper {
  margin-top: 12px;
}

.to-card--two-col-pool .to-pool-wrapper {
  padding-bottom: 8px;
}

.to-pool-label {
  font-size: 0.84rem;
  color: #6b6f76;
  margin-bottom: 20px;
}

.to-card--compact-five .to-pool-label {
  font-size: 0.76rem;
  margin-bottom: 16px;
}

.to-pool {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  
}

.to-card--compact-five .to-pool {
  gap: 7px;
}

.to-card--two-col-pool .to-pool {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-bottom: 8px;
}

.to-pool-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.to-card--compact-five .to-pool-col {
  gap: 7px;
}

/* Schrittkarten unten */
.to-step-chip {
  position: relative;
  width: 100%;
  text-align: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #d6c89a;
  background: linear-gradient(180deg, #fffaf3 0%, #f3e6cb 100%);
  font-size: var(--to-step-chip-font-size, 0.95rem);
  line-height: 1.35;
  color: #1c2342;
  cursor: pointer;
  max-height: 140px;
  overflow: hidden;
  transition:
    background var(--to-anim-fast) ease,
    border-color var(--to-anim-fast) ease,
    transform var(--to-anim-fast) ease,
    box-shadow var(--to-anim-fast) ease,
    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;
}

.to-pool {
  overflow: clip;
}

.to-step-chip--picked-anim {
  cursor: default;
  pointer-events: none;
  animation: to-step-chip-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;
}

.to-step-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Zustand: ausgewÃ¤hlt (verschwindet aus Pool) */
.to-step-chip--picked {
  display: none;
  pointer-events: none;
}

.to-card--compact-five .to-step-chip {
  font-size: var(--to-step-chip-font-size, 0.82rem);
  line-height: 1.25;
  padding: 8px 9px;
  border-radius: 11px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Karte bekommt State-Klassen */
.to-card--correct {
  animation: to-card-correct var(--to-anim-slow) ease-out;
}

.to-card--wrong {
  animation: to-card-wrong var(--to-anim-base) ease-out;
}

/* Confetti */
.to-confetti-piece {
  position: absolute;
  width: 5px;
  height: 9px;
  border-radius: 2px;
  opacity: 0;
  animation: to-confetti calc(var(--to-anim-slow) * 1.7) ease-out forwards;
}

.to-chip-ghost {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  text-align: center;
  border-radius: 12px;
  border: 1px solid #d6c89a;
  background: linear-gradient(180deg, #fffaf3 0%, #f3e6cb 100%);
  color: #1c2342;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  transition:
    left var(--to-anim-slow) ease,
    top var(--to-anim-slow) ease,
    width var(--to-anim-slow) ease,
    height var(--to-anim-slow) ease,
    transform var(--to-anim-slow) ease,
    opacity var(--to-anim-slow) ease;
  overflow: hidden;
}

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

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

@keyframes to-slot-pop {
  0% {
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes to-card-correct {
  0% {
    transform: scale(0.98);
  }
  45% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes to-card-wrong {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  50% {
    transform: translateX(3px);
  }
  75% {
    transform: translateX(-2px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes to-slot-check-pop {
  0% {
    transform: scale(0.98);
  }
  55% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes to-slot-reveal {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes to-confetti {
  0% {
    opacity: 0;
    transform: translateY(0) scale(1);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(34px) translateX(8px) rotate(25deg) scale(0.9);
  }
}

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

@media (max-width: 600px) {
  .to-card {
    gap: 8px;
    padding-bottom: 20px;
  }

  .to-meta-row {
    font-size: 0.9rem;
  }

  .to-prompt {
    font-size: 1rem;
    padding: 14px 12px;
  }

  .to-line-label,
  .to-pool-label {
    font-size: 0.82rem;
  }

  .to-slot {
    min-height: 38px;
    padding: 7px 8px;
  }

  .to-slot-index {
    width: 24px;
    height: 24px;
    left: -28px;
    font-size: 0.78rem;
  }

  .to-slot-text {
    font-size: 0.9rem;
    padding-right: 30px;
  }

  .to-slot-placeholder {
    padding-right: 30px;
  }

  .to-slot-result {
    right: 8px;
    width: 20px;
    height: 20px;
    font-size: 0.76rem;
  }

  .to-step-chip {
    font-size: var(--to-step-chip-font-size, 0.9rem);
    padding: 10px 12px;
  }

  .to-card--compact-five .to-prompt {
    font-size: 0.94rem;
    padding: 10px 9px;
  }

  .to-card--two-col-pool .to-pool {
    gap: 6px;
    padding-bottom: 8px;
  }

  .to-pool-col {
    gap: 6px;
  }

  .to-card--compact-five .to-step-chip {
    font-size: var(--to-step-chip-font-size, 0.78rem);
    padding: 7px 8px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .to-step-chip,
  .to-slot,
  .to-slot-result,
  .to-card,
  .to-confetti-piece {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .to-step-chip--picked-anim {
    transform: none;
    opacity: 0.15;
  }

  .to-card--correct,
  .to-card--wrong,
  .to-slot--pop,
  .to-slot--check-pop,
  .to-slot--reveal {
    animation: none !important;
  }
}




