/* ================= BASE & CONTAINER ================= */
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  margin: 0;
  padding: 40px 20px;
  min-height: 100vh;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

h1 { 
  text-align: center; 
  margin-bottom: 24px; 
  color: #a5b4fc; 
  font-size: 1.6rem; 
}

/* ================= ŻYCIA (SERCA) ================= */
#hearts-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 2rem;
  margin-bottom: 24px;
}

.heart {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-block;
}

.heart.lost {
  opacity: 0.15;
  filter: grayscale(1);
  transform: scale(0.8);
}

/* Animacja serca przy stracie życia */
@keyframes heart-beat {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); color: #ef4444; }
  100% { transform: scale(1); }
}
.heart-anim { animation: heart-beat 0.4s ease-out; }

/* ================= LIST & ITEMS ================= */
.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  /* Strefa dropu na samym dole */
  padding-bottom: 80px; 
}

.item {
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 12px;
  padding: 16px 18px;
  cursor: grab;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0.2, 1), background-color 0.2s, border-color 0.2s;
  position: relative;
  z-index: 10;
}

.item * { pointer-events: none; }

.item.dragging {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  pointer-events: none;
}

/* ================= SPECJALNE STANY ================= */

.item.locked {
  background: #064e3b;
  border-color: #10b981;
  color: #d1fae5;
  cursor: default;
  transform: none !important; 
  z-index: 5;
}

/* Czerwony puls dla błędnych kafelków przy sprawdzeniu */
.item.error-pulse {
  border-color: #ef4444 !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.item.shift-down {
  transform: translateY(64px);
}

.item.drag-over-swap {
  background-color: #334155 !important;
  border-color: #a5b4fc !important;
  transform: scale(1.03);
  z-index: 20;
}

#insertion-line {
  position: absolute;
  left: 0; right: 0; height: 4px;
  background: #6366f1;
  box-shadow: 0 0 12px #6366f1;
  border-radius: 2px;
  display: none;
  pointer-events: none;
  z-index: 100;
  transition: top 0.15s ease-out;
}

/* ================= WYNIKI KOŃCOWE ================= */
.item.correct-final { 
  background: #059669; 
  color: #ecfdf5; 
  border-color: #10b981;
}

.item.wrong-final { 
  background: #b91c1c; 
  color: #fef2f2; 
  border-color: #ef4444;
}

.value { 
  font-weight: 600; 
  color: #94a3b8; 
  margin-left: 10px; 
}

/* ================= UI ELEMENTS ================= */
button {
  display: block;
  margin: 0 auto;
  padding: 14px 40px;
  background: #22c55e;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.2s, background 0.2s;
}

button:hover:not(:disabled) {
  background: #16a34a;
  transform: translateY(-2px);
}

button:disabled { 
  background: #475569; 
  cursor: not-allowed; 
}

.result { 
  text-align: center; 
  margin: 20px 0; 
  font-weight: 600; 
  min-height: 1.2em; 
}

/* ================= MODAL ================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden { display: none; }

.modal-content {
  background: #1e293b;
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  max-width: 400px;
}

/* ================= ARCHIVE ================= */
#archive {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

#archive li { margin-bottom: 8px; }

#archive a {
  color: #93c5fd;
  text-decoration: none;
  cursor: pointer; 
  font-size: 0.95rem;
}

#archive a:hover { 
  text-decoration: underline; 
  color: #a5b4fc; 
}

#archive a.active-quiz {
  font-weight: bold;
  color: #ffffff;
  cursor: default;
}

/* ================= ANIMATIONS ================= */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

.shake-anim { animation: shake 0.4s ease-in-out; }



/* ... (reszta Twojego CSS bez zmian) ... */

/* ================= STATYSTYKI ================= */
.stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px; /* Odstęp między sercami a streakiem */
  margin-bottom: 24px;
}

#hearts-container {
  display: flex;
  gap: 12px;
  font-size: 2rem;
}

#streak-container {
  font-size: 1.4rem;
  font-weight: bold;
  color: #fbbf24; /* Złoty kolor płomienia */
  background: rgba(251, 191, 36, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Animacja przyrostu streaka */
.streak-bounce {
  animation: bounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* ... (pozostałe style, animacje shake itp.) ... */