/* ===== Base ===== */
* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: #ffffff;
  color: #0f172a;
  font-family: ui-sans-serif, system-ui, -apple-system, "SF Pro Display",
    "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* ===== Page centrée ===== */
.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.card {
  width: min(1100px, 96vw);
  background: #fff;
  border: 1px solid #eef2f6;
  border-radius: 22px;
  padding: 22px 24px 18px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.06);
  position: relative; 
}

/* ===== Bouton retour ===== */
.backBtn {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: transparent;
  color: #334155;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.backBtn:hover {
  background: #f8fafc;
}

/* ===== Header ===== */
.header {
  text-align: center;
  padding-top: 34px; 
}

.title {
  margin: 0;
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: #0f172a;
}

.title::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin: 14px auto 0;
  background: #e2e8f0;
  border-radius: 2px;
}

/* ===== Bloc consigne + lien ===== */
.prepBox {
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 16px;
  padding: 12px 14px;
  width: 100%;
  text-align: left;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.03);
}

.prepTitle {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 500;
  color: #60a5fa;
}

.prepText {
  margin: 0;
  font-size: 14px;
  color: #334155;
  line-height: 1.45;
}

.prepActions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Bouton "Lire la page" */
.linkBtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 9px 14px;
  border-radius: 999px;

  background: rgba(59, 130, 246, 0.06);        
  border: 1px solid rgba(59, 130, 246, 0.35);  
  color: #2563eb;

  font-weight: 600;
  font-size: 14px;
  text-decoration: none;

  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

/* Pictogramme */
.linkBtn::before {
  font-size: 16px;
  line-height: 1;
  opacity: 0.95;
}

.linkBtn:hover {
  background: linear-gradient(
    180deg,
    rgba(59, 130, 246, 0.10),
    rgba(59, 130, 246, 0.05)
  );
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.10);
  transform: translateY(-1px);
}

.linkBtn:active {
  transform: translateY(0px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

/* ===== Feedback ===== */
.feedbackRow {
  margin-top: 12px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.feedback {
  padding: 10px 14px;
  border-radius: 14px; 
  font-weight: 700;
  font-size: 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  width: 100%;
  text-align: center;
}

.feedback.good {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
  color: #166534;
}

.feedback.bad {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #991b1b;
}

.feedback.neutral {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.10);
  color: #334155;
}

.divider {
  height: 1px;
  background: #eef2f6;
  margin: 18px 0;
}

/* ===== Objets ===== */
.itemsGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  justify-items: center;
}

.itemCard {
  width: 190px;
  height: 112px;
  border-radius: 18px;
  border: 1px solid #e6edf5;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  display: grid;
  place-items: center;
  cursor: grab;
  user-select: none;
}

.itemCard img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  display: block;
}

.itemCard.is-dragging { cursor: grabbing; }
.ui-draggable-dragging { z-index: 9999 !important; }

/* Bordure feedback */
.itemCard.is-correct {
  border: 2px solid #22c55e !important;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.itemCard.is-wrong {
  border: 2px solid #ef4444 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}

/* ===== Poubelles ===== */
.binsSection { padding-bottom: 2px; }

.binsGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  justify-items: center;
  align-items: end;
}

.bin {
  width: 230px;
  height: 270px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 20px;
}

.bin img {
  width: 220px;
  height: 270px;
  object-fit: contain;
  display: block;
}

/* Zone de drop */
.binDropZone {
  position: absolute;
  width: 160px;
  height: 120px;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Hover poubelle */
.bin.is-over {
  outline: 3px dashed rgba(0, 0, 0, 0.10);
  outline-offset: 7px;
  border-radius: 18px;
}

/* ===== Animation ===== */
.fallClone {
  position: fixed;
  z-index: 99999;
  width: 84px;
  height: 84px;
  pointer-events: none;
  transition: transform 420ms ease, opacity 420ms ease;
  will-change: transform, opacity;
}

/* ===== Bouton reset ===== */
.resetBtn {
  display: block;
  margin: 14px auto 0;
  padding: 10px 18px;

  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: transparent;

  color: #0f172a;
  font-weight: 800;
  cursor: pointer;
}

.resetBtn:hover { background: #f8fafc; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .itemsGrid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  .itemsGrid { grid-template-columns: repeat(3, 1fr); }
  .binsGrid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  .header { padding-top: 52px; }
  .backBtn { top: 14px; left: 14px; }
}
