﻿/* games/category_sort/category_sort.css */

.cs-card {
  --cs-item-font-size: 15px;
  --cs-item-height: clamp(56px, 7.6vh, 70px);
  --cs-layout-gap: 10px;
  --cs-pool-gap: 8px;

  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  color: #1c2342;
  padding-bottom: 96px; /* gleiche Unterkante wie Standard */
}

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

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

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

.cs-counter {
  opacity: 0.8;
}

/* Aufgaben-Text */
.cs-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);
}

/* Layout: oben Kategorien (Buckets), darunter Pool-Begriffe */
.cs-layout {
  display: flex;
  flex-direction: column;
  gap: var(--cs-layout-gap);
  margin-top: 6px;
}

.cs-card--compact .cs-layout {
  gap: 9px;
}

/* Pool-Bereich */
.cs-pool {
  display: flex;
  flex-direction: column;
  gap: var(--cs-pool-gap);
  padding-bottom: 2px;
}

.cs-pool-title {
  font-size: 1rem; /* vorher 0.8rem */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888c99;
}

.cs-pool-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cs-pool-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-card--compact .cs-pool-col {
  gap: 6px;
}

/* Begriffe unten als klare Karten */
.cs-item {
  width: 100%;
  min-height: var(--cs-item-height);
  height: var(--cs-item-height);
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #d6d8e0;
  background: linear-gradient(180deg, #fffaf3 0%, #f3e6cb 100%);
  color: #1c2342;
  font-size: var(--cs-item-font-size);
  line-height: 1.35;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.16s ease,
    transform 0.06s ease,
    opacity 0.15s ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  max-height: 160px;
  overflow: hidden;
}

.cs-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* ausgewÃ¤hlter Chip */
.cs-item--selected {
  border-color: #1c2342;
  background: #ecefff;
  box-shadow: 0 3px 10px rgba(28, 35, 66, 0.18);
}

/* Chip bereits zugeordnet */
.cs-item--assigned {
  cursor: default;
  opacity: 0.5;
  transform: scale(0.96);
  box-shadow: none;
}

/* Gummizug: kurz aufblasen, dann wegschnappen — Nachbarkarten gleiten sanft nach */
@keyframes cs-item-gummizug-out {
  0%   { transform: scale(1);    opacity: 1; }
  20%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(0);    opacity: 0; }
}

.cs-item--picked-anim {
  animation: cs-item-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;
}

.cs-item--picked {
  display: none;
  pointer-events: none;
}

/* falscher Versuch */
.cs-item--wrong {
  animation: cs-item-shake 0.26s ease-out;
  border-color: #c62828;
  background: #ffebee;
}

/* Buckets-Bereich (Kategorien oberhalb im Raster) */
.cs-buckets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cs-buckets-title {
  font-size: 0.9rem; /* vorher 0.8rem */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888c99;
}

/* Raster fÃ¼r die Kategorie-Boxen: 2 Spalten */
.cs-buckets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Jede Kategorie-Box */
.cs-bucket {
  border-radius: 16px;
  border: 1px solid rgba(46, 125, 80, 0.18);
  background: linear-gradient(180deg, #f2f9f5 0%, #e4f2eb 100%);
  padding: 10px 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.18s ease,
    transform 0.06s ease;
  cursor: pointer;
}

.cs-bucket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.cs-bucket-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1c2342;
}

.cs-bucket-count {
  font-size: 0.76rem;
  color: #6b6f76;
}

.cs-bucket-body {
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
}

/* Kleiner Hinweistext, wenn noch leer */
.cs-bucket-placeholder {
  font-size: 0.78rem;
  line-height: 1.35;
  color: #a0a4b5;
}

/* Bucket aktiv, wenn Chip ausgewÃ¤hlt */
.cs-bucket--active {
  border-color: #e8bd4f;
  background: linear-gradient(180deg, #fffaf0 0%, #fff4dc 100%);
  box-shadow: 0 6px 18px rgba(232, 189, 79, 0.18);
}

/* Bucket hat Inhalte */
.cs-bucket--filled {
  background: linear-gradient(180deg, #f8fcfa 0%, #edf7f2 100%);
}

/* korrekte Zuordnung */
.cs-bucket--correct {
  border-color: #2e7d32;
  background: #e8f5e9;
  animation: cs-bucket-pop 0.3s ease-out;
}

/* falsche Zuordnung */
.cs-bucket--wrong {
  border-color: #c62828;
  background: #ffebee;
  animation: cs-bucket-shake 0.3s ease-out;
}

/* Finaler Chip im Bucket */
.cs-bucket-chip {
  padding: 6px 9px;
  border-radius: 999px;
  background: #f0f2ff;
  font-size: 0.78rem;
  border: 1px solid #cdd0de;
}

/* Ghost-Chip, der von Pool â†’ Bucket fliegt */
.cs-chip-ghost {
  position: absolute;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d6d8e0;
  background: #ffffff;
  font-size: 0.7rem; /* vorher 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.18);
  z-index: 2;
}

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

@keyframes cs-item-shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

@keyframes cs-bucket-pop {
  0% { transform: scale(0.97); }
  40% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes cs-bucket-shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

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

@media (max-width: 800px) {
  .cs-buckets-grid {
    grid-template-columns: 1fr; /* Kategorien untereinander auf kleineren Screens */
  }

  .cs-pool-items {
    grid-template-columns: 1fr;
  }

  .cs-pool-col {
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .cs-card {
    --cs-item-height: clamp(52px, 7vh, 64px);
    --cs-item-font-size: 14px;
    gap: 8px;
    padding-bottom: 100px;
  }

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

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

  .cs-item {
    font-size: var(--cs-item-font-size);
    min-height: var(--cs-item-height);
    height: var(--cs-item-height);
  }

  .cs-pool {
    padding-bottom: 2px;
  }

  .cs-bucket-name {
    font-size: 0.9rem;
  }

  .cs-bucket-count {
    font-size: 0.74rem;
  }

  .cs-bucket-chip {
    font-size: 0.75rem;
  }
}




